<TABLE width=500>
& h& L4 M# X' u2 k+ A8 ]% L<TBODY>
: A1 o( Q. o$ R4 r<TR># V# |3 k- h# j3 @! n
<TD><PRE>Method 01 `9 M1 i- r# W X J% _
=========9 X% K# |. Q" c2 r( P0 s
: p( A" E4 Q) z; h! x, @ m _$ ~% d
This method of detection of SoftICE (as well as the following one) is
- @+ M7 B9 l" \1 f8 \1 L+ gused by the majority of packers/encryptors found on Internet.3 C0 Z+ Q9 F& y% p5 N+ g
It seeks the signature of BoundsChecker in SoftICE
7 v1 I/ H! g# d- f0 H) k
$ Y1 |; k) g- o6 |2 K: V* U2 Y mov ebp, 04243484Bh ; 'BCHK'! j( V1 S, s( K9 y
mov ax, 04h+ P7 c5 V# I, @& `$ t5 ?+ |
int 3
4 \: p% c" P* M0 W- B# [ cmp al,4
. c$ ~! Z* x; A1 D& P& N. f/ A jnz SoftICE_Detected
" }( p% Q0 I3 K8 ]
! W; v4 K% U0 e1 ]" o& H___________________________________________________________________________
7 z4 u. r1 I! n8 J8 W0 X
; ]7 H" {. P. p& V/ O9 V3 C* AMethod 02
8 J5 E. f" k; m1 F; Y# s& d=========
0 }0 ]5 s3 K, X: l
/ H! }- K2 c+ h; c5 HStill a method very much used (perhaps the most frequent one). It is used {$ r; t5 G# _9 g
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- J9 ]7 h, \6 ?8 T1 D
or execute SoftICE commands...
- q& U% C' e% p: `It is also used to crash SoftICE and to force it to execute any commands
+ h2 n- q8 f7 ?" U(HBOOT...) :-((
! e$ V% Y2 W; u# Q# j6 g+ |! M1 C" G" H! G! \
Here is a quick description:! |; }9 E7 J! Q
-AX = 0910h (Display string in SIce windows)9 H( D+ {: U- e! C' [
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, S# N2 R; p4 _: L/ ?, [2 o2 L-AX = 0912h (Get breakpoint infos)
E, v3 o0 f' L- m0 r3 \-AX = 0913h (Set Sice breakpoints)
9 D, O( S3 y+ e8 z3 S O-AX = 0914h (Remove SIce breakoints)* L/ e* R/ H8 Y3 u' i2 [
3 S- R0 e0 ]6 N! \8 ~, T. l
Each time you'll meet this trick, you'll see:" |$ C3 G% e% y# F/ J( w
-SI = 4647h3 G! A- n1 W+ W; Z( H3 P9 N6 a
-DI = 4A4Dh
3 t5 C2 d' k9 h- s( r" \; p: o: X0 rWhich are the 'magic values' used by SoftIce.7 n- P3 T% _% N# R& G
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ n7 L, T1 k! ~6 o4 @0 ?. h, c/ m( p& y# g, U
Here is one example from the file "Haspinst.exe" which is the dongle HASP% w# A: A7 k6 I) \( ^+ d' V
Envelope utility use to protect DOS applications:5 F. A" J; ^7 Z$ B1 f( B" ^
# Z8 O8 _+ y) ^% ]
5 W5 j8 a6 O+ I B
4C19:0095 MOV AX,0911 ; execute command.- U9 G5 g# \8 w+ J
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).3 t+ l8 k y9 ~- m
4C19:009A MOV SI,4647 ; 1st magic value.7 U2 P( M) p: ^! N3 r% ~/ O, K) F
4C19:009D MOV DI,4A4D ; 2nd magic value.
8 b1 {# u$ @0 ]/ p8 X- w4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- M/ C9 f) g& P6 V6 L# G( z6 K, D4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 {% y) Q) u" a, z. W4C19:00A4 INC CX
9 p3 S; \' ^/ {# k/ C4C19:00A5 CMP CX,06 ; Repeat 6 times to execute) X$ b. J7 i( q( Q
4C19:00A8 JB 0095 ; 6 different commands.% ~0 P; o# L/ f' r3 r
4C19:00AA JMP 0002 ; Bad_Guy jmp back.! i2 j- L! j* P3 \9 i7 m P
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)$ H4 h d5 s+ B
* f# X5 y+ S+ P, V6 A1 Z! UThe program will execute 6 different SIce commands located at ds:dx, which
! E+ f$ C/ w% B/ p$ f# l+ k4 V& @are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ y& J4 R& d7 I5 i7 v) ]! J& I' k6 U) Q9 S h
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) y6 e- z i/ e; Z X* d1 a' x/ ^___________________________________________________________________________/ m" A6 o5 q; a" u' B
9 n& h& Z! x/ f4 f. Z
. T8 S% ]" `. U6 i
Method 03' J9 I2 t: P, m! A4 g
=========! L/ L1 @ ?/ N" |4 u
0 u. `0 i: n1 G& D6 a
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' L0 a$ {) r9 f1 S0 t3 l- m8 q(API Get entry point)+ ^: s3 L9 u! o h1 c$ z
' M: N+ [4 \$ f9 {) Y. Z8 D
2 N' l7 A2 Y& K3 L xor di,di. Z7 v$ w/ j( z; d% j3 j+ b
mov es,di9 u' |! }7 z5 i
mov ax, 1684h # r9 n$ J! H% s& J
mov bx, 0202h ; VxD ID of winice
% v& }& Y3 @3 P% _ int 2Fh8 U5 }: q# }1 q: [! E: {$ M
mov ax, es ; ES:DI -> VxD API entry point
5 Z! H5 c- ?7 S3 k+ ]9 \ add ax, di; T- u3 V" }& d, ^) y
test ax,ax
9 Y, Y7 c! ^$ ]0 l0 H4 t jnz SoftICE_Detected
* Q9 s5 a7 s5 K# @
; A! ~/ [0 A; K+ y+ |# W) ____________________________________________________________________________: v( F0 q" S: f$ m" u
4 Y8 h0 ]; Z- Q5 ]" c& g
Method 041 T \1 O, Q6 G2 |' Y
=========' u1 a0 ?$ L `5 ^
/ E% h* ~$ }- m
Method identical to the preceding one except that it seeks the ID of SoftICE
. s5 d) K- i+ h2 f0 Z3 kGFX VxD.) w/ @, C1 G. v9 e0 T# H8 {) F
: U+ r3 k, G( O! p# y) Y
xor di,di
% N& Y+ A; R/ p) q/ I" d+ U4 H mov es,di7 ^( _* |: H2 k$ \* i& I% t
mov ax, 1684h
8 Z( [7 a0 _2 E2 Z mov bx, 7a5Fh ; VxD ID of SIWVID
: {! w: u- Y0 y2 } int 2fh
/ C* C$ E8 c" c6 f- X, p E3 U$ x mov ax, es ; ES:DI -> VxD API entry point% c" g8 b" v( S# Z7 q# T# U& A. v
add ax, di
U! C1 {! R! c4 p2 X+ C" u( R test ax,ax
+ ?" ^; A- c. Q; }! K' I jnz SoftICE_Detected2 K N# b- P* J/ n5 i# S
# @4 L4 o4 j/ m( v0 M1 f( _7 t__________________________________________________________________________; ?. X0 ^6 y" ?/ X
$ w1 X% j0 f8 L* \. F( F& E6 B ~2 j7 d' P8 B# `& G, `, `7 P
Method 052 R D U) V. F" q/ G+ p; J( u& Q7 Q @
=========
: A! r# e1 ~6 }5 l2 D: o9 @ Z& |) a, y) W! I0 q
Method seeking the 'magic number' 0F386h returned (in ax) by all system1 \3 C" S P4 m% U7 U
debugger. It calls the int 41h, function 4Fh.; X/ l, B( y6 b0 t/ o8 O
There are several alternatives. 0 C" G1 X: c' _" y! g/ `/ L
' v3 G8 O/ O9 f# Q* L6 }The following one is the simplest:: s; `& y6 A7 F
0 k4 |( }+ {1 X9 }4 E mov ax,4fh
; a! y8 }* B9 D2 G" u int 41h9 p. w% p+ Q+ m
cmp ax, 0F386& H+ t/ z9 |4 T' F: z# L; \
jz SoftICE_detected
$ X# s. k3 @% B" ~- p. V
: G+ A( B9 L x' p* E9 A- e& X& T0 M" s
Next method as well as the following one are 2 examples from Stone's
{, E# \! T0 R& `2 `"stn-wid.zip" (www.cracking.net):
$ D' Z* Z) N4 g7 e# `$ X" b% M0 w; G! P* r6 Q
mov bx, cs
2 J, {5 z9 ^, `0 `* q+ [ lea dx, int41handler22 Y/ f) i/ ^+ ^; d7 G
xchg dx, es:[41h*4]* `; i S: ?( [- l: \+ ]* F
xchg bx, es:[41h*4+2]1 D0 k+ ~7 {7 ?, y
mov ax,4fh
( `" X4 J8 M4 A( u/ x. a int 41h( d/ |% f2 n2 `. x }4 \1 O- H
xchg dx, es:[41h*4]
. v6 J- l" E. M. t xchg bx, es:[41h*4+2]0 D7 d4 s7 k% v, K
cmp ax, 0f386h
7 Q. K% f7 P9 q( o/ w jz SoftICE_detected$ x9 K- Z0 Y7 }" t# G
1 e7 k- W4 h5 W. z7 Z& Uint41handler2 PROC9 j: K/ q0 }" p/ d: X" X' W
iret F7 s1 m3 P' a7 V
int41handler2 ENDP1 [/ i( T7 M2 u+ Y
$ o1 o' j) e2 {8 U! l
7 U6 J9 t6 ~2 V) ]6 v_________________________________________________________________________
3 @; {+ v; e3 W3 A: A% E3 i; G/ ]
# ^' d& U4 a7 E- n5 ]% {# h3 ?! c) ?3 X" q# K; p7 H# o0 J9 D
Method 066 z/ ?" `' \2 |' H8 U
=========8 w" H' @6 q4 u) H1 x$ q g
" E+ H8 C9 T* b4 {; Z5 X" \' S$ G" q1 J& o$ n( h
2nd method similar to the preceding one but more difficult to detect:
7 N! ~0 ]3 _3 I; x& S7 y' M6 D; C1 \& j, m" [' ]$ r% f
. R. A$ E' L8 T# f' f7 D
int41handler PROC
+ G" X8 z, `! J0 `* N# Y0 X; c mov cl,al
# F& _+ G& | M6 S5 l q, }8 J iret/ Y* z Z Q# C c+ p* X9 o
int41handler ENDP
3 k$ R& k0 i B2 J; I# D
7 r9 B @4 z, P* V5 U. A5 S* c5 U- b2 w3 {. \4 u1 B3 S2 O
xor ax,ax2 W: C4 ~$ v, e" M: L
mov es,ax
5 w# h& K! w/ V% y+ s mov bx, cs
7 o# R H) W1 _2 K2 B; }4 G" W lea dx, int41handler( K c8 _4 ]! W% k
xchg dx, es:[41h*4]" n4 c. K" e6 M+ K- d# ]! Z
xchg bx, es:[41h*4+2]6 [) J5 H; d- q0 E2 D& j
in al, 40h6 g; F& z4 `, I5 ?9 p& O) S6 t
xor cx,cx
) y* W, d" R; a1 p: Y int 41h
) W4 U8 B' u0 j Y4 T7 A1 e7 ~. z xchg dx, es:[41h*4]
; i1 c' c3 k0 O- @4 ~: @ xchg bx, es:[41h*4+2]
& m/ A* Q: a) Y) q; b cmp cl,al, @+ e( e" `" u, D1 v6 e
jnz SoftICE_detected3 |! b- K. E& C/ T1 b& Z* B
4 e" t* i1 m; F h1 T- X_________________________________________________________________________1 q8 A* t% n5 H1 b7 A; I1 P
+ W* @$ l, Q9 X6 V7 zMethod 07
" Y# w- [5 H. I, e=========
* [- s# C/ |" v+ G q; I1 U
6 z8 k* r9 h4 B: CMethod of detection of the WinICE handler in the int68h (V86)
( w& s3 j" t+ `- M$ U; t3 w, N" e4 Z' O# W6 b4 x* \: O
mov ah,43h
7 l2 x* i$ b5 V8 m0 ^4 p int 68h. i& |/ t& g" X; L- U
cmp ax,0F386h
' U$ G+ m; N. ^4 |3 G! a/ n jz SoftICE_Detected W, X- h5 n- l) A* [) _
) M& g% ?+ z) m& J, Y
3 s+ A$ A# J* v=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
' M1 ?( W8 C4 B' `# J s- p app like this:' F; S' \5 I' C' }0 I
- X) m" j$ |! `0 J0 p. \2 K3 X/ `! V
BPX exec_int if ax==68
& {5 x/ l( H' c& J (function called is located at byte ptr [ebp+1Dh] and client eip is% i& e5 Q# P0 q; G. Q# l! ]
located at [ebp+48h] for 32Bit apps)
0 g7 \9 O4 w/ x. o1 G1 r% ^2 f__________________________________________________________________________
( d. \( r* U3 Z* G% v7 H* z% J
3 C: D: i- C8 @8 D; s4 U; J! P9 N3 q
Method 08
, C$ ~" A: S8 U: p t8 Q=========" j; j9 ^" j6 s4 M
* b# J1 |1 x$ \+ d1 M! dIt is not a method of detection of SoftICE but a possibility to crash the3 |: G! q' a4 W. p( A# I4 ^3 K
system by intercepting int 01h and int 03h and redirecting them to another c; J( g; g+ M, K
routine.* n( W7 @' q* I6 b x2 M; v" c
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' f/ W% _& e5 i' O4 `9 o* @ h
to the new routine to execute (hangs computer...): s* f& u; H2 |- T; O5 m
* d# B, A& F8 E1 T* W4 b mov ah, 25h
' p- g' N: d* ~5 V( T mov al, Int_Number (01h or 03h)
4 C9 A' m2 ^8 L- Y3 o) C mov dx, offset New_Int_Routine
% u& X4 d! C- R7 H3 z3 n int 21h
4 N3 L, j% W- A! Z0 E6 ~8 k X; j$ x( r
" h9 T) F9 L& ]% A% Y5 ~__________________________________________________________________________
! i/ |/ E, ^4 i# L6 G: e( n
$ s+ x% Z$ P1 s9 I; l/ i* M/ EMethod 097 G9 \2 N; K, r2 N; D
=========
" v0 v* r, y: f0 Y5 X0 H
. i j8 l5 y( r. ~' N0 b, J' y6 IThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
( d' P, `: H8 h. \performed in ring0 (VxD or a ring3 app using the VxdCall).
+ ?( g# q* o" W7 J& U( R( Y9 jThe Get_DDB service is used to determine whether or not a VxD is installed
9 U. Y3 e2 H0 Jfor the specified device and returns a Device Description Block (in ecx) for
0 o5 {3 b H, L. E2 o- F* T) Q! vthat device if it is installed.# v# c: |+ z4 v) I) r+ C1 W
5 b# N7 s" p1 A% t. O mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) b. f; R$ b; p5 b4 P& ` mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 [6 V( D0 G% L: X! m3 l* Z VMMCall Get_DDB; d! A: e$ q5 `. t$ o, b& M
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
: x# C* s2 o" X0 q
* ?- w! Q7 {1 f* B( u: D8 D( INote as well that you can easily detect this method with SoftICE:
! F3 @$ m$ C; U* e bpx Get_DDB if ax==0202 || ax==7a5fh9 E" Q$ _* m r, W/ H
6 ?. l* e9 q- X__________________________________________________________________________0 Z& {$ }7 r$ K" l8 P
/ l2 G, ~5 a8 z Y$ R' ^8 w$ T
Method 10. P5 o5 u6 \5 _) e
=========
) M' k) C2 w* S0 r r& _& e3 [
* G+ T8 \/ _5 W: g: {=>Disable or clear breakpoints before using this feature. DO NOT trace with
6 l! O! p" F# E+ |8 g* ]. M X SoftICE while the option is enable!!
. ]8 d$ W$ F9 A" l1 U( a5 O) f
y1 u/ ?+ S, b8 V* @3 A6 o: mThis trick is very efficient:1 D) x& h( A5 m$ |, [0 U
by checking the Debug Registers, you can detect if SoftICE is loaded' z7 l& j9 [; `0 r
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- C! E! u7 ^, s9 Q' e
there are some memory breakpoints set (dr0 to dr3) simply by reading their0 j' i0 o& ^8 X2 n' n$ r; s0 [
value (in ring0 only). Values can be manipulated and or changed as well, W$ u V/ f1 F9 h4 S
(clearing BPMs for instance)9 S9 U2 d8 P# Y1 w* P. ?
( E: M! W' i% O: s0 X/ N8 e__________________________________________________________________________% G: G" U+ X. R; o" d* s3 [
2 _: F5 O' H/ S8 M, CMethod 11- M4 J; W/ V! ^ v/ h0 d
=========' d# _ ?! Q( I; Y9 Y2 i! |
, l9 l$ ~: ~4 I" l! jThis method is most known as 'MeltICE' because it has been freely distributed
- H0 |0 ~9 k! S. ~$ A! x$ H Lvia www.winfiles.com. However it was first used by NuMega people to allow6 A7 K y; i$ q( G
Symbol Loader to check if SoftICE was active or not (the code is located0 @' T+ m1 Z4 t' W' y2 g$ E
inside nmtrans.dll).( y; E: I5 {, H4 }& l
; _2 ?0 k& t S2 Q
The way it works is very simple: F' \4 k4 F) z7 i9 d
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
8 d8 ~4 N& I& B VWinNT) with the CreateFileA API.* B5 E) j$ I' w9 x7 _
! {" a W/ x8 E3 _4 V" k* SHere is a sample (checking for 'SICE'):
& t, N: r- I5 Q) h0 W
( ~0 B# W1 F8 g7 K/ q$ SBOOL IsSoftIce95Loaded()
3 n5 C8 y+ C) X; M3 q+ r{3 L' f: w9 Z) |$ h3 @
HANDLE hFile; # P4 N: x& s) W% C/ |
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,5 r* \( c9 L# g2 J- C; m& B" ^# j( T2 o
FILE_SHARE_READ | FILE_SHARE_WRITE,
8 }" g$ X9 G8 p( a7 w/ L8 I NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 s5 i0 ^ E* n" \8 e- U if( hFile != INVALID_HANDLE_VALUE )
$ W3 f2 R A7 t$ j) V {
% i( u: U0 m, w1 N CloseHandle(hFile);
2 i+ U9 j1 {" ^) Q* r return TRUE;: o+ \8 C! N3 p; h; t" u! U
}
) f J) n. | \- c return FALSE;1 T+ y+ q2 @8 S$ g) p
}3 K' m" n0 Z3 F M8 c* ]' N0 q4 Y
! A# a4 D/ B" T9 U* R. N" E6 r, UAlthough this trick calls the CreateFileA function, don't even expect to be E; O1 Q) D' b5 d
able to intercept it by installing a IFS hook: it will not work, no way!
( w/ [# y2 `# S4 Z1 W9 |+ _/ eIn fact, after the call to CreateFileA it will get through VWIN32 0x001F2 G( D7 ^$ z: V) a8 S- M* g) M8 v3 I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. Y# a; ~. H) E- z# V" q1 m/ T7 zand then browse the DDB list until it find the VxD and its DDB_Control_Proc
' C8 t( W% Q( D U: h) _4 xfield.
4 p! h( H) d C5 DIn fact, its purpose is not to load/unload VxDs but only to send a
; X& m4 A* c0 A% Z$ r3 K, sW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
" ]" n h6 W0 r) F. Lto the VxD Control_Dispatch proc (how the hell a shareware soft could try
: _' a) [4 \, L) r+ Mto load/unload a non-dynamically loadable driver such as SoftICE ;-).6 ~, H% D o! C2 q J x! d2 V
If the VxD is loaded, it will always clear eax and the Carry flag to allow
" U) n& q+ {6 a/ k( bits handle to be opened and then, will be detected.2 p( h) h5 Q! p+ _- N
You can check that simply by hooking Winice.exe control proc entry point
3 ]( K9 h5 E; W$ p$ |while running MeltICE., D* ^8 `" z* I% M* a9 I. Z' Y
# j, Y% p$ R8 H& H
+ W0 S; x3 L% O; B4 ~& y
00401067: push 00402025 ; \\.\SICE1 K9 t" H% b& D) m0 y* r
0040106C: call CreateFileA
$ G# ^; L* G4 S* H- T" R8 ^( H6 n 00401071: cmp eax,-001
& m$ Z# i2 e0 v; N: D 00401074: je 004010916 c3 Q+ ~% l1 k0 k9 {
& |8 s9 @4 c# d- y7 K
) }) X7 |2 l: P0 \% K( G
There could be hundreds of BPX you could use to detect this trick.! F6 o5 |- D' p0 v
-The most classical one is:% b+ K0 S' s, S4 B$ j5 _& L
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ E1 G7 O: U- m3 H7 `* @) W h *(esp->4+4)=='NTIC'" M2 \ H. ?' e# a, D
, d g& p7 x5 Z) t2 E8 c. v
-The most exotic ones (could be very slooooow :-(6 `+ k* ~6 S- }# A$ s
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
5 P8 ~8 D J! i# c1 {' ~ ;will break 3 times :-(: C) P, U, U, V
! r" C9 t; c9 ?/ U. d. }, M$ p0 Z
-or (a bit) faster:
6 a3 ~3 T& [% Y- j+ x6 u5 U BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 K: B, O% \7 V" z! O4 Y% v% c$ s+ C; u/ h/ S' ?" R# f
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) _" J7 u E$ z2 z' }3 m' p# V ;will break 3 times :-(
- ~# e3 V5 n/ J4 V8 m0 f$ E2 J
9 ]" {" c; B; p/ b& ~2 Z-Much faster:
1 Y1 ^9 _5 n4 C* k' A) m+ U6 I# c! n BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
. e) P! {. b/ r: [) L. g
% {& c! p! v- |6 r' q* `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
& e# G" G" R/ c- o3 Z% u" v/ }function to do the same job:
4 A4 h& d( Z2 l3 q
9 e1 r0 h6 ^& \! p push 00 ; OF_READ
4 o j' Q. T% x) v* Y4 U3 r: D mov eax,[00656634] ; '\\.\SICE',0' l, }7 r" A/ r( D2 P7 c- Z' z
push eax$ V9 D- {% M& h+ A/ N1 u+ J( z& O- h
call KERNEL32!_lopen `- |) _6 s- e1 \$ n- S9 \
inc eax4 T8 G1 D3 H$ K' I3 v* \3 V
jnz 00650589 ; detected7 G0 r6 y" ~2 |' M% u z' k2 ?
push 00 ; OF_READ
* w& P E5 I0 k. y2 B mov eax,[00656638] ; '\\.\SICE'
: v+ o: t% b' l7 ]* |) O push eax. @2 I) y2 d7 ?3 ~( V3 M8 C n
call KERNEL32!_lopen
/ p1 w. F2 v* L, M2 E P inc eax
4 v: C" A/ K3 `* q, [' r! x jz 006505ae ; not detected7 _. c& n+ M% Q. K
: B9 l3 h- O. q! c3 K) i% W- r+ J: V% I6 S
__________________________________________________________________________3 P, B$ T! E ~% q: ]
- \6 }( _- e: _% O% F, {Method 12" k6 L. n# c- b e
=========
8 D# N5 H2 j |8 J' N+ Y' l# J$ ]0 e! V8 r
This trick is similar to int41h/4fh Debugger installation check (code 057 o( w/ ]9 |. r5 O( ?; k* g
& 06) but very limited because it's only available for Win95/98 (not NT)- X2 c, W5 ^4 a! w: r: J2 T* s
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
9 ` L3 i9 Q6 ~4 K" m8 m& x7 R2 ^! m% |6 v
push 0000004fh ; function 4fh( K( g# e8 |( [2 w7 o
push 002a002ah ; high word specifies which VxD (VWIN32)3 o6 C+ f4 H; q* `
; low word specifies which service5 e: \- n! V- |: |
(VWIN32_Int41Dispatch)
8 ]" p# @4 a8 P, z2 R7 u; D( G call Kernel32!ORD_001 ; VxdCall
% O/ q% B4 o( r) d. e- ~ cmp ax, 0f386h ; magic number returned by system debuggers3 W& N1 @0 f# b- ]- k
jz SoftICE_detected
1 u4 f5 n% I* p2 ]4 i& @8 \8 `, q; ^
Here again, several ways to detect it:
" _5 J7 j1 J% f- h' W; o" f% E- v- O6 {: {# c. d3 A
BPINT 41 if ax==4f
% ~/ U c8 R- a+ n$ U; s
# y# _+ ~7 `8 N2 h BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; ]% e$ W8 }1 J9 s! V" C2 b
0 f2 ]+ F( p2 }+ |. x- U- s/ n BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A! P. X# v+ b) n. W
8 q. ~# R' |( a
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!& [* ^: R, H! i$ ^9 z: Z, L
* |1 W4 Z- u2 ~8 N7 ?% U5 }
__________________________________________________________________________8 e" i7 ^; y0 o% @
8 g+ A1 c7 ^ g9 p4 b4 w3 W1 D6 b3 |Method 13# }+ ]4 U n5 E, G
=========0 k }- C7 {: P0 I/ _) p
. \1 R% \. W0 TNot a real method of detection, but a good way to know if SoftICE is
; N" o2 g$ h! A5 t/ G, m1 zinstalled on a computer and to locate its installation directory.
9 [' B' ~' O# ^$ L+ G6 UIt is used by few softs which access the following registry keys (usually #2) :$ \( V' N7 `+ X# j* H! V- t
: Y: _+ f- `4 B. O) ?/ G" k) Q-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" N1 ]% X7 p& p. Z4 f/ h4 S\Uninstall\SoftICE5 u5 B) a+ D; ^4 H2 W
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE) R6 I& Y) w2 Q, W' i
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 ?" P6 f6 U* R' w
\App Paths\Loader32.Exe
1 }0 V* J4 T7 }; p9 L# H9 ]# o9 l
' s+ o6 i8 J4 B) C$ r
Note that some nasty apps could then erase all files from SoftICE directory
- J3 _. _% d1 l7 j(I faced that once :-(
" C! i6 \2 P% j' p$ R; `3 j! p
0 {; |/ h1 p% Z+ x* hUseful breakpoint to detect it:
9 r' d6 C3 M0 E3 T6 H$ @/ ?% C X) S0 o$ p
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'4 I) n. b3 T, m" A# f% ^' `
4 }% b6 V' a' x; ___________________________________________________________________________
- h$ h. w9 }. l# B- h% I$ w$ K& I& g9 l. E; |4 B/ `
0 ]: d8 K9 O7 N3 ~2 _- n/ I; s
Method 14
( E: g$ I/ Q; ]5 f4 d=========
6 i$ F; f/ H2 g" ?0 ~
4 g" S' x3 J0 |8 V Q) jA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
3 x* t' j/ d- i+ ?# L: l) Pis to determines whether a debugger is running on your system (ring0 only).
9 H" t' X7 |% t/ P5 V, C- I# i6 o: q+ U* A' ^
VMMCall Test_Debug_Installed& p5 K* B! u B
je not_installed
0 {6 s1 G9 E8 Q4 \) |( s A+ H4 f, Y3 q; k' d2 R+ ~: w: C* Q+ O; `
This service just checks a flag.1 E8 Z$ x3 p$ b, R
</PRE></TD></TR></TBODY></TABLE> |