<TABLE width=500>
p, U0 s5 J, S5 m, }/ X<TBODY>' ^# S% z# p+ D! C. v' W) p
<TR>
& t; Q4 U x8 [$ h; U/ [) W5 l1 P<TD><PRE>Method 01
7 }9 j- a( u J( s, N6 O+ {=========/ c# _" _$ t6 h0 p* u7 ]6 g" i) g
5 f' T7 _4 M4 S& G: v
This method of detection of SoftICE (as well as the following one) is
2 o k' Y9 H+ c/ Z iused by the majority of packers/encryptors found on Internet.% u! n: L! W7 G/ |
It seeks the signature of BoundsChecker in SoftICE
$ r2 \$ B) ]' J/ e3 o# p' A
: D1 {6 k9 @ s5 s1 ^# z mov ebp, 04243484Bh ; 'BCHK'
- l' I3 R! c% J8 o0 W mov ax, 04h
3 | R i1 ?* `" L3 I9 p int 3 $ Z D/ u' ^: Z& m/ z8 b0 ]
cmp al,48 ?% L1 X. C6 s, `
jnz SoftICE_Detected
& x4 J8 E! ?' q+ q Q' h
) }) @# J% [. G4 ^9 c___________________________________________________________________________4 X) R+ Z- B+ L+ i/ v
0 x; h$ X+ H$ [" ?' c& \Method 02
" n. {% w3 A/ b H }" B=========0 _( t6 C3 B8 |8 F6 R3 p
8 _0 Y: o4 u) E/ V' W0 L
Still a method very much used (perhaps the most frequent one). It is used2 j- ?( g, u3 g9 o
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
% F0 V! p0 l, e0 f1 e% h/ a5 k; Nor execute SoftICE commands...( V7 V3 }9 s/ O0 G; c
It is also used to crash SoftICE and to force it to execute any commands# i8 ~: _4 k4 o: E, C, n8 |
(HBOOT...) :-((
! ^; j* O9 s5 x, U2 F6 l
+ X' H8 F! {/ ~) [Here is a quick description:
8 z- n1 R$ b, e: Y% i* Q9 @, x( a-AX = 0910h (Display string in SIce windows)
! [, T5 Y+ s+ i0 |' P-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 [) `. F9 o4 c
-AX = 0912h (Get breakpoint infos)
, O# [/ E' ], G! n& R-AX = 0913h (Set Sice breakpoints)
( k* P: @) o$ F-AX = 0914h (Remove SIce breakoints)& I( Y V( Z9 D9 P; e/ R* u& j% A( e
% t& i% R, Q6 F, H8 ^6 X
Each time you'll meet this trick, you'll see:7 s5 V- G8 c! ^0 y% W q1 U
-SI = 4647h
. Q4 ?8 W3 s1 o2 f- k, b2 M8 }-DI = 4A4Dh* x$ V9 c5 G; N- Y+ {) x& ~
Which are the 'magic values' used by SoftIce.
9 p5 x8 A& f, lFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ P. i& C- d$ p# i
" X R) N E! f% o# J
Here is one example from the file "Haspinst.exe" which is the dongle HASP# Y }7 _; ]: \& s! ?
Envelope utility use to protect DOS applications:
3 ]# g7 f6 t, B `+ t! [) W6 G
# K ?$ K( k3 G1 R" l# D5 ~7 i' t. Z$ z( R" a
4C19:0095 MOV AX,0911 ; execute command.
; ^- V) N( s! r6 C( B0 a4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! Y% I( f$ D! I$ z* E# H Z5 s0 g4C19:009A MOV SI,4647 ; 1st magic value.! R P4 z1 \( C" ~2 w8 v
4C19:009D MOV DI,4A4D ; 2nd magic value.
4 ^( q8 ]0 i: ?' F7 C4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)/ X2 {2 ~- V1 M7 d1 m2 j
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute- v$ f" t! c* T, v0 ~6 E. h. Z' |1 A
4C19:00A4 INC CX
8 S: l" p" I" d7 E% ~4C19:00A5 CMP CX,06 ; Repeat 6 times to execute9 V+ `1 H- r2 A" F$ J9 r1 _. `
4C19:00A8 JB 0095 ; 6 different commands.
1 |! K. R" M; F, m5 l+ J1 v* `/ P4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! {9 e3 z9 s6 J# U# M# S2 A; W4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
3 H; Z3 d/ m' U4 @
: Q8 s. s/ f3 Q: O" xThe program will execute 6 different SIce commands located at ds:dx, which$ g+ E3 L$ m4 Q7 O# O
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% k) T( R* J% I6 H, A& m: T+ ^! ?0 e& A0 c9 T! \ J6 K
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 j% k. F+ l4 H. c% M( M- ~' s8 x___________________________________________________________________________
7 x; [0 K) ? _
7 v5 w; ]- E" R8 j5 D0 b4 L, v2 N- h$ Y
Method 036 Y/ Q- w& t! z; {& x. ^ N
=========0 v0 Q7 \+ z. C9 `4 M0 [- o4 R: b
7 G- e6 ~' i3 H( x# Z' `
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' ~3 z7 V) A) R4 q(API Get entry point)6 Y8 @: N4 Q9 d4 x% j3 j% b
6 T1 m' ~) f, V# _6 q& I( ?& s) |) [, x# u; v
xor di,di; j- ^" ~! f% L
mov es,di5 ]$ `2 C# |/ G2 }. f$ m
mov ax, 1684h / b( _( H9 x, z4 N8 A0 E% e6 N$ ^. S
mov bx, 0202h ; VxD ID of winice9 Z) t! U0 z0 H
int 2Fh8 h7 F0 q [6 H5 W
mov ax, es ; ES:DI -> VxD API entry point% O( y# f2 O$ @8 |5 }5 d
add ax, di
0 A( M% K# C4 ?- y! H% ~' P* P( @4 Z test ax,ax
* O- g6 l% o% m! n$ D# h jnz SoftICE_Detected, o6 V% c* [5 F! k
& @1 Q# j" k' p& ]
___________________________________________________________________________! A4 W O0 m; ^; \1 U' p3 ?
' N9 n5 ]7 Q- U4 w7 `% J
Method 044 o$ o8 {8 |4 {7 g, U* g
=========
* n% F" P4 j( |/ n1 ]6 K8 F8 j! |5 H$ p4 |1 F$ W* m, x
Method identical to the preceding one except that it seeks the ID of SoftICE# t4 t) c9 N8 g3 }$ |4 p% G5 x6 m; a
GFX VxD.
3 i2 g$ R7 }) ]$ k, C& O7 r3 A. L
xor di,di
# G3 Y c; T$ K4 J$ B mov es,di0 V8 {6 m* t. k9 `, J" S
mov ax, 1684h ) [+ `0 Z! b* j7 \ L; o
mov bx, 7a5Fh ; VxD ID of SIWVID
8 w) a; m2 k% K* {: E* ^ int 2fh. ~& b) n7 g" P. P
mov ax, es ; ES:DI -> VxD API entry point
/ n! C8 ~% V5 g. i# \8 o: S( q add ax, di
: o: O* a( D' v9 j% l: G) \& o test ax,ax" ^+ h8 G8 e1 m& d# C3 s
jnz SoftICE_Detected
% T( O) L8 |$ A0 z* Y# |4 F( O7 r' \4 p+ R' R. U1 b
__________________________________________________________________________
+ L* W h7 H7 S& U/ L; W3 c+ y$ q5 D% ^' I% Q. f0 Y# V/ H
9 C! h6 H# s* h4 m1 m6 ?6 d
Method 05
3 P3 w( `0 O! G1 b% [+ z=========, G/ E" f; y1 n4 u6 r
1 k; x. h5 S6 ^' Z" ]+ b) J3 v
Method seeking the 'magic number' 0F386h returned (in ax) by all system8 R7 [- U0 C: v( n. M$ B7 i8 l
debugger. It calls the int 41h, function 4Fh.+ z0 O- ~; D: K4 I1 F$ v) ?
There are several alternatives.
" T+ d' L# T7 m7 @# n- M5 o7 F* `
$ H3 c4 w" h5 `8 v5 V) IThe following one is the simplest:4 {$ A% x" b# z! s1 n& M4 V0 ^: I* J# J7 E
; s* |8 Z% c; }7 c% n% E& [7 u0 j
mov ax,4fh
, U: w7 v7 i+ u int 41h
7 ^7 | m7 U& i9 x* T, K7 H+ U3 G" W cmp ax, 0F386
% e: B/ a! I4 {; O% q6 S jz SoftICE_detected7 |. Y' Y- E- F$ w& k3 e
# \# i- E6 e& f' g. t4 ~
) e' [2 t& F2 P; f" e1 O/ jNext method as well as the following one are 2 examples from Stone's
" |( `* X# o6 k+ A( N0 J( u. e/ L"stn-wid.zip" (www.cracking.net):
8 T% m& O M( f6 C1 \, x+ u& o1 u+ s) M1 n/ B- q% z4 |2 T/ U
mov bx, cs
9 c: a! x0 O! S- s/ f- d lea dx, int41handler2- i3 g( E& m/ Q* ^0 ~) ]6 t! @
xchg dx, es:[41h*4]
; y3 x1 ^/ F8 L9 @/ N# W xchg bx, es:[41h*4+2]# {/ b6 I4 [3 I1 R& ] s1 `9 B
mov ax,4fh
7 A& G6 @' z/ B/ e% ^( y% R int 41h
" ]. L+ K( L3 O xchg dx, es:[41h*4]' R4 x' ~* Y- X
xchg bx, es:[41h*4+2]/ y7 S+ \6 ^+ W' q1 J/ H
cmp ax, 0f386h M3 x. @ x' S4 _6 Y3 P" o: |
jz SoftICE_detected; ?; W% F) N! x' e) G, C& t) O
f0 c0 O) e7 Y' r8 s0 k1 W
int41handler2 PROC
0 A3 n# B+ o. o* w5 l) Q6 {5 [7 @% r iret- _; ^8 A; d& S1 ~) I
int41handler2 ENDP
* T; I: u8 b% m8 e! ?- w d! b1 K- k3 y: v8 u3 @
* Z. h# m. P7 V0 `3 k& ?/ L1 h
_________________________________________________________________________# D, y6 O; ~6 ~6 H7 a% Q
' O" S, S$ L) U: r2 X
: F: W- }" f& c
Method 06
" u4 Y$ D" w3 M" y2 [=========
: q" ?& R/ n7 q3 j" ?3 R }
# H0 o- K5 S( ^" b: T' A5 f
3 n5 J; \- `: l1 v3 A, P; Q: \2nd method similar to the preceding one but more difficult to detect:' Q( b- n! ~! M8 o' w$ \' f
+ A9 D2 {' q' B" z( V/ u9 `
% F! n. l; u+ W% ^& w# e1 B; Lint41handler PROC
; s& A' S) j6 F# S G4 p mov cl,al! D; W' v' [3 [8 M7 K
iret
; d" Y2 b" d! Y: qint41handler ENDP5 y$ I7 i" L B: I, O: J5 c" }
% b H- |. J0 ^9 W( c, e8 Y
- c1 @6 w4 _6 e: u xor ax,ax
' u& I' Z. {# A, k3 u# F- ?9 [ mov es,ax+ P$ P9 F1 ^! h5 |
mov bx, cs! X* E o/ l3 E: _8 T; _) M J( w
lea dx, int41handler$ `* X' [0 |0 G& t) K/ Z2 B
xchg dx, es:[41h*4]' a- N) p' z4 W6 S* y% }, t7 g
xchg bx, es:[41h*4+2]
2 O! x+ m0 r5 m$ N in al, 40h
" {" ?/ A: N5 N1 p, W+ s' M xor cx,cx
8 I1 ], h: {6 v7 X6 I4 N# a& e* d2 X int 41h
8 V+ U6 q' h9 h9 ]% j xchg dx, es:[41h*4]
; O6 W6 q9 x9 q& J/ S xchg bx, es:[41h*4+2]% a Z$ _3 {4 P' `$ o5 S
cmp cl,al
! G" A1 ~: \) L2 X8 G jnz SoftICE_detected
5 C6 G* T& Q- D8 _: V+ G3 n2 j( ]4 Y3 [5 @& ]. J, ^- Z
_________________________________________________________________________8 O1 i3 `. f$ ?, i
6 u# t0 j( E7 S! R# XMethod 078 K6 H5 _8 M9 Q9 ~; f) v C
========= w( I2 l4 ^0 K/ g) g
. i2 x2 A9 ^: o8 }Method of detection of the WinICE handler in the int68h (V86)3 \7 m( [ G7 @, v* d& {
- a* r5 j' v8 W5 K) X
mov ah,43h
7 d2 G- k+ j( R) E3 C. D) c/ y int 68h6 h6 }# a# l4 l$ ^ T
cmp ax,0F386h/ \* r" \( u3 L
jz SoftICE_Detected
H U' n. H2 a6 s: K% B) s0 N4 B, N) R0 ~' x% O* D! y- ^. n
' n% L$ F7 D/ _=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
Y! R) N6 w7 y) Y" b, m app like this:- |5 h; g! U, I5 N* a/ E3 p6 Y
$ @+ y* b4 l6 ?, e$ s
BPX exec_int if ax==68+ ~9 V4 D6 D( A& i( N' m
(function called is located at byte ptr [ebp+1Dh] and client eip is
% {( v# A$ s- P( e located at [ebp+48h] for 32Bit apps)
$ n X; @2 D. x# t2 k% h# A. Q: V__________________________________________________________________________
: e% |& O1 k% o2 G
6 s: @( q$ P# b! ~" j5 T
" n6 U6 ~3 X& q! w2 |) BMethod 08
( n6 ?6 p m( x/ o=========2 S$ i/ E5 q3 h- x
0 I$ h& }8 \$ I2 i% O
It is not a method of detection of SoftICE but a possibility to crash the8 d+ H: E' r7 r, U: W7 s: K6 x; j
system by intercepting int 01h and int 03h and redirecting them to another
0 J: M) H; Y0 ~/ y2 Z) Broutine.$ D1 x9 {* ?. C; Z; ^9 U
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ K: T/ P* D6 E* x5 u. N0 }
to the new routine to execute (hangs computer...)
, i% o. h" }* m8 |5 ?' |8 n- V6 ~! N! V% i H$ E5 E8 c* K- ?
mov ah, 25h; ^$ R' S* H3 g9 U- o" }* ^3 E6 O
mov al, Int_Number (01h or 03h)
: k' s- m9 W3 p" p mov dx, offset New_Int_Routine( y. r' ]6 k( x7 i6 A9 F
int 21h6 B# F- |( y* ?0 z% V1 [6 ?
5 J) s) } ]& W2 [5 e3 h
__________________________________________________________________________& a9 `/ G! A) i# m! M2 z
7 t( ?2 V7 I7 }1 N5 Y: K8 \5 d7 c9 G
Method 09
$ R" i) b# z1 C ]; f2 H7 @4 }=========
+ y9 ?& i' R4 [7 r% {. Y: \! w8 f; E. w+ G, V4 S# t# Y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: F* T: l% L* W& n2 F. D8 W6 v3 b& Y
performed in ring0 (VxD or a ring3 app using the VxdCall).+ \; e! W& P% c$ E
The Get_DDB service is used to determine whether or not a VxD is installed
! I+ q& N( U8 z7 nfor the specified device and returns a Device Description Block (in ecx) for
7 a: L5 d& ^ |% ]that device if it is installed.
8 `* H& Q8 l6 i/ o0 I+ ^# O
% M1 A, k1 f* j3 ?' I% i$ e8 T8 B mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: K3 b' |5 |+ Q4 g+ Q8 m) ]; @
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-), A, _+ U& G$ W' W p; y$ s
VMMCall Get_DDB9 J- l, r) T- n) d; ?
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
" m* T) f/ G$ ^$ ~0 x* Q6 I1 [, v% |* P; P; y4 B- a; y0 E
Note as well that you can easily detect this method with SoftICE:
- i' O3 n6 W- N# ^* ~, Y bpx Get_DDB if ax==0202 || ax==7a5fh t5 f+ A, q4 t5 X* G
( ?/ s1 g- E' c: Q4 j* L
__________________________________________________________________________ [+ a- p" H& `* M6 F: {' b, F+ X
6 d' x! V$ u. k; ?Method 10$ X' d3 ~# \" A2 E
=========: [3 t* p: P: W6 _
E s: Z' @+ o/ l=>Disable or clear breakpoints before using this feature. DO NOT trace with: |5 _! `4 f4 z% _. ?
SoftICE while the option is enable!!
& u6 ^! N. F) x1 }' G$ U' C
! \0 \1 ]7 o2 N' m/ p2 _9 ^This trick is very efficient:: F2 c- O9 V+ g& h5 |
by checking the Debug Registers, you can detect if SoftICE is loaded" J" N; [5 Z5 ?
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ o v2 k' S$ z2 ]3 U* L
there are some memory breakpoints set (dr0 to dr3) simply by reading their8 t- W! Y1 @( M+ ^ A
value (in ring0 only). Values can be manipulated and or changed as well2 r7 F5 A9 H9 h" A
(clearing BPMs for instance)9 K/ H! v' s4 x+ m. }
( K. a, {( }2 F5 A( } O__________________________________________________________________________
1 F8 v4 {: j8 r+ t8 y
7 f1 U$ j9 s+ D; ?- Z" nMethod 110 @( j: \# C# B- f# g+ W8 I
=========- O( X" O' ?1 k8 V/ N) D9 d% Q
1 F. }2 P5 o. o S# y1 _2 U& YThis method is most known as 'MeltICE' because it has been freely distributed9 t8 S0 L$ Z9 M
via www.winfiles.com. However it was first used by NuMega people to allow
& X: E; C' _& V( L/ A9 W. xSymbol Loader to check if SoftICE was active or not (the code is located
( f" X8 M5 v1 j" g8 c5 J2 vinside nmtrans.dll).
; o$ i9 O* v6 Q' N! R$ x; R. [ D2 t
The way it works is very simple:
2 P* p9 E5 o+ Z, HIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
8 N* i$ m2 [1 k& Y( vWinNT) with the CreateFileA API.2 [3 r- R9 @* s. C
) ?& Q: [; c; b
Here is a sample (checking for 'SICE'):- w7 o+ p$ d9 c, a2 ]; B% c
% Z/ J# ` z! p. ~/ I, H: [1 d
BOOL IsSoftIce95Loaded()
4 H; \8 L+ \* r) n3 |% k7 S: B x{
' \$ h& b7 y! r8 c HANDLE hFile;
5 i4 I5 G. g! K2 r hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 g1 C% H8 s" k# d5 v1 N- h4 c FILE_SHARE_READ | FILE_SHARE_WRITE,! c Q. A" p& ~& f
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ n. S6 y" H8 {/ P* s7 X+ g% e n4 L
if( hFile != INVALID_HANDLE_VALUE )
/ h1 y' l& }; W i3 d: O {
+ N7 g9 m4 @7 y CloseHandle(hFile);9 n' Y' x! \2 y/ b# m4 ~
return TRUE;
2 P: E# V! I6 Y* N* y( o2 J }# N$ |+ Z, J1 \0 D( Q. K8 D
return FALSE;' w9 k. ?/ v# _3 Z9 R/ ]9 o
}" q. ]6 h- Y+ R& z
( g6 E! [2 m# F0 |
Although this trick calls the CreateFileA function, don't even expect to be
4 W6 Y$ D0 `/ J+ @/ Aable to intercept it by installing a IFS hook: it will not work, no way!1 b. ?* J% G1 S+ _% ?
In fact, after the call to CreateFileA it will get through VWIN32 0x001F3 Q2 z J: X9 w( H
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 S, N9 `3 K6 @; Vand then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ ?# t( y: C1 t( H- I# _field.: d+ T+ }) c9 [, b
In fact, its purpose is not to load/unload VxDs but only to send a
( q# J' l1 |' c# eW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)7 A7 w" H) }" Q: r- d, e5 I1 N
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 q$ G5 `6 A/ K6 N
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
# `2 n+ [+ E) y5 F. ]- mIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ R6 y# u4 m: m5 xits handle to be opened and then, will be detected.
o& ~: v) ^( U1 m7 U# Q$ |You can check that simply by hooking Winice.exe control proc entry point' p) Y8 E( C9 ^2 v. f
while running MeltICE.0 T% U" a$ G. E* f4 u
) E0 K/ X9 S) q3 O5 N
! v! s; O7 `) j2 o c 00401067: push 00402025 ; \\.\SICE! {0 J$ i" W! A; P
0040106C: call CreateFileA
& e6 \* O" |8 y 00401071: cmp eax,-001" m) }( Q4 J* j6 n- P$ F6 q; }' T! P0 w
00401074: je 00401091; W/ T# e4 ]1 \
% c- q( w/ Q( r( O4 q% q( N) [
5 E; T. z3 _! `9 D$ P6 s+ ^# _There could be hundreds of BPX you could use to detect this trick.
5 O: e$ e6 O. M9 R. _2 H8 @8 ?-The most classical one is:3 V6 F7 [) s1 k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||& z! n2 C* d" ]" V
*(esp->4+4)=='NTIC'
U) W2 W: E$ N7 P& }1 O4 G' N' o! G
-The most exotic ones (could be very slooooow :-(& L* u% G3 \- g- t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 P) q" q* M2 K( W. A7 m7 F
;will break 3 times :-(
/ b# ]% ~7 }9 I Z, p' ^7 T1 O3 K! f) i* a
-or (a bit) faster:
7 w$ \7 |# h1 Y5 s+ a) ? BPINT 30 if (*edi=='SICE' || *edi=='SIWV')- S8 b* r# o! b7 f' b" O
5 I% h; k# E: w5 |0 X BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 K5 G& }2 l- O+ k8 V$ _ ;will break 3 times :-($ h# ~; }$ M5 H1 p. ?3 s( C
! a: b! L% t4 Y7 `6 E-Much faster:
7 H! V; J+ C3 l) G BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
. W+ f0 q4 U! a; y; u9 m8 N4 |8 ~$ ?
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
6 X _9 Q6 g, o R' [function to do the same job:8 R4 | Q6 q3 J
% x8 O- A+ ~6 T5 E# ~
push 00 ; OF_READ
. f1 A- W+ W5 _ mov eax,[00656634] ; '\\.\SICE',0
& s9 _, f ?6 ]- T* ^% G1 x push eax% S7 u- H9 ~+ X" v4 ]; R
call KERNEL32!_lopen
9 t1 j- q" [# t7 r7 a, P# T inc eax4 i" Y/ d% r% a# L) h
jnz 00650589 ; detected
$ O. }1 O' _' _6 b push 00 ; OF_READ
6 ?: Y" W( A4 r& a" X# E mov eax,[00656638] ; '\\.\SICE'8 d2 U; z6 [1 I$ C* b
push eax
1 T @$ r- r! r _# U call KERNEL32!_lopen
* Q, n% W$ [5 E2 f5 S( Q% p- m inc eax! b, |. R& F9 u5 V5 |+ |6 W5 m6 m
jz 006505ae ; not detected6 N* }( Y' ^/ w5 \
- v3 m0 z, M# ?. x# {1 f/ d+ g$ ]! T
__________________________________________________________________________
: r- S8 E' i" l0 d3 {2 h* f+ c& w7 \7 O! h4 |& T3 N/ Z3 w
Method 12' n9 A+ t* r2 ?( y
=========5 C& f9 O, ^2 k% ^7 N r
3 |$ c) i! R9 W" RThis trick is similar to int41h/4fh Debugger installation check (code 05 K" V0 g# H2 ~, M, b
& 06) but very limited because it's only available for Win95/98 (not NT)
$ P5 j( h2 p; r' d0 {* d, Oas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
9 h9 \2 @# T6 ^, J2 H# D5 I h1 \% y0 K3 m; B( c# r
push 0000004fh ; function 4fh, z" s( v/ i+ Q1 c
push 002a002ah ; high word specifies which VxD (VWIN32)
2 h" ^# c9 s' y0 N ; low word specifies which service
# a- G) h' R3 B' g (VWIN32_Int41Dispatch)# I% k" Y: e7 x4 y8 z% Y* w* w
call Kernel32!ORD_001 ; VxdCall
" s! @- ]; } w: {& I0 j' \ cmp ax, 0f386h ; magic number returned by system debuggers" d: u5 T: O- H: d7 u! g& e- c
jz SoftICE_detected
5 ~; l5 b2 l0 p- X* _5 s; i l9 |% H) x, X+ M; O
Here again, several ways to detect it:1 C0 U. v4 P5 r$ i% b/ a
9 d9 M+ {9 |) j" K! y BPINT 41 if ax==4f: Z+ a h2 ]# Y" V
4 c/ [- \$ a+ [- h2 Q& h$ T BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; G' r- [+ i: t- x1 N9 G6 S6 C
8 Y; a2 g( s# L& `* J+ I BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 B. Z9 l" Z7 e; v& u
9 I, Q+ [% g* B( G) l p+ q& k% t# H BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!; `2 I Q/ B3 X4 z9 B
- \: J4 [4 ?/ ]2 z0 K7 U__________________________________________________________________________% T0 P* N: N& G2 ~
# T5 y0 F3 L6 L) ?
Method 13: M ]5 h, u$ ~2 C7 X, H" ?% E
=========' G* C3 e" q i4 O
: T, p9 T7 v; f `2 v- b
Not a real method of detection, but a good way to know if SoftICE is6 w; ^+ A; z% K' D0 x+ E1 }% `9 z# d! k
installed on a computer and to locate its installation directory.
! `% C% b9 Q9 O1 t6 @It is used by few softs which access the following registry keys (usually #2) :
4 O5 T" x; R; s
. C a& C+ z6 S8 [' L, D9 }3 i( ? a-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 a: q R) T( B\Uninstall\SoftICE
" B$ f* ~1 ]( X) s6 m" I-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 i' f& b( m% |2 r( J+ `. `4 {
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, u; b& y4 C3 X+ _" f\App Paths\Loader32.Exe5 i$ j8 c6 b$ E8 C H) B
! v, b+ x0 _! z6 V3 j0 Y
! a( u& m! Q5 T$ e! jNote that some nasty apps could then erase all files from SoftICE directory+ P0 W* x1 {4 _2 s
(I faced that once :-(9 @* W! d( k, R
% G( z8 q9 [+ t7 H4 _) YUseful breakpoint to detect it:& v0 q Z8 B a3 w' W Q! h! R
9 n# D: d8 B5 J% E. b7 D BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
g2 c e5 T n6 B8 f' W) u1 O: [6 v2 b2 e% j2 ]: P) X2 Q* w; S& X
__________________________________________________________________________; E# @& s6 }. {$ p; y/ U7 M+ M
. R ]6 w& H( t& A1 E9 o
, v) Y2 Y) I. L$ b, _Method 14 : q" ]3 S2 X: \" G; `- |
=========
6 x5 D1 [) R( w- ^: s+ @; o1 L+ R0 |* @ F& {, V& j9 u
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. w% t( `0 ~* q5 m; ^8 Ois to determines whether a debugger is running on your system (ring0 only).7 u1 z/ [6 l9 Q* @
) c1 Q: Z8 @$ }2 z/ o6 z0 _; Z VMMCall Test_Debug_Installed
9 ~/ u( c1 o Y) g4 ^" V je not_installed
H0 @0 o5 u* w5 f8 F7 _* z' J1 r$ C
This service just checks a flag.# W) q' k0 r5 r# Q" z8 T' J) `
</PRE></TD></TR></TBODY></TABLE> |