<TABLE width=500>( V* z# @9 j6 M6 a/ U
<TBODY>. s3 i2 O' m$ H- p; ~3 n" w
<TR>
0 l* K" }/ _9 y- c: @9 c<TD><PRE>Method 01
) {6 {! q) N& R- G5 M=========/ X0 k4 [( Z4 r/ S6 q e; X
; j. N. V- o, e& A
This method of detection of SoftICE (as well as the following one) is
' W/ N! g* G( Z: \5 Z7 Xused by the majority of packers/encryptors found on Internet.
& S" `5 Z- R' G4 O+ k& tIt seeks the signature of BoundsChecker in SoftICE- M( P* P ]' z1 x* x, ]5 |% \
1 x' \5 W4 N- K mov ebp, 04243484Bh ; 'BCHK'
: u% J$ Y3 q* E; H mov ax, 04h' _0 _: {% \* }( N+ j* k
int 3
$ I) B1 o. f# P& ]1 S, ` cmp al,4
; r% q( t. D3 _( B; s jnz SoftICE_Detected
* `1 d, R8 h% O# [4 |9 {! v& }/ i H4 B) |- [ d: t- |6 U- f6 f: f
___________________________________________________________________________2 i' W0 p3 q \. T
, k8 H# r8 b1 M2 L% {. dMethod 02; H7 Q: c f, K+ d- S4 E
=========
7 a3 S5 k) |& |
7 P7 _* J% q8 m: D2 i' v8 zStill a method very much used (perhaps the most frequent one). It is used+ |) H3 l; K% ~& |& R
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. b* f4 I3 p) P5 nor execute SoftICE commands...( w' e9 O5 r5 f
It is also used to crash SoftICE and to force it to execute any commands
+ C4 E/ Z. P! ~5 B2 p" R(HBOOT...) :-((
+ U# D4 m: A' u Y. r7 n$ Q5 a$ c! H- j3 g- I* g! s
Here is a quick description:
' f8 m- u) v6 E, Q) S" E9 ]. K-AX = 0910h (Display string in SIce windows)
- K8 e# A, N" ]0 X% [& t' n-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)! o- c3 a2 N; x% u2 K- ~, i
-AX = 0912h (Get breakpoint infos)3 T: f' n6 w( E q4 H5 v
-AX = 0913h (Set Sice breakpoints)) s. d) g( x' Y V6 G* o% I8 i
-AX = 0914h (Remove SIce breakoints)1 G; T& e8 Q5 ~6 r
. v& e0 h& v: ^, p* F
Each time you'll meet this trick, you'll see:
7 Y( c! n! V6 | r8 t-SI = 4647h
9 a% V# B2 Y8 B-DI = 4A4Dh( c7 |+ h! U7 ]2 M$ o
Which are the 'magic values' used by SoftIce. v( X Z/ R9 h* ]$ L" G# r) l
For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ ]' ^" [; A( T: K
% X; r+ |" p; P' j- hHere is one example from the file "Haspinst.exe" which is the dongle HASP
) l( h2 P7 P9 v+ v0 N$ R- JEnvelope utility use to protect DOS applications:
% V5 I/ ?/ f+ T; i9 _# c7 o. f# C2 J
A$ L+ C& q% ?3 p. j# T; k4C19:0095 MOV AX,0911 ; execute command.9 W9 P6 l: x- w
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).5 x z! L5 Q* \& X% A" Q# Y
4C19:009A MOV SI,4647 ; 1st magic value." T; Z9 ~9 q2 T1 z* C3 p/ V
4C19:009D MOV DI,4A4D ; 2nd magic value.5 S% ], C$ S5 z! q' y, O
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)! _! X3 H7 D. `( ?* Q9 t! B
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute8 O+ W# O5 n' f8 W5 t) q, Q
4C19:00A4 INC CX
, U2 x% r( n3 i4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' u" z5 i* F! _- ?
4C19:00A8 JB 0095 ; 6 different commands.+ l, ?2 I: B- b4 R% Q: J* L
4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 O* F* l, x+ @. s0 L
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; p# u" p/ r& Z) ]9 w, G
! t" ~ |0 F! Q/ @5 D6 GThe program will execute 6 different SIce commands located at ds:dx, which
4 _" j" c3 u7 J! c2 r7 `9 ~- ?* ^9 Sare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 l B4 \% @1 o. i' x
# ~% ?' w6 A- K+ S! F* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* i$ R3 U- R- Y& w# j$ C, y. A, n___________________________________________________________________________/ W! j/ A9 P3 t
- q4 L0 R3 R5 C0 t0 K* a
9 B I2 }' r1 U: @' i9 o6 x2 `) @. b
Method 03# T: m" O! w s a; _7 j5 v
=========7 N% q$ o8 i* f7 H% ], d
# L& K0 b% U4 RLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
; U ?" u2 v( ?4 x% h) E(API Get entry point)
1 v* a; g, q$ @9 S; }6 b 8 W5 ?( r/ h) f
0 E, \$ o+ \1 O, a, }6 ]
xor di,di1 p5 J7 l* B7 V
mov es,di
, n7 [3 {8 w3 x9 |/ U mov ax, 1684h 1 N$ z6 p9 _4 u. _4 d' q
mov bx, 0202h ; VxD ID of winice8 e- @/ v3 ] z0 S' g( j# Z- m
int 2Fh
$ u! g/ ]7 z2 w& z6 l mov ax, es ; ES:DI -> VxD API entry point T- T( K# P: X: s
add ax, di( G1 |) q2 W& z9 p: ^
test ax,ax) Q4 N1 O% ]5 V. m6 _2 P# P! H/ L: v
jnz SoftICE_Detected% s2 B0 v- u: e7 j
( o: e$ B3 Z* a9 o___________________________________________________________________________
6 Y; z2 E* x2 P3 _
4 i5 q- s: f# |7 o$ A) _Method 04
* t+ D! C9 Z* D6 p: g. @# v6 M8 z=========5 Y7 B7 k2 Z2 Q$ G4 i; a
( M; D. L5 P% x: n/ }% f6 V# z E: a
Method identical to the preceding one except that it seeks the ID of SoftICE- J" h1 L7 s& X( w: i' b
GFX VxD.+ V! y2 M! N, a& V \- F
% D7 g2 n0 A8 \ Y xor di,di' L4 M# P( F$ X3 u; {
mov es,di
1 }* J) @0 M! u, ] mov ax, 1684h
! m( ~" t: ^, m; U) H3 D9 b mov bx, 7a5Fh ; VxD ID of SIWVID
/ T5 I% a! V* m7 Q int 2fh4 w! X8 ~/ q3 J( u: v4 p5 H8 _$ H
mov ax, es ; ES:DI -> VxD API entry point' j( _6 S% m8 K% x+ q4 j
add ax, di$ z5 `4 x7 _; Q9 N- S: d" V
test ax,ax
7 s% Y; l/ k9 d0 E6 P jnz SoftICE_Detected
! {2 H5 u2 t2 l% k0 ?5 [, O
- `1 F) D8 z. q2 o, g6 H( m7 ?3 R__________________________________________________________________________$ H% R* X0 c. f: H' E f, G
9 u8 L7 w% s E- i. x4 v U2 `, S! ]% l1 h: a) r- C
Method 05
6 [1 ?. e; l. W, S- D=========( z) R, _. m# J& Y" {2 r! L
6 `1 N/ M" ], a# D) x' nMethod seeking the 'magic number' 0F386h returned (in ax) by all system4 t4 a! e1 D: _1 z
debugger. It calls the int 41h, function 4Fh.
5 W8 k- s" X8 r8 k2 g9 P; EThere are several alternatives. 6 I' W) c* r3 @3 ?
0 G4 I+ _: Q. c9 g' YThe following one is the simplest:* c0 {8 X; n+ [. W- n s
8 R7 o+ D. b2 W) M% M) k) p mov ax,4fh U& [* o ?# s
int 41h5 R! z8 M% a5 U2 A7 I
cmp ax, 0F386
6 @6 s/ S7 m- l( g2 g% T5 U jz SoftICE_detected
f4 y' u0 @% f* C3 E: b( `3 b' U& c+ D& L
9 b; v" R2 d* p$ X' O
Next method as well as the following one are 2 examples from Stone's # }6 V8 ?1 `& W& h7 [% t7 s
"stn-wid.zip" (www.cracking.net):
' }- n6 W4 O N6 G
( n. i" Y1 a$ z/ _1 w# R& W mov bx, cs
& J2 Y# j. O% D* D. v9 E5 V lea dx, int41handler2% r! ` l& a5 @5 v$ h
xchg dx, es:[41h*4]( z' J& W5 k; M# {* B
xchg bx, es:[41h*4+2]* b' o' S# N5 \4 J
mov ax,4fh; M/ ~% J# P- h. p, ^7 u
int 41h, P, o: q6 @& n, G( f* p
xchg dx, es:[41h*4]5 u, p. M% m% J
xchg bx, es:[41h*4+2]
. q0 H# d+ r; H* [2 Q$ P. k0 D cmp ax, 0f386h# t- b) n. j- {0 a A4 w" L7 P1 i
jz SoftICE_detected& D8 C* N$ z* W% h% M! ]* }3 C& y
( A( _. q) x; x4 R$ U1 F" Oint41handler2 PROC
4 C- Z [( I ?+ g$ ]7 g) U5 V% N iret @ j2 G- w3 p2 j2 W# [
int41handler2 ENDP
4 C5 `8 Z" n" y" O+ Y5 ~, S) D$ L8 A1 N* c' O
% x! Q6 E9 `4 ]% F) L% j1 m% \( k_________________________________________________________________________
% }1 |6 m+ ]2 F/ P9 r! F4 O& H9 j5 W. K2 a
* C4 c! ]% m% k9 l6 `
Method 063 B; o6 ~8 O E6 O$ J, n! W
=========% @( X& P' K' d, Q
6 H. P4 V Y+ q/ T0 X7 T* ]. X) E0 a* ~- B$ b5 Z
2nd method similar to the preceding one but more difficult to detect:
8 i7 o5 U0 U1 h+ G
4 w- l- a2 ^; t- `( |! G/ u
w- i |9 y3 \0 r3 mint41handler PROC
9 o2 M! J( b. X, d, h mov cl,al
. K$ ~) s( n0 Z7 A- D9 I iret
4 f; [4 r% d! Bint41handler ENDP& B1 b- H: r+ v" H) k
- B& a) M" O) v0 Y, r! o" [
1 J; X& I6 Z! H' g: P2 ?1 w' Z, n xor ax,ax
9 M4 H- V! M3 N* Q3 P mov es,ax
, M6 b7 ]( r4 w! c0 V/ D mov bx, cs
/ _7 B! j. i# j8 K1 h lea dx, int41handler
: H# W0 V+ a; M xchg dx, es:[41h*4]9 z# e& E! S$ b3 V3 f
xchg bx, es:[41h*4+2] ]& E$ X2 _$ a7 K$ F6 [$ m Y
in al, 40h3 A2 M% N/ r; S1 t% g
xor cx,cx- ]+ Q9 o1 e+ b" i2 X
int 41h* Z. z1 y* c1 ]$ Y! L3 @* x: z t
xchg dx, es:[41h*4]: y6 i, U3 b8 h
xchg bx, es:[41h*4+2]' K( U& C) P& ?7 V
cmp cl,al! G8 w$ O# t# G* x- o3 O. P
jnz SoftICE_detected3 L8 w2 J$ C/ D% {/ m2 S& q' Z
- k$ O. T: Y: J4 g- s+ m
_________________________________________________________________________& i! Y+ l/ F) W* ]- G
( Z S3 S9 [8 S/ b& j, p- H
Method 07
9 p8 l; ~4 u& P9 |" t0 a& \1 T0 Q=========
/ o z$ M' d3 e1 n- D5 m
8 E8 c. k; ^) }$ ~Method of detection of the WinICE handler in the int68h (V86). _- E) j. f9 S$ F9 {, J2 }' S
" e/ s" \, T+ z mov ah,43h
9 P# q8 K# W6 G/ m int 68h, k4 U$ G5 t2 x
cmp ax,0F386h
2 l( B( n% s9 Q' ]! X jz SoftICE_Detected- I: b3 a* n& K
' Y8 p7 l# H/ Q. g
. X7 |/ j0 Z/ M
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 j0 n) G7 r1 ]9 V! j3 A" y
app like this:
$ C }% e% A. U2 ~* C8 L' S( `7 G" x! B# ], E# f U
BPX exec_int if ax==684 i: O& n3 n. h' \- w+ D6 r2 P
(function called is located at byte ptr [ebp+1Dh] and client eip is5 m. C5 q$ j% Y( K) K& C+ j
located at [ebp+48h] for 32Bit apps)- t0 ^- p5 d( u* Z' Q
__________________________________________________________________________8 [6 t9 ?1 T7 q9 U% u+ w0 F
, u- D, ~& N6 ]8 Y7 {
' C# j# ^* S$ I: n. P* FMethod 08. z' e9 n( X0 u9 L8 h+ A
=========+ B4 z: ~' q# U7 B1 x; y; O
, ^, A7 `) V7 z6 R- n
It is not a method of detection of SoftICE but a possibility to crash the
* t+ B( L5 X! }+ ]2 @( i, ~system by intercepting int 01h and int 03h and redirecting them to another
8 _4 w. T7 W% x7 P# Y) _! ?routine./ g) U2 `4 k% F
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. N1 r" B, {0 x9 Y- A
to the new routine to execute (hangs computer...)$ D, H* V1 I( U) \6 A. p, T
& b1 M7 d! K) o$ V" T3 i
mov ah, 25h
7 @: x. Z6 E; P mov al, Int_Number (01h or 03h)8 E) A3 x) ?" Q, i0 S
mov dx, offset New_Int_Routine2 g) i8 R% {: T3 u
int 21h6 U6 R3 x( j Q4 b6 z
- h: @. n; K* X4 E__________________________________________________________________________
6 Y4 Z. w1 f) J- y/ D; j+ c: F/ b( z, M2 K
Method 09
% f# l: y+ w8 Q& [# }* C9 |8 V; }=========# s7 M3 p9 @! X1 z3 Y2 @
2 r/ G g/ O$ i+ h' M' ^# ~7 CThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 ^% H# X6 V3 K2 A: r, s5 E/ P8 H
performed in ring0 (VxD or a ring3 app using the VxdCall)., z( q6 E! I; Y& ?- W) A- s0 p5 R+ B
The Get_DDB service is used to determine whether or not a VxD is installed- ?2 d9 |: ?9 e- Q: b7 x. A+ u. K/ R
for the specified device and returns a Device Description Block (in ecx) for
( v0 O0 p8 I$ H2 E* e: Jthat device if it is installed.% g( _- I. i' Z& K) G5 a
$ @2 A' n0 A0 N" \ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 o: _: P9 D& Q9 Y2 ~
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)4 V0 f- U2 }( [; c7 S/ e
VMMCall Get_DDB
4 }" W" X, h2 W6 ]6 ?: u8 k mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
3 T0 T$ @- X) z3 ` E
7 E1 j" J1 i% k2 a" H3 X/ ~Note as well that you can easily detect this method with SoftICE:
7 J* H8 c+ [3 h% E3 c I) O+ @9 q2 E bpx Get_DDB if ax==0202 || ax==7a5fh3 T/ R S( i) g; S8 m ?5 g! Q
5 I4 }6 b* a: W" H2 [3 l
__________________________________________________________________________
2 q" @% C$ z1 x% r' n3 J6 n3 F
- ?- X+ A, y+ IMethod 10
* [ S2 g1 g! s! h$ n, w=========6 y: o$ N, c# a& m, D: e
+ p4 c/ J }' z
=>Disable or clear breakpoints before using this feature. DO NOT trace with
. C. ?' U6 @8 J$ ^( N0 G SoftICE while the option is enable!!
0 f3 i: _* S6 e( L
) H( [7 p/ i4 B# lThis trick is very efficient:* q! \% Q/ R, f
by checking the Debug Registers, you can detect if SoftICE is loaded
9 J E) G0 `# T+ x; t8 p(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. g9 ]' r# v# }1 o K& ~3 P
there are some memory breakpoints set (dr0 to dr3) simply by reading their
* ^5 ]9 u- D6 V5 Jvalue (in ring0 only). Values can be manipulated and or changed as well
+ R( Z$ A. p1 S(clearing BPMs for instance)
E/ b8 U- O6 s$ F3 |0 V( p! u0 k1 B" a2 X7 G9 j# _
__________________________________________________________________________7 L: B5 f% j d( @* c7 ^
8 k# l' W( h/ ~, bMethod 11
2 E6 p5 `9 U4 x# U' J' r=========
& \$ ]6 u. f, T2 o
% s! m9 T# t0 b3 j/ c: hThis method is most known as 'MeltICE' because it has been freely distributed( \. O0 L7 W0 t3 L* s# F
via www.winfiles.com. However it was first used by NuMega people to allow
1 u# g/ P; ~$ C6 d& ^Symbol Loader to check if SoftICE was active or not (the code is located
( @. L8 y! T- e J) ]inside nmtrans.dll).
8 F( O! \5 f# n4 z5 g
7 ^" k. A" Y8 ]1 |/ \+ R3 _The way it works is very simple:8 T- |' a* [" `/ o. g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. e9 |! ?% m9 N, R9 x. [6 p! LWinNT) with the CreateFileA API.
& F) }3 V$ n6 I7 Y( z$ P1 N, G7 n* w9 F6 X: j, i$ o5 {( P
Here is a sample (checking for 'SICE'):5 R6 E7 k1 E0 v2 L. G0 ?3 `7 ?6 H
' `! t: L% {# JBOOL IsSoftIce95Loaded()
) i" I! |. a7 \9 N: ^{
& z% ]7 _: ]) \5 n# G HANDLE hFile;
) H+ @: }+ n6 e* `6 I; G& G/ j. K+ L hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 j" U6 d. `+ U, o
FILE_SHARE_READ | FILE_SHARE_WRITE,
) q; B4 X8 G$ h2 E% X. U NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
; J) U6 r9 u. o9 p ` if( hFile != INVALID_HANDLE_VALUE )
2 p- p8 f# A, k& O. p {
" T. @5 f; i2 H* k( f/ W CloseHandle(hFile);$ P3 o/ e; J4 h2 o5 p% S
return TRUE;: h/ ]. `' v \: s9 y7 D
}
; B; a1 k. s& A l& n return FALSE;
* M. \ Y, N2 a+ f8 S& G( k}
8 d# Q% g+ V: F2 f4 P4 T
6 K8 v0 \" ?6 {# S. y+ hAlthough this trick calls the CreateFileA function, don't even expect to be. @6 c$ B& X- k3 }( v0 J- z
able to intercept it by installing a IFS hook: it will not work, no way!5 O# ?1 d. d. H6 d
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
% H% V0 V" T8 Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 L1 r' G6 j) E1 i. |
and then browse the DDB list until it find the VxD and its DDB_Control_Proc$ p- g. T% n* \9 P1 K* U q
field.
; j, y! [: o8 W/ FIn fact, its purpose is not to load/unload VxDs but only to send a
+ r4 I. ]8 D' a: oW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) z- q* |" i! ^. ?( |# W
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' i3 o z3 x" j6 c9 q
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
" \( F5 ]1 a- j0 o; l4 L3 i; _If the VxD is loaded, it will always clear eax and the Carry flag to allow
; L; b! o# c8 `# ]its handle to be opened and then, will be detected.
( P& J) z' Z) \You can check that simply by hooking Winice.exe control proc entry point
$ A7 j h+ k" H0 W4 l3 ]" a7 kwhile running MeltICE.+ G0 Z! W C" X: C
. z" l+ I! T+ t
, z% V9 L( v% N p( l( \8 { 00401067: push 00402025 ; \\.\SICE
Y$ e$ M1 X. n$ c 0040106C: call CreateFileA
# x# ?* ~6 u O& b: i: y! y 00401071: cmp eax,-001
2 t" c& E/ l& H: b$ B( G/ X+ V1 @9 w+ f 00401074: je 00401091+ ?" G3 U" f0 t5 J
, p- A/ d. a9 Y/ W; E5 [ H, e3 h: q& H% r5 u
There could be hundreds of BPX you could use to detect this trick.; n. O J5 {6 g1 |
-The most classical one is:# P6 u6 F5 ?9 d
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
. t+ z2 e6 ~1 d *(esp->4+4)=='NTIC'+ G0 a, `/ t& c
3 ~: N ?8 u) C
-The most exotic ones (could be very slooooow :-(
2 e+ |; A& T: v3 ] BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 5 S1 r9 `! e7 h
;will break 3 times :-(! F% ~6 x T" `4 v. s
! m- C( I4 X3 A) G4 G( B1 W
-or (a bit) faster: # q% Z- q: m: L
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) ^# ]7 q/ [/ W, r( g
8 h9 e9 B- u* j! w7 X1 _+ ?2 I BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
3 } e2 o5 v$ M6 U$ D c. }: |' G# E ;will break 3 times :-(( V+ }# e8 L* n' J5 F/ `5 t4 H% r& @
5 R9 M' Z, g7 ] C3 K/ V-Much faster:
+ X# A; b8 `; P7 C# z1 E( j) C BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV') r& y# b& J# I' j8 d
% y$ e! S5 |4 b/ f6 t3 Y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ o7 p y( R* o- Z' n4 ~/ efunction to do the same job:
2 V( `+ G0 q) R: x5 C, a0 j7 S! i! E% s7 l, R; E1 e8 U
push 00 ; OF_READ
: R4 e0 M& D Q5 E5 ]* |, h mov eax,[00656634] ; '\\.\SICE',0
0 z( G0 p5 A7 I( T2 }( U push eax
- Q. U7 A) G$ q6 }2 X* ^% Z2 I& R6 ~ call KERNEL32!_lopen+ P. I$ |' A9 T- O2 L( b- I
inc eax
. J: T# q9 M6 X% C jnz 00650589 ; detected6 |# S, o" s3 A
push 00 ; OF_READ
& U: H: ?- f+ a mov eax,[00656638] ; '\\.\SICE'
3 F# F$ I) H9 {7 N3 K; j% P push eax
& _# O+ r) s% V8 W call KERNEL32!_lopen
$ v& ?3 |7 }$ A" G% T* ~ inc eax
' i) Q$ ]3 y% l# w7 {/ J jz 006505ae ; not detected3 {2 T: R$ x! p* e3 b! p# h* `
# U! W4 a6 ?% D& ?9 u* o# k
4 _4 Z2 ]+ z2 V; N# w__________________________________________________________________________/ _- F- M3 @. d# Q4 N9 p; h3 a$ o
, U, G/ H4 h5 U
Method 12
( j. Y0 r: J) d; ]7 I5 L U& z3 ~=========
9 O$ j6 Q; ]4 K# a6 ~; @. x9 ~; d9 i! U& t
This trick is similar to int41h/4fh Debugger installation check (code 05
Z& b' ]* A9 W: Z0 M, x$ A/ L& 06) but very limited because it's only available for Win95/98 (not NT)
8 m( R/ x# B/ i. j5 q. J* Gas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& d/ V8 |6 c9 a& p, w
! {# f% V5 o( M4 n push 0000004fh ; function 4fh
k x+ K/ i5 _' {7 i: Q) E push 002a002ah ; high word specifies which VxD (VWIN32)
" L+ @- I6 T# }" p/ x ; low word specifies which service
: Z( U5 F6 x; a& c (VWIN32_Int41Dispatch)
) k2 H3 `) z1 s# {0 _- I; f/ ? call Kernel32!ORD_001 ; VxdCall
* K' A6 e/ d6 x K7 j# L/ D cmp ax, 0f386h ; magic number returned by system debuggers% y$ x2 u$ l6 {" o5 V4 k4 z; }6 c1 k
jz SoftICE_detected
) a* z6 M. k! o2 {* o, j
' _: W2 h3 N" p2 r# s" \! MHere again, several ways to detect it:: b! ? y4 u$ Q
' j9 k# l& k2 X( z8 \9 z BPINT 41 if ax==4f
! M5 o: T1 ~- h. T8 v. v# i& ]0 e x3 S) w8 }+ B1 |& Y+ n
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 }7 S8 n$ z/ C. D
& s* \9 L5 K* V" m% ?* l! @0 I& x
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. l0 h/ A* {! c! x/ A
& w i+ T& {4 g& K* I3 v BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 N. i G8 |; [9 v# Q5 E
, W9 I: h% ~) J% C" T__________________________________________________________________________
6 J! ?8 p/ T; r+ S
/ l! P9 J+ v) F. hMethod 13
& z( r7 N/ `' I! h) n- V7 J; Z3 G=========- W8 S: Y% H9 [* d; ~
1 V9 i I, A; v U7 YNot a real method of detection, but a good way to know if SoftICE is) r; s3 I, s- U7 N3 q
installed on a computer and to locate its installation directory.
* m, Z' @% p+ Q/ F/ \) o9 s. fIt is used by few softs which access the following registry keys (usually #2) :. O# x8 t( ^* @# I6 C: k& @$ ?) C
& L8 k; b6 Y. X
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, a: v- _8 S% D( _: ^) T. K\Uninstall\SoftICE9 Q: M/ W6 f+ @* c f
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 U0 m: O7 y" |6 M
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 O: ?) X4 c4 k7 a# _4 s
\App Paths\Loader32.Exe% K( x% V- c2 N
- v$ {" k2 {2 e- W# F1 o! \$ P6 W" h& j. _$ {
Note that some nasty apps could then erase all files from SoftICE directory8 b/ h( r# ]0 T, c1 i
(I faced that once :-(
5 F$ q4 x& d X g. z& i' Y) k4 b* y1 C# s; E
Useful breakpoint to detect it:
0 c, B3 R' F. S: y3 ^
4 v( C' W7 A, B# }- w# k/ z BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; x, i$ Y8 h" n; T( s; e
1 c3 z, C9 p- L% k; j2 x__________________________________________________________________________2 Z- Z. w2 o; |+ P5 V8 X+ J Q
9 \# x4 x$ Z& ]
; Y8 s, V- S# YMethod 14
; l4 _# \: B. x. f' E0 q=========
- w& x' A* I1 h( g; p. i/ b( n9 d6 o3 |: u5 K
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& p6 Y6 b$ o) x3 }+ jis to determines whether a debugger is running on your system (ring0 only).! w7 X; d3 i6 O$ k) a
: Q; Q" k: z9 ^
VMMCall Test_Debug_Installed
" k2 b7 H0 Q& l' g je not_installed0 e8 E) H& i% l7 f
$ W# a, v% m/ z5 B: y- ?1 [This service just checks a flag.
! t5 a8 D% g( W; I; K( ?0 j</PRE></TD></TR></TBODY></TABLE> |