<TABLE width=500>
. Y0 E2 a' `" a0 _9 M" `( c0 h4 m, w2 h<TBODY>( D7 r3 e# J" ]
<TR>- i! Z5 M- |* Q
<TD><PRE>Method 01
1 Q! Z, j+ I" R6 H5 ^1 v=========
. k3 p! ~8 R) B* d. X! t; g. o3 [, n
This method of detection of SoftICE (as well as the following one) is! Z6 T& d: h Z! e# w. A
used by the majority of packers/encryptors found on Internet.) U( D3 d- j4 x1 ?1 r: C
It seeks the signature of BoundsChecker in SoftICE# n7 k; P0 j( B3 f- b
/ L! X2 M) l1 O( l- p2 R# _' a mov ebp, 04243484Bh ; 'BCHK'
1 z& ~7 l4 Y7 ^# a7 G j& Q, Z mov ax, 04h! J6 Y* ~) P r( t. [: c) D" _
int 3
" y/ V" s0 Y6 e; k q# `# }2 o$ A cmp al,4, L( U: u& p: y5 y J* t
jnz SoftICE_Detected
9 K( i I |; v/ b
/ ~ i; `5 ?0 Q- \( g# ^1 ?& O+ L___________________________________________________________________________8 D( U( i. M/ y! h
3 G5 F& y% Z4 k" c. i( T2 ~Method 029 G; i% m, ~7 ], S$ S
=========6 s1 b- y8 J; V- \/ o- g/ B+ b
8 w0 g) V2 P4 G! M/ y4 \Still a method very much used (perhaps the most frequent one). It is used
7 Z7 S' P! N) \6 `9 Pto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ ^1 N8 Q) L2 ior execute SoftICE commands...
' N' O& G# ]# C7 Q1 i2 F( x' d( ZIt is also used to crash SoftICE and to force it to execute any commands
0 V1 _# ?1 y6 ]5 Z9 _$ z+ ?, [. {- o(HBOOT...) :-(( 6 k) b$ m2 }, _0 D8 [& I7 d. q0 f
! `3 }0 d/ R/ R8 t; ]& g2 ^Here is a quick description:( ]4 o7 z* Z! R* R
-AX = 0910h (Display string in SIce windows)
: X, _ k& P" G- H9 R) J-AX = 0911h (Execute SIce commands -command is displayed is ds:dx) e! X4 Z. y; w; z) ^- d/ L9 I
-AX = 0912h (Get breakpoint infos)/ L, Q/ A6 G% L( [4 T
-AX = 0913h (Set Sice breakpoints)8 T9 V$ A K7 q( A
-AX = 0914h (Remove SIce breakoints)
. z# [7 m9 _7 H! c! q3 H6 z. S9 L! m- L6 l y0 d
Each time you'll meet this trick, you'll see:( ^8 j+ s+ [3 D& `, j8 m
-SI = 4647h& \/ x% @! p% Y- a
-DI = 4A4Dh
! o5 x2 F& j. U9 hWhich are the 'magic values' used by SoftIce.+ z" e0 l+ Z# v6 [( y! x
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
7 `- A3 K% X: e. h" Y) d6 v5 [8 a; T" d; T
Here is one example from the file "Haspinst.exe" which is the dongle HASP% L: |4 g3 A0 Q# f
Envelope utility use to protect DOS applications:5 V: v0 j, x p( @0 y- W1 i! ?# K
6 j p' ^6 i1 t- \
! L) Y/ n( [% D7 W, F4C19:0095 MOV AX,0911 ; execute command.1 B& g' k5 u# o& e8 `
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).5 N- F5 f" m N% y0 N) `# h8 M
4C19:009A MOV SI,4647 ; 1st magic value.* d9 N( y. m1 u$ }$ N
4C19:009D MOV DI,4A4D ; 2nd magic value.) @! ?0 h5 R, y5 ?
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ J, c( m7 {) F# f
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
# z% a! B7 e; J# y' N) r4C19:00A4 INC CX
' d, v* u* n5 m) C4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# A* f4 x: i* K* d' t! R2 e4C19:00A8 JB 0095 ; 6 different commands.
" b3 ?% {" I& u( M/ G4C19:00AA JMP 0002 ; Bad_Guy jmp back.2 l5 [. b6 N" @( l( _0 j: N+ |
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
?5 u, B6 q) c4 |1 c; k! E9 ~# m9 O& o% n: r, S
The program will execute 6 different SIce commands located at ds:dx, which5 d# x8 I- s/ P5 A7 m4 p, T/ G1 l( \
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! c8 j! {( X' D U2 p# b. Y
* R1 S$ g. A; Z/ i( u+ ~* {, O* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' S: J# ~. F( K
___________________________________________________________________________4 t9 V, J0 L4 G' T1 V
" y5 K# f( x! T8 `5 l
& t" D+ [' h7 V% Q; LMethod 03
- P j( b& i9 N( u+ w=========( q o4 N; C. c
) [2 y# r' H" M5 M. B1 C+ {Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 R& `5 x' i4 @" k
(API Get entry point)
; D' o3 `$ ^4 b
3 i. `. t7 T8 N! [
# ]* d% }2 g7 s$ }5 {3 W! X' J2 c. k xor di,di
) ]& \1 C2 q& Y# d" E mov es,di
& e# m- B) d0 w5 y" B7 Y: Q5 G f mov ax, 1684h
* I6 O! t8 j2 w mov bx, 0202h ; VxD ID of winice
7 k+ Z6 C i. d6 E, v int 2Fh
; t2 r; A" W: T' Z/ P1 M7 e8 c mov ax, es ; ES:DI -> VxD API entry point) @: j: ]2 q( @! |) E
add ax, di( [" L6 A0 g& G. o/ S! E
test ax,ax
8 F2 m2 P. D( z( ]/ T jnz SoftICE_Detected, X* f6 n, i' ^/ V& m6 X5 K: g' O
/ U: @, [2 M- _# Z: e5 u___________________________________________________________________________
- Y" I/ L* [* q1 F; w1 w F* D4 W# S7 i4 {+ ]8 q( \
Method 04% k2 }0 c# ]/ ]. |% ?7 K
=========
2 E" T: V- F% S2 V, O1 X$ `* I: `5 g% o1 a! }* ?( T
Method identical to the preceding one except that it seeks the ID of SoftICE
. A* X9 o$ ]& E: J0 m M( FGFX VxD.& K& S0 M# o U! r9 O% P8 d7 n
7 p9 s" d) @' u xor di,di2 ^& ?3 f. Y- m4 \
mov es,di
! T* {% b; @# w% ]# C( b. g mov ax, 1684h - a. Y( X' N. U8 v
mov bx, 7a5Fh ; VxD ID of SIWVID
, f+ S! e/ M& r int 2fh
& V) R/ z6 d5 `' O4 o1 D7 ` u mov ax, es ; ES:DI -> VxD API entry point
k5 f" y# M2 T$ l2 Q" @3 C; H add ax, di( b6 s, R; \% d& | A6 U
test ax,ax) ~. k' f0 Y6 K: I$ n
jnz SoftICE_Detected
1 \2 a" U e$ U: m$ J
. P4 x$ Q1 O+ n: S% r2 ~__________________________________________________________________________
5 k, C ~7 ^/ C) o" c# f
9 b) q. M; j, ]( ^9 x; H" O" a2 I+ O- ] A( ]' G! U
Method 05
8 d8 k6 g0 Z3 @+ W" A; r4 ]=========
) `' y) U% ^* X! d! U0 T) S6 [$ Y, I+ v+ r7 Z5 Y
Method seeking the 'magic number' 0F386h returned (in ax) by all system! q* r. C, g/ v/ h2 B7 q5 o. S
debugger. It calls the int 41h, function 4Fh.& p; q! b$ x& S/ `
There are several alternatives. ) E7 U1 S8 d1 Z3 F% Y' Z
: e0 R7 U, }% ^1 XThe following one is the simplest:4 f# |, H; \3 j
/ c- Q: o0 `* J, F
mov ax,4fh
4 W3 S7 [* N5 S; Q8 E# p" Q int 41h
Q+ H; {$ E, v cmp ax, 0F386. b+ H& U) |6 h N) H- @7 H
jz SoftICE_detected
9 N k0 h1 w V6 ]5 U. S
5 R9 u9 S6 C2 F* g# V1 [# [: t& p( u, M4 X, c
Next method as well as the following one are 2 examples from Stone's
7 Z. a+ z1 p* g"stn-wid.zip" (www.cracking.net):! o8 z x r7 u
" d) r3 v; Q: I f1 S9 P! O
mov bx, cs- u) f2 p" Z* N/ {( H/ e! x
lea dx, int41handler20 |' u% N3 h& X. z+ h4 X
xchg dx, es:[41h*4]4 ] T/ E$ a) s
xchg bx, es:[41h*4+2]0 @" |$ Z0 M( }) N1 q
mov ax,4fh g- f5 |6 F0 B- s9 o. M6 N/ X, c
int 41h9 H' W- h- p+ \6 K
xchg dx, es:[41h*4]
. {- _. b. s5 u5 r( L xchg bx, es:[41h*4+2]* a+ h1 |* l, u# A
cmp ax, 0f386h
t, y; A0 H0 D" ]* [ jz SoftICE_detected8 k7 F/ ^6 E9 O2 Z9 q4 ]. x* {
7 y% J2 w3 e# a7 eint41handler2 PROC
" E& y( F8 J+ J! U* M8 G iret
; U, m3 D! F, E/ a' r9 zint41handler2 ENDP
+ e1 Y7 ^. N5 X3 }) i; z. i5 d* R% S$ ~/ E, ^+ Q6 O
3 [( h8 B7 {% Y_________________________________________________________________________
: n+ q9 N1 l' ^; [; M. Z+ K3 r( Z2 m1 [+ Y: v% b; D: ^
) c' o% J7 b! K1 r0 m% QMethod 06
$ d) b" D1 N) {% a& B h( b7 I=========
5 V7 R2 f8 X+ }! ?/ ]; b+ U: |& F9 G' J0 V, T( F3 D7 ?
1 g$ L' L9 m4 ^5 ^7 W9 d4 m% N
2nd method similar to the preceding one but more difficult to detect:
" ^' u6 j0 i) ~ d6 w0 w8 W S7 H' N- `8 x9 U
8 I7 h. r( I: x/ [
int41handler PROC" r( S2 M# E1 r1 w
mov cl,al
6 ~ `9 d2 Q1 J( Y& Z iret
3 C9 s6 E' M# |' kint41handler ENDP) @5 y+ m( b% N/ l3 ~; w5 ]
% y- V( [0 `, g* g# c1 l
" t9 a7 @& v% U; }5 O1 w
xor ax,ax
& ]- r0 P z7 s; d7 H2 r0 v mov es,ax
6 L$ e8 ~' S; @$ r; S0 ? mov bx, cs
& D" F; B. g- T- W' A$ T lea dx, int41handler
; R' w/ N& |. k xchg dx, es:[41h*4]
" w; T: h: f: K8 ] xchg bx, es:[41h*4+2]3 ?: I: S) g' x x; }
in al, 40h
5 ~8 J/ z0 _% `$ W! q xor cx,cx2 Q& ^( k% q) P% E0 M0 M8 s0 a' ]
int 41h" G+ a( p' T# n0 Y! ?# [" A/ L
xchg dx, es:[41h*4]' D7 k& Q. z& }
xchg bx, es:[41h*4+2], M- f! [4 q, j% y5 {& ^# ?& W
cmp cl,al
8 G2 ]0 K) N- Q# I- e jnz SoftICE_detected _* |5 k6 J2 a& x2 ]1 v" Z- z! e
! C* X) Z8 \6 ~_________________________________________________________________________
" R/ ` Z% U* P) q& y* n8 F/ `; ]6 i; Y
Method 07
; g5 G$ U8 S8 P========= z5 I# D7 G7 w- k
+ ]. f* i: y! ^% J/ ?) c
Method of detection of the WinICE handler in the int68h (V86)
) Y1 H/ q- ]) ~- ~+ V
4 u7 M5 [; s8 D5 i2 G1 t7 p mov ah,43h
/ v" n% A* @; c! w3 n- |: X' S int 68h+ t! |8 h$ v+ u/ A
cmp ax,0F386h
% u$ y# h. m2 z$ e, f+ w X jz SoftICE_Detected% d# ?# B6 ^( T2 H& j# l# c2 h
! y' L- p2 Q1 c( d
* V6 Y ]% M7 h" O9 |6 a* e" _
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 e4 c8 w3 j2 U/ z' `, ~ app like this:
, a* Y0 F6 z$ ? `1 P, P
. r/ O& e4 m T6 o BPX exec_int if ax==68
* z' Y( E$ z3 s (function called is located at byte ptr [ebp+1Dh] and client eip is0 K4 Z* M; Z. ]/ E
located at [ebp+48h] for 32Bit apps)
7 b; R1 J% X" O__________________________________________________________________________
0 j; U& b: X- D0 Y# K8 G0 I* j* S' l
$ p: [) Q2 o' ]+ i6 dMethod 08$ J1 d7 ]# p# I, ~
=========/ S& e6 S+ L) ~5 r3 W
3 |# R- K& P7 q0 ^' l; H
It is not a method of detection of SoftICE but a possibility to crash the
+ y! ~7 q8 ^0 v! G- H! Isystem by intercepting int 01h and int 03h and redirecting them to another
0 S/ ^4 `' m2 u7 {9 g A2 k' Proutine.
4 [8 f6 @6 V [It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" p5 i; s) q( }" [
to the new routine to execute (hangs computer...)4 _ `# b- s) @" h
5 ?2 b1 K: y- a mov ah, 25h
5 E1 I+ P" b0 v, L" a W/ R1 j mov al, Int_Number (01h or 03h)
& z# h( s$ n- }( s. q4 K% N mov dx, offset New_Int_Routine
5 ?6 i4 h6 y3 g9 }2 u6 e int 21h3 m: m3 q% p0 D' M& Z
) @' v7 k7 k; r0 _. K4 i9 o9 G2 {+ D__________________________________________________________________________
3 M6 Q a5 J9 t* J8 s: T6 S! k) r, }3 K5 _ q& M+ B9 b
Method 093 f6 M. O" @4 m6 p6 K' [
=========+ O5 E+ S$ }5 `+ N4 z: S
, |9 B* ~# ]( L9 k% {# x/ `, u- ^! u) I
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' t6 \, z6 \5 a _" ?' bperformed in ring0 (VxD or a ring3 app using the VxdCall).7 b; N- g" X7 D) l
The Get_DDB service is used to determine whether or not a VxD is installed
9 W$ f( Y: _8 c1 E8 efor the specified device and returns a Device Description Block (in ecx) for
3 U0 ~- e3 z# K' G" Othat device if it is installed.8 Q3 r6 L2 A2 K+ Y0 T d
: L1 D s/ e! f# ] ~/ J
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: g4 l% _2 n$ H4 e8 Y2 L p# t
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& Q9 ]4 @+ P4 F
VMMCall Get_DDB
' D& w* _6 q) v- Y( \2 b) ~ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
l+ I4 h+ y: u* u- O$ [% e; V' l9 m3 O
Note as well that you can easily detect this method with SoftICE:
2 G' @/ I9 A2 X& U9 q0 ~# n3 T bpx Get_DDB if ax==0202 || ax==7a5fh* v, V" c& T+ x1 O' `; i
7 k9 {1 k8 U: ]+ a, ~+ Q) W
__________________________________________________________________________
9 K% b( O7 R" L; ~* _! q- w3 W2 D$ o5 H, W1 Y
Method 10) _+ A7 U" e% L- ~% g5 l' I3 [
=========
7 c2 X7 U6 i0 j0 o
9 ?+ f% T( q; S8 P: m( k h2 q=>Disable or clear breakpoints before using this feature. DO NOT trace with% Z6 Q! `) E& P/ j8 H/ b, }/ ^ ~
SoftICE while the option is enable!!9 z8 i( c. N0 p. i& w
" }$ @7 E( D* r# _This trick is very efficient:
9 Q: ?& k* a; M5 X" o( I, s3 Bby checking the Debug Registers, you can detect if SoftICE is loaded
( D& {0 X1 w2 A+ w. U(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. p& {) y& P7 }0 }; M% [there are some memory breakpoints set (dr0 to dr3) simply by reading their
0 A8 b' d$ B" h: F+ wvalue (in ring0 only). Values can be manipulated and or changed as well
4 B& ~5 n5 v$ z" m9 S$ X' k(clearing BPMs for instance)
& f' y, @! Z, k6 T
+ J* G ]% M5 O& ?' ]% n9 z__________________________________________________________________________
% g7 N7 `' q5 ]( ^7 r4 `
4 z7 U: d8 k! D: [. UMethod 11
% f/ q+ p4 `- l% r9 F0 G( I3 [=========
8 f) O4 U. r; Z, o9 e( l
5 M+ S. R D+ x5 y8 JThis method is most known as 'MeltICE' because it has been freely distributed
7 H4 ~% \( o8 r8 Z2 hvia www.winfiles.com. However it was first used by NuMega people to allow
2 ^# h) D8 {" q, {/ z2 S) m9 B* R7 \Symbol Loader to check if SoftICE was active or not (the code is located3 {7 k& c* m& b0 J; v! Y- J
inside nmtrans.dll)." n( D" l' T' Z2 Y; _* x! W4 o
5 m7 V) ^; g* y1 b* |8 O' L7 Y" @The way it works is very simple: n$ o! U) K4 g3 I
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 u/ O7 [) v% L* }& M' T
WinNT) with the CreateFileA API./ T Y9 I4 |9 s% ]2 O. k
7 U! n" {! o5 m- {* v5 T% t9 E! \Here is a sample (checking for 'SICE'):/ ]0 A" v, v$ J# N. S) w
4 b& ?( }" @+ t. ~BOOL IsSoftIce95Loaded()' f) J7 }" N3 O# ~
{
/ j; U' S; r1 z8 O! g( a HANDLE hFile;
+ A; U' [0 ?4 M, D2 i- }9 e% G6 T2 E ? hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
( m. W! ], d; m; r3 t. M FILE_SHARE_READ | FILE_SHARE_WRITE,3 R' G6 l! p( h) X: N1 Q6 a1 H
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
' z0 j2 r8 g/ Z if( hFile != INVALID_HANDLE_VALUE )2 t A0 v9 |( O- a
{
- @- [. h4 `+ `& F: ]! b CloseHandle(hFile);
9 z4 w+ } E9 m/ \ return TRUE;
- p5 x R3 v* U- g }5 F* M' X3 _: N$ D, o5 `
return FALSE;0 k% Q: e& B3 q. H4 {' A N3 R2 T
}
4 W: a0 d7 p k8 Y: h6 }3 x0 ^; y* }8 q( n: i5 `, Y9 ~
Although this trick calls the CreateFileA function, don't even expect to be0 d+ t, r9 C0 C5 }/ Z9 @ Y
able to intercept it by installing a IFS hook: it will not work, no way!4 c3 D7 i' Q9 _( n! x
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
& r2 w: K) y9 C& pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)5 |* [. Y' T5 ^: `, U1 k: c# Y4 x) \
and then browse the DDB list until it find the VxD and its DDB_Control_Proc2 }$ l$ d+ _1 P5 C+ w7 Z
field.
" n& G4 e q; O) K7 M: P6 cIn fact, its purpose is not to load/unload VxDs but only to send a $ h( G2 _1 N2 E0 B G
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 \" | b7 @5 J w! J H
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 a( D% E' x8 Q( |! g$ Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).% U |5 b, R2 ^, o/ L
If the VxD is loaded, it will always clear eax and the Carry flag to allow
: Z7 x7 c2 Q. q- r4 Bits handle to be opened and then, will be detected.( e) _/ [9 |7 i6 }/ N
You can check that simply by hooking Winice.exe control proc entry point
2 G6 D) J% J) [. swhile running MeltICE.
$ T) p$ T9 g) R) C
1 ?3 p5 f3 ~0 J. P7 o5 ]/ ^- H9 C. B/ \/ l6 |, ?& V
00401067: push 00402025 ; \\.\SICE# {$ L2 _ ?; D! [
0040106C: call CreateFileA' ~# ]$ w8 C1 G% j
00401071: cmp eax,-001: \5 Y1 Y' W$ ^' h/ `
00401074: je 00401091
+ q3 k7 N5 p/ G* {0 ~2 S9 P$ ]5 {3 ?; ~
/ B$ { |6 c9 B, L7 d1 I: B
There could be hundreds of BPX you could use to detect this trick.7 k& H2 F" B' P# j9 I& J5 x
-The most classical one is:
+ n# v9 W2 i# i0 x8 V BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||: {) r" F3 }- R$ y6 X. \
*(esp->4+4)=='NTIC'1 r' c, S# S$ l! D
7 Y1 J0 u# O. d0 n
-The most exotic ones (could be very slooooow :-(: h6 J0 v4 E& x3 N/ X% N
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 c8 y( [3 J. R/ M$ _# f/ l, y) A8 z
;will break 3 times :-(
+ M4 z; S) T* V& i+ g* q; w8 ]) [4 t* W" X8 |& k& X. m3 o3 D
-or (a bit) faster:
2 g1 T$ X7 k/ r( c# \+ l5 V BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" A1 w; i6 P3 ~2 M# [3 R1 V7 S
6 U" I% t/ J2 }2 \3 d1 t& h5 p7 [1 X+ S
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : B6 G7 F7 X; g. A2 ~
;will break 3 times :-(! P1 f9 T: o( ^, g$ p
0 C& P0 k n5 \9 h
-Much faster:- a$ m0 Z) z% g8 B, Y5 Q q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 f7 d, `9 \! ^5 G( G2 H
% ?4 n3 y. g W( m0 F3 n
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
) G2 X- ~+ [ x# ~. y3 z4 Ifunction to do the same job:
4 m' H( @6 O+ }6 G
# `7 V' I% H: o push 00 ; OF_READ9 \+ e% ?) c8 z6 R) V: j+ O( q
mov eax,[00656634] ; '\\.\SICE',0
) `5 | W% }9 c/ I2 d0 A* V' h push eax( z$ P* |% B5 j1 h' X% z2 k: T4 x3 l
call KERNEL32!_lopen* E& m" ~# G) Q
inc eax }5 }: Z- g' P
jnz 00650589 ; detected
9 a! ]( P4 x6 O/ G$ {' u push 00 ; OF_READ
; m9 g: i1 L5 ?; J3 F( V; t5 v8 h mov eax,[00656638] ; '\\.\SICE'
- |+ x' u( u3 G$ B3 `- V j/ x push eax
S. h) L1 E2 d2 G6 P# s( J call KERNEL32!_lopen+ Q! x7 \7 R \# u! m7 D
inc eax/ f( Q2 B+ Z. j$ o1 D( j
jz 006505ae ; not detected& Y2 x; {7 ~' P$ G2 {
5 [* x2 {$ |; m& u# Q
" G4 J3 @! s" z O2 [' H0 Y2 p a__________________________________________________________________________
* e% Y6 C% v: d7 Y1 ~0 `4 h9 f% N- P7 p7 I, `. Q" e9 z
Method 12
! d2 w2 R- |' x: x5 J8 o0 W3 L' v3 ~=========3 Y4 {) J2 e4 t" b
( _9 ~, P, t! {$ M
This trick is similar to int41h/4fh Debugger installation check (code 05
2 ^( c7 c% F j& A3 q9 `& 06) but very limited because it's only available for Win95/98 (not NT)8 L3 t3 X' k9 ~; p, H+ C
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 @1 ?& a. B" X0 Q. t, B) w/ G2 o' T$ j* S
push 0000004fh ; function 4fh
! L! Q" ^: J1 ?. _ push 002a002ah ; high word specifies which VxD (VWIN32), \ x' g# _$ s I" t! a
; low word specifies which service4 Y K3 @/ O* m2 j9 B+ `
(VWIN32_Int41Dispatch)
1 b: ?1 g3 z/ a call Kernel32!ORD_001 ; VxdCall$ ~1 ? v3 |: _- r; ]8 |2 o
cmp ax, 0f386h ; magic number returned by system debuggers
5 N6 {# p* l- J5 N( e jz SoftICE_detected5 R" H% Y s; s3 s1 Y; D
" R# G2 j3 Y+ q* j" F% [2 M& T- `9 CHere again, several ways to detect it:' O; C+ i. v) P7 [" Q* p
) ], J1 J8 e, Z% l! k BPINT 41 if ax==4f
) H" G. B0 Y; v0 P3 ?( f; B; }1 M3 f2 T3 G
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* {$ w4 p- @! [4 W5 x* r P; t0 U3 d$ f; W7 H
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
" ?1 b$ y' j' q* G. O9 [5 h0 \
( N) P6 v) Q( L BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!4 C9 s1 V- f. Q$ I4 h" l# @1 [
" l/ Q3 k8 h; h$ S: B- C
__________________________________________________________________________
6 o! R, P7 B7 ~+ E
! J3 C2 q5 E8 E& f) mMethod 138 ^7 R W4 u( `" G
=========
- l- D6 c7 B" ?4 s) ?& s
/ Q- o- }6 f* b2 c! S+ C/ h! MNot a real method of detection, but a good way to know if SoftICE is
1 N+ `- Y0 w6 ~1 a) Kinstalled on a computer and to locate its installation directory., s( h: z& n, V w: _; T9 G
It is used by few softs which access the following registry keys (usually #2) :
1 H, \- ?9 j5 s8 \6 L. W5 c& ~8 u4 R, f
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 ~0 w* P( }$ e% L3 ? _6 F4 o' l# j\Uninstall\SoftICE
6 j5 x) \- K0 {" n$ ^' z-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE( E) C& E( y. @ K
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 O) i: P. {" b0 Z0 x% a
\App Paths\Loader32.Exe
" X5 b9 W$ z& I& A0 y* H" _! P2 c8 l& M$ R: ?0 k) S( }
) S$ a6 w% d7 R0 T( m, Y' c" }Note that some nasty apps could then erase all files from SoftICE directory
8 i' k% c6 h# Q$ S(I faced that once :-(4 N: ^& L2 V. c. E0 A5 T& G& u* b( E: y
/ d% n7 z' d5 I' w8 |Useful breakpoint to detect it:1 {- Z8 x6 k# P0 z- h
. G4 N& a, A% p. g5 o BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'. `% G! X8 B* O
4 _, D! ~! w5 v__________________________________________________________________________* z8 }9 N D @% R- A
3 g) i4 M- ]1 D; ^
- P6 h' E6 G$ L2 R, v2 c+ }Method 14
4 I- j3 G0 z r; s* O. q=========
( `: [1 \! Z2 E8 y1 L
9 d6 a3 ~4 s! [ M/ ~! Y1 I* iA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
1 Z1 ?: S" W6 @is to determines whether a debugger is running on your system (ring0 only).
0 e7 e' j+ z; U- T0 h
6 i# P* Y8 B$ Z0 ^* H VMMCall Test_Debug_Installed) x* w1 W' V1 F4 p* c; Q
je not_installed8 L5 C7 ^5 t9 `3 [8 W% W1 H/ K
" t d; t7 R4 e: P* fThis service just checks a flag.
/ U5 B1 j( F6 l* B% F# R</PRE></TD></TR></TBODY></TABLE> |