<TABLE width=500>
: H: n& O4 A! o7 p<TBODY>, _1 m j8 t; S8 `0 l2 G
<TR>9 q1 s% b9 U4 @* c3 u1 Q
<TD><PRE>Method 01
* \' z3 H* `) B. z+ I4 C=========0 U& k8 H- H n
& D4 D! y7 E- A& Y3 v$ f4 v3 X$ m2 bThis method of detection of SoftICE (as well as the following one) is
6 s3 m& F. X5 z' [, W( N9 @used by the majority of packers/encryptors found on Internet.
4 `& k( N4 m1 P* u6 M* l) XIt seeks the signature of BoundsChecker in SoftICE
9 Y# x% P4 E' ?+ j7 m
, u8 @; a/ q3 @, m3 Y mov ebp, 04243484Bh ; 'BCHK'0 ?4 p, w+ z1 y, E( d G3 E/ L4 A
mov ax, 04h* H$ V8 P4 Y0 t7 s+ F' |$ B
int 3
; }6 S, c' M' J9 U: w& l/ A$ N cmp al,4
# h& |& T2 a5 Z0 \( ~) f jnz SoftICE_Detected
6 w2 w, l' a, i( F! m. b2 C4 U+ @/ A. g7 d5 d% ]9 L% O
___________________________________________________________________________
, o2 C5 U. d" `1 H& _/ u- ]+ e8 b+ H4 y/ [' s
Method 02
4 P, x- R6 `: t9 V! W E; i4 |. D=========
6 f- h" ?/ d3 n8 f3 ]1 P0 W7 v2 c! {6 p K( I0 h
Still a method very much used (perhaps the most frequent one). It is used
. q! x4 p+ ~, c$ K5 Y2 j; y! ]to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 k; K0 \' x" Y7 f0 x
or execute SoftICE commands...% x9 ?8 a0 o. l& |4 z C! g x
It is also used to crash SoftICE and to force it to execute any commands
9 {$ \% l! ^* ?(HBOOT...) :-((
. F$ G2 B; N4 Y. u+ A/ A7 F
& W& w9 h v( F' K. vHere is a quick description:, F# w s- f6 E8 k& A
-AX = 0910h (Display string in SIce windows)' m$ b7 X0 x _) K+ |
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)) m. r& q4 T/ G- x/ v2 V' K% J
-AX = 0912h (Get breakpoint infos)
2 _; p- H# F3 z: _-AX = 0913h (Set Sice breakpoints)* M/ |* @6 E0 g( J# q
-AX = 0914h (Remove SIce breakoints)- E) D' k k0 h
! P: g( b6 F' w$ X* J
Each time you'll meet this trick, you'll see:% e( `* X% l7 k' X1 Q% F; H% c( v
-SI = 4647h
( |" Y% W3 d5 {0 s" z V8 E-DI = 4A4Dh
: i D6 C$ c$ w( r" \Which are the 'magic values' used by SoftIce.9 c+ t. M: k& r/ S1 H
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 ^1 x8 l+ M* n
9 Z ^3 c) |1 |1 g7 N
Here is one example from the file "Haspinst.exe" which is the dongle HASP0 ^+ Y) ]' R/ C$ h& [# r6 g
Envelope utility use to protect DOS applications:
( G# c+ V% U9 k8 Z$ `1 | Y t- n0 p4 S5 d9 [0 j: S. N! ?
: |* q3 D& ?7 |% \8 g0 |
4C19:0095 MOV AX,0911 ; execute command.* v2 }3 |& e! H8 s6 u& M
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
) p- M' G- h! w4C19:009A MOV SI,4647 ; 1st magic value.2 k& L- ^0 o0 g, k' [
4C19:009D MOV DI,4A4D ; 2nd magic value.7 g4 o. L; i9 p: F3 J. y
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# a% _) F7 _- W7 V4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
s( ~+ E0 i- o# v" [' ?" x$ v! J4C19:00A4 INC CX+ ]( ?7 w! k0 S8 l* a" T. H) B. M
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute9 N( [* v- p4 }8 k( b& _# j( h" G
4C19:00A8 JB 0095 ; 6 different commands.
( |6 }4 B; r% w, H3 Y y* d% O4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, X- u5 i& Q# k7 X: P4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
% l; R: u" [9 \! x3 }2 E7 j- j8 B }5 @2 S/ l, {" h
The program will execute 6 different SIce commands located at ds:dx, which
. k5 t( U% f% ]6 r$ t1 ]are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 m4 |; p/ k7 O S! y
4 p, C% D& K0 C8 Q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.6 r$ w: L; A+ v. R% s
___________________________________________________________________________
* w) E$ ?2 ]" D d4 P
: l# ]1 O+ h' v2 Q
' p+ E" ^6 I2 i' b8 i7 LMethod 03
, L) o8 |. k' o* v) P4 k9 v, ?=========. `$ ?* r9 a! z' W; A( ]$ a
, Q: f( |/ L) L& r/ M* WLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! Z" Q0 ^! m/ f" J(API Get entry point)
; Y0 m4 ?$ w! O8 B9 N4 }: h
" P9 p0 ]$ y3 n: Q2 T
# P+ Z1 X" M1 h& l! P/ r% u" K0 B xor di,di
& K% Y1 V2 V- ~4 z5 W; Q g mov es,di
) |- W7 \5 m0 ` Z mov ax, 1684h # D2 V5 q- s! q# e2 q( u
mov bx, 0202h ; VxD ID of winice% q. n0 o. D# R
int 2Fh
% {* b. p/ Y5 W$ e/ v. ? mov ax, es ; ES:DI -> VxD API entry point/ A2 W' t* v5 z: t: Z( g- `2 S
add ax, di4 I" f, C1 b, e, _' J% N
test ax,ax1 i7 j& m3 L. F) X$ \ l+ c+ \
jnz SoftICE_Detected/ } P, K& |9 ~, [$ F6 y
+ o4 ~( P7 j% _; T6 r___________________________________________________________________________& R, ~4 g9 h7 X
" O2 [) u" I4 }; I
Method 04: U! m% [, Y' A) a
=========
j G* l ^& `5 V3 P5 @
: _6 B7 b$ {( Y6 M+ d# gMethod identical to the preceding one except that it seeks the ID of SoftICE, X) w0 \7 o# O
GFX VxD.
, {) e5 C$ m5 X6 x
& J6 \) }. [. _! x. Q8 p A8 W- j8 y xor di,di
3 D" w- c; [4 U8 R3 O6 e: i( ? mov es,di
6 Q& T3 G" C2 f% q* w mov ax, 1684h ) q; }9 u1 L. `, v0 }3 O
mov bx, 7a5Fh ; VxD ID of SIWVID
0 y0 } p( }/ }) c: s int 2fh
+ M( n/ b& B6 l- d mov ax, es ; ES:DI -> VxD API entry point! s) C& b+ j" j: o/ S+ a
add ax, di
, j' K) [4 n3 i1 b* P3 o; P% v test ax,ax5 f! F# k- u, R& }% M9 ?4 ^$ O
jnz SoftICE_Detected: Y- M1 x9 v2 A
; e ~" ] Q. q Z5 e__________________________________________________________________________
1 Z7 W% E+ U6 Z: r7 O P$ e, h- h9 v3 |: O
8 v4 }* y1 }( C. @4 k7 SMethod 05" G- K; ^6 f$ l9 o+ c$ S0 f
=========3 w$ q4 \' ~+ s6 u2 L/ O V% f' ?
$ D1 H4 l5 w, T$ vMethod seeking the 'magic number' 0F386h returned (in ax) by all system5 q; y1 X% p1 v t) B' j% V
debugger. It calls the int 41h, function 4Fh.
3 s0 ^; H% S, |: P# s1 vThere are several alternatives. ! ]" H p$ ?. R% q$ S
6 a ^3 u4 v. kThe following one is the simplest:
0 N( _1 t5 e# F0 v$ u6 N+ W
, h4 S2 s6 G4 X% K } mov ax,4fh
0 @4 \; E9 x$ A. f/ K1 X int 41h0 ]# h/ E! q, o9 L5 c
cmp ax, 0F386
2 g, E- ]( l" H: m. ? jz SoftICE_detected( n" c# ]/ e* Z: N' }0 s
+ i* \9 z7 F8 I. z; A0 h3 H
$ |( `3 O1 k4 P! W( |6 TNext method as well as the following one are 2 examples from Stone's
5 ^: z8 p4 r' o. \) S"stn-wid.zip" (www.cracking.net):
1 K& }- Y+ [1 n& @" u5 u0 n+ G% G
+ n) F9 P7 e2 v9 S# u mov bx, cs [6 c+ e4 B' |' t; @: N! H/ I
lea dx, int41handler20 H1 t! J+ n' ~+ q0 V3 `1 [1 A" j
xchg dx, es:[41h*4] `- ]3 t" I2 _5 b
xchg bx, es:[41h*4+2]
1 h1 u% Y/ H( w' |2 S \4 _. v mov ax,4fh/ G5 a5 n9 u+ `; M0 n% ^6 `
int 41h
- O$ {$ i$ P V5 @3 ]) K xchg dx, es:[41h*4], ]; ?" t" M4 P. s: v2 f
xchg bx, es:[41h*4+2]
0 v1 c) k' ^9 a( `0 S I% w cmp ax, 0f386h
9 L( q& Q% d" H/ M; z k1 x% t jz SoftICE_detected) M8 H5 T, V) A6 n: p5 m
: X% V5 S! [' t: g( p( r/ l& @int41handler2 PROC
* T0 D. @ k/ `. U1 I) w D. W8 ? iret3 P; p. Q7 O+ m0 @
int41handler2 ENDP
, R5 Z8 v8 v& J4 I! V$ g
0 o5 `4 _( u2 Z& U. X" ?4 y; {1 |# J
_________________________________________________________________________
' d+ k7 ?3 T8 v/ W" q% w, W4 p2 v% ?+ O2 P
3 a( F5 g1 f5 h: p5 I3 s
Method 067 ^0 A: V) S% |& e- o
=========/ I5 j) J2 [: J/ }! ]6 Q
8 k- D* r9 e( X4 l% Q' s
9 O4 S6 C2 ^! M7 }+ v$ S2 A4 a2nd method similar to the preceding one but more difficult to detect:
% b" d: B; P" ?& _* |- u3 P9 x. [4 T0 O$ i: x q$ H, `* `
2 ]* h" `6 K `; m
int41handler PROC0 X$ ]! d( l$ K: H; V
mov cl,al J/ o3 d) J8 K+ Z: s$ p$ Q( a* ~
iret
6 |# m$ D3 { g6 i0 sint41handler ENDP
# k& G4 x/ N0 V N) g) a3 b& C1 h O6 }/ W: F
. V: r1 _% S- M8 n xor ax,ax* w/ G0 b, E5 g% C8 ^1 y
mov es,ax
3 N/ u# i+ }! t2 C mov bx, cs" D2 f$ D' c2 ^# P1 ]0 s0 }
lea dx, int41handler6 y$ t S" ~5 O0 o6 G
xchg dx, es:[41h*4]
+ Z4 q1 L: @+ ^4 \/ S xchg bx, es:[41h*4+2]
/ N% ^7 r9 P3 B6 T in al, 40h4 C8 u( i; H- P! U# D- u7 b4 s
xor cx,cx; m! p4 k: _) b/ V b; _
int 41h
& g v7 X3 Q2 f$ ]5 u! z xchg dx, es:[41h*4]9 W/ b: X8 K# k
xchg bx, es:[41h*4+2]
, y: M+ Q3 d! I9 J cmp cl,al; @ v N- R! ?+ U8 ^7 J- q
jnz SoftICE_detected
: j. g' \/ u, v* X
+ o$ ?' d# B3 k4 t, B_________________________________________________________________________
! e+ a0 R# Y3 U0 q9 B# Q4 g i/ V, V( c7 y) c
Method 07
3 @7 v+ P1 J- Y=========$ H8 j! P& R8 D
2 u, z% |9 n; B1 E2 B; e0 n X. dMethod of detection of the WinICE handler in the int68h (V86)9 B, Q/ P7 `" m
% `! ^4 r. p9 l mov ah,43h
7 p, d' k E8 y0 @) V6 H7 } int 68h2 I, o3 u! Z& }+ u7 J) k, n5 O- M
cmp ax,0F386h$ [1 _/ t' i2 V% { N; [/ L# [$ B" m
jz SoftICE_Detected
+ B1 [) v8 v$ h, i2 Z1 p1 w1 ?0 l s! J- U/ f( u
1 M9 R) w; C! T: L; w
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit" m+ x- E- q0 _( g* Y/ V6 w7 a( f3 [* X/ p
app like this:
4 h" A9 d: e7 n! N' ~' N' L, K
" T" `3 \6 C7 [0 {2 D @ BPX exec_int if ax==68
7 `0 C& Y: J) b) F! R* u (function called is located at byte ptr [ebp+1Dh] and client eip is) n3 }' P1 P) g$ x$ _1 E
located at [ebp+48h] for 32Bit apps)! x% t; F. `2 h1 }+ p
__________________________________________________________________________
2 N, y) u7 C3 p; o
0 N3 |5 M0 t; {, r( `! I) N/ P3 A0 Z" O3 i. Z K
Method 08
/ T9 f" _" D9 o+ T5 a/ s=========8 z3 Q4 |" Q6 m- i: w/ t$ Z" U* k
) }9 M/ n( D6 T* `9 P! U% i
It is not a method of detection of SoftICE but a possibility to crash the! y, `8 S. }% g" V) }/ A
system by intercepting int 01h and int 03h and redirecting them to another# `1 p+ l4 d0 m+ ?0 t( L7 w8 u
routine.2 g$ k% r# k! U1 c
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" i k6 @$ u! P1 @& Rto the new routine to execute (hangs computer...)
* b& C) @- Z5 Q, X. P; y. x; P: I) k* v0 u; L/ F" ~$ T0 c! {
mov ah, 25h% h4 R! E4 V Q( A0 _
mov al, Int_Number (01h or 03h)
5 Y; k4 k' k+ [* y) f) F! C mov dx, offset New_Int_Routine
' O1 ?3 x; F5 {7 m; }; P# _ int 21h
9 R* ^3 v; p; m0 L* a c' P2 R( h8 m
4 H( A v$ O3 s. ~1 |+ }- {__________________________________________________________________________# H: v" x! \1 l3 u* ^* F
' g7 c3 M) k" I& N- ~
Method 09
& x3 n# b( x* A$ y) N3 L6 z. A=========+ H2 Y9 H( R1 k3 |, |
2 |$ z/ L; Z7 K" a" y% F% K
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
1 l; P/ A9 E3 u& jperformed in ring0 (VxD or a ring3 app using the VxdCall).* a2 ^& y8 T! F( E; i8 q
The Get_DDB service is used to determine whether or not a VxD is installed1 m G7 N, R! B S" I) v+ w
for the specified device and returns a Device Description Block (in ecx) for
+ d4 V# ?4 i Xthat device if it is installed.4 b1 {% H) Q0 {( ? i
- j( V: k; l4 w; L: U8 ? mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
6 t7 h I8 z8 }3 l mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% A4 a+ c6 R) G
VMMCall Get_DDB
5 o, L6 A+ j% I' e) {0 P# L mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 @* j( D' p) f7 A
& D( O: m) A% zNote as well that you can easily detect this method with SoftICE:
$ d8 n/ h2 t- h4 q! \+ b bpx Get_DDB if ax==0202 || ax==7a5fh
" u) D9 F- M* }# w( y/ R3 h! b
/ E7 P5 z8 T+ l5 h" d9 | @1 s__________________________________________________________________________
: k0 G9 n, ]% P3 c6 b: p8 e
i' q9 b5 ^* _Method 100 f1 U" W: X) M1 }' ^ N7 f2 C
=========
' R" B W) _/ u' g0 ~0 M& F( Q# S* B5 w, R1 ]( x
=>Disable or clear breakpoints before using this feature. DO NOT trace with1 e k% o" D+ n9 j) L! C9 z
SoftICE while the option is enable!!
. x* Y4 H' [ l. h! g( R2 F# c4 v6 @
This trick is very efficient:- k4 Q7 \8 j) t+ {. ~
by checking the Debug Registers, you can detect if SoftICE is loaded, v4 ?" j, U; x2 w* q2 ]
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 l! c- M, k* t0 |7 e( B# t9 M+ \
there are some memory breakpoints set (dr0 to dr3) simply by reading their
1 ^* ~2 B+ ^$ evalue (in ring0 only). Values can be manipulated and or changed as well
$ R! {* A1 \% s, a# x6 u(clearing BPMs for instance)
: \; C$ `! M, n) ^ M$ v* k2 U
$ f1 o4 |9 t: s& X/ S: ]$ f& n__________________________________________________________________________2 C: o+ e# w$ F: u- T- X: p% I
- y2 l+ N% F8 E7 _3 G
Method 11
5 h( s% q S# i5 f: q- N, N=========1 F) D5 W& O( ^/ Z! A! K4 o
- C! q! C5 _8 I! k; p+ i3 l* H5 ZThis method is most known as 'MeltICE' because it has been freely distributed" H4 K* o& D: y6 C3 [0 S% x/ D9 A4 S! A
via www.winfiles.com. However it was first used by NuMega people to allow3 R8 Q: [3 A7 t( z1 C t
Symbol Loader to check if SoftICE was active or not (the code is located9 T! f! E: y1 [5 s
inside nmtrans.dll)." J3 q: `( N, r9 W% F
( h% n' B7 V8 W9 Y) @The way it works is very simple:2 I4 T5 K" N2 u: t+ s
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. o( \( l% r' z8 |3 f8 C' yWinNT) with the CreateFileA API.- D; J- j; D6 W; M7 ^5 c c, ~
0 ~! W, E; O F% E, W( a
Here is a sample (checking for 'SICE'):' u# ^0 w9 j0 z4 F$ L
]) D' y& b- Z4 G3 f3 d8 xBOOL IsSoftIce95Loaded()- ^" u- z `# q* f2 ~# B( `4 G
{; C6 J8 f: `! n/ B! Y" R8 A N/ ?8 _
HANDLE hFile; . m5 M$ x- J1 v" `' v/ _! B$ E
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 P+ k/ N( Y8 q' I6 t' y5 H
FILE_SHARE_READ | FILE_SHARE_WRITE,* [* w) {4 Y* ]" ~
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 g8 B- ?; M2 r" | if( hFile != INVALID_HANDLE_VALUE )& c$ a8 x6 K/ B4 |: C( ` d
{ D" L! ]* J% f( @
CloseHandle(hFile);9 }5 ]! I) M* }1 N
return TRUE;9 ]0 F' S( |+ ]% R' L
}
5 C3 s6 b( X1 `5 i5 Y+ ~( C3 W! [ return FALSE;& T3 {, M- b& I" E& i
}8 Y' Y: w% d4 N4 u
- H: Q9 G8 A2 l- C+ A& D. H& f( r
Although this trick calls the CreateFileA function, don't even expect to be1 {& v# e" o" P
able to intercept it by installing a IFS hook: it will not work, no way!8 i% p# p" C% c9 |" G1 f2 _# u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; a. {7 o0 Q/ }; g3 |
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- {" i6 j9 a1 l7 \, U8 c2 W; n1 Xand then browse the DDB list until it find the VxD and its DDB_Control_Proc% K, t9 Q' c/ P" e4 d. l/ w
field.
% p8 ]* N! h# JIn fact, its purpose is not to load/unload VxDs but only to send a ( E/ N" b4 u& \' p2 N2 ]
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, _! @. v( c" p5 j Y1 u* ]: eto the VxD Control_Dispatch proc (how the hell a shareware soft could try
' C/ r2 J% K' F% h1 Cto load/unload a non-dynamically loadable driver such as SoftICE ;-).) f/ k2 c0 X3 ]. z) o2 R8 {+ _2 |
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 B# E3 n! ? a
its handle to be opened and then, will be detected.
7 H0 |* {- ~1 R+ {You can check that simply by hooking Winice.exe control proc entry point
# t9 G8 A7 x/ S# F+ O* [8 B! ~7 xwhile running MeltICE.3 u. h6 |$ r. b# B% f
+ Y+ q/ c6 u# s4 Q8 I& e' T' H3 H- @
4 G# d# T% m, S) l6 T, T) p 00401067: push 00402025 ; \\.\SICE
3 n/ q7 k5 u: y8 Y, ~0 R 0040106C: call CreateFileA( ~# R8 a/ q- ]# k* b8 s
00401071: cmp eax,-0013 a7 S: p% n% ?0 \6 _" V
00401074: je 00401091% i" L, y! R! z* h$ T
$ s5 S2 k/ X& v: \& r2 |. f5 W6 g* g2 G
There could be hundreds of BPX you could use to detect this trick.
1 h" p1 r6 z7 w1 A1 |-The most classical one is:4 f; ] o' ^8 \. N/ x
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||3 z d, A f7 T3 i% t
*(esp->4+4)=='NTIC'0 q; Q3 G8 C3 v% P2 e1 s& U, b7 Y8 ~
' b; K6 g- ~4 N-The most exotic ones (could be very slooooow :-(, G+ ]$ u, w; P; U7 }5 P! O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 m- I6 \+ J* d% a) U4 P
;will break 3 times :-(
, |1 n5 _7 @! T _
* d2 [6 G; |0 `' L+ v# b9 y6 M-or (a bit) faster: - u7 r( c$ A" x4 ?5 n5 }
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')+ y2 u7 X2 L! ?
- x4 _! ~0 b6 q, c/ S: P' T
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
" Q% R! a- x1 t% Y ;will break 3 times :-(! l+ f+ a% |; E; e. t. N& H! i
9 ^. ?3 W1 D; j
-Much faster:2 {( I3 K$ T9 q! |/ k
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'; k( K; v! Z7 Q) u2 A( g
- b) i0 t. H0 _ F/ G. HNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 Y7 F6 z- V& Pfunction to do the same job:
5 U3 w# X) D, h# T& g) c4 _
3 L1 f! Y0 p4 C. H4 u push 00 ; OF_READ
, P/ o. |( d8 ]3 |' M. Q mov eax,[00656634] ; '\\.\SICE',0% ^8 B- ^9 c; {+ [1 j) E5 P5 L
push eax2 g, O4 a7 @4 Z2 W$ v) b) q1 u
call KERNEL32!_lopen
1 `- I+ S7 z. {# H* I ^: j inc eax
7 T# q/ M3 i0 B4 M( E jnz 00650589 ; detected: v. h! t9 F7 n. x
push 00 ; OF_READ9 A5 S$ b% F7 Z* G( n
mov eax,[00656638] ; '\\.\SICE'$ ~6 ~2 ^0 F3 H; y
push eax, U) y8 I5 L' l ]) X+ S5 d
call KERNEL32!_lopen4 Q; }- b% {$ Y! Y. @5 R2 \$ {) y
inc eax
' t4 k8 V- n u jz 006505ae ; not detected
1 e# R& k& s. t o. c, b+ x+ g
: F( r( d3 {: Y& y2 c5 Y% f Z8 x/ F5 Y8 |) p) {! E% j
__________________________________________________________________________2 z$ |5 W! S, T4 E% A0 s
& B4 P* h; t7 c- y' R" {
Method 12
( m6 {3 o6 {: U# }# R; g8 V4 `=========
6 Y" V6 s' o" `0 k3 t; V: M7 P/ k5 H7 t
This trick is similar to int41h/4fh Debugger installation check (code 05
: q+ L r+ p! L( e% }4 c' q( e" F& 06) but very limited because it's only available for Win95/98 (not NT)
5 G8 L' k' A; j5 was it uses the VxDCall backdoor. This detection was found in Bleem Demo.
2 I* K+ V- ~8 X3 W6 K) D1 q9 a- ?/ [+ S1 P
push 0000004fh ; function 4fh
! [8 g3 z! o# M* ^7 ?+ W push 002a002ah ; high word specifies which VxD (VWIN32)
) h2 a5 H6 a1 S; h: h ; low word specifies which service
+ V/ L: W% [' T/ b% m" p' Z/ H; L (VWIN32_Int41Dispatch)
+ W, I4 G0 \2 [+ v( ?$ m3 g call Kernel32!ORD_001 ; VxdCall
& n' t6 D5 J* K y6 k( b cmp ax, 0f386h ; magic number returned by system debuggers& h6 v( p7 l* ]; E4 c8 o. ?* q
jz SoftICE_detected9 i# \5 p6 i; g+ Q
! s! U" t7 I% N/ o/ bHere again, several ways to detect it:/ W. `- W# @" @: G! W
- x( j; Y4 U. q& S BPINT 41 if ax==4f
8 V8 K8 Z& V j4 ?1 @5 Q7 O3 L' O; C" @/ v( @3 K" [$ c& `1 q
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! i4 [- g5 u" n8 w4 y7 f+ v
" q- g" y2 \( }8 w+ d
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# ]6 v, Y1 U3 e/ q, s4 s9 f; R9 E) x
) O9 W0 g& D9 q, R6 m
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 w; e4 A" v ]; ^2 v4 l+ o8 P
9 |$ y( t! N- t& k I: K! h+ G& N! x__________________________________________________________________________
6 M3 X9 [- ?+ B; `* v# V' V% Z& J2 ~6 S. a, a9 o
Method 13
( _5 i$ Y) K9 j, e3 Y=========
/ s' ~/ B8 x2 B) n2 Q6 O
% a( U# e, n* v, cNot a real method of detection, but a good way to know if SoftICE is
& s+ s' L) r( d1 w9 ?installed on a computer and to locate its installation directory.: i+ N% B& _! n/ V
It is used by few softs which access the following registry keys (usually #2) :8 _; [) Y7 `+ `2 b- _4 T3 {3 d
; j+ Z1 L! q6 L7 J1 s7 }4 J% H-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 G3 c9 X u' d) [( ~, ^7 g6 ^\Uninstall\SoftICE- l# Z, V# r0 I6 _! W8 E
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# c: P( S% Y; h- _# F; s( y2 i
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! G1 S. T! }. H; @, f/ o\App Paths\Loader32.Exe
" N9 j' X2 K4 N5 f0 y
1 ~! H7 P8 p, M; c' T- Z- y. g3 }% W8 [% p. D
Note that some nasty apps could then erase all files from SoftICE directory
+ ^4 U1 M( q }; H' O% I/ {1 `) ?(I faced that once :-(7 O. |7 W$ x, \* d8 W+ Z4 c# g: f* Z, v
3 t6 N& R% v" tUseful breakpoint to detect it:' ^, l, G3 {0 c% ?* E$ T
9 P+ p0 N. F) P* k/ Y7 `
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
1 y4 x( w6 i( C/ p. u' E8 W4 b/ A! J7 W) l- s
__________________________________________________________________________9 e% b# ?9 w8 ^9 C# I% F
9 t5 A' M7 v! i. _$ \# R; U% u( a: ^
Method 14
( @5 L7 {3 w) x. B; W. `! y=========8 f+ P5 ]5 S9 f% w4 ^/ C
- `0 b2 L4 I# b' HA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
0 K$ p& X1 S3 x/ D) u/ vis to determines whether a debugger is running on your system (ring0 only)." J/ p+ }6 _. e5 a. `3 {- V6 ~" \
$ I% r) w. w3 t( b5 s/ p VMMCall Test_Debug_Installed
( L' ~6 t4 c q2 t je not_installed% e' T0 a2 H$ v+ z5 J% X
* o/ t2 d- q( S# }2 B* c7 u& MThis service just checks a flag.! s- {( k7 \# J# Z% T7 H
</PRE></TD></TR></TBODY></TABLE> |