<TABLE width=500>7 a" Y& Q. u5 z/ R Q, {$ L
<TBODY>
/ {( H9 Y' W* z<TR>
0 A% l9 _! r# w8 _- O3 G<TD><PRE>Method 01
6 Y2 c" I2 I; C=========: Z; k$ `6 U7 T4 J1 Y
_9 f4 Q3 n! [; t z. l; K
This method of detection of SoftICE (as well as the following one) is
; H9 T2 ]2 x' u) c- W' Sused by the majority of packers/encryptors found on Internet.# `, J5 e+ \' e2 B4 l! _
It seeks the signature of BoundsChecker in SoftICE
4 l+ Q" W4 a6 P, I% _! \) a6 Q% k: N- J% d/ F
mov ebp, 04243484Bh ; 'BCHK'$ {: Z4 m3 c! _7 ~
mov ax, 04h
1 m3 E1 U% a2 H$ Q! ~ int 3
; ]% r" J8 }# c! b0 h x# O cmp al,45 S7 F/ p6 W$ C! D; ~& j9 F/ b
jnz SoftICE_Detected
) d9 e+ @$ ~; G* L1 v* \. V( d6 P! \1 B: w G1 ?
___________________________________________________________________________( ?+ {1 F3 l6 [
$ }1 t, L+ ~4 U( U+ T
Method 02
. {1 d4 K) `7 N+ ~; ]% E=========
' ?, U! N! E9 C+ W. x x; k
0 y* `3 }- \* L K7 RStill a method very much used (perhaps the most frequent one). It is used0 N7 b0 N) ?3 y, j4 V& y4 ?
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- q" S4 D8 @, L1 Q
or execute SoftICE commands..." E4 w% ~9 |( Y4 r; e0 [
It is also used to crash SoftICE and to force it to execute any commands
: k" E! x, M$ |- P: y(HBOOT...) :-((
4 k0 W; x% A S; L# I1 g
# p( O! ?5 a8 _5 D* ~7 ?' e, }Here is a quick description:
# `' \) E& [" D$ f-AX = 0910h (Display string in SIce windows)* {5 Y1 ]' d }" j2 n
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx). a" q. \7 Y! B8 m
-AX = 0912h (Get breakpoint infos)6 D) u, N3 i: p- J
-AX = 0913h (Set Sice breakpoints)
5 ?9 u3 h/ u. {4 \! K-AX = 0914h (Remove SIce breakoints); F& m5 N9 f+ c% C( o7 U1 h$ A
. `( T0 y4 Q3 c7 q& w' TEach time you'll meet this trick, you'll see:
4 }5 ?9 n- _1 s r& C-SI = 4647h
) M$ U' q9 W g$ E/ ^. i# H% W/ z-DI = 4A4Dh
4 Z; F6 L( ]4 P+ L1 E5 `7 c3 s, T" zWhich are the 'magic values' used by SoftIce.5 g' ]3 D2 t4 Q9 Z! g9 `
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.- ?* c; q! M4 Q$ k! E* I4 l
, ^+ [" H( L4 a- `# H6 F# I
Here is one example from the file "Haspinst.exe" which is the dongle HASP$ ~, i6 m2 s) g( m
Envelope utility use to protect DOS applications:
/ X, @& z: V% b: j. r9 r! @) v- X8 R1 C6 B/ L h* E# |! b: m4 ?0 a
1 U8 T$ N8 e4 z% g! |4 n' s4C19:0095 MOV AX,0911 ; execute command.
* b7 k# y$ z6 \+ g4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 W- |# G1 j& x( _$ `$ T4C19:009A MOV SI,4647 ; 1st magic value.# h: I. @9 |* U4 Q& P7 m
4C19:009D MOV DI,4A4D ; 2nd magic value. N) ~. D" W2 D. W9 m
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 Y/ Z' }$ a9 x3 @% ~4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute: V+ a( {0 b0 O
4C19:00A4 INC CX
! m. e! `- N( m2 Q) B4 ? n0 Z4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
( g9 O; H: B5 j# z) e4C19:00A8 JB 0095 ; 6 different commands.
+ Y: m1 K0 X. ^" C) K4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! I5 s, ~7 N+ ^: @/ d4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& e6 d4 l6 ?, Z- a8 h( z* m( V; Q5 N$ l
The program will execute 6 different SIce commands located at ds:dx, which
9 B0 j: Q! T; o" G6 }# C% Mare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& W9 C) q6 n2 y% f( |
2 L; C4 P. g& O4 F. p+ |1 x
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; H) h8 O# O6 i& P9 B
___________________________________________________________________________8 `+ \" }' [; z$ |' O
. M d' j5 n0 s! g# d" B ~- A- O( G* i0 o4 R) h7 _
Method 03
( Z1 K4 n/ v8 C1 Z3 g, S6 z' t' i=========
3 w/ W7 C/ o$ G( _: d% N4 A1 @
# d, ?2 K" X* V; ?, l; x. JLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 O0 d0 h2 B1 e! u# G
(API Get entry point)' e* a4 A& g, m7 c
& F6 p7 Q' b4 ^- O! z. H
* b& w7 w3 A9 I2 J/ S8 }; d xor di,di. ^: K# b3 D3 u4 x. |' |5 d
mov es,di3 b. G% X z; c; S1 j) C y9 n
mov ax, 1684h + E0 s' F9 V" t2 C2 r, H
mov bx, 0202h ; VxD ID of winice* q& t) x4 y* E3 c/ L+ ^3 H) N# ~+ h! Z2 [
int 2Fh3 [! u. u9 N9 o
mov ax, es ; ES:DI -> VxD API entry point
( p; m+ X( a# O( f o6 g; k add ax, di
/ K3 ~ @$ H/ \1 F, i test ax,ax2 p, Y/ A i2 a; x
jnz SoftICE_Detected6 d) k0 O. ?- j; \% t
4 c1 ?# w* s* ^0 F( u
___________________________________________________________________________
# N! ~% P* V+ [5 e5 U V5 I9 g6 y# @7 K
& G& n& ?6 B1 D L) G' ?Method 04
3 M9 ~8 N. w4 O9 c$ O5 x3 u6 ^========= { U/ O3 x( H! S
3 g! y5 d0 h, A9 k' E9 }6 J5 m bMethod identical to the preceding one except that it seeks the ID of SoftICE
, ^0 \* a$ {& I: {) B6 D( k4 O( tGFX VxD.
+ u4 s' s) A+ O
- n6 z0 U# b8 D h4 a1 y( g xor di,di* Y. Y5 |$ J" J$ I# r# r
mov es,di* f# b! [- W, W0 |
mov ax, 1684h
2 k* h2 z8 k7 i) h( h m& H) E mov bx, 7a5Fh ; VxD ID of SIWVID
3 c5 V# ^9 {. q int 2fh
! [* k# v, l, Z1 z mov ax, es ; ES:DI -> VxD API entry point1 M' \& K9 g# d$ b
add ax, di
/ e* H! F" t) o% Q+ ] test ax,ax
* r* D- P/ s5 P# a jnz SoftICE_Detected
8 }4 d( c/ y1 H9 T I' u
7 e; R) Q$ f7 @; ?__________________________________________________________________________3 l _/ J( s2 L w7 T8 j8 h
4 o& j& Y$ n; N O7 H1 U5 m2 R8 x5 o2 y4 Y
Method 052 o8 l2 R; H9 J q0 G. w
=========9 L3 Y5 h# U# L9 u7 }- G6 \" O
F6 Y; r: @7 P: b9 n
Method seeking the 'magic number' 0F386h returned (in ax) by all system
: d# }7 t: q+ _) `0 {3 a6 Hdebugger. It calls the int 41h, function 4Fh.
$ ^, J2 m6 d8 V# q" D8 u5 F0 DThere are several alternatives.
! I9 V1 M6 [8 [& d: `- C& q4 }! l
The following one is the simplest:
8 j$ i( \( h7 L
8 F2 A! G) m5 M. c f mov ax,4fh5 N m1 A. E& G c! Q+ l# |* G
int 41h/ i- @8 f% ?; Y% V+ k1 E9 M
cmp ax, 0F386
/ C# Z6 D4 B# d: \: H jz SoftICE_detected
7 N$ F) c/ C8 N: O3 y: w
$ z6 }0 b, t# q0 R& J9 F8 T$ M
& f. W' J6 j) c+ }5 @. }" [Next method as well as the following one are 2 examples from Stone's
D, {( f) I1 X"stn-wid.zip" (www.cracking.net):
5 s& F- n9 f7 k }$ D7 l, T
) W& N- U9 a. [5 [7 B mov bx, cs
2 H) @' C: h3 |/ C5 V lea dx, int41handler2& {( |6 d- z& p/ o: w' e+ U: ^! a1 k
xchg dx, es:[41h*4]
6 _8 q0 X% K. W' n" W xchg bx, es:[41h*4+2]
3 j1 m- @0 T9 T& f: ~) H& |2 M mov ax,4fh+ {1 L& S1 w. A# U1 u
int 41h
, Y' o% d6 M; n! v' i xchg dx, es:[41h*4]& m) z; l0 \# W' Z; r8 m- q' P8 y
xchg bx, es:[41h*4+2]
0 V% c5 ?9 o s+ ?7 Z/ F% w/ H cmp ax, 0f386h# R' |0 N4 {, V
jz SoftICE_detected
2 r1 U8 k. u6 m0 s
, T, _3 j: C$ s6 R K9 `5 tint41handler2 PROC7 \" h, _: ~, |5 o8 W
iret" J+ ]7 Z4 f y" p6 l) H
int41handler2 ENDP
5 U7 r: \; @! g5 B! G8 B
& e% p. d; T- a! o6 [ J4 f- r. i& X) E9 X5 g& g! d# Z
_________________________________________________________________________% b6 c1 F9 N0 r/ [3 W4 ?
. L' |$ z0 A0 u( O3 Q; l7 A# C' E: G0 A; K: a
Method 06
0 h& Y7 P+ M2 f8 y2 Y, j=========
9 \$ D( V. V0 O( J
0 F6 M% j) o. x. N" H/ R6 ~$ J
/ Q2 D4 h' z% \6 s. [+ e2nd method similar to the preceding one but more difficult to detect:
( |+ x1 p* Z5 z( d i$ M
0 L$ S m: T- M1 b) G
1 z- l4 b# P) W8 nint41handler PROC" Z) j! X$ R% U- P
mov cl,al8 I0 |3 a: \$ J0 B
iret
# C/ `- p2 X+ u! u0 eint41handler ENDP
. g' p7 W, @. E& c
: C. P4 z$ l# y( I8 k7 c/ C( V
& a" D, j6 w( J! q; T. | xor ax,ax
+ z$ X3 Q; W* h/ o" R8 [ mov es,ax) U% z% j% Y; I( @4 p, A* ]" A
mov bx, cs
6 ~5 Z2 e& ]( X0 G lea dx, int41handler9 y# R3 P. e9 o' n
xchg dx, es:[41h*4]
4 m% x+ _' N+ p/ p' f" K xchg bx, es:[41h*4+2]
! O# f8 P2 D y in al, 40h' d/ [' U+ F9 e6 u; N: |* E4 i
xor cx,cx& b$ Q, p* V/ d8 J2 {1 h
int 41h) t4 [8 W- L l4 ^7 ^
xchg dx, es:[41h*4]- N: \/ C! `+ I
xchg bx, es:[41h*4+2], c" N t2 Q- N! h% J' J# A% F3 Y
cmp cl,al
1 i9 g: Y# c" @2 R9 E% ] jnz SoftICE_detected
) ?. g- V$ s' [8 V) I: }, u% w1 @6 K1 T3 C: R
_________________________________________________________________________. Z7 \0 n: q. y8 |
6 w1 x) T2 G& w+ F
Method 07
+ L) }# K0 R+ O$ N$ g$ E=========; B1 Y# R+ v @4 j
. K1 L3 d- r: f. n: I' rMethod of detection of the WinICE handler in the int68h (V86)% {+ D/ ^/ l6 N; d2 F9 F7 u3 t! ~& Y( S
; t1 T1 Z5 R0 n) n- P
mov ah,43h
" C6 E |3 D$ F& }/ {5 I, s int 68h
# i) l. M0 y: u! d( ? cmp ax,0F386h
: L6 T2 O, T4 L jz SoftICE_Detected
# H' t7 l! {9 M' D8 p( x
( X/ p2 l+ |/ r. I' c" n% p! T( [$ G* R8 D
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, F3 c: ^" y0 C1 i/ T( T e+ ` app like this:
4 P9 ?* q! e( t/ P% x" P1 B
8 l( |, {# f4 L- x* u1 t1 q7 u BPX exec_int if ax==68
9 B# K2 K# w* ? F4 { (function called is located at byte ptr [ebp+1Dh] and client eip is$ {8 g" A I' J. O$ Q% P0 R
located at [ebp+48h] for 32Bit apps)
( J/ L8 `, q% w- v3 h3 Q4 p* U# w+ W__________________________________________________________________________+ E3 l, h5 f2 U: ?
; P3 k: I( N; N1 A: X
) p( Q$ A9 t% U9 V2 B- u8 K2 N$ ?5 @
Method 08: w% o2 E# Y1 C/ N9 W
=========9 A" U# m# \/ l* F* J. @
* }7 K- ?* {6 j# I0 }: OIt is not a method of detection of SoftICE but a possibility to crash the
( ^1 \3 j$ O: ~( C: d& bsystem by intercepting int 01h and int 03h and redirecting them to another) n* c5 ]: o+ G9 G0 x
routine.% v6 A# F7 a0 h& k9 c/ b8 b
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points0 O9 V) V, x! m' P: D2 G
to the new routine to execute (hangs computer...)' m% X: E: B' X: [% |) V$ l) _
% g! e* G. }# F( J- F# ^ mov ah, 25h
. X3 l7 v+ {* ^8 y3 }2 B! O; T mov al, Int_Number (01h or 03h)5 \! Y9 }, B: J" f; d* r' S) f
mov dx, offset New_Int_Routine
! C& p; U: q* K' x/ ^( _; R int 21h
9 F; r! ]) l( G/ I" ^5 O* A
8 N) S( N1 G- E0 v# B% ]__________________________________________________________________________' l/ W' ]+ S' O; @: c- T! N
9 R5 {' o/ Q9 ]! s( [/ ZMethod 09
' A$ q8 a7 |0 Q' P; W=========8 O [+ ?, ]/ }2 e
6 N; B- I# E+ {# M+ R9 ?5 H* b! UThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only6 p6 A" [" u0 c) \$ ^
performed in ring0 (VxD or a ring3 app using the VxdCall).3 X3 c& p2 Y; G, t2 ]8 I
The Get_DDB service is used to determine whether or not a VxD is installed$ [' }* T& O& k0 Z9 ~. ^! w, f' W
for the specified device and returns a Device Description Block (in ecx) for4 J2 r" {: x: f/ @+ F
that device if it is installed.
6 z# d5 _, I2 J/ ?) w+ G9 _1 t" F8 N7 c/ n
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
% i$ \1 A" ?2 d( S: j mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 n" Q3 s/ V# c VMMCall Get_DDB+ i# t7 a/ s! H1 ^$ [ T6 S+ U7 ^7 k
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
" ^& }6 _+ d% m( x! A1 r* w
9 @ U* g& P* n$ F" s9 h' K. Q# t3 r% JNote as well that you can easily detect this method with SoftICE:- Q" W6 I; x7 ]% D' t$ o K
bpx Get_DDB if ax==0202 || ax==7a5fh* s0 M6 Z" s' i( |
5 u- [" o9 S0 p+ C- J__________________________________________________________________________5 [8 l4 }: n. x/ D9 S9 y
6 X9 j5 y$ | r
Method 10
4 e( u" H: e* I=========0 L& X, T# i# K, d& y, f
+ e; I& Q$ E+ u- w
=>Disable or clear breakpoints before using this feature. DO NOT trace with v( a7 s/ ]9 y
SoftICE while the option is enable!!+ \: a, x/ z/ j8 j
) [9 `' X" A8 U" W
This trick is very efficient:
1 p5 I$ C3 ^; n' e+ y. i! |0 Kby checking the Debug Registers, you can detect if SoftICE is loaded
' N- x3 [; a2 ^" z" y6 F(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ ?% ]( }7 C# Y( d4 f% ~3 n$ s2 I# Zthere are some memory breakpoints set (dr0 to dr3) simply by reading their9 i& K* p6 d. h
value (in ring0 only). Values can be manipulated and or changed as well6 t: C5 S5 N: Y y; E
(clearing BPMs for instance)+ `; D. z$ ]) f1 S' W& l1 D2 m
. }, Q, x1 r! g+ d# c9 x( y__________________________________________________________________________& `1 E0 M' v7 b l- P: c- y
% I% D* |) w9 P* k( s/ V
Method 11
8 U6 l" J7 z: Z=========
, v' ^# `7 g+ U2 u! m8 v% e1 P
( h+ L9 r/ \( B5 ^' LThis method is most known as 'MeltICE' because it has been freely distributed
! @5 q- l2 V# F7 `7 V+ wvia www.winfiles.com. However it was first used by NuMega people to allow ~; j5 T& f( [+ T8 W8 T
Symbol Loader to check if SoftICE was active or not (the code is located
9 k/ T$ `4 B7 K6 w% u3 ginside nmtrans.dll). ]0 t$ q0 ]; J) A( h& h7 h" u
1 @, j0 v( l: O1 m8 s
The way it works is very simple:% [* L. D+ k( ]0 y/ x- v( ~/ U
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; w& h" I' r* W/ N
WinNT) with the CreateFileA API.# V( A$ y; P+ D8 R8 X9 W! H8 d
2 J, E/ A' o) |& {$ dHere is a sample (checking for 'SICE'):
8 i7 n- k! l R8 L3 ]7 s I) z# \6 y! b% g; b
BOOL IsSoftIce95Loaded()) l Q- Y" ^9 q2 _
{; f% Z1 x n0 O! W2 z1 j
HANDLE hFile; ) K$ m+ F; W% ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 n! ]) O3 j& d5 f$ M% i m( P! A6 c, p0 R FILE_SHARE_READ | FILE_SHARE_WRITE,
8 Q+ t$ i; B- z NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
, v: k8 }* Z) l! W# Z) i3 T0 L) W if( hFile != INVALID_HANDLE_VALUE )' i6 b9 n1 V0 |6 \9 l$ n
{
5 N7 Y: c- ~- f- S* |) z9 ~ CloseHandle(hFile);) O! Q; S) f% o/ {
return TRUE;
: {* J2 i* w) {( v }! O D) h: [. H) A: o
return FALSE;
`+ F0 v5 \. O# L0 v}
& h% @7 Z) c" C/ Y, @$ `8 A9 O. A9 I- V3 s& }$ T
Although this trick calls the CreateFileA function, don't even expect to be1 n9 `, ^& k9 n4 W, v
able to intercept it by installing a IFS hook: it will not work, no way!+ B) J: H) A; Y- k- i; r
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ r/ |; {: ], O- m5 k) kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
2 }5 e3 e% x9 }9 M& Cand then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 l) b4 R* L' R# yfield.
9 N2 C2 \8 p% h; z: s/ w9 ]' AIn fact, its purpose is not to load/unload VxDs but only to send a
* B- g) B0 p, n# Q" J8 ZW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* V0 ]' y% Z7 m9 V. D- B3 Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try( J* {/ {6 A5 @# R* P w/ P# m. y
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ V$ L5 j6 V' bIf the VxD is loaded, it will always clear eax and the Carry flag to allow
% i/ z( c( _: e; q* Sits handle to be opened and then, will be detected.
! J" s& f. m4 \ x0 i9 k& `You can check that simply by hooking Winice.exe control proc entry point1 X O8 `( |0 E7 }0 M. y
while running MeltICE.' N8 R( k8 w5 i" O- ^
/ r O6 n. m1 s' E3 j W: t# {( \% |
! }) H) L/ D* c' Q; X0 V; V3 K 00401067: push 00402025 ; \\.\SICE( {7 W8 ]5 x- M9 e0 @; ^
0040106C: call CreateFileA5 z9 ~4 B- L3 D6 B
00401071: cmp eax,-001. Q6 h% |" G3 E- P
00401074: je 004010912 L+ n0 t& A7 G; x7 X
+ L" P( T" ~( O) e3 l: T; f T
5 t$ h* c7 o, tThere could be hundreds of BPX you could use to detect this trick. [! a1 r0 |& _
-The most classical one is:! G2 Z* ]: B: H
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 w* y& w. U/ ?0 t$ S. E
*(esp->4+4)=='NTIC'
8 B; [' K& B8 N0 d/ l. V+ n& X/ L5 h& C& m
-The most exotic ones (could be very slooooow :-(
! x8 m9 d0 w* c BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% t( | w9 P" @% {& p. B6 }8 f ;will break 3 times :-(
6 d. v6 @. F/ u" p; ?0 T+ f% I) a- [, M7 F
-or (a bit) faster:
3 o: a8 F* D3 `6 O8 _) { BPINT 30 if (*edi=='SICE' || *edi=='SIWV')# m: u; U; {1 E
2 F8 S: P4 _8 x0 d$ U, ~: Y/ d3 Y3 H BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' * m' w/ [$ G2 R% v& F
;will break 3 times :-(
: |* P: Y' |5 e# U
; y' P# @+ G6 B6 [9 |# a6 ~-Much faster:
6 B" A, ?; _. R } BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* _" J2 y% b' s- A6 C
" m, m! ]2 Y) q! }9 uNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 y1 Q6 T, t/ Q6 G# O. nfunction to do the same job:
! `& k/ v/ ^ S* k* r% ?' a, ?; ~' x1 A: i
push 00 ; OF_READ' G% ]) Y8 r4 g
mov eax,[00656634] ; '\\.\SICE',0. g2 D0 B: B6 g6 H1 V
push eax
+ A+ C9 E; p4 G5 S5 {; X call KERNEL32!_lopen
. a0 v x$ {7 n inc eax m9 `$ C; J& z4 T
jnz 00650589 ; detected
! Z6 q3 e4 r/ R% }) Y push 00 ; OF_READ7 |( Z) b' c8 N O1 x, f9 E
mov eax,[00656638] ; '\\.\SICE'; a; p- K8 ]; ]0 @1 Q
push eax
! s* ~) Y% y5 S call KERNEL32!_lopen1 d# m* f8 o! [2 R! v4 Q" X* \
inc eax
, m+ H [/ f/ U/ Y$ V; W. e jz 006505ae ; not detected6 N+ \) R# g6 E6 K
; b, g* Z1 W3 D* x) U
( n& C% u$ H/ I# q__________________________________________________________________________
5 e9 l Y1 N; H+ j# v0 ~- Q0 u6 E. B- @( C- P& E% ^& k1 T
Method 12
( {% D; ]& c; y; `) A=========
& ` _; f: T9 _/ O4 t4 M( [! M' K8 D9 n/ Q/ z" _
This trick is similar to int41h/4fh Debugger installation check (code 05
[6 o1 \: l/ k. A$ T& 06) but very limited because it's only available for Win95/98 (not NT)
* _! M( {* z. H- q; y, b8 n! ]- Qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 _" [. f- B$ T6 f
" t" h; F f, w$ ~& r3 t push 0000004fh ; function 4fh* U8 N" \/ E) E3 b$ r% C9 ]4 h. O
push 002a002ah ; high word specifies which VxD (VWIN32); D# t/ Z5 a3 X- \
; low word specifies which service1 S5 g1 _5 F" e ]0 p
(VWIN32_Int41Dispatch)
7 l- Y1 w/ z! f8 r( u+ D/ ] call Kernel32!ORD_001 ; VxdCall: E; I* f7 d) S3 M2 c4 t
cmp ax, 0f386h ; magic number returned by system debuggers
0 m, {6 }" }- V, l8 ] jz SoftICE_detected2 W# a* m. ^ N: U
, L, J0 o; E1 t) z0 x( }& }
Here again, several ways to detect it:
) u! d9 V4 [, f4 b8 n
5 V4 i, \$ ?& [) o BPINT 41 if ax==4f
0 ?2 l6 [( ?4 @- ^8 U5 \8 d) c- X: t8 ?
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; |, F' ~& v- f7 ]/ h$ q
5 m. T/ w$ T2 J# O: _, w- f9 q BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 P" P* u# B6 B$ `% E' }2 z
. i) x& z X% e$ n( H/ F. v/ u BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, Y& {5 g- |- Q. z0 F* Y7 \7 d, }0 C
__________________________________________________________________________
8 v" G& x8 x0 X( B& F9 O: J1 X. t! t' z7 s/ F5 C- w
Method 13) |1 d' W! E5 ] q/ {9 m
=========
! M" R' _ l# M" N0 Y; `1 T" h x9 `- H$ |3 D
Not a real method of detection, but a good way to know if SoftICE is
5 v6 X8 G2 U) i; V, Y% b' Iinstalled on a computer and to locate its installation directory.: T3 k# r' m& ]: G7 }- s
It is used by few softs which access the following registry keys (usually #2) :* ~ G/ f, h( A( l! Y
* Z4 j. d* @% m# ?3 @-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 v* b3 t! G3 I- h o0 l0 Q2 F8 y\Uninstall\SoftICE
& _8 \3 b4 t1 `) p* N-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 K @/ I9 ]1 J$ |* x) b5 f-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
M* V6 Q& }/ H/ @) k\App Paths\Loader32.Exe
/ S! d2 Q9 h |, k Z/ c$ f% P: r. }
% I7 K$ u$ U4 `$ ~( F" o
Note that some nasty apps could then erase all files from SoftICE directory
6 o) i" v: Q; B4 r" a(I faced that once :-(
, A* W, q5 h$ {& l9 w0 j8 O% S* X- C; b. l* r' i& J$ i; M* O
Useful breakpoint to detect it:
2 q' E; p4 O/ t
! _1 H1 Q* e$ f8 m; Q BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 K$ A! i; l7 c; v/ e& Z7 t4 x
9 \1 ^! F* y! W+ }5 Y__________________________________________________________________________
* Y) |& O+ @2 }6 ~2 V5 S2 N: z6 k' w6 l7 [& l8 c& a
* X/ i2 R Y+ P; Z
Method 14 7 t* Y9 S( w5 ^$ _; l* g7 U
=========$ p/ _5 r1 o0 G( O& G1 _
( A: f, n9 [ O$ a. X. m* V7 s
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
h8 }+ F2 f: j, ?% W4 I" r. qis to determines whether a debugger is running on your system (ring0 only).# v0 b* x \$ G+ C9 |
3 L* n0 Z F `. g; A
VMMCall Test_Debug_Installed, W# G ]& D$ h+ a0 |0 ~
je not_installed1 M- Z! ?8 n5 x r
7 D/ f6 z" [1 A/ ]+ p1 ?This service just checks a flag./ D, b9 q, Q: ?% J
</PRE></TD></TR></TBODY></TABLE> |