<TABLE width=500>
% A! f# M" @, G<TBODY>
9 _' \1 g$ p- m1 g' t<TR>
4 \1 s7 K" Q) r) E<TD><PRE>Method 01 1 @! j, Z Y5 J2 {
=========
! H3 o. t" K# K2 I- e, n3 J. C5 y( R/ v7 H9 @* _2 K9 {3 I
This method of detection of SoftICE (as well as the following one) is
7 a% y- ?6 }9 Eused by the majority of packers/encryptors found on Internet. k6 T8 d, B& T$ o3 \/ f {
It seeks the signature of BoundsChecker in SoftICE
. D' @: w+ l" D9 b4 v3 Q
' j3 y3 N$ C6 {7 ~ mov ebp, 04243484Bh ; 'BCHK'9 k. B( B' g8 }5 @
mov ax, 04h
, F; ^: U* s6 D" p9 @, Z int 3 ( Y/ l& W1 U; ~0 n9 P
cmp al,4
$ e5 U% G/ Q1 t jnz SoftICE_Detected8 E5 r( d" E2 ^) b4 H$ e, [. P( j
5 ?& y3 c- o& H; m0 ]1 A/ [
___________________________________________________________________________
8 J4 q' o8 i" e: ?% v! ?
0 b. H( i* | |4 c. z: xMethod 02" g" @% O0 {1 a4 j# @7 L
=========
* V7 V& M6 ?* A }7 L
( d3 Y/ Z1 H6 l6 U2 s5 wStill a method very much used (perhaps the most frequent one). It is used R8 h# ]& F, Z) r$ ~
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 S/ u% J; e$ R! u! K
or execute SoftICE commands...3 U4 d8 K2 K. z
It is also used to crash SoftICE and to force it to execute any commands
/ W) o# x, ~, {8 a0 s: F! F/ ^7 w(HBOOT...) :-(( 2 \0 b: _6 y1 U( m! w+ G. w/ e9 p
& Y! V; w, s' h8 F1 H# _
Here is a quick description:- N, G2 e, |" J0 D
-AX = 0910h (Display string in SIce windows)3 |0 I6 g0 O! V# D% }& Z
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)) @; k: p/ t$ J2 c* {
-AX = 0912h (Get breakpoint infos)( v5 d1 \6 f/ f, `) ]+ w! L4 u
-AX = 0913h (Set Sice breakpoints)
* Z+ M2 ^0 Y% A5 m) Q: ]-AX = 0914h (Remove SIce breakoints)
/ g& i+ ^( h- l4 M8 u; E$ k9 u5 O0 I1 Y+ G
Each time you'll meet this trick, you'll see:$ N# ^8 q+ w$ {
-SI = 4647h% e8 h' G6 m7 q- f6 F/ t! C$ Q( G
-DI = 4A4Dh* ~# _' {; `+ a9 z- M
Which are the 'magic values' used by SoftIce.8 a, y+ ]& f$ Z! q
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; ^1 I6 U/ c8 H# v) K" i6 ~ T" M
, _* d, c) f A& D! yHere is one example from the file "Haspinst.exe" which is the dongle HASP! Z( `6 E% {' K3 O. i& O
Envelope utility use to protect DOS applications:8 V& X. z" ~4 _
+ Q& u' @5 b! _. @, @
% }) E* D+ u6 n
4C19:0095 MOV AX,0911 ; execute command.& l+ o O- ^" f: l, ?8 M% G6 n2 T/ y9 R
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; R: x6 q4 {& S4C19:009A MOV SI,4647 ; 1st magic value.) Z4 E+ Z" H) F( |( C2 {: ]
4C19:009D MOV DI,4A4D ; 2nd magic value.+ Q( p6 Y- \: z6 j3 a
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 a& P, X# m% y% b& D4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
4 _# S( Y2 W7 V, w4C19:00A4 INC CX, }4 [/ i% i- ]$ Z
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# Q" U4 d4 L- u) @4C19:00A8 JB 0095 ; 6 different commands.2 a; |( F9 M0 I3 d
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& [, X, Y* d2 J4 t7 n3 M5 m4 J4C19:00AD MOV BX,SP ; Good_Guy go ahead :); h( k& z+ u: G
/ K, c: Z8 B4 H5 I/ j1 @: T
The program will execute 6 different SIce commands located at ds:dx, which
2 M7 W4 I6 O# H. S8 x' V! lare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. c9 ]4 r/ I3 ]! k4 w! k) Q
( V" Z N9 T( w' T! e( X; w" x- h f* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: Z' R$ ~. S- Y/ e; u" H
___________________________________________________________________________1 s+ G9 c8 v. _3 U3 x& Y' [
1 u" U, p' w5 n. {$ j; t
7 K0 x7 ?* ~' `$ M! J# G& TMethod 03
[3 G5 |2 ~' |: K- V=========9 |6 _$ T5 h4 N/ L. F
7 U4 `* I/ Q( l4 o' v6 |Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) i& J* i3 w, z% o. b(API Get entry point)
" z# n$ o7 ]5 f1 F2 k. G4 Q3 X' C
; T: H$ `& x% @, L3 e
6 |$ P: k/ [6 K" L8 H" R a xor di,di& i: T. q5 |) H+ L W
mov es,di/ [1 p. N0 v# h T( o S( Z
mov ax, 1684h
4 {3 _- r9 B( D/ L% ^* h mov bx, 0202h ; VxD ID of winice
, {) o$ c% Z- U8 D' o# O1 ?4 Q4 Q$ C int 2Fh
0 V& ?9 K5 Q# j: i4 \ mov ax, es ; ES:DI -> VxD API entry point, }; q4 X3 G* P4 G4 \; u
add ax, di
1 }! f/ z' y# q: N8 J% W" s test ax,ax
6 t, F$ i( k( f jnz SoftICE_Detected
+ c; M( h9 W6 \, y; t
. e$ k: y) }* _, p+ s' J___________________________________________________________________________
3 Y l) s2 ^& A6 x+ l9 K
* V* Q) b6 U' d0 ^8 I# D) KMethod 04+ G. E* ?. K! A4 h: T4 c# y
=========- G8 u/ K# F; _6 V4 O- L
. B; a- {! H$ ?" y+ ~ ?. G2 N- n# f
Method identical to the preceding one except that it seeks the ID of SoftICE
/ V; t, A( R( c/ g" `8 _9 V- PGFX VxD. l% t3 h$ A6 Y
n) u! v, ]! Y8 q" a
xor di,di
, N# t" j7 r! Z' R' i mov es,di
; r# |; w% F$ o# x. |1 M mov ax, 1684h 6 z0 T7 c! f8 p' y9 V: O
mov bx, 7a5Fh ; VxD ID of SIWVID
B m/ E3 H# W4 \2 { ~ int 2fh
6 L! F, R7 v/ k |4 } mov ax, es ; ES:DI -> VxD API entry point- G) n& F) P4 k
add ax, di* s1 V$ k. F+ _8 S2 g& j
test ax,ax
, Q+ }1 [1 \- W. |* ~4 L jnz SoftICE_Detected
# @. u- c+ E2 R; j/ Z8 R5 B6 ], c8 V8 Z
__________________________________________________________________________' v# v+ j6 T9 j! s7 e8 y# Z6 d _/ V
9 E6 J6 N5 L. n2 a& t% q d/ K7 c7 n$ C- C* |
Method 05/ x" ~' _( S. R0 r
=========
6 _" c4 O; }! `# d
8 y4 S& S1 w" r# QMethod seeking the 'magic number' 0F386h returned (in ax) by all system k6 [# U E8 D! O0 n" H; _
debugger. It calls the int 41h, function 4Fh.; u0 T4 t9 c6 a \/ v: i
There are several alternatives. * b) g; R+ W, z" J4 L
* f0 T5 `( q0 M. c' A! T( ]1 u7 aThe following one is the simplest:
+ K* Y- k) |7 L3 y. k. m) }0 i$ N/ b6 q! _& ^9 P/ K5 A
mov ax,4fh$ o( ^ o. z* l$ T
int 41h3 n5 L5 `7 {( A
cmp ax, 0F386
; ~! C# N! h( h' M jz SoftICE_detected
5 s7 a Q; ]' E7 F7 w4 n2 {) X* Y# v4 \' B, P, y0 k2 i
- V- n1 Y/ z4 @
Next method as well as the following one are 2 examples from Stone's
1 m. {/ R8 q: k"stn-wid.zip" (www.cracking.net):
& U3 M } F \' w' N& v3 s- K$ o$ G; O, c+ G! y* h
mov bx, cs" F$ k7 }: A7 C4 j
lea dx, int41handler2
" k% @6 G5 G5 S xchg dx, es:[41h*4]
3 }7 |( @6 d \: p7 O xchg bx, es:[41h*4+2]4 {- a+ p: z% x9 Q0 n, F @
mov ax,4fh
9 C) q& R. A8 w2 r7 P, G! T4 ~ int 41h
3 `: q5 W% j# s& u, h9 L xchg dx, es:[41h*4]% z, i8 S0 t. w& Z
xchg bx, es:[41h*4+2]
: t9 }( [9 |* j( P- l1 d cmp ax, 0f386h
" X" @" i( l7 t5 g% Q( d& T jz SoftICE_detected3 X" I/ n1 U) W0 }! c. ]( E) U ^
" k4 g6 L! j- f0 P
int41handler2 PROC
& h' y7 i" U- M c% ~9 P iret
) \6 b$ |+ b L/ \int41handler2 ENDP4 d2 \9 j: R0 P3 P5 a/ d
; I" u# E9 o" l+ f: w/ }* b
2 T. c; G7 @# {8 o- y& w_________________________________________________________________________# Z) h( b# J! G" n
9 x* `; l7 k, C4 A3 H; d4 O, x+ e
4 m; ~; E4 ~8 `( |, t5 r9 PMethod 06
, }$ q: R5 L# j/ H- ^) v& F=========% K# e$ [8 z+ z" w }' s" m
3 }8 F# n2 k) J9 M, N; ?
% I; r, V, ^* L( y3 ^) q2nd method similar to the preceding one but more difficult to detect:
# W3 M' I7 e L3 }5 y, [1 o0 v; \% y, d$ b3 m" ]: n! V, e$ R
! n* e0 |' H1 w( p; @6 U; C& ^- t
int41handler PROC# N/ B: e, u1 R$ ` e
mov cl,al
) s1 Y# e- s6 Y2 [ iret2 X& k; t0 ~8 X7 q% W. i, y2 S8 ~2 P
int41handler ENDP# K, z% I# `7 N2 N9 V
* |+ D$ H* u" E' `1 Q
( Y. O& S8 ?4 |7 k# E; N xor ax,ax! q) W6 ~6 m( @0 q- i1 C! Z7 t
mov es,ax" v/ V! @- C" ` ]# r
mov bx, cs" O, m6 @8 l' K) \; J1 s* L) ~- l* g6 A
lea dx, int41handler
! \" G2 \4 p# T3 V% k xchg dx, es:[41h*4]) E7 l6 `( ?" ^- [5 w9 Z
xchg bx, es:[41h*4+2]
$ R |5 B5 {$ ^0 A in al, 40h
# m! g) I% G D+ `4 @: G xor cx,cx
( m: f; P( [, H( O* N int 41h
) c- _9 K$ j6 s; |* {$ c, C: U xchg dx, es:[41h*4]
2 S8 D7 |6 g0 F( t xchg bx, es:[41h*4+2]
1 b- O8 w' I# o cmp cl,al: {* }; {% Q9 _3 L# g* ~
jnz SoftICE_detected
. [( a& M: y' ]' O% H5 e3 E
5 p7 \8 t! r/ W_________________________________________________________________________
" e3 I; R+ |. S; n: ^
1 j% j, i7 X3 ` p9 @Method 07! ~) _8 ~- {7 ]! ^# s( N
=========
' e0 w1 n- } H
( F% {6 _# k) t+ m, R* s# W( gMethod of detection of the WinICE handler in the int68h (V86)7 q# L2 A7 M+ u7 K
E% M% c! ^- R" Z0 F1 N3 H
mov ah,43h
; z6 a2 l5 _/ ?9 [ int 68h' o4 g! d! E) r+ e
cmp ax,0F386h
7 u3 e7 ?$ G9 Y9 V jz SoftICE_Detected
3 ~; }0 M: F+ m" Y2 p$ q
. `. ] R9 p$ r8 X6 m5 k1 U1 e6 {' P( Y' \! X
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 Z2 ^% T6 ?9 x! X; t app like this:
) x4 @" e, M3 o% T2 w/ C, \; `, V6 O. @! X) C) i
BPX exec_int if ax==68- _$ ^. X' O- M# g/ h
(function called is located at byte ptr [ebp+1Dh] and client eip is% q& K/ C7 k* `6 a! w
located at [ebp+48h] for 32Bit apps)
- G8 W4 a) c2 ~2 Y) h__________________________________________________________________________
8 \$ X$ c; V& }) v8 ~* {
% x2 D6 o8 K8 J6 l
m4 c8 C, F3 L9 I% gMethod 08
: b- N3 P7 y) k) h, I/ G- a' p5 g=========8 n: u7 j$ U2 G: ~9 b* P4 d D
# C) i& d+ D I- R- c& ]& v) Z
It is not a method of detection of SoftICE but a possibility to crash the
o% E( j5 }% E! w% V# o- V# Csystem by intercepting int 01h and int 03h and redirecting them to another
; L! Y0 t: ?# J& C, qroutine.
4 l) R1 }$ s; S3 x: |& _It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' w' ^4 l7 R% R: _
to the new routine to execute (hangs computer...)
L' q& d. o) A
0 F" P+ n' f, B& @5 u" k' a mov ah, 25h
- ]8 C) ]3 d2 i( r; D: K; ~ mov al, Int_Number (01h or 03h)
/ Q) R1 K2 ~2 l- v mov dx, offset New_Int_Routine6 _! N8 S" ?$ T
int 21h
! T- Y# _, S: s7 Z3 p
& f7 G) d4 \! U6 M% ~7 ^( B$ R__________________________________________________________________________3 Z( I/ X$ ^$ z! D: H
9 E. ~3 U% m% L( h6 wMethod 09
" G, S9 [2 ?1 l# E' W=========+ T2 w5 @( S; H/ ^# Y+ h. h
) D( @. Y! k1 k/ s. B
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only% E! D5 a+ I, W" k/ Q/ j U7 v
performed in ring0 (VxD or a ring3 app using the VxdCall).
% G; v) |6 }! kThe Get_DDB service is used to determine whether or not a VxD is installed
" k+ N" h! q, ^- M9 z1 c% g/ V6 s( kfor the specified device and returns a Device Description Block (in ecx) for8 o8 [7 P9 u* C9 k. w4 W2 \8 c. J f
that device if it is installed.& A: h1 u7 r" ]% X
: t, j, ^! ]$ u mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
6 [* n; k3 O. _. {# [ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( O+ ?' d8 F, ~6 c# Z$ s VMMCall Get_DDB
3 C' P8 }% o0 m/ D# m# ~! C+ s mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
' M+ B n& ^9 O/ G6 N* h
5 U6 N( M% A, R% `' ]4 [+ }4 x! XNote as well that you can easily detect this method with SoftICE:
5 ~; \0 @. Y( }1 [( d bpx Get_DDB if ax==0202 || ax==7a5fh& u9 g ^9 F/ Z, o
9 G5 \8 k' N. z9 Q' @__________________________________________________________________________
- F, B$ b2 ]! B, `8 C3 K, b8 |. M% |! p( J
Method 10
; r3 y6 r3 C- b8 t/ Q# N9 c=========$ {6 u$ x+ E" U, M
M$ K7 l$ `( _/ k) i
=>Disable or clear breakpoints before using this feature. DO NOT trace with
: x8 m2 {) N6 V$ i5 e$ u+ r SoftICE while the option is enable!!: E% F$ ?& u- r) O; {
* D8 `: P0 v" n* p# o4 lThis trick is very efficient:
. E4 }+ o v5 l, v, K, ?# j7 Aby checking the Debug Registers, you can detect if SoftICE is loaded
/ ]& K& K. \) \( S(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- W* @( c( ^1 v0 R2 I. j F$ L, mthere are some memory breakpoints set (dr0 to dr3) simply by reading their
/ \8 y# ]. |4 ]. }. `: Ovalue (in ring0 only). Values can be manipulated and or changed as well
0 k( z( B& |9 N- b( _" |(clearing BPMs for instance): n# Q1 [6 @1 V
0 A, K& ]% \3 m. S7 {
__________________________________________________________________________
+ m z7 C5 U5 K. u' Z
, W9 E) I1 x" K' P7 z' KMethod 11) u% b, `. F- Y" \$ l
=========" A4 i! b4 q1 t9 [" M& R8 E: }' a
" V4 I" \& ], G" E7 x/ JThis method is most known as 'MeltICE' because it has been freely distributed
6 j) Z' I/ }* Z2 d8 k2 E& i; Avia www.winfiles.com. However it was first used by NuMega people to allow
/ l) \3 s( T' T2 B7 c, wSymbol Loader to check if SoftICE was active or not (the code is located: {- }: s& @; c, W& G. |% _: N6 W
inside nmtrans.dll).. z+ N( W2 R6 q( v& U2 V- e
3 M. d& y" O$ H2 r! R- G1 Y: V
The way it works is very simple:2 O! a1 O8 H7 M4 q9 H2 d0 L& ~+ e
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 M9 ^0 Q* I& T! o6 @; L
WinNT) with the CreateFileA API.
) z" u* @3 W! b/ I' ~. D) z! }7 @ k
Here is a sample (checking for 'SICE'):
8 Z7 `( A/ n5 z$ e7 v% g( \
9 _5 S" H4 e/ `7 _( J7 YBOOL IsSoftIce95Loaded()# _) B1 r- T% u: _
{
% }4 a7 M( n y2 d$ b HANDLE hFile; ; F t, P$ V( D' T q* s
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
: |3 k4 [$ a# ?0 n. {" o$ P! \* ? FILE_SHARE_READ | FILE_SHARE_WRITE,
, n" y+ B d. M4 R1 n NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* ?& N, [- i) B4 G$ E if( hFile != INVALID_HANDLE_VALUE )* |# @5 E7 F5 c
{8 S! M+ g7 D7 j4 [3 G4 B
CloseHandle(hFile);
. `0 O$ s: o7 H2 e: w0 f return TRUE;
8 @- A/ U B9 G: O" o }" r: ` F. e4 [; _- o. c5 t
return FALSE;
; z. B2 o6 ^5 U6 K# N! Q) y0 L}
6 x$ G% k' |, m u
5 O1 k8 [& c' w2 qAlthough this trick calls the CreateFileA function, don't even expect to be
# N' A$ u4 A5 Oable to intercept it by installing a IFS hook: it will not work, no way!
+ _6 p+ V4 A: [5 {4 K6 |- GIn fact, after the call to CreateFileA it will get through VWIN32 0x001F; [5 Q9 L/ M) Q! T: v6 H
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); T' O$ s4 o8 V' H9 F
and then browse the DDB list until it find the VxD and its DDB_Control_Proc' [# l" n4 B# V6 P! F: e
field. \0 W; G$ X3 k1 I! g, s6 P$ v
In fact, its purpose is not to load/unload VxDs but only to send a 0 f0 Z2 g9 y6 l$ ^, Z0 ^
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ T2 I* m3 a- C6 i. p
to the VxD Control_Dispatch proc (how the hell a shareware soft could try1 P9 e. q! X! T9 X: r/ ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).3 s+ ?) H1 \3 ~( @# }- G6 a
If the VxD is loaded, it will always clear eax and the Carry flag to allow
% f' H% N1 r( p3 m! kits handle to be opened and then, will be detected.
3 A! F' f& c0 \* I* ]8 h1 gYou can check that simply by hooking Winice.exe control proc entry point
& H" E% [& V* twhile running MeltICE.4 Z6 T3 O4 q' w4 e2 A9 m4 |
. d. T# v. ^& s: w; x7 u9 i6 H3 i$ _1 _
00401067: push 00402025 ; \\.\SICE
% |$ C; x# d& A 0040106C: call CreateFileA+ y8 |0 G1 U% Y' e
00401071: cmp eax,-001
4 Y4 P1 s8 \: Y" C 00401074: je 004010916 a) s' P6 h1 _" ~
* M/ ]- {% y/ U0 L( I
_4 I0 h0 e8 _! @6 h
There could be hundreds of BPX you could use to detect this trick.
: b1 R4 d3 ~. j7 X/ u4 f' i-The most classical one is:: r& |: Z. g' w3 P' ?* R8 w/ x o
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
5 y% L& b3 ~& t% j) c: b *(esp->4+4)=='NTIC'6 T! |% }* f; R. }+ }& l( n* C
; I$ m" w# b$ f7 ]7 k5 f# m
-The most exotic ones (could be very slooooow :-() ^2 Y1 [3 L: E' A- Q2 X
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% `4 v2 ^4 G+ ~3 f5 _ ;will break 3 times :-(' @3 s: ?' l4 _# }9 |! r2 i
; o- E; M% C5 ]
-or (a bit) faster: - \& ? y" f0 [- C& i) t E3 L
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' N9 |6 h6 c, }# G; V5 ~; ^% C: G3 f, s0 k3 s" P* g4 \" G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
" U8 J% h/ a$ j ;will break 3 times :-(
8 T) Q% ]8 P$ z. P% }) X
7 D3 m0 G5 @( y-Much faster:2 C( y# ~2 q! v% f( U1 j/ b0 ~" `
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* g% i v; ^+ [' b; x0 M5 o1 J# ?1 P4 E( g% {/ u: f
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen* [* ~' U4 x7 w* I4 T, U8 s( f
function to do the same job:
8 U7 P# h; }, ~% c; j' B
) j4 b" j9 Q9 k push 00 ; OF_READ3 m; K$ q% L T4 p+ C3 p
mov eax,[00656634] ; '\\.\SICE',0
, R$ r/ O- Q( W( X push eax
! }+ G$ O9 _' [( N4 N; b* N call KERNEL32!_lopen
; A9 M; r/ g3 I: A inc eax
! d8 ?3 h6 V7 I& P9 `$ Z4 v1 ` jnz 00650589 ; detected8 O1 T, K& Y% [& K1 [- E
push 00 ; OF_READ4 R4 s3 _) Q/ {; c+ S/ V- E0 o
mov eax,[00656638] ; '\\.\SICE'
+ ]1 A- M& ]" S0 o push eax
- t- [+ Q$ j3 ] f call KERNEL32!_lopen- ? X1 E2 x d3 P
inc eax
$ ^2 a7 U: Q) | jz 006505ae ; not detected
0 I. a3 h e4 J6 O
& Q# m4 A% t9 d5 G. E& f/ [% A/ p
__________________________________________________________________________
J# ~6 L& C# r2 c6 r% W' F9 x* L) Q" o* v3 @4 k/ j2 d* K( t
Method 123 ^( D+ ~/ I3 _. c- P d6 H
=========3 i, _5 A- ]( C) c4 ^
; Y0 {7 m8 p6 V: l: ^9 K" M3 w
This trick is similar to int41h/4fh Debugger installation check (code 05
2 R$ c& L0 S, }* Q3 h& 06) but very limited because it's only available for Win95/98 (not NT)" l" J- G$ {. I1 U
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* I- D5 F0 v7 Y3 l3 z0 y8 E) x5 V
; z4 X5 m4 C" u; k" p, W" j
push 0000004fh ; function 4fh
0 n4 a5 n$ q' r m push 002a002ah ; high word specifies which VxD (VWIN32)7 u" p8 m9 S0 G/ }
; low word specifies which service$ u1 E6 l) U" h' V/ g* X: @
(VWIN32_Int41Dispatch)
1 o* g P5 {1 g) T, _! ] call Kernel32!ORD_001 ; VxdCall
& Q ~9 B% G+ }' X, A' n cmp ax, 0f386h ; magic number returned by system debuggers9 H. Z7 T% w+ N. C9 I$ f
jz SoftICE_detected. [8 S' T$ j; u: } t+ ]/ d0 l
, m5 e' Z8 j7 jHere again, several ways to detect it:
8 r/ i, S1 U/ ?* ^
9 ]1 H7 y' P( ?7 G$ h BPINT 41 if ax==4f* F5 H, F4 A% p$ g! K
0 i8 T$ E" b2 W# W9 k8 o
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( Q' d, y+ p8 s$ r( Q
1 Z1 x* X1 ]1 y; V7 J, @/ e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
" X' i( U" @2 }
) n, C3 k k" s7 b BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ W$ ~3 y& S( m. ? Y) W: v- X' F( Q
__________________________________________________________________________
* @( V; o, t" y+ {* t
" |1 N9 v* s2 V9 t9 kMethod 13
$ Q& T4 H3 N3 k3 b=========3 V8 i/ b# L1 c7 s: L
; m$ g; b7 ^, L0 W. F
Not a real method of detection, but a good way to know if SoftICE is. e3 t; ^# z2 ~; J- [8 h. o2 }
installed on a computer and to locate its installation directory.$ I& ?3 z% m9 R. y, O+ H
It is used by few softs which access the following registry keys (usually #2) :8 y( b) X( L8 ]
4 t1 F; O0 V5 O. g. b* ^% H% q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# R* Q& a+ E, u& s
\Uninstall\SoftICE4 f+ V! Z0 w4 m
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 p2 Z5 M7 {/ q/ Z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) |5 r- p' d7 l: @
\App Paths\Loader32.Exe
# e1 C V& F* ?! s3 u, Q0 x; T! f4 S! d1 M5 {
& C& H& d/ }9 P# G# u3 @
Note that some nasty apps could then erase all files from SoftICE directory0 l' K- x( c; X1 \1 v- b4 w
(I faced that once :-(' R' u! k2 a2 k; k# r( x2 ]
% H6 D9 Z B6 ~3 EUseful breakpoint to detect it:9 Y7 k; t" m- q* R" F% k
+ k0 `% Z6 o% J2 E- l4 s7 I; U
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'5 l) A2 A' D- p
1 ^: D* U- b2 s: f8 Y9 X__________________________________________________________________________
7 E. S4 v& C/ N4 w
8 t& m2 M$ e2 V' Q' t( Y; R f' I$ [
Method 14 " k, `7 Y! g; i% O E0 i
=========
) r/ R) h% G$ a* k( O
5 A. ]; C- T' }# a5 |* L, @) X$ D. VA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, t4 O" {! W' G, X" e9 D
is to determines whether a debugger is running on your system (ring0 only).
% T" w- d( h+ Y5 f9 h: p
. n$ l! H. b2 s! g# l& ` VMMCall Test_Debug_Installed, Z6 H0 A+ j% k& t" F8 T' _
je not_installed$ D. r- l& t4 Z3 w6 x) `+ @
8 V) f' h g" B% g' o( H: AThis service just checks a flag.
! Y' o7 w1 M+ j0 \9 a</PRE></TD></TR></TBODY></TABLE> |