<TABLE width=500>. ]0 I4 v x1 Z7 ]5 {: u
<TBODY>
1 f1 ^8 Z& J% y O& @<TR>
; A9 e8 @+ v# `5 \5 C7 [<TD><PRE>Method 01 # `" Y. h' O( ~4 ]! n, D: V9 p
=========
/ s/ j+ I% e) U3 ^) j" H
8 h Z* B$ u2 s6 f/ ^8 jThis method of detection of SoftICE (as well as the following one) is3 b1 k# `2 Z2 } y; R
used by the majority of packers/encryptors found on Internet.
" D* [2 e' L5 c/ \2 n! V1 y4 S6 nIt seeks the signature of BoundsChecker in SoftICE) W' K0 }8 {) P; L, g, z2 a
8 H4 N3 }5 l0 G
mov ebp, 04243484Bh ; 'BCHK'0 G* W1 f8 R/ A
mov ax, 04h5 }& v: T$ _( B2 C- d
int 3
. m( ^! G& T7 R cmp al,49 a& o% P6 y3 K. o5 N) [
jnz SoftICE_Detected' ?' M+ }1 o& k2 r* |8 R
R6 P: p2 D( K
___________________________________________________________________________
7 L3 B4 u, l1 d% r. |+ T9 a
7 Y. Y1 p; Q+ h: K ?Method 02
5 P0 m. I; x: T! T$ X=========
/ m) q- r: N% c# l3 I5 b% K& W( {1 h( r1 c W/ E
Still a method very much used (perhaps the most frequent one). It is used
3 {: Q8 w4 g0 C! j9 V9 \ lto get SoftICE 'Back Door commands' which gives infos on Breakpoints,! f1 h/ ^2 r& m# ^4 U% n
or execute SoftICE commands...
. k! V7 h0 S( i8 r* o8 GIt is also used to crash SoftICE and to force it to execute any commands
/ f. X+ t, [/ d1 W) P(HBOOT...) :-(( x, r* h- C t D3 F A) i5 p
6 f# c* c4 W# D. `0 M* q* O; l3 e- m
Here is a quick description:
# }4 l# W J; Y9 l# y4 `-AX = 0910h (Display string in SIce windows)* `* \; F. v7 {3 B1 r
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 ?8 G) ], r9 D% Y9 ?; V+ K5 Z-AX = 0912h (Get breakpoint infos)
& I6 V- y: d1 j6 g) Q-AX = 0913h (Set Sice breakpoints)
# u# h5 b: \/ K, K/ H3 }-AX = 0914h (Remove SIce breakoints)- a1 H5 E$ j% Y" M
' T$ c* W8 V- H# b# oEach time you'll meet this trick, you'll see:4 r# B u9 n# g
-SI = 4647h
/ G# d/ k' b; S2 S8 g2 d) F$ N-DI = 4A4Dh! T. P" w9 g O2 S, f
Which are the 'magic values' used by SoftIce.
& Y; Y1 X5 L X, Z- P. qFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
^9 O: Y# B+ C/ Y7 _+ \! e
7 v0 w) h! x: `/ GHere is one example from the file "Haspinst.exe" which is the dongle HASP% b3 _8 i* a! W d% |% h" p
Envelope utility use to protect DOS applications:
. e2 d" i0 e4 t, x$ _* A7 N- F( ?" q7 a9 Q0 v% N
. ?. E4 ]9 z# k4C19:0095 MOV AX,0911 ; execute command.
e1 A9 H" f, T s: C2 g4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) g. u# u: A3 j5 I6 ]
4C19:009A MOV SI,4647 ; 1st magic value.8 H. S3 Y" f: w
4C19:009D MOV DI,4A4D ; 2nd magic value.
- ]5 H4 `6 B ?' K8 E4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)9 {1 j2 t6 @" c+ s% w
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ ^7 u/ r* s3 x6 S4C19:00A4 INC CX( ~1 f' A4 _6 X
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
2 [! N5 {5 v; C4 b# I4C19:00A8 JB 0095 ; 6 different commands.
& r3 Q7 z6 s D4C19:00AA JMP 0002 ; Bad_Guy jmp back.# N! a7 w4 z% r' D. ^, h
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
, H. |# ?! \* o1 D/ E. c' L- E) [0 M' Y8 ]2 M
The program will execute 6 different SIce commands located at ds:dx, which. B+ q& B* [' Z, D
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
+ l2 Y H. r- D: T) g* O; H4 M' R9 Z1 ~" C
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) |; y6 B' L8 S( l# G5 j' ^% V___________________________________________________________________________
9 K1 R( v' R5 ^0 Z1 K5 h1 [6 W9 y
0 n: c' N& d/ V& x. F- v/ A! E6 D3 }3 |4 l2 h
Method 03
/ S+ |- |% }' Y$ q5 J, K% [=========
+ n+ W5 h6 c# q5 x% m, |, \7 k. L, |; T2 F$ B6 G7 D4 I
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% o) l8 ]/ W- E+ Q(API Get entry point)
3 L/ C9 _* m% P: C2 I5 L* a ( ]/ I0 U4 {+ T
/ ^1 N* W8 g& J4 ~0 S1 s7 z
xor di,di
8 L% ]; j( y2 L# {6 ]* N" d mov es,di+ o: O# S1 p% c4 R" ~% q. a
mov ax, 1684h
- X) a. o/ F8 f7 w! z( V! F2 U mov bx, 0202h ; VxD ID of winice/ e2 L6 ]5 A0 i% J6 s
int 2Fh
) D S3 g) o+ J2 P& j. B8 i mov ax, es ; ES:DI -> VxD API entry point& t) H/ d P% p/ |6 k: y/ `
add ax, di
" u" }% g8 h; o0 U* z: g7 } test ax,ax
* F) a* z; y$ X% b* ^4 R2 }4 N jnz SoftICE_Detected8 v& P' C" V, y, V+ |/ ]6 Z1 D
0 i# d7 ^( b9 X) L- _/ ?___________________________________________________________________________* F2 b0 f$ I0 ~9 Z7 c2 H+ w
, g! S9 J& g# Q- ^Method 04
" i+ z* ?; l l% g. H' u=========
/ r1 J2 K1 S' Y2 v. P9 A) l% X' b' a# \* F
Method identical to the preceding one except that it seeks the ID of SoftICE
# {4 C0 z( ?# b! J( UGFX VxD.
4 d5 O* d- a7 Z) |1 ^
+ Y' c: x, q# k. C% J* N9 H xor di,di O, Q3 X1 M: T
mov es,di& `( W! ?" D" P; {
mov ax, 1684h , v* Z5 u( v0 H; H4 a! m
mov bx, 7a5Fh ; VxD ID of SIWVID" x: b0 M( z+ }# |/ C$ n
int 2fh
; X; E1 M. Z% M" _. y" y2 B mov ax, es ; ES:DI -> VxD API entry point8 k- x5 ^ {( `% ~# ^& q
add ax, di
/ K3 I9 a0 S( f' @ H) M2 ]- p8 O test ax,ax
* C6 I* j& e E jnz SoftICE_Detected' y; M3 h( ~6 `( {7 l
0 K# K/ |/ A: c5 [. z__________________________________________________________________________. U, m! r6 x2 }! n
& r4 ?, Q! m/ F- t
" _& l! E" P* {/ w; bMethod 059 a# z, H; ]" e" h
=========$ a' V8 b7 w/ C6 n! U" m) E. Y _2 X
' K7 o9 |1 a+ L' C
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 B+ B; i5 t9 v( j) e) E6 Ddebugger. It calls the int 41h, function 4Fh.3 k6 z+ S$ `3 ~; x
There are several alternatives.
# z: h N8 i. Z- V5 c W
5 m. \$ N z- C6 }1 U+ U' B2 RThe following one is the simplest:2 b. Y1 F! r% B' t: Q5 z% a
. C2 Q A2 c; `( N mov ax,4fh' m- e ?( e/ t5 {" C* ]
int 41h$ m2 ~. @# k o" s2 [4 G9 b/ G
cmp ax, 0F386) ]. l7 B( ]% }; \* V7 m8 ]
jz SoftICE_detected
; A. T. C+ e& N( c g8 `$ @/ w k- G# X1 U# S, n& a( l6 {
1 q: \$ A7 X$ e; @( B7 P1 v) b$ N
Next method as well as the following one are 2 examples from Stone's
4 {. L/ J4 ?9 s' T, h h5 @"stn-wid.zip" (www.cracking.net):' f& k% v: E* m. a* I5 ~
+ N$ _) h& Y, R. Z3 i
mov bx, cs1 D) n3 i) K0 p6 z% x
lea dx, int41handler29 @! f6 o- v& a- q
xchg dx, es:[41h*4]
/ k* v$ c+ g% @1 p- r i4 { @ xchg bx, es:[41h*4+2]5 \7 p- T5 [% z [- V' X7 ?6 }
mov ax,4fh3 }1 i. ]# D5 Q6 n) v) S
int 41h
+ C( G6 ~6 k7 t6 k4 \/ \ xchg dx, es:[41h*4]" ^& i9 G# f. M- g
xchg bx, es:[41h*4+2]4 G/ b; b! W8 P9 \4 s) ~
cmp ax, 0f386h* w x. T: x2 t. m
jz SoftICE_detected s' Q/ s7 f2 v2 S. P( J, h) X3 O
0 t1 Y, _2 o6 \! W$ Eint41handler2 PROC
, S; y! P7 A9 J* z iret
# y! Y# j" Z. O5 f; X% O8 zint41handler2 ENDP
; c3 p x: p1 O! c5 ?( g
5 {3 j8 J. h1 @, X% r. S% w) B5 [: H+ w
_________________________________________________________________________1 `% @" G) z8 N5 {4 I7 A4 R
; y; m& \* z0 P$ U, a5 K! {# i1 L( K, A' M! b. C
Method 06
& u7 S5 i7 M5 d; K0 D=========1 W9 O' w8 F3 z+ k- d* B; S' r$ j% @
" `( [0 D0 ]" L- E2 O( l, E+ y7 y8 L, K. m8 Y
2nd method similar to the preceding one but more difficult to detect:/ _6 ^, v, f& ^. S& }
$ {& O" h, h0 W' J
! S G3 g. \+ y0 Y( C; n4 L' g
int41handler PROC8 e3 \) k6 |/ L: h; \/ J
mov cl,al$ Z5 }2 x2 p' X( l) z# t0 L
iret
' u" _, [3 p1 qint41handler ENDP
1 Y9 e' \& K8 A* Q% a8 h0 k$ D+ V" P( }
% t0 I" c+ i. ^0 q xor ax,ax7 P7 e+ O: `) k+ \3 K
mov es,ax& h; U4 _; t7 c. h. e8 L2 c
mov bx, cs* j N& l5 i& u9 R4 q1 p
lea dx, int41handler
. m I& y* Q( l8 t xchg dx, es:[41h*4]7 I8 j, N' q2 ^' G( g2 |, I, g
xchg bx, es:[41h*4+2]
: |% }( b. Z6 ]) p8 L* Z- q2 q1 P in al, 40h
; N) B& }% f n1 w- I7 A$ c xor cx,cx G" X. O2 g8 a. F/ U4 P- F- g
int 41h
4 F4 l& y7 Y; Z# h8 b- N xchg dx, es:[41h*4]
& b. u5 g P0 d( U* g g xchg bx, es:[41h*4+2]
. I% Q( }! M. ^. c9 Z+ ~7 q cmp cl,al7 Y7 y* q9 |2 T3 w* X- P" b, z
jnz SoftICE_detected7 e. K/ ?: w, k
+ Z) H( y! _2 K' V/ v" V7 F6 e
_________________________________________________________________________. x6 v& q8 t7 j" R$ \/ F+ b5 }
) u3 [' b% H0 \/ h' XMethod 07# d' d& K( A8 k5 d0 d
=========
: K \$ v9 ?" ]# G; d3 m9 \9 w+ X" d M- n& _
Method of detection of the WinICE handler in the int68h (V86)
& ?5 C% y: v- j0 ~4 o# i( m& {# E% D/ R% ], T: x/ |
mov ah,43h1 r" S, c- z5 z' S1 U) M
int 68h! t% f" w6 c) f
cmp ax,0F386h% F! I6 V! y5 A& n8 `
jz SoftICE_Detected
6 h" y! P5 \ C0 {" }' E( y
7 V* u) v, _3 S3 I% M# T2 d. k2 p \$ m1 X! a( x
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: C( b+ _/ y1 h4 s( S9 n
app like this:+ b$ h+ e6 ~: W
8 Q- V- [0 e8 \1 B- l6 z3 h
BPX exec_int if ax==68% I4 X/ q9 p* {( C2 U8 B) k
(function called is located at byte ptr [ebp+1Dh] and client eip is
& _' Z h0 r( T! Z! j9 a Q0 Z located at [ebp+48h] for 32Bit apps)
* ~- o$ U- o$ e4 u. |__________________________________________________________________________
6 _ n) u+ w1 s, i, ]) B) B K+ T( i) h! T; n4 {
' @% H9 F+ `# SMethod 08; V1 k- {9 v; z5 G
=========' V: J* f- F+ S3 {# D2 H7 ?. e2 _+ _
2 R" b4 V+ j( Z1 p% Z+ B
It is not a method of detection of SoftICE but a possibility to crash the
( m' o2 _ Z& Rsystem by intercepting int 01h and int 03h and redirecting them to another2 O) x7 h0 T6 i( E/ {$ E
routine.3 w* w% R6 M. g: p: n# @
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 }+ e0 J) T& ~: Z8 z/ a
to the new routine to execute (hangs computer...)9 W# z$ p; J7 N2 L& g! S2 G
1 T, u {: H& ]) U" v' Q6 w. } mov ah, 25h
$ Q3 c0 ?" f, X- u. j1 Z/ P- `, f mov al, Int_Number (01h or 03h)
2 @! c: m$ e0 q4 B8 z mov dx, offset New_Int_Routine7 f& X4 z( z2 M; b
int 21h" Z6 F/ K* \! X' {* k; e7 s
- n1 q6 ?0 e1 t' L; s4 |
__________________________________________________________________________
; k5 x$ f1 z E8 e& V6 ^1 w/ H
& d. A: o, T: O1 {( ]/ @Method 093 d; a! I2 y* N3 m
=========
O6 \( ^. O/ e+ ^* z2 w' X( X* T9 j) A+ v/ t3 Z# t
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 l( Y& N- V; c- A7 y8 q- Uperformed in ring0 (VxD or a ring3 app using the VxdCall). V, C1 {4 P2 A8 f/ |" [% n
The Get_DDB service is used to determine whether or not a VxD is installed
" q! ?7 N, Y4 |3 p% B* efor the specified device and returns a Device Description Block (in ecx) for
5 R4 G. v) u ^; bthat device if it is installed., a6 m; ~# p2 a
" @# n* Y4 y- y) U mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 F2 n3 r2 O* b* [- t6 G
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ v8 B9 H4 p5 g% \" u; W1 K VMMCall Get_DDB4 U+ s; T' Z* H* ^* H& ~ b
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 J: ?- n" F; X; I0 }! G4 W% M: p8 J( i# X9 ]; ^( I
Note as well that you can easily detect this method with SoftICE:6 ^2 N% u+ `7 y W
bpx Get_DDB if ax==0202 || ax==7a5fh
( ]; S& c/ _0 Y6 o9 [
/ ?( y6 G3 }* ^' t__________________________________________________________________________
+ C& c+ V0 q/ c8 a2 D$ `# ^4 l1 L& C
Method 10
3 {+ Y$ G; s. k/ y' _ W1 U5 t' N=========. K" k8 U+ a" h( b" L
5 ]5 h1 m; ]3 g: V& H8 A4 q7 P=>Disable or clear breakpoints before using this feature. DO NOT trace with
! x# C1 ?% M) i' x+ m SoftICE while the option is enable!!# y. b8 `& P2 i4 z" T( \
& p6 M5 ^. V7 }9 N G4 @
This trick is very efficient: k7 R8 @. |4 M( n# i6 O
by checking the Debug Registers, you can detect if SoftICE is loaded
9 [. Y/ {# N! Z0 e1 ](dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! M( O& L7 D8 a# sthere are some memory breakpoints set (dr0 to dr3) simply by reading their
* L0 b, Z! e1 Z6 B5 nvalue (in ring0 only). Values can be manipulated and or changed as well: q9 ?4 w& r1 Z/ \6 n
(clearing BPMs for instance)6 e3 K2 A2 b- z( C2 A
4 K1 ~; x5 \; Q% M5 t% r
__________________________________________________________________________' B+ c% `/ }' r9 T% ^0 Q4 \* L
% h- t7 j E8 R9 gMethod 11& O( U4 D* p# @$ @5 Z: y) h
=========
/ m% P) ?, Y0 T+ x0 d
( ^7 q6 W) B" A9 n9 t& {, fThis method is most known as 'MeltICE' because it has been freely distributed" t4 n/ H+ g2 I, n( l0 R# z
via www.winfiles.com. However it was first used by NuMega people to allow, @- R# p9 y/ c8 n9 F# n" k
Symbol Loader to check if SoftICE was active or not (the code is located
3 K+ o$ i' ]/ X5 iinside nmtrans.dll)., v* b3 E6 e% Y" M
% i; L7 u: R, L: a' t- L) |
The way it works is very simple:* u+ d. S% ], H; C
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- P: T" z* X: g* k+ S9 m7 d& i
WinNT) with the CreateFileA API.) u0 a3 o# h5 j
5 S1 M$ e, ?$ r0 n: Y7 YHere is a sample (checking for 'SICE'):, }+ j; w4 Z( G+ r3 x# W
$ Q0 \2 R! v, w6 ^BOOL IsSoftIce95Loaded()
% r7 @. o: |! j. w7 u, N/ Y{
' |* j& L1 s# _: Q! q$ X) A HANDLE hFile;
3 q+ r5 U) n8 o' K hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 h/ c) N( k I& |( z4 x
FILE_SHARE_READ | FILE_SHARE_WRITE,
9 s: C( V- T" q5 ~ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
, [. W+ G1 ^; o- q* B# A if( hFile != INVALID_HANDLE_VALUE )
% K% C! A/ q+ j$ k: C9 h) C5 O {
( ~" J0 Z! t7 P: X8 [1 g* t; C CloseHandle(hFile);
# \/ m L' h$ U# ?: v" ?+ D+ t return TRUE;/ R5 R4 c- P: M
}
, i. y W4 m2 _5 O* C5 r) Z% E- o9 i! J return FALSE;4 a) H& ^' B/ T
}
- ]3 Y( O |/ {* x
' k1 Z4 {5 x7 E7 }9 X6 |Although this trick calls the CreateFileA function, don't even expect to be
& N% h: r; K& u7 |" Q! Xable to intercept it by installing a IFS hook: it will not work, no way!
7 Y4 _( _" C6 o/ I# EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F+ n4 J. @2 }; U0 M6 g0 D
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- q9 ? t, p8 ^, ~) }% T) Rand then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 l4 E( ^# r6 x* ~6 D( ^' xfield.
1 ~0 y) |* X8 `/ g" H5 FIn fact, its purpose is not to load/unload VxDs but only to send a / w4 h. E* ^: s q" Z" c# ^
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
6 H1 C% ]7 R0 Y0 V" n8 f: mto the VxD Control_Dispatch proc (how the hell a shareware soft could try
. Y( I: l; U( _, |to load/unload a non-dynamically loadable driver such as SoftICE ;-).4 I, r& N& C- D2 c8 v6 h0 i$ Z
If the VxD is loaded, it will always clear eax and the Carry flag to allow
# }+ {" |5 P$ `$ n: D' Eits handle to be opened and then, will be detected.- I+ S) ?# _- n. i: L* e; O3 X! a3 J
You can check that simply by hooking Winice.exe control proc entry point/ J. r1 W% @, D
while running MeltICE.
9 U- a3 z, @* q0 k/ x1 K! @' h/ a& }) F8 ~8 B6 t; E% E5 g1 ^7 \
6 g$ z$ X3 B. M2 O, M 00401067: push 00402025 ; \\.\SICE! y8 P; N( t1 j2 G* W
0040106C: call CreateFileA( ^1 _3 t' t$ M% o: _$ ?& N
00401071: cmp eax,-001
; f' n- P! e4 Z( c$ t, A 00401074: je 004010919 M' L& |* w$ Q( Y% n5 R+ F# i
& J- q; z# T8 J2 `$ N* ?
3 y8 v/ ?' y- s' ?. GThere could be hundreds of BPX you could use to detect this trick.. S: @" {; K: F) H x% y
-The most classical one is:7 ^& i2 X+ E. |+ _
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 D- |4 D; }' B9 a *(esp->4+4)=='NTIC'
. g/ f3 X* m' ~4 } |
- a, D8 e& s" ]( A( @$ V D& y-The most exotic ones (could be very slooooow :-(. l4 v6 m6 z2 G
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. g1 r: k# o2 x) x ;will break 3 times :-(7 q: r3 n) Q0 j9 R: d0 A5 C
8 D7 l" O7 o0 r) }0 \! r
-or (a bit) faster:
0 c' b9 Y' j) S: d BPINT 30 if (*edi=='SICE' || *edi=='SIWV')6 k9 ]6 a1 j2 l2 i1 T4 X* I
) y0 R. f8 F; [ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 V4 L$ p$ b; ]5 z& G1 a ;will break 3 times :-(* g6 w* R. ?) i2 E3 Z3 e
6 u+ }1 W$ U* D: ^
-Much faster:! X! I! _8 ^+ B" k* e2 K; H
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
% _! v( ?* L7 L) ?3 W4 z
5 r, ~+ |& R- G" e, p5 qNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 V3 i- c: t- M5 r0 rfunction to do the same job:
o& f2 G/ [# P( j+ y- T. U: i
( C" [$ ]7 |0 a+ T# ]( a" Q: b W0 ]9 e push 00 ; OF_READ" g! L5 a3 Z2 z5 l3 H& P
mov eax,[00656634] ; '\\.\SICE',01 v8 L- e3 }5 v$ L4 Q- _
push eax
" c2 y+ @& U/ u2 D0 b call KERNEL32!_lopen" B' X" W) o7 N' i) \3 U+ F* ~
inc eax, G9 C8 `1 K' g4 ]1 @* b
jnz 00650589 ; detected& p+ {+ a6 F: m8 H; @# O6 W
push 00 ; OF_READ
! [% |4 T. E5 J9 N0 C3 K0 f/ v: X mov eax,[00656638] ; '\\.\SICE'
. a" _: e+ V+ k push eax! z$ e8 n0 @9 r+ u6 A4 d
call KERNEL32!_lopen
2 e+ |' Y7 i1 }5 W. p inc eax6 f l, f' A$ Y9 x" Q9 ?8 ~8 `. r
jz 006505ae ; not detected
0 M6 G6 G( I9 x+ c* I; t: Y% `2 c1 f# u; F* d$ Q
; t' P7 }$ X, C0 d% o
__________________________________________________________________________
]: t q$ _% {9 C- W. `9 t8 Q* R* A% b1 [% s
Method 12; d; \8 w' f+ `* a
=========; X D5 x- K9 p5 C2 X0 `
5 X4 o* L+ N7 e3 H- j7 r
This trick is similar to int41h/4fh Debugger installation check (code 05
, `. d/ D' @; e# Q/ H# K3 o& 06) but very limited because it's only available for Win95/98 (not NT)
+ e, ?2 }. R, _, h5 L4 T0 oas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
! D' z+ ?0 @& J/ K; D5 u) l1 C3 `0 o' r6 w
push 0000004fh ; function 4fh% Y5 F6 \: x9 x, P( Y) {
push 002a002ah ; high word specifies which VxD (VWIN32)- ~4 B+ i2 ]9 P( m# d; {; \; S0 T
; low word specifies which service
8 |+ \0 y- n* X2 ]5 o (VWIN32_Int41Dispatch)/ U. e j) V+ d, W* R" H+ i
call Kernel32!ORD_001 ; VxdCall
. ^9 q! l* a+ x% H7 N' L cmp ax, 0f386h ; magic number returned by system debuggers
& a" i, y3 F6 Q jz SoftICE_detected" S' s. {: e5 J# `" u
$ P7 ~; g. h T7 RHere again, several ways to detect it:
. ~2 e3 T4 U# y1 ]" ]/ \( c, D3 q; v& w `4 i
BPINT 41 if ax==4f' _ C! [6 ?7 @# |2 Y# ^" s( ]
# w, g2 Z! x& L3 ^8 e4 A BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 t/ s# d) z: |) E' s
. O# m6 m' G% ?6 C9 n/ r
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
& e" T3 N$ U: d5 M7 f& w& l2 U7 `; r% {; o: \
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! r! t$ ]4 [( H, k4 {) [# v1 x: S. j5 p
__________________________________________________________________________
5 B: R% v$ W) t/ g/ y( c+ f" x5 H, P; O4 v) _
Method 13% C! l: I3 q6 L, Q* _7 u& G) n
=========6 i1 c1 z, X- E
+ r7 i9 J5 f5 t( ~5 F, R2 u3 p2 qNot a real method of detection, but a good way to know if SoftICE is
" D4 g! ^6 ?- h$ _installed on a computer and to locate its installation directory.* D- `& ]5 E/ v5 U8 W1 @5 C
It is used by few softs which access the following registry keys (usually #2) :2 g4 x$ q! n: _/ E; Z* t
/ ?4 ?. e1 Y# T
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* n. e$ y. K% v+ ^\Uninstall\SoftICE* ?8 R; o' W* X7 c9 n) X
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE _" z; p h7 J- d
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 L6 M& x/ p, L, r7 X
\App Paths\Loader32.Exe
6 {# w ~# S" M& P! G/ \ o: ]" A' l7 o) S2 j# k
' Z5 N9 D! _7 L8 N; v& r& dNote that some nasty apps could then erase all files from SoftICE directory' l. T" I7 V- A% V3 D0 A J. y
(I faced that once :-(
0 U& x6 B- T% E# U) w: m8 K- g) B; X$ s/ P% a
Useful breakpoint to detect it:! r: V9 f* N5 }* ~" r6 R; ~. I2 C
# P! N4 s/ w: v* H8 v6 e7 w. i. T" Y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 y$ l+ }7 C9 q5 S
6 G" P% l; f/ l
__________________________________________________________________________
, @& y8 m2 K: m
. W2 h( ~4 l* D* s! r
5 t/ A% V" P2 K) C) V4 \Method 14
0 |, k% s4 F- W; r4 J=========
4 H( z2 m0 z9 E ]% r0 `$ _
* G! H* ?. A7 X8 a- wA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 [# c9 `) @; E1 M5 v' t' ?" M) lis to determines whether a debugger is running on your system (ring0 only).3 X' X* I) C5 K5 B3 y
- f" L h) z# o$ u3 c7 ~& u5 e8 J9 a
VMMCall Test_Debug_Installed; {! {0 t- B4 P( ^
je not_installed
f4 d$ {; \" a' e
# G$ f4 O# l: _0 [2 C7 ZThis service just checks a flag.0 T% _( B# ?6 A: M3 G- n7 ]1 j
</PRE></TD></TR></TBODY></TABLE> |