<TABLE width=500>
/ i H' V3 B8 `9 y) W; S0 ?6 _" N<TBODY>( H0 {" h/ j$ |( Z- g9 j7 o3 L5 t2 \& G
<TR>
9 s D+ [ ~: ?<TD><PRE>Method 01
8 I- f/ j& k3 S=========
/ A( E5 s, `) j
2 d: ~) x2 {0 S0 V9 c" L( rThis method of detection of SoftICE (as well as the following one) is
2 v1 C8 @* V6 w* jused by the majority of packers/encryptors found on Internet.) O& g9 B! u' ~2 m! U, Z( j
It seeks the signature of BoundsChecker in SoftICE
- k5 N) Q, g4 S4 T4 P$ g ^1 p, H6 O) G$ Q
mov ebp, 04243484Bh ; 'BCHK': o, Z `+ b" D& ]6 s4 t$ k, u. U
mov ax, 04h
$ u5 l2 x4 C& c int 3 : j; \ M6 v; o8 P- h
cmp al,4
/ i, D8 w' _$ z/ L& r" B jnz SoftICE_Detected
) A! E1 ?. y p) D5 r# s
" F- M @4 Q& q2 }3 M- O___________________________________________________________________________0 D( Y2 |; h, C' C$ y. U! r
2 j! g$ u1 l! @4 }: B
Method 02
3 h9 E% L# o0 N& q=========
$ V6 x* o, T. Q. M; [) O% O9 f/ V u# U: U8 M) B+ U/ d0 o
Still a method very much used (perhaps the most frequent one). It is used
7 T' k5 H* ]1 I3 l6 c9 I+ M c' dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,; q9 _6 P: @$ Q$ V
or execute SoftICE commands...
. Q/ b2 e/ b( [$ A9 f( }It is also used to crash SoftICE and to force it to execute any commands
9 |! Q0 g. ^' x: Y3 [(HBOOT...) :-((
. x9 V6 m% [5 j8 u2 j, H! A# s5 C" |3 x
Here is a quick description:
}' A, a* }% n6 @/ u-AX = 0910h (Display string in SIce windows)& W6 ^% P% s. X* z; G6 u5 y6 |6 i
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ I; z! k0 T; P* G @, T-AX = 0912h (Get breakpoint infos)1 p, c& t' q/ W0 }. M2 E
-AX = 0913h (Set Sice breakpoints)% [$ |2 v+ H$ E) y" u$ ?; ^
-AX = 0914h (Remove SIce breakoints)
1 Z, _3 p/ @ ~, v2 `$ c8 w/ V( t0 Q1 L% e: C/ Q5 d- s
Each time you'll meet this trick, you'll see:) J# @+ h6 r% Q9 I
-SI = 4647h
. x4 q% L: b& t9 g @8 Y7 Q- I4 R-DI = 4A4Dh
/ u% ?. N# H" y4 ]0 Z+ P% N) G8 eWhich are the 'magic values' used by SoftIce.( \* P8 H2 k6 y& }3 l# |" P, }( M
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ u9 K) a6 B9 A7 K
/ T. u* e( T6 k6 K- N% WHere is one example from the file "Haspinst.exe" which is the dongle HASP" Z ?6 L3 K* m9 D: }4 m
Envelope utility use to protect DOS applications:
7 g2 M" A/ K7 |; ?: V4 B% ^# Q9 m+ E/ l. m S
1 W6 M- x: q! R: B- b! o: v' N4C19:0095 MOV AX,0911 ; execute command.
( z: b* E* Z( x1 W$ t3 M4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
: t/ h( j: { t9 c4C19:009A MOV SI,4647 ; 1st magic value. O; p8 F% b' w
4C19:009D MOV DI,4A4D ; 2nd magic value.5 c' u9 E1 H% R' j7 p
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ K( a, [* I4 l, ]/ N; h1 V) ], T! Y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute6 d5 E r; m8 x, }, A1 p5 s9 s5 K9 k
4C19:00A4 INC CX5 x- W# A7 U1 h3 N8 q( c
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 L/ {2 v" Q+ D! j( w4 t4C19:00A8 JB 0095 ; 6 different commands.. @( R; e& } ]; z' j( Q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.5 Q5 J% D- ~3 k! V2 C. h
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)- b4 }, f2 U4 n! \
7 S5 L" H2 I5 D# zThe program will execute 6 different SIce commands located at ds:dx, which
+ c& y" W& k( H5 x) iare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 [2 I9 m4 r! z& V x+ V
7 q2 `5 p( h# F: ?* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., O0 ?6 k5 k2 c: p5 Z. m6 K$ c
___________________________________________________________________________
6 _6 m3 g& `9 ^& \9 H) l! {- Z" ?$ [9 `- v5 _
0 u7 f' K1 R& \" f, RMethod 03
" o, H5 T0 R/ o$ T) k3 F4 D/ F=========4 `( W: m1 S+ ?/ Z; ]
( M$ T6 ~( l" G4 S4 n! n2 hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 a/ J" X7 {$ ]
(API Get entry point)
2 O$ F/ k. _: U5 H1 ]# u ' A6 Y! E+ s0 Z D* U. S: F
( r1 v9 T5 v6 n' [. t5 L1 m
xor di,di1 S( u) b4 S) @
mov es,di
2 T& J+ X6 y, K& O; z mov ax, 1684h w( _- n3 W6 ]* f
mov bx, 0202h ; VxD ID of winice7 J0 F1 [! G" W" l
int 2Fh7 r4 z6 g! g9 Z: I* l# p
mov ax, es ; ES:DI -> VxD API entry point
8 a" x) H Z/ Z; A add ax, di- @! W: B! l7 r" [9 T/ G: s
test ax,ax
4 K4 Y) T Z9 L9 | jnz SoftICE_Detected5 b+ w ?/ P- x2 j; y
$ U* s6 _; A: C) v/ H& T
___________________________________________________________________________% ^& v2 V# |" G) X/ g2 x4 B! ^
5 V8 p, X' T r6 U3 rMethod 04. X7 h3 g( ]# A" c- y+ `6 H
=========
* f' @9 }1 O" a* i) W/ v f( K
' _2 g9 T' u7 U; W8 K% j# TMethod identical to the preceding one except that it seeks the ID of SoftICE3 X/ h9 J$ K" D# c
GFX VxD.6 M5 g& L5 I1 e" C
2 d$ j5 \+ J! x3 L" b ^7 \5 O xor di,di2 y( K- O) }* g! W6 O: j% B
mov es,di4 b' b+ D, H9 m4 c6 e0 A
mov ax, 1684h ) \. }9 F9 ~' r3 t6 t4 D
mov bx, 7a5Fh ; VxD ID of SIWVID4 w9 } X# U. z
int 2fh' M( _$ z3 K% A9 t2 x) g1 j
mov ax, es ; ES:DI -> VxD API entry point+ ?2 v5 R; d8 U. ^' P
add ax, di
; F; N0 B$ t1 A: c test ax,ax! `) D+ U) v' |# z' J' E! F5 ]% q
jnz SoftICE_Detected5 L; x5 V( A3 W9 z' I
. N- N5 `/ ^$ ]- n
__________________________________________________________________________
# F4 v {5 V. Q* @( T5 ~' {, B; R+ i1 V* y# e+ {
. W- B) [3 D' ^" m8 HMethod 050 ~" H3 t4 c1 h; n. u, y c
=========' `* c1 c3 M. W$ e# A9 g
/ Z1 X0 \) J" I- k- }Method seeking the 'magic number' 0F386h returned (in ax) by all system
8 n/ N, ^/ |- [1 {2 wdebugger. It calls the int 41h, function 4Fh.1 w6 @8 G3 v- k, j
There are several alternatives. * B, m: f1 J- F1 {7 w
5 _# t6 {* F4 W2 TThe following one is the simplest:
5 }) A0 J8 i* [: B2 X" W7 r" M. o% C5 I+ M+ u; [
mov ax,4fh
4 }- f1 B4 I) l% t: x- d int 41h: T# L8 p6 n& u5 d1 T
cmp ax, 0F386
( N9 M# X. g# F; k& Q jz SoftICE_detected; w( `* b3 _# F, f+ T; _
& G# n [: s9 Q; Q( M7 g* f1 q" s
) U2 N! f( F3 O+ @* A1 E4 m# |Next method as well as the following one are 2 examples from Stone's
8 Z) r! M. W0 W% c+ m" m8 H L"stn-wid.zip" (www.cracking.net):
" A$ M: J3 p& E l
8 K# i" e/ y L. t. @7 I3 V mov bx, cs E7 V0 S- u/ M' Q y. E
lea dx, int41handler2
. e0 F- c7 y) C" D4 k xchg dx, es:[41h*4]6 F9 Z" c7 p' b; P
xchg bx, es:[41h*4+2]. A& A! q' }$ v7 O
mov ax,4fh
. {9 B+ i: M2 z* h int 41h" v3 K- T6 K/ c3 n9 X+ C
xchg dx, es:[41h*4]
$ J. n' q( f5 ?+ C b xchg bx, es:[41h*4+2]
% H" m8 @5 f, f/ T6 | cmp ax, 0f386h* L( N4 M) V$ |
jz SoftICE_detected' ?" X, E! e: t4 i3 d% l
1 T9 f( H( U. u R3 H3 @/ Y0 ^
int41handler2 PROC) J& n. l% I' y- y3 h, E
iret
# J" c6 _3 w: [+ o2 }2 }& ^% Uint41handler2 ENDP+ y( |& k3 f$ @9 G8 }: {, B
9 C; D0 J m r+ z5 E: p9 l
7 V, O. l* }, O& {: s4 |1 B_________________________________________________________________________
" d7 g9 `5 V( s6 N) q7 X0 n7 i
5 |% m, q) M0 h. [: o: {& g3 S
: M/ N3 _# ~. y' L8 K$ q9 OMethod 06
; M6 M# y$ Q0 @- _& o, F$ u. C=========& d7 M# x2 X b6 A* v
8 K, k9 z- S! g) I
2 {) s; _6 f- t$ M) R2nd method similar to the preceding one but more difficult to detect:8 v# d; r4 v4 a7 I, E. i- h
& |! v8 ~! K9 t
' X* v& K' Q/ S8 \* e6 Z
int41handler PROC# ?# O/ j$ C( `& U" w
mov cl,al
5 @; }, O9 w7 H( @ iret5 ]8 j# L7 J! y4 Z& S) n
int41handler ENDP
- @$ }, }6 L; C3 V: t8 S7 i
: z" e$ `4 ]' \0 _* B5 r
8 z/ q g) M% H) T9 h7 a xor ax,ax
% g1 b+ T: h( R! b" o. n0 h1 u mov es,ax ]- m7 C/ d0 g k' Y5 u% U
mov bx, cs
6 ? ]5 }9 M9 T1 h1 o# _: x0 z lea dx, int41handler
8 {9 s8 J7 V3 K) I: H0 H! s9 B) b6 Y; A xchg dx, es:[41h*4]9 M6 \. f. i$ L/ }& {
xchg bx, es:[41h*4+2]
# E9 `0 e7 n* c% k- _, j in al, 40h# V+ o: G. `6 G- Z4 ] I0 Q
xor cx,cx, R% p: j! X7 @6 n1 w3 j' ^
int 41h
1 \0 I6 |6 x# x; d5 n, L0 | xchg dx, es:[41h*4]& ~1 K6 Q( _3 o- f
xchg bx, es:[41h*4+2]
: [: q3 A( ?4 K9 P; b9 G1 y cmp cl,al
/ ?6 A+ o7 j2 ?, |& T jnz SoftICE_detected
; w0 y3 y: x6 X6 y
* e, _! O1 J5 b7 C_________________________________________________________________________! |4 S1 z2 x$ m0 y/ l* Z4 N
8 F x- ], @# I- v) K
Method 07
$ d& x' n9 W, X! B5 @3 N=========% N5 {% }$ W2 I# i9 ^5 l9 C, e& W& K/ e
0 C. `& u7 e* ]+ J. G
Method of detection of the WinICE handler in the int68h (V86)7 x/ C% e! F% r1 r
& P. X) f6 |+ B2 Z- @# s
mov ah,43h
: w/ _+ B- p/ w: `% V4 P int 68h
@5 {1 Y- \& ]8 J) c3 _2 X2 @% p cmp ax,0F386h9 x ^& B4 u5 T2 q" ]& S2 j
jz SoftICE_Detected
, t% y9 f. B+ B) P* y3 |, _- a6 V( c- |2 } f9 q
6 T+ ]2 X1 O* J0 T3 x7 y8 Q. {=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, A( B( x. w; A/ k- O2 r
app like this:
$ p( v. I2 z3 }- C3 X5 j0 H. D% f: X
5 Z+ d# {" q. U! K. [2 z BPX exec_int if ax==68, j% e' c F$ P
(function called is located at byte ptr [ebp+1Dh] and client eip is
9 A2 h' h) B/ h; r' n0 ^+ q located at [ebp+48h] for 32Bit apps); g* Z( @) R6 {# @6 v9 x9 e+ Z% M5 b5 t
__________________________________________________________________________! Q, Q6 [( o3 C
9 f; @3 t9 {. f3 m3 t
# e' a) d4 @% D N% k+ M# NMethod 08" j, M1 O' y# @& {: r6 f$ e7 [
=========3 S0 k. Q& Z4 e4 \3 Y
1 C) z: r# ?9 C7 O) `' T# `It is not a method of detection of SoftICE but a possibility to crash the
; {% B% ~; J, O& wsystem by intercepting int 01h and int 03h and redirecting them to another
E# H, g/ e) o- }, a$ \routine.
: x0 C( b1 E" `) s" y" |6 }It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points: ]& \6 G0 G, j+ d2 n
to the new routine to execute (hangs computer...)1 M1 ~8 I) i6 v5 M: w
! m; n. I' r# l- j mov ah, 25h
5 U9 ^' c! M! P2 g S3 \ u; ? mov al, Int_Number (01h or 03h), R% s$ V) v5 u4 _# N
mov dx, offset New_Int_Routine
+ M- F; F* e0 ], B int 21h
/ A) |* I* e/ P* _
- I! q4 s ]# K/ ^% T- ?6 Q. }__________________________________________________________________________0 M3 j; F3 i' P% g% q' P) q
7 ~4 p+ o9 G& K2 c9 D
Method 09( D7 r( M3 M0 f- I
=========
, P4 s+ P& R6 e+ _& o% H$ h
, Q" s& t6 \) F9 l, g# Q2 U# O% e$ HThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ t* l' ^! K8 H' M! p; Bperformed in ring0 (VxD or a ring3 app using the VxdCall).( Y4 }5 D. W0 T7 R$ w. }
The Get_DDB service is used to determine whether or not a VxD is installed
8 E4 L! V/ d6 s. s* h, q; h1 \for the specified device and returns a Device Description Block (in ecx) for
4 b- b/ M; d. f" Y1 \that device if it is installed.
& F, T; V( Z+ I4 S- q& {1 A/ p+ s" ^) {7 ?$ c: H
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID) J9 B% V; y3 ^% f$ n* \6 A
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
8 X/ e2 z" O% u3 Y- }& E VMMCall Get_DDB
" `( q( i) v5 U1 m) e7 d8 M mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: o+ }. S5 [5 R$ k+ y
) b8 o% U1 i8 R3 M' b i, f% l
Note as well that you can easily detect this method with SoftICE:
7 a" p. `* |4 @7 m W* G, m% C6 _ bpx Get_DDB if ax==0202 || ax==7a5fh
! v. @6 f, I. y* @. b7 \9 v
- V/ G8 n( g; Y. |$ T3 D7 U5 x__________________________________________________________________________, A3 j. l5 } Q$ \7 @0 o4 y
$ p& H- R+ f1 }
Method 10
2 I/ K; V$ ~% U/ X; w3 a3 _ W, n=========2 b }; u! Y' T- o
' j/ n" P7 q" x$ m
=>Disable or clear breakpoints before using this feature. DO NOT trace with% Z9 a' o. W/ ^* g C4 @
SoftICE while the option is enable!!
" t! [- B2 P, ]' X$ Q, r% Z3 [1 c3 u* I& M T' u
This trick is very efficient:, J8 m2 b; {* U9 w0 ? {
by checking the Debug Registers, you can detect if SoftICE is loaded
7 f- Y% S! I. V v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 ?/ z) v! ]: o$ v' j V% l
there are some memory breakpoints set (dr0 to dr3) simply by reading their9 k4 j( `1 {: Z8 y+ \; Z
value (in ring0 only). Values can be manipulated and or changed as well( S$ T& h: Y' r0 v
(clearing BPMs for instance)8 B8 L w. C) C
! d3 e7 C7 }% _, R, ]) U4 L__________________________________________________________________________
" h/ o$ m% [. n/ }" z: `! l6 K: I. E
Method 11
! Z8 r& h4 g) C6 P/ M=========
5 F! T# c7 P& u0 j. w0 J" B% v* n# S% J
This method is most known as 'MeltICE' because it has been freely distributed
4 n4 N/ U' p6 ^! }; P4 n: Yvia www.winfiles.com. However it was first used by NuMega people to allow* A. H) I0 r: e( D$ o6 w
Symbol Loader to check if SoftICE was active or not (the code is located
6 F9 J& w! b! k4 ~, Zinside nmtrans.dll).5 r, a' h8 U3 `: l
" u1 d: v9 T# L6 d9 z2 hThe way it works is very simple:
5 P: R1 U% l5 E8 X8 d5 \7 `It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 m4 m7 v0 M% F# I
WinNT) with the CreateFileA API.
( i( g8 x2 _1 D& z+ [" G6 Q1 X0 w1 l9 A! B& q: A
Here is a sample (checking for 'SICE'):
) ]. P# P; }* @+ ~3 v+ E! @
9 R5 D) T/ | |' z0 [BOOL IsSoftIce95Loaded()' D0 l1 j# [8 I& H* D6 h
{
5 }0 l/ A0 N( Z0 W HANDLE hFile;
2 S/ s% H9 e3 g, e: i; h5 Q hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 D& l/ E2 N" G/ {, N' n& _ FILE_SHARE_READ | FILE_SHARE_WRITE,
( m5 S* S: K* L" D9 f2 l6 f0 S NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ u. r+ k$ v$ g" |: x r8 a if( hFile != INVALID_HANDLE_VALUE )# f4 e! O4 o a
{
9 E* _, _$ A" C CloseHandle(hFile);
/ B1 c/ o0 L+ k1 |; ^0 Y9 T return TRUE;9 c' e8 l0 m) D. v2 k
}
" o$ v# T8 Z& a return FALSE;: D& U8 `+ `+ m3 K" h+ V h
}! X0 [7 m N' d% q! t/ `
! x3 E9 M9 b& O% o% lAlthough this trick calls the CreateFileA function, don't even expect to be
* m' Z) K+ x: O1 M' z! \able to intercept it by installing a IFS hook: it will not work, no way!
6 i3 ]6 i5 v- VIn fact, after the call to CreateFileA it will get through VWIN32 0x001F( R% G9 [& ^6 F9 p$ V
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 ]& w: p( r1 o3 J+ Sand then browse the DDB list until it find the VxD and its DDB_Control_Proc
; m) h0 U" p, t) |* a' Vfield.
" f6 N2 M: U1 Z# BIn fact, its purpose is not to load/unload VxDs but only to send a
4 d) R C; z: c# Z9 Z8 O& X' ~) \W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* w$ y7 i! c* cto the VxD Control_Dispatch proc (how the hell a shareware soft could try/ m. _* r% s) a1 A8 G. L, W
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 }7 `( h$ W# r+ J( nIf the VxD is loaded, it will always clear eax and the Carry flag to allow* k6 H$ _, U* t
its handle to be opened and then, will be detected." i! q8 @2 ]% i4 z( k3 a
You can check that simply by hooking Winice.exe control proc entry point
- ^. [+ E3 t3 D) }3 Pwhile running MeltICE.4 }1 ^5 n+ w, m4 l
/ t% m! i4 j# ?! D9 d, G
* i* U5 A$ a1 m 00401067: push 00402025 ; \\.\SICE `$ o+ P/ Z8 `; y: S
0040106C: call CreateFileA
/ T# B" Z+ y' x' K7 v* C 00401071: cmp eax,-001/ c( {: w2 ]/ ~7 _4 I" Z
00401074: je 00401091) w4 f" [% V5 H* G, j+ w
$ d# l5 ~" o0 K4 g# ?8 ?1 r8 i2 \+ s( v7 M( `# B
There could be hundreds of BPX you could use to detect this trick.$ x- |6 [' D+ M8 B# v( z
-The most classical one is:% g0 V! f k+ |. r
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
: X/ L" ?, K$ ?9 m$ k/ ]" \ *(esp->4+4)=='NTIC'
3 n' @7 w |; Z0 B! v9 d$ R
+ a* q/ S; y1 C H3 s-The most exotic ones (could be very slooooow :-(1 {* R5 p, t+ ^8 `7 j
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' M% z7 h" X& P/ U1 L2 w ;will break 3 times :-(: l8 e3 l4 M @9 E# w: ?
5 B1 \/ {( G' q2 j' b' }
-or (a bit) faster: 2 r, J$ O- ~: L9 p4 P9 \8 {
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 `( ]9 T1 L$ p$ R% x
7 i0 F; i4 `; s; P* r3 { BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' * v* m' ]: R" A) C6 a
;will break 3 times :-(. l! q8 c* P6 F. `4 i, g8 g2 ]
% ^" S: V: f/ G7 L
-Much faster:2 q2 A2 l$ `6 @0 s* n" ^! c
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'; h- U' B" q: t
% {$ C3 G$ m8 s ] k" S: o
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
* T! H4 f% Z8 ffunction to do the same job:: j4 ^) Y7 i6 S" K5 S! |& k" q
8 Y) o- H" ^, h: a
push 00 ; OF_READ. {) \% r% Z4 c& S# T) d) x! H
mov eax,[00656634] ; '\\.\SICE',00 z3 V" W6 A- L
push eax) [; |5 l! E! Q- F* r! `+ {
call KERNEL32!_lopen
- ^7 u X$ n! M9 d2 b2 G: f* P inc eax
|7 u; F- P6 v% ^: ^; U; u( k jnz 00650589 ; detected
2 E. I6 Z/ T1 ?* k9 C push 00 ; OF_READ
. D) z- Z8 v7 P$ s* M mov eax,[00656638] ; '\\.\SICE'1 }/ B6 O' N: [$ X% o
push eax
0 A j( k7 \/ S1 U: h: f! U! X+ _ call KERNEL32!_lopen
3 f' M9 W9 f: T inc eax# v S! Y. V# E; U
jz 006505ae ; not detected' I/ s# M) M, k' u Y0 t/ V
4 s) S4 O# H+ ]& H1 `# Y- M4 D
6 x2 J8 Y d7 j, z7 l
__________________________________________________________________________7 E9 [; f( X% _/ l% |: L( d& G
/ r p& |: L; R
Method 12
1 F6 b6 h9 ?; N: X9 f9 f=========
, A* M" M6 r. E2 y/ b, X& H3 l- A+ U/ ^
This trick is similar to int41h/4fh Debugger installation check (code 05
8 K9 Q* _( S7 U0 X1 B& 06) but very limited because it's only available for Win95/98 (not NT): [! H) l" Z0 I+ H8 V" K( Y
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 A) F' w2 M" I5 f# B8 R
3 e0 T" F# h( P8 M push 0000004fh ; function 4fh& M$ P( J/ h# K0 W" u+ u
push 002a002ah ; high word specifies which VxD (VWIN32)! x% k `0 d, O6 R& I
; low word specifies which service
/ K. @5 }5 f+ t9 s, }( P (VWIN32_Int41Dispatch)6 t- B7 K+ i( `+ M4 Z' \3 n
call Kernel32!ORD_001 ; VxdCall. O' p$ C* U3 ^6 J8 ]/ e
cmp ax, 0f386h ; magic number returned by system debuggers& N7 q" Q+ ?9 e3 b% e% Y7 C" S% S
jz SoftICE_detected x; W9 _. q& g2 v$ Q( d6 _# b
0 |! S: `8 i: r9 w
Here again, several ways to detect it:
" J3 Y0 U5 Q1 |
$ D/ ^ A8 c2 w% e1 { BPINT 41 if ax==4f) c; y8 e8 F2 M% e) d. l2 U
- k7 r7 m1 o6 z% r
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
: m* v1 M q4 r( d" f6 F D+ X: w) H+ @6 V( R
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
- o5 Y+ v: Z1 I! r; X: U' c/ {4 p8 {1 i0 F
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: z9 `/ c2 r8 A8 n/ u! `, S+ W9 o' D: `& |" Q* j
__________________________________________________________________________! A, Z6 @- P0 q$ w
3 J4 _( l0 c- u8 ]; v& {7 f: l, mMethod 13( u- f' ?$ d( y7 P& |$ g2 I
=========
/ B. u1 f% c2 a! i0 z( X# w
. ?2 b6 R! C" T# Z' L& RNot a real method of detection, but a good way to know if SoftICE is& G3 k, `1 f1 d; Y% v0 k- M
installed on a computer and to locate its installation directory.
, o& D2 b+ f+ R: {/ X' BIt is used by few softs which access the following registry keys (usually #2) :
( }9 I5 j& q4 x+ L" c' N, ]( o: O3 O+ [2 `6 E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% k8 D" g4 s. ~; ?' q$ }9 f\Uninstall\SoftICE# {% J2 z- ^0 i+ o4 Z$ q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
8 [. W4 |- N( r1 U-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! t# E5 }- D* L9 C- i\App Paths\Loader32.Exe
5 M" j- n* k. @8 k) X: J2 ]$ ?; O4 O' S5 W3 B$ s
$ E8 s$ ~2 i9 e
Note that some nasty apps could then erase all files from SoftICE directory
G& X/ K( U7 @: M0 a(I faced that once :-(5 L: _" n8 z( Q* B' Y
1 h* W7 K, a, `; ?0 @Useful breakpoint to detect it:
9 ^$ w4 q2 B" Y3 U3 R
8 I! `) S' s; h, R z' v, h BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE': c/ s+ N0 B# Y% O: h* h
' d; D) M, `& O- a! p' Z__________________________________________________________________________
: w/ }+ z' z8 d" ]& R1 W) I0 g6 U
- z6 W- I2 f* d$ l
Method 14 # k5 h' `% R/ \. h* y+ B' `; s
=========
( ]0 H4 v* i, x6 C! y& x, U
. I0 `- ?( b; I$ m6 dA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 o5 x# E% L! [0 ^- ris to determines whether a debugger is running on your system (ring0 only).
7 b) g' S$ i0 t. K4 {
) P* s2 W% v& f; r4 z0 b VMMCall Test_Debug_Installed/ n0 L% x0 \1 ^
je not_installed4 _. @& W/ a+ Q7 g7 k G* d( V* T
* u0 c% X! s1 Z! O' TThis service just checks a flag.
" ^/ i; r: I8 i9 W( Y</PRE></TD></TR></TBODY></TABLE> |