<TABLE width=500>
: b7 `6 X% w( n/ Q# P<TBODY>1 h" _1 }0 [) c# S4 w
<TR>8 s- d* [) k3 a3 Y
<TD><PRE>Method 01 ; @- |$ \' ^3 I0 \# ~
=========
6 s; A2 L& S. E! x6 j4 C. F' e3 F/ S: ~: L/ _2 q2 C
This method of detection of SoftICE (as well as the following one) is1 n# N% }4 X: I6 W
used by the majority of packers/encryptors found on Internet.6 G6 N1 h. W/ r0 r1 l. B7 ^
It seeks the signature of BoundsChecker in SoftICE
7 _8 X, ?- `% d6 u
8 K8 N6 N+ H' J mov ebp, 04243484Bh ; 'BCHK'
# e8 G4 L5 \; v! U. V mov ax, 04h
1 w g1 [! g: f' ~: e' R9 T int 3 / Q( t& h/ T3 `5 t
cmp al,4
9 u( r# |/ B" g) @ j; |. m2 A. T" O jnz SoftICE_Detected _8 c) b6 Y7 C7 y$ f5 k; S7 J
) a9 A% G' T( U) n9 p7 E___________________________________________________________________________
. o4 l& p, b/ r9 k; z2 J: e6 e' _+ F
Method 02) {1 s) G- K2 j" t
=========* T! W( [9 S' B* r8 M/ a
/ l0 [4 ^; G$ iStill a method very much used (perhaps the most frequent one). It is used
0 E: r- \0 \. @7 g4 x+ wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) D. x4 e; S1 J5 b1 C2 Tor execute SoftICE commands...
/ x% K" ]& c0 R' `; wIt is also used to crash SoftICE and to force it to execute any commands
7 O) k w0 M0 z _& T8 i0 q- }, `2 S; |(HBOOT...) :-(( . A' ?2 X, c4 _4 c
& ]. [3 ~4 ?' e6 ?" N2 q
Here is a quick description: u2 f/ A1 R2 I1 r" L" R
-AX = 0910h (Display string in SIce windows)
. ^' C6 k3 w) f-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 z1 Y) j" [5 H" u1 M8 ^1 j-AX = 0912h (Get breakpoint infos)
( U) D9 I* H' Z* A. d( G-AX = 0913h (Set Sice breakpoints)
, u |4 d+ E. { x* @' K* R7 G-AX = 0914h (Remove SIce breakoints)
) x+ M* i0 Y \2 r0 m. Z2 I! u5 Y) N; i
Each time you'll meet this trick, you'll see:6 L: R$ w `/ b6 F" \
-SI = 4647h: }7 H! u Q" o0 S& U7 }
-DI = 4A4Dh
" @ ^8 M% I. p; ZWhich are the 'magic values' used by SoftIce.
: P; n# v' ^8 z0 X/ sFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
u3 C: a" J; S$ L1 y/ G- O1 g- i
/ d& I3 k" B7 ~6 C M/ I) O0 GHere is one example from the file "Haspinst.exe" which is the dongle HASP3 a9 D6 A1 D( b! i' k
Envelope utility use to protect DOS applications:8 L0 p/ `# r+ o8 ^' d- G* W1 j
, c7 n6 N+ [. }) o4 V" s
- t. `) x) s6 p- B+ N4C19:0095 MOV AX,0911 ; execute command.7 e0 q- v4 j3 m' {6 @4 O V
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
. Y2 o/ d& D. ?) i D# T5 J4C19:009A MOV SI,4647 ; 1st magic value.- K% \/ z: d4 f* ~0 t& o
4C19:009D MOV DI,4A4D ; 2nd magic value.
! x# H# ~1 T# [2 }$ A! k. Q: R4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ C$ [* |$ O+ z0 h7 a* y7 D0 \
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 J7 D# F5 M; z" b" V- @- \3 j
4C19:00A4 INC CX1 `+ b$ p! }4 @, M. N
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. w! I* B5 _, x: f" {: q Y5 v
4C19:00A8 JB 0095 ; 6 different commands.
9 r- O+ T" h. ~ P n2 o+ o4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* e$ C- d0 O1 h4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ Q0 K5 O0 A3 X4 g; k0 ]6 }
* `( Q z \ l3 d0 |# L6 WThe program will execute 6 different SIce commands located at ds:dx, which+ ^2 p: l( V0 \6 W: k8 S* Y! `- z
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
( r* t1 D" B( W1 w) h# `
2 m6 {& S$ C, w9 W9 H! G0 q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" V+ F7 t- S1 L___________________________________________________________________________
( C/ w' H. K* {* L
4 H1 z$ I6 O7 }. i4 y" _
( o6 {2 ^9 }* i! ^0 ~) FMethod 03" P! O% O: Z4 N1 J) Q7 U' |( V
=========1 ]4 z$ k' J8 @& t/ h
1 Z, T' t* Z" _& f& ?; FLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
2 S, ]9 P/ |1 G(API Get entry point)
7 C( ?, k: O+ y) P
! Q, X) u9 c$ r# E
1 k3 Z; _8 d3 }! Y. S- } xor di,di
/ @6 c( Z) F _" x5 m. Q$ n mov es,di
+ c9 y% n& L( U& i mov ax, 1684h 6 }/ v! r0 Z1 |: u0 B
mov bx, 0202h ; VxD ID of winice
3 k. }9 _9 @1 _% n c int 2Fh9 F8 c/ X7 M9 j0 q z
mov ax, es ; ES:DI -> VxD API entry point
8 v) _# S2 d z% y% K" | add ax, di5 c& U3 X7 p7 F! B
test ax,ax
/ a$ E* |9 M. @4 J' J- F b' ? jnz SoftICE_Detected: \2 o9 Y" I3 m7 a& n8 A# |, S
$ ^* p5 L! K: u/ n/ X/ `9 K___________________________________________________________________________
8 F6 ]3 L4 y0 L, y( r: S7 T; v6 }; s7 H: H
Method 047 t1 ]$ K% u! q% `: W
=========- ?8 q4 e; f6 Z
- K' D/ H- G9 j# B" n3 Q* u! lMethod identical to the preceding one except that it seeks the ID of SoftICE
6 Q% |4 |3 m* H! g. S, |& uGFX VxD." H1 s8 B6 }) g5 h" \
5 ^9 j: i) P4 r' V$ M
xor di,di
: }1 ^- G. A' s mov es,di
q" q# j0 I$ Y6 q1 i mov ax, 1684h $ l3 ]" C* s7 G. W
mov bx, 7a5Fh ; VxD ID of SIWVID
5 N0 ]" ^4 V1 J1 v int 2fh
- ^" H. U' ~/ Q: }5 _: [- J& L/ k! a mov ax, es ; ES:DI -> VxD API entry point4 A" n9 }* {6 h, Y2 u; M
add ax, di: s' C G5 W* \! v
test ax,ax9 y$ c5 X- w+ i1 O# c0 v& [
jnz SoftICE_Detected) P. m7 [8 U* |
7 a9 W& }! a6 U3 m
__________________________________________________________________________
1 L+ x: j1 s9 l$ ~, C. F6 [: `" L* t/ `
5 k% K$ ^% m$ f8 C, y* f; c) AMethod 05
/ U( C* ^* ?( c0 @8 L8 S=========
" \6 _. y7 j# g' z- T5 |( G* x: \2 M; i9 j$ _7 u
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ X% Y3 m4 c; i% G6 S& H( Y
debugger. It calls the int 41h, function 4Fh.
0 a7 ?# l! O6 p+ t: n9 m) \There are several alternatives.
8 E- M" H( I* b0 B. J; f9 H# P" T! q" |" s$ n
The following one is the simplest:
, U: A# K, N N; |8 s9 N
6 J- j( D1 ^% C: f5 e/ r mov ax,4fh
& e3 H. Y+ z. z o$ H( t3 G int 41h
( q, O# k4 L9 b4 ?, h cmp ax, 0F386
3 T0 E8 d/ Q5 N9 Z) t# i jz SoftICE_detected
( C8 j' M! i, o9 j7 j. i0 Z! ?- \* {
* L q2 V- @: y4 E: {Next method as well as the following one are 2 examples from Stone's 4 Q, b. N% T- l* [
"stn-wid.zip" (www.cracking.net):* S' [+ F$ [1 x0 ^# B7 N% f
5 M& x* g1 n' ]; |2 k5 O mov bx, cs
! i- \0 r+ k) c! }+ P lea dx, int41handler2
2 T/ v0 F- D% G. C7 k xchg dx, es:[41h*4]! ?+ w8 D/ ~: B
xchg bx, es:[41h*4+2]
. ^& \( C; x/ |. R: `5 n2 y. G! N mov ax,4fh8 v y: t9 B. h4 P' y) [2 H! P! P
int 41h. D- k9 \& Y! E
xchg dx, es:[41h*4]7 u6 t$ P. D. B7 E
xchg bx, es:[41h*4+2], C, ^; ^3 f: y; e
cmp ax, 0f386h
0 z+ r7 m% w: N, T1 N jz SoftICE_detected
2 c' N/ i6 r, n" N& j7 q
+ I% R) i, q2 \int41handler2 PROC
! Z2 c9 k; k! I/ Q- H& X: r5 x iret8 B! D6 [& j! t; O: Q1 T2 W" `
int41handler2 ENDP5 c7 z" q# c0 B! @; d. l% K; u
( U9 j8 V- |- N1 f- _
" n3 }# F) T. k5 U$ T_________________________________________________________________________
1 R9 W. j8 b4 L: k2 F
" L/ Y4 j1 R0 v7 s7 |1 s4 R
1 e4 @ A5 L ~7 m& O" QMethod 060 I+ T [2 J4 e( Y1 ^
=========3 G: h" H/ l6 E9 ~6 @
. P _5 m& c% @/ X
0 l1 B. }* O( E8 P2 |" o2nd method similar to the preceding one but more difficult to detect:2 r! H, V. L @) ~5 s d
" L7 m0 N8 q2 j
G$ ~+ r5 L/ \& D
int41handler PROC
1 _0 S( F% V7 {8 K0 B3 E mov cl,al& e6 r0 {4 E# w; @5 B# z8 j
iret5 h7 \) N% r. ?+ \% y6 E
int41handler ENDP- c) y+ ?( t! c `' s
! M1 ]( v3 g: g' [" [, I D0 v6 m: q% b/ B6 Q$ N
xor ax,ax, ?2 x* J/ H4 Q+ E" V6 q
mov es,ax
2 N$ \( w2 f+ i& [( r( ? mov bx, cs
6 R* |1 f2 U7 N2 x+ b lea dx, int41handler# A& I5 S$ }2 i) k% ]
xchg dx, es:[41h*4]
S: o5 B0 B6 P. U+ x P% t xchg bx, es:[41h*4+2]
3 s4 C9 f/ L7 l1 T) V H in al, 40h0 @) c/ ^) |# i5 k
xor cx,cx
6 j0 e( e* ~: H* o int 41h
( J2 v! ^6 N0 ]: d' r; Z8 \4 V _0 j xchg dx, es:[41h*4]' z7 l' N s# B1 B' |( R
xchg bx, es:[41h*4+2]0 y$ @; C. S& A _
cmp cl,al
! |' \/ u" u1 O9 Y, _8 E' i; ` jnz SoftICE_detected3 K( L, i- p5 y) E- u% q6 A
; b+ H- Y: i: ?( A- [_________________________________________________________________________
5 n8 @3 A/ k. {5 f/ @! m9 L& P/ \. E. n* G) A# o
Method 07
& Z: D, ~( q- g" ?9 L=========+ f) v! h" Z+ D
1 i& p7 k) s& C
Method of detection of the WinICE handler in the int68h (V86)' u$ \" x! {5 s
5 O$ n. b6 ]* n mov ah,43h
) w5 Y( X) J9 G int 68h
; Q( e1 b# j& u; ~' P9 f7 n cmp ax,0F386h2 Y5 j' y5 ` Z; T/ e9 Y# V
jz SoftICE_Detected) m/ z, S, t$ M7 J+ ?9 W
/ O) N4 _# f7 T2 B$ t& E P- C
- @' B6 X4 y6 z* t; g. C=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* {! l- N4 \: a* g' y! f app like this:
0 V. x" r1 W) G
+ U" b, x y( z8 }' ~* Q BPX exec_int if ax==68+ `0 s% w" P* G$ D/ T5 H% I5 H" H
(function called is located at byte ptr [ebp+1Dh] and client eip is
0 w. a- ^$ Q& g# ^: U' n' K located at [ebp+48h] for 32Bit apps)
3 u4 G q& [6 C! J" l9 m0 b__________________________________________________________________________
& L* X, ]; h. Q4 Z8 [* l8 E. i5 q% i7 {& R$ R( O, G# s9 o, E8 B
1 g) n1 T9 M7 l% A. Z( C: lMethod 08" B; J# o6 K$ o) _! C6 P! T
=========
9 a( S% S- f8 O5 X0 H+ }) \2 x+ L; O' \, _& q1 }. v, n
It is not a method of detection of SoftICE but a possibility to crash the& [8 ^6 G" P+ n, Q6 U
system by intercepting int 01h and int 03h and redirecting them to another
- {: S; u$ j2 n, Mroutine.
" Y- i" U0 w$ {( @5 |It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 x+ A- _; E* d- W/ {
to the new routine to execute (hangs computer...)
5 H, @7 S$ C, D1 ?5 f2 Q# {" s' y0 @: q
mov ah, 25h
% E% b. u& P; B }- Z8 A mov al, Int_Number (01h or 03h)6 i- s9 a3 ?0 d: [1 P) q! X
mov dx, offset New_Int_Routine1 w, o+ e# U/ v# h% ~; H
int 21h
# m/ U8 C* H1 d- l! y( Z# q) `1 v3 h Q
__________________________________________________________________________
/ y! n; c( _+ t: _& W2 _1 c- }$ R! P* t9 @
Method 096 y `+ k! o; v+ H( A1 j0 o
=========
; I% G% k! M6 C
6 l5 j7 h b4 S7 b HThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 ^" o" u: Y+ t; @* ]
performed in ring0 (VxD or a ring3 app using the VxdCall).% |5 W! l/ s5 W' i4 n2 b
The Get_DDB service is used to determine whether or not a VxD is installed
/ i9 H5 |: p6 Ufor the specified device and returns a Device Description Block (in ecx) for
9 E0 _8 j3 C! E" s. y! }" Xthat device if it is installed.
, m0 t) y3 W2 E9 m$ y7 U; w( |' k A! w. o n# E4 ]3 v# }3 @
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
5 R3 v1 S' a; n% W, @3 { mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 o4 f6 i& T% n$ X VMMCall Get_DDB7 H5 Y9 t0 w) R* x8 Z7 R: O
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed0 x$ r! [9 R, ~ Z# H
- e$ {+ l0 B7 Z& H
Note as well that you can easily detect this method with SoftICE: w: [% F) Y L' `& y; Q" v8 u; X
bpx Get_DDB if ax==0202 || ax==7a5fh
( ~+ Q8 M3 k, r% f
. z% e. E5 O+ f0 D8 L* ]__________________________________________________________________________4 T6 g3 m/ t0 L" C- p1 l
0 N5 U: l6 l! J$ l! l, }9 C R! i& }
Method 10
9 }$ T3 v; @* T* v7 |=========
/ M- {. q; O. E) Z9 e, g9 C* T4 v* D% V" Q3 W
=>Disable or clear breakpoints before using this feature. DO NOT trace with
1 k+ w8 t9 f$ D4 M9 A+ k+ K SoftICE while the option is enable!!( i5 [4 f5 b( c+ \6 @( O: F
* P9 Y! K( O3 c' K
This trick is very efficient:
M& c" v c9 S' P% N0 a: E( lby checking the Debug Registers, you can detect if SoftICE is loaded
8 }9 M. g$ f, r( f0 p" h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if% t( |' S: u0 r) I9 ]% u$ m# H
there are some memory breakpoints set (dr0 to dr3) simply by reading their7 [: Y1 e S- e7 M# s& S# K
value (in ring0 only). Values can be manipulated and or changed as well
$ Z( G( U4 ]; R6 r' k" h(clearing BPMs for instance)4 @& H$ S* T! _/ ^
; E) m+ r- N2 t: H. c& b
__________________________________________________________________________
1 ]; X# ` a" Q* q
|9 K* G5 j( l0 w7 G0 Q/ C# BMethod 11; Z2 c1 B- J" m% I
=========
6 ]( O/ y+ g; j: h- m- M7 m
: `3 R& X L4 fThis method is most known as 'MeltICE' because it has been freely distributed! C0 D. Y9 {: j4 W- Y9 R
via www.winfiles.com. However it was first used by NuMega people to allow; c5 M1 w; L. X, [
Symbol Loader to check if SoftICE was active or not (the code is located% g# Z- n, \ \5 _0 ?& E- ]( R
inside nmtrans.dll).
/ @: q0 `& W0 |/ p. q2 V
/ w) B5 T* F% bThe way it works is very simple:/ M" M+ }& r- F) a3 x% b6 @
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ N0 d: o* f y5 x1 |# }. G! bWinNT) with the CreateFileA API.
3 c+ [' x1 M- Y2 k/ v
' l& G. ]4 e6 |* T. Y7 w" A2 V* hHere is a sample (checking for 'SICE'):
7 Q" u! |/ ?! _5 o! ?9 ~% Y, W$ m& a1 l% x8 T
BOOL IsSoftIce95Loaded()
# K1 g7 P+ A0 E* c- S' s, ^. s{
9 `+ o# P3 l! k% S& y) J HANDLE hFile; ; o4 t: K: o; F9 u2 W5 i9 u
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, [0 _ D2 f* }2 A
FILE_SHARE_READ | FILE_SHARE_WRITE,
5 J0 Q! `% k# V! g. x$ G$ D NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 P( Y; \- y( `- z: w if( hFile != INVALID_HANDLE_VALUE ) O( O2 o8 S+ @( i7 ]. f
{6 [- ^+ `) l- ]
CloseHandle(hFile);& W: k' l2 V5 O( f
return TRUE;
" k6 e# l) i* V1 |/ H+ B% d8 W2 f8 S# b }6 R- j6 d2 D& }: J/ C5 ~$ p9 a
return FALSE;3 `' @, I9 ^) j6 X9 B* m7 m. y9 B9 a% }
}8 a5 `9 j2 |+ T( L9 B
5 i2 M. V& ~$ @0 @& }
Although this trick calls the CreateFileA function, don't even expect to be
& D$ j7 Q9 V2 c; X- G1 y; x, pable to intercept it by installing a IFS hook: it will not work, no way!$ U; @, o4 B$ t4 f" M! V: {
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 n1 P0 F$ y7 `# |8 t1 dservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)* `% n: p5 M7 [" u$ B
and then browse the DDB list until it find the VxD and its DDB_Control_Proc9 i+ y7 \- c. d1 B7 n( z( q$ v$ I
field.
: [) g0 J( [9 ~) w/ AIn fact, its purpose is not to load/unload VxDs but only to send a
' t; F0 E* R+ X7 u* [* q3 gW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* j0 Z/ [) c' c" c
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
: E1 K, U7 f; Lto load/unload a non-dynamically loadable driver such as SoftICE ;-).
, p2 A) M- A( ]If the VxD is loaded, it will always clear eax and the Carry flag to allow6 K" X3 |1 p( G H- a. e
its handle to be opened and then, will be detected.+ Y5 u' q* u1 \. \- U1 }
You can check that simply by hooking Winice.exe control proc entry point
/ ?. F- @' F5 x! Swhile running MeltICE.
$ a) C! i! E) z5 q: J5 a6 ?3 }0 M% |% [+ z1 Q2 `
. G" L S( O" o G, W9 m
00401067: push 00402025 ; \\.\SICE; O) ^: i. ~% f4 o" c* ~0 S
0040106C: call CreateFileA
5 p1 }+ U1 m: f) E% H4 A 00401071: cmp eax,-001
5 W- `" }+ [/ @' a. ?/ | 00401074: je 00401091
4 h5 Q4 T+ T) V9 Y# F) {! H1 Z, a; z- U
& g) U2 E8 L* C; C1 q
There could be hundreds of BPX you could use to detect this trick.) D" ~7 n, z" d' j2 Q
-The most classical one is:' J! f4 C1 Y9 A9 q2 }
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||2 N/ X: }! c4 d' _" o5 ^3 r
*(esp->4+4)=='NTIC') q! M- Y1 d, Q8 g. h E) L
' [: ?7 K8 R1 w/ c R
-The most exotic ones (could be very slooooow :-(8 E, s, ~" _5 P+ \
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ c; _- e! n/ [$ A4 `6 c4 k+ K ;will break 3 times :-(
5 s( d# N9 C. K# n: J, y0 c
3 O6 g/ r5 l+ A$ m9 p E-or (a bit) faster: 2 |$ j: p: f o: U2 v+ j
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 ^+ v( [' U1 z4 W& Y- l4 H6 R* B4 Q3 Y! B0 Y- h
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% M0 ^6 n1 a z7 e ;will break 3 times :-(' T6 e. e$ J+ c3 b6 g- ~+ ?0 o
! B; A# t9 ~ T) O3 B
-Much faster:* u f" f- b) c: P, h4 Q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" D* h: c$ a* E( o- ]
: Q- j, M7 c+ Q6 s3 n G& _4 lNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 n* a6 B0 s+ Yfunction to do the same job:( r- W t2 x" f, j
0 Z6 Y# d! \7 z2 @1 _1 s6 _ push 00 ; OF_READ
" [: L! ^$ a: d' W2 p) ^ mov eax,[00656634] ; '\\.\SICE',0
* F9 e( U8 B& W% r! z( z' l' [7 { push eax4 L$ ?' }# `% p
call KERNEL32!_lopen
; R- R+ {( |" |* r `. _" _+ H inc eax
, B; _2 W" ^5 T5 _" G& q jnz 00650589 ; detected5 _$ Q8 t! M3 K" j' {; d7 N
push 00 ; OF_READ
3 d, u$ [1 N8 Q) g$ Q% s mov eax,[00656638] ; '\\.\SICE'
+ N; L1 d9 r& B6 Y7 o0 O1 A push eax! _2 Y2 r6 \& h8 w4 `
call KERNEL32!_lopen' R) [0 a4 Z3 j3 E
inc eax% i- C/ [( X8 N/ J$ g! M4 ]% H, l% Q
jz 006505ae ; not detected
! _3 \) O: o- T+ Y( O3 g8 s1 n1 t$ h- n! O% q! X
* R; x/ o/ r: ^) _
__________________________________________________________________________
) x7 U4 {9 k( h9 a- Y
$ v( O- }% Z PMethod 122 T2 g6 X S" _% U
=========7 { W @" }' N: m3 u7 R& b
7 d, w0 j, u( lThis trick is similar to int41h/4fh Debugger installation check (code 05
5 ^8 F# c1 V( g/ u$ M- \( e2 B& 06) but very limited because it's only available for Win95/98 (not NT)) A/ _( D3 c- m8 F5 Y& f8 d
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.) i$ m. |9 H1 S4 p) O
3 O; Y) i: n1 w& C
push 0000004fh ; function 4fh8 P V n/ v+ Y' X- z: J/ M/ c
push 002a002ah ; high word specifies which VxD (VWIN32)4 f$ I' v: r. O" l6 n5 O
; low word specifies which service
9 d8 w3 Y- p. s9 e (VWIN32_Int41Dispatch)4 z; S! H% P* o d
call Kernel32!ORD_001 ; VxdCall
6 U( l% k2 Q. ^ H, y" D. d; x cmp ax, 0f386h ; magic number returned by system debuggers
$ b" l& D9 O6 u6 _: ? jz SoftICE_detected3 |) o/ c- p3 ^0 { ?& k% ^
1 a* h8 k& y% F2 ~7 ^- A) O: BHere again, several ways to detect it:5 F+ f" Z+ Y x
* }: p3 M. W2 R0 }3 _& M
BPINT 41 if ax==4f3 T6 a8 Z! k( f
2 Y7 F Y3 p; A& @0 o( X4 Q+ R& x
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* |$ o' T& @+ w% Z5 R, W+ _# Z2 C( ~/ e5 `( I$ P8 t6 j+ \
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
4 @; N. Z/ v/ u) h+ P$ X |( ]; ]
8 V4 {4 k8 ?4 ^/ d) N BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
3 D5 Q y# S7 s$ ^1 G' D9 ?1 Z9 t. H! O7 Y0 l% i3 g* ~
__________________________________________________________________________% @' b# A4 h1 G P$ T* D' ]+ [
8 D) \# S4 L0 u/ tMethod 133 V1 @8 l* H# N' k% A! y0 ?
=========+ A4 `- J U" u0 Y$ H, C" |. s" o7 @
4 d9 c/ [2 T' z7 v6 A
Not a real method of detection, but a good way to know if SoftICE is
/ P* y8 n8 S) ~2 yinstalled on a computer and to locate its installation directory.
) a2 E5 ]2 t1 [, |' f! PIt is used by few softs which access the following registry keys (usually #2) :# w5 T2 g B) D
L5 K" X; e& n6 `
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% R2 |8 V2 @# H! ^& i! {, @\Uninstall\SoftICE g6 [( v( ?' g* z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, c! [1 \7 z2 e/ `6 @
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 Z; a; l+ Z0 R: x
\App Paths\Loader32.Exe
" }: A! G- N0 u" Q7 i
9 C7 k; `9 t7 y" u- Z- o2 X& y2 ]! \* H5 t. d7 y5 N
Note that some nasty apps could then erase all files from SoftICE directory, |2 d3 p! Q, ]6 {; N
(I faced that once :-(2 y, y6 m `% {) G/ y8 C
3 g$ u$ U6 M; F- _8 M1 h
Useful breakpoint to detect it:! P* U# {0 K' R; H# ^2 V
! z& F+ U; {2 J( l; M
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
7 j3 ?- s) k4 `3 R& g. o9 t# S# `& @; R: T
__________________________________________________________________________# q$ F, c' v; a* A" l
# _( @6 Q j4 M% A. o6 k0 c( t6 O9 H! ~. L1 q' y$ f, H
Method 14
' C! e+ Z7 w/ h8 V=========
# D2 T) M/ F( g1 f( A" h1 C3 G: t9 E: V( W6 T' ?9 d
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
" h; V0 I) G$ ~; j" ?1 Iis to determines whether a debugger is running on your system (ring0 only).
( H! k k o7 N' v, x
6 M4 a1 Y9 a9 v- \# h* U VMMCall Test_Debug_Installed
$ U+ Z: }( S$ Q je not_installed
9 [8 v. ^; ?; D) E& s( F- z, s' ~6 G4 H2 t2 J2 \) D3 y! E
This service just checks a flag.
, s& W# e7 H; o% i; s</PRE></TD></TR></TBODY></TABLE> |