<TABLE width=500># g8 ^+ @. s5 Z6 b" q3 O1 j3 }4 E
<TBODY>
' z+ v7 S% \- x8 g$ E<TR>
5 q6 M& }$ j' x& z+ ~% }0 p% d<TD><PRE>Method 01
7 ^- n( G( \1 A+ H" ^5 e8 c=========2 L3 q4 c b4 T: ^, P( x
3 R6 x4 z: C& Z5 G5 ^3 S
This method of detection of SoftICE (as well as the following one) is
O0 [5 S+ ^% C9 wused by the majority of packers/encryptors found on Internet.$ v# `4 C- T7 D$ N" ]! \& i
It seeks the signature of BoundsChecker in SoftICE+ w4 D, d6 R) e. N
" T2 |' |0 U, j2 c8 r
mov ebp, 04243484Bh ; 'BCHK'% o* s/ x: s: ~5 f) K
mov ax, 04h) X9 ~8 l j# X8 I8 \
int 3
1 o8 U; i2 a4 N cmp al,4- _% C( O: I, h+ n0 X
jnz SoftICE_Detected( b. J! z2 x9 i0 b+ g% ?% s
( h0 z! u- t- H4 q+ L$ I6 O R7 z___________________________________________________________________________6 l3 P" h; z8 O3 H) K+ {8 ?
* N5 ^% D9 t. o2 o, C3 [3 k' RMethod 029 K) ?! W4 L+ B
=========
& D# S& ^+ D& t* `# d2 @% R0 J* Q$ Q& Z
Still a method very much used (perhaps the most frequent one). It is used" J+ Y6 h1 }! y/ U. l, I. X8 n
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, O: w0 a; r5 L9 }, ~# k7 J kor execute SoftICE commands...; M; p& H, d, r' N: Q) D9 e( G
It is also used to crash SoftICE and to force it to execute any commands
) d5 z+ W& P" B. \ F- @: L H$ J(HBOOT...) :-(( 6 l5 V3 e' P# g+ Z
8 Z: X, z3 W8 ~, m
Here is a quick description:& q9 N7 \3 x2 g; H
-AX = 0910h (Display string in SIce windows)
9 ]3 o$ B* _$ n( L0 M5 O Z+ X-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 [9 N( v; u/ P2 J) y-AX = 0912h (Get breakpoint infos)# q9 ^" e# v: m" ^; Z! J
-AX = 0913h (Set Sice breakpoints); s, k" r& R, n3 T4 X) e
-AX = 0914h (Remove SIce breakoints)8 i9 _( G' a4 V3 G" S
" H0 ~3 a0 `1 F5 a h& eEach time you'll meet this trick, you'll see:, [- c% m% g0 v: K9 |7 a
-SI = 4647h
- U* V/ z6 D9 ~+ a# J6 [-DI = 4A4Dh4 e' m5 P$ ?, Y3 @
Which are the 'magic values' used by SoftIce.
9 M( ^6 G/ e4 f/ r% {* _9 i% ~, uFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ G% C% B/ `" C0 b7 D+ R1 }6 u
7 P, a9 A: Q2 ~. P7 x4 NHere is one example from the file "Haspinst.exe" which is the dongle HASP
! a/ q& {2 {! `6 x. UEnvelope utility use to protect DOS applications:9 ?" P$ C( R( @; O1 ?+ S0 \( ?1 h
) Z( w/ R8 o% q$ i/ f ^
* c3 g8 m' _9 B
4C19:0095 MOV AX,0911 ; execute command.
0 K. ~' b; ?+ W1 O3 c( y4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
+ Y5 r. Q2 C8 A/ m' m- S4 n4C19:009A MOV SI,4647 ; 1st magic value.
$ ~0 U% E3 g0 ?; b" d8 N( H1 i6 K4C19:009D MOV DI,4A4D ; 2nd magic value.8 Z1 M* }; [, A: p1 i
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)7 T8 A, O6 i. o7 R& T! ~6 }9 y$ S4 R
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
7 J2 r% v' p1 r/ y: C* R4C19:00A4 INC CX! {" y" x% c! H) q0 W
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
5 t3 ~- _$ [$ x" K4C19:00A8 JB 0095 ; 6 different commands.
! f: j4 x4 d/ X Q2 ^3 `% j4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% y6 u, o" z! ?% c2 K! o4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
0 t4 N4 U T( W4 w; r6 T+ N" @# {, b' f8 Z& J# T( Y7 ]
The program will execute 6 different SIce commands located at ds:dx, which% }- s# C9 Z+ y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( x0 Y+ n9 D% e9 F$ p4 B4 e
. a" _) [6 F7 H' A" c
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.3 ]- [. Q% g- p7 g/ V4 c0 T
___________________________________________________________________________
" @; U9 \3 D1 z) Z; @; C& V& t( a# X: J
7 g `* s$ E4 l, i! ~
Method 03. h, x! w2 E% f: E( s) A5 m0 R; y
=========
5 u C+ c* Y* y3 [- ^; D& u( s% D* }) W
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h* M( t1 o9 v h1 w
(API Get entry point)
+ x: }. @( Q$ |7 ~2 m- g & h0 X; v5 I, F7 w
3 K( r8 V7 B1 H# `, A! h xor di,di
/ I4 `$ ^; I$ h8 n8 X. Z mov es,di
7 I& f4 n& {: L3 ~1 [ mov ax, 1684h # u1 z. b q9 H6 ]! t1 N4 P7 m
mov bx, 0202h ; VxD ID of winice
! k* S. c; p- L$ E- C2 W int 2Fh3 Q+ {0 f6 {" V& N/ ^8 U- P
mov ax, es ; ES:DI -> VxD API entry point) d4 z/ }" g; h& B3 V$ F$ Y
add ax, di! R; K8 [+ `: c
test ax,ax( R$ @5 m" n; D1 M! {% p* ^
jnz SoftICE_Detected- @/ p$ q% a f7 g+ ~8 r" x
3 m! ~7 L: V& S
___________________________________________________________________________1 v% K, W( P7 a1 Z% y
" i5 o4 {5 K1 F8 E& {9 Q( K
Method 040 I1 q; p! n6 W4 B2 |4 m$ X; ]# I, Y; Z; W
=========
! T- x( b8 \: q
: z Q! ]/ q% AMethod identical to the preceding one except that it seeks the ID of SoftICE# s8 P. s0 Z' W
GFX VxD.
& W$ `& q+ O+ i0 s/ ?+ {$ V
* @! J+ B$ @8 t/ P xor di,di
( ~' r: [( p/ }0 i) j0 W mov es,di
6 A$ G% T6 ? Q+ k' b& \ mov ax, 1684h . B1 i3 P! H! Z$ X1 |- k
mov bx, 7a5Fh ; VxD ID of SIWVID
! m. A" b8 S9 V* p. n# p int 2fh, ]" ]4 s( v1 \2 H( j; X
mov ax, es ; ES:DI -> VxD API entry point0 G6 ?1 H9 m# t& q3 L( e
add ax, di7 L! ^+ z' a) r D h
test ax,ax! G6 [7 e0 Z* K' H
jnz SoftICE_Detected4 [5 [6 Q u1 H5 t2 E9 t) ?6 T
* k6 t# N2 e2 }1 {. r
__________________________________________________________________________
0 Y& c& q) |/ t% `4 R
+ _) P; `. t* }. I1 C, }8 d" s- O. f/ |, E3 X" \
Method 056 S$ i* |& D3 [/ ]; n4 r
=========
7 g% O5 V, o0 k1 G l' @( ] ^4 ?' T9 K, }4 O' n* _4 Z& D
Method seeking the 'magic number' 0F386h returned (in ax) by all system8 Y* x! n" s) o6 }' C7 x3 s1 e
debugger. It calls the int 41h, function 4Fh.
/ g: @' `' r& e- i8 t* ^There are several alternatives.
1 m$ U3 Q5 H8 P1 F0 J4 g) U, }! D% v& ?
The following one is the simplest:; w) U9 |2 g2 G( v
( B% g/ e0 F) N' m4 }) R mov ax,4fh
5 d& p2 Z* W7 C3 g R2 H& Z int 41h/ P' r; i! w9 }2 h* L
cmp ax, 0F3861 u: c9 T5 b8 ~( {
jz SoftICE_detected
) Z3 w) j; g( M# C# t1 w' E% U) Y) e7 p7 O8 i7 e
1 d! n" L, u" [5 N
Next method as well as the following one are 2 examples from Stone's " j- U) b5 w0 c/ q0 o( Q+ a
"stn-wid.zip" (www.cracking.net):% \, [6 H5 Q$ b- M" a! k: j t8 o
# i; m, q% f' B
mov bx, cs
# @, J% D/ @* {& A& f; `. O2 S lea dx, int41handler2
/ ]7 o7 G+ F! G( ? xchg dx, es:[41h*4]
. U3 {6 y0 H% X0 C. [3 ^; k xchg bx, es:[41h*4+2]# M2 y5 S6 w+ _! p( u2 N
mov ax,4fh
7 T- Z; e5 Z. {* R8 C int 41h
, F% w& m$ U3 ^7 k' Q% b% C1 Y0 d xchg dx, es:[41h*4]
+ {' n7 M8 L, Y/ D; n! p. x5 Z xchg bx, es:[41h*4+2]$ z8 e: C! ?9 x$ n8 p9 s
cmp ax, 0f386h j4 |5 o z# k
jz SoftICE_detected; b$ v5 d" f8 y* a3 r/ V7 h/ Y
* n& b) g- Z# t- m, x3 b
int41handler2 PROC x* q4 v: I3 O) O& o
iret
( x& |# r" k* A) Z3 U- tint41handler2 ENDP( }* N, A; b4 `- A1 K( ?: y. s& c
5 q+ K( g, a% M) V' d9 Y6 ~
% r& D9 m7 D v! ^9 Y2 o6 b
_________________________________________________________________________
$ a+ h4 q" w W2 G* c7 Y
: {+ y# o: w# d! ^6 R; E+ G
: T! s, ]) {1 X6 `4 o9 |( ?Method 06
" G q% _4 B* t. H=========& n2 g* e! P! E& |. R- ?
5 c) C g) m2 [8 r9 y/ F6 a7 b9 x9 M6 d3 k
2nd method similar to the preceding one but more difficult to detect:
5 q( D' H" L+ H; u5 |" s5 R3 I
1 h* @/ I. g# G+ o' y* M- @7 Q" |; ~
int41handler PROC9 |1 H/ I4 H' ` }; V$ C( L
mov cl,al7 m, ]) h" |* O0 T ]
iret8 p6 k% h; g" |7 {8 K9 i
int41handler ENDP
, N, d5 \; _. }9 w, P% S
; Z9 ~( D6 \$ ?5 B6 u# d) m4 v% C; E+ l: H, m1 ~
xor ax,ax- c7 w. J. ^) G* t# L" P y
mov es,ax) U* k' e" k) l! w/ T$ D
mov bx, cs ~1 K/ O# H8 Y. g
lea dx, int41handler
, Y; U! {$ U3 i4 [0 z xchg dx, es:[41h*4]
9 f" p2 _ u' N# s- Z2 \ xchg bx, es:[41h*4+2]8 T3 _! p2 O o# X# Z; ]
in al, 40h
& h$ f* L8 }1 r xor cx,cx, G6 ?# i D( p Y
int 41h0 K# K" O6 ]: S. y, L( w
xchg dx, es:[41h*4]; c4 Z8 w7 ~* L+ d* v9 j
xchg bx, es:[41h*4+2]5 N$ c" A; ?4 Q. [
cmp cl,al
2 \0 u2 Z, N$ ^" O jnz SoftICE_detected
0 V2 U- u+ ~$ z- l# }1 r5 V: m& [) ^8 Z
_________________________________________________________________________1 A1 I& R5 k' M6 X. a
; o# N6 q% z# a% v6 \3 U5 NMethod 07) L: x) A9 u" g: c# Q- v+ ^$ K
=========
6 e' C8 ]2 d! j) ]* P0 l1 |
) @- P2 j, G1 D- SMethod of detection of the WinICE handler in the int68h (V86)
8 d# Z5 a: q/ l+ f; N- I6 Y! X: N( t" A5 y! x
mov ah,43h
# a; G; m* l+ A; h- N+ L! U* R int 68h# r; x+ H; M2 K
cmp ax,0F386h' X9 a0 ~- \( \& _* Q9 s
jz SoftICE_Detected
2 ^3 y$ J/ W; w& I
, H/ B, F1 m0 f
; J1 J6 e4 B0 B6 g! k- S. x=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit) ]! [" c! H: \4 Q
app like this:9 {% M. X5 j8 @ G: c. s) w$ w
2 F! q# s0 v0 v, ]
BPX exec_int if ax==683 W K* S- Q6 t' M
(function called is located at byte ptr [ebp+1Dh] and client eip is1 Q+ A* W8 `! e& R6 c
located at [ebp+48h] for 32Bit apps)
. O5 r- r% Y, g7 R4 M6 T1 J__________________________________________________________________________
& W4 q+ C" z# a1 N8 B! N8 c7 v, A$ V! Z& ]7 L% P
8 q; o/ k% G$ s! AMethod 08/ ]0 Z# Z* b* X
=========/ Q6 L0 [5 J4 \/ R$ q
M" |! j% M9 m6 \6 P8 `' E8 zIt is not a method of detection of SoftICE but a possibility to crash the& A4 Z, U9 M* }* e
system by intercepting int 01h and int 03h and redirecting them to another
4 ~: {2 k3 ~. e! q! xroutine.5 c4 U; O# l% X2 ?+ n) l
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- d* ^$ P; K0 `$ S
to the new routine to execute (hangs computer...)8 ?& J1 d$ a( F
8 [) |7 _0 i' X+ L/ Z
mov ah, 25h' R( {/ e& @8 U9 J! s0 ^+ `7 }# r1 t
mov al, Int_Number (01h or 03h)
# z% k; k) h J* \7 }1 a: V mov dx, offset New_Int_Routine; j0 J. }% ` x& t% Z' Y
int 21h
* Q4 |$ S; F9 f- t# u+ |; {4 Z' }( w
__________________________________________________________________________
8 Y3 l4 j$ P0 q6 b" v# j
0 D s$ Z/ O% q( ?( I) Y+ e. wMethod 094 Z0 N [, G; C6 @$ `) o8 G
=========8 y$ s% {1 m* s, S$ r$ k# k, l
0 u. e0 `) U! p# N0 r2 tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only# o3 z- W% u- ~/ |6 R# H
performed in ring0 (VxD or a ring3 app using the VxdCall).3 B/ | y* z& }
The Get_DDB service is used to determine whether or not a VxD is installed
7 I% _" o2 g0 C" D+ S3 Afor the specified device and returns a Device Description Block (in ecx) for7 q5 _1 |9 \. @, u9 w9 j
that device if it is installed.9 d; V' t- @' Z$ y$ p
) w0 R- |8 d3 H; v$ I5 E
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
% T ]9 U+ m7 N" r2 f5 z4 F8 R mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# d: F; U* F! S: B% E8 g* t: g
VMMCall Get_DDB
! n# g& H+ f0 l0 ]9 I/ z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed4 ~2 K- S% R6 g1 \+ K* I/ y2 o
( u- [$ \8 w+ A, V o/ h9 ]Note as well that you can easily detect this method with SoftICE:
6 h2 i* s' e, E0 _* K/ w# f bpx Get_DDB if ax==0202 || ax==7a5fh4 R- f& g5 I7 T$ M) L% v, A
$ B* K* M0 i, `+ z! f+ m7 x* S: k
__________________________________________________________________________) N% f! r/ Y- t8 x& _2 t/ _
, H* v0 @: |6 }1 J" \. ?Method 108 J5 s7 C2 k" G4 V/ h
=========4 X/ I1 _+ A# j7 d( ?$ R b' H
' A, |' e& H; T. y
=>Disable or clear breakpoints before using this feature. DO NOT trace with4 a8 a" z; g. }3 |
SoftICE while the option is enable!!, ~5 k" n4 b! a. _( X* M2 Q. R: f
+ G' N9 D5 `; y6 S s/ \$ N7 S+ @5 z
This trick is very efficient:& _4 D. V9 P0 j9 c/ a$ B: {7 H
by checking the Debug Registers, you can detect if SoftICE is loaded
2 [! J8 j* l" ^ P(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' A j: h" |2 J& B5 I9 v* T: f' Bthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ [8 A' a6 a! X% _value (in ring0 only). Values can be manipulated and or changed as well
, W r5 {2 {) g( }/ d(clearing BPMs for instance)! N1 r( f4 v9 i* `- U; V% X! o( G+ l) m+ l
% f3 B+ c% b, D
__________________________________________________________________________/ E. O9 X7 Z" h- I: s* d( I
+ x( A% F% q" Z: fMethod 113 y# L7 ~- e( o1 H% `
=========" `1 `# G. p7 b! {
+ ~3 d3 }( K0 _ U8 r) w
This method is most known as 'MeltICE' because it has been freely distributed7 x) j; { `3 ]8 P
via www.winfiles.com. However it was first used by NuMega people to allow
# z3 f6 `, }! J3 @* Y+ u( S4 I5 `Symbol Loader to check if SoftICE was active or not (the code is located
7 U$ c4 Q/ o0 p. Xinside nmtrans.dll).
K1 C# f$ m0 t2 e# Y0 z& i( n2 g7 u, D3 ?* N* B# l
The way it works is very simple:
- d9 h P% o8 `7 ]2 O4 Y: s5 TIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& ]$ m: ~' m# l: k5 `8 _( `WinNT) with the CreateFileA API.- e2 K& c2 b7 [
8 n: X4 k: C# U, \Here is a sample (checking for 'SICE'):
3 w) C9 d$ _2 t2 J6 t- B% m! U0 v( T4 n1 }; v
BOOL IsSoftIce95Loaded(). E- m2 R4 t- w' K
{
) z4 d3 F( F% }0 X: U+ a v0 H# S& ^ HANDLE hFile;
9 v) S& A$ m, f% h( P8 L hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% a+ g0 _, C( s2 N
FILE_SHARE_READ | FILE_SHARE_WRITE,
$ v! s% A; V) l$ _9 |0 ~ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 U- S! G3 v5 y* v
if( hFile != INVALID_HANDLE_VALUE )# w( s- s) C* S, m$ U3 Y* E; v( i5 T3 s
{8 t. B$ R/ i, l7 R
CloseHandle(hFile);0 X4 A8 \( e$ [6 E! l) e8 L1 Y0 F
return TRUE;' I3 [! _ h1 \# Q% ?
}3 r/ ?" `5 U5 y' ~2 R0 ?6 h4 G
return FALSE;0 X8 h6 Y& s6 t2 m
}
. R% s* Y" M, c- M( X9 Y, N8 @; l
Although this trick calls the CreateFileA function, don't even expect to be
7 F) ]) F# m) K" ]. {able to intercept it by installing a IFS hook: it will not work, no way!$ a$ ~* B* _6 F3 @; P$ A
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
% a, h9 Z% z8 xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( G/ L+ x; D6 T+ P% W2 W, j
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 ~ j8 G. s! d* z5 N% s5 lfield.
! K% o3 \2 x2 k' [. W+ ~/ MIn fact, its purpose is not to load/unload VxDs but only to send a
. k' ?+ h0 n1 D& i* V( Q4 _( mW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 Q ?; M: x) D+ t6 fto the VxD Control_Dispatch proc (how the hell a shareware soft could try
; w! }0 p# s, a8 }2 N' qto load/unload a non-dynamically loadable driver such as SoftICE ;-)./ L% ]8 _6 i4 d. a0 r7 |2 x( c
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 n- d) \7 z8 L. H+ m: A" F
its handle to be opened and then, will be detected.
9 t u; }" V5 f$ ]& ZYou can check that simply by hooking Winice.exe control proc entry point
2 _2 B9 g% B0 u+ v kwhile running MeltICE.+ H% z7 O) r+ C# P7 G* T, f6 P
' K; G/ s8 ^2 s6 M# P
$ d. \0 c' a4 n" M0 d7 G# X 00401067: push 00402025 ; \\.\SICE
, _% P+ Q; u* E$ t! Q8 r 0040106C: call CreateFileA
0 f( M3 ^* N7 h: X: I% s 00401071: cmp eax,-001
, s/ z; V7 k+ J4 ^ 00401074: je 00401091 o( E4 k7 v* I2 E! s
. {- T5 \- T1 a7 [; O, R
& u! A3 H/ z% H: J" t7 z! i$ HThere could be hundreds of BPX you could use to detect this trick.
0 d$ E0 j \9 M `9 w4 t, s- k$ y-The most classical one is:
+ Q- a6 s% m) A7 e& e$ i BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||5 {, p+ S+ C3 @9 A1 R* [. V
*(esp->4+4)=='NTIC'! a1 J) ]! y0 j1 l8 U
" l+ n+ E9 n% i/ |% o2 P-The most exotic ones (could be very slooooow :-(
! H% K0 D. j2 g- f3 H( _ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 c: R3 u% B% J$ V4 C
;will break 3 times :-(1 z& z. ~2 Q6 E1 e8 Y1 b, | R: c
- R& g. j8 Z3 [0 \( b7 Q5 W' ~-or (a bit) faster:
5 R& i' W9 x9 y- G" w+ e/ Y# R& e BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 [3 C4 P& B# Z7 g4 B
v- ~6 o; d. Z: l BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' D7 k/ d6 U0 P. @( X
;will break 3 times :-(
) f) ?0 m g7 A$ Z8 R# G' @# I( U! ~
-Much faster:2 `/ M) C: R% f- X" a
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' _/ P. E7 {; H9 n: z$ u4 G, F
$ c s, b) F% K9 b% rNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ j2 F" X6 @* O( M z1 V' s8 Nfunction to do the same job:9 R2 J* Y- u4 L. G, D: t* R
. L: g# A" d+ l: q5 j7 e push 00 ; OF_READ
9 e, K* J ], G6 K. Z7 J mov eax,[00656634] ; '\\.\SICE',0
+ @ k# U; A* n3 J$ Z) e( F9 z! f. E push eax
8 h$ t9 o# O5 E8 t call KERNEL32!_lopen( L7 [) c: L2 `' K z7 Q
inc eax
8 ^+ ~: u& t# [ X/ w) `% } jnz 00650589 ; detected; d9 q6 A& y+ O6 E
push 00 ; OF_READ
. W' r3 I/ a, D6 `5 ^ L b mov eax,[00656638] ; '\\.\SICE'4 I# L3 [3 m% |6 W7 W/ l+ ~! R
push eax$ L# W* O" K* S4 n; F
call KERNEL32!_lopen
) O6 k- L+ ?5 X/ n! p inc eax4 g$ E+ W8 D! p* c) i: T0 Z$ V6 E
jz 006505ae ; not detected1 A1 S4 _* i& n2 M4 ^
$ C" ~" d0 l" U/ T4 |4 O+ S
# c$ ?9 Z3 H; l# z& Z. U% x; X1 H
__________________________________________________________________________
4 N8 Z2 h" Q$ U; r. g1 o1 W1 V0 J& e3 l
Method 12
1 L6 A6 p; @6 @; _; a1 f3 Y: t1 R" F=========* z2 m5 W5 D, D* z5 @/ R7 r+ k
2 c; f2 u4 D. @
This trick is similar to int41h/4fh Debugger installation check (code 05
_1 v3 |$ n% p' `0 Y) t% z& 06) but very limited because it's only available for Win95/98 (not NT) _ z, s# ?; R
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.+ n" H: x+ |5 c7 Y% L
1 [3 ]( T0 i9 F3 f* N" k push 0000004fh ; function 4fh
' V% G* r. A1 v3 s- A+ `; s; W push 002a002ah ; high word specifies which VxD (VWIN32)
* j3 u. O: R5 F7 g' u ; low word specifies which service
. s+ v/ D5 A# U7 B/ b (VWIN32_Int41Dispatch)8 s9 D7 `' n* Z, t4 C
call Kernel32!ORD_001 ; VxdCall
8 P5 A- D9 D; u5 w! L% w' r cmp ax, 0f386h ; magic number returned by system debuggers
" |" r! n: ^- G+ _, G( P# x+ m jz SoftICE_detected
3 Y$ H2 s' W/ Y0 I5 V8 S5 y$ N5 O! g6 e% }+ x
Here again, several ways to detect it:' X8 n$ u+ B! H3 V
+ p- ?0 W* L' ` BPINT 41 if ax==4f
- b; S) e/ V% F& ] q4 D5 Z9 X b7 S, P+ u5 t& L# Q1 l: c( t
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
! n6 u: z1 U K9 c# Q7 @2 ]/ t9 n
7 U" S1 Z( t5 b) Z+ w$ x BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 D( n- w. T: B1 q
3 t) z' H% {4 ] U BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!/ E9 {! K+ C. s) j
! V, c0 Z1 V f# O# p, i
__________________________________________________________________________
7 }! `6 G$ B, t# X
# T3 u' ^5 E7 n* E7 L* nMethod 13
+ X# {6 q4 Q. w2 K0 M) Q* |, q=========7 ]! _) K5 G$ v
R( {0 k! B4 x U* S w$ o
Not a real method of detection, but a good way to know if SoftICE is- s, t! F/ x% V( Q. }8 _- D) U& b
installed on a computer and to locate its installation directory.
8 |) z1 G8 G8 H8 G) mIt is used by few softs which access the following registry keys (usually #2) :
& k3 V+ @8 U) k9 z7 U- ^) E
! s7 w1 }& @, U4 {5 ?* c, o-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 U$ [) Z) e# e, i\Uninstall\SoftICE- Q' V) e) s" ]- Q% U
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; I1 c: @4 I4 l- B, s0 r9 r O" ?0 [) p
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 n* Q* w# ^9 P/ A; H
\App Paths\Loader32.Exe" z; o. Z. x! Y
+ M: w- ]3 L1 h/ f. u7 c$ w! R, K$ {2 W9 T, i) [1 x9 K
Note that some nasty apps could then erase all files from SoftICE directory
. d* H7 q+ ~( u4 ?9 R; w2 l(I faced that once :-(4 {" B, t1 T7 Z- L
5 o: A( m( K$ ?0 F. a0 ]& NUseful breakpoint to detect it:3 H& c2 d: P; g3 h
$ X7 N4 a) W3 K4 i' L5 m BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
0 a" a0 t) f1 ]' v8 O
' Q& i z/ T' u2 \0 a# ]3 F__________________________________________________________________________
% m8 a4 a6 |+ m) ~% K
% D6 F' b# Y+ N8 Z5 j4 @- z2 }7 z6 n% N u) P( q) W0 [/ ]
Method 14
. ^$ |" b9 S% E( H========= ?! F2 d, j# a" d. Q
" N$ M6 G* N* j" D& G; _+ t* ~
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* V& d; H/ O3 D" g/ l3 X
is to determines whether a debugger is running on your system (ring0 only).6 F! r9 W v' b) w+ l
) ?8 x) o4 V4 _* I5 e
VMMCall Test_Debug_Installed
9 f3 n4 y& W [. t je not_installed
7 }$ X& D. m5 X8 z* R! e- o0 D) D# k) N0 \* u
This service just checks a flag.
" a3 U" u9 K+ B4 S/ J+ y& D' m</PRE></TD></TR></TBODY></TABLE> |