<TABLE width=500>
( d! K& ^9 @1 e& d4 k3 M5 w- x, s<TBODY>
! n7 B2 ?3 W1 o! D4 s8 e% ?<TR>9 q' a6 E. @5 r7 d, w
<TD><PRE>Method 01
0 [/ u1 B6 l* I4 }7 }% C0 @% r=========
# S5 K/ [7 r3 d: a. l+ U. X4 v7 z& c* r" w
This method of detection of SoftICE (as well as the following one) is
; R1 z1 }2 c! {) S# V1 pused by the majority of packers/encryptors found on Internet.
! A) i \1 V DIt seeks the signature of BoundsChecker in SoftICE
3 q' P8 n, |% _
2 m7 [, g( I; j3 D/ E( L2 j mov ebp, 04243484Bh ; 'BCHK'
; B9 W) Q7 g; {' d mov ax, 04h
9 y- N& o/ z4 V; J3 ^" u+ n, U; S int 3
5 v4 M3 d% U2 s' s1 c cmp al,4
2 u4 S% g" t: |9 M r+ ]0 O$ A2 u jnz SoftICE_Detected- v$ b }; R8 Z- O5 v
* Z- i6 |& m t" X* X0 R0 T___________________________________________________________________________5 X0 C3 Z* v7 _% y6 {; \7 A
# E- J5 P( o6 ^! x' F* JMethod 02: I* B7 ?) B0 q0 P# W
=========
+ r0 J$ T2 V' S3 h' b. \1 `
. q* a2 S- H/ o+ |Still a method very much used (perhaps the most frequent one). It is used9 y6 X$ f: J, D- o" n: }
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,: \: o% |2 M1 t$ `
or execute SoftICE commands...
/ T, J! X/ S. |# FIt is also used to crash SoftICE and to force it to execute any commands
3 T4 J+ D% w O" D3 E(HBOOT...) :-(( , ^! L. l+ X. k5 \& T' i7 k
. G) g0 w- ?6 B- P+ |
Here is a quick description:
! F9 z2 I( ~; n0 D& q& W; \/ `-AX = 0910h (Display string in SIce windows)
/ a+ [+ D$ D0 f& R6 e: E-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
" { R. J6 c6 K! ?4 r' n-AX = 0912h (Get breakpoint infos)2 f9 M4 C7 H+ P6 m6 `% [* L: W
-AX = 0913h (Set Sice breakpoints)
( N9 O" H$ I8 u5 E5 v) k* y-AX = 0914h (Remove SIce breakoints)
$ D# D9 S8 K$ R( \# P4 d& j9 r1 K+ h" ?1 } L+ y2 A( j7 ?
Each time you'll meet this trick, you'll see:+ j3 Q' p5 n" s. f, y
-SI = 4647h
% S; i$ g6 V7 r" f0 I-DI = 4A4Dh
' ?) [0 J/ s: W, k( s& MWhich are the 'magic values' used by SoftIce.
8 w( g0 u& ~% `! w- J% sFor more informations, see "Ralf Brown Interrupt list" chapter int 03h., g3 \% G1 ~2 s% t3 L9 T
0 r% Q! b# X+ [/ A
Here is one example from the file "Haspinst.exe" which is the dongle HASP" [, V( h% r- @( M+ U
Envelope utility use to protect DOS applications:
# r; ^1 b: A y
# m. i6 e+ P) \8 @8 D* B8 X3 u1 g( W P G; x4 g& x4 L7 L
4C19:0095 MOV AX,0911 ; execute command., A; X: `7 u& Z4 i2 o
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).$ i" f) H0 x9 g5 k1 o
4C19:009A MOV SI,4647 ; 1st magic value.& N8 K, |+ y% w2 G" Z0 w( N
4C19:009D MOV DI,4A4D ; 2nd magic value.; A8 Q& n0 G# p5 }: V" B. U4 Z
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 y1 F* P1 H% {6 y5 g9 \4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
7 l( j! w! v2 D; {$ B4C19:00A4 INC CX0 P' \% x- T- ~7 v% |
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. R( P- r, A: A; |: q2 J4C19:00A8 JB 0095 ; 6 different commands.0 L9 O2 E; g' e) J3 `
4C19:00AA JMP 0002 ; Bad_Guy jmp back.: W" p# U3 Q! P7 K" p# @6 j) L
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)7 c6 K Y: Y' i/ C' a3 g1 q7 ]2 b
4 _" V# x, T3 E9 H1 f# Q! c5 _The program will execute 6 different SIce commands located at ds:dx, which
6 S5 }% k9 ?. [0 ]& n; rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 r# I: d2 p7 a0 F6 _3 M( ~, E2 y
: `8 f" g$ \+ j8 O" w
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
, K m/ W7 ^% I___________________________________________________________________________
1 A# }( G* ?5 }4 f1 M9 P
$ [( N! N4 }/ U# m/ K: O- V# c, i
/ n+ t, t( Y' k9 t0 o; eMethod 03
% P! `; Y: I J=========$ c/ R) t3 z3 |( a4 h
7 E% z1 i" E& ?2 n9 p1 f6 q8 T( z
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 ~- I( T. J4 U(API Get entry point), A1 s2 n8 r3 V; z" e
! r8 M" m. C2 _. b* L5 J, F
& X) f; i! v! }# P4 Q xor di,di
2 `' p8 b* Q( f3 c6 ?( ]' q1 S mov es,di
4 S* t @" i6 q4 \$ h mov ax, 1684h $ }; L5 ]% L7 L1 j* V+ n, ^' x
mov bx, 0202h ; VxD ID of winice, X A4 z1 s# A" o8 [# [6 ~
int 2Fh6 i. A0 \: K" ^4 k5 J7 A
mov ax, es ; ES:DI -> VxD API entry point
7 K4 h: P" ^( K$ @, o6 c+ K6 V add ax, di
7 G- J! S: U: w3 G4 }7 I r1 Y test ax,ax
8 G, X& {, F0 V$ F7 {* ]8 ], `5 C& @ jnz SoftICE_Detected
$ Y: Y- H" r( V! P6 X# i/ y: k7 c5 m) ?
___________________________________________________________________________8 ]0 O- ]4 c+ j2 t5 U" y' \4 k
0 R- ?- x- ~9 f& y n# F: `7 ~4 ~
Method 045 J# M/ D% h, t" U
=========
# ?; x' p* ^; K& [" u. O) \/ H0 H" k8 q: n/ i$ X1 n* {
Method identical to the preceding one except that it seeks the ID of SoftICE
. d, Z+ H X7 |+ G7 O* C4 e+ p8 kGFX VxD.' J+ t/ }3 J$ Y
+ u/ d5 D2 ?+ W- K xor di,di
$ o |* O0 `# I9 U7 ^ mov es,di. b4 v( @( y0 L1 W; l* J
mov ax, 1684h
# j8 E) I- n3 h9 M, P% W0 ] mov bx, 7a5Fh ; VxD ID of SIWVID" {" [! B, k; L# m) Q
int 2fh6 i. `( v, `( {+ J& ]
mov ax, es ; ES:DI -> VxD API entry point
B- X) m# b3 b" i3 _$ W- l' t add ax, di
/ @- K' [* }) U* i( L test ax,ax
. ]8 v/ x& l0 d* ]+ M0 m4 y jnz SoftICE_Detected$ Q. p! M9 v9 A
* X" y7 C A& ]6 f9 q! u/ i__________________________________________________________________________% d- `! H1 k6 v/ F
& o7 i1 K" U; S& T2 s+ k1 @4 g! o- h: E
Method 05
: u$ W, C+ W; e6 I=========
" O9 A( l# y. N
: T0 D6 {" }3 i2 YMethod seeking the 'magic number' 0F386h returned (in ax) by all system
. [$ C, i& n! b" h; _debugger. It calls the int 41h, function 4Fh.. R/ d- K7 i8 v9 v8 x
There are several alternatives.
\+ y' }1 X3 U+ T# D/ r
: o$ I* H2 x; h' f6 IThe following one is the simplest:
* Y( J# M% t! ~; E/ O* C- s( z8 C" q% j6 ?5 E$ n% f+ r
mov ax,4fh0 K/ g4 c4 b2 ^. W0 \, k
int 41h1 C1 X, w. O6 j$ d0 X1 x
cmp ax, 0F386
9 l4 U8 ~/ d7 {' x" N$ i9 B jz SoftICE_detected
' g6 X V( J3 n2 f! I! E3 w/ Q! q6 F* W& l2 S. A# u6 s
$ @+ y, |% I9 E ]( v9 w: s$ HNext method as well as the following one are 2 examples from Stone's
) ]' n( y/ r9 s6 n- K0 T) |' M6 I"stn-wid.zip" (www.cracking.net):) b( P9 Z& T u E7 X
' z# C; O9 }7 ^# [9 E
mov bx, cs+ _ t1 E- v7 M) i8 B! H( f
lea dx, int41handler2 e% u% T( C6 U, w$ N
xchg dx, es:[41h*4]* x$ q' j6 _! A q% d* V9 {
xchg bx, es:[41h*4+2]
5 _9 p- |8 C7 S% O% k mov ax,4fh6 a0 `3 X! Y4 U1 I; U
int 41h
) ~) z# L) @! I( z# \ xchg dx, es:[41h*4]
1 [/ n; C4 D! I5 ? xchg bx, es:[41h*4+2]
& z) H6 K" a- `/ r cmp ax, 0f386h
' K2 w( V% Q$ O0 e5 D' [ w2 t, S9 {7 z jz SoftICE_detected
! Y' `4 s9 L$ T8 k& d
: \7 ~7 L' ?7 y, `# N( V5 fint41handler2 PROC3 ]3 ]5 a. {8 _1 O1 z
iret6 r! X/ l4 i# M' M* Z
int41handler2 ENDP
- i; G6 M; E+ \0 J
8 `* o; ^, D# B6 j- h/ n& L# Q( B1 W; k' G% U$ W
_________________________________________________________________________" R" f9 @7 T* Z8 g
/ V; X6 I1 k4 `
( a1 p1 O8 l3 C: R
Method 062 X d, t* i1 F) e4 s
=========2 p) m. C8 ^* B6 C0 l' }
7 Y; `- ?6 [4 r8 o- q o( W/ l9 X8 m
8 W& N, b% x4 V4 T6 i0 N# \% h2 n2nd method similar to the preceding one but more difficult to detect:5 }$ k- E9 x9 u/ F/ H! h. e1 @5 [! z/ }
3 |9 E3 M' r+ {- B% D! j
9 c1 d' y( H2 b; A, f" Oint41handler PROC
# {6 Y& g( y& a& H* z5 | mov cl,al/ C$ N4 p3 g- I
iret/ j' N9 R5 S- q
int41handler ENDP
- H A5 X, i+ U8 B2 W
m6 { L1 d0 s3 M$ i0 `$ Z8 l+ p' L
xor ax,ax
- L5 A; F! \) h* p) n mov es,ax
( l# E, H/ N# m) B' A! Z1 v# ^ mov bx, cs
2 D$ {8 z2 j( I$ }6 u9 G lea dx, int41handler0 C0 T, W7 z& ?, Z6 Q
xchg dx, es:[41h*4]9 v3 N! ]! X4 q( h# o. f! B* b
xchg bx, es:[41h*4+2], a) {4 k j; c: j" i1 F
in al, 40h2 m% T h% K( i/ v! y1 N" s
xor cx,cx2 z8 M, w' q. p8 V* ?5 M# E# d
int 41h
/ f" D: U$ }0 o+ {( s! r5 m xchg dx, es:[41h*4]; u$ _+ w- s, q# a3 d1 C2 M. ~ F5 w
xchg bx, es:[41h*4+2]
2 Y- w1 @, M+ @# R# \- S! B cmp cl,al
4 R* I! C4 C6 w" Z. s7 x+ L0 G jnz SoftICE_detected
$ J* J; `' S1 c) I' M( G; G$ z
* j" t @6 ^/ f9 `3 g_________________________________________________________________________
. { i- u7 q+ {9 k: S. i
5 d6 {- l0 B$ KMethod 07; G% v6 o2 {2 t0 W1 W& \3 H+ n
=========1 G6 A4 G; g( j
2 y4 m; z7 e( w' p; L, I VMethod of detection of the WinICE handler in the int68h (V86)! F& `4 K9 D: o+ `7 ?3 c
" {0 x! X! r- R3 F* z# H. ] mov ah,43h
5 J+ m0 p' Z5 B; T$ \8 I int 68h+ R2 i* K9 _/ U
cmp ax,0F386h
! V( y* }3 w1 q" q4 w2 A2 Q! K' N jz SoftICE_Detected
4 B; u! V7 ]" F3 [; h. g) X5 n' W
+ ^# g! R( I M8 A" ~6 B
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit0 \; F- Q: K1 v3 Y& {9 t
app like this:) {! s% \" f3 W
: B; i* c5 M2 L+ c8 U BPX exec_int if ax==68
. r. r B' F4 D% w$ M (function called is located at byte ptr [ebp+1Dh] and client eip is
+ w% _% b0 p$ U9 f3 E9 r: Z located at [ebp+48h] for 32Bit apps)
, g7 X( k" m, j/ g' z. ]) t__________________________________________________________________________- x- `+ x; k5 K
8 g5 A3 a2 i6 L5 [/ T' _
1 c3 R+ f9 A3 |* L& N3 k: s: G5 rMethod 08, n& T0 o) A! h3 x' n: U4 J
=========9 r# e' |& j( Y0 I# m1 v/ d2 q: f
; t4 W' z- K" x2 E. NIt is not a method of detection of SoftICE but a possibility to crash the! ]+ j2 |- \! [, ?/ P
system by intercepting int 01h and int 03h and redirecting them to another
6 X/ X: i6 I5 g9 o; g! r6 d6 Xroutine.; Q- l2 P4 G5 g- d/ Z
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ V: b- ]/ s$ A1 y0 D* }, m9 b
to the new routine to execute (hangs computer...)
b8 d U- R) H1 [$ |' M" z3 ?8 Q+ V3 K. ?1 d! Q4 E/ F. w
mov ah, 25h; h: {& U, l r0 } T
mov al, Int_Number (01h or 03h)
2 f2 v" s h$ x: p mov dx, offset New_Int_Routine1 G | e- d' y; Z: {+ g
int 21h
2 g$ r! o; D: @$ t- u4 w7 }6 V8 p" D6 H: C" s
__________________________________________________________________________, t9 U# b- G- M1 W: S
9 I% c6 ]) i4 c% jMethod 092 D7 P7 ~/ ]- x! G
=========5 K; `8 l6 {! L3 L7 b
! z7 S6 Z1 A v/ k4 h% R7 ?
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 q$ \6 g& P7 O7 }; `! y( k7 L: C
performed in ring0 (VxD or a ring3 app using the VxdCall).6 u" d$ }( P# V
The Get_DDB service is used to determine whether or not a VxD is installed
" A5 _9 k/ R) B' E6 O& wfor the specified device and returns a Device Description Block (in ecx) for# o( z' r( w# X, K* x" D
that device if it is installed.
0 M1 x" ~1 \6 z/ W. E3 \' a9 t$ U' X! ~
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 p$ N9 N+ c+ y$ Y) `; J
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" f9 _$ Z) C0 j& v, f a O. B: } VMMCall Get_DDB9 Z$ d- L# F( D: r& \5 X
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ Y0 i; k& _7 P" M* V+ s
3 k6 A; e$ L* Z, a: h. L# \$ Z+ pNote as well that you can easily detect this method with SoftICE:# f) e% M0 o# l- V% i
bpx Get_DDB if ax==0202 || ax==7a5fh/ U+ I- B- \% a' y
4 O: @# K* J. l__________________________________________________________________________
7 z6 A1 `5 K+ L0 }/ q1 y
/ y2 a: A2 Z2 x7 z& ^, J! {2 t+ w" {Method 10: }: D, @" @* e3 C' j
=========9 D4 t& A% o4 r9 |" }$ h
) d1 X$ a" V- s5 h( g
=>Disable or clear breakpoints before using this feature. DO NOT trace with
, ]" B4 n& G1 K. O4 N SoftICE while the option is enable!!- Q7 L- H' U4 _. l I5 |
1 b: o# @- e2 p! U
This trick is very efficient:$ R, \. B8 O% R P7 L5 Q1 X) A, o6 \
by checking the Debug Registers, you can detect if SoftICE is loaded
0 E3 G; b& C3 H" p+ H(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- n' n/ X4 @* f" `+ k4 I1 }1 M$ E
there are some memory breakpoints set (dr0 to dr3) simply by reading their- N- j A1 ?5 t: s: l6 ]( p* ^* E- r
value (in ring0 only). Values can be manipulated and or changed as well* t y: d3 v: H& o2 a! c) t7 P
(clearing BPMs for instance), P5 }$ H N* I
6 i4 U( U8 R# ^0 Y% F4 w2 g) k
__________________________________________________________________________0 f5 B! U% i& G3 }# I
0 g) j0 r0 {$ OMethod 11
( F9 U" E7 X- T( L+ e7 P6 m8 C=========
% h2 U! _# W" h
7 f1 [2 `. ~- T( x( A1 PThis method is most known as 'MeltICE' because it has been freely distributed
1 |, [' I# p- Z2 ~$ uvia www.winfiles.com. However it was first used by NuMega people to allow
- Y* Z2 ~$ }. O* J7 \5 FSymbol Loader to check if SoftICE was active or not (the code is located# ^; D2 s& x1 P. m) b( K9 [
inside nmtrans.dll).
0 T) x3 g* @' U. Y& F) n
6 G& f4 i8 w2 d5 n: |The way it works is very simple:
' l3 y6 v* ?& M6 lIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
' h0 F4 `0 q* S1 cWinNT) with the CreateFileA API.
* S4 D6 Y' i9 {9 k! g% Y4 v0 x5 r; a9 Y' N, t. E# {
Here is a sample (checking for 'SICE'):
5 l4 _( Q- ~: ^% ^$ m
. M" Q: P; ~0 _BOOL IsSoftIce95Loaded()
- ?8 d! W! Z: B{( }- c( }% N7 |1 O: V) M4 x) X
HANDLE hFile; ! C; k( P! @! J& X& M& s
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: E, |* }1 @& t; _" W. N! {* C
FILE_SHARE_READ | FILE_SHARE_WRITE,8 N8 t; B' E Y1 N/ i
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);! w; ]% v& E% n# u5 \# v
if( hFile != INVALID_HANDLE_VALUE )4 Y4 l7 O6 E. i. h N8 l3 w
{
7 A1 M( W# t! b( a2 s& d. B. K1 _- i CloseHandle(hFile);! |; B* s, o/ ]( d3 n3 h
return TRUE;
7 Q# ~6 V( I# D- C* s' [2 w }
- G E9 J1 M4 a/ `5 u8 | return FALSE;
8 n: A% u7 Y) W7 `" }1 a}& ]- H- y% f$ _, t1 N% x) n* Q0 `
3 b- S0 s; y# b TAlthough this trick calls the CreateFileA function, don't even expect to be6 {5 s+ H/ Y( C/ l/ a6 ]
able to intercept it by installing a IFS hook: it will not work, no way!/ V5 e V! b; W q: o" A$ H
In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 N0 d: b6 _# U) N1 i- d
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). R$ {9 J- j7 F$ l+ w8 d0 M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc7 P$ M' i6 O+ Z
field.) K* x4 e1 g- M( u# e. h0 |& E2 @
In fact, its purpose is not to load/unload VxDs but only to send a
5 `' B& }+ s. Q9 S" OW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: L* a* A! a% G/ h0 g% wto the VxD Control_Dispatch proc (how the hell a shareware soft could try
. v5 Z4 U/ ^+ ato load/unload a non-dynamically loadable driver such as SoftICE ;-).! V- z. i" U% Q' D3 d2 x! a
If the VxD is loaded, it will always clear eax and the Carry flag to allow3 {: c# e# B# {7 a( Q, l0 u+ _3 {
its handle to be opened and then, will be detected.( Q- g- F9 H( W8 }/ t8 |
You can check that simply by hooking Winice.exe control proc entry point
1 n0 f. y1 n' Z0 c. _+ W! F! Fwhile running MeltICE.
) J1 H7 ~ d5 z( f) f& s- L8 [# g$ f H2 J2 U) P2 N
% \% `7 p! Y; p$ E3 \ 00401067: push 00402025 ; \\.\SICE( A% J) q3 H, M
0040106C: call CreateFileA9 r: q" k9 y+ V' u6 P. B
00401071: cmp eax,-001
9 [. y# c2 z' g5 ]3 \. r 00401074: je 00401091! e5 Q; C q1 I2 H" h% K% ]8 \
& e F, }5 X! G
* @+ a. w# F Q, L N0 DThere could be hundreds of BPX you could use to detect this trick.+ b9 a0 p4 H) g. \& s
-The most classical one is:
6 a) X4 [% ?9 W" h1 ]' n BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
; U% {7 J v1 T6 t8 W, A *(esp->4+4)=='NTIC'
$ C& D2 B2 M9 l9 u7 m6 G. X* @) z, f6 X8 F* ~0 l
-The most exotic ones (could be very slooooow :-(
6 L: }. |3 I5 R BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : v, |% b) J& Z4 g7 d9 l
;will break 3 times :-(- d' z/ B9 t1 y: d
) q+ h9 c; g( k( J. d-or (a bit) faster:
- l0 {6 b% ~' i" {3 [8 K BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 q2 ?: n- ^% O3 M1 ~3 F, |
& i7 u( @* w. H1 V: t3 A BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' / _/ Q0 ?# F/ F# b% n! y
;will break 3 times :-(2 g( \/ S. ^7 l4 v& Z' |
& V- e3 h# M7 |-Much faster:* j8 L! i! n' U$ ~
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'" i; e! \/ o+ I j6 m
) Q; n, p4 O4 @, t, yNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 p: [! r8 O7 B1 Z7 D2 j/ e6 Ifunction to do the same job:
! p) g' p: @, w9 [# s
" `# C4 l; M1 m" i. L push 00 ; OF_READ1 p( P8 k# F9 V6 Z% U7 w% M, Q# D
mov eax,[00656634] ; '\\.\SICE',0
3 h( q/ j, u9 ^ push eax/ U) B( M+ D- t X
call KERNEL32!_lopen6 g' o+ F6 G6 Y! [7 ~4 V! R
inc eax* W R; m( J: @5 a8 P# Y8 l/ ]
jnz 00650589 ; detected6 f @# ^* I- W5 D! F% v
push 00 ; OF_READ5 U, z# L7 u# Y* ^; E$ a) z, z
mov eax,[00656638] ; '\\.\SICE'
* {+ P6 [3 v/ F' O push eax3 K9 K L g' g& D
call KERNEL32!_lopen
& \. B2 M7 Q! h) Y% E" R+ |7 `" } inc eax, i% b7 j1 N- \% ?5 Y5 l# T
jz 006505ae ; not detected
' }9 T- T! ]# ~; A' j2 O; f! [1 \7 r. E' J$ d& l4 L4 j5 _( z. d3 @
, [, o5 o- V- G5 s k3 W
__________________________________________________________________________
* L; Z: l+ @, K7 |( f3 V* Z. w# l) o. X/ u9 V0 w4 R
Method 12- |8 v* f; M6 F# F/ z& ?9 r Z; m
=========
* a5 W# V. P4 M1 u: P& B4 R9 Z
! O' L& J/ Q3 t! \This trick is similar to int41h/4fh Debugger installation check (code 05
5 m$ a0 T6 z3 i4 T: t _1 ]& 06) but very limited because it's only available for Win95/98 (not NT)$ v2 T8 z& h8 h- n V1 T
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.& L& n$ ]3 Y" ?7 s! G9 r/ E+ U
; j2 |$ S% g8 r
push 0000004fh ; function 4fh
* }. z" X4 \! @, i6 {# D8 ? push 002a002ah ; high word specifies which VxD (VWIN32)
; h" _' u7 }& V* N* |: M ]( I ; low word specifies which service
) t" o+ ~$ \% {% y$ }/ W (VWIN32_Int41Dispatch)
: L+ M8 I4 F1 Z- O d# g8 j call Kernel32!ORD_001 ; VxdCall
; I: T5 ]& k$ ]( y$ \& B cmp ax, 0f386h ; magic number returned by system debuggers5 G/ C$ j, q- }! }: V
jz SoftICE_detected3 v7 f+ C) {7 N! ~
9 c# O$ R( e, x/ m2 t; D6 LHere again, several ways to detect it:
( U9 J# { a+ I. L* r
' g1 d. O3 ~ r* b" q/ R8 d+ ^' q BPINT 41 if ax==4f
2 @* A$ D# x$ g1 \; C" C; k# M' x9 Q+ d9 G
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one- N; Y& n: s9 A
6 e! b5 ]) j' R; e' i BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A. q9 ^* q; D3 Z3 m! O/ s& n' }
6 K. ?" U2 m0 y+ N: h% o5 g; Z BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
9 z# e1 h3 G: z! ?. I$ S9 z7 F. W; i) D3 O
__________________________________________________________________________
* m! E4 T& A" }
% K( h& x, @( U4 `Method 13
( @/ G+ d0 u6 N) c=========
M# a( [1 H* Q# a# u/ A7 Y7 A, G9 X8 G. p4 m3 |5 S0 [
Not a real method of detection, but a good way to know if SoftICE is6 B7 V: x- F" q0 }( X* f8 t6 n" I& N) ^
installed on a computer and to locate its installation directory.
: G) @9 K8 |* gIt is used by few softs which access the following registry keys (usually #2) :" \% x! T9 H4 @( S
; F6 `1 z3 S! I' R) P2 S-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 W$ ]2 |) }% ]
\Uninstall\SoftICE
; E* s6 T$ u6 W. G-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
( \7 w' l8 J6 X) g( q; N-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# f1 m0 a! x# w/ T2 a
\App Paths\Loader32.Exe
{$ u7 W3 Q' V( O4 I: N; n+ C2 O! s5 Y" j
+ q# p$ }! _+ q7 z; f3 ?
Note that some nasty apps could then erase all files from SoftICE directory1 u4 Z- n* N8 v
(I faced that once :-($ r+ i B1 G; @# }7 q
+ b+ C2 K+ [2 p9 b% s, j
Useful breakpoint to detect it:+ v! k' t! }, F
/ h+ v* l# i0 _# s3 ~6 h8 V
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
' x" c1 c# f( R1 ^- I( G, L' z6 k B6 O$ W! ]3 {3 B Q
__________________________________________________________________________! |& d4 Q# P8 h5 S. a( Q! R6 v( n. p
. `0 a4 c/ |3 J: Q) u, V( V( q% w7 Y
) ^$ @' L, j. p$ Y, AMethod 14
3 T$ `/ H0 X y- ~=========" E/ Y# o- l; a( {
2 c7 ]5 M$ s$ j6 }& J
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 a9 [/ g. D; N: I/ xis to determines whether a debugger is running on your system (ring0 only).& r ~' F' f7 A0 ^
% l8 N I0 h, W$ x8 p) ?" ^ q
VMMCall Test_Debug_Installed
( w& ]! W0 r" {) A0 B je not_installed
9 D: [8 U' [: {0 ~+ s! _7 h
2 i6 L& O; s; e) L2 L# [This service just checks a flag.
2 G8 L# V) \$ u3 N$ `0 s1 y</PRE></TD></TR></TBODY></TABLE> |