<TABLE width=500>4 Q0 F" r- K2 P3 I6 n
<TBODY>( l8 `8 R/ C) a. L3 g( j& z
<TR>
. U" _7 m& T. W6 p4 m1 G% X<TD><PRE>Method 01
w1 m/ b/ m. D0 e. x=========
$ o" u O, h5 S) L; G% D V
0 w- A/ D1 M0 H% b0 l/ b IThis method of detection of SoftICE (as well as the following one) is
, B- Z' y4 ^ }/ Lused by the majority of packers/encryptors found on Internet.
- O0 ~/ F8 `! A6 X8 P! B$ ?It seeks the signature of BoundsChecker in SoftICE0 c9 D1 d5 m R; k; q% j) d4 x0 ^' ?. \* Q
" J7 d8 D- u2 c* |8 S$ i% \
mov ebp, 04243484Bh ; 'BCHK'4 q0 d" G$ J. H; |
mov ax, 04h
) V, I" r6 l+ H1 D, H& z3 l9 A int 3
4 C% p% X0 ~1 V( Y( I. U: k cmp al,4
4 \6 V. g8 V8 j5 R7 }- u4 O6 h9 G jnz SoftICE_Detected
" ?1 ?# z5 P1 y) C7 U. N2 p0 I$ \7 _
___________________________________________________________________________
. E$ x/ \ m; M0 h P* R% U6 ^% m+ X2 o' @ r% E' L1 }
Method 02/ U- M/ B+ V7 ^5 t6 V# m
=========- [( m8 Y9 V% U, d( q
" Z; I- _# ^- ?0 ]
Still a method very much used (perhaps the most frequent one). It is used
0 I+ N5 _7 Y) w i; Bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ ]; a/ `! B0 {
or execute SoftICE commands...: y1 a- z- ^5 W" w. i- ]
It is also used to crash SoftICE and to force it to execute any commands
9 N" _( @" f/ ]& x+ G" S(HBOOT...) :-(( ; I8 F/ u8 O) z2 A9 r6 M- g) ~
8 U" q& O: a! F4 X' @8 ]% w
Here is a quick description:
6 H- Z+ G5 w* F8 ?-AX = 0910h (Display string in SIce windows)
$ W/ Y6 g, G! ~. w$ \-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' _& @+ F' l. q
-AX = 0912h (Get breakpoint infos), Y% j6 R& ^8 b
-AX = 0913h (Set Sice breakpoints)
& W6 Y% y; U1 m" ^5 E-AX = 0914h (Remove SIce breakoints)
+ s% T- C+ L' O' b+ G- m+ F! v
" m9 w8 ]9 Y) H, }) [Each time you'll meet this trick, you'll see:
# M* f6 T5 P. T) m/ [-SI = 4647h
7 d+ Q( p' ~0 E9 T. A( H# f-DI = 4A4Dh Z9 c, `$ ^; ^; e* |
Which are the 'magic values' used by SoftIce.
4 M& d. E4 N/ |4 d% v5 W9 WFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ Z9 r2 j- N. u- N2 |) ?* S
9 {, K3 ~, L6 ]% O Y( X$ {1 bHere is one example from the file "Haspinst.exe" which is the dongle HASP3 l- {8 P# U: d8 E0 u
Envelope utility use to protect DOS applications:
9 e+ C& B! P1 g, `" H& x4 e. N" f8 v+ P) U, P8 J
: A$ [) I, w1 _( C( t" G' [) V
4C19:0095 MOV AX,0911 ; execute command.
6 ?: \7 R$ p. f( S2 Z, I( \4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
: B( G/ _! |; y0 o [! B4 H4C19:009A MOV SI,4647 ; 1st magic value.
$ H5 Q, E# r: m4 Z, f7 u) f4C19:009D MOV DI,4A4D ; 2nd magic value., A! y$ F1 J3 S9 m. e
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)! Q8 h0 I0 r0 _/ c2 e; e- O& ]* W
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 d+ Q( L6 u" _# F2 B2 L4C19:00A4 INC CX
# I, X, q) E! P0 |8 n* e4C19:00A5 CMP CX,06 ; Repeat 6 times to execute5 ]8 }0 l* v4 w' t% u' r* D' i
4C19:00A8 JB 0095 ; 6 different commands.1 a' f3 d, m5 X$ E
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 R, O7 k+ P% Q7 H0 A4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( g9 \, G9 T, n c
" W6 j& E& Q7 b) [$ AThe program will execute 6 different SIce commands located at ds:dx, which/ R* x. w) Z3 s0 M" N* ?& f. R% E% H
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ B, n; Y$ o" m+ T/ Z( y
# f) s. B5 ?8 r, { N! p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; ^ |- F! B6 c+ A* ?
___________________________________________________________________________
- x3 o/ [: q Y( u) }
- F- p' H9 u6 U9 H' U, N3 p" O+ ], M& v) N: o O/ f- `
Method 03
# m8 x' p4 x ]" @=========" I$ t8 P) ~0 f- W5 l! M, l
/ y6 t! L) E3 J: B" ]
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 e6 A4 N c8 e0 M. H
(API Get entry point)
/ H& L$ n+ E# _+ d; z ( o: p2 H8 |, h- d9 r
3 f4 T0 w4 Y# L3 I: @) C2 W$ ^8 h
xor di,di8 u. x7 O) y. x$ q
mov es,di- Y# u1 r0 z* V. I
mov ax, 1684h m/ ]1 B8 \9 g+ e+ w, q! \; ]
mov bx, 0202h ; VxD ID of winice
8 J- J2 _/ R5 M% c g9 H int 2Fh% l, W2 ], C9 m# Q- x' D7 J) D
mov ax, es ; ES:DI -> VxD API entry point
0 f$ U: ?# d) B5 X add ax, di* e w1 x9 F; M
test ax,ax1 V7 j! T3 Q5 R4 o9 C4 ?
jnz SoftICE_Detected
! j% i, \& X; A: n4 r8 M
" U% ]1 A9 b8 A. `___________________________________________________________________________/ ?+ j& b6 I$ ^, ?; d& W
/ r4 C* e+ R( l" d, g7 E
Method 04" u5 q& a8 U. z y7 k
=========
+ a% {+ J Y' I$ g
+ w9 E5 [& r% ]" a: jMethod identical to the preceding one except that it seeks the ID of SoftICE
5 X2 A$ B. V3 i+ T- f" CGFX VxD./ B+ P/ i6 K+ n, Y" ?6 g
' a- b9 l! e5 H, r' H xor di,di
) g5 h9 C! U! r0 d F" f' q mov es,di
5 E- r7 @. i) Q/ T0 \ mov ax, 1684h
. D. D; G" V% M- q9 i! l mov bx, 7a5Fh ; VxD ID of SIWVID
8 Z5 d6 ~ _# H2 o( ~! r2 o int 2fh
! x, {/ {9 u: U& f5 F mov ax, es ; ES:DI -> VxD API entry point
5 y) P! z% ]# W% W* { add ax, di' C; @0 e; J. J$ a1 q
test ax,ax/ |9 p- U2 O9 ]
jnz SoftICE_Detected
0 a$ q X# Z1 l( {; Q/ \* k1 l8 Z4 E0 T( S+ i
__________________________________________________________________________
1 P. k* l- b G
+ S) [/ Q, r; E M' `; K- b4 I; s- O2 E
Method 05( P1 B; b/ a2 f. W3 ]2 @' p8 v5 y
=========
$ c6 [' l1 w i3 w9 \2 O4 p$ C' \# `* V" R& P7 h
Method seeking the 'magic number' 0F386h returned (in ax) by all system
* Q0 n& S4 {. |. T! N" z5 H0 Adebugger. It calls the int 41h, function 4Fh.& _% U7 M8 I0 ~- b7 ^9 X
There are several alternatives.
/ y- ^* K1 ]9 W* k. h7 W
% t% C' Z' R4 h. EThe following one is the simplest:( ]9 M# ~4 d9 p) Q& ~, r2 X: n
$ A/ X( c+ [, H) P7 K& T/ A
mov ax,4fh9 W1 U8 [ Y- x, S; f
int 41h( c5 @2 K/ W; v) D E, g) V' j
cmp ax, 0F386/ t: b0 T" @2 ^ i( H& _, u
jz SoftICE_detected/ X1 s9 ?* w3 ^7 O r5 K
% u L; ~+ ]. J
) O$ Y: `( l4 p1 Q
Next method as well as the following one are 2 examples from Stone's
2 J7 L4 h+ x1 B* U6 l. |. `+ k"stn-wid.zip" (www.cracking.net):
7 H4 _5 g6 U; }- U. k. w- p6 u+ v# m8 x- O: G! O1 _3 f
mov bx, cs, G0 R/ V+ U6 w2 M+ H
lea dx, int41handler2% l( K; S: Z. x
xchg dx, es:[41h*4]
/ k7 n7 ?, e& q; a xchg bx, es:[41h*4+2]5 X5 \* M6 z; G
mov ax,4fh8 I2 j9 g, i9 V2 g9 D5 ?
int 41h
+ l0 \" u. y- X, R: H xchg dx, es:[41h*4]( y/ Q0 I2 t' B: d! i) J2 _2 H8 j4 u/ `
xchg bx, es:[41h*4+2] F( y. \2 s# T8 f5 z
cmp ax, 0f386h
# u O9 X: [0 D9 O jz SoftICE_detected# V8 R8 l4 L4 i4 ?
( t* \: Y8 F( m3 b* S! x; e+ H* ^6 j
int41handler2 PROC
' I/ Y k( s0 S+ Q/ A b) s4 L5 ~ iret
$ R! |% k/ L3 ]! t0 L& wint41handler2 ENDP
1 l2 j I# |; N2 |# b d
; T. P3 h5 J$ M7 P! B6 Z3 B5 ~/ ^; {, m
_________________________________________________________________________$ B$ u+ n# A2 F* C' p3 [
5 S' T9 z( ~4 {" V, n) B4 g5 K
1 G, O6 b/ p+ f. t% C& ]
Method 069 ~% f4 ^( k- O: F2 P+ w2 p
=========- B9 v' {7 F$ B* M
. _/ W% }3 @# F: ]
0 @1 @4 d% a9 v+ }$ I2nd method similar to the preceding one but more difficult to detect:8 Q# |# y! l# m( ?
) }: ^% c0 V/ F1 n- N& e; ~
0 x4 y+ c, X3 t. fint41handler PROC/ K: p- d% Z! c3 m) N; s5 z- h7 X
mov cl,al
3 u' b: N/ U* q$ _* X& O iret) d; @8 Y, e# B: E$ o
int41handler ENDP' b, y7 I$ q Q" I: m
, F# @: D6 p6 s' r! [ |# K
! Y! ^( G: c+ v* p. E xor ax,ax
' E2 M: C4 V4 k1 N$ B' h8 k" ] mov es,ax
& [4 {; ]0 S/ P6 P! b mov bx, cs) M3 \# J9 F; c; u( S3 _
lea dx, int41handler
2 G5 z7 ^5 g+ V8 x$ R xchg dx, es:[41h*4]6 w- m2 c! w1 `9 j" w
xchg bx, es:[41h*4+2]
/ c& x& T. P& d9 F4 \( M+ o7 W4 T in al, 40h1 n! K, Q2 R" y
xor cx,cx- g- z6 ~; J& C# f. W9 y/ [
int 41h
; o6 g6 [* W6 T- r xchg dx, es:[41h*4]
4 m; i1 C$ u, a' q+ G5 ? xchg bx, es:[41h*4+2]5 v) G9 _4 D0 Q! h
cmp cl,al) ^3 S5 w( }, i5 s
jnz SoftICE_detected4 u8 O( b6 t" `4 a* Y
! `7 a* t1 ]* ~" ^4 J_________________________________________________________________________
) d8 f. Q8 v' @* I4 B1 @: X- Q
6 H6 ^) {) j! a/ k1 E, ]# g3 aMethod 07$ c- q8 F' S1 ?: Q# H+ D
=========6 O7 _7 V. a5 b
) m9 Y1 v3 O, m8 t
Method of detection of the WinICE handler in the int68h (V86)
& y( n p" y2 V! c- d6 \
* M5 D- L4 Z, T1 v8 j mov ah,43h
; [. r9 P( a' \. U! k/ J# L int 68h
* t+ G9 N5 [' e% A0 s cmp ax,0F386h' e5 x+ D4 ^+ R: L
jz SoftICE_Detected
# \" D# f; Y3 I- U4 O
$ h+ c" Y K/ y" x2 p' I' I f. a- D; u
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 ^. U+ V, ~2 U ^. v* n$ `! a9 | app like this:
2 [" m1 r! O, d( ~ i% b
( K) \/ ?) `- o' c BPX exec_int if ax==683 ]; J# o! S' v8 H, n5 y7 x
(function called is located at byte ptr [ebp+1Dh] and client eip is
) N' O9 n( x. F$ |( V+ Z* f) M7 h located at [ebp+48h] for 32Bit apps)
1 b# ]" ^( b% i; T9 V2 _' c__________________________________________________________________________' t# {4 F3 d, c" h' e4 x: }
& s& Q" h: Y7 Z+ V1 k6 p
, l/ |' F0 ~) B' [' _' oMethod 08
( p! ?$ X, U, A+ }; p) u=========
, t3 @3 k* l o4 H9 A+ S/ u' N$ r9 f5 Q+ P( x* Q
It is not a method of detection of SoftICE but a possibility to crash the
/ g3 V X8 Z$ B+ K$ F. Psystem by intercepting int 01h and int 03h and redirecting them to another
, M9 N0 ~$ s' h6 [$ U' [. Droutine.5 w/ ?3 _1 }. v j; i0 o# v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points Y A [7 Q. h2 @# Z) D
to the new routine to execute (hangs computer...)4 v' f3 x; t7 |+ k9 V! E
/ q2 U6 D- V# ]# S) f" z mov ah, 25h X, n5 m( \. f- ^4 H
mov al, Int_Number (01h or 03h)3 c% i+ t0 d: L/ g$ w$ ^; `# J
mov dx, offset New_Int_Routine
8 D: N- ?6 r; g$ T6 M( ]; e int 21h
/ C- X3 @9 z2 o: O/ M* o
4 K- J" V1 |/ l* i t__________________________________________________________________________; {1 A9 M& J8 K2 ]9 ~7 D
- K! `7 Z4 k( o, A
Method 094 a8 c" K# H" s" p, D. N
=========
. B% @' K n2 c6 U
. p0 Y, c5 ~4 U2 _1 a# RThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% e* s) r5 C9 H& z, k3 ~performed in ring0 (VxD or a ring3 app using the VxdCall).3 o# {/ h6 G2 V5 c; X K3 J7 B8 s# y
The Get_DDB service is used to determine whether or not a VxD is installed B9 ~2 D( u/ Y$ [5 p; h* K
for the specified device and returns a Device Description Block (in ecx) for a2 O- l( j8 n" I/ i/ V7 M
that device if it is installed.! d( y* `8 d" A% _" O' |
$ M: P* q0 c0 D5 a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: q' k2 N4 k* F% C6 T mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- I+ x* x' K6 L& X* U
VMMCall Get_DDB& L F& T/ ?6 i$ u/ {6 \
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* O0 [& ^9 R4 _' I6 A+ W% L) ?) E4 W8 D
; m/ C# o$ Z7 F4 P; y8 c& |+ rNote as well that you can easily detect this method with SoftICE:7 W$ J: W: B$ l
bpx Get_DDB if ax==0202 || ax==7a5fh$ f" z* d* \, [$ i0 _2 o. d9 Z% {2 d
$ V4 V# K9 E/ p' m
__________________________________________________________________________
) o1 m- P! U# @8 J2 J7 [# e% ^/ k- b& \+ a9 O* c/ d+ G/ t
Method 10
2 U! K* i! A3 O9 d=========# r2 f; ?9 I3 u( T
* \) }3 J- J! p* F=>Disable or clear breakpoints before using this feature. DO NOT trace with
2 x) F. c. h6 m) _8 S* \+ _3 A5 O SoftICE while the option is enable!!# k; s& A& x$ \& U1 y
5 h. A8 o& l) j5 D) H
This trick is very efficient:
# f) Q3 L: c$ B; L" B+ P/ fby checking the Debug Registers, you can detect if SoftICE is loaded
_4 Q% [, f5 ^2 a3 q' U& S, g6 J(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( Z: {6 _ H" e0 X
there are some memory breakpoints set (dr0 to dr3) simply by reading their
( ?5 b: i- s U. K4 ?value (in ring0 only). Values can be manipulated and or changed as well7 _ Y8 I1 M: T+ J& C% B& q
(clearing BPMs for instance)
% }. [7 M/ f0 o j& Z0 t% n d3 i' x% Z1 ~" s7 Z
__________________________________________________________________________9 W8 Q9 S$ z8 C
) s. c1 L" E1 m1 B: LMethod 11
: j7 r5 P8 C- [. n- b% q, q=========
1 e. n# R8 j+ M; T* j5 y( u2 w! }
" E, c" ?/ ]* }/ F0 F" OThis method is most known as 'MeltICE' because it has been freely distributed& z b+ M$ A/ H0 r
via www.winfiles.com. However it was first used by NuMega people to allow6 D8 z& t& F9 h* S
Symbol Loader to check if SoftICE was active or not (the code is located) H/ c2 D8 Q" ^: h" }5 [
inside nmtrans.dll).! F: c9 ~2 X7 ?/ L4 ^
" `! k( U- Y) T7 m2 b) HThe way it works is very simple:
# p, j9 `; b* C9 g0 MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 C, p4 N2 T' A* Q$ n# ~4 P: b' o
WinNT) with the CreateFileA API.6 a1 M3 k% z6 P. K# {0 G" E
8 ?) [, k: I, Y* }
Here is a sample (checking for 'SICE'):
# |; f( k, [* n- N% q: |- R6 L5 j# a7 o+ P7 @$ z4 e; e; a
BOOL IsSoftIce95Loaded()
[& I7 Y0 `5 q- K{' R, ]1 s) j; F8 ?
HANDLE hFile; 6 D+ s. ?4 C) D; ]& v( D
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,! k/ H/ d3 o+ n S, Q
FILE_SHARE_READ | FILE_SHARE_WRITE,
9 W5 w6 m4 [. s1 Y9 P# l NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 P# s# a! k- ?- c n" f4 n
if( hFile != INVALID_HANDLE_VALUE )
$ j b; H3 z& b: ] F) _ {
3 s" W* J. N8 v4 t; E8 s CloseHandle(hFile);6 K5 B; q8 w# v* S2 e5 j
return TRUE;
2 m4 q* g! C3 u. e9 b9 \ }! b. F1 b7 z2 g. g$ z4 [3 p8 C
return FALSE;
4 p$ \ P/ x. ]5 d& A/ C8 p3 h}* y# S" [' d9 u$ e+ y" J7 A' D. T% c
2 P% [8 t( x; B6 M& i) IAlthough this trick calls the CreateFileA function, don't even expect to be: S$ S/ ^) F8 k
able to intercept it by installing a IFS hook: it will not work, no way! L/ L# [' o6 i
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; N8 G, r. D/ o) Y- y- @
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" i6 U d' X" m k5 W! ^& Q1 ?and then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ t4 s9 O6 S5 b9 g% Gfield.
* ~7 S2 v) b& w; L4 R1 b" i7 W6 qIn fact, its purpose is not to load/unload VxDs but only to send a
5 p/ k, J. K6 j6 G" ^% mW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 W0 M/ l. {8 oto the VxD Control_Dispatch proc (how the hell a shareware soft could try
; R3 w* A' H7 N9 k: T$ n9 h U$ Qto load/unload a non-dynamically loadable driver such as SoftICE ;-).1 A$ d! z# H+ H% x3 W$ d
If the VxD is loaded, it will always clear eax and the Carry flag to allow' Y6 z @5 x7 s% A+ ?) U d
its handle to be opened and then, will be detected.1 e3 J% e- D9 z+ k! ]( o
You can check that simply by hooking Winice.exe control proc entry point) }4 m* C: Z' p; \! }" }; O
while running MeltICE." H. {5 d$ ?. J6 B+ }; R% ?
4 ^; y; {( W) u2 z) s" P
0 z% A) Q6 B# a- V! q0 m 00401067: push 00402025 ; \\.\SICE& Z$ A3 a, @' V/ X; ~' r8 l& s! J9 r: p
0040106C: call CreateFileA$ B R1 V1 q% A
00401071: cmp eax,-001
' k% D# |6 s+ H+ k' ~ 00401074: je 00401091
) h# j- h, |: H* G! u4 ~
) o H' \6 q7 A2 }: I4 U1 t8 n, j6 I0 V9 B
There could be hundreds of BPX you could use to detect this trick.
2 Q% ]) n! D0 e# A' n0 y9 O0 ~-The most classical one is:
. |$ h2 t! h; d: @# M BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# r. A: j1 N" [: g2 l$ \/ \: D, q *(esp->4+4)=='NTIC'3 y; b8 p1 ]& \% Y
& T* N* [4 ^+ q% y5 `) A; L1 R; V. F-The most exotic ones (could be very slooooow :-(
' F+ G9 s& A4 ?0 s+ ]0 Z3 m BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
& V( U5 _ A7 O1 v- y ;will break 3 times :-( b& j1 n! g' g1 {
" [' p% Z, y8 B/ X. O-or (a bit) faster:
8 N( k3 _1 ~ |0 ]8 M/ F1 d6 F BPINT 30 if (*edi=='SICE' || *edi=='SIWV'), g) q# F0 K8 d7 q" H
2 K1 w5 o* n* ~
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
! J$ c: E. n) l. I/ `: W( ?; O6 M ;will break 3 times :-(; q4 D: f& C% p
0 _( D4 M; J% K% A
-Much faster:
! S( q& ^3 f; M: B0 I* h8 _- } BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
4 V7 ^2 p- z) C% c7 U$ \, H9 C6 d, X8 _1 r
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 `# }0 @: N/ t* E) h! f r
function to do the same job:
5 p9 U1 V9 w2 A( {4 Q; B6 r2 k3 R/ m1 {* t( H
push 00 ; OF_READ
- B* U. w. v* m1 e" C Q7 T mov eax,[00656634] ; '\\.\SICE',0* Q+ n- ^: v1 _/ y5 k/ B7 ?
push eax
8 Y0 Y* v, H U- }: ? call KERNEL32!_lopen
# |3 D4 {2 {* M inc eax6 y; E; I! H& a
jnz 00650589 ; detected! [1 l* P. C H7 z# }" S* i; v0 e1 i* ~
push 00 ; OF_READ
^0 W' x5 a' J' C mov eax,[00656638] ; '\\.\SICE'
5 e9 ?* h5 X( F1 u- e8 @5 A8 Z push eax
4 P. T* F+ m2 ]8 A& W. f9 V9 N call KERNEL32!_lopen6 ^4 {3 b* P) j8 n' b- U3 x+ q
inc eax4 e7 d3 e' Y8 T
jz 006505ae ; not detected; K! |* O: \; d
" F& G7 k5 m( ]
, Q8 o7 T9 p5 m* |, K2 ^
__________________________________________________________________________( u% g8 X$ Z4 J* D$ M* @% u
: r9 }8 r4 n c
Method 12
; j+ E; x0 u' S( o=========
% c5 j% W3 J0 N% O
- n3 v* L2 x AThis trick is similar to int41h/4fh Debugger installation check (code 059 d9 M% e$ |& z+ s7 x
& 06) but very limited because it's only available for Win95/98 (not NT)% m, Z% w1 w+ @3 v% t' {
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.) `7 l" c. t& e
) b* r# X( G1 Y. X) O
push 0000004fh ; function 4fh' I) `$ K/ n9 `/ e, h" v
push 002a002ah ; high word specifies which VxD (VWIN32)) W. |7 |! V% u/ c
; low word specifies which service5 P$ ^0 w4 e f: Y
(VWIN32_Int41Dispatch)7 X3 F' w2 J9 R/ }
call Kernel32!ORD_001 ; VxdCall
5 q [& x" L' b cmp ax, 0f386h ; magic number returned by system debuggers) h- F2 c. ~) O3 q% t
jz SoftICE_detected
* C4 F+ v- p4 \: L7 _6 n
; R" X4 `5 }# _* GHere again, several ways to detect it:
. V2 [& D" K n" [: |
3 M# ~1 E9 l6 q4 B9 E- @ BPINT 41 if ax==4f. K: U. q |8 B9 `: y, u
' d/ y3 N9 {/ A& t
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
. \* h! M& Q* o1 V2 |. V+ G$ `/ g1 l
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A; U6 k* j- N5 I: a7 o' B
: h% `- K4 `' B BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!( S, ~# C& Q( p5 x! s
r: y d. z$ \8 ]__________________________________________________________________________; {3 q% _7 U' L
! M7 q4 l- O, Q" CMethod 13, O/ c7 e( Q, S+ U
=========0 Q* _& \% V" _, V! j/ P
; a. [3 t5 U1 Z
Not a real method of detection, but a good way to know if SoftICE is; U. u! |, O: O! M7 d! [
installed on a computer and to locate its installation directory.
5 L. ^$ d ~7 G' |2 j6 p3 NIt is used by few softs which access the following registry keys (usually #2) :
4 i. w+ A4 m- Y& G7 O" |3 |1 E3 r' `$ H* ?; a% Z( j9 @( d
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) B1 G9 v. _5 {$ e" }3 k/ B" b\Uninstall\SoftICE& A, a3 p5 Y: M! y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! Z3 D: T& n1 G8 h* `' w. O-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( \8 |7 ?2 B* S% c4 B- Z\App Paths\Loader32.Exe, }7 M% o! G$ f
* ?$ D% A, r$ ]: q: g# t% B* {* d4 z, W+ u& A1 i2 X
Note that some nasty apps could then erase all files from SoftICE directory
. A; {3 ?9 O5 @(I faced that once :-(
+ r3 h4 B& J% s4 Q) u3 k) q, m; x& M/ g$ ^
Useful breakpoint to detect it:" A/ h( k [) y, ]! c
; D2 D! B; |! L* B
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'. E v. k0 }! f% j Z5 z; B
: z" E/ `5 F) C4 U' P2 V; m__________________________________________________________________________
; y5 a8 L' D1 l6 A. g: F5 U1 U% c. T
7 P% q9 Z3 K$ S( l$ G r1 h
1 P4 x3 r3 f/ k0 `2 vMethod 14
" N% J% A/ }# F/ _=========
9 v3 _8 I9 ~! U) W/ }4 d# U& Q g2 l
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 k1 p5 u0 x9 A
is to determines whether a debugger is running on your system (ring0 only).% w; T% B3 E; M$ l" X
9 A& Q; S2 y$ @1 Z
VMMCall Test_Debug_Installed e1 r2 @* ]" t# E6 i) Z ~% d- n: p
je not_installed
% `0 Z2 V7 @7 h1 O, q0 z- e6 z* ~' w1 |! o
This service just checks a flag.
+ o3 G# X) J* Y" {& V</PRE></TD></TR></TBODY></TABLE> |