<TABLE width=500>
8 g# Z. G8 p9 a$ \<TBODY>: z% y z/ e7 V ?; c+ ?
<TR>) e( t( S- ?2 K* p4 a9 p8 e) R- a
<TD><PRE>Method 01 7 r9 g/ \. x$ X
=========
9 n4 p1 W. n" N3 ^( p4 R- p# X9 @2 V3 B9 Z5 N8 N) k! V
This method of detection of SoftICE (as well as the following one) is
) @# d- o* _1 [5 Z! Y% U! pused by the majority of packers/encryptors found on Internet.% S! V/ z2 p7 a$ q* r" b
It seeks the signature of BoundsChecker in SoftICE' G3 ^ c* ^% L& u$ y; b
" r6 P; w2 U: q& c: U* o+ Q mov ebp, 04243484Bh ; 'BCHK'
( B, g$ t2 A, b, F' A mov ax, 04h
h2 z: ^+ Z" P( K int 3
( E2 ]' T7 K, H3 a5 j' v {; O cmp al,4
( D4 r2 q# S; S, O jnz SoftICE_Detected7 ^6 g0 x, ~0 O0 w5 X! Y3 R& C
# ~2 }$ X8 D+ c% R+ j4 s
___________________________________________________________________________
7 r( a/ v! H& c* g: B
5 N8 I1 Y0 U0 p+ `- yMethod 02+ M6 v& r, f0 w% ~! q
=========
% g z. T5 H* O3 e) X$ b0 x# `/ j) p+ W1 S; v( q& y/ v
Still a method very much used (perhaps the most frequent one). It is used0 a! b3 V @+ S
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; p; @2 L a* i# zor execute SoftICE commands...
& w# f- `# F: oIt is also used to crash SoftICE and to force it to execute any commands
3 z% j* _8 T; ~. t( T(HBOOT...) :-(( ; K2 I- [3 F3 n4 w6 e [
6 l* c$ E; I5 c O
Here is a quick description:' R1 T+ W7 S7 F( D" L6 c- e
-AX = 0910h (Display string in SIce windows)
: a3 U# x e* Y3 |9 l4 Y' y-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
`; u1 ~& T- _3 F7 [' f) m" U-AX = 0912h (Get breakpoint infos)
- x" o5 N' r$ k. @0 D6 O3 G-AX = 0913h (Set Sice breakpoints) W; U9 e8 a5 l# V( \ v8 n9 r8 E
-AX = 0914h (Remove SIce breakoints)- [; K$ e% J' x- b9 D
6 X3 u4 C% p z8 \) f K0 X
Each time you'll meet this trick, you'll see:
* S T0 x3 X* i7 j1 Y, b8 B+ K-SI = 4647h
0 j+ r2 x9 L' Z1 F-DI = 4A4Dh
% O$ \' P; p9 \- V7 l1 {" S* i3 Y5 z* q% wWhich are the 'magic values' used by SoftIce.( H6 l* z! | ?; |
For more informations, see "Ralf Brown Interrupt list" chapter int 03h." ~' X& {) ], X, m; W* C( x" M
\1 E. B& F5 A% G2 \5 [Here is one example from the file "Haspinst.exe" which is the dongle HASP
4 o8 s; U: E; W: Q9 Z8 K, xEnvelope utility use to protect DOS applications:
; s0 W. B8 H4 u7 u z& ] i2 z) I/ `+ X( U
: _1 u/ j2 _2 @. x4 K4C19:0095 MOV AX,0911 ; execute command.
6 L# t% R' K& D k e/ ?9 u: N4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
2 |4 m7 w5 s1 m! e) _2 t3 Q4 q4C19:009A MOV SI,4647 ; 1st magic value.
6 j: s7 r7 \' C# V1 e$ v4C19:009D MOV DI,4A4D ; 2nd magic value.
1 g0 F2 s' c1 L2 L; v4 L4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 `: I! [- f P0 T( v. }1 D4 {
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
# r6 T2 S+ E1 \' B9 I' q2 l4C19:00A4 INC CX. X7 A$ u; }$ B" @, l
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. w1 W7 ^" [. x i6 S" B" G4C19:00A8 JB 0095 ; 6 different commands.) z7 {" I4 b+ h, g8 u' `% @
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" C! W, s, X$ U Q1 ~ k; e$ w# X4C19:00AD MOV BX,SP ; Good_Guy go ahead :)) P% k) j2 W* \
: o0 V# i! B+ x8 f; ?' r& C
The program will execute 6 different SIce commands located at ds:dx, which" @* d8 a: m5 |( H: ?+ [
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ y% E' a3 \8 o4 V5 w) U
8 D8 [& ~) o; K, b( n9 i& z1 U* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.+ B+ |3 j" O$ g- S, D0 W$ ~
___________________________________________________________________________- v3 Q0 |0 ~' @% Q
/ K, {1 h0 k3 L3 o0 X5 F
. i% v: Y, b! }+ I* NMethod 03
4 Q6 a! m) @$ o$ V' L# A* ~=========
, U+ u4 N9 f9 T8 { A5 F5 a
, k% D9 l6 ^& U, WLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h8 g9 `( d8 Z1 R: k8 v9 n
(API Get entry point)$ F: @( G3 e* G. X
2 I1 [* R" F# h4 n# ?, a1 y; B7 z% B+ L" z9 s! Y9 c# O/ Q" H0 R# D
xor di,di
7 s: h$ @. l. s mov es,di6 b/ c, ~3 v6 M8 K& y/ K K; Y
mov ax, 1684h 0 i% L. b" `) o+ q
mov bx, 0202h ; VxD ID of winice, Q9 S' P& F s0 B# \- `) l& z4 v3 b
int 2Fh$ \1 n) w0 l/ P s1 D1 V1 P
mov ax, es ; ES:DI -> VxD API entry point
; F: x5 U1 U! a8 C9 C add ax, di F* q5 x3 }' w! m
test ax,ax
% a* b; t: V# Y- j9 \ jnz SoftICE_Detected9 h5 u. r4 z/ H# m/ X
. I0 D6 n: W- } p5 O& u) s6 D) r& E___________________________________________________________________________
! s; b- L& V) v
7 m( Y2 W/ h# p" N7 eMethod 04
$ Z/ h0 _2 p& I=========, x9 u6 ]/ c4 J
2 d( g2 }2 h0 z0 C2 k3 pMethod identical to the preceding one except that it seeks the ID of SoftICE
% \$ g; m" R1 FGFX VxD.
: D, C" I* J/ s
! f% e8 [/ e9 s! X xor di,di
. k* \$ m! p3 E( O. i" c mov es,di
! ?. B0 J: T0 h! p! d7 c mov ax, 1684h
% U/ _* v) s0 ^ f9 D mov bx, 7a5Fh ; VxD ID of SIWVID
/ q% a) e0 N7 a! [$ K$ N# Z int 2fh
( m* R w3 X4 \8 @% B7 v, f. |- } mov ax, es ; ES:DI -> VxD API entry point( J( z0 h3 ^, T7 Y
add ax, di9 Y- r. Y8 L* r$ F% j
test ax,ax$ ~- u. G( d8 \4 t# B4 v# R+ f
jnz SoftICE_Detected9 T8 t& n! p4 [5 x
, R: t# B4 r; p__________________________________________________________________________
* o& T0 F F7 Y& x
5 e$ r9 ~' O/ P
$ v; E( S2 P" d7 BMethod 05
$ b4 ?6 _6 U- y# s! E=========8 j. z/ B; D5 @
" M, n. B" k q. N y( `' D
Method seeking the 'magic number' 0F386h returned (in ax) by all system& @( L& ?% Q3 K8 R) ?
debugger. It calls the int 41h, function 4Fh.5 T9 g/ u3 G1 t4 A @" w. z
There are several alternatives. + ^+ A* l; j! Z6 @( k* R* k
' y2 E4 s. ?8 D0 @" x( o( ~The following one is the simplest:
0 w6 [0 Q( k0 H* F
1 A1 x6 r" y6 W4 {3 ` mov ax,4fh
0 i& o) ^; w8 L$ \: P) C6 k int 41h+ k# e% t( m4 ~7 W# o$ ?# T$ L1 K; N
cmp ax, 0F386' {% \ L% E1 y* P5 y* ]( h
jz SoftICE_detected) x' p1 r* a# J ^4 t
. t) l Y3 E( c* A2 _ r$ b
2 P0 |% G5 f- @, L, O6 q; B7 NNext method as well as the following one are 2 examples from Stone's ' T' Q' j" V, K. D' z) O8 n9 U
"stn-wid.zip" (www.cracking.net):
+ S' `. j2 k2 ~6 Y! d" l+ i& z2 T& F$ V' j2 Q* }2 Y
mov bx, cs# Z# v8 o: R1 Q3 n( U9 I3 a
lea dx, int41handler2
& d9 T9 u; D7 u3 O' B7 T/ @4 ? xchg dx, es:[41h*4]
. m/ i# N* |8 ~: h; o8 v x xchg bx, es:[41h*4+2]
- C7 F( {3 J& G/ |- h* W mov ax,4fh& A6 A; Q7 k4 h j1 J
int 41h
' O* n j$ x; f5 \ xchg dx, es:[41h*4]: t; m9 B8 [3 g0 _% G% |
xchg bx, es:[41h*4+2]
3 K8 E, |9 X! c) t# Z9 T" N cmp ax, 0f386h
( H* N6 J; z/ W& X! T jz SoftICE_detected
; L) t$ c, b. }$ t- Z, h( s( i4 h9 @3 C5 y3 A, [, Z' ~ g' Z
int41handler2 PROC, X8 ^ v" o* U, s2 W
iret
b Y/ t$ ^+ m# V: W, g2 cint41handler2 ENDP$ H; O: [9 `/ |$ p8 T
5 u' @" D! G, g) u
/ Q& ]" `! p4 t A1 R' x" p_________________________________________________________________________3 W( ?8 ^& {3 I' @3 ~ N
2 l1 S: @* D. ]- z2 v% R: {! L) `9 a, C; u2 N# M
Method 069 g g9 D' ~* ?$ P
=========- U' Q$ D1 g$ ?7 f
* A, C. l+ T/ {) G0 c: }3 `, V6 d/ z8 Q! \2 g# D* F* n
2nd method similar to the preceding one but more difficult to detect:) Y u. V R# b4 G5 [5 N' R! P
4 b$ B4 n0 c( c( M5 s" D Z' M0 M) g8 W& _; ~" f. D
int41handler PROC
% Z; S2 W, G6 p1 [( Z. l mov cl,al' V3 N0 h1 E! Q3 n, e
iret3 x& q! X& ~6 s6 q
int41handler ENDP; @; K5 R+ ^- ^# z, ?" X" M& x3 ~
( d3 A+ g7 n8 ` P3 |
% ^2 _: l2 n' B( ?) h xor ax,ax( U, `0 C) L6 j8 w4 O6 ~6 F
mov es,ax
" u0 T% s4 \1 K; y9 N mov bx, cs
4 B5 I8 o+ r h! B5 G* W3 F lea dx, int41handler
& [$ ]& v% l% A- a8 I I: d2 M xchg dx, es:[41h*4]
0 H* g8 H t$ p" J1 Y xchg bx, es:[41h*4+2]8 v9 ^$ L k! d) b
in al, 40h7 \4 L) ? J/ ~" l- K( Q
xor cx,cx0 {0 e* U! m% C
int 41h
& ^, Z+ H9 m8 X% @% ` xchg dx, es:[41h*4]; c9 x4 o! Q1 y$ C5 n1 {) ]
xchg bx, es:[41h*4+2]
* A; S; w- w, G cmp cl,al
- {% {$ D2 o3 n! H9 i' I( j jnz SoftICE_detected
* p, { p8 Q1 f
4 D( a; a2 ]& w$ I% c" B_________________________________________________________________________. L2 Q6 h7 Q6 n% }( c+ ?
* n0 B5 v3 y) Q2 B0 Q, u7 h
Method 07# c X6 z5 H8 p) m
=========1 _9 n# H( Q3 k( Z$ u! L% G
1 |9 }' H' x& I+ ]$ S
Method of detection of the WinICE handler in the int68h (V86)% Q* K" Z1 z& R9 R4 r' g0 }
1 u7 X5 z6 c F. p, z2 p2 B% G$ h. W
mov ah,43h
% g" Q' U3 u3 x8 ^+ h+ h% q1 T int 68h
# C# O& C) x$ X* M cmp ax,0F386h
& N- e1 s4 r W% ?9 K1 N, I jz SoftICE_Detected
$ l; C! t7 a6 u* e! p5 w4 e, U' e0 M* E$ @' W
3 f# Q9 B5 J! p, q
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
1 l C% k$ W& E v8 l app like this:! r8 y9 X6 D5 y j6 F) s4 [
' X# R, W# ]9 S: y" r K& R; Z/ m BPX exec_int if ax==681 R! e6 @9 l& f( a3 ^ M5 f6 M
(function called is located at byte ptr [ebp+1Dh] and client eip is- ~2 _8 r# R1 k2 Z) D
located at [ebp+48h] for 32Bit apps)
0 j# I( C; q4 |( S s* X) x__________________________________________________________________________; y( }+ ~+ b6 M0 X: k
* V: B+ c/ @: b& v4 ?9 O1 g5 v4 B5 l+ |0 s% z9 |
Method 08% t1 W3 U' E% J' ?/ X
=========
! G8 V- S) }0 p7 Q" f
0 ]7 y* V! _& _5 X/ vIt is not a method of detection of SoftICE but a possibility to crash the
: q7 ]& ]" g0 s2 @: fsystem by intercepting int 01h and int 03h and redirecting them to another
: ?. B7 a/ U! _. V9 I0 x% iroutine.# U4 u3 V7 U" [# {& v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# ?! e% M- z' uto the new routine to execute (hangs computer...)# [/ s) X6 o G: M& X* T/ }/ N
' C/ m6 i1 M! z mov ah, 25h, r7 u- q1 M+ u, Z
mov al, Int_Number (01h or 03h)
0 d) L1 [% a; W8 F# N* e7 a mov dx, offset New_Int_Routine
, j& h8 \! p8 H" N" R. I int 21h+ B) W/ {1 T x8 `$ e: q1 E5 u
6 B! G6 a& d- y: w__________________________________________________________________________
5 ? Z4 ?" c5 u1 ?& W4 `
% K1 ]$ {$ c9 h# s5 ZMethod 09) y/ v0 P5 ~( D0 ]1 |
=========2 ^' N; Q9 [# s) [3 ^- [
2 W; I8 Y$ V5 dThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 I2 N. } A% n" e/ e" z, ]
performed in ring0 (VxD or a ring3 app using the VxdCall)." E. I7 E1 G6 @" {2 P
The Get_DDB service is used to determine whether or not a VxD is installed
3 A2 ]2 ?" Z0 z! h' Hfor the specified device and returns a Device Description Block (in ecx) for) h" N: P! S( k: O
that device if it is installed.$ w, P) ]$ ]+ v; d; Z
& i4 u* E* y" n1 { mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 A/ r3 `2 Z/ w, l/ e- |) [! E
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 {( |- m: [1 A! ]0 E2 J( t! {: j! N
VMMCall Get_DDB
4 F* w0 v! ?) A0 F5 k7 f mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
# i' h! B$ G' ~$ p7 A7 ^4 V( F& Z3 g
- s" D" V/ C7 t0 {* [Note as well that you can easily detect this method with SoftICE:
2 w0 w3 B' H) v7 }) b bpx Get_DDB if ax==0202 || ax==7a5fh
! T \9 |0 p( A9 W) k V% ]( o k1 y: L p8 o/ m* b4 v5 G; X
__________________________________________________________________________
# @+ V/ z8 B5 k3 D- s4 Y# m/ _1 _6 Z _: ^+ s4 F" ?7 n$ k
Method 10% @& G% E5 ]4 C2 @% Y
=========
6 ~5 N n% D) T8 Z+ H/ K; B8 \* x
=>Disable or clear breakpoints before using this feature. DO NOT trace with2 c7 z/ H N" j6 V- B
SoftICE while the option is enable!!) s7 i% p+ c t% y$ S/ q7 S) `
% Q+ C: e3 A6 K7 vThis trick is very efficient:7 J# E& X U9 z- A8 J
by checking the Debug Registers, you can detect if SoftICE is loaded
6 s M" |3 N- V7 ?0 A(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, R* c0 N7 b& a+ tthere are some memory breakpoints set (dr0 to dr3) simply by reading their
8 V2 s6 T7 _. o N8 m+ o& pvalue (in ring0 only). Values can be manipulated and or changed as well
1 r% x8 W! P0 z- L) K5 s0 [(clearing BPMs for instance)/ `$ c y2 @7 P& y3 }
) M/ {, l6 d8 [% d T, r__________________________________________________________________________
( T) {! L8 g% C0 j& ~( h) o& u, e% g
. C" h! \( D& t, ]' iMethod 11
# S' V8 ~4 |* C V=========
! M' B# s6 X# c. R8 C5 t
/ _0 y0 S7 m0 [+ fThis method is most known as 'MeltICE' because it has been freely distributed7 K8 n& L/ B7 b5 l$ d8 T/ b
via www.winfiles.com. However it was first used by NuMega people to allow
8 E1 S$ g6 D( \2 _+ n- l- R. B( b+ OSymbol Loader to check if SoftICE was active or not (the code is located
) d% G4 Y* h6 W+ `; s: ]5 Uinside nmtrans.dll).
* O y g: O0 y- p6 s2 `
7 m7 a- s' v6 V4 e5 uThe way it works is very simple:
, Q. I! L# i( e: r4 qIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" D" R7 W- w- P
WinNT) with the CreateFileA API.
6 _' f/ N7 B9 M$ m0 ^7 L; s( p+ b
Here is a sample (checking for 'SICE'):
' j' g: X R* R) Z6 X' t4 @8 ~/ T- c% a( J: R
BOOL IsSoftIce95Loaded()
b+ u/ ^ m3 `' R' I- v h{
4 ^% }. i2 P5 \; r$ l! f3 ~5 t HANDLE hFile; : j/ Z7 p. u2 W# A6 Y# ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% f" A8 R: Y4 e6 E K
FILE_SHARE_READ | FILE_SHARE_WRITE,0 A; |% C5 w! w' S3 d
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);! B4 @# W0 B3 g" c
if( hFile != INVALID_HANDLE_VALUE )
, r& d" r( G+ ] {! |7 t5 f; Q( @1 S8 f
CloseHandle(hFile);) I0 P1 z3 z1 P$ U5 w" ?4 L7 U
return TRUE;
. _3 w" y" U" I' T( y }
4 s! ]- q0 S9 o return FALSE;
- @- n+ k$ \ Q9 c) Y* a" O}0 | E! L; z, t5 c- s- Y# ^: O' N; d
1 R: s& {0 [3 o8 K8 i9 A$ Y
Although this trick calls the CreateFileA function, don't even expect to be
5 V' `# |) e. s9 \5 d" J) W- M, Nable to intercept it by installing a IFS hook: it will not work, no way!2 d0 ^' s6 r# @* d
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 S! u# P1 w7 l- D1 bservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 Y8 |& s2 O6 o6 N' }and then browse the DDB list until it find the VxD and its DDB_Control_Proc) ~; B! y; \) ]3 j- H- u& ^; p
field.9 Y6 @8 c x. B5 y# D
In fact, its purpose is not to load/unload VxDs but only to send a / |& O" Q o& R: k2 M
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ M0 K0 d! Q Z! V/ D/ nto the VxD Control_Dispatch proc (how the hell a shareware soft could try
! G3 S+ h* C4 Q, n. f. C# _to load/unload a non-dynamically loadable driver such as SoftICE ;-).5 T* F9 L) F# i5 z
If the VxD is loaded, it will always clear eax and the Carry flag to allow& W$ y, e; g- v/ N
its handle to be opened and then, will be detected.
9 j3 [8 B% R' JYou can check that simply by hooking Winice.exe control proc entry point9 @- D' r2 l# d7 k" y( T
while running MeltICE.0 o& J, r& d; Z* m0 {9 M+ l5 |- ?! s2 c
' E1 L {; c# R
9 @6 z! T, _( S5 U' S }
00401067: push 00402025 ; \\.\SICE
6 k3 _7 C3 l! D% v4 b 0040106C: call CreateFileA9 y' m* Z' o7 p$ }
00401071: cmp eax,-001 R1 R0 D' `5 Y3 ^; s
00401074: je 00401091% E2 h% Q) j1 i5 W. o
1 d, ]. }6 @1 I, ^! `8 D
7 j& c/ C9 u- T, ?, V+ n) QThere could be hundreds of BPX you could use to detect this trick.
4 z' S) F ^. S) v7 R5 _-The most classical one is:- T; l2 V# X$ H, v/ W
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 a. n& G' P c" _ *(esp->4+4)=='NTIC'
! G" ~7 h5 d6 o+ P! P. ?
& J! T, v% t( p% n8 Q-The most exotic ones (could be very slooooow :-(
* t. Y$ e& ]. x' J/ U- B0 G BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 3 X0 g4 Q `' U
;will break 3 times :-(
9 _: L2 k( M; q" w- }( z% Y& P; H' W: r/ l
-or (a bit) faster: ( y: ?3 L0 g/ W; y0 M+ O9 l m& h# ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% O* p( S) X, x
5 x w4 \4 x# ]4 w, ], z# t BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) S- N+ m; U0 h' E ;will break 3 times :-(- p- ]! d% A2 k; F
2 C) C5 S' J+ N$ p, s
-Much faster:" @6 V4 X; ]$ [# o- B4 J3 L( `
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
1 k, W7 R0 t% R, T3 e: U' R$ A, d
! \4 p4 ]; z' h. ?* [& JNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
0 P' G/ O M: Qfunction to do the same job:
y! Y0 r% _# N$ R; m' c/ x
& g% j7 u4 a6 b0 {, f/ I/ l3 A push 00 ; OF_READ
8 ~1 w2 Q' X; }0 m- o& L4 a+ I mov eax,[00656634] ; '\\.\SICE',0+ }8 |% h" Y8 s0 L$ x* e3 B
push eax0 ~- Q2 W( S5 \6 U
call KERNEL32!_lopen, c% o5 }" l r, a* W$ v
inc eax
( K k- k! C- k9 A" m: E. f; i5 m jnz 00650589 ; detected5 v9 Q2 w! P2 r0 k8 J! _* O# q
push 00 ; OF_READ
N) y: n% h2 ~4 j# R8 l mov eax,[00656638] ; '\\.\SICE'; A- m) _4 P, a6 ~
push eax
$ ^! U5 H- A' K call KERNEL32!_lopen
) s7 b0 F: a* X! t inc eax% I) q! O4 N/ s6 R
jz 006505ae ; not detected
/ {% a- F5 `) c
1 a+ }) g/ e- Y/ [
1 ?* t9 F. z. m7 c5 u) A# i1 G__________________________________________________________________________
9 U3 b4 M+ A" t; T/ R- L4 d3 t' F6 E
$ v1 r" ` v0 j d8 L6 C5 fMethod 12' \' J+ b% k# C2 G) X
=========7 p8 b3 G3 P3 y/ M; p
5 A- C2 o8 z- i; k' N' C7 cThis trick is similar to int41h/4fh Debugger installation check (code 052 l8 S$ B) t; v( g) {/ ^
& 06) but very limited because it's only available for Win95/98 (not NT)4 |6 p* T& C5 t1 W
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 n5 L1 w# H" I- ~, k& R! ~3 m5 U
7 W2 ]4 Y& V4 y* e1 M. ^
push 0000004fh ; function 4fh$ V, q" A& m( p2 B( F- }
push 002a002ah ; high word specifies which VxD (VWIN32). ~0 I3 J) R' G6 g
; low word specifies which service
5 k* w' `6 L, w A8 p (VWIN32_Int41Dispatch)! w( u* q2 R& i- x, E
call Kernel32!ORD_001 ; VxdCall. X ^2 x& D# H7 ~
cmp ax, 0f386h ; magic number returned by system debuggers A0 w0 x; u0 _2 P! v
jz SoftICE_detected
^$ ?5 s: a* E' I5 c
, N+ C. h/ W: O5 PHere again, several ways to detect it:
1 `4 `* \% T4 ^" Y# r
7 x( o9 h' ^* R BPINT 41 if ax==4f9 Z$ c& q* R- X0 ?3 s9 P. J
% c' {0 [6 U& i0 n5 v BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
# d/ @& {% I7 D' K6 X: ~4 [* D: _. w- I0 X1 l8 h2 r' f( ?+ _
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A" \- P7 \9 ]( K G" S
% Y5 W. A( ^/ S7 E8 }- Y# f BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
r# j1 A3 t' z/ q0 i; P
]/ o5 n: [$ \! a__________________________________________________________________________, I: R' ~" W( H: @3 x
* l- }7 H0 p" p. z0 ?! a( [
Method 133 p- O, f/ `" X3 K% L- _
=========
& p& Z7 H. s- p T, _: }1 Z& o) p- K$ R) G/ Q
Not a real method of detection, but a good way to know if SoftICE is
6 k+ r. J2 u! X+ C- minstalled on a computer and to locate its installation directory.
# [. e5 F! b$ U( mIt is used by few softs which access the following registry keys (usually #2) :9 m% Z( m3 V2 k! ]6 u
( W; j( Q- z: V' ^
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) Q- G1 F: ?; {. a5 b }: d
\Uninstall\SoftICE
' h e2 @1 o L7 Y( f9 z8 K8 e-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- X# ?/ H. V+ U) \-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ V; X% r; b* p' }7 {0 W. C
\App Paths\Loader32.Exe
7 M A/ ]2 I6 N7 X: E
. m0 p5 l8 Z0 q" g5 A: E, G ?3 w6 c" J* v
Note that some nasty apps could then erase all files from SoftICE directory5 n# A; k4 {/ x# Q/ M H6 ?" M
(I faced that once :-(
' `" U$ q% F/ W; N& G. l2 B$ J/ l" _8 `- G
Useful breakpoint to detect it:5 Q' u" x* ]8 n* B/ t
% _) _" _, O+ Q3 d8 Z3 N+ C) R6 ?7 k
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'. |# j9 s2 L0 \( N( E/ @% @9 b/ U
8 ]% x$ c- k- X
__________________________________________________________________________
# X3 g) p9 T* Q7 i7 i2 ~2 Q7 l& d$ \4 ?' {- t
* m! g, a9 ]. A: O. E- s* NMethod 14 ( e. h/ n0 m0 ~% P0 ~) h
=========/ m1 d$ `* O- |# ?4 `2 U3 s
; h9 D6 L( c) X! K6 }3 L0 ]9 ?" {* V
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- o, _9 [) Q# C) |/ {# }5 q( h( ^% ais to determines whether a debugger is running on your system (ring0 only).
$ G0 l1 H3 T3 n0 w9 S& m1 a8 a+ H; s4 n0 o0 p4 n9 y: O
VMMCall Test_Debug_Installed
# O9 d2 O+ J0 {& r+ K7 f je not_installed& D1 r! ]$ f B6 Z2 Y
9 t0 z X4 I& B. O! w- TThis service just checks a flag.
5 s+ {2 j2 ]+ \) G</PRE></TD></TR></TBODY></TABLE> |