<TABLE width=500>
2 R' j: b. @+ e3 H* F# {<TBODY>
- ?5 _4 B0 C$ C" D0 a, `<TR>
. k0 m" W4 u- n<TD><PRE>Method 01
6 R' C' v | t' ? |=========3 u) }4 a4 g( a" J' Q& G3 b5 V
8 R; \+ d3 ~5 A! r, P; ~
This method of detection of SoftICE (as well as the following one) is
5 T) v& z, L/ u6 X0 Fused by the majority of packers/encryptors found on Internet.
2 Z4 H% N' S2 G% @! t- }It seeks the signature of BoundsChecker in SoftICE8 v* q. [6 ?) \! P( R: o- C" \
4 y/ x, F: A% q s: q" O* | mov ebp, 04243484Bh ; 'BCHK'
% V4 z: P% f! b, u% P mov ax, 04h
# V& O) S V/ O' b9 j2 ?- W9 p, ~, l int 3
, a$ {" P' i) X$ |# C! ]1 M6 g cmp al,4
9 `6 n3 b+ l+ e% ]5 E: h jnz SoftICE_Detected4 A; j) H! |! j3 |( ^5 |
6 w- N7 C/ v' X: H3 |___________________________________________________________________________6 Y+ o* v' C. U9 @! u! x! O" q
2 a6 i$ Z6 D( dMethod 02
9 x2 k6 l3 l# a: d=========
, v0 p6 r1 q/ m8 Z4 Q( L" ~; I/ u. [1 q0 t# `
Still a method very much used (perhaps the most frequent one). It is used
1 ~# l) m4 j8 kto get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 Y$ M3 {" H) _5 X+ F
or execute SoftICE commands...- ^& K2 O1 H8 r1 }5 B
It is also used to crash SoftICE and to force it to execute any commands' O* ?- V* |" E
(HBOOT...) :-((
9 X& B5 H& q* s9 g/ G' y& }: }
' E8 f* s3 M! @ L2 a: C* q7 Q' [- K( aHere is a quick description:( w/ {7 G: ~: Z3 i
-AX = 0910h (Display string in SIce windows)
! W/ P' k( X+ R2 f1 x8 W8 p-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ `0 \+ ~* ~7 [2 P/ l4 M-AX = 0912h (Get breakpoint infos)
P* _: ]- Y7 y0 b; K1 \-AX = 0913h (Set Sice breakpoints); v" A/ o+ C8 u6 m
-AX = 0914h (Remove SIce breakoints)! @0 N$ i( H' i, \6 j) u8 [
: c" V( S5 C& ?Each time you'll meet this trick, you'll see:
8 }! b6 n. q+ w) `, X6 \7 ^-SI = 4647h$ ^! W" D. K( @: q. |
-DI = 4A4Dh4 c5 H( l3 M# P6 H3 U- s2 n5 l9 {
Which are the 'magic values' used by SoftIce.8 |& C* s5 A# ?- T7 [6 w0 `: T
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 K# U' F# l8 D" ~
4 I- @4 _- T+ `5 e; WHere is one example from the file "Haspinst.exe" which is the dongle HASP
% I6 V, Q* t* _Envelope utility use to protect DOS applications:7 ?/ i2 X( W4 n1 t, U
2 a9 s. w m2 }; M+ H7 y8 M
K- L/ {( r6 {: b* y2 x- S) ~' B4C19:0095 MOV AX,0911 ; execute command.! Q7 |8 S& G4 P/ ~! S6 L+ M
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below). A7 N$ `$ E; {9 M1 A
4C19:009A MOV SI,4647 ; 1st magic value.! C! y0 U, q4 `% T) R* t
4C19:009D MOV DI,4A4D ; 2nd magic value.4 {; F* @0 }. ^& O0 c0 _. M- r& z; ?$ ^
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' D& S' {; u# n5 U+ } y2 x) M4 h
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
# _. e" J/ t. u- |4C19:00A4 INC CX
, ]8 X' ?0 _" u% [6 c4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
& R* ^ |' w4 }, b; }/ x9 U3 u+ d3 G4C19:00A8 JB 0095 ; 6 different commands.5 |( _; _3 Y. K7 l
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
) k9 S& [3 j0 f) \% X. ~4C19:00AD MOV BX,SP ; Good_Guy go ahead :)7 S1 u% c# L& r
5 P' u6 j) Q& y6 S; {1 zThe program will execute 6 different SIce commands located at ds:dx, which
x. h( U4 n4 A( j/ N; V+ [are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# p N; n- A& r- @. I
' S2 { Y6 v8 @9 O7 @& @* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) B6 D6 a( @& Y5 ^___________________________________________________________________________$ U) }( N6 P! j- {4 I
b+ z# `, `2 c% i* U! x" f) x
3 a, w R d5 W9 D
Method 03% Q. U+ g) @0 [, w7 t+ {& F( O7 c
=========
* _- V# _: a) P" P6 a/ w% z8 B7 A* r- z$ f
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 _) U/ U D4 L+ T& B" }" V; n
(API Get entry point)/ m: Z8 O! q% B3 G& O+ H# M, Y
4 L9 `" P1 ^! t! U
' `" z* r: w7 \
xor di,di5 ?3 b/ O, u8 y6 `* F# @
mov es,di
/ o8 {7 O5 @1 Z: z7 h" s, q mov ax, 1684h Z" b4 D2 i# m, U" X- w
mov bx, 0202h ; VxD ID of winice
# t7 U, E6 c' V1 u, Z int 2Fh
7 B O) ?* L. m. C mov ax, es ; ES:DI -> VxD API entry point
1 L: F5 k9 H2 ]0 |1 d8 f) N; W T add ax, di4 I3 I- I8 `1 e- T; u, u z6 F9 q
test ax,ax4 }9 n- f6 O6 }1 @8 P% d
jnz SoftICE_Detected1 u+ [; w; ?9 g& M# y
1 v6 c+ a" b" B$ o___________________________________________________________________________
9 z3 V, m& X3 R
$ I4 ]+ @! o# V% Z* n& Y2 N" vMethod 04
! o+ l& X' _) o' W. k=========& @1 C1 ]4 ^. m0 Q8 X, k
! |0 F# L- N3 n" s, C
Method identical to the preceding one except that it seeks the ID of SoftICE C. g# a3 R: h& I& L2 E* l
GFX VxD.
% r# R' C) b0 S6 B6 E; U2 L& F, i0 Y9 c; D @/ \
xor di,di
5 e7 D3 K# I0 P/ [: w mov es,di4 a; l0 k; L& E
mov ax, 1684h
6 f, M0 b, f! K, e" r w" l mov bx, 7a5Fh ; VxD ID of SIWVID
0 g6 K5 s4 K) f8 {% r int 2fh
8 {7 H5 u, k% l mov ax, es ; ES:DI -> VxD API entry point
" W# @8 }9 y7 ^7 g6 T/ B9 m add ax, di
# C; {# M& i/ [5 f/ A. L8 ` test ax,ax4 A" y: B! O3 ~! M3 o. X
jnz SoftICE_Detected: c6 H2 F# A/ P9 t6 w4 X" P- J
2 X4 q4 m6 V/ F' X- v1 e- m
__________________________________________________________________________4 h; \$ x# c- V" \
6 W% @ J( [/ Y* z0 O
3 | |6 m* {% K# M/ v
Method 05 D8 x; }! l5 \3 b6 [
=========9 B" T& O% K; c' J. b* J* u
) K5 D& {. n5 S! {# c
Method seeking the 'magic number' 0F386h returned (in ax) by all system' F* P* l' B- X$ q, F
debugger. It calls the int 41h, function 4Fh.
" p9 F p0 D% ]7 q8 ?3 [( r8 H1 YThere are several alternatives. ( y4 ~# x) m/ k! d1 {
1 _/ y) n, d' o# p) P$ F
The following one is the simplest:
0 O" d% i+ D8 f$ R: G0 }
4 `; t" T9 J. m1 e4 S- i mov ax,4fh5 `/ q6 y6 `! a
int 41h
: o" W. j1 P- v: S1 U( | cmp ax, 0F386, U3 p. U; _- i2 R, c% r/ H
jz SoftICE_detected
h% A7 x1 R9 ^1 r" h0 |. y3 ?, n6 f% @$ p$ d% i
: }0 a' o ^7 F6 { ANext method as well as the following one are 2 examples from Stone's
* |+ L; a+ N7 X0 X! M% @"stn-wid.zip" (www.cracking.net):' Y7 j2 J3 p+ w. W6 `7 z
$ F' G7 Q9 K' W. b
mov bx, cs9 {. h% f" [9 D2 n) W: m
lea dx, int41handler2
. ^' f% O, T, l' @: i( V" r xchg dx, es:[41h*4]
. [+ x7 s s1 ~: o5 y$ D+ k, {" X0 a+ [% G xchg bx, es:[41h*4+2]
1 g9 N4 i8 ?9 n$ p% V0 _* z( A mov ax,4fh
" O6 t/ |' {: }- H* ] r, T. q' w9 t int 41h
# t5 d6 F6 z4 O- u; p+ S xchg dx, es:[41h*4]0 [$ U8 g; |: N9 e4 ?% O! Q/ e
xchg bx, es:[41h*4+2]
1 c4 _3 a1 j/ E6 P/ T cmp ax, 0f386h
" F0 N, Q" Y5 ?" c jz SoftICE_detected4 z9 [ Z' k" P3 m
4 v; b6 X4 S' y1 {int41handler2 PROC( N G* Z( A4 e* A4 x. K2 g$ @4 t
iret
% Z6 ~6 Z% j( Z; p3 ]int41handler2 ENDP
' a5 G2 [# E, K; D; t. Z" X9 v: M5 v2 t0 f: s C' [/ t6 A) W6 J6 u4 [
2 ^& X4 F) e/ C3 I' f0 E
_________________________________________________________________________
( X% ]7 Z2 ^0 k# k( O7 I" C' K1 [( B- O+ t
; Z" D% N" h6 ?5 ]Method 06$ S9 l( J) n+ L
=========
1 [) d5 G$ M1 Z5 w. h! K6 G: q+ V: K; K
n8 {5 M4 x) {( X9 z0 p2nd method similar to the preceding one but more difficult to detect:
: `# k/ U e' d- N3 s7 ?5 W$ u D; \+ E% G* ^9 ^5 q0 f) N# {1 H
; }/ y( Q5 I8 ^% B5 vint41handler PROC
' P( t! d: o( R1 b7 U& ^ mov cl,al, k. t+ A ?7 N- P' n! V( H O
iret
2 |! V1 m8 B, o& r& H2 N/ ]3 m, Gint41handler ENDP$ X8 M9 m1 r: E- ~) D6 B3 @- N9 R
; x* m4 D4 [$ T
/ x+ r9 ]0 n! Q$ ?+ k xor ax,ax" E; q" f: B/ h7 e" S
mov es,ax1 x1 y" }* Y; M' M
mov bx, cs
# i* _$ j& x: Y4 g3 V1 J lea dx, int41handler+ G5 K: I o$ l7 y2 L
xchg dx, es:[41h*4]
' I7 [3 c* i) F" ^! W. @ xchg bx, es:[41h*4+2]
1 z7 \8 z# s# ~* h" d# O in al, 40h& M* [* H, E$ L8 v
xor cx,cx, c% w$ N U+ z4 V" O. e
int 41h7 |* i3 O1 x7 w( A+ O
xchg dx, es:[41h*4]$ n4 Z0 O3 Y d
xchg bx, es:[41h*4+2]
& G3 b9 `! h& C3 Q cmp cl,al- j" t2 M" U& K0 r) C/ W6 V/ q
jnz SoftICE_detected
+ E, q/ F/ l1 |& q4 O
7 n; P( Z' _' h_________________________________________________________________________
, a5 c, ~ B2 X$ N/ {1 R1 ~
: K8 V( U! P2 c& v" s7 _) q2 H& U0 GMethod 07# z; }7 S% C0 [1 o
=========8 d8 F1 |0 E o/ X; m1 P7 v# P
- N" E" P6 r$ n; R LMethod of detection of the WinICE handler in the int68h (V86)% A" L3 i i9 `. u; b
. X: n7 x% Z& W( O mov ah,43h; J/ f2 G1 N" S" l! p6 Q; _
int 68h
1 Z8 e3 K. w3 ^( |! X cmp ax,0F386h# ?5 z. O. \6 g
jz SoftICE_Detected
Z. z) f1 r- g& C! b( r! u* `2 D5 {3 U+ ^" R
. v% ^& L3 T9 i' y: D0 f3 S$ U* j
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
# Z; K$ d: u' \5 C4 ^ K1 q+ l app like this:
- T5 V3 [/ I f- l3 `0 _2 G2 X' H* V- Y4 ^. b6 D. j
BPX exec_int if ax==68- I: @/ H* H1 G9 u
(function called is located at byte ptr [ebp+1Dh] and client eip is/ \3 p6 f( @! v/ }% C
located at [ebp+48h] for 32Bit apps)
) f, y4 R6 L1 Z1 B9 l4 g__________________________________________________________________________8 f0 @5 H' K( Y; a" R$ V
1 S0 I, I. y j' N: B+ B( Z2 y8 O
. h6 y( `8 K% p# t
Method 08
, U/ \' k j( H: _/ r6 o4 P( N5 l! @=========
( `7 L* @% B: w0 J2 p, I( F4 h s' R% z/ o( v* R4 p G" n3 D
It is not a method of detection of SoftICE but a possibility to crash the
$ f/ `" L; W5 S6 B( N9 a$ Lsystem by intercepting int 01h and int 03h and redirecting them to another
4 }$ g, S, O* [3 ^routine.# L: k2 b- M" a
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( C+ f) b" b1 r, K" Q( `4 V) \# fto the new routine to execute (hangs computer...)8 S% e9 g6 i# m! D
+ A+ V) D2 z) W! q U. E7 s mov ah, 25h9 z$ P& e1 K3 h
mov al, Int_Number (01h or 03h)5 p3 l2 ^- n2 P, \5 i1 ]6 c
mov dx, offset New_Int_Routine( P, [' O/ B% l9 c
int 21h. `# t5 n! R2 F+ _! f. x
) f# Q3 H8 A6 n8 k! j1 G+ j- \5 O, u__________________________________________________________________________; b' q+ S) y: X/ J4 y% Y" {# I
: c) ^* c8 o6 S1 u. i2 g0 |Method 09
. a' T4 n2 n# U=========
) w4 q8 _# W- c' ~) ~' L% x! Y3 G+ g: s/ u% X6 o: w; R# D5 y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ A/ v2 o8 K6 J" ?) a1 Cperformed in ring0 (VxD or a ring3 app using the VxdCall).% s) g& k! j" \6 |
The Get_DDB service is used to determine whether or not a VxD is installed4 R: x; n8 C: d7 ~
for the specified device and returns a Device Description Block (in ecx) for
% f1 f9 P4 Y8 r4 S, m& q# \' v+ M0 {that device if it is installed.( g. V$ c1 {8 n+ g
' e# a' x4 ]; q, x6 Z
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- u( e3 M! O% J8 t* G; r5 I* x mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-): }# g1 Q4 e" R1 ?, s' Z
VMMCall Get_DDB
4 Z, J* f% w; t! K% s8 Q' N mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: Q/ j6 s$ }+ `$ c0 v1 G$ z' i- m2 p
|1 v: E8 N2 I- N$ b4 ]
Note as well that you can easily detect this method with SoftICE:
7 n I) W% Y9 H bpx Get_DDB if ax==0202 || ax==7a5fh2 P6 r, ^1 m. v( h! U9 z/ P! A
' v, `! Y& o9 Z1 B' V) ~/ v__________________________________________________________________________
3 N, o% o! j; B/ d" F% M9 c% \" _; ]
Method 10
1 Q1 M" @+ N/ z+ f; z9 W- l=========- G! v# t: B( m3 v# s5 w6 }- z$ a
y9 B/ u3 V2 g3 H3 @; f9 S
=>Disable or clear breakpoints before using this feature. DO NOT trace with4 H; I& p \( g: _! L1 y7 w
SoftICE while the option is enable!!: f- D8 w! [6 X
( p2 N* M* T& t; Q
This trick is very efficient:, N, v5 i! {: Y @$ [
by checking the Debug Registers, you can detect if SoftICE is loaded
' K$ G# l! U2 d5 H& f(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* y, J. N0 S& {5 C3 [8 U+ J4 Cthere are some memory breakpoints set (dr0 to dr3) simply by reading their4 s; w2 N) V' [4 d) H
value (in ring0 only). Values can be manipulated and or changed as well3 o- [# c! d4 R% }, O6 e
(clearing BPMs for instance)
+ q: o5 \9 ?- a4 h0 ~5 W. J& _! ?9 ^# c( l2 L: M8 `1 a
__________________________________________________________________________
/ X ]3 |# p+ I9 a/ _5 {
5 |: Q0 g# g) k$ m1 mMethod 11( X+ l! ^( F5 f
=========
6 }5 ]: [/ I; q! n3 {$ A5 I: A, c: m3 i/ [+ A2 B
This method is most known as 'MeltICE' because it has been freely distributed! }; n9 H* A6 ?' j3 ~& t F
via www.winfiles.com. However it was first used by NuMega people to allow
% b' m/ v' [$ p* ~( _Symbol Loader to check if SoftICE was active or not (the code is located
1 |; h- ~0 n( a2 ]4 \1 A6 [; \( b$ x- X5 Sinside nmtrans.dll).
. O9 M, W8 b0 H+ {/ P# S5 j @2 B$ Y. ^; F* F; Z) r
The way it works is very simple:
) q9 ?* u; }$ I3 p( r4 yIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ u; X3 I; Z# \; ?0 t, P* y9 L
WinNT) with the CreateFileA API.
& N" j# h v3 D1 l- [4 y' m
9 e8 R& x( M& o% T% mHere is a sample (checking for 'SICE'):
8 h8 S: F0 m! e
/ m$ {: d$ e( B, m3 SBOOL IsSoftIce95Loaded()1 v+ k2 Y) i! {4 }, a/ G3 f2 j
{4 e) ~- ]; F( F3 C8 r
HANDLE hFile; ; f% U1 m4 H, ]! u- N
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,! w4 _& G4 N# [( C: U& d- {7 N7 `
FILE_SHARE_READ | FILE_SHARE_WRITE,+ x- T" y/ R. e. r$ w* O
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
, |! U: E# T c6 x$ i# W ~ if( hFile != INVALID_HANDLE_VALUE )
# x/ {/ d( x1 Q$ ]8 ] {3 m0 H3 u4 j5 k- v0 E. g7 S& q
CloseHandle(hFile);' ~' |* |' i* K8 ^
return TRUE;) s0 S+ E# ~, m A0 L3 y6 _
}, j9 x" A, G" z, k/ U& ~3 \' J
return FALSE;
* [ v9 q" }( G}5 s, y, g, [9 I8 B( o
7 ^' j& f- R" ?; z& X# z1 `
Although this trick calls the CreateFileA function, don't even expect to be
3 U' R' J8 T9 h$ n# I: t( W9 O; Qable to intercept it by installing a IFS hook: it will not work, no way!
( g2 ?, U6 `& e& O) k; GIn fact, after the call to CreateFileA it will get through VWIN32 0x001F9 \! w Q# Q! F, @6 A" I+ l
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ ?% a6 o, L/ A! w5 p: rand then browse the DDB list until it find the VxD and its DDB_Control_Proc
& D3 e; j6 S" [+ r5 v: k8 J M* ~field.6 b3 | k4 m9 O8 ]9 z4 i
In fact, its purpose is not to load/unload VxDs but only to send a , z, \/ [8 g% C D% J
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) H" a+ q; `' l7 A0 B* `
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
& r* ?) n2 j4 f' O- Q5 E/ ~to load/unload a non-dynamically loadable driver such as SoftICE ;-).3 u( g n) w; g3 G; k: h
If the VxD is loaded, it will always clear eax and the Carry flag to allow) T* W) ^2 M$ l4 ]+ h
its handle to be opened and then, will be detected.
+ j; m$ \' p# Q1 nYou can check that simply by hooking Winice.exe control proc entry point. ~* q- w4 ]8 w' d( e8 T5 A4 ]. O
while running MeltICE.5 S' N3 L1 e; m$ @8 K' }8 U' t
3 x+ o' {& ?2 W4 j4 ]1 r4 I* r
- V7 }) |/ Y, ]. B, b. ?/ z! q$ V 00401067: push 00402025 ; \\.\SICE ]9 p& F9 h* e4 I# t' k7 g
0040106C: call CreateFileA
$ a2 h1 _. p7 _ 00401071: cmp eax,-001
, G g9 q7 w# m3 L 00401074: je 00401091
' ^) a( I( s% ?. z1 h2 r# V3 z. r- y3 A9 b9 d. ]! r2 l
* T. ~6 ]( k" k. s4 ]* GThere could be hundreds of BPX you could use to detect this trick.
2 N1 U* p9 f, L. `1 O-The most classical one is: m% }6 V( }; S' n
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 ?3 A, c2 W2 |# |% E( ?; J& c) Y/ Z
*(esp->4+4)=='NTIC'2 y1 U: `+ H' ^) t! Q# s0 v6 a: o J
3 _5 L k1 {; {% X-The most exotic ones (could be very slooooow :-(# |* h% Q9 M( Y+ t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' y/ E1 k% q0 Y8 h ;will break 3 times :-(
5 P2 F5 \1 p# C, e4 {/ z1 M' D2 |" o( T1 M
-or (a bit) faster:
; ~. f( C' ?" ~! F3 S8 c$ f BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 E) L) U2 g& p4 _/ I; @- J3 X6 u# ]& [
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 V/ w o/ _5 S8 }7 N ;will break 3 times :-(- a. |' P7 A$ ~6 _! f
/ r0 |# H: }: C+ f! u7 R3 L+ O, ?. ?
-Much faster: [+ h1 T6 T: x/ [9 f/ z
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
; ^* D/ i# P" T6 O3 n" z. x% U1 |; M: S% @* \+ W# ~* p
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 ]& ^" P- _, u
function to do the same job:9 B. r# _3 M# h; R) e1 B' n
$ [1 \" s) ^2 ] push 00 ; OF_READ
4 L2 v/ y F- w# H- Q7 w mov eax,[00656634] ; '\\.\SICE',07 G* u0 o$ B3 C
push eax9 _. T9 c" G& ~2 P' q# s0 W
call KERNEL32!_lopen
2 C% X: e! T- C3 @# i# s5 T! V inc eax7 r4 k, T- q5 P& f! a d2 M0 q& N
jnz 00650589 ; detected
9 L0 i1 A0 P+ a push 00 ; OF_READ
$ `. b& x3 S \0 K; X& k6 S mov eax,[00656638] ; '\\.\SICE'
$ z V! W- {* d+ \4 g, Y6 l push eax
+ _! Z7 @- [6 M; k/ w. A call KERNEL32!_lopen* D4 @+ F" W6 Z6 C, w2 t/ o. e7 w
inc eax
; r) S' n. u6 h# m jz 006505ae ; not detected
, Y/ s, p* P. V; [, ~( W
- s# d m* ~; A2 @, m& L- e- O0 O, E+ C! b! e$ @- d
__________________________________________________________________________
& M# [ o5 f* p* j0 n7 M+ v
: ?% B! _# \4 k$ J( b8 `' ZMethod 12
; X' \& Q7 U V# t- {& N _=========
9 a# q. X W' B, a; |8 d( N1 `7 V; S! u5 M; |0 r- U
This trick is similar to int41h/4fh Debugger installation check (code 05- _2 |, N, |+ a) G2 N; v) ]; I4 n
& 06) but very limited because it's only available for Win95/98 (not NT)
1 J4 J A7 Q" I' ]' j% fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! T3 X, @9 p$ H# t9 W# S
5 ?9 |. |1 S& H4 j1 E2 r( [3 w: t
push 0000004fh ; function 4fh
8 K& v) z# I7 B3 k push 002a002ah ; high word specifies which VxD (VWIN32)
# q( _5 H" l7 c! b* I, S. X ; low word specifies which service
% u$ F/ [& x/ W. R (VWIN32_Int41Dispatch)
* g% P5 l3 X" K |; E call Kernel32!ORD_001 ; VxdCall
, a- ~9 z3 ^" w' p cmp ax, 0f386h ; magic number returned by system debuggers9 f8 n1 x9 \. H- d m
jz SoftICE_detected
; C1 \+ J) W6 R' T
5 V3 R* O. G9 G, o: c6 x* u9 C* ~) `Here again, several ways to detect it:: |+ v. N$ A: K5 A1 Z
0 g% O: |4 w1 ~1 I: k
BPINT 41 if ax==4f
* h1 C/ x4 R6 Z) E8 m3 O- A8 E6 ^" G3 \* j# A
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one& J% c. g: D- e. _
7 {& {, `' ^7 X/ O0 X) [ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: U/ u% \0 x) J1 ^ f m2 ^
) E" t5 T# j) G8 _& ^ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ `6 E; p2 G* R* k9 g, M
7 x E" b+ e/ Q/ ~. s__________________________________________________________________________
, h2 t9 Z# p2 N5 p0 g) D% \ |5 U$ ?, k( W8 T! r
Method 13+ U0 c$ ~% a! I1 h/ T" f
=========
# T( x3 [" S+ K" ~. N* C& X6 [2 A! q( Q/ t5 m0 F" ~
Not a real method of detection, but a good way to know if SoftICE is; ^1 b, h1 [( h) ?7 w/ L7 ?0 x
installed on a computer and to locate its installation directory.8 v# i/ u0 j( a% ?/ `" S9 N
It is used by few softs which access the following registry keys (usually #2) :
# W. z8 ] z+ r( @( Q- ] h O) Q5 v7 ?5 N4 t @# H( \5 h0 Z8 F
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" E% }' q4 @4 Q5 T; u# b- O1 E! K\Uninstall\SoftICE
$ A0 D! c$ T+ @% {& E$ w-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 s5 ?2 {, M7 C9 Y, {4 p
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* H3 a% @9 [* J1 b1 ?- a
\App Paths\Loader32.Exe: M9 a3 p& X! J6 O' G
y0 K" Z$ }( w9 i2 G* B
( E3 ^+ U2 i$ C2 hNote that some nasty apps could then erase all files from SoftICE directory
& ^. A$ ^# T) Q3 Z; A& _& V0 z- ?" i(I faced that once :-(
( K) x/ Q$ M) b+ B. W6 S& U o5 s
Useful breakpoint to detect it:+ d- R! }' u- N8 a# X% V
( {' h; N: g7 @5 a BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
, V( C3 p s7 p: F8 _2 |4 g5 V: }8 k+ }6 V
__________________________________________________________________________
( v7 `. m, {' f3 \; N6 a; l4 L7 n( i0 Q1 L5 y
! @7 G; r" |* }Method 14
! [* ~4 Q: [9 Q+ `7 {9 j5 L+ y=========
7 |, f; ^) F) s g% {( l; ?$ {3 f2 j
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
; a3 G+ \3 |- Uis to determines whether a debugger is running on your system (ring0 only).
3 A! C* d3 A: Q7 u4 j
. S0 U7 @: [! G, G" P# e VMMCall Test_Debug_Installed
; J1 [4 ]4 V6 s& P. a& n3 @9 N+ f7 ? je not_installed
+ J2 h& k( }; A/ P
5 f! T4 S( m+ dThis service just checks a flag.# [" }- j5 W1 \# b" _
</PRE></TD></TR></TBODY></TABLE> |