<TABLE width=500>
* i% H; v& V( A+ G( z3 F<TBODY>( t4 a0 w0 |1 o0 I+ v
<TR>
7 o, }! `% c* \2 f, |( X' _<TD><PRE>Method 01
3 `. n" H8 E8 v+ _' }' {" s=========. s/ ~! X" m! G
- `/ w7 E0 o- L& W$ }/ rThis method of detection of SoftICE (as well as the following one) is5 J' N- a. ?3 U+ c' O
used by the majority of packers/encryptors found on Internet.8 A8 ]: N1 }7 U$ m% n$ S+ d r$ P
It seeks the signature of BoundsChecker in SoftICE
% Q, `* i! i5 Y: ^9 M& I; B/ Y& G! s, W# n. _$ [
mov ebp, 04243484Bh ; 'BCHK'
% A8 j L( E# W! N mov ax, 04h( c- G' `" d2 I0 P4 M
int 3
* m- |+ F1 |+ ^+ ~5 U cmp al,4
7 V7 K/ D! E# L( w jnz SoftICE_Detected( |1 J' Z. B/ [( _9 C H1 v
/ O! x7 _+ v* K! s
___________________________________________________________________________4 b9 r4 J" J8 z' u% G: k
- w* j$ `+ `9 z/ o0 i
Method 024 g* g2 U6 V/ C, Z! Q4 ?' ~: ~
=========. t# t0 J8 g1 r* g$ E
% V& }& ~$ ~# q0 N+ K9 s# HStill a method very much used (perhaps the most frequent one). It is used# N/ S- e8 i9 D: ^
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: g s* \" d+ c+ v+ sor execute SoftICE commands...) j% S, W+ T8 ]7 }& l9 q
It is also used to crash SoftICE and to force it to execute any commands. f8 b! ]# ~: W; G: P: \: o% j, }! M, C9 T
(HBOOT...) :-((
' C9 Q% r0 i; w$ R) x9 _0 E9 Z. z
0 ~ z/ j9 [# a8 w6 F1 iHere is a quick description:
, _9 d5 x4 R/ k' m& A7 k0 M' E" B-AX = 0910h (Display string in SIce windows)
. ]" t4 ~$ D% ^! i5 [( N-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, P2 S, f- P+ F9 w/ \5 a-AX = 0912h (Get breakpoint infos)1 f, r+ D" ?/ g7 ~
-AX = 0913h (Set Sice breakpoints)- I) s5 b' [, A- l. d+ [3 R
-AX = 0914h (Remove SIce breakoints)
$ l4 u4 }. g7 k/ Y1 y) Q& q' E+ a' h* z8 E9 z0 l! q4 l1 \
Each time you'll meet this trick, you'll see:! a# S8 t# h* Z& `
-SI = 4647h
( V7 C# D7 M- u; v9 ^1 o1 j: _+ H-DI = 4A4Dh
+ _* s3 w# j2 wWhich are the 'magic values' used by SoftIce.
8 @8 L9 p, q) J! Z3 Z8 U- AFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# \# [! c$ Y, q
9 M1 r2 B1 B2 W L/ NHere is one example from the file "Haspinst.exe" which is the dongle HASP
& ^ `( h9 K1 o) f( REnvelope utility use to protect DOS applications:
1 Q0 y4 `+ ]" [" d4 \4 I' F0 @$ Y) j) Z0 Y$ K" }% k/ L. X2 F
& D: K# Y; }. {2 u* O* E& H
4C19:0095 MOV AX,0911 ; execute command.& F" H: {; S1 N+ C
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
6 J, o4 r9 v. U& r, y4C19:009A MOV SI,4647 ; 1st magic value.: D) x8 T" O8 i5 l! F. w
4C19:009D MOV DI,4A4D ; 2nd magic value.
: H& n8 I+ B5 x7 Z0 ]7 [/ S4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# I5 g& }& O0 p3 L3 M4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ F6 x, Z: f5 U7 E7 Q4 k T- A4C19:00A4 INC CX
5 n( `( Y8 L v3 w3 e4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
2 p3 z9 P, Y; E$ w7 W4C19:00A8 JB 0095 ; 6 different commands.; f. h7 L1 M0 t! b
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
# [- ?* a: O+ U! \! n4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. T* ?7 a/ b% \& h! o/ ]/ e% P6 _7 v* o5 h* x
The program will execute 6 different SIce commands located at ds:dx, which
& n @4 m' F3 y+ H/ X4 [are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; R6 {( a+ s0 a% B% ^2 j5 y* o
9 o, ~. H: U5 z5 m* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; S: ]9 h8 L8 h. ~8 r
___________________________________________________________________________$ T6 f. }2 D0 T3 _- C g
$ k5 d' I7 \3 t/ G; @6 z
" g) p$ C4 ]4 d" g
Method 03
/ p7 t* ^- W% u( y& m* R B=========- e" N$ m$ ^" P
, t% H+ w- }3 \0 K& {3 M; s- }Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 I6 B8 n! l/ W$ K2 R
(API Get entry point)) R/ {& b, e2 t
4 R6 v) ^ V/ f. u$ b# o' t
4 ]3 n$ o: f; C. Q* c. r. x3 e
xor di,di) u% u. D: {, y: o8 E1 |
mov es,di; I: G+ ] f# t8 t. p& X' m
mov ax, 1684h
0 o: L7 e/ Z2 [7 T mov bx, 0202h ; VxD ID of winice* J: k* `3 H+ ~8 m+ @, a
int 2Fh
9 \/ n* ?4 L; ?' C" @ mov ax, es ; ES:DI -> VxD API entry point" a5 ?/ j1 U% Z$ p, G2 B% I: y l
add ax, di5 j; K6 a8 V" z. |6 `- f8 I3 S
test ax,ax, R4 E( F: @- \$ c1 ], I
jnz SoftICE_Detected
2 [/ {: b: m4 X$ r2 A& Q( k4 A2 `' |
___________________________________________________________________________( c, ] R5 h4 |
# N# v6 r4 ^& JMethod 04; J: m l+ z0 T% |3 W, f5 _- e
=========; Y$ t: l u t# ]: r
' H" F, x+ ~1 XMethod identical to the preceding one except that it seeks the ID of SoftICE
( `6 e# R1 E% ~: q! FGFX VxD.
5 d* o" I/ e: J. U; ~$ d: [9 m' S3 C4 n' ?/ @
xor di,di9 L: X, g& \# k" R, P
mov es,di
* C/ T2 L2 C2 O, h2 K. q$ t/ G mov ax, 1684h
. R3 }' \' L. E1 S' M, Q1 p& J mov bx, 7a5Fh ; VxD ID of SIWVID$ v4 ~' s. B/ _7 o4 w: @/ n
int 2fh9 ~* w" r* o8 ]
mov ax, es ; ES:DI -> VxD API entry point% F2 C4 a0 d# t9 u" T
add ax, di
1 f3 I$ X* J' U( k- o3 ^: E test ax,ax g: X& w4 m1 ?7 w& F* O
jnz SoftICE_Detected4 h- a& Q7 s$ T8 _( ]: O1 c F
. n; T: P( q& r4 K2 w__________________________________________________________________________
0 N1 o) U$ N! a0 b6 y7 `& ]4 L7 `7 w, k8 [, _# p" ~3 M" l
* w' r5 G7 f! ]5 H1 s: T; J4 hMethod 05
, g( {' j b# {% j; j1 B=========
9 M$ f( D7 g& F3 f! @4 z5 \7 Y9 o2 p
Method seeking the 'magic number' 0F386h returned (in ax) by all system
, l* M! @) W( N7 B) gdebugger. It calls the int 41h, function 4Fh. e' n9 G! Z3 h# z, S, l7 c5 {& ]
There are several alternatives.
& n8 _" `- Y( W$ W( B$ S& e+ j" b
The following one is the simplest:
1 q8 l6 B1 v1 q6 b1 Q R5 V5 o, ~4 U
mov ax,4fh
+ z; `& _. W8 \; y" U int 41h: ~# ?( u, A0 D9 p8 b0 A; J6 ` f
cmp ax, 0F386
5 `% p9 U/ E- m% c' \2 R jz SoftICE_detected
3 ]- E8 T3 T- b. J6 n# @: w8 j- l; t2 o, [
U6 Z5 u# O$ e) ]; V- Y. }6 s4 x
Next method as well as the following one are 2 examples from Stone's . q# @0 D9 p! a6 p3 c9 m
"stn-wid.zip" (www.cracking.net):; C# R- r& ~: b& Q# q
+ x9 V2 D. d8 t9 ~1 K mov bx, cs6 x3 \) E5 X! K' i* h/ o* R
lea dx, int41handler2- _- V. p$ n6 K( `6 v2 B6 y( b
xchg dx, es:[41h*4]6 o+ v1 z$ q b- X Y. n E( N9 [
xchg bx, es:[41h*4+2]
& E8 W! y1 R. o& ^! Q mov ax,4fh
! V! R5 P) S2 X; h; E# q H# h int 41h! a' t) K) I) r/ C; `
xchg dx, es:[41h*4]
% d6 w' ]6 u- \8 L+ k: I" h xchg bx, es:[41h*4+2]
0 j! T% F$ \; q: h! D0 \1 X cmp ax, 0f386h# z( ~# J( O) a7 l; ?6 k/ l
jz SoftICE_detected1 S! d" L& o$ l9 H7 L
3 K( ]( {) Z1 E$ i* }) |+ B
int41handler2 PROC$ O) l. m# t9 ]# O) }
iret
+ L6 }3 l. F) G6 q4 `( e& Kint41handler2 ENDP7 I) n1 L& p6 ^6 Y3 C! N. X1 f8 x
; r; G0 y& U p5 Z2 g- Y5 ~
3 `' n( q9 F: V$ k8 h1 D
_________________________________________________________________________: e7 r2 d8 g4 G+ r3 t; p: O" `
% N, O5 e6 N( {* z4 n, r
7 x4 n/ U! l5 F/ `( r+ iMethod 06, w6 ]* p0 ^& N' V8 b
=========0 O+ m5 f5 n- m! d! x, D9 }
5 P% t( d9 ?5 Z: t7 {5 @# A0 ^
- @0 M5 ]! }- \8 d" h2nd method similar to the preceding one but more difficult to detect:
) i" I+ F4 k8 I* x% m1 r, Q
; {# w: Q( i( t- `* Y8 h; d; l5 |8 p5 p0 s; r
int41handler PROC
) E7 ~8 `. s$ K8 L9 z mov cl,al
- T' z) N# T$ q iret6 ?7 o: P9 B( ^5 R% C/ [
int41handler ENDP* P+ U; L& _2 L% a
8 Z0 e$ N: X/ H! T
' F$ o! }* p* `6 F9 U xor ax,ax
8 n9 q+ Z. H: ^: n t9 y# V; h mov es,ax+ ?" {" A% H( \- E4 `$ \4 H
mov bx, cs
% t1 g; j2 L( ?; z lea dx, int41handler
; \2 r; c. |5 |. y0 p xchg dx, es:[41h*4]
^) T& z& y% L% o8 n xchg bx, es:[41h*4+2]
0 J* q0 J4 D/ h) m in al, 40h
) s) \9 C0 K# l; A+ e xor cx,cx. \) S# t7 b ?4 y( c
int 41h4 U* A& x- K5 ?
xchg dx, es:[41h*4]( t5 {) J% m: u4 r
xchg bx, es:[41h*4+2]9 i# D7 E( L* X( f$ e! S
cmp cl,al
3 t7 L2 f5 @9 J6 B. @# Q jnz SoftICE_detected& I! y! y9 ~( Q" Z* _
" q4 d% o q7 o. ]8 y
_________________________________________________________________________
* e( Z/ b1 v! U) n$ j# V# S
! s* I( k8 y: ?8 _Method 075 A/ }4 b3 }) z3 U Q8 N1 @
=========
3 a" p2 S. x% m# v* h* c2 @4 Y& M/ ]( t/ E
Method of detection of the WinICE handler in the int68h (V86)! |) e, n8 N7 w: l- C
8 |5 f/ j2 y* d+ _/ b2 a% ^8 {
mov ah,43h" h% H- f! w6 {- i% m4 F
int 68h
2 U, Y) ?# Q0 A; V" |' D' u& S cmp ax,0F386h
0 i3 V( s9 K+ T' P7 v jz SoftICE_Detected
2 ^1 o# k) S1 F+ f0 P+ f' H) e
! ?. i i/ ^# N6 I
6 w6 y7 E8 i8 Y* i0 {& x=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! R$ |% N* T, a3 ]
app like this:. A2 p4 w2 ~, O; Z& J5 {3 g' {$ P
' p" A6 x- q- O. U BPX exec_int if ax==684 C! `9 j5 F0 W5 l3 o
(function called is located at byte ptr [ebp+1Dh] and client eip is
9 Y/ [2 ~- T2 E. j+ G0 W located at [ebp+48h] for 32Bit apps)7 }7 h w p$ [7 O) \1 V( U
__________________________________________________________________________
; l1 l) Z5 H8 x: k) e9 i- x
% ?. {& y, d/ y- X+ }- v6 J7 p. l% g) }) c9 I- \5 U
Method 08
0 P8 a! J% U. [ {5 L=========
+ s Z) r4 W7 b0 ~" k) D( Q# i! Y$ w
' Y! H- l: @* RIt is not a method of detection of SoftICE but a possibility to crash the A- o. t. G }3 k& q
system by intercepting int 01h and int 03h and redirecting them to another# S. u, o+ f! Q8 V4 I# ~3 y
routine.
\2 E9 g' h! _It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 K- i) ^& a2 \* u5 l9 K4 C
to the new routine to execute (hangs computer...)1 C6 O- d b0 r8 K+ t( P' ]
% p: Z5 ? _9 J1 @ H" D2 A mov ah, 25h8 x# V" |/ Z4 l: h. h- \8 b
mov al, Int_Number (01h or 03h)
5 e' U( o3 h9 i mov dx, offset New_Int_Routine
^8 k% j8 O4 O int 21h
8 k L( k- \% \7 g1 _9 V
6 O$ d) U' M% m7 T* I0 w8 X4 X__________________________________________________________________________
& @+ h& m( I0 j0 i) R% J; m y3 X" Z" V+ e& R
Method 09
9 X" Y7 u/ g$ @: ?=========
- N5 y0 ~$ @ q) }/ s
7 P7 z8 H6 ^* F* e3 C/ o$ Y( `5 oThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 U, L* C+ }6 s$ o: U) m- }& ~0 k! I# \
performed in ring0 (VxD or a ring3 app using the VxdCall)." U9 s; g- [% P: Y: @+ Y8 j
The Get_DDB service is used to determine whether or not a VxD is installed
; u2 w' l3 h% {$ Rfor the specified device and returns a Device Description Block (in ecx) for! r" s' D, n: G1 a
that device if it is installed.7 _2 p' t) L1 V4 C% q! }
! m* F" M2 l) \6 b) H
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 {+ L# J" o- L( ]" @, c/ h1 Q
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ T. l+ C7 N' u9 d VMMCall Get_DDB
/ D& x$ b) c) w) o mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 V: w) T3 b) ^! [0 g3 y7 U" H8 B9 c8 X6 m% J6 Y2 z: s' J
Note as well that you can easily detect this method with SoftICE:' h( g& S, A1 `+ w# n" _
bpx Get_DDB if ax==0202 || ax==7a5fh
, q! d8 o# g* a# q/ i/ b1 [
0 o' S! d( ^7 K/ A* G: c9 e__________________________________________________________________________
) E1 H U3 m# @ d2 ?
: B% M8 K1 @5 V; jMethod 10
! w ^5 A) r H& d7 o! W: s% o" p# R=========0 y7 [4 D0 I( _$ C: ]' O
5 ^% [" o4 N* T4 M=>Disable or clear breakpoints before using this feature. DO NOT trace with
* P. M+ r' k0 z% k4 z" } SoftICE while the option is enable!!- I4 f" t+ E2 N; B, [0 M7 d% ^1 T7 J
- F$ m0 {% l& B8 `/ f$ x5 J- z
This trick is very efficient:5 |' X+ A7 M1 t) x2 i* ?1 ~
by checking the Debug Registers, you can detect if SoftICE is loaded# J& @. O8 w: {+ h, p) J) E
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ t3 ^( ?$ s- Y9 _& ?3 z
there are some memory breakpoints set (dr0 to dr3) simply by reading their
^4 p l7 |* G6 X: w2 pvalue (in ring0 only). Values can be manipulated and or changed as well
% ]+ p" V. W% R( y" Y: i(clearing BPMs for instance)& J% @5 Q Y3 Y# a( p4 S N
7 F- c- M* v r; b6 \# w
__________________________________________________________________________
1 c* A+ M3 w" H" h9 p, ^ M" J; O6 f9 A* ?, B- c) m; u2 I
Method 11" V+ g5 Q# g) c! `' V
=========; Y- k9 r( q# r/ W
/ q5 t% \" K8 @" I! uThis method is most known as 'MeltICE' because it has been freely distributed& j- r" ^- p4 g" K9 D
via www.winfiles.com. However it was first used by NuMega people to allow
+ a9 o* {. H V6 `# SSymbol Loader to check if SoftICE was active or not (the code is located
$ [6 {2 G# s# n, ]2 ~inside nmtrans.dll).1 ]; W- [. j: B
" v+ m8 h2 @& t
The way it works is very simple:
1 X4 t$ `. n, E; kIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ r* t7 M# s3 K; uWinNT) with the CreateFileA API. ]" r( ?7 m& C" g: f
0 l4 K5 A; r' O: g$ gHere is a sample (checking for 'SICE'):
. x- M: Y- y" L `. z, k/ y$ ~2 r Y# G$ H3 g/ n* U8 D$ r
BOOL IsSoftIce95Loaded()
1 l8 S6 q/ m$ ?& t+ v$ |# a# ~% ^{9 y% U2 s8 z% j! J. M
HANDLE hFile;
* o( f( Z2 K# V O Y- R hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 z$ T$ d7 ]/ w$ N0 _
FILE_SHARE_READ | FILE_SHARE_WRITE,! F1 X! Y$ O+ o8 [# q
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 ], g" K4 B) d8 }; i L if( hFile != INVALID_HANDLE_VALUE )) l! f+ \8 k7 {& |; \: s" ~
{6 \, A+ y+ |! I( X; ~+ H+ @
CloseHandle(hFile);
3 G- {# g9 ^+ R+ Z8 n# @ return TRUE;
! \" E8 e7 _1 |$ O }
4 u( `% R, P" m8 `0 p( G return FALSE; w, w' m V/ y" L- n0 Q
}& N2 Q: S! P4 @: f4 g' F
% h3 Z+ U3 Z% R3 p! S/ h+ N! q8 AAlthough this trick calls the CreateFileA function, don't even expect to be" T7 ^+ {7 w4 W4 z
able to intercept it by installing a IFS hook: it will not work, no way!( r! d" v# g" f* g! Q! o
In fact, after the call to CreateFileA it will get through VWIN32 0x001F. Q1 C! w; r2 |8 i$ R; [
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ J* m. {) ~: \/ p
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, G9 O9 R" O& w, m4 Ofield.
- g1 ^( G) n+ P$ e; q7 d6 bIn fact, its purpose is not to load/unload VxDs but only to send a
( C+ Q1 b+ H4 r6 T5 o( g/ r& mW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ G; y. T E* ^4 |
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
' _! C* R) M' f- W& X* ~to load/unload a non-dynamically loadable driver such as SoftICE ;-).. c2 N' W1 } A }% z' {
If the VxD is loaded, it will always clear eax and the Carry flag to allow' N3 D* ~) c6 w) x, u1 @
its handle to be opened and then, will be detected.' D9 Y3 i: s' ^2 m
You can check that simply by hooking Winice.exe control proc entry point& r! f; ^( C1 q- v; S6 J$ D! w
while running MeltICE.
, m- D% o1 {/ w' }/ L' P$ O& J$ `+ {" }# E
" s9 c4 w) f6 W J( L 00401067: push 00402025 ; \\.\SICE4 L% d. T( G1 T- n; z8 P3 t" A
0040106C: call CreateFileA
% U4 F6 r' e; ~6 V H1 L( B 00401071: cmp eax,-0012 K9 U& B6 ]7 T. }7 o6 [. z
00401074: je 00401091* J, ^+ K3 t5 C3 ]5 j
3 {# a; Q5 Y1 R
9 S+ X# G* k( S+ V* O" GThere could be hundreds of BPX you could use to detect this trick.
: s3 ^/ V& r. A8 l" E J$ q4 N-The most classical one is:
7 @) \" o+ g+ |( [, A7 U. u0 B BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# s3 m i+ ]1 y* r *(esp->4+4)=='NTIC'- X% R! {6 f& M R; Y5 T" g+ e J2 s
% w) U6 V, p' D-The most exotic ones (could be very slooooow :-(
5 z) a, j( ~7 Y9 q5 _& G# F BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
- d I, D/ ]' ^ _8 B7 k ;will break 3 times :-(1 K, b" A# s+ x2 N
9 L" l; n C/ a a-or (a bit) faster:
. c. B: W2 Z1 l, v7 v BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
; d4 f5 R# L9 H) c$ Z; J& x8 i/ d% I; I
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) m5 @( t5 _; n, l2 Z- h6 V
;will break 3 times :-(: n9 ?$ A# H; M# F! C; I$ C* v
( m/ J. r+ O* |9 E1 ~& I$ _-Much faster:
; P& Q* s3 b2 J/ b/ Y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'; C n0 \1 b; Y/ x. Y
0 W. P7 z @, {' U0 p
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
- t9 e7 P! F6 a% S" @function to do the same job:0 ?* x0 h' y& P$ ^+ S; V
7 Y p) J) s# C8 a/ Y6 A
push 00 ; OF_READ& N3 w/ M4 G3 e% o# ]# x
mov eax,[00656634] ; '\\.\SICE',0
4 |. t% N; e8 G- Y$ ]7 ]" [ push eax5 C, n7 p: P: r; r- i1 F
call KERNEL32!_lopen* Y' H0 Q6 D) E. b" L
inc eax- }. X- P, o4 s, H, u a" n3 H# j
jnz 00650589 ; detected" b( R& g6 N0 p
push 00 ; OF_READ
3 G2 h. O4 Y) _2 u3 G1 x- M8 Z$ X( d mov eax,[00656638] ; '\\.\SICE'" a8 S: ~& L* F/ W) y
push eax1 Z( T: j) B( v; ?# w
call KERNEL32!_lopen7 q! D! |9 p* \7 ^+ d, m. {+ |& m+ L! _
inc eax0 n: @' G5 Y7 C: f( ~% X3 c5 h; B
jz 006505ae ; not detected
" C9 N% K4 H+ p. O; s% m7 I2 ?, B9 b/ J% s/ d" H: G' e
) z1 K0 k9 E3 u. }' F# c& ~__________________________________________________________________________
' ?7 p0 Y- ^# S6 F& c
$ v2 F% Z1 G# P s9 z# }; pMethod 12
) N/ d, J7 {, p; U/ \) d, G; X=========( f% _ F' \( M/ d7 T
. e4 u+ m4 e# j' r0 v$ i' vThis trick is similar to int41h/4fh Debugger installation check (code 05
6 E6 }& a% m" |# c1 }* o& 06) but very limited because it's only available for Win95/98 (not NT)
$ g/ S% e( d* P% ias it uses the VxDCall backdoor. This detection was found in Bleem Demo.# O+ f9 B9 P% i; W/ X
9 G' V: C- J" n; u. f& u push 0000004fh ; function 4fh
! T2 A B7 [7 ~2 ~, m8 ~$ Y push 002a002ah ; high word specifies which VxD (VWIN32)% s+ U6 J; q! {# P7 K, n( M
; low word specifies which service; x0 b, M( }, S
(VWIN32_Int41Dispatch)& z" d/ ?' Q# G5 h
call Kernel32!ORD_001 ; VxdCall, W0 |7 d7 ]- x5 E2 J' r7 R
cmp ax, 0f386h ; magic number returned by system debuggers9 D7 o' G6 s4 `/ Z: M* S
jz SoftICE_detected/ u. k. E4 }1 r' `4 P! B2 o
3 T1 ?4 Y# }% y0 O: T
Here again, several ways to detect it:
; I6 q5 X1 ?5 C1 X+ t2 G$ ^1 d6 D- q7 q3 q
BPINT 41 if ax==4f
- z! e: Q; _" O/ W$ k! |2 @+ M' {
8 W0 `: p& w! _7 J BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one. a* z# G! o B: | s/ a* K$ ]
5 g$ X, `7 s! d
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A3 N7 I W, |: W9 o$ o3 Q3 Y
/ D% }' F8 L. U BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!& |7 M3 W5 D. K5 M5 `& ]
8 p+ ?% N3 l( s. _$ \: E__________________________________________________________________________
; `/ W6 V" q3 n' `9 e$ M/ J( T, T
" L6 \) a8 M/ t2 d1 J kMethod 13
( {& X, n3 Q6 F; |* A=========) a( I6 T1 W) z( h- K/ U7 T. X: V
2 u# g8 Y6 n0 a& l- [+ L
Not a real method of detection, but a good way to know if SoftICE is
( R! J8 b" d' J, I: P/ m2 ~installed on a computer and to locate its installation directory.7 b* Y+ g9 C7 a8 l) [6 Z
It is used by few softs which access the following registry keys (usually #2) :
& C2 p7 B3 P J. d! F8 r% G
+ \' j. V4 C7 B! @# R Z/ j5 i) d-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' w+ Z5 |8 Q) {+ u" s7 {, w7 i; f\Uninstall\SoftICE# h7 g) E3 j/ u. u( J
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 A" Y( a! ~ k-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% M; y, f" C9 E- w, Z6 F) N\App Paths\Loader32.Exe
# r5 x4 T# v9 ~2 H+ p. f- [/ G# A G1 |7 @
8 {4 o* j: x2 a0 H. F' k+ j0 WNote that some nasty apps could then erase all files from SoftICE directory
1 K& Z% ~" y" ^+ i(I faced that once :-(
( H/ b6 p# b# x/ ` t0 Z$ Z c# ?
Useful breakpoint to detect it:6 d$ O9 y f! ^$ `! K
6 l, A/ p$ J0 X* n8 k3 T' w BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
$ h" X2 ^' |# Z% t- F( ?" B0 q) W9 [+ J8 ~
__________________________________________________________________________% n7 s: M' K* u$ d
3 M2 |9 x' D4 X* b4 n; C" p
2 c% {# h. ?# M% p* KMethod 14 7 k& Y, Z/ Q4 U
=========. U4 r5 {% Q6 {: _
. T# E" n& m) C4 {A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 o4 W0 H' m$ x C2 E" M1 |) t9 vis to determines whether a debugger is running on your system (ring0 only).
. e; d. }% `% r- q' V# Y; U' |$ t! P/ u) I! g5 r
VMMCall Test_Debug_Installed7 M" S* E* m0 u" p: x* _
je not_installed
$ O" ?* @$ e% _6 e* A s( V4 Y7 Y# B
' h8 `9 Y, y' |+ x/ `7 ]This service just checks a flag.$ d' Z/ U5 P2 r! @) F! L& X
</PRE></TD></TR></TBODY></TABLE> |