<TABLE width=500>
: e' `# L2 w4 Q<TBODY>
- b: R# y7 G! j. o<TR>4 Q/ `- P3 w( f6 J/ {0 ]
<TD><PRE>Method 01 # z' m; J) [$ b2 n- C5 t O1 I
=========
5 m8 D4 o' @% m
& j% L+ A0 n- _) F6 r5 B$ A3 pThis method of detection of SoftICE (as well as the following one) is
. a, |3 R) c9 O% lused by the majority of packers/encryptors found on Internet.
4 C* @6 w" A9 L5 @( L1 ?It seeks the signature of BoundsChecker in SoftICE9 g- z* Y: q O$ X' n
, Y% U5 S+ w5 M7 ]# U
mov ebp, 04243484Bh ; 'BCHK'
0 n" B( ]. e! z# g; O" U mov ax, 04h+ q. C% F$ e7 P
int 3 4 Q# u( D* a, |1 l' p5 G2 P
cmp al,40 t+ Z" _; u1 q. c
jnz SoftICE_Detected
. t5 g- p$ E2 {2 Y& t! \' L
& t9 i! c8 X! L___________________________________________________________________________* U- g$ o2 k, _; d
/ `! v3 s: z" D. }6 WMethod 025 x* z( R6 ~: r. Q L- k
=========9 q8 Z) l! f$ ~% U
% i: w& a5 }$ s& ^3 w$ ?0 XStill a method very much used (perhaps the most frequent one). It is used
! F6 R# A2 _; O- q" Y( z' oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
9 f) y% r8 d1 `6 t, y2 e! b( M7 eor execute SoftICE commands...
& X' w" n" D7 C/ qIt is also used to crash SoftICE and to force it to execute any commands* `) V% g, ~; u& H
(HBOOT...) :-(( 4 i# ?2 l0 c3 S5 s
& t# L& p7 B; Q& \/ |. {" @Here is a quick description:' g* b; y9 ^) \, t3 g* V0 D) h
-AX = 0910h (Display string in SIce windows)
# `2 N$ c' }1 k6 _-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)* g! g* @, J2 h* `! g! T8 s
-AX = 0912h (Get breakpoint infos)
/ o x& W2 K$ E9 A' r-AX = 0913h (Set Sice breakpoints)
; u+ \( ]* W( z8 [' \) D-AX = 0914h (Remove SIce breakoints)3 [0 t% M( W, I+ I$ V1 j/ e
0 H( M7 W* J, `: Y# j
Each time you'll meet this trick, you'll see:& v4 @, \( Q8 k3 T7 f' c* ~
-SI = 4647h" }7 Z" | F* G- M, U1 Z: C4 D$ Y
-DI = 4A4Dh
2 B9 O( \8 x! Z5 sWhich are the 'magic values' used by SoftIce.+ n6 y4 K, ^. V) B' Y
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! U/ G3 N( j/ G1 L# K' [% B* k
8 a0 A/ u- s; C6 lHere is one example from the file "Haspinst.exe" which is the dongle HASP
" m, D- v m( U# L# }! X% Y! ?/ lEnvelope utility use to protect DOS applications:
8 v9 N! e- n2 c$ U. S# [) ~8 A
( K# w% D3 b; ~" e" n2 O$ Y
, y* k: b% i! v% j+ S4C19:0095 MOV AX,0911 ; execute command.
8 K! k; L) J1 y" m2 ~2 a" o4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; d. Q, G' |4 X- H4C19:009A MOV SI,4647 ; 1st magic value.$ A* u6 B' W' ?* p! N' u C
4C19:009D MOV DI,4A4D ; 2nd magic value., L9 d+ O+ D3 W5 ]6 X, i8 ~3 Q3 f
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*): H" \, X! X/ u) }& I+ Y8 p
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 I7 h4 H' \4 c5 A, R! X0 V* h4C19:00A4 INC CX! s3 H% S. O% O4 P& P/ I, v
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute( K3 }. N; h* }2 d- y2 H- R; M1 A
4C19:00A8 JB 0095 ; 6 different commands.
1 b; V8 Q! U% }7 K4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: g( N* h1 F1 r4 w. V4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
% R7 o0 O( h6 u2 o
9 E2 V/ y; N2 k8 ~, [The program will execute 6 different SIce commands located at ds:dx, which) k" k* d" h+ d( \9 j; |
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. Q; l$ x" u$ x& j& |5 @
0 a4 ~& B0 _( ]8 c, C9 Q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% K2 ?4 Q' N6 r, Q7 M% n+ |9 o: R
___________________________________________________________________________. {# F0 M) K3 I. o
+ U1 g3 N" w) I: x$ p
( a* Y* U. e' d" P1 I7 @
Method 034 Z3 Y2 t9 T0 {; F4 D
=========$ P* [. e9 b5 q/ {' ~
2 l* P3 Z$ E* l
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: b4 k4 C. K) q2 [( s(API Get entry point)
: o; T+ W) |' q, F7 |* k + H) c6 h3 R9 W: Z& {$ B
' ~* o+ D0 z6 {. {) F% U) Y
xor di,di
3 w9 [3 |+ _3 {1 G mov es,di. S) b6 `- g m$ w7 f; R5 h( t
mov ax, 1684h ; q% {' }' ~& w1 _
mov bx, 0202h ; VxD ID of winice
* d7 { Q" E: A int 2Fh: u1 \' s# B& l8 `& {4 w' E4 J' @
mov ax, es ; ES:DI -> VxD API entry point. q! Y1 h* m4 o6 A; O
add ax, di9 |% \% o1 b; z$ ?4 g
test ax,ax7 Y" Z, g6 C5 S
jnz SoftICE_Detected
" U2 b n# m- g" [$ M
7 {' U) M* }9 O. X5 g! `___________________________________________________________________________
1 b# h5 A2 m8 [; R# E- @8 @- i) p: y. v2 y
Method 043 f' j6 A; Y; b6 N
=========) L; N% y) r: t9 s- P- y
! g( o) s, y* s# H0 dMethod identical to the preceding one except that it seeks the ID of SoftICE
6 K/ x8 W+ _" O8 a+ O( d/ _6 ]GFX VxD.$ F6 ~0 H% `% K' g* @: ?" \. A. ~/ |
2 _3 Y2 |$ {6 I6 f xor di,di7 `2 D+ Y8 q) e+ R6 f: w
mov es,di' m! O1 H& R2 p b2 n7 y9 T S
mov ax, 1684h ' {8 }4 V8 x9 C
mov bx, 7a5Fh ; VxD ID of SIWVID6 Y8 z4 N$ M2 V1 O
int 2fh" J2 b5 o" X m
mov ax, es ; ES:DI -> VxD API entry point, p- o, E7 k( S2 A3 d& V
add ax, di
' J) S+ N5 T6 l. M9 _: }& X- d test ax,ax
/ D6 b6 f' `( O3 N# ~ jnz SoftICE_Detected6 j9 o- t% H R. X, J
7 H- n7 |* o P+ P* D4 d
__________________________________________________________________________
# F$ B1 i; V; c" u: m% P' |( @' N9 z
7 l* m2 s& l2 ?) R* HMethod 05+ R$ L, B( Y. H) A' k3 D
=========
# N) \( w5 x! j0 F- G+ q4 X$ ?, ]# q" c# y: i0 g
Method seeking the 'magic number' 0F386h returned (in ax) by all system! B) B1 \2 i/ H
debugger. It calls the int 41h, function 4Fh.
7 \0 k! ?6 E* A4 _4 QThere are several alternatives. 4 g4 V# V+ D1 D5 h/ X9 `% K2 L
" R. U! h8 T( P' S+ }The following one is the simplest: z( ]; ?2 S6 R1 K$ O8 X
" G _9 m; {% Y5 J3 O( w mov ax,4fh3 `! g: _1 e* @! x3 V6 u
int 41h
+ i! T9 S8 l4 _0 |2 ~ cmp ax, 0F386
: I) }& d1 O$ x# I! H2 Y# A$ m jz SoftICE_detected6 S0 o% _2 I; X' J9 r1 E) O1 B
8 {4 Z) w* \7 T: s
4 Y8 R% X! ^6 L
Next method as well as the following one are 2 examples from Stone's
T% }* u, s1 w. v: D, C"stn-wid.zip" (www.cracking.net):
& h' N7 }/ z! m: L
; @# }1 ] Y! L% V* b9 t9 f mov bx, cs# L; }3 b9 q# Q& T9 g
lea dx, int41handler2& C" O6 A6 \1 o$ h0 g0 j8 f4 K
xchg dx, es:[41h*4]7 H1 p" F9 B/ {) `7 T
xchg bx, es:[41h*4+2]+ I! D4 k% A! M& Y0 G1 z
mov ax,4fh
. C) @, z u4 O; _* } int 41h; r5 |, D2 H8 W) N
xchg dx, es:[41h*4]
; t$ p+ _7 [* K: T xchg bx, es:[41h*4+2]* `! u9 A, @ ]
cmp ax, 0f386h l$ k3 ]" L! y7 A* Y: @
jz SoftICE_detected
$ Y2 v3 R) F: f( k& p# A% X$ J0 e* a6 f# F
int41handler2 PROC0 G' Z4 o6 g$ e& l% S1 U8 a) C) H
iret
2 }& e- A2 u1 X6 o# j0 Pint41handler2 ENDP) _9 _' s0 M z/ D; B' f; }
+ W* Q0 j7 z7 _) @2 R) C8 g' w7 S# A' j& H5 ]; g1 u
_________________________________________________________________________
, y, J! C& Y. _# ~. a" i- j1 t! U& Z
) n9 S1 ~4 r% V9 k: `5 bMethod 06
# y- F2 Q' M) V3 Z" v' T=========/ J0 R( m: q+ N( L: \+ R
9 [+ [; `' Z! r& A/ T+ u) Q- h9 M
) v4 q9 |( A, g# @0 o3 l3 k2nd method similar to the preceding one but more difficult to detect:/ A- B b2 J6 E5 |$ F
1 }8 O( D7 k% X2 o' N
6 G8 {2 M9 f: U) k) d3 ~6 qint41handler PROC
' `) u) m& J" Q0 ^ mov cl,al
5 f$ t! O- ?2 Y2 E& ^4 ?' o O iret
/ e2 S& ?2 e# Z3 O3 M) q4 P+ Aint41handler ENDP
" {7 a/ {8 t4 B9 J" ?* g0 e& G" D' Q5 I0 V1 X) V0 y E2 v6 c9 k/ @0 m
f6 D9 h j8 T2 `) ~: x! z xor ax,ax
- @& H) i/ o1 U5 ^! @, P mov es,ax, u+ H2 f3 J: q# T+ D/ E. H
mov bx, cs) p w" [$ i' x& R R9 X# n, l
lea dx, int41handler
p0 ]$ m/ N n xchg dx, es:[41h*4]+ N; j/ X# ?- y7 p8 `
xchg bx, es:[41h*4+2]
! x$ v5 v, r6 i7 S6 E0 } in al, 40h$ w; p, a; Q0 u. ` r- F
xor cx,cx3 D6 U5 {: e% u3 H
int 41h' y+ |" k2 I5 j" p& C l6 p5 R, z
xchg dx, es:[41h*4]
: O- Y! }4 @! d) D xchg bx, es:[41h*4+2]( E# X8 h% J7 d1 F2 Y3 g
cmp cl,al% R8 ^8 l' g* P1 S. Y v3 s9 R
jnz SoftICE_detected! d, P. U" A l$ i C3 U+ h
& Q% f9 k7 ?! W; Y" u_________________________________________________________________________/ \5 j- R3 N. \; D7 y" r- M: q' G
i. H% y& k8 {) a3 X1 hMethod 07
/ x/ i# \. M6 r) [=========
* Q8 U' N4 R4 C* F+ u' L
8 z0 X( {& M5 J+ n" HMethod of detection of the WinICE handler in the int68h (V86)- o) `3 n# I+ \! A/ H
+ V# j6 p% G+ T# f3 j mov ah,43h- `# P# u' y& G9 h. i
int 68h0 N1 f' U/ @* ^; I2 s& a8 ~3 a
cmp ax,0F386h
, k9 @- \4 C& r4 l5 t jz SoftICE_Detected
. K7 x/ y0 @% V
9 B; y) N$ J; K H1 _5 R H! H- Z2 M# q+ f. F+ i0 g
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, E& k8 c2 F' s; [& G, ~ app like this:4 B& {5 V4 `) u9 o# [: ]5 ~
/ Z: t# Y1 c* ?- z7 l$ G
BPX exec_int if ax==68
5 z8 }2 ^8 p8 c D+ s4 s' l6 K (function called is located at byte ptr [ebp+1Dh] and client eip is/ h! o' ?' \1 u! W+ Q
located at [ebp+48h] for 32Bit apps)
$ d; U: ?2 N4 p5 ^- i e__________________________________________________________________________7 r! j3 y+ u$ w; J
% M( g" c& p- C" \
5 b1 x ]+ v9 A) G) c4 Z
Method 08
; P {8 J# m) L. ?9 i' Y=========7 r Y2 g4 z, k' Q% H+ i, r$ C, {
1 V1 |' [1 A6 }& U1 K" w
It is not a method of detection of SoftICE but a possibility to crash the
$ F5 S7 q8 q7 e5 \system by intercepting int 01h and int 03h and redirecting them to another2 p$ k9 { y! {+ y L3 i
routine.
/ u1 E, z$ Z; Z5 V5 c; M+ ^2 NIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; W8 Z- ]1 Z, Bto the new routine to execute (hangs computer...)
. I3 v7 G! \9 ~8 L
1 U5 L' V) Y% {/ y mov ah, 25h3 T1 Z: ?3 a' ? E. e3 v
mov al, Int_Number (01h or 03h)3 N* i3 ~1 }9 s8 Z
mov dx, offset New_Int_Routine
5 {/ d9 q5 E3 ]- |+ @ a2 Y int 21h
2 l$ j6 | Z. e. e x" z% `) {6 ^, l& c6 n1 g2 M' J: Z
__________________________________________________________________________
1 W% t* j9 U$ T, { _) m* \4 d z F1 O: a7 I
Method 09- c2 Z0 i0 W8 A6 X J: \
=========. a& v3 X# b1 \: x# E+ `
- T& { N0 l& }8 U+ M1 ]: q) I9 y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 S% |! d* K+ i( K# f
performed in ring0 (VxD or a ring3 app using the VxdCall).
% F2 f, H/ b- t! s8 g6 Z# OThe Get_DDB service is used to determine whether or not a VxD is installed
. i$ R6 u8 v6 m" n( P( a- Q' wfor the specified device and returns a Device Description Block (in ecx) for! f5 h# f4 \& i% d+ B8 u# a/ k
that device if it is installed.
" A% v- Z# v o" c
3 [/ [& f c: F& v/ Q; p8 Y. j mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID) m/ _) E) g/ C$ B9 w2 \5 p/ J
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 m Q$ g( N# ~" q; Z) Z VMMCall Get_DDB t" f) k L# t0 g# k6 f
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed6 ~/ c+ v" V$ H! p& O
; o) y/ g. b* b5 R6 iNote as well that you can easily detect this method with SoftICE:( b% s3 v) I4 W9 v! v' ^7 u) H
bpx Get_DDB if ax==0202 || ax==7a5fh
$ g3 e3 \$ c7 Q# L
/ W! I: u0 s; `' _& @, t) ?__________________________________________________________________________
# J/ X& {, ~( X3 n$ I' ]
3 o/ _2 j) n6 l/ v/ O7 hMethod 10
# m, s& {4 ~# ?0 O+ W=========) \( D. I, D- w6 W
4 @0 J8 ~; |7 P3 r$ {1 Y=>Disable or clear breakpoints before using this feature. DO NOT trace with
# K6 G5 r+ `0 e SoftICE while the option is enable!!4 r& g0 [. @6 p5 }- ^5 b8 s7 `( R
& |8 T' p- I( W$ ~9 `. Z
This trick is very efficient:
{9 X: d- N( P& Q0 Aby checking the Debug Registers, you can detect if SoftICE is loaded
# c& A, \& c# {, x# J(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
8 J6 b& u7 x& m3 R# Ethere are some memory breakpoints set (dr0 to dr3) simply by reading their% S3 p& D+ h3 e [# A
value (in ring0 only). Values can be manipulated and or changed as well! C# C( F" f$ i$ D# |. F: s
(clearing BPMs for instance)& Q8 `) r% c' i+ }, E4 w5 e8 i. q
' _3 D% ~$ z! s7 t- u
__________________________________________________________________________
$ m) D5 ]( g# P& T2 j+ @9 ~- b+ f* e2 N0 @6 V
Method 11# r5 D: ?! I |6 ^/ M
=========
" ~) m) D% n! e- A' t5 \ P8 G6 [
9 ^5 ]# ]* O( BThis method is most known as 'MeltICE' because it has been freely distributed- }: ]2 m' \- P: a, A# v
via www.winfiles.com. However it was first used by NuMega people to allow
6 c- K( w% a5 N4 ]- P% `. x" KSymbol Loader to check if SoftICE was active or not (the code is located" N9 ^! U! R& L% E) N' G
inside nmtrans.dll).
/ `3 V) a4 l7 l! A2 p+ w/ E( H2 f. C, a: K# M. _4 n
The way it works is very simple:
3 v; P# i1 g5 q0 ~It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- e- E7 E, F1 p0 b
WinNT) with the CreateFileA API.
5 J2 m7 Y0 d. s7 ]
$ ?. v% u9 A3 u- m/ r2 q6 G WHere is a sample (checking for 'SICE'):
, o+ S2 l V3 S7 h1 Q3 @
+ ]% K3 E1 c# |5 E% j" I* K/ oBOOL IsSoftIce95Loaded()
' Y# r+ x& Q% b2 P$ V% a{0 N0 M7 q0 p% b, O
HANDLE hFile; : n2 p7 s% r" w0 f! S$ T; }
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 ?/ z+ n/ f1 `* M, {& f$ {% H; V( l FILE_SHARE_READ | FILE_SHARE_WRITE,
; s' W- k, M+ M) c% s2 Q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) h' c4 B# a. w0 Z$ ` if( hFile != INVALID_HANDLE_VALUE )2 N- G# S6 u6 d& Z" I6 w2 _
{0 L# b1 i1 ?" {. J* n2 x3 p( C
CloseHandle(hFile);4 h. e) p( I; h2 g2 f: d
return TRUE;
/ l7 D+ z% u+ L9 E" }% s) X }4 L* R# d" y' g
return FALSE;8 z! l+ s Z4 \- ~2 V
}
) d3 D' ~7 x+ `! b, {' i( ^. F8 G1 D/ a7 y T0 Z' k
Although this trick calls the CreateFileA function, don't even expect to be
7 l. X' ^- t v, z9 o& }) mable to intercept it by installing a IFS hook: it will not work, no way!
/ l8 m5 U& ]# }8 wIn fact, after the call to CreateFileA it will get through VWIN32 0x001F3 W( h0 S; E6 Y7 h
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! y, p# R; I8 w) h
and then browse the DDB list until it find the VxD and its DDB_Control_Proc0 r7 s& {1 C' |) V- k7 M
field./ {# c) ^% e6 n
In fact, its purpose is not to load/unload VxDs but only to send a
" n+ B, g0 ~7 w; X& \W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 q& h4 b* r- @9 K
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
2 w- S: A3 m' Ito load/unload a non-dynamically loadable driver such as SoftICE ;-).
- r% d- A9 j8 t; B uIf the VxD is loaded, it will always clear eax and the Carry flag to allow
9 p) a7 H" L7 h1 b, Nits handle to be opened and then, will be detected.
. n% y8 F/ B! J. |; T! RYou can check that simply by hooking Winice.exe control proc entry point C7 w, \. i$ P2 t) B+ l4 m
while running MeltICE.
3 k/ q, `, A" O% n( Z6 t! U: i* r3 a
6 c2 @" g# N+ L8 O
. y" j1 H- i/ Z( t 00401067: push 00402025 ; \\.\SICE
& ]3 o: E/ O1 h. {1 w% u% x2 ?) \ 0040106C: call CreateFileA
7 @1 \! ]4 c3 e* s 00401071: cmp eax,-001
9 X. Y9 k' s# k0 u; { 00401074: je 00401091* r, U$ B- |/ @ {* p
( I( O- Y7 h/ R3 {% E% e4 [
$ f+ N$ `7 h. {) c
There could be hundreds of BPX you could use to detect this trick.
& E; v9 ~# i9 y- A; I-The most classical one is:
/ C% S( K2 a |/ \1 E3 g- } BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ W* x9 y- u- S f( w/ s0 Q: q, d/ q *(esp->4+4)=='NTIC'$ I: D) ?2 v1 D# s! Q( G
3 F" Y+ l! F0 z/ P-The most exotic ones (could be very slooooow :-(# _" k3 d4 |) n: F9 g7 C! C
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . F3 u. f3 T f. D/ O& K
;will break 3 times :-(
, R- I8 D3 H8 {
X: V: y$ x. C0 [% u7 V-or (a bit) faster:
( B& |' o& ?; u7 M BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
8 V& N( y6 r- f' X. Z# ]" J
2 d5 N/ n& s, v, q BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - w* Y. \; u; B8 x! e/ n
;will break 3 times :-(
6 k8 d+ H8 Z: X( p8 I' }$ G3 [ k1 E+ V' }. _
-Much faster:
0 S8 U0 D5 \% F, o BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
/ C3 h. X5 n2 {' X; d9 r. n
* f4 G8 K& y& P0 wNote also that some programs (like AZPR3.00) use de old 16-bit _lopen/ V0 O( }8 L6 O9 R( n
function to do the same job:
5 |3 |) f0 p' v. a/ H+ K' b" ~- H. R
push 00 ; OF_READ! m; m2 ~) a# \7 }3 f
mov eax,[00656634] ; '\\.\SICE',0
6 C) A4 m* J0 B' W* d- N& h/ I push eax
p! N+ O5 j* Q+ }' q, ]6 c call KERNEL32!_lopen4 J$ j$ j; E y- J# P4 ?* E
inc eax" d4 m. k( t7 p, h$ C% z
jnz 00650589 ; detected" t! e4 B( W1 w
push 00 ; OF_READ
- m) B& H* Z6 q5 F1 @3 E' v- d mov eax,[00656638] ; '\\.\SICE'0 Y6 j+ D1 l/ f6 S
push eax5 ^: J* N# y% P. C6 d. s: b
call KERNEL32!_lopen' j" K" T' ^* x& J, J7 A
inc eax1 P; \4 m9 z. Z6 n! p$ o4 v
jz 006505ae ; not detected) W8 w0 r1 l+ D
, k7 Z" A% J0 w8 g
) {' ~% I# x7 {& K$ i/ z0 o__________________________________________________________________________' t+ s% y; U4 I- ~1 ?- K
+ ^! W( ~" A: q" x* D/ o
Method 12
( p/ P- ~4 V6 G8 R4 ^- D' U4 D=========/ U9 A& j" v1 j
: g% P/ a% T/ y# \; w: YThis trick is similar to int41h/4fh Debugger installation check (code 05. f4 m3 e6 a! s: N1 J
& 06) but very limited because it's only available for Win95/98 (not NT)
( f& ]5 {3 ~3 eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
. K3 ~4 m0 L( t6 B* {! |
! \* ^1 }" s) u- D6 g: V push 0000004fh ; function 4fh+ m) b& x! j* I7 B
push 002a002ah ; high word specifies which VxD (VWIN32)
1 M0 `) U. Z4 g+ O! r ; low word specifies which service+ ?. ]5 s8 V3 _3 p/ U0 p R
(VWIN32_Int41Dispatch)
" }) G, m& t M' B4 i" g call Kernel32!ORD_001 ; VxdCall
* M9 u/ X) h8 `; @" h cmp ax, 0f386h ; magic number returned by system debuggers
( g0 U5 P" b, ~: a jz SoftICE_detected" \9 e& c7 {# M Z
: x6 J$ ?6 G- LHere again, several ways to detect it:9 S% {, ~6 l7 }* @1 `: g, g
& S* W8 Y9 U9 X8 ?( y5 B, `7 {" k BPINT 41 if ax==4f/ k" h. O8 M, m9 L
% W! K2 j7 d& _/ ~6 _3 s- T' Y3 t BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 S. L( {$ V. Q5 @% n
- x& E! X# \! G7 H- J6 ` BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A2 X6 b* K1 K$ N( n. ^* X
d. P4 q: I5 x7 t; S ^7 P3 p9 b" V. k
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
' s( T6 Y2 {5 E/ F. X; d/ I% h* z# O0 B9 ^+ i5 G- ?
__________________________________________________________________________: e7 c" y, H& x) \1 W" T' c n
1 n9 _. S9 v9 O9 k l) R5 z
Method 131 l/ ~5 M4 _' e! C' [4 H
=========& b( |. D+ k' H i7 Z
# ^! m. M4 k% UNot a real method of detection, but a good way to know if SoftICE is0 T. G& v# U: w2 c; O' s
installed on a computer and to locate its installation directory." u" N$ I. I# r( z) _6 {& z$ |$ ]
It is used by few softs which access the following registry keys (usually #2) :+ H+ k# i( F9 Y
- G) {2 M/ W9 V* j4 v9 e
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" _! C2 f! G8 }& _, K+ s3 o. M
\Uninstall\SoftICE
5 J) g$ R" l8 W-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' M1 K4 r. Q5 S% ?% J-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; e& g2 N# ~/ s" f2 |4 a+ _
\App Paths\Loader32.Exe
+ ?& ~/ b5 f }3 O$ [$ l! h% b+ a+ l
9 }+ p( c8 L. R* hNote that some nasty apps could then erase all files from SoftICE directory# x Z8 t/ N$ D8 W
(I faced that once :-(
# \9 N; S2 e2 s+ B9 J" S7 P" t% x' `' a- q) V5 u8 m
Useful breakpoint to detect it:, p( G9 k. t: [
& Z- E/ O* _$ \' _6 G/ f7 k$ S BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
) C; K3 T0 M# V9 T# \0 Z6 ?9 Q* H B& z! N2 {) |
__________________________________________________________________________
) j7 j% ~8 i7 T8 n A" L. L% }6 \3 G! t( [( N/ `& _, J, m
& k: F7 s) U: ?0 w7 S) B3 y RMethod 14
Q9 k2 s$ ? f+ O6 S=========2 Y$ h4 d, }* I
! M6 Z' Q& w: D+ a# a! X
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
3 B4 v5 l5 E3 x+ ~is to determines whether a debugger is running on your system (ring0 only).- i' K9 `7 q3 f- c# w
" z! n) f4 z! X z VMMCall Test_Debug_Installed) v p2 }) J7 K
je not_installed- G: Q, j! v* ^# z
$ ? A: ^# A# T0 ?/ QThis service just checks a flag.
* n n) R+ S& w F</PRE></TD></TR></TBODY></TABLE> |