<TABLE width=500>- b, y, h6 L5 T. _4 d0 }9 E- v2 g
<TBODY>2 s0 {4 }" E$ V/ S
<TR>4 t9 e2 I8 m1 H5 k
<TD><PRE>Method 01 7 h! k3 }- {4 { k& R' B: ]
=========
3 \$ r8 Z$ W6 @+ j+ n+ j8 I- B- u& K2 c3 G* r
This method of detection of SoftICE (as well as the following one) is8 x- K/ A( ?2 T6 s9 t
used by the majority of packers/encryptors found on Internet.9 {6 Z4 M) `' y& P, u9 t" k5 H
It seeks the signature of BoundsChecker in SoftICE7 Q6 ]) v1 ~! G3 a6 d" k
) x2 G# r3 H" a0 [ T+ B mov ebp, 04243484Bh ; 'BCHK'7 B) Z1 [2 h% N! W4 g( b+ L
mov ax, 04h4 @2 ^/ a: h5 {. ~. D- t
int 3 " r' n# P9 m& x/ T6 A
cmp al,4
. A* r+ ~) j6 h$ f8 q jnz SoftICE_Detected
5 ?# u; I, R* c0 A. [( Z* x0 s* R: t
___________________________________________________________________________1 @6 p8 ~1 u5 ]: E4 T9 b( F1 {
! O+ C( D$ _$ Z& b
Method 02$ v: ^7 d( |3 i' F- w
=========
5 R' F) \& S. Y2 o) ]" b3 s+ d. P$ p6 \$ m+ m
Still a method very much used (perhaps the most frequent one). It is used; I" {; B/ O8 p/ y
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
9 @; T* J4 T# K% ?or execute SoftICE commands...% a# c! V5 K( R7 C3 R0 p, H. s. m3 f
It is also used to crash SoftICE and to force it to execute any commands$ e/ G, ]# |% z# _- P3 B9 C6 \
(HBOOT...) :-(( ) w* ~1 p7 P& f
7 E8 P+ P) Y: U/ t0 N+ VHere is a quick description:
* f$ |* N" o% r3 S-AX = 0910h (Display string in SIce windows)
, b, t H7 \) g-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' F/ K6 X1 n7 {
-AX = 0912h (Get breakpoint infos)2 m; |/ V3 ~ e( x+ [
-AX = 0913h (Set Sice breakpoints)1 K- p# i4 p- R' l% o1 }0 {
-AX = 0914h (Remove SIce breakoints)
! [* L' f/ D& K2 B
" k; l6 \6 N4 `" B* U3 `3 EEach time you'll meet this trick, you'll see:
% k0 ^4 i" O) l" X( Y$ y. a0 S-SI = 4647h
! K& Z/ n7 F9 D-DI = 4A4Dh
+ B9 r! q- o8 e8 [1 O9 [Which are the 'magic values' used by SoftIce.- ~4 A6 |+ Q+ T$ T+ y
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
) `. ^, o" `1 T0 h @( U# f3 T& N$ l& d0 ~/ ~# R7 D* Y. Q: G
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 c8 x* H4 n; ~" U
Envelope utility use to protect DOS applications:* O1 v9 m- V+ O
3 w9 E; J/ V6 [( z+ a* _
$ C) k) T% x! }1 l* N; ]& h$ t
4C19:0095 MOV AX,0911 ; execute command. o+ \6 k p; E( z
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
% L$ r$ x+ `7 H3 {& _4C19:009A MOV SI,4647 ; 1st magic value.
0 h; c5 v* K. r1 M# s5 x4C19:009D MOV DI,4A4D ; 2nd magic value.$ k% O& w' W/ X. {& N& z) z! ]4 c, h7 {
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
& q/ m& v: y/ e+ a- i" y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ r' g# r* d$ A( _ v8 v
4C19:00A4 INC CX0 o3 Q1 p8 h# z: I8 l
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute5 i5 _2 y9 @5 o \8 h0 |$ I8 P- e
4C19:00A8 JB 0095 ; 6 different commands.+ t1 f( R3 i1 e( m( l0 B% m, c& m4 b, Z
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% m7 |# e" B$ u4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
+ Q0 I8 a* g- h: u) X$ p
+ Z8 v# `) E. H% V- O3 b: X% X1 aThe program will execute 6 different SIce commands located at ds:dx, which% m% V, e. q/ R. Y3 B6 j
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 d' V7 s( _& _# J2 q+ v3 w" U
1 X2 [! P$ X2 h% P0 b! m7 Q+ z2 i0 G* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ Q$ j2 D) T$ q5 I3 ?& F2 u, w1 c___________________________________________________________________________" p ~( Z) C, u# [
( F! E" R# [/ [7 z5 [: N: X: i9 T* O) x% x% ^" t$ [( m
Method 03
! `6 y4 q" D% b C=========
, H3 v$ H/ @9 [4 M4 v$ h
) s& }5 Z0 _0 s9 }Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. u: n7 h+ r/ U0 s
(API Get entry point)
$ F m4 l0 [& y! M
6 r, |3 \$ Z( Q* m
9 g' x6 t# `# R0 U" Y4 v* ] B xor di,di
+ A# J& b: U8 m3 M' c* D2 O1 G mov es,di7 N. Y* x* F$ o3 m* P5 C0 c
mov ax, 1684h 7 b/ W2 |' [# n9 X' N
mov bx, 0202h ; VxD ID of winice
R9 d/ ]$ i5 ? int 2Fh% A( g/ {, e+ e$ `
mov ax, es ; ES:DI -> VxD API entry point
+ S8 @" W4 ]- b; Q) Q) ] add ax, di) h& g5 O# S# @2 c
test ax,ax
0 x* y$ r/ B3 f: J/ _3 { jnz SoftICE_Detected, B+ q d9 S4 W r2 P6 t3 y
, T& {( S7 p3 N7 s4 E
___________________________________________________________________________5 J: `3 t4 p% L8 d3 D! |" Z# ?4 r
5 ^6 q5 k0 l2 L% W1 C
Method 04* ^( G' E- r+ A; h# n# b
=========
: q$ i( @0 w% j* C; j: Z" W+ m+ Q1 X. ^3 `% e
Method identical to the preceding one except that it seeks the ID of SoftICE
3 I* O' S7 ?+ U) P+ E+ w4 vGFX VxD.
( ?" b$ H8 n- i) L9 `8 F. R- J$ _+ H" p8 @4 Y& K
xor di,di P/ P% R6 c) g9 C5 l3 Q6 E! t% a
mov es,di4 q$ J, B: Y- S% B! P: N3 L; e3 ~, u
mov ax, 1684h
; Z) G% F4 j4 p1 `: Z3 e mov bx, 7a5Fh ; VxD ID of SIWVID4 d2 k7 L7 _% F: b3 [
int 2fh- n1 e3 v( S ]2 t) _6 w
mov ax, es ; ES:DI -> VxD API entry point% n' @6 B5 h% H7 Q
add ax, di
% W9 ~0 j/ k9 H test ax,ax k3 k k9 V" g- v# f
jnz SoftICE_Detected1 |# s% C2 [! I2 F: L- L8 v
! j" f8 r) i4 v0 P7 {
__________________________________________________________________________: Z x+ a0 t% g( Z( U3 {
) @) Y# p5 L+ ^9 ~2 M6 @* m; S0 X. g2 N M! h: X
Method 05% O5 j: W5 t; {* I+ B# x/ s" O$ Z
=========
9 n3 y g1 P% Y; X w! _( R. c# K' Z# ]
Method seeking the 'magic number' 0F386h returned (in ax) by all system9 {! D" @+ {$ c0 }1 [
debugger. It calls the int 41h, function 4Fh.2 Y7 H' N$ ?' x) M# _4 W; E) r
There are several alternatives. 1 ^* K! ]: @$ z* w
# [0 g1 @" `( ?) s+ `( q3 xThe following one is the simplest:- f( A" l& ~$ ~
) j) m# F6 Z. @, u5 m5 U6 y, ^ mov ax,4fh
5 H- H, H/ X6 V int 41h
' w! Z: @- A0 y cmp ax, 0F386! w# `- Z+ w2 q# ]- h0 h3 M
jz SoftICE_detected+ C- J$ {3 z" m3 u) u6 H, o
- v! F# n8 {5 w' `! |
_5 q+ f. }4 Y. @
Next method as well as the following one are 2 examples from Stone's
! y- d; s3 R6 S! W8 D"stn-wid.zip" (www.cracking.net):# c6 Q* |9 s* n0 W1 m d3 n" f
2 O' }4 Z3 G7 L& | z# g3 v N$ u
mov bx, cs# p y, h3 ~# {; j& o6 `$ r" U
lea dx, int41handler2
; f. _1 M' G1 x/ j xchg dx, es:[41h*4]
+ I/ @" M/ M' e+ {# H1 t xchg bx, es:[41h*4+2]- f5 j+ f. V9 d" y
mov ax,4fh
( n- o6 e" z4 }3 Z2 j/ ? int 41h. ?+ w) A1 `2 B6 d9 p* ~7 I
xchg dx, es:[41h*4]
' |' t; s9 Z6 D% h* R5 {8 m xchg bx, es:[41h*4+2]
3 N9 U3 h7 A7 G; M Q- v cmp ax, 0f386h
' w$ s( Q* \( `2 m. A, m. X jz SoftICE_detected
* v- u, L. I$ i
4 Q3 Y2 |/ Q1 E9 E: Eint41handler2 PROC! d* }1 U- e$ `! j: z' ~7 B
iret
& Z x% V/ U- {" H: wint41handler2 ENDP) p9 q; k# Y+ i% ]9 Y
: O; k8 I* Q: Z
! F9 I6 E8 `' S% x_________________________________________________________________________7 L: G5 K; ^1 _( r1 z) m3 J
2 A# E" w1 n) ?. J8 ]9 N
: w4 }- B9 R- x3 GMethod 06% D' G2 Q+ p8 L2 z% C! K0 e
=========
& O2 l5 p: t3 u; `; `
. v0 ~' T6 H* x/ C
+ T: i+ }2 f: s4 z3 G& v ~) e2nd method similar to the preceding one but more difficult to detect:" h( r8 M0 d6 v( `9 x5 f* _
" L* K- @/ E1 a' B$ j, h2 K* v- C4 i' }' X3 N
int41handler PROC& L% a! y2 b- n& i, C w$ V6 `7 @
mov cl,al
. J5 ^9 H* v* h2 {3 H% |4 B* w iret
+ z# G1 x1 A2 pint41handler ENDP
! Q5 e5 J' ]9 Y3 Y! W
* F% G! Y) x: ]; o8 v/ k! v
. y& }& K; m7 w' z( r xor ax,ax
' b( u& t" t! D- S, J) | mov es,ax
4 I. t' V5 M" H0 E7 L1 T mov bx, cs* z) s+ f/ q2 p8 q x
lea dx, int41handler9 {& A. `% W9 u. I( w8 _
xchg dx, es:[41h*4]
' r8 @# g0 A, F6 X0 R: J" l9 G, O xchg bx, es:[41h*4+2]5 U3 a4 J7 U! i
in al, 40h
2 }2 o) R# Q0 W xor cx,cx, ], R( V! U2 a* M
int 41h
: y; V2 F3 @" V" T, A6 D) T0 B' ^ xchg dx, es:[41h*4]7 D& z0 [( h8 v% ~
xchg bx, es:[41h*4+2]" D/ o8 m/ Q5 I& t/ D
cmp cl,al# \. \3 }1 Q1 e1 d4 Z
jnz SoftICE_detected& M, d% M: g4 i: n" [3 V, u
4 b4 j6 B' m+ L& ?) z- l& `_________________________________________________________________________' {. N8 z; `% T3 _5 C1 P2 \% L+ T! u A
! B, d' G" d& q0 d' B9 D
Method 07; |* V, N# S- Q* h. s% e- w$ D' h" X" ?
=========
9 \: K2 K/ g, y! V2 d& U( l4 U+ D1 @( _' A9 Y* O9 X# L
Method of detection of the WinICE handler in the int68h (V86)+ t Z+ F3 |! H6 `0 P; a- n
- X0 r* Q% F% b# z. l. |0 z4 ^7 s7 i% w8 Y mov ah,43h8 }5 N5 b* j2 s; D; {
int 68h- V1 f: S( ]* b# D& A
cmp ax,0F386h
: O7 \6 X3 ~+ V: d& i, M; b: D jz SoftICE_Detected1 C8 ?0 r7 z# V5 S9 ?
0 M, e# Y9 ^1 a( F& u! T3 M
% E) w: u% X- b: _3 _=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! d8 _# W' ~5 {- a# h2 w1 r7 ] app like this:
' w7 p: D; z( r ]
7 r9 S1 ]7 @$ J" X BPX exec_int if ax==68
: @- k( f" L1 @' u" ]$ P (function called is located at byte ptr [ebp+1Dh] and client eip is
3 G; r8 f( z- ^( B; c, ] located at [ebp+48h] for 32Bit apps) e; `( K3 y# [: G# f
__________________________________________________________________________
& s, F6 z! @, A9 k+ x8 U! Q+ h; J/ U5 V& j+ ~- U
9 B7 p- Z" m# J6 \1 A+ n) cMethod 08/ G5 [9 `' p2 q& `1 e# P
=========4 {/ I! z: Q6 o5 P
: G4 ~ o" _6 g5 F
It is not a method of detection of SoftICE but a possibility to crash the) t4 m; x: B7 J3 N9 \& C
system by intercepting int 01h and int 03h and redirecting them to another$ F1 x: y3 Y( f6 r7 C+ W. j9 J% a
routine.% Q4 O$ K' A/ ?' K
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points2 o( ] o5 Y7 n0 j
to the new routine to execute (hangs computer...)' _! w" s+ p1 y
& r- m: r+ m/ I) t* X2 h1 Y0 W mov ah, 25h% _3 } c. K- V/ \' e
mov al, Int_Number (01h or 03h)
! M$ B& F4 e) j7 ?. V' H: `+ q mov dx, offset New_Int_Routine
) b" G5 |3 j& w9 |7 \ j int 21h
6 \' t" g$ f3 {4 z m, L, X/ S Q
__________________________________________________________________________7 Q& w/ T7 F$ m& G9 k: a4 `
* E+ f9 T1 r* Z2 b5 t; B' G
Method 09# n- H5 R6 f( X% ` M& q
=========
! @ r$ k7 p; Y, H/ ?, Q! N& G& s$ K8 E% f5 m" \
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ _8 O/ ^3 J) `2 y5 V6 S
performed in ring0 (VxD or a ring3 app using the VxdCall).
+ x O) G7 g3 R0 I L7 aThe Get_DDB service is used to determine whether or not a VxD is installed
c' ?" y0 q# w. h# Ufor the specified device and returns a Device Description Block (in ecx) for
6 d3 z/ E' b6 w- A b2 e4 c& \that device if it is installed.% [3 `& L5 b7 C
0 H2 e W' K8 k9 u5 l! j" S# L
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, ~' `' T2 a# L' ^* t: m
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 o$ s1 X. _; |9 p( \. h& O
VMMCall Get_DDB" @% |( E3 p' n/ _* G# U1 a! A- ~6 D
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ Y! u1 `8 ?; {7 {' _, T- y; o' T& D% \3 d
Note as well that you can easily detect this method with SoftICE:
! `+ F W& b S8 p bpx Get_DDB if ax==0202 || ax==7a5fh+ w3 d* L- D7 m1 |0 ]& R
! t1 l; g; K( Z7 y
__________________________________________________________________________
# j# ~) `; s& s) g' I; w4 h- r$ d0 }, |5 i
Method 10: C1 A1 ]) Y7 f1 H3 K
=========
l* Q& `7 L" u0 C U5 ?5 d; z; u
=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 j8 T* Z" [: M SoftICE while the option is enable!!2 b1 e4 M% q6 P9 {+ m5 z/ `
4 ?& | c2 C9 UThis trick is very efficient:+ X( @+ e' u% H( A4 P
by checking the Debug Registers, you can detect if SoftICE is loaded
/ B e% {6 d k8 F(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 Z/ h5 `! o, D% W( @/ h
there are some memory breakpoints set (dr0 to dr3) simply by reading their6 K9 |! L* m8 Q$ R6 ^5 r _
value (in ring0 only). Values can be manipulated and or changed as well6 @; @# K+ B9 O, g
(clearing BPMs for instance)
$ a: K0 o, D/ f% ^5 N4 q) X q- P
__________________________________________________________________________
7 F( h4 x& m- f& h# E4 R1 A
0 U. p4 ^, r2 m+ c% S% W+ Q2 LMethod 11/ z7 j# n+ n3 m
=========6 j+ E- @4 ?) }- f" v( F N
U6 k/ {7 n( CThis method is most known as 'MeltICE' because it has been freely distributed
% h7 L( S% f0 c3 {4 rvia www.winfiles.com. However it was first used by NuMega people to allow
# G( H5 Y6 z: o m% F7 JSymbol Loader to check if SoftICE was active or not (the code is located
/ B8 y4 W) G) P! p4 sinside nmtrans.dll).
2 v' W3 I/ O2 v# s* i: D: A' W: M7 k
The way it works is very simple:
- J3 s# ~9 g4 RIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
[4 g( \/ ]! uWinNT) with the CreateFileA API. r$ C& F, W& _# z9 ?2 n: X
: G( Q. `8 C# s, bHere is a sample (checking for 'SICE'):
3 F. D; e6 Y- y d" C
: G# D: I0 P K5 N5 Y5 BBOOL IsSoftIce95Loaded()' e. ]8 w; y9 X9 U8 P- z% ?1 b* |
{
. ^ X! z6 B/ h5 g3 e! x HANDLE hFile;
5 f* P. b3 x# q- D9 O hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 f4 T, M. S; M; J v, f ]
FILE_SHARE_READ | FILE_SHARE_WRITE,
9 i" V3 e9 M2 |2 | NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) I2 f3 `1 i2 s, I$ G if( hFile != INVALID_HANDLE_VALUE )
3 D& C G3 \, ^7 j2 x& B4 U {, u3 m# X& P# ~; J5 Q4 X
CloseHandle(hFile);
0 K# J+ i6 W$ m( [$ ^ return TRUE;
8 u7 {# m! w/ J9 F7 Z+ P% ]8 ~8 g! W }8 C7 n" [ ?1 F' u2 i* H
return FALSE;4 _7 W! U' J% n: z& G7 D2 C
}
5 a6 j& H, K) p% G
, E7 S! F& O, o. r1 l8 kAlthough this trick calls the CreateFileA function, don't even expect to be1 d9 m+ E8 s% T( r7 Z
able to intercept it by installing a IFS hook: it will not work, no way!
a4 e5 H. V! n9 HIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
' l- g9 O+ \+ Eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ X( Q! T, N* Y: k
and then browse the DDB list until it find the VxD and its DDB_Control_Proc- D8 J( v0 ^0 v+ N. ?$ `9 O8 n
field.3 V1 m. i, Q: q1 D
In fact, its purpose is not to load/unload VxDs but only to send a
$ M d% V* y3 R) s" R7 C- eW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)1 v' @; _* t" h: U1 [7 w
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
/ w9 M* u* Z6 |3 f7 \to load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 \$ ?! a8 M- j0 H" d3 v! `& i4 D; IIf the VxD is loaded, it will always clear eax and the Carry flag to allow( n) G; o* ]* H3 z
its handle to be opened and then, will be detected.6 C5 g' D1 L4 e; S1 D/ \
You can check that simply by hooking Winice.exe control proc entry point; Q' W" g- `4 ]' L
while running MeltICE.+ Y5 _+ W, Z! r3 _0 v9 Q3 S
' a: w5 l4 ?1 v
6 K6 I( ?( g1 s' F
00401067: push 00402025 ; \\.\SICE
1 s% t9 s5 h; P% s* e; e2 } 0040106C: call CreateFileA
2 W/ V/ A9 y, r 00401071: cmp eax,-001
& c; i5 m% h* Z 00401074: je 00401091; o6 L' g; N6 F! j" l. w% d
& F) ?; u" e1 v% ]" B0 v% `8 B1 r
% q; t. K$ H7 ?) A! _, k4 H& e
There could be hundreds of BPX you could use to detect this trick.
9 U/ I7 t- ~$ h6 t-The most classical one is:' ]# g, x* `- n" o8 T
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) I1 t$ w: W& i% ~1 k# d0 R
*(esp->4+4)=='NTIC'
) q3 | s$ ?' t1 ?8 U. g/ M a/ h5 n5 [" y4 B. D" m
-The most exotic ones (could be very slooooow :-(
, K! c) ~) _; t# B% I BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 3 L; b5 J5 G/ x6 e- c8 H2 O6 \
;will break 3 times :-(" u i9 d+ X! s5 g
$ l( ` O! O' r, J, @
-or (a bit) faster:
, e0 S9 o& o5 f) {. I BPINT 30 if (*edi=='SICE' || *edi=='SIWV')) [/ }/ ]1 N/ R& s1 n- H! X
: S1 G* D, h4 @' I; q
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
* ]/ [9 a$ w/ s [* F ;will break 3 times :-(
6 a2 x; C9 A1 @$ U- [7 t% ~
# V0 Q0 Q8 U( {! s-Much faster:1 {" B: b+ `6 Y, p1 k( Y/ q# ^
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
- h( _4 Q* a' x$ P$ G
9 j9 F7 o7 [; i. P7 \3 FNote also that some programs (like AZPR3.00) use de old 16-bit _lopen/ {4 H) R' r* v/ s
function to do the same job:
. J6 d, g: h! m; g% V$ i) J& m6 B+ L8 o3 C: ]% f1 C( o
push 00 ; OF_READ. w+ g8 J+ s. i8 ?3 i
mov eax,[00656634] ; '\\.\SICE',0
3 N4 x; q: p" p& M, w5 p push eax
% T1 J6 c, x3 V8 V5 {5 k; }5 F call KERNEL32!_lopen& J7 h; p% [6 D0 L% I
inc eax
' T7 l/ t" p5 z9 ~ jnz 00650589 ; detected& @4 W8 o9 k- t/ L2 { D X6 s
push 00 ; OF_READ7 U; G7 r+ G5 Y% n4 F" S3 m S E
mov eax,[00656638] ; '\\.\SICE'7 m% ~. m+ N, Z: P& M
push eax
. [1 R1 U( \$ G1 ?" l d4 V call KERNEL32!_lopen* r3 g0 M! Z. D$ j# a. T8 {: ~& A P7 e
inc eax9 N4 m* C3 s0 W; {3 s- Q
jz 006505ae ; not detected
& g. M! `5 b, B; \7 K
9 w* }6 Z1 ?1 @* C' n8 n( }, G# O; d7 r+ Y3 |3 \
__________________________________________________________________________! R0 e& g/ C3 N
0 U. u7 @# l/ TMethod 12
5 z9 F0 d$ @& \9 n) R$ a p3 \=========
- k7 \& D1 l' }" W. y5 N* g$ \/ c6 f0 ^# x* M
This trick is similar to int41h/4fh Debugger installation check (code 05
$ W/ H0 E& R+ v, f; ~& F& 06) but very limited because it's only available for Win95/98 (not NT)
( U. c4 K) ^" q* `7 B7 ^% aas it uses the VxDCall backdoor. This detection was found in Bleem Demo." t5 u# m/ }" z7 L0 `6 A: y7 N# H7 o
: [ d! e. `5 q; d- X
push 0000004fh ; function 4fh3 G+ ~% J7 L2 Z! b# m
push 002a002ah ; high word specifies which VxD (VWIN32), D7 |. }% @. {4 y( K9 r7 I
; low word specifies which service# Y. p3 U$ @& M% A1 A% s( u& M$ Y+ T
(VWIN32_Int41Dispatch)
4 j8 P% h0 T0 U/ y call Kernel32!ORD_001 ; VxdCall* a" i5 S& `4 E
cmp ax, 0f386h ; magic number returned by system debuggers
5 |3 M5 d, F \" l1 R jz SoftICE_detected
) C r; p4 P1 ?- A, C
2 [/ ]+ j% p! V P N, v- I7 SHere again, several ways to detect it:
Y1 w% K2 }4 M
7 F5 W M. N9 Q. w \1 m BPINT 41 if ax==4f
6 ?( L7 M' \ _0 `0 r+ Z4 o, f3 z/ `% C# w$ `0 Y5 f
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one+ Q. d& w; O& F% \1 j5 l7 x
: G$ p) ^) k9 I6 ]0 [$ g! r- c2 Y BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 s$ m6 N7 x2 q m" M2 B$ d( l
+ q! g6 p: `, j3 J8 V0 M
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!8 q, k" p. j: \ B
+ h y5 N5 K( E. j: I& ___________________________________________________________________________
7 X+ w( z% k3 g2 P7 U9 W6 F) h, s h0 q
Method 13
% }% q# Y g9 M6 g1 l( b7 M# {' B7 B+ E=========$ n6 @% p) \! D* v+ q8 R* g. J
/ P0 Q+ G. H3 [) b0 O) c2 BNot a real method of detection, but a good way to know if SoftICE is! T$ e2 K$ F6 v6 r6 K+ R
installed on a computer and to locate its installation directory.
& ~$ q U3 v! I6 QIt is used by few softs which access the following registry keys (usually #2) : {7 O7 [7 E, y" j/ N
3 f. N5 z" h% ]$ A7 J( ^5 r2 ]
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 a4 T) [8 G p; S6 J7 x\Uninstall\SoftICE
_% b! u$ F4 [: g1 \9 D-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 m2 @5 z8 c; l-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" f! o" k" g# c3 W% c7 i\App Paths\Loader32.Exe8 @+ h8 {: c) C- J4 J; b
1 p. y/ J8 s( y6 i7 e, X2 i+ ?3 ]; z+ J# E2 f4 I' z' @0 _
Note that some nasty apps could then erase all files from SoftICE directory
x+ D2 }& l9 j$ }- E' k3 X+ X(I faced that once :-(+ C5 C; J( D' V
2 U; {7 p; n$ W6 |, D* x& XUseful breakpoint to detect it:
! r$ s& q3 k X! S8 |. D% `4 ^$ p% e# ^
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 W6 Y; J# f) Q9 r$ A0 r, @0 m5 \
__________________________________________________________________________* ]) J4 ~3 [$ Z; s( E6 |" }
; g6 U; l" b) o! w' b' }
$ E; }0 i4 R* f& m6 i' K$ Z' jMethod 14 % b" |$ @! W1 R, B6 H4 g) h" I
=========
' u; m$ f' A/ W$ J1 P3 {7 t, c# {$ K1 d3 V3 @8 g& o
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" g0 w* E/ Z; B ?
is to determines whether a debugger is running on your system (ring0 only).' l0 ]1 ~% N. i2 q; v
" W' ^. ], r! B+ {1 Y
VMMCall Test_Debug_Installed
" C' f X- N. R0 m2 G( r je not_installed
1 J6 v h7 n' @, b5 t3 p6 C
: p) r9 d' k( @4 M! w$ VThis service just checks a flag.9 r! ~- J- _: L& _* s
</PRE></TD></TR></TBODY></TABLE> |