<TABLE width=500>
- M1 K5 f) W( Y, w1 x% N/ S<TBODY>; o7 x1 p' ], ~ W! q3 `5 O# ]% A
<TR>
3 I/ u1 {1 g1 R# ^<TD><PRE>Method 01 8 l/ d0 o& C% C8 t+ {* o3 r2 u# A
=========) b3 v9 g' H0 K* {; q* ~( ~
$ a3 ^6 u0 [* i3 @This method of detection of SoftICE (as well as the following one) is* [; y" ?0 m, W4 G6 K; ]+ |
used by the majority of packers/encryptors found on Internet.8 k, L n; t) ^& w
It seeks the signature of BoundsChecker in SoftICE
* V# E9 r3 a3 K$ X5 M% c
9 B& D v' U; } b; C" p0 x mov ebp, 04243484Bh ; 'BCHK'
# N, B; I# [+ ?1 m mov ax, 04h
6 P0 ]) g" |% f5 V/ P5 k. d1 O int 3 " e) q" [' K8 S6 d& b
cmp al,4
% \+ _0 F8 l' |) h8 p9 @ jnz SoftICE_Detected) }' E A8 P m2 S# _
) B2 h; x+ U. x5 Q
___________________________________________________________________________
0 u2 K& k+ Z1 R8 s6 f
4 O$ m: X" {5 m1 aMethod 025 r9 U2 p3 T8 P8 t1 f$ W, A! W# d
=========
: f' Y( q: T; H2 M- g$ _
: k4 G, _) k6 X& r5 k& T6 {' @Still a method very much used (perhaps the most frequent one). It is used* c2 ]* l$ y% N# {) |
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) n3 ~+ b, u2 w. C3 lor execute SoftICE commands...
2 Y4 @: Z ]% D3 l7 i4 oIt is also used to crash SoftICE and to force it to execute any commands* x/ B1 m+ A! D* d
(HBOOT...) :-((
) e8 Q L& @/ L. z' V- D
z0 I4 `4 m* E* t) uHere is a quick description:
$ M! M$ [" A3 i-AX = 0910h (Display string in SIce windows)
% b8 a. ~$ T+ z! _9 p( S. ~+ ]-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 g5 C7 A8 f! z1 e
-AX = 0912h (Get breakpoint infos)7 k9 {9 M+ O0 X! l- r
-AX = 0913h (Set Sice breakpoints)
6 w4 V) a S' X3 v. T3 B0 M' q-AX = 0914h (Remove SIce breakoints)
^% t1 s+ A9 Z; j. W! ?: M) B9 \- ?7 O: n U z6 F
Each time you'll meet this trick, you'll see:, J9 ~: s8 X/ @! Q+ A
-SI = 4647h
9 C' c. Y" d7 q3 P _ ^: a4 X3 ]-DI = 4A4Dh) o8 z D! @4 @ X+ y- A2 I2 j
Which are the 'magic values' used by SoftIce.9 C; Q1 ^1 M! r* L: x+ X j! x
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.* ]3 ` ]! Y. `4 z* o7 u$ g
& E7 S9 ^1 } G3 u/ m- d$ }
Here is one example from the file "Haspinst.exe" which is the dongle HASP
0 \6 G" f. m8 u% T+ Y; Z' x" zEnvelope utility use to protect DOS applications:
7 Q* y+ d% ~! E4 p
" k) w' F9 r/ e) G0 i% K8 V% y# _: N: }6 N$ e; X
4C19:0095 MOV AX,0911 ; execute command.8 f+ z* e1 s; n* r
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).0 e1 H0 {+ o3 V0 r$ k1 J2 l' N
4C19:009A MOV SI,4647 ; 1st magic value.3 s, O. g3 T! Q9 ^% F( N
4C19:009D MOV DI,4A4D ; 2nd magic value., b. K. [, P: M
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 b8 z, M% M4 {4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute6 k9 t) e+ u0 K: r
4C19:00A4 INC CX
% v8 t/ l* D4 D1 |- u R9 t4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* w, R. n* N( f M2 D$ G; m4C19:00A8 JB 0095 ; 6 different commands.
. n4 B- n( M# S. G, O3 `4C19:00AA JMP 0002 ; Bad_Guy jmp back.- H. c0 {* P, G" R2 ~- l5 G( ?
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* r4 r( h( R5 _9 S' B$ {( v" j! L6 \5 g4 K: V! G; ?% p( r( X4 \3 f
The program will execute 6 different SIce commands located at ds:dx, which
* q& I$ a* w" V& @0 W1 F+ Yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 t4 \7 ~1 O! E3 {+ ^8 ]* M6 t6 R- X; t: V3 x
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.9 y8 }8 y$ @4 |3 w: U6 f$ W) m
___________________________________________________________________________8 }' g/ q* ?* j
$ |+ s9 F2 a$ Y9 v% Z3 ]+ L7 |! h& n( r! c- B/ P( @0 r0 U$ `6 a
Method 033 @; u- ^+ Z R7 N
=========
: F. s) R" I0 x3 w# o) E
. M0 n9 p+ w2 vLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 I7 a9 A j) N4 q
(API Get entry point)
& u: U3 p2 ]3 @$ s2 V1 m9 m+ Q& |
( S0 n2 `- y, ?, P1 Y# y" R0 O5 z: L2 ]" J& g7 t3 n
xor di,di$ n, F. P1 u7 M4 Q F, {
mov es,di
# g3 D6 r5 Q5 a6 B6 q/ t( X' B mov ax, 1684h
7 ?: i8 C: s. c) h mov bx, 0202h ; VxD ID of winice
_/ s. I7 O; e: A$ M int 2Fh
1 j0 W% D, g9 t+ M mov ax, es ; ES:DI -> VxD API entry point4 d8 p- j! P% }' d) K4 w) f# R- R
add ax, di2 \5 Z* f$ c0 E- G( V% F
test ax,ax
2 i* x7 O% _7 M( s" G1 p, V/ \ jnz SoftICE_Detected. d6 V1 p; n4 N/ [% K( h) x
5 W, }$ D% {0 N6 r4 P___________________________________________________________________________0 ?: H. t$ G. y6 |# E4 a$ W' k
3 a, [6 a3 t- Z3 ^# Y SMethod 048 n/ u2 ~+ Q. X* g
=========
$ H, Y/ d7 R9 A% `' b7 `
9 c1 o, H: h5 P, xMethod identical to the preceding one except that it seeks the ID of SoftICE
1 P+ D/ z5 P7 _- Q( ^GFX VxD.
+ I- q# r2 @, S! l; m& S2 t1 J7 g- D- `5 Z( } b
xor di,di
( H+ u8 E) f) `, \ mov es,di u3 X# Q7 H! o) u }+ U/ n
mov ax, 1684h + C; }/ g) Z" z- c5 v
mov bx, 7a5Fh ; VxD ID of SIWVID+ N2 U% H. y. O: b' y7 p1 l4 h
int 2fh/ x; u. v+ d; U+ }
mov ax, es ; ES:DI -> VxD API entry point
1 \* m4 d( ~4 a C( P: \ add ax, di- h3 }) S/ n8 z' G# l6 }' R
test ax,ax) ]- o- R2 C$ H3 e0 L8 c. M
jnz SoftICE_Detected
+ f9 {$ R+ v& J
8 k2 l' x: h8 p__________________________________________________________________________0 c( y0 h6 W0 I( \! \) m i$ O& |6 \5 o
# j( r# [7 X/ g9 j) S7 p* U' m# a1 S# _+ ~8 T5 z& G
Method 05& \& T2 r- L& _* z3 E; b. _
=========0 o$ e% v& q! Y& V% ^, g+ H
: G: q" r& _1 n% d! m9 h7 V" c' q
Method seeking the 'magic number' 0F386h returned (in ax) by all system8 S* S3 d( T" _6 Y( z* w
debugger. It calls the int 41h, function 4Fh.+ Q8 B% u3 [( q9 s! w# G. m
There are several alternatives.
: H2 w1 }# I/ N0 y! J
+ B/ b7 i/ E$ [1 xThe following one is the simplest: V" A9 ~3 I% N* S7 ~ A
1 d5 K Q" t1 j* r, t
mov ax,4fh
, l6 K4 z7 m$ U) m I int 41h
7 l5 u1 K8 ^4 g! I7 W7 j% F6 w- A cmp ax, 0F386
) J K6 ~1 H$ g* S jz SoftICE_detected
7 a7 z% H5 t* a Z0 f- Y# B) y# v" Q3 w/ e" I9 F$ l9 o) X1 G; Y9 r
# l4 T# Q5 t8 O6 ~2 JNext method as well as the following one are 2 examples from Stone's
/ t% H: j- `0 F4 h2 i6 |/ d"stn-wid.zip" (www.cracking.net):
* i% z* u# ^8 G" _* S8 X L9 X) b/ ~( V6 U* M, P4 Y4 ?) |$ x6 o7 z/ a4 E
mov bx, cs
1 M% U$ K1 W2 k6 e" t7 M lea dx, int41handler2) w( u7 C0 v: w) z
xchg dx, es:[41h*4]
, R, n( Z! @) B' W! t2 g xchg bx, es:[41h*4+2]3 h" M& A; |. l7 X
mov ax,4fh- K+ d; K: W9 f9 O0 i* y% Y U
int 41h
; k) A* H$ H/ h- ] xchg dx, es:[41h*4], d+ \, [/ {4 Y
xchg bx, es:[41h*4+2]
?) B2 e5 K% b1 x+ V0 I3 m cmp ax, 0f386h
; A1 i* i& |: |9 `7 U8 P0 L0 V jz SoftICE_detected8 }! `! F. N% D% B, i5 E
" T" ?& _/ b8 U7 G' [* Vint41handler2 PROC+ R8 O$ Q' t3 o% |
iret& u4 s* B9 h( @# F+ j0 r3 Y
int41handler2 ENDP
7 K8 P& q+ I& f. Z1 N" e6 t! T
8 [! k3 O' V! L" c9 v. y8 c" v
_________________________________________________________________________
- N. T, [/ k" r* k; N- x4 c( a3 x+ T$ B& d* c( H/ \2 D6 [/ z4 L% c+ N
7 L: M4 G. C7 `
Method 06+ @0 h, K' l3 G5 n2 h: ^
=========) Z* s! d* `1 M/ ?
! P" |2 x, Z1 n# l
% [8 x+ ~" X; D' J: d
2nd method similar to the preceding one but more difficult to detect:2 ~: O( n/ g* Z! z* M) k, i- E
" X3 W! Q/ c2 S- d( c9 \. U6 k0 x; S0 m
int41handler PROC% `0 M7 x) v& f! r& Y
mov cl,al2 }5 K" r* e5 n5 v' [$ N8 k% u$ T
iret- x( n8 c$ J) h& E. y" v, x
int41handler ENDP
/ D) y# L5 h0 e }* {' p" \
# m/ t# D' @( X; n+ d R% h+ i
. r" ~0 p k4 t! j+ y, S. u2 l3 Y xor ax,ax2 {% U: z6 C' E) ~4 C# G- _
mov es,ax
7 x( ]4 P- E- b( H% v: m8 W mov bx, cs/ k, I+ j/ v7 V4 @
lea dx, int41handler
# i1 r8 W2 v9 s( Y1 w8 f' t c xchg dx, es:[41h*4]. ?% e# k( B% \. T$ ?, ~
xchg bx, es:[41h*4+2]
& q, P$ N7 N$ M in al, 40h
: W( w& |: c( {" o3 ]3 G% S8 B xor cx,cx
2 x8 R+ o6 e# U int 41h
5 N6 c2 a6 l/ X xchg dx, es:[41h*4]" C: v' V9 ] Q7 U
xchg bx, es:[41h*4+2]% ]8 _4 B6 ^/ x4 ]
cmp cl,al- U1 Y% e! O% ?2 {. X, d
jnz SoftICE_detected
# \4 @8 { U1 ~# ^% X1 g& l1 M9 i; O: N0 y( B% U$ `
_________________________________________________________________________
1 Y/ E" E" E% h& H. y+ j8 }7 j) f" w; ]- ~
Method 07+ i7 A& e6 p1 ~- q8 Z' B
=========
& X% Z) x) k8 R r$ V {, Q$ p9 Z2 B* [9 S1 J+ v, N; I
Method of detection of the WinICE handler in the int68h (V86)
% {( T+ V _% w3 C/ ^+ t1 L
& w& `- q' P/ L W mov ah,43h
/ j, k: p$ ~! B: \7 R* o7 x int 68h! R& G6 F% m9 \$ X% A# k
cmp ax,0F386h7 Q+ @' ~/ @6 K) B$ b
jz SoftICE_Detected7 ^; m7 M Y/ u0 K5 o1 Q
1 ~2 W5 g$ z6 S
: {$ n2 |, ?7 {1 P=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit J+ F: ?+ [9 w- N) j
app like this:: s; E5 v% J3 b. g4 \
5 a% y V% i) S
BPX exec_int if ax==687 \* C/ G- j* g( h" C. o* |
(function called is located at byte ptr [ebp+1Dh] and client eip is$ Z7 _: _/ N4 @7 N9 _
located at [ebp+48h] for 32Bit apps)1 } I( s" F! a. z
__________________________________________________________________________& }8 C3 `/ f, A7 n+ [
" A$ `0 M6 j' @3 Z
6 R& X) h: b0 T i+ Y BMethod 08
% l. \+ F2 C0 N; u' f=========
1 t u8 f- P- R. W( K: B, p8 J$ I8 I; ~* V# X
It is not a method of detection of SoftICE but a possibility to crash the M$ ^0 f x3 H# \2 m" d
system by intercepting int 01h and int 03h and redirecting them to another
4 ~/ x+ C) S# @( y) c7 rroutine.' G7 {3 m; t- J/ r0 q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" p8 r% b9 m" Q; W( |1 f. w
to the new routine to execute (hangs computer...)
1 q/ u+ E' y8 k/ Y5 o
. R. D' b2 ?7 g: X) p6 | mov ah, 25h9 W" C9 p6 f0 M, a
mov al, Int_Number (01h or 03h)2 j; N" ?2 W+ @- g
mov dx, offset New_Int_Routine& w! F& n0 [& u7 {8 D
int 21h
, R; m+ k( [* b3 o' I, S/ ~8 @
$ ^% }$ k/ f2 {0 T0 F* z__________________________________________________________________________
' R' k4 Q i9 o, d$ Z$ T% }0 }7 Q8 w: G$ y$ t7 Y9 `7 F; ~
Method 09
% t% d, z# K7 Z! e) l/ c* L=========
& \4 I: o! a i1 ~! Z7 H1 A3 [8 K- T) t [ y6 n6 X
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
9 R6 C7 } o! @0 C" w% i- tperformed in ring0 (VxD or a ring3 app using the VxdCall).; J4 b# ~. t- q+ q" l! f
The Get_DDB service is used to determine whether or not a VxD is installed
) d) I1 y* Q rfor the specified device and returns a Device Description Block (in ecx) for
9 y$ o/ {+ C! }3 nthat device if it is installed.6 j# W( c5 f4 |' c
" j6 q, ]2 D* B$ ?3 ]0 H# C
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID+ t. V) q9 e% E/ T
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-). ` L5 s4 |. X
VMMCall Get_DDB/ h' ]: }% z$ C' S$ `" b* J; x) y* z
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed, J: L; m4 \" {% s1 k& \
* ~" G+ k1 l( @! k. BNote as well that you can easily detect this method with SoftICE:
4 R4 K2 Z8 J& H" { bpx Get_DDB if ax==0202 || ax==7a5fh
4 u' A3 K2 _' E" b+ W# o
6 q- M1 K3 L& q. A; q__________________________________________________________________________
! A9 s+ `" p! U2 I
5 a$ f' ], q4 p+ e: w" AMethod 10
2 R R1 h# V4 E6 f7 c! Z=========6 ]5 g4 E; F7 q% a0 T- n/ H1 b
3 m- L. e; q6 L3 r# T+ m. b9 K$ U
=>Disable or clear breakpoints before using this feature. DO NOT trace with! r9 M7 F5 b6 O& f7 x$ u3 @& S
SoftICE while the option is enable!!( f4 Q6 g* l6 W# r/ w* N8 A2 G
2 n" h3 `" ]8 q! _% { [ Q
This trick is very efficient:
8 {3 K5 {0 l! Jby checking the Debug Registers, you can detect if SoftICE is loaded/ g3 }. {- s# c* \5 E
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; F: r% a9 k" z: u& ^
there are some memory breakpoints set (dr0 to dr3) simply by reading their
# J7 F! \, z$ h. ?value (in ring0 only). Values can be manipulated and or changed as well9 H. Q4 `% {5 K$ o! p
(clearing BPMs for instance)
; }; u6 m; O5 ?9 i7 ^0 z& H
' _6 c# Y1 X+ A- |# E__________________________________________________________________________
2 Y8 \/ n6 a, f2 }/ K3 \8 r$ _
5 `- k0 }9 ^( N5 C3 OMethod 11 U) I# Q+ |* C* k$ G6 l. A
=========
& |: L/ I. _2 L
# L0 R/ X% q. ?' N9 E! S$ d" fThis method is most known as 'MeltICE' because it has been freely distributed7 g: O' X' s9 x
via www.winfiles.com. However it was first used by NuMega people to allow
3 f# s0 K# p1 JSymbol Loader to check if SoftICE was active or not (the code is located# ~, m; D/ t) k; n6 ]
inside nmtrans.dll).
, v' m! i9 l( l1 e! r/ U$ c# r* s' w5 c/ l2 R9 z6 [% z) E
The way it works is very simple:
2 ~& g& U& l: q6 yIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for5 u$ i2 A/ V$ N' K+ v a
WinNT) with the CreateFileA API.) r( o6 q3 ` O/ a. Y
- J" v5 @: v, K) V$ K6 vHere is a sample (checking for 'SICE'):
% m4 j- n z8 f& b& J: y, Q
4 ~ x7 A( ~2 J4 A* wBOOL IsSoftIce95Loaded() q# m4 J8 C i5 @
{6 H& b7 l9 @, c) O* t
HANDLE hFile;
0 ~ ^5 }6 O- H2 _! E; e hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! s1 W3 O: h) r/ J: R1 v FILE_SHARE_READ | FILE_SHARE_WRITE,
. F" D+ _: i* e NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
& \% K2 V8 v3 g if( hFile != INVALID_HANDLE_VALUE )2 s) y. k+ y2 i$ _. `
{4 ~' [6 {7 g2 V5 J
CloseHandle(hFile);2 \- F' ~! g5 i
return TRUE;
7 r6 }4 r; `* E6 S# W, a# } }9 p" R( j; q7 z3 k
return FALSE;! ~& Y7 I2 \& L, E1 Z* `
}2 A; q! X# z& H; y1 y
+ c3 P" n1 d7 d- C7 v0 T. s
Although this trick calls the CreateFileA function, don't even expect to be9 w& G. _2 g5 Q6 U* W+ X0 w1 e
able to intercept it by installing a IFS hook: it will not work, no way!) _& L6 ]! x0 e0 O1 v1 x
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 L, l" M1 G; \( Fservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ ^5 y* `+ I% |7 {
and then browse the DDB list until it find the VxD and its DDB_Control_Proc7 Q. A6 ^( J- _7 w( O) n
field.
8 j6 H# E) Q& d+ SIn fact, its purpose is not to load/unload VxDs but only to send a 9 d- Z8 K/ Q- O$ h8 U( M3 Z" @# w
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" f6 \/ ]( n. ^5 E) O
to the VxD Control_Dispatch proc (how the hell a shareware soft could try/ C2 Y: J7 m) s4 Q2 b0 u) ?+ P7 M
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, Q9 D8 Q; W; h2 l' J+ @If the VxD is loaded, it will always clear eax and the Carry flag to allow( W1 S* y' k G. Z8 i% M7 E
its handle to be opened and then, will be detected.. G+ D5 l) j- V- y8 S
You can check that simply by hooking Winice.exe control proc entry point
$ G4 e0 n5 k+ q% I* ~+ bwhile running MeltICE.
# O6 u+ x: V; y& z X! C" | Y7 K* b0 l6 o1 ?1 H6 e; |% p; i! E- L
$ d- }' B0 p. L& O4 f3 n
00401067: push 00402025 ; \\.\SICE
1 L! k3 {1 [+ R5 q3 a; m 0040106C: call CreateFileA
$ C/ R" z7 _$ r+ d0 Y7 b4 D 00401071: cmp eax,-001
4 u" S4 X" \- S' c# ~$ E 00401074: je 00401091
- y9 e! t2 M6 E+ ]: h$ { Z. s7 P! h
0 o; W! m' \$ l) @- \7 Y$ u# i& T
; b# f$ r% E i! a7 eThere could be hundreds of BPX you could use to detect this trick.8 r) F. U' G1 |2 @/ D
-The most classical one is:' x0 M8 @: H7 O& ^
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||7 R; {8 T9 F# {7 M: e2 Q4 ^+ s) K
*(esp->4+4)=='NTIC'
; s1 A3 ?* ]5 l5 C
( {6 o3 r. C8 H3 Y8 k9 ?+ @-The most exotic ones (could be very slooooow :-(3 a1 z% v, x8 z) P' i2 z6 R4 X9 }
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) J) ^/ A, g8 a8 T
;will break 3 times :-(9 D+ x) t0 c/ V, B! N. {
. ]0 I+ c0 p/ g5 z-or (a bit) faster: 6 `2 O, O7 o: t0 \8 ^/ c
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 P) R! l: O8 m& R2 r1 a. Y7 z! W: L+ u
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( }0 N" b0 ]+ P0 w: k5 j1 k ;will break 3 times :-(
% H4 `0 I8 P% q- O$ z5 |! T2 ~0 `! w3 T
-Much faster:) b4 K& z" [) w( w$ h! R1 O
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( B H3 K1 o! Y! u" Y- c* O) ~; `. B# X- m
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen. m; V1 s" b. N$ u* ?. E
function to do the same job:
* n- @6 ` p% z! H3 P9 \' U" @8 F3 Z" _* F. }) {6 [7 v2 h
push 00 ; OF_READ
$ K; `9 s8 E" a! F) a4 z: E% J mov eax,[00656634] ; '\\.\SICE',0) p6 d! H* K2 D6 ^* R- `
push eax
) M+ w3 H" M. @) c call KERNEL32!_lopen1 {+ h" j) t0 ~
inc eax
8 h5 Q2 y) K5 c: ^ jnz 00650589 ; detected
" N, u l7 p& V push 00 ; OF_READ
! d( y5 M- V8 c/ N& a* X" z mov eax,[00656638] ; '\\.\SICE'
! H$ j0 U! o9 E$ x3 i# `" K4 _ push eax
* n2 i3 N+ A8 a( ^/ P) P call KERNEL32!_lopen* z# n3 U6 t; v- [
inc eax Q; F- c3 g$ N H9 y z
jz 006505ae ; not detected. q L1 h; t' {8 V
% Y4 J# M/ M+ d n& {2 {5 M8 Q, T
% N, u3 L b u1 \. p__________________________________________________________________________& M) Z% I7 l0 ?
& g" g I5 L3 EMethod 12/ j1 I3 ?7 N9 @1 v, q8 \7 ^
=========
, A+ N& F% U$ V* d2 h6 r4 S6 H# I* P* I: U
This trick is similar to int41h/4fh Debugger installation check (code 059 v' n, @/ @1 P) `
& 06) but very limited because it's only available for Win95/98 (not NT)
. a# N2 h4 C1 J8 Yas it uses the VxDCall backdoor. This detection was found in Bleem Demo." j7 E \1 Y2 f. P4 T p b
t/ z, Z( A/ a/ R
push 0000004fh ; function 4fh: w+ p+ p7 Q9 H0 z: o
push 002a002ah ; high word specifies which VxD (VWIN32)( x" s- v* v+ e8 D
; low word specifies which service6 p& o0 \. O$ t* f: `/ C
(VWIN32_Int41Dispatch)
* B- e0 A! C5 _2 ^$ q call Kernel32!ORD_001 ; VxdCall7 t( ^8 c8 N7 F9 R( E" A% `
cmp ax, 0f386h ; magic number returned by system debuggers
# B, U8 X) r9 M4 g7 Y3 S# g jz SoftICE_detected
. v6 N# }8 I" G' y$ C4 b$ H$ ?, m
Here again, several ways to detect it:
5 n( k- _! B' W d) H+ X; {8 G/ I$ [5 e3 L
BPINT 41 if ax==4f1 c5 N- p8 R6 U. M1 F- w( j
0 j; O7 y9 X! W6 d9 k2 | BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one% B& }1 ^5 P9 R, Q( t0 R1 R. L4 c
% n: v J/ e7 w5 U" A3 m( E0 J BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A1 K9 \, x* i4 T* I/ v0 f
7 o( w6 f! `" F. S0 U
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: X$ |" r: v; M" l
- n, j/ a4 m h5 ?__________________________________________________________________________
5 y' |' ]- {1 W# d1 {- c Q, v4 R; p6 b* k' Y$ p, `
Method 13
9 X- P; c' L; S========= m9 ]- g- H! q+ H
. |5 a4 F- g D- ]- v' O& `Not a real method of detection, but a good way to know if SoftICE is1 R: w1 f9 M. ^& a& f
installed on a computer and to locate its installation directory.# z* o" e5 U( t- N6 G1 l7 K
It is used by few softs which access the following registry keys (usually #2) :
9 r6 D6 e4 M% R8 [9 p* v& S
" P3 W) C i2 O-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 E" j" V' h6 o\Uninstall\SoftICE5 W7 B9 J% O( o( a! Q i4 E7 q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! i: o( c5 F0 w0 h0 X/ i-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& H- ~5 Z$ S9 c; Y1 b+ s\App Paths\Loader32.Exe# B' Z' }- U. X3 n* ~& s" U3 V
& C& n. Q. l8 A7 X7 p, @
' A8 |' s1 U0 ?+ q0 A% DNote that some nasty apps could then erase all files from SoftICE directory# ]- Q1 i) k8 g/ R7 O4 ]5 p
(I faced that once :-(' @! x4 r+ q4 z% l7 C
3 @$ L: d8 d7 I$ P: F0 X" d. j" oUseful breakpoint to detect it:
% z Y9 L/ F( ]* D4 W+ O! m) ]* A2 U: V
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
, K3 p; f; ]! K. S
& O1 J7 ] E/ w/ h# j- P, S0 z__________________________________________________________________________7 e$ {4 x; d; b' ^
3 f6 s+ X* l8 O0 @: ]
8 H$ ?9 s+ y3 [8 [& G, }
Method 14 7 t% {) Q$ Y8 T i# |- D# X/ E9 D' A& d
=========
, ?" |6 t2 n% L% Z' T
' y" q& V- L% f7 t8 E: v+ i cA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" A" b9 b+ r) V' r1 c
is to determines whether a debugger is running on your system (ring0 only).
1 ]* G( r2 _7 `9 s" E- A6 L+ `5 @8 N, P# t n8 L
VMMCall Test_Debug_Installed
0 d( n6 G; \2 U: v je not_installed7 [! ]' X4 Y: j
2 d9 Y' {* o& S, w! M! D+ VThis service just checks a flag.
5 h9 `8 A) Y6 H% ?1 a0 ]</PRE></TD></TR></TBODY></TABLE> |