<TABLE width=500> u. G! w6 T( S: w* ~3 Q
<TBODY>
7 r# g! \) I5 L+ y& ?; @% o<TR>$ m2 @7 E# m3 d" H5 |8 n6 l( L
<TD><PRE>Method 01
$ \/ d2 t1 r$ v% U=========
; Y: I4 I: w; Q2 s7 c3 _4 C# m0 X5 C. [4 W
This method of detection of SoftICE (as well as the following one) is
" M/ i9 C: w) _6 _0 K/ C! qused by the majority of packers/encryptors found on Internet.4 D6 C6 v4 X0 S# U8 m; p# n
It seeks the signature of BoundsChecker in SoftICE! m @9 H/ f: ]; G
4 U0 B8 k$ M3 c9 R( Z/ x
mov ebp, 04243484Bh ; 'BCHK'
- L( u: o- Z* z mov ax, 04h
2 F$ ?) D# b0 f$ Y int 3 ' D+ V: ~, v3 p% W6 H
cmp al,4/ r0 ^1 e- k1 E' ~" F" N
jnz SoftICE_Detected
) x' p& N9 U8 E1 X8 E* K C; x4 ]) {' C) o9 r
___________________________________________________________________________5 L9 V/ s; F& l' X
9 A* k9 m# j. kMethod 02
: @. i8 r1 n1 i7 D2 Q=========
: X( y$ b7 D) u P
2 H$ S* N; }: j8 X6 O) @" M( n0 ?Still a method very much used (perhaps the most frequent one). It is used! I' }( P# d$ A; X
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' P& F* L) n6 w# L3 i% r for execute SoftICE commands...
( r9 [0 L, ~% i5 T) K) QIt is also used to crash SoftICE and to force it to execute any commands
7 W- `* m! ~& [; J2 E* @7 ]+ F(HBOOT...) :-(( 1 S) d2 Q$ K$ B0 T; s
. Z$ G @9 t$ A7 M# f9 ?
Here is a quick description:& f; T$ t% D }, D7 i
-AX = 0910h (Display string in SIce windows)
) k" {) v+ \7 s0 V! `-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( R; d* Y8 ~5 C7 s6 E7 f
-AX = 0912h (Get breakpoint infos), w; c0 k, L( s9 c
-AX = 0913h (Set Sice breakpoints)2 S1 R3 T+ V% j
-AX = 0914h (Remove SIce breakoints)
" v! d* j# n" i8 M6 S9 V3 v6 e+ w6 }' ~9 x. S7 ?, h, S. I' v1 G
Each time you'll meet this trick, you'll see:* J' s2 |0 T2 k* s$ l
-SI = 4647h
6 a& ?/ L% y; `-DI = 4A4Dh: X6 ^6 @5 ^8 U7 U8 t9 o
Which are the 'magic values' used by SoftIce.
2 F1 h8 N' m/ o" _' @/ o: ~0 {For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' W: w# c3 M! C' F w1 q
9 C5 q: I v. D/ U2 @Here is one example from the file "Haspinst.exe" which is the dongle HASP
+ o1 M' L8 F1 Q0 v8 k& Q( U+ b% TEnvelope utility use to protect DOS applications:2 `# V t9 N9 L4 U; o% S" B+ y
+ j1 t) ]! `( X9 Z2 `# F
# |$ L7 Q/ V- ?: n/ d9 F! k; N4C19:0095 MOV AX,0911 ; execute command.: F+ [! D) g4 w6 I/ i6 h, }+ K
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).. J- b4 W1 s, M
4C19:009A MOV SI,4647 ; 1st magic value.) Z7 x- i! s: ]/ ^0 j
4C19:009D MOV DI,4A4D ; 2nd magic value.3 ^0 X' Y% N* N
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 ]$ d; x3 E# {9 ]- G4 ?8 q* y( y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 H2 o$ w9 }$ @% Y U1 D4C19:00A4 INC CX
; O# R) E8 r5 d1 w% ~4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
, W! M, `( t' [) N. o4C19:00A8 JB 0095 ; 6 different commands.+ w/ o% k* D* `7 x- j d+ P8 E
4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 D9 T5 w9 u. y4 o+ R
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
, i: m8 l: K( b& M/ a5 S7 \% w- H7 O1 U( n
The program will execute 6 different SIce commands located at ds:dx, which
_0 r* t! `9 x7 A4 Z2 yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 `6 q2 ?* q; D' A5 V
+ c1 G. j. m6 t k! c
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* S2 Z4 B: l- X3 F( z, t2 t1 ^___________________________________________________________________________
: _ o6 a8 B5 y9 z2 n: Z
, }( R7 r \6 ^) e9 ?9 ^ x/ o2 x6 A7 X) l7 T& x6 B
Method 03
- p9 a+ s7 w1 J% D" n=========
( m' |! E% w4 \% r( Z1 h) w
( S% k( U$ A* j) |6 W/ h. b4 sLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, |6 y7 L( R& W O; M1 x
(API Get entry point)6 v4 ~! s% g0 `6 ~4 [2 q& q
7 T* o6 w0 R+ Y, n- N8 m" p% Z) x/ e
c1 `! z' x" M; n# s* l5 T) E
xor di,di
+ ^; [1 r$ V& D6 ]: Z. k3 ?' I: z mov es,di/ S7 @" l% H* ^/ D! A; v
mov ax, 1684h 9 O* @& a g( r
mov bx, 0202h ; VxD ID of winice/ t8 ]( y8 W; r" p' j
int 2Fh, V) ~/ a. j8 t
mov ax, es ; ES:DI -> VxD API entry point
# r* l8 ?" y* U$ A" }0 m add ax, di
- W9 s1 z- E3 O3 r test ax,ax* L ?" N9 V4 z$ e; w( `
jnz SoftICE_Detected( ?2 [3 L2 H5 x% ?/ ? a: y* |2 u3 W
4 j" v: y8 p2 ^2 e! g* L1 d' ^# \___________________________________________________________________________1 z6 j$ V" X9 {
5 C* O0 C$ E6 ?' t( y4 ^- hMethod 04
9 Z, }5 N2 G- e; M' ~5 T, h=========
$ l" X4 `! B& ]# t
- c. Q* s& Q" zMethod identical to the preceding one except that it seeks the ID of SoftICE8 [# ^! x% B3 I0 K# R
GFX VxD.. }) [1 g6 S6 m0 ~' \
; ^8 A; P0 J, O/ {3 s xor di,di8 L: i6 m* g+ Q+ E% K
mov es,di( a5 i1 C3 ~: P! s* @- F2 T
mov ax, 1684h
3 r' n. M* L& E- i mov bx, 7a5Fh ; VxD ID of SIWVID. q7 B$ ~7 v$ c9 J: Y
int 2fh
; Y4 s, K; Z4 o- ]' ~ mov ax, es ; ES:DI -> VxD API entry point
% `9 A( W% {/ m/ g add ax, di% R0 g7 }" [6 m2 b. z
test ax,ax+ Q g, [3 S# |: r. z
jnz SoftICE_Detected. f/ U( L' }; I8 B4 _2 X/ y
+ U T b! w7 d
__________________________________________________________________________
U. s* U# `6 x, {0 T( B+ O6 R2 M
8 n: `8 U |; M2 M, e8 a( }; t0 v9 h3 N8 o7 _+ Z* N" ]/ Z" P
Method 05' S d* c1 N' U/ p$ P& s8 U' |
=========
/ D- U. c8 m7 w; d) H6 ^2 q: K7 F, n9 D8 E& k' d/ }
Method seeking the 'magic number' 0F386h returned (in ax) by all system
5 w. C: E) S( ?% tdebugger. It calls the int 41h, function 4Fh.% ~( R) r0 J, q6 L2 c m
There are several alternatives. ( i; r, M6 V# j2 g' u2 F: n) z
2 G6 q% o, E' v U. rThe following one is the simplest:
, O! E4 f! H( v% H
6 Q4 a6 p& t& e( l0 A mov ax,4fh
8 h/ _( [" L- u7 s int 41h; s: T. e- X1 ], t
cmp ax, 0F386
: ~5 h! X1 T* p) C jz SoftICE_detected0 I5 b% Z# [7 d- h4 l
6 _- B, d3 [% B) M5 V8 {6 v/ _" H- W. @0 }5 A
Next method as well as the following one are 2 examples from Stone's
~( _# @- J3 m$ N* W+ l"stn-wid.zip" (www.cracking.net):
6 ?. X; _% g8 E/ F
: A" u/ G0 a4 [6 R mov bx, cs
9 t5 Y6 r2 \& j( Z' W0 v lea dx, int41handler2
: y9 G! A/ [ K }/ { xchg dx, es:[41h*4]
6 ~" f( L% W# Q+ Y xchg bx, es:[41h*4+2]& G+ B4 e. M2 `' ?0 ~0 Y
mov ax,4fh
" i( n) r% h5 V4 L/ f+ I: x int 41h3 K, S9 O# e! I- ]+ k
xchg dx, es:[41h*4]7 H* x/ v: z% t- W$ R- M
xchg bx, es:[41h*4+2]
, Q4 | Y/ o E% } cmp ax, 0f386h# I5 d6 F1 }/ A+ d: R
jz SoftICE_detected
7 s* P# o+ b; g& _: v8 ]
$ x; i; ?2 F! rint41handler2 PROC
: Y( Z& j% V- x5 w ]. Y" @ iret
9 i8 c+ V; x3 o: }1 Xint41handler2 ENDP7 Y% Z/ c- y; ?3 d7 h
7 h/ F) \8 |$ b' E" P* @
2 w( y) y! }2 s_________________________________________________________________________
( f! e) R8 c6 u2 E3 ]4 F: Z$ ]& ^3 L. Q& K D+ k
$ \. I7 l0 H) x! @2 a% QMethod 06 H" a T4 A, H0 E3 _3 P0 }
========= c6 c* e$ x9 V0 ^( f
: ~8 a- h4 E# W2 Y1 Z
6 p; G( @: \ ^: [; O2nd method similar to the preceding one but more difficult to detect:
) P! ?; B0 `7 {: n' H! _0 w3 ^0 z0 L5 m6 a8 ], q$ \( f0 p) r
! m: C% T8 r" H& m9 E$ H
int41handler PROC
2 b2 K6 c! n+ j5 {) z mov cl,al
! ~/ F# ~6 ^1 ]2 Y% n, m: F iret7 j2 X& n" o# \/ U7 M. C
int41handler ENDP
9 i4 z9 [4 C' P% J& l
7 L' H+ h4 }, K
/ Y! x9 L7 [" h R2 v, M xor ax,ax
2 L9 }( t, a% k" j: b! J8 k2 \ mov es,ax; R: o* y% z8 c; A7 a* n
mov bx, cs7 n( Y/ |+ x q6 X
lea dx, int41handler/ w: |4 i/ c N# ^! K
xchg dx, es:[41h*4]
5 X1 ?3 ~% d' {; P3 g! l/ ? xchg bx, es:[41h*4+2]
& M( G1 l& a4 Z6 i/ P- ?" E5 o in al, 40h
' e. b, e8 R- q2 z/ _, a xor cx,cx
' V7 m+ `, Y( p, r1 a int 41h
6 }2 t/ v) U/ K6 M xchg dx, es:[41h*4]0 b) E, m8 L( I x
xchg bx, es:[41h*4+2]
6 K' O3 e' ~: H$ W& @" H cmp cl,al
8 i! S' t9 o7 U( R A jnz SoftICE_detected
" Q5 L0 J$ P# E
4 L4 J4 h7 a5 V_________________________________________________________________________. @' c x- Z( ^, Q" g
) D8 {9 e8 p: _1 @Method 07% O! ~$ g- \& a
=========8 M0 x9 I: k$ t( y. D7 g
* o: q# i9 B1 n" c
Method of detection of the WinICE handler in the int68h (V86)
7 |( `3 _( S0 K6 G" U' c7 w h# Z* R7 Z! r3 U
mov ah,43h+ Q& i9 N, h- a5 }4 ]2 ^4 k
int 68h
4 S. e: L0 Y' L: v5 O cmp ax,0F386h- Y" K* U6 s+ ]5 ]
jz SoftICE_Detected
, z% C0 c( T" F F# E- Z* V+ l$ F& D: D! F) G
9 O# X! A9 t4 a/ c& \$ S0 \- `8 A
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit9 J/ l' f$ V/ y: P5 J% @
app like this:+ E: v) ~" l3 R
) l. `+ G- P9 b6 r% O) j
BPX exec_int if ax==68$ \7 l! p2 I1 I( u
(function called is located at byte ptr [ebp+1Dh] and client eip is
" Q* W4 C9 T2 m! }9 T+ Q located at [ebp+48h] for 32Bit apps)
4 n2 N% X' F& b9 n7 M3 A__________________________________________________________________________ B% f W' x3 i. ^
* G5 E& |0 T6 E- M& w8 j
# ?3 ^2 l7 Q/ g0 s% z% [Method 084 f& Q: c1 u A" L! r1 _; s# a! }
=========
# O) F6 a9 E* ]; a3 J+ ]/ |
8 w# c1 }% r* M; {1 g1 TIt is not a method of detection of SoftICE but a possibility to crash the o/ I2 b- k T d, U
system by intercepting int 01h and int 03h and redirecting them to another
, y2 l8 E1 Z. Qroutine.
& z1 l5 Y2 T M( B# CIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: p7 P5 _ e, ?to the new routine to execute (hangs computer...)- b; x2 j6 x" V/ Y [; V! X2 B% M( P
: J# ]" G2 ^; j mov ah, 25h
2 `' R' g. x3 W ]) t" J% t ^% M/ r mov al, Int_Number (01h or 03h)
. V/ Z$ A7 V0 g- C+ _ B! l mov dx, offset New_Int_Routine
) {2 q9 r) B% R6 Y$ u! { int 21h5 w) ^" H) y! U9 R" A6 e
4 y9 x1 Y$ T8 e4 k! \__________________________________________________________________________
% T/ h. n; }/ V1 ^
& P/ Q! z- Z, \Method 09# Z9 M' c% W6 f) R. B: i
=========
1 s, w! X9 \& F& M1 n; q; M) j, W1 Y7 J8 Z7 O$ N. n! I3 _! @: I1 f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only% w( X( m2 N! `" `
performed in ring0 (VxD or a ring3 app using the VxdCall).: B6 B9 N5 v$ c8 T- z- z3 N5 a
The Get_DDB service is used to determine whether or not a VxD is installed
8 S( C1 d+ `8 L' O- Efor the specified device and returns a Device Description Block (in ecx) for9 Z6 g# W* w; n2 ?' T. ?
that device if it is installed.
, y m- B+ N+ F G2 c$ Z! T* s6 J2 j& o, F
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! u& q4 A( H& N5 K# |; w# x
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ e3 y' P- v0 ?% c; B
VMMCall Get_DDB
; F) Z) t% c) l0 f8 `# c0 f( p mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
2 K: d- }. `6 p, V) j
, A- q, }8 _* D8 TNote as well that you can easily detect this method with SoftICE:
* ^/ W5 G1 J6 y1 H- ], t! S+ Q bpx Get_DDB if ax==0202 || ax==7a5fh
" ~3 l" [- U: \7 }( @: b
3 ]. y1 X& m$ j0 s__________________________________________________________________________0 X: u) |/ ~/ p ~1 e8 _2 t
. m/ V+ J9 _! g1 n7 I) o1 V! {
Method 10' t' S7 k2 w! ~2 O0 h* j8 _" {
=========9 N1 h/ `5 S3 [$ c
* ^$ [1 j, x8 O ]6 D/ b4 L
=>Disable or clear breakpoints before using this feature. DO NOT trace with
, T" c, b6 `' i" z SoftICE while the option is enable!!9 X/ u$ {( \1 V" i3 o& f
- s4 p0 G: V; G" L3 OThis trick is very efficient:
1 M, u+ P7 R& U' h% u( Zby checking the Debug Registers, you can detect if SoftICE is loaded
1 b5 q+ I3 r/ y/ c/ a& Y( z6 V(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, Y! y& |3 O7 [8 P G& H" X0 cthere are some memory breakpoints set (dr0 to dr3) simply by reading their
. p9 S& Q! x$ D- g) d8 {+ B1 Avalue (in ring0 only). Values can be manipulated and or changed as well5 J5 t) L9 Y2 X) F" y, o
(clearing BPMs for instance)
5 O! _' R" i2 w* z f. r
4 l4 Q: x2 ` o m4 m__________________________________________________________________________
% M8 o% _) V; r" f6 `2 E3 V* N" v. |. m- g
Method 11
7 z% l+ h8 p+ d& `: V$ {4 I=========
7 Z3 k7 l9 F1 w0 d3 X* {
^5 f; ^( q% X8 i! \% V, sThis method is most known as 'MeltICE' because it has been freely distributed
# p+ i( I# S" f; fvia www.winfiles.com. However it was first used by NuMega people to allow
) V- y( z' q# F( w9 D0 A, c+ g0 hSymbol Loader to check if SoftICE was active or not (the code is located
; t* E& }# g' p+ G5 m' Binside nmtrans.dll).
; {& C2 l. O$ i+ N7 n# p; Z- \
% H3 |8 u3 C& e) i/ Z3 ^The way it works is very simple:: x7 h, s* J' t* A9 w2 P9 I
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for. u7 [) j) E: N4 E8 r8 y5 D
WinNT) with the CreateFileA API.
6 Y. x% M7 y D
5 b% R" t8 s! c* o. L# QHere is a sample (checking for 'SICE'):
& F# ^8 X5 |& s7 `' q- F) ^' k/ i" c
BOOL IsSoftIce95Loaded()
! b* @0 x+ }, h{7 s7 c# ^% _1 _$ P. ?
HANDLE hFile; 6 V/ @& p) P4 C$ A4 Z
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& u' h, C; _( \% y* b FILE_SHARE_READ | FILE_SHARE_WRITE,$ Z9 P- ?, \4 T8 L( M4 m, h
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" O3 N- u' @8 E( p if( hFile != INVALID_HANDLE_VALUE )
& m3 e( E8 m" U! R) T% ` {4 y: n6 b7 O+ G2 g4 N" @
CloseHandle(hFile);
; B7 P4 V" @$ c' t0 D; t; K return TRUE;* K$ h0 r" a) D
}0 V9 } Z G# k/ N) f
return FALSE;/ `2 M+ Z; G/ l
}. h" }/ ?" g; P' ~) F: g
- g6 z4 U7 @, a: y: RAlthough this trick calls the CreateFileA function, don't even expect to be# ~/ Z7 ?, S0 b$ N/ H
able to intercept it by installing a IFS hook: it will not work, no way!" b; Q# P5 x S3 I# K. S3 K8 D/ s' k
In fact, after the call to CreateFileA it will get through VWIN32 0x001F @$ G6 h% T; \/ f" B" c$ N
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 d7 r5 w& u; h; w* x4 E# ?
and then browse the DDB list until it find the VxD and its DDB_Control_Proc" a' u: {0 W: ? l
field.) J5 \# V3 ^7 \" z, `5 U
In fact, its purpose is not to load/unload VxDs but only to send a
7 v6 V e0 W* T7 J9 wW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
! I0 O) T7 k1 N; [+ ~( x3 N% i& bto the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 g# A+ j3 n& R4 J" Y" o) rto load/unload a non-dynamically loadable driver such as SoftICE ;-).: E3 H* t% L9 `% f
If the VxD is loaded, it will always clear eax and the Carry flag to allow( a- q7 ` Q' m) M, b; G
its handle to be opened and then, will be detected.
) ~- X+ p# i* ^9 I3 G! aYou can check that simply by hooking Winice.exe control proc entry point" y! i: ]1 d X( V# t' Z
while running MeltICE.
" `8 K ?$ R; X4 A& ^6 g: j0 [7 D4 s0 [- y. ^1 A
( y7 U/ M7 a' b' h# s. h
00401067: push 00402025 ; \\.\SICE
5 ?* q; O% [8 Y, U, p: ]5 g8 R4 Z 0040106C: call CreateFileA/ k! u s/ G. [2 ]
00401071: cmp eax,-001
% p! P) V o, W( \: y 00401074: je 00401091
6 N7 d! S! \3 v2 T& I# J$ d Y4 [: e! s, R& r; e( e) t
: u [" M5 ]$ I3 j9 L$ n* [- |/ CThere could be hundreds of BPX you could use to detect this trick.7 Y( C7 I* r- J7 M5 c# d
-The most classical one is:
* G% n. S! V- @: V BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
0 Z( Q+ S, _3 d) c V6 i *(esp->4+4)=='NTIC'
& J4 l. v+ M$ [; k8 @
6 W0 d) s0 D* Q2 m" m0 i' w-The most exotic ones (could be very slooooow :-(/ U! B$ d' r+ X+ Z" z, D" D+ O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') a+ k% G9 G4 @- o1 W: M
;will break 3 times :-(6 g4 I n0 O- u0 S! \
5 g1 m! C& P5 S-or (a bit) faster: ; |/ l: [7 z" X
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& K4 |# `* C8 |# H8 ]5 [
( e: o" g0 b: T$ g BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 7 O* C* ?* L' x- Z5 b9 X- S
;will break 3 times :-(
! t3 E6 I: j7 g$ W A" g+ i7 \
. ^6 L* P& V( J* W6 {3 q$ }# I-Much faster:9 W* g* m: x8 h& b9 ]$ Q& Q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
4 \- l$ ^2 K" j" l4 d0 t [! {" o8 x8 P
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 d3 [4 s/ E/ P8 l$ u D3 W
function to do the same job:
1 Z0 F2 ~7 g3 p! j! X4 n4 C+ Z/ q8 h2 } x3 C5 ^; V
push 00 ; OF_READ
4 E5 J; N, S3 r; n+ T% d mov eax,[00656634] ; '\\.\SICE',0 I z( z0 }* M/ Z
push eax: j+ e% n V/ a, J4 j. S, l5 `
call KERNEL32!_lopen
c$ L( m6 k- _: V7 T$ C) c1 q inc eax: O- M. W4 ~1 d4 G& T+ o# n
jnz 00650589 ; detected
# {* Y' F6 l( D8 d$ z! t push 00 ; OF_READ/ ?$ x/ ~4 F$ }& z
mov eax,[00656638] ; '\\.\SICE'# u9 ]$ w1 n* Q- b& a
push eax
( K; V2 F( l& R% t" I' Q# C call KERNEL32!_lopen' V o3 g9 P" [" P4 E/ _
inc eax3 D5 i; J( q. [: \; C
jz 006505ae ; not detected. P, [% U3 E" n, ? U# n4 |$ P
$ D9 K) F: p/ w' g! i
6 H( `) S% _; @9 j__________________________________________________________________________" S' f5 V w+ j' E: _+ e$ i
2 x+ f' P, j5 G9 l! f+ x
Method 123 v6 N( I8 n% t" ]3 Y2 I# z7 E
=========0 K1 W3 c% @9 }
, W% j6 d8 q6 E& [4 P f& F! fThis trick is similar to int41h/4fh Debugger installation check (code 05+ f- I2 d' Z- B% M
& 06) but very limited because it's only available for Win95/98 (not NT)
- s3 K4 e. L+ Z d1 ?as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& O( E2 c; F. \* T# j# ]. U' S" c I+ @! t; [9 z! O
push 0000004fh ; function 4fh8 O C5 J+ z/ ~
push 002a002ah ; high word specifies which VxD (VWIN32)
( q/ S" U9 L4 \* r. G ; low word specifies which service
4 U1 m$ o8 ^3 Q% b9 X (VWIN32_Int41Dispatch)6 C' v$ `& l3 I% y" ~" \4 m* {: q4 F6 y
call Kernel32!ORD_001 ; VxdCall
: U" }6 V' S" `) ^ cmp ax, 0f386h ; magic number returned by system debuggers
* ?4 f0 `9 C P9 u" S7 w8 e jz SoftICE_detected' j) n% m: U s4 _& ]' v5 X
# t) a; Y: a& W# i8 mHere again, several ways to detect it:4 x/ u5 R" P5 F* _, Q |4 [9 C! C
) f+ E" d) Q. C" C1 }& a
BPINT 41 if ax==4f7 b a. O: [3 Q2 x p! t5 g, o
6 E4 J, y, q" b J% S+ u4 M: y, T# ] BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one1 D0 e8 l3 O/ V; q% u& X
: X4 t( C' B0 e! T, g BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
- Z( G/ s' Q" p6 m5 D% i! m' v0 H# R9 G" b# L5 t. t
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!1 P! k. T a% U( t% K5 z% W+ `
3 G- u; x6 s0 Y, Z; |__________________________________________________________________________4 b) `$ g d0 j3 K" q* |8 Q; v% M
: k4 {3 t4 h& V8 e1 @, s
Method 13! L" [) J5 L; \3 {% E
=========
$ W9 ?! \6 B' E7 O
+ P& v' \8 Q# G: _Not a real method of detection, but a good way to know if SoftICE is
; W. \( F* H Tinstalled on a computer and to locate its installation directory., Q4 _2 V& x/ S, e' c8 Y+ m# D
It is used by few softs which access the following registry keys (usually #2) :# B; g. d+ L7 A
: O4 j- d: g4 S+ m+ L( D0 s" b& |-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% F: g0 k1 b% Q& F. X8 W\Uninstall\SoftICE/ j4 z7 N' B, z/ s+ {9 T# ]6 f- y2 C' q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
8 y$ H e1 G$ E4 Q7 p W% { q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( j- w: [5 g% M: d\App Paths\Loader32.Exe7 R! f6 ^- _# E* S
5 g% Y! v0 y2 N, Z9 ^
& F3 M* k, T( g. U! R( tNote that some nasty apps could then erase all files from SoftICE directory- L# T" ~8 b; M8 l3 m7 O( U
(I faced that once :-(
+ P6 L* m0 v, y0 a" \) c: {
) |5 E: w' L* q9 r6 @% NUseful breakpoint to detect it:
# F7 ^- r* U: B5 v& }5 V' L4 @$ y2 b4 W$ K: {
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE', y5 j/ @: b) d$ @' @
# M" a8 k9 _1 J( M$ j) i' u__________________________________________________________________________
- i7 `/ L' o* M' l$ w0 [% k8 I- W( U( E
! ]9 V7 ]+ x( gMethod 14
$ o! Y" a l3 g: J" C8 s0 c5 \( l- t=========9 [, t, q: P; f( G8 W$ a
$ [* d- P8 z& gA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
( D& p' U& _& q4 X; A. l' C$ Q# e: Lis to determines whether a debugger is running on your system (ring0 only).% `7 B1 o$ ]2 M* r0 N; ^ `0 N" B
5 c0 l/ _; V' q# J# s8 p) n
VMMCall Test_Debug_Installed
. I! S1 y- a r% H/ E1 _ je not_installed# z0 S' c. z! Y+ q
: p7 m8 V ` Y1 {
This service just checks a flag.$ ]8 D4 C' U# A- W( ]" Y& H
</PRE></TD></TR></TBODY></TABLE> |