<TABLE width=500>$ o2 @( D8 n6 O* ~+ c
<TBODY>) ]# g. u" s$ \) `! @( _6 ]
<TR>
+ \/ \5 C3 J j) U* f) d<TD><PRE>Method 01 # d; n1 E; h$ O) O% P( H
=========
5 e/ J; u: Y- n" H( X: ]6 q' d" m; B9 x: N& B# r. V
This method of detection of SoftICE (as well as the following one) is* l, r k- o- N2 N0 q
used by the majority of packers/encryptors found on Internet.5 F! F$ X0 m; H4 g# [1 ?0 l+ G
It seeks the signature of BoundsChecker in SoftICE
/ D: T5 e6 k' g
& H+ `7 @$ ~$ H5 _9 C, ^& I mov ebp, 04243484Bh ; 'BCHK' K, s! H0 K6 s5 k/ H) i) F
mov ax, 04h
4 X! y8 w: ]& q- i int 3 8 x. g+ g) X4 B
cmp al,4- U5 m% G' h6 F3 q
jnz SoftICE_Detected
) o3 Z: j+ S- e, I: y. I* v! Z) J% k) n3 H. R6 w
___________________________________________________________________________2 `% F8 M* N$ W4 b# C
5 S ?" n, w0 g, m# P6 }. B5 [* MMethod 028 U- d2 d" ?9 A ~; g* s4 ], l
=========+ w# z/ k6 m: A3 o% n$ K# Q
& y4 t: v# G3 J4 t8 D( g- {4 A; F# F
Still a method very much used (perhaps the most frequent one). It is used% |5 j; p* A/ N7 `
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ F. d; ?0 I* s" @
or execute SoftICE commands...
% P8 J- H/ }3 V# o$ T/ SIt is also used to crash SoftICE and to force it to execute any commands9 ^& n8 W9 N) H& ]5 J
(HBOOT...) :-(( 7 ?/ { N1 A" C8 N% n6 c {
/ M9 m( H+ n9 [: v1 R) z zHere is a quick description:
- D. W- e$ [8 _1 @4 y-AX = 0910h (Display string in SIce windows)
. z b% r$ g, A$ z6 h" q5 K-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)% ?& `9 k5 P5 w3 N, ]" T
-AX = 0912h (Get breakpoint infos)# i) O0 b U: }# X$ G
-AX = 0913h (Set Sice breakpoints)' H. H$ e# ?6 Y# h% W4 i( B5 ?" z
-AX = 0914h (Remove SIce breakoints)
* L3 y* j. }& y5 Y
2 L" W A: M4 z) ~ t( {' ZEach time you'll meet this trick, you'll see:' J! {" e, D# V/ h3 t# d
-SI = 4647h
+ T$ N8 {3 x% p-DI = 4A4Dh
9 o$ C% a, k( ~, uWhich are the 'magic values' used by SoftIce.
h* U# A& p F6 o" M% b6 {2 [/ LFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
) [ z' \8 m) k' z# W( ]0 H, c9 W3 f6 G; o
Here is one example from the file "Haspinst.exe" which is the dongle HASP! R! U; B9 y5 G! n2 u
Envelope utility use to protect DOS applications:) K% z2 \$ ^+ g
! U8 ]) r- M; l4 A; z1 b, h/ S
& G+ {2 g/ |7 ]& B+ k r5 m4C19:0095 MOV AX,0911 ; execute command.9 l+ @5 a) o! x: ^, h) t/ |
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
+ ^2 [' g v6 w [: \9 Q) @9 p4C19:009A MOV SI,4647 ; 1st magic value.
7 m4 }& M" V2 e5 c" Z4C19:009D MOV DI,4A4D ; 2nd magic value.* S0 C% C* O7 y
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 y ]* g5 g- R; e, F4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% E7 o9 h* G6 O+ b
4C19:00A4 INC CX2 B, }6 h1 o5 v
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute8 T; n2 i2 p7 n* ?
4C19:00A8 JB 0095 ; 6 different commands.3 x4 \/ q1 }' D+ a5 j) M
4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ o9 z; w! c! c- C3 M
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( G. p0 f, `" J! ~+ i5 K: ]# `
! M, A9 {' M4 s8 \7 _$ x" q% J, |0 B j8 gThe program will execute 6 different SIce commands located at ds:dx, which/ c+ [2 G- }$ w. R5 G$ m
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.2 \" n0 b) ~5 r# ~; P& P5 `/ o% d
5 d$ v6 c2 N' T4 M* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( J2 C J% w; {: C4 g2 k) l___________________________________________________________________________7 k$ R6 X! K1 a2 k
( ]/ I3 w1 P0 a$ x" V( ^0 C
2 x6 I5 O- M# v+ N+ G2 KMethod 03
* ]" j+ q; p. a+ t, ^3 R9 ]& q4 i=========, x0 z9 J. A% Y H8 ?$ Q
4 d3 i( M% Y* J! o5 T. ?5 vLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 D' t, S0 V! R4 Z. l1 `9 V
(API Get entry point)
3 Q- }, o; [- m" j
/ V d) a) w, C `+ H6 f# `; P/ i4 H) L- @& X2 H0 q
xor di,di
' ], D. t7 Z9 O1 l( Z mov es,di, k0 z+ G" U4 \
mov ax, 1684h
: r" d3 s3 |2 h J mov bx, 0202h ; VxD ID of winice( C2 L& B& N! C4 B5 y! |
int 2Fh
! a$ F: D, L% V mov ax, es ; ES:DI -> VxD API entry point: `7 W( C; J' I/ ^" m, E
add ax, di
1 a ]7 j3 n' J test ax,ax: q8 P1 b" X! ~8 u
jnz SoftICE_Detected$ i( q+ M9 x, P8 v1 R4 I" @# r
. J; W/ ^& T9 {) K/ T" j* i
___________________________________________________________________________
7 x& l+ Z" n( G) H
9 u4 `' @) |4 U' ZMethod 04. @% r* J& T Q
=========3 W2 U$ e3 H( h& N" |
# Y- k8 _; z8 H$ a/ Z. xMethod identical to the preceding one except that it seeks the ID of SoftICE
# T# J. J, g4 p0 L4 A9 {: Z, _GFX VxD.
2 y5 Q$ Z. f( {! K! P! L5 O: m# y6 P' b6 O3 ]
xor di,di- I) r3 n% h e, s$ H
mov es,di
_+ I' H9 J/ s$ X# {. x) A mov ax, 1684h . s( z! P" U: Z+ D. o) ]+ }
mov bx, 7a5Fh ; VxD ID of SIWVID
Y, N! r% m0 F N% V' ? int 2fh
! g K( r( u0 r- x$ S A1 G4 |) L4 U mov ax, es ; ES:DI -> VxD API entry point
: X: ?& e" @7 x2 K' c! m add ax, di% \: B( b8 S) Y4 f( X6 A
test ax,ax
6 t; S, w" \7 o4 X* k; x& w jnz SoftICE_Detected. t0 i8 Z: ?+ F7 o
! r% E' a4 M' T: K: m& t
__________________________________________________________________________5 r2 f; h: Y" o5 h
& e( [: B3 u8 S0 B; F+ N! H) _' x7 J4 A. F8 s- c- q
Method 05
0 t: n# h3 O; e% J; m* g' C=========6 }5 Q9 e+ K% x+ c1 {
1 h* V3 N5 C; ]+ N: }( o& W
Method seeking the 'magic number' 0F386h returned (in ax) by all system, Z( v' ]: a$ ?/ I5 g5 G; h. ~
debugger. It calls the int 41h, function 4Fh.
n2 R# |2 e; S* J! {4 b4 HThere are several alternatives.
5 `! T8 Y4 i+ S& L. M$ V4 H; i/ J( G6 z9 ^, B2 u
The following one is the simplest:6 a7 {# k9 c: I2 }$ {
- k5 S# h) ]/ |$ V9 Q, y
mov ax,4fh
6 l; S+ J/ i' x# k% X" Z0 W int 41h# f0 o! j" d* q! w5 i( V
cmp ax, 0F386
; l" k2 l2 T7 y/ z5 c0 R1 V jz SoftICE_detected
8 j/ O8 e& b/ K( \' O* j
7 S* C+ |4 c1 X" D6 e: `) f3 K- c" {! M9 X" C; \! u) ^) i
Next method as well as the following one are 2 examples from Stone's 3 p; C( n4 g' V7 q- ~
"stn-wid.zip" (www.cracking.net):/ s8 b ^3 P& K' |" X
; s1 G3 E {6 ~ mov bx, cs
4 V% e, Z9 i: ]: n- o- X% A lea dx, int41handler2
3 u3 \& W7 D2 \; p5 O xchg dx, es:[41h*4]
* i9 s1 B' u5 Y+ g3 Z3 [4 u xchg bx, es:[41h*4+2]9 j5 h ]2 @) q9 f+ \! B+ o
mov ax,4fh
1 `* l+ [# l2 ~1 d3 F6 B: Q int 41h: f2 A' e6 G1 C! y& V
xchg dx, es:[41h*4]
% e5 F) t) T( ?- ~' ? xchg bx, es:[41h*4+2] H8 @: H f W; z5 @+ D- @
cmp ax, 0f386h
2 C% r9 l8 G+ M1 g5 @/ x& X jz SoftICE_detected% B, c; T- j+ l3 B) k, l
7 p0 o' C: j9 r4 Q. K) \int41handler2 PROC$ M( e/ U$ j# O' O: y) b
iret
+ |4 V8 U% ^* S$ Yint41handler2 ENDP6 s" ^0 y6 B3 J. Y t" ?
2 w l+ L& \, q% [. z: b" z/ P l" d
7 B8 O1 _3 n9 K3 J, U. _
_________________________________________________________________________! W' s) A" `# ]; v8 T
$ e+ Z( f: }7 c o8 R
; l$ }, C, P2 m& ]7 L2 X, a
Method 06# ]5 ]" A- U( @. ?6 V
=========
: i; y3 f9 R w; V, j+ E
& m7 X7 E# h2 v5 c) W2 z5 \- K9 `$ f. ]7 n- Y
2nd method similar to the preceding one but more difficult to detect:
# s$ U' q( g" D" ~% K" F7 O) Z! K8 E+ z
/ ?3 f. P5 [0 v. k0 x4 Y3 Kint41handler PROC
5 [( u1 V( `3 U" S9 w: ]- l' ?$ Q mov cl,al
9 D6 y' E# L! m4 N8 O iret
# D" k/ a( [4 _+ ?6 eint41handler ENDP. Z/ O" N1 v/ o6 p
# R0 ?& {9 }1 d' k Q. c) D0 S$ R0 g* z. h3 |; \' ^
xor ax,ax
& T8 a* R0 }& e! {0 g' `, D' v mov es,ax3 \' {0 @* U# C% V! G
mov bx, cs
5 t) j( x1 n: F4 s* Y lea dx, int41handler5 v3 u4 J8 {) N7 h0 V# Q/ I: a& @+ {
xchg dx, es:[41h*4]
- a0 |2 y" a! @! U+ G xchg bx, es:[41h*4+2]1 c2 Y* m& R$ V2 z6 ^! ]2 P
in al, 40h
5 E/ J6 _: j% B" M6 t7 O/ I xor cx,cx
* a. b- Z* J) E6 N1 G8 C int 41h
, ?6 Z( J7 V9 g) D xchg dx, es:[41h*4]
+ @9 }$ g+ a) X% z- d' Y; D xchg bx, es:[41h*4+2]
! [. |/ H' t6 J8 A cmp cl,al
$ u8 M6 L" f% [# N- _ jnz SoftICE_detected
3 H3 N6 [! i& t6 V. ~; l$ a0 j* g0 Y9 J
_________________________________________________________________________6 a7 a. v/ O# `' N2 k- I
2 y& k3 Z( O" I: P2 I- vMethod 07
8 b3 p3 f. R# R: o=========
+ C/ B6 h. |# o% b
: O% k7 n8 b( Y L7 x7 WMethod of detection of the WinICE handler in the int68h (V86)$ L2 n$ R3 X4 v. `( }3 i
, n: v$ P/ N. H4 l9 J, N; v* b3 J( c mov ah,43h$ i$ }! }0 n/ `: D( S% F" B W
int 68h3 g) W* s3 N; V7 G
cmp ax,0F386h; @% q) ]" i2 b
jz SoftICE_Detected/ s' r: y& ?5 l: t8 i( \7 f) S
' j7 f; j; Z$ @6 Y) ^0 L9 X+ l
- {8 c! u7 {2 ^8 l9 ^9 g) Z=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 J* u6 e# N8 k# O* L app like this:
' ^2 J8 r" E0 b8 E0 N) s# M1 V
& _1 x: G6 T7 {7 w% g; z; ? BPX exec_int if ax==68
, G, p$ V, k. {6 f2 n (function called is located at byte ptr [ebp+1Dh] and client eip is( F: ?- N- ]1 T0 u4 I
located at [ebp+48h] for 32Bit apps)
) j9 U. s$ C5 |* ?5 O. C2 i6 C__________________________________________________________________________3 W% o- j" M! s# n0 ^( [
# I; W. i' h* i6 `
* D5 m* Y" c5 s0 r9 n# p- GMethod 08
. l2 Z" ]9 K2 ], B2 ^; z) Q: H=========
; h Y1 `4 R% F7 K9 t! l5 U& X3 l8 D/ D8 V8 |. p, F/ P2 [
It is not a method of detection of SoftICE but a possibility to crash the* C# ]$ W* q* B* p5 E8 x* T7 m$ ?
system by intercepting int 01h and int 03h and redirecting them to another
" {8 E0 Z2 S4 ?7 Y9 m9 proutine.8 b6 u& \" O( `" R( H
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. b F/ v2 s& ]. E9 a
to the new routine to execute (hangs computer...)
! q! W! |1 W7 A2 }4 W4 p! z! \" [& h7 S* T* K& S
mov ah, 25h9 o' z7 [' f' N7 ^( P# M8 f. }
mov al, Int_Number (01h or 03h)
" S; G/ {3 m7 b- `5 \) i mov dx, offset New_Int_Routine
2 Z- p5 d# ?7 O3 _4 u' |# e0 Q int 21h
! o' ?( M- w6 J( p/ T0 i# @ y7 @ `7 k2 ]
__________________________________________________________________________
. Q! K6 A; y: D u
4 t/ K6 ~1 L" g$ U) W" {4 A9 {Method 09
! y1 n( E/ u; G6 B# `$ s=========
7 e4 n2 k y8 X0 p9 c' U: `8 g/ H/ \0 ~' b- a& o* z m% u: R
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) _) F( @% w% d8 pperformed in ring0 (VxD or a ring3 app using the VxdCall).
! U& C' B) z! Z6 G3 n- v8 QThe Get_DDB service is used to determine whether or not a VxD is installed
6 n( c" y0 l, z, `3 Vfor the specified device and returns a Device Description Block (in ecx) for5 Q$ u& L5 s% l! t2 s" a7 N
that device if it is installed.% B; G) O& i9 C
( ]! ]7 D( J& h/ i- n) I mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID8 }9 s7 T {; z# r1 ~3 z. k
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 V9 D3 T* }7 T# ~# T7 F VMMCall Get_DDB
A8 @5 x: \; k. N6 U8 q) Q mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed, P; a6 D# g4 |6 Z2 [4 v: A
, F8 L5 u. h& G/ R5 B8 d' pNote as well that you can easily detect this method with SoftICE:
7 @2 i; {( D4 K( ^ bpx Get_DDB if ax==0202 || ax==7a5fh) c& a" n$ s' v
4 i2 l- F, L' @" P0 }( ^
__________________________________________________________________________
6 ]% w1 K: O( q# J' K5 }: F9 S( i: f1 o
Method 10/ B2 a! G& j! {( s5 F& B
=========6 C9 \& H- y$ N# T! K! P4 h1 R
W% s- a7 ?) V=>Disable or clear breakpoints before using this feature. DO NOT trace with, Y3 q+ {0 u: Q- D8 L( L& {
SoftICE while the option is enable!!
; E; m7 ~" [# z, c& N
8 @1 ~0 x) }6 W2 ]This trick is very efficient:
* } v) e7 N$ O$ O( [7 Lby checking the Debug Registers, you can detect if SoftICE is loaded* t* J; t$ r+ d8 t6 U z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# l" C* n; O5 i F% Xthere are some memory breakpoints set (dr0 to dr3) simply by reading their
( }3 X! `" I9 v& H4 g L5 P; }value (in ring0 only). Values can be manipulated and or changed as well
. y" a2 z% P: }! c4 @3 t f(clearing BPMs for instance)
0 S5 }" I9 O1 {3 r! a2 S3 ^7 b6 ^" D
__________________________________________________________________________
5 C4 g& z, d2 `. p
: K; X3 W) h) Y0 b. B6 MMethod 11
5 T8 l- j+ g3 J) D1 H' y/ y& k4 L" C=========9 T, j5 m2 q- Q$ r' \
2 G! {4 z8 C, b+ m5 f* c# g7 f
This method is most known as 'MeltICE' because it has been freely distributed9 Q- X' H! N$ L8 I# Y. J" I
via www.winfiles.com. However it was first used by NuMega people to allow% U3 C: H& r/ f9 P6 l
Symbol Loader to check if SoftICE was active or not (the code is located
. d3 n. q2 ~, Y- m0 q5 V R) Yinside nmtrans.dll).
$ k3 Z) D. m. k4 V( v) m9 E6 `- `0 k2 N4 u7 x) Z
The way it works is very simple:* y0 A+ J! |% D# T. F* S
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for. }6 Y U) e' |$ h! M5 p& f
WinNT) with the CreateFileA API.
) d9 K$ y) M9 {0 S/ Y0 k
& Z: K3 [+ V G. m( N4 FHere is a sample (checking for 'SICE'):1 l7 R: G$ C( u% f! W1 l
, D5 K2 f* `# R+ n6 J
BOOL IsSoftIce95Loaded()
4 a* r/ x' l8 h: y{4 s( H W U5 a, I& \, O& Z
HANDLE hFile;
$ F% e+ a. g( S/ U; f hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 }; |: R( k7 C FILE_SHARE_READ | FILE_SHARE_WRITE,
. H, `0 p4 |( J1 c! K NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( g& c& `$ u5 v3 O3 w7 [0 n4 Y& ? if( hFile != INVALID_HANDLE_VALUE )1 z4 V4 J6 \1 j U6 m: a4 p' V) v
{- ]" d8 p0 ?# F0 L
CloseHandle(hFile);
9 |& l3 q9 F' M& X' O3 K return TRUE;
9 o! |# G' d- h z+ M, d }6 Y# B$ t* ]0 x# \, q7 |
return FALSE;$ r& r2 _/ I7 r7 _" E1 q
}
+ w. N. T( {0 e: ^2 x
6 @$ v6 H) t% N/ E4 iAlthough this trick calls the CreateFileA function, don't even expect to be+ t; @3 R5 R4 T2 t- F5 y
able to intercept it by installing a IFS hook: it will not work, no way!& v V! }; q- o
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 a3 _& {$ a! B* H) Oservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ x% N9 v' \" y Z: X7 g
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
& p9 T2 B6 U6 {) jfield.$ U2 J+ X. L8 C: S @. N
In fact, its purpose is not to load/unload VxDs but only to send a
$ B$ d$ ~/ e+ e* S; FW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
2 {$ J5 X: ~2 ^7 ?/ pto the VxD Control_Dispatch proc (how the hell a shareware soft could try
A" H; u1 s; T6 d {to load/unload a non-dynamically loadable driver such as SoftICE ;-).. `/ r, D: X$ c& C
If the VxD is loaded, it will always clear eax and the Carry flag to allow
5 g4 K1 Q0 U. f6 a9 y K- r- ~6 |its handle to be opened and then, will be detected.
2 \; ^2 h m$ zYou can check that simply by hooking Winice.exe control proc entry point( Y9 w; v9 F5 W( R! _; z
while running MeltICE.0 h0 j9 g2 S2 b' y
5 t) q# f F2 h* E+ ^. z
+ X% t6 r* Y, { 00401067: push 00402025 ; \\.\SICE3 ]+ y% g% }5 q6 v
0040106C: call CreateFileA
1 q0 Q( a' D1 I: o0 M( P 00401071: cmp eax,-001, a- z' R+ i# `! y0 h
00401074: je 004010915 C+ y- x7 T. e$ a: M' W
* b5 x G6 s$ L0 b+ R2 D( H
5 U- Z+ ~9 a) T" l
There could be hundreds of BPX you could use to detect this trick.
6 G! B4 w- [7 p-The most classical one is:
' L1 o; W& N0 @9 S& C: {( O BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
% X0 \* Y! R, E! ^* Y *(esp->4+4)=='NTIC'; K- J0 x9 D" {6 _
' ]: s0 d I. G- [' u
-The most exotic ones (could be very slooooow :-(
6 H0 r6 _5 ? N, n BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
0 `) u3 L( H4 m1 |0 w ;will break 3 times :-(
4 b4 `$ q8 Q$ p8 V
7 s( Y( N- ~2 O! ^- K-or (a bit) faster: . Y, j! b( y' Q7 X7 S. @
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 v4 i! `4 E+ Z: V7 @3 \; f
( x0 c0 w. d K$ e1 ]/ _2 N: T* L BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
6 n+ u4 b) M" H1 ]- [9 F( w8 K ;will break 3 times :-(3 Z! y5 z0 h4 Y9 b' E S
! p% [% {6 X, O: N7 R5 h2 Y) p( B-Much faster:& i a1 X! I# b2 t3 j
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* T3 }- }( `- \5 Y+ [ i( O. {
2 H" U( M) h/ r5 c7 B7 [6 t: f0 |Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
M6 Q; D9 H" X9 B* f$ nfunction to do the same job:
* X* X- }1 a! b$ c% f0 j6 p
2 B, J0 c6 e7 [/ s9 M push 00 ; OF_READ- w0 |0 F$ s5 _8 F, a' c* ?5 L
mov eax,[00656634] ; '\\.\SICE',0
9 M7 e! g) @; G/ a push eax( B$ _* |. p0 X/ r1 ]6 w
call KERNEL32!_lopen
) J# q$ }* s9 \) B5 e) W* U7 Y& B inc eax% \: \& q" N* A% @4 }4 \
jnz 00650589 ; detected
! B2 H0 f9 U: W6 O1 g K push 00 ; OF_READ8 ~: r* F2 g$ ^/ q8 [
mov eax,[00656638] ; '\\.\SICE'# S- |" U4 f3 H6 H% y7 U
push eax$ L) S( h( V9 I, X5 ]5 z6 g
call KERNEL32!_lopen* j4 }) A6 f% T! S }( w1 ~6 F) X
inc eax, \ o5 C( T0 M0 r: F
jz 006505ae ; not detected- M2 c, ?5 s. S, E8 s" U
* D, S& @0 D) d6 z- [' G6 ^) t+ f. q8 r+ N ~
__________________________________________________________________________
! I* M' y' h( W( R6 ?: P2 b Z0 M$ f0 H3 H+ c) S
Method 12
: o" E* W$ M: f=========3 |+ _; ^6 Q" q; A& Q' R
, ?9 Z/ C& g) S$ C7 bThis trick is similar to int41h/4fh Debugger installation check (code 05) g' _# H8 d( {; |/ @
& 06) but very limited because it's only available for Win95/98 (not NT)
. M5 i% [% f4 j$ qas it uses the VxDCall backdoor. This detection was found in Bleem Demo., n( b4 S. T" a2 q
0 T z" F8 ^! t push 0000004fh ; function 4fh9 |3 A4 a* M4 l; m
push 002a002ah ; high word specifies which VxD (VWIN32)
; K9 i4 Q7 o# @5 {9 w6 r! d7 h2 R ; low word specifies which service. x" \- B6 [2 |" U( \9 ~. i$ Z! x
(VWIN32_Int41Dispatch)6 F, s0 } A8 g5 _
call Kernel32!ORD_001 ; VxdCall
+ V1 q: }$ D9 W9 `0 z; z cmp ax, 0f386h ; magic number returned by system debuggers
' m% ]$ i E# g0 J9 Z" h# O0 K jz SoftICE_detected
$ [; S L' I7 @1 |7 w n( l% t J* \" k G0 Q
Here again, several ways to detect it:0 ?% l' F( w3 q2 h) ?' R& D
- u% i. z$ e' S t: u3 Q' u BPINT 41 if ax==4f
0 }. a( ^2 a3 W; I9 _4 E9 U* N- Q; L$ h1 _/ ]
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
. j7 n9 h5 [ v; @, k6 y
/ x" H: K, r F5 Z% x: ? BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A* f' I. j, O: U2 F6 B' t
3 Z6 O0 f1 s$ O* l$ T' @
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!/ ]0 Z' a' M: }! v2 y; H5 B
4 b9 W H$ v6 Z( p# x
__________________________________________________________________________5 e) f, `: w) _0 w" J- I
) l t# v1 S- l8 n: w7 [% ~( \0 U) VMethod 13
* h3 P) M7 _8 D7 m+ Y' w% u=========
+ i$ {' l5 x6 Z0 [
/ j7 U7 V/ A( V4 GNot a real method of detection, but a good way to know if SoftICE is. p6 A( `7 v- V
installed on a computer and to locate its installation directory.
) e# U' b/ A, `, X5 i, n, JIt is used by few softs which access the following registry keys (usually #2) :
8 q+ d! k, Z5 F; x3 T- `9 j
% @& A7 @& L/ z& L6 Q* A-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- S" [" f8 j2 Z: H/ E+ r% g4 b\Uninstall\SoftICE) Z& H" r! l+ X
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
& Z. n3 H! V3 q) ?-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: B7 j3 E+ u# @: [2 z$ W\App Paths\Loader32.Exe
2 P$ I( _! Q5 w# t
) q8 H; m/ O# h# h
J% g; v$ f: RNote that some nasty apps could then erase all files from SoftICE directory
% Q) X# R" Y- [4 [2 Z. q(I faced that once :-(. r/ [- N+ B- W/ ? v7 a
" r# [6 D* S. u3 s8 U
Useful breakpoint to detect it:5 ^4 E) z4 S7 u! M, l! C1 L1 c
2 P9 s, d' ?1 O3 R4 {6 O. g4 t
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
* [3 e1 h0 Z2 T* D' M
C) |. P2 Z# i) P* j__________________________________________________________________________
( i$ [9 u2 p' I: Q2 z
3 \( ?" R, [# n7 V* E4 y* ?/ D2 T4 V) w, {4 E( B& c7 f% g
Method 14 0 g( @3 g- i+ @6 B" i
=========0 l z- {4 H1 V; d4 V, s
2 k/ v% U; f( X/ v' C0 o
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 M) ~4 ?+ [8 e5 p9 {
is to determines whether a debugger is running on your system (ring0 only).
* b* F5 t; Z/ t P: [; o0 o$ ^) m
VMMCall Test_Debug_Installed
# _- z$ R( [/ |' u5 h je not_installed9 X9 K& \) D" A/ d
- i" A @/ j4 c1 k! r2 t9 f s' e
This service just checks a flag.6 R: ]% G/ E- f( ~" Q! A8 U
</PRE></TD></TR></TBODY></TABLE> |