<TABLE width=500>
, J* t) U+ O5 I# X<TBODY>( y" D. i% l: R& o
<TR>; [' x2 d `! }5 X/ v# |. h) E2 N
<TD><PRE>Method 01
% N5 } }- E1 i7 Q# g7 I( H" W=========
/ J$ o( u0 w2 z! O
5 `) J( V7 V) X6 BThis method of detection of SoftICE (as well as the following one) is: S, s8 M6 h& w8 w Y$ w" v
used by the majority of packers/encryptors found on Internet.7 f! W; J4 o4 Y. t. S# G" q9 k
It seeks the signature of BoundsChecker in SoftICE
1 R' W8 w3 T+ a5 U& {- g. L# O1 Q4 Q+ }2 @" k
mov ebp, 04243484Bh ; 'BCHK'
( G A$ K( r" P- A0 @& r: ?% W mov ax, 04h
& M8 A x8 z0 y' s2 U; S& R; T int 3 3 J! H- c- Z) p
cmp al,4
9 y6 f! K+ [) p$ q9 w jnz SoftICE_Detected
; L2 Z# B# v7 W7 s. ^( q' R! w* I) t, n( ?1 b6 q
___________________________________________________________________________
- X- l( y/ |. K: o6 |. N
( Z" g# t- _3 dMethod 02
: W' i8 j( t! {% b9 _0 F5 M- h2 H=========7 [ l* z9 O/ z$ ?" a/ i
/ w2 {- W1 M8 p# s. |, G; p0 `8 j/ NStill a method very much used (perhaps the most frequent one). It is used1 }2 O5 |! ?9 ~. l! ?: d' @/ e0 _
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ G0 K N9 N( u2 }2 Uor execute SoftICE commands...* D3 ?# o1 S. U% y. c) N
It is also used to crash SoftICE and to force it to execute any commands
" z& W+ C2 a6 r2 I. g* } }(HBOOT...) :-((
0 A% p! u/ H, [* ^& X* g3 M9 C$ e- R3 @' G
Here is a quick description:
# }! v+ [* C: u$ f, R-AX = 0910h (Display string in SIce windows)' H7 S& ?; ]9 F2 h# s: {9 V J- \' C5 i
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 Q2 l% d2 |& P+ w0 V9 A
-AX = 0912h (Get breakpoint infos)& t; r& ]$ H8 \, \
-AX = 0913h (Set Sice breakpoints)
5 S; R$ _( b) e _, e/ V1 L$ I# l2 M-AX = 0914h (Remove SIce breakoints)
# T' F0 ]- t1 V
4 y9 {4 `1 l, ^" n# cEach time you'll meet this trick, you'll see:8 b, a3 X& W% k H9 l" I- A& U" c
-SI = 4647h& Y2 q3 [, o' C( d
-DI = 4A4Dh
3 q! N4 Q- I# z Y9 @8 b! N/ WWhich are the 'magic values' used by SoftIce.
' Q; C0 D& S( n1 e/ Y. v" N+ ]For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
) |2 T. U1 `" M. \( Y% x
& R' h: ^- U3 v& ~* s6 f' OHere is one example from the file "Haspinst.exe" which is the dongle HASP
3 q" S, X7 _+ m! |6 V" a' qEnvelope utility use to protect DOS applications:) o' `" j' s V) {) G7 `4 G R
) D# g4 n5 a- k. B" O5 f- V+ s- R; i& I
* l' W. J1 d5 b& C3 c3 B J4C19:0095 MOV AX,0911 ; execute command.
! y! `% `& o i4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).0 T# v( s* Z/ L0 j! p
4C19:009A MOV SI,4647 ; 1st magic value.1 Q$ C8 V2 A7 w5 u
4C19:009D MOV DI,4A4D ; 2nd magic value.1 C8 i1 S s; K& A
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
* [, _( p% f0 O: u {% u" \- M4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
* U& T/ o) w& }+ S$ y$ a4C19:00A4 INC CX! u7 ]+ B; X- w5 E( Z, U. S' A- }
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 w+ w! Z( d6 k; ^2 M: O3 ^2 Q4C19:00A8 JB 0095 ; 6 different commands.; w; h. }' i z" F! X
4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 i! }0 y: p, m
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
2 h/ J+ o2 s# h% G: N3 S" V2 z! o5 q% z. t0 I
The program will execute 6 different SIce commands located at ds:dx, which
, S* m- h& A) gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 a* D! Z& p3 R" b) V+ S* r, [4 u
& U4 E4 B- z. E' Z: Z* u5 j% r5 X* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# R% {! s2 m$ a; V8 X1 B7 G___________________________________________________________________________/ R# ~1 Y. W+ y! N1 X1 |. E, w
' F" ^8 c$ X& a0 L# b3 V
8 c( a1 a$ d, P; F2 h* t% Z: k
Method 03' g. J |9 f3 ^2 N5 _3 d
=========
2 m ` Q% u) o' `3 q, {/ p |7 A
& D% k. Z/ K; yLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# D9 h; y: q0 i& C4 K% C+ }(API Get entry point)% }' Y0 H3 v2 P7 [. O
0 Y! r9 B9 ^& w" e6 x
5 l# r, ]5 y# y xor di,di
' `1 F+ }/ b' l5 h0 W mov es,di
$ V# C2 k& N/ E, U9 y0 Y- {" |& h mov ax, 1684h & R9 i J5 ]! i# |2 V. k
mov bx, 0202h ; VxD ID of winice
2 i" D6 |) D- q6 _, A int 2Fh
5 _! G$ h# |* ], V* G8 ~! Q6 e mov ax, es ; ES:DI -> VxD API entry point
: I0 W9 A* c" H) J+ R% } add ax, di! `- M; P! x& n$ R9 c. m
test ax,ax
+ a( {' w; y) c& K jnz SoftICE_Detected
- y7 a0 X. D: d
% C' E {" X7 k9 J! e: ~+ {/ X___________________________________________________________________________/ d4 t; b, o$ T9 M. G( z
+ `/ |+ H; ?4 _5 yMethod 04
5 F! s5 ]% I% U6 U5 c=========
* ]" s; g; a3 _" F2 M6 l' ?/ n) U% o7 ]
4 y' q, m6 {8 z0 ]Method identical to the preceding one except that it seeks the ID of SoftICE# k) W* U4 F1 S" g, a
GFX VxD.' {+ P* c4 e f! d1 U; @& @
: T A( a' [2 ]* M1 K xor di,di( Q7 R) ?5 t6 o) ]% _
mov es,di
5 f1 m* A$ \. R+ Z: X$ r) ^6 D mov ax, 1684h
2 w5 {1 H& ~% v9 f* ]) ] mov bx, 7a5Fh ; VxD ID of SIWVID
/ |+ I" K' {3 M3 u3 c5 ^ int 2fh/ O0 i2 I) O* L% }( [. ~- A
mov ax, es ; ES:DI -> VxD API entry point
/ E+ K4 |" [4 Q" h add ax, di2 t& }. T( ^1 ]# G
test ax,ax% A- C9 }2 q4 c; T$ p) g. ^ _
jnz SoftICE_Detected/ G% h, y" ]; m1 |
9 B* I$ l/ r) X8 Q/ A8 ]
__________________________________________________________________________
4 b6 ]0 i# @2 z! E- f, d) S
, G0 \, R' d8 h/ c; q3 k$ C, o+ g% H" V. c1 T1 V: ^$ L
Method 051 b) G4 A# a) L; C; W# ]
=========
% p3 G7 y# w) _5 k+ o8 I
0 r/ U' T8 G. m7 b3 mMethod seeking the 'magic number' 0F386h returned (in ax) by all system
7 L7 ]' ]' Q2 {8 Vdebugger. It calls the int 41h, function 4Fh.
+ K" x: Z) F% XThere are several alternatives. 4 x) o7 [. l7 G8 J% |4 F. I
: B, o# U* j0 I; O1 @& M @% BThe following one is the simplest:
% j$ {! x. s2 b, x- k2 D5 ~' M4 J# B" i% r& Q( O
mov ax,4fh" M5 k. M, K. O+ v
int 41h
3 T9 o& K9 C% d+ W( s cmp ax, 0F386- K# f: @9 R! ]+ J' F/ w' m
jz SoftICE_detected
' H, E0 ]% H, I$ v
4 C) x8 W8 U) K1 P% s, L& l9 U- P) [+ d+ M/ f- x; n; p2 e
Next method as well as the following one are 2 examples from Stone's % q4 G7 V% l& m6 o; W
"stn-wid.zip" (www.cracking.net):8 ^/ R8 @/ I* Q( ^+ g% A' q
1 _' @& A& y: {
mov bx, cs6 Y2 I8 T X' l/ L9 V9 y- T
lea dx, int41handler2
7 Y3 R6 I! [ z& A! g/ @. z; c1 ~# Q xchg dx, es:[41h*4]
/ x& _* o+ `' L) H0 f& V xchg bx, es:[41h*4+2]- r! U1 b9 e, \( Z" V
mov ax,4fh' \5 r a" ?" ]& |
int 41h6 ]0 y# R5 L; d) v% D
xchg dx, es:[41h*4], t$ z' _6 a, v% ]- l, ]7 Q* ^5 ?7 @; \
xchg bx, es:[41h*4+2]
9 X# O% Z' Z9 p! c cmp ax, 0f386h* n6 M/ }2 c/ Y2 }' i: `
jz SoftICE_detected6 Z6 N M. _" L# f4 Z
& Q* g4 c/ k5 g/ B6 y0 @/ Nint41handler2 PROC
9 t* {/ r# P0 K; U iret
7 F* a; l$ M! F) v& Qint41handler2 ENDP
+ J! ]7 p- S9 C
' B1 X8 T8 ^9 R# Q1 d7 F
/ e+ X- W0 l. l. t5 ^. b( F_________________________________________________________________________
/ W% ^" b+ x' @: r+ o
3 }; k$ J% S0 G: z6 k, U: w L2 S" K+ q( |
Method 061 o8 d1 c% s7 V8 f2 n: J
=========
2 @$ |( L$ n' G% K# ?0 u
1 \) Q0 Z, f* E% c+ o
- N$ z" S k, r4 w+ [2nd method similar to the preceding one but more difficult to detect:
4 T+ \3 w. `" F0 W
0 J4 m" s3 W/ O8 g4 u! K8 E) I* B d
1 _ c d/ w [9 {1 M: B; ^int41handler PROC: g1 \: _5 f4 Z* b+ K, Y
mov cl,al
. Y5 \0 X4 N8 `8 E: j2 Z iret
0 b% }, k( E/ b2 h" a2 }/ Fint41handler ENDP( Y6 |2 s$ H5 s3 m( E
7 p. w* H: m4 n2 s5 C n
+ p/ O: i) Z z+ ~8 J4 F# A# [ xor ax,ax: Y `- J# c* T3 N/ r" w2 C: e& }
mov es,ax
$ l' z3 |5 g+ S3 S7 d mov bx, cs
9 r/ A# W0 u1 f; J8 Z1 k lea dx, int41handler! z/ J3 `. y9 }; H( ^( G: {* h
xchg dx, es:[41h*4]& O% t: |6 f0 s" t& `; A
xchg bx, es:[41h*4+2]7 [+ Q) }) A' u: H
in al, 40h
% m: X4 h) f5 d0 I% F8 d xor cx,cx
; I0 W- G% a; l% r& K+ ?5 r5 i) ?/ D int 41h
' S5 K) b! u) W5 J xchg dx, es:[41h*4]% l, ?0 R$ Y( U: @, I
xchg bx, es:[41h*4+2]9 r! Q$ N1 p9 M/ i
cmp cl,al
( M5 S! ^/ n0 r S jnz SoftICE_detected
9 _) m- Y9 u0 l
/ v. p5 M. Y* j5 t+ v: O4 V0 ^_________________________________________________________________________% s( H: d: L j5 O' B. W
$ D4 b2 C& c' J% [Method 07
: Q9 @# M2 x: P9 a! p' R8 {: M=========+ a8 _8 w0 y" `" E) s
# r4 G% M6 F9 X+ B i4 w, o
Method of detection of the WinICE handler in the int68h (V86)
4 ]) y& Q4 c8 w0 x5 L: _* p7 Z2 ~9 K6 u
mov ah,43h
. h3 {! q' s( i int 68h& n) e$ ]* d" n- t* Y! N: [7 m5 f
cmp ax,0F386h
; `$ }2 C. D( S8 m2 A, \/ `) s jz SoftICE_Detected0 K0 f2 g" W: V
1 w6 o" T+ T) q4 y( k7 H
$ X) x0 W7 }# m( Q! V=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! O# J7 c! X3 o2 j& ^4 r6 Q
app like this:! ]! g: s2 x9 W5 j
* `6 Q+ h+ Q7 ^( ~ BPX exec_int if ax==68
. h9 X9 `* g5 s: c" D (function called is located at byte ptr [ebp+1Dh] and client eip is, t0 q* ~0 |# k$ L$ J) Y4 c; W
located at [ebp+48h] for 32Bit apps)- r6 _- h3 P# \' ?
__________________________________________________________________________
; u3 j% k9 T- Q" c5 U
[+ Z) X/ p: o4 F$ V: h- s9 V, n, ^6 L2 M: I- f% z& R
Method 08& g( i$ I2 C2 X. h
=========
" b7 _8 z+ `) P" y ]1 x9 x" }! S, [3 X5 V ?
It is not a method of detection of SoftICE but a possibility to crash the
! ~! R* [7 [6 J4 N7 _# qsystem by intercepting int 01h and int 03h and redirecting them to another3 C# Z7 C l5 a0 I, v
routine." |6 e4 m- J8 u0 m
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 c3 x0 v. V5 y( ?
to the new routine to execute (hangs computer...)# S% y7 o, D- \/ U3 _) f
+ @1 o. l0 M4 U7 S/ b8 @4 G( n mov ah, 25h3 n4 c& Q+ ~0 \ w9 P$ e, S
mov al, Int_Number (01h or 03h): Y8 U+ r' _& y: I
mov dx, offset New_Int_Routine" C2 E9 p+ u' g# e: _3 }! O2 u
int 21h* }( w' C. H2 W i
, y |6 Q+ i s9 s__________________________________________________________________________5 P8 j: q$ L, d) s7 N$ u: ~; i. ~
7 w# k- Z0 d1 a5 L( C5 O4 |" m
Method 09. G1 w$ }1 p( T# e4 k, ?
=========* }: x1 }. c3 m
. K7 Q0 U( l2 V) r4 S7 B! s5 bThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ `6 x+ E* }3 x$ K$ A) f
performed in ring0 (VxD or a ring3 app using the VxdCall).
6 l1 y7 @ G. TThe Get_DDB service is used to determine whether or not a VxD is installed
& X9 A+ Z" S' V8 efor the specified device and returns a Device Description Block (in ecx) for$ h! v5 Y$ \6 \$ q- K# l* c
that device if it is installed.
2 A7 J; Q' e( Y5 `% q7 G1 o' u# h" e4 P$ f2 N
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 K* _6 Y# e5 [, F
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 ]! J/ P0 B; Z' A4 e" W, X
VMMCall Get_DDB) ]4 G& _* [4 M1 K8 x$ v
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
e2 W/ I! ] Z7 R7 X$ t3 W1 L8 R( ]
% m+ ~5 ^ C* e9 t3 aNote as well that you can easily detect this method with SoftICE:" B9 b" }- k$ p/ ^8 K8 S
bpx Get_DDB if ax==0202 || ax==7a5fh3 `3 B' n2 r& }8 T
3 w# @0 u* {5 V__________________________________________________________________________$ }9 r' |& o% x' `
# h& S% d8 z- E; m+ y T( x+ FMethod 10
5 T W9 L: `, `+ @7 A=========9 {, X9 z" a7 P0 {, f
6 M2 V* n/ `- ^
=>Disable or clear breakpoints before using this feature. DO NOT trace with
6 k% q& N" u- w9 H* j SoftICE while the option is enable!!
# N# m; @2 Y) }% q' P' A" e, Z: h/ o7 N) |
This trick is very efficient:
, I" z: f( F+ J2 O4 a- v: pby checking the Debug Registers, you can detect if SoftICE is loaded
3 D) h* O/ f& V(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- \2 I5 y7 c2 I; u1 _
there are some memory breakpoints set (dr0 to dr3) simply by reading their
r9 o3 E }1 Y! Y0 ?value (in ring0 only). Values can be manipulated and or changed as well' g8 h8 s& H0 G6 N6 u2 f
(clearing BPMs for instance)
" G' |' l T& S5 T. t
! ?$ `6 W+ e* N* h9 J. M+ q__________________________________________________________________________
0 ^! _% v& M5 ~0 |$ M9 A, y3 O' C' K# l6 N
Method 11/ h) m9 P8 j# ?9 H7 p4 Q2 {
=========
& c3 o4 Y% @* `
- J. H1 P7 Q, P v! Y5 p) n. q" jThis method is most known as 'MeltICE' because it has been freely distributed+ N" [9 D; a; q4 b
via www.winfiles.com. However it was first used by NuMega people to allow
7 C3 F8 ^/ n* G7 F3 I+ p" t" ESymbol Loader to check if SoftICE was active or not (the code is located# |. V' J1 Q/ q ]9 O1 {. _
inside nmtrans.dll)., `7 P1 y; @4 K$ x
/ e* \8 I. ~4 TThe way it works is very simple:& T1 _2 g* P- v+ j# J* y! O% R
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for5 a2 o7 d7 b5 B) ~) m) u4 G
WinNT) with the CreateFileA API.
B) {1 F) F7 T) C# U0 M1 \: l4 B! G4 g- y+ j2 }3 M% p0 B2 E
Here is a sample (checking for 'SICE'):
7 d% q# [2 {7 {4 Z) \9 V; @' o+ J7 i h. b; V9 ]* a
BOOL IsSoftIce95Loaded()
2 U1 [% F) T ~+ d6 Q{
2 ^* z. N: u N8 k D+ y" m HANDLE hFile;
5 M1 N D8 Y I: Y hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,& y0 k- ]- o% q
FILE_SHARE_READ | FILE_SHARE_WRITE,
9 L% Z6 O8 s( m: i! z$ ] r, b NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 Q4 f8 d2 }2 W4 L% p0 B$ Z
if( hFile != INVALID_HANDLE_VALUE )6 r _; d* e+ u/ B6 E
{
) G7 f& Q; S: Q e& j2 \ CloseHandle(hFile);
9 c, w0 ?1 h5 v+ i6 K return TRUE;
4 x9 g# V6 k: q! M* w }
0 X( w2 \! n$ v) x! l+ ] return FALSE;
- _& k5 _1 T6 ?5 } ]}
/ [" S, p" C; T9 c/ a: z, n) i' _, R' j `8 }9 d$ y/ H' j
Although this trick calls the CreateFileA function, don't even expect to be6 l( |3 p' W# E! e6 H( m
able to intercept it by installing a IFS hook: it will not work, no way!, V6 x [8 I1 x) l" W8 S4 l
In fact, after the call to CreateFileA it will get through VWIN32 0x001F& N/ E( X$ B8 D3 r8 i1 h
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 G' V4 E2 k [- I( j
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
. T$ i+ m$ Z" |8 W+ Yfield.$ i& @/ o# f/ Q" {7 d* W
In fact, its purpose is not to load/unload VxDs but only to send a ( k" l* b7 M+ v
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 j6 {5 |; A }* o" h1 L5 E
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
- C: I* t' w1 r. ]9 I( B( k: U* Lto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& ], L Y5 O) _If the VxD is loaded, it will always clear eax and the Carry flag to allow9 N5 q8 i( |1 B2 L
its handle to be opened and then, will be detected.
. v5 Q9 s1 T p' B! S& WYou can check that simply by hooking Winice.exe control proc entry point, \9 O5 h2 P$ D1 }# }5 ^& K
while running MeltICE./ I$ c+ g. c/ {/ {# G y
" ~9 r4 h6 N* R t$ u% Q% [+ t5 @" T
00401067: push 00402025 ; \\.\SICE$ c5 C: ^9 m2 D1 m
0040106C: call CreateFileA& z5 B' W0 Q% Q2 r( O
00401071: cmp eax,-0011 a; L- t5 k/ N. u/ m
00401074: je 00401091$ M: s+ M/ j# N
) p V1 Y; v7 q! l0 Q6 h$ S% z7 P, u; J* E9 p& ^1 F, }
There could be hundreds of BPX you could use to detect this trick.
" _/ E& ], M' d4 ~4 }9 J-The most classical one is:
( d+ F% N/ w# F2 c BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||# o5 q* J/ d0 u) J2 N ]
*(esp->4+4)=='NTIC'- x3 l A! N) Y8 Q
2 g& v7 s' C _& ~0 e4 g7 r/ S: X- M, B
-The most exotic ones (could be very slooooow :-(' \6 _! ?! d: U1 z7 D
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
& u0 F8 R9 F* W9 N9 z ;will break 3 times :-(0 S9 R% @' s$ P) K! \- a+ p; x
4 F9 n1 W3 v/ A+ j2 e1 f-or (a bit) faster: . I+ q$ i7 p) u3 `, a
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 |" a8 u" [* e. i U/ ~2 @8 ]0 ?, ~0 Q1 `; ^
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
! |* n. P' [3 o- j+ a/ {' l* j! Q ;will break 3 times :-(' d& @, Q3 o9 a; {2 E# a/ Q& m9 p
+ h8 @0 ?5 ?0 \/ \3 B( o, p-Much faster:7 L s; l3 E. e% }3 E
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 D2 b6 {0 Z1 T; M1 U) A2 f) Y! w$ {+ j4 Q* _# @% `0 K
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 I6 y8 ]9 t; J1 |- j9 e4 k
function to do the same job:( D# n) d$ m% E8 a) A
2 P H* d* `; a4 W) N
push 00 ; OF_READ
0 x R4 v9 A3 p7 `; b5 D mov eax,[00656634] ; '\\.\SICE',0. _& d! M( p9 i" e0 `: B% O
push eax7 c' M j5 w# l' R: {" s
call KERNEL32!_lopen
2 @$ Y( R# t0 C inc eax
, Q- T K8 l5 F8 M+ g' ] jnz 00650589 ; detected
3 x# K" u2 O6 c9 e; I0 J N! {$ @ push 00 ; OF_READ) b- C& l% u6 K! b- l5 o
mov eax,[00656638] ; '\\.\SICE'! K' Y% N1 N/ h4 E
push eax8 b1 \7 d E J+ j1 U3 V
call KERNEL32!_lopen
0 e; a2 D6 v* R. a% N f( l inc eax
6 y5 G# b+ c+ e" Q5 \3 k2 T- D jz 006505ae ; not detected
( W7 Y! T* U! p4 B' t8 G% I; F: H! Y$ `7 L+ |8 a* {
. A h( t# r/ e& b__________________________________________________________________________
) K" t) o6 y- p" ~- @; E1 O+ @3 D3 `, n# y, {5 l6 b+ Z
Method 12
. P% s: h! ]/ D: V; A=========
3 D( f' n9 q R; a9 S! t& d" J+ b6 v& V: X5 ]2 H. g
This trick is similar to int41h/4fh Debugger installation check (code 055 t, x% t3 M2 u+ i+ ?
& 06) but very limited because it's only available for Win95/98 (not NT)
" I3 Q- Q* Y& y1 m6 mas it uses the VxDCall backdoor. This detection was found in Bleem Demo.. C/ s( O/ v8 ^& u% s
- G1 P: U# n% z% y! m, h: Y3 P push 0000004fh ; function 4fh0 A7 j; F; \& w) g- j
push 002a002ah ; high word specifies which VxD (VWIN32)
" a; {( R3 n. ~ ; low word specifies which service
T: |9 F; {- L. P (VWIN32_Int41Dispatch)0 q5 A4 w, Q8 G" ?4 u8 J Q
call Kernel32!ORD_001 ; VxdCall2 ?6 B" R+ ^4 P* X0 X1 v! A( c
cmp ax, 0f386h ; magic number returned by system debuggers
! ^4 v. F& C# n: ^1 _( | jz SoftICE_detected
8 f2 _! F$ n, P5 h( A: {+ W* e! ?2 d" V5 ^$ a" e
Here again, several ways to detect it:
% E+ q6 z% }! O) a s0 U" ~- @9 F& Q8 J7 o# t, A9 m, {+ a! r
BPINT 41 if ax==4f
) ]$ ~, T3 e6 P3 R. F) s" y$ [
! Y$ c; v: ?+ d+ Q BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one3 R5 _" n' Q3 c" D9 k
. g* Y4 c9 X- S) {9 {! C BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: s% Y: F/ v2 ?, x. D) h! \
/ G3 m0 m, A4 w) { BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!( c6 t% E/ i5 M3 k' d
* B2 e2 R$ S* {8 y__________________________________________________________________________0 m3 r Q& s' U( V" j1 ]: c
/ h" L% e& `, i7 ?Method 13/ L, H0 G% U; T& O7 H* S, E0 m
=========
0 n! ? e( ^& u* F/ _, z' E; o5 n/ R. c, s0 y+ T
Not a real method of detection, but a good way to know if SoftICE is
: _! ]7 V. U( P/ n4 u. j5 }7 Linstalled on a computer and to locate its installation directory.9 \) j! C0 d% z/ l2 l$ R1 `& u+ {
It is used by few softs which access the following registry keys (usually #2) :, A1 e" C( _5 C3 B
- k7 ~8 K- e+ D- H9 Q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& g! z. b( q9 H# g u- t/ o7 ?4 E
\Uninstall\SoftICE
* o l) l+ C. I% k- ?- q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
, `* n: b d7 r) _$ [( u* O-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, @' P' Q( T- s, |. w\App Paths\Loader32.Exe; j. H$ e6 q3 s: [5 a; E! c
8 @0 c0 V6 q S1 V$ i a8 ]
5 R+ E# c' e8 r+ q; JNote that some nasty apps could then erase all files from SoftICE directory
+ m6 t3 t* _! d; \' `2 T7 ?(I faced that once :-(* I7 ?4 V- p- H& V6 ?7 r4 }( e
) m2 I5 d4 {; ]* m# ^) A! v9 Z
Useful breakpoint to detect it:0 Q7 x( _3 \" V1 N: E" s$ q
( v7 j2 i% q1 ]
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; |; o- f7 e( j' y) N( Y; y
* b" [% N3 ^2 _! |% G__________________________________________________________________________
8 O% p3 K7 i% F( D! U3 ^1 I' d
. _8 c9 n7 a; [1 L4 T: ^# U: `Method 14
! b* D8 \) g$ B- m/ A=========1 q, l: w; G$ X( Y6 i* G/ I8 ]$ }8 j' T
a3 f7 d$ k7 J5 z# q; i& X6 ~A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 R1 I5 ~# R! { {% o+ d# l" r+ r/ U) ris to determines whether a debugger is running on your system (ring0 only).8 W4 h5 h: c" P9 j4 U) ]
; ~! D+ F8 N( L* F7 K) S, m J. S VMMCall Test_Debug_Installed
% {4 @# W; S. s6 P! ~6 C3 |! r je not_installed: V5 T0 j6 e# T9 m
- a' U( R; w1 @; W
This service just checks a flag.% ^! C: e$ U# I
</PRE></TD></TR></TBODY></TABLE> |