<TABLE width=500>0 _) v# M! }+ o/ V
<TBODY>
" D1 H: ^4 |, F1 J* G( X) q<TR>
; P6 ^! T/ q, j9 }- G. H<TD><PRE>Method 01
. f( h, B, @' ^ v% S7 k& H=========( l5 O' X7 j& [' C8 K0 [7 o
6 R( c, s2 p8 U) a% ?' }This method of detection of SoftICE (as well as the following one) is
) R* r7 o9 q. y; Q% [# yused by the majority of packers/encryptors found on Internet.
$ z0 u/ c7 w- e, QIt seeks the signature of BoundsChecker in SoftICE
4 u5 S1 _- i$ C/ l7 p, f- {; `+ b7 w9 \/ q
mov ebp, 04243484Bh ; 'BCHK'
) X6 L' W Q" c4 o0 Q mov ax, 04h4 G4 U, U6 W6 q k# x
int 3
, Y" e2 C# n9 M; q) `+ x cmp al,44 u- v: M) K- s4 i- `5 B3 e
jnz SoftICE_Detected
# d$ q. ~+ G4 T7 s }- ^+ k5 g" e2 O. l9 l
___________________________________________________________________________% w' r) M& g) O9 }, E( s
2 \- Z! W5 H$ n# o P$ i! LMethod 02# `/ g* c- E% T: j/ c* p
=========
, L5 x, i0 a& o" R' }5 w
, Z% ? V& T8 \# |Still a method very much used (perhaps the most frequent one). It is used
, r( s4 @/ M6 a# M2 W- Z: Qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, g6 c) B& L+ @4 g' L9 ror execute SoftICE commands...
5 q' }% {. ^. ^% v, Z* A+ T; `2 AIt is also used to crash SoftICE and to force it to execute any commands9 x, N4 ` }( Z& z
(HBOOT...) :-(( 8 r! G% q1 V0 `5 C1 Y
4 p: M! Q6 i& @/ ^( B$ o+ V- U* q
Here is a quick description:
+ h9 C* q; B& P4 f+ O* X-AX = 0910h (Display string in SIce windows)
2 v: F# p8 ?. c! R; }0 `-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 _$ E P3 O7 ?" w {* ]$ @, m- B-AX = 0912h (Get breakpoint infos)
/ e% V( Z' D# `' ^* ?; Q! |-AX = 0913h (Set Sice breakpoints)9 F. ~" M6 m/ H' E' o; x M$ C
-AX = 0914h (Remove SIce breakoints)! L( w0 l' s1 C+ I1 J
: W) Q) \: Y; l# rEach time you'll meet this trick, you'll see:
: T8 F0 ^; z; i" ]. c-SI = 4647h% K' }( f/ @% v% C
-DI = 4A4Dh
2 j* J! L* s4 j. EWhich are the 'magic values' used by SoftIce.2 m' @, _+ X0 h7 S* c; k5 N
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' Y' j& j0 k. Y2 d& @& g
* q j2 E4 I* j/ K6 K
Here is one example from the file "Haspinst.exe" which is the dongle HASP0 |- y2 q C. h5 W3 K9 e
Envelope utility use to protect DOS applications:
, {6 r5 I' M6 T4 z% a
4 n8 J- D$ G2 W+ P% n) x4 X% s9 n! t0 c2 j& b# ]/ {
4C19:0095 MOV AX,0911 ; execute command.
7 H! n/ O- |4 U/ K4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." H' P3 t. S) i6 D
4C19:009A MOV SI,4647 ; 1st magic value.* B' n* c0 ^9 M# o8 q$ Z# y- @
4C19:009D MOV DI,4A4D ; 2nd magic value.
. f1 j1 V) p0 ?/ }. B; g' J4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
7 a2 t: n* s. _+ x; L& {4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
/ X- s4 \4 h" T/ n4C19:00A4 INC CX e3 M/ Q# x- O: W- {
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' L- N: q4 i" F8 s4C19:00A8 JB 0095 ; 6 different commands.3 H+ y: S2 L0 |8 D7 h1 b
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
$ V6 Q9 T% j* f! x g7 M" ~3 u2 w4 e8 D, @4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" X. b; C; ?0 m0 J, K
2 `" `. I" a3 OThe program will execute 6 different SIce commands located at ds:dx, which
( l! y) o5 x7 a/ X0 w; P& f6 v, ]& pare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& ?/ O- I/ i$ p# H6 T
+ M' l" S# {1 a1 C* k
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! N5 W: Q; F3 u' g( g
___________________________________________________________________________: J. ]' ^6 r w% G. o
) M7 d1 c' M8 x: N( v
) i: H) m; h5 T1 J1 vMethod 035 H% V0 W% i; ~0 |/ v
=========
% D' {, S5 V, _: i
4 e$ _7 `* i$ Z- e, s$ J0 JLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h; H: G( n' `3 n
(API Get entry point)2 B2 t) M4 [7 u" Y
; ~- y5 I" R" t/ ]9 g7 |
" m7 b) D. p, a xor di,di
& ]; g& }: f+ t5 F2 z mov es,di( J, T0 R0 R6 m: E" m& m6 S
mov ax, 1684h v; u9 a1 L3 n& R: X/ ]% A
mov bx, 0202h ; VxD ID of winice
# G5 U [4 q/ O/ ?6 X int 2Fh/ O/ L' c9 G L3 E: |
mov ax, es ; ES:DI -> VxD API entry point ]4 i* z) o* |9 j7 T, u2 ]7 [* F, J
add ax, di
/ y6 J' W( W; I1 E& P test ax,ax
7 w& r- A; n& Q! o) U; \: M# c jnz SoftICE_Detected/ h) v' g( f9 L. ]% i8 k8 a
5 q4 V0 F( e1 E8 ~
___________________________________________________________________________
% g: G! a/ B9 x4 f+ R$ I
. ^( M, @' t! yMethod 04
" ]" N. m3 t8 f& q, ]" @3 z2 J=========' ^" ~7 s7 J d
6 r _- l: \. M R2 d% {
Method identical to the preceding one except that it seeks the ID of SoftICE
" @5 C2 j) J3 R( Q" N, K7 OGFX VxD.
# K8 W. n9 L+ F" x+ y+ d, g! U; X1 f8 e+ l9 C2 R8 r* \8 g
xor di,di
, o9 W2 b7 B7 s# L mov es,di
, ~& _: [8 Q7 O/ u- V% h mov ax, 1684h
" m! s/ V6 ?2 _2 \7 o* k. f mov bx, 7a5Fh ; VxD ID of SIWVID
: q/ @! S0 C$ O int 2fh% U5 _2 U& f: D! H+ b$ e' O
mov ax, es ; ES:DI -> VxD API entry point6 H% y- l7 r0 G6 ~$ A
add ax, di
4 {" i% V2 C0 |" @ test ax,ax" t9 H# b% J! ]+ d* ~
jnz SoftICE_Detected
$ F/ o/ F4 T7 u0 X, F; B
S, h/ `4 @: C# \, F__________________________________________________________________________
. X+ Y0 \" S$ _4 a0 q5 u: G* b- D1 @5 a( D5 {
1 F7 R8 L6 P/ W* {: O9 m
Method 05. w6 `4 y, K: r9 M6 {
=========
1 z$ u i+ c; m9 ~$ h! b3 C- c! V" b: [5 \
Method seeking the 'magic number' 0F386h returned (in ax) by all system9 w; c: ]- W7 E
debugger. It calls the int 41h, function 4Fh.% @0 j6 |7 a& e
There are several alternatives.
* J1 j! O: s/ ]7 E
% i5 a& @% t7 V# hThe following one is the simplest:- { C0 I: ]6 n
/ e$ [! O8 S5 p( d mov ax,4fh7 v. B+ H; m% x6 R" [( w
int 41h
: B3 M0 T, ~8 h H4 e6 ~2 i cmp ax, 0F386$ F- q! L' I3 l' I# E! [5 s
jz SoftICE_detected
, h2 g2 ~5 @3 h$ K* l' i
( t+ g# \$ u- c5 G* @7 o: _8 A
1 j$ M4 C4 o" W) s4 @' jNext method as well as the following one are 2 examples from Stone's
& n3 G" e3 W( m6 U( {9 R"stn-wid.zip" (www.cracking.net):3 q \3 K( J+ O0 T: E: y
4 i& q( w1 @. \3 D mov bx, cs7 O. w* m2 o+ q; }5 d/ p
lea dx, int41handler21 Q0 t% z, O3 B0 m$ a* Z, n
xchg dx, es:[41h*4]
0 a4 S7 Z5 m/ C5 u! ~% | xchg bx, es:[41h*4+2] C2 l3 J' _; o' h9 G" N
mov ax,4fh
/ y( m) Y/ @9 R; M* k$ |1 ] int 41h4 S% n6 v: v4 \5 E* O v& n
xchg dx, es:[41h*4]3 W" n" g" ^9 O! z0 J
xchg bx, es:[41h*4+2]
+ {0 W5 p1 h& P7 G% _ cmp ax, 0f386h& W# p s# D! G/ U8 R
jz SoftICE_detected
4 i; ^7 n( ?4 g" P( n: U7 R5 n: B- C) M% m
int41handler2 PROC
7 P' \& E; X$ [ H. K iret
2 Y1 ` S1 c! L3 i' f' Mint41handler2 ENDP5 C# j3 ~" x+ k9 [, V3 ]. G0 B
% e: Z3 S5 I- b3 Y7 i
2 d, f. A% u0 G" k3 @' `( y_________________________________________________________________________9 w. C$ Q5 X9 ]# T
* Z/ W3 n% ?6 a
# M) v5 n( l3 o4 E, XMethod 06' B' [( u; ~" w- h" k% r
=========
2 K2 s! B9 V; S& O4 Y* z7 r- @: ]6 g( q- M) }
" p5 x1 ?8 k7 Q7 _4 ?: c
2nd method similar to the preceding one but more difficult to detect:
. B2 {5 f$ A4 @$ ~' i O
3 J+ z$ x5 B; A; a6 I* h! ?. A# u' r7 m( n
int41handler PROC& Z( P" Y) w/ r7 `! s
mov cl,al+ \* ` }& |9 I
iret
4 d6 i. c3 S& p6 d1 D+ F$ F6 o. Bint41handler ENDP
/ q4 A+ `* p% O$ H6 [+ A
* Z: b1 A2 e4 Y# `) H, p9 w$ _( F
xor ax,ax
2 u8 u4 x$ o, `, v" Q( h mov es,ax
. i2 ~4 w4 a! w' E mov bx, cs
. K ]8 ~4 @, b3 Q# m+ O lea dx, int41handler: J# h+ |/ a$ M9 l3 { z
xchg dx, es:[41h*4]& n8 @) \, v# x1 G' w
xchg bx, es:[41h*4+2]1 d5 u9 e! ?1 [0 Z8 T9 n
in al, 40h
* f- @4 R. m! _ xor cx,cx
' R7 W3 O- \5 W int 41h5 A0 A; `0 Q% l( Q% {6 k
xchg dx, es:[41h*4]1 r# P9 ]# C% M' S* J- b
xchg bx, es:[41h*4+2]
" B) l5 N% }! r' d1 v% B cmp cl,al
) d5 l. O+ {6 o R" P0 ] jnz SoftICE_detected0 M( x% a: h+ v7 o8 R6 e
- z( p) T3 R6 Z# `9 \& E/ b_________________________________________________________________________( U u$ s/ b: b$ [- d, t' f6 ?3 b2 J8 a
/ O' w, l, g, j2 O: n& C7 U$ kMethod 07
* g" i; O/ r; H=========
; C, R1 i" y# y+ M: N- r8 O
$ ~9 `* L/ d+ z# _4 ?6 e7 I* {Method of detection of the WinICE handler in the int68h (V86)
1 f" j5 Y$ O& K/ B9 I) t% o! I
& D8 Q* @8 Q) }, l6 ~ mov ah,43h
# m5 e) C5 k( K" c/ a int 68h
6 u3 t# |4 c' |8 j& a cmp ax,0F386h
8 ~0 V& \. Y5 s8 R2 ] jz SoftICE_Detected
) Q/ z. C6 z& E/ M' k& M2 S0 e2 L( Z1 X5 l4 }
4 ?6 j; Z. @/ o$ r- G=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! d7 \! ]1 D' M( Q
app like this:! |- Z8 w6 U" v5 c) C, g4 v
1 n" L5 c1 X& q& @% R. R. R BPX exec_int if ax==68
7 L, T% f' f, \1 u8 J Z# q (function called is located at byte ptr [ebp+1Dh] and client eip is9 m! j2 @$ j& r9 O3 P N& Q
located at [ebp+48h] for 32Bit apps)$ L! o0 I4 Q i
__________________________________________________________________________
7 D* q2 g7 o' I! {& l9 g+ P* H% E
1 S3 D. F9 m; Y2 P4 Q; d6 G9 p0 T. v
Method 08
4 U) p. h. a5 L, S/ Q- \) y=========
1 F( B+ {6 H% z+ ~5 N- k& P* x* L3 [. l1 h$ t8 }7 L2 h
It is not a method of detection of SoftICE but a possibility to crash the @ B$ O" P5 L2 g5 m
system by intercepting int 01h and int 03h and redirecting them to another1 A$ V# b/ Q8 `! |4 [
routine.
5 J. ~1 q! e; ^7 V: K, n8 {It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 Y# l; T+ ]/ h: q
to the new routine to execute (hangs computer...). g( j0 v# G( X2 j- {6 B
. {$ q, k9 ]. M mov ah, 25h) {* u4 s4 T' j$ d4 \; w9 P$ P' t' N
mov al, Int_Number (01h or 03h)
' m/ b7 P- m N% q& F mov dx, offset New_Int_Routine3 i- |# X. k" |8 M3 `( Z9 h2 N! r
int 21h
; Q- d& n( r3 u/ u2 Y( s* L. L5 I" v6 Q; A
__________________________________________________________________________
: i0 [5 Y) Q1 R% E0 c& Q/ J' M& H# K" f0 i6 c
Method 09& E( Y X. i0 t, _6 @9 {/ M
=========
! {9 x/ u3 {# n+ n, q, }) D& _3 a" U$ X6 {. X
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only# Z# f! c3 k( ?. t: M% [& h& W
performed in ring0 (VxD or a ring3 app using the VxdCall).# M7 n4 |% a" p5 |
The Get_DDB service is used to determine whether or not a VxD is installed6 Y- K3 C& x2 M4 u
for the specified device and returns a Device Description Block (in ecx) for
% N9 ^8 H" L3 ?! `1 a% n0 q7 r. Tthat device if it is installed.
% C( y8 U0 W( N: J9 M, N3 L+ n% q% X: Z" a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
9 F6 U F0 U. z+ A+ ]( \# K mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 K$ R1 E( f9 P, R+ {9 ^6 k
VMMCall Get_DDB
- Y* M) R+ k# V mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
! ]* y0 {% i: ?8 W" [( \
% S: T/ a3 H$ N- m) x# [Note as well that you can easily detect this method with SoftICE:" M. f5 w7 `0 y5 N2 h
bpx Get_DDB if ax==0202 || ax==7a5fh
3 E; G$ q* a) f, g9 O) J- `; b% U! N4 l0 q& r: [& W! ~! [
__________________________________________________________________________0 v" I* e( _; D5 B" g
# |# D5 N% `5 B9 J, kMethod 10
$ h0 `+ w! {7 Z" {7 v* H4 e=========+ [9 i. w7 k0 W
2 L+ k, ?5 l% i" r! _=>Disable or clear breakpoints before using this feature. DO NOT trace with
- F5 H. Q& v) i6 Z" C SoftICE while the option is enable!!
$ Q% f6 d0 |0 E. m8 I# }$ b8 v7 z" o0 G8 @. n
This trick is very efficient:
# ]/ E5 x9 d- L9 v* n9 j6 lby checking the Debug Registers, you can detect if SoftICE is loaded
" R3 x1 a3 H- u(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if: O( e9 v b0 y- k% b4 k: f+ j& I
there are some memory breakpoints set (dr0 to dr3) simply by reading their1 @# W, Y! R: v& E. N* w
value (in ring0 only). Values can be manipulated and or changed as well# W* H) g6 A4 A) ~$ p# a: ?' o
(clearing BPMs for instance), @' z) u7 a1 b/ K
! M1 ~& `5 w2 s
__________________________________________________________________________) }" t: i0 U( t9 `
' {/ \6 ?8 b( q2 Y2 y6 k, _$ p) JMethod 11
/ L4 V' g: D* D( I/ N9 O=========, P1 J$ c. `! @9 S' g
1 z& e8 r* }) ~* X9 |: h3 v8 J
This method is most known as 'MeltICE' because it has been freely distributed7 i5 O* F+ U% a
via www.winfiles.com. However it was first used by NuMega people to allow0 |7 A. o3 T' Y# x$ D/ C
Symbol Loader to check if SoftICE was active or not (the code is located2 W1 ~( J6 `5 Z: N y) n, r
inside nmtrans.dll).
, y) B: ?$ s9 k. O* V' l: m$ N
) p$ y9 H( O# y5 m6 V; y; F, zThe way it works is very simple:
3 X2 f7 W5 y7 ?* `3 j& fIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; }5 t4 V, R( }; _
WinNT) with the CreateFileA API.. T# V3 I9 ~1 `$ m
; s+ M( C+ r/ G7 L9 S' K% W( R/ z
Here is a sample (checking for 'SICE'):+ {) j& o2 u) O+ t/ W# r
& ?& R) {2 N2 M; J4 i
BOOL IsSoftIce95Loaded()7 z+ w5 l; u- Q/ e1 `
{
/ m; c8 J! h/ A; p HANDLE hFile; ' t# O1 w' _0 k
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,3 i* V* ~6 @) N0 G& P( y
FILE_SHARE_READ | FILE_SHARE_WRITE,$ X* V1 k9 P9 j# E& Y# a9 U
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
& Z8 Z' |6 S# Y if( hFile != INVALID_HANDLE_VALUE )- ?4 n9 }6 {1 a7 M, k+ K& m, p
{7 U! K; D& v8 t6 V
CloseHandle(hFile);- w. T% K% V9 Q/ o/ N
return TRUE;
) Z& N" k3 w) }+ ^3 l }
& g% }8 }7 ^3 v O5 v0 Q( p5 i return FALSE;
& c$ M! m6 V: |& m}
/ e! _8 |: q' m: ^8 q; J
# g+ x" L7 Y" w. \) i) j/ zAlthough this trick calls the CreateFileA function, don't even expect to be
' y4 A7 S/ T" t- i5 jable to intercept it by installing a IFS hook: it will not work, no way!+ ]2 e0 ~8 \* H, f/ X/ @+ {
In fact, after the call to CreateFileA it will get through VWIN32 0x001F9 H* N# l" t2 z% g3 j6 l+ d7 P( G7 y9 l
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ H/ N3 I1 E8 Q: Rand then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 m1 J8 B% M# [! d5 I6 Vfield.
( `* S" r% h2 m' K) |In fact, its purpose is not to load/unload VxDs but only to send a ) G% _- I" u) t2 U" l) a0 F
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
& @. Q4 R i) w) [( ^& d d& Rto the VxD Control_Dispatch proc (how the hell a shareware soft could try
' x0 s1 Y& v4 Qto load/unload a non-dynamically loadable driver such as SoftICE ;-).
" w {' ?# ~6 \; r! r: VIf the VxD is loaded, it will always clear eax and the Carry flag to allow b4 @; W* E$ ` l7 @" _
its handle to be opened and then, will be detected.- u* p2 s( ~, L+ S6 N% o* u* r$ W! |
You can check that simply by hooking Winice.exe control proc entry point
) [4 {" L( B# s, rwhile running MeltICE.' V1 ^4 M; I4 I, u# N4 O
+ f' k o( Q( H6 l- F% x
0 C0 g$ ^3 j/ f0 M [5 L0 ~& d4 Z 00401067: push 00402025 ; \\.\SICE5 S5 z2 r2 Y- b* E! J
0040106C: call CreateFileA* d {) v! e. \9 r! A; o2 X+ a, \
00401071: cmp eax,-001
% Q0 k9 `/ D- `& p7 U+ Y 00401074: je 00401091
* s1 Q! } W* i& G
% l' j* D0 K8 z8 \( }! w' o ?0 w" y4 `: _" B' T. |: K. a& Z
There could be hundreds of BPX you could use to detect this trick.$ T5 B: b7 n2 }/ p
-The most classical one is: m0 _7 w# J5 o8 Q1 ]6 d
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; b6 r f! l" Q* X, j4 [7 V+ ]
*(esp->4+4)=='NTIC'
Y! }( k" }7 K+ z. \# A
, J1 s5 n; _5 @$ z& G$ V: Q* J-The most exotic ones (could be very slooooow :-(
0 ?) \/ i) S ^ y) y BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 t; }) I! k/ a, r8 G" z
;will break 3 times :-( p4 D- P9 O1 l p5 p$ p# S
# a) D' `# k ~5 b- i-or (a bit) faster: . i% D! k6 I5 z8 i4 V( N+ q
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
8 a$ d" L u8 r- p% D" ^- ^+ {6 ^, l- Q9 P3 h; S6 O
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' v a" ]; H9 ]: v; K: ^9 G3 H- O, v
;will break 3 times :-(( V! ?1 y1 M9 s# ]
8 N' Z' s3 N N# x* G$ A: a8 h-Much faster:! {$ Y' q# I; _1 G+ L. K4 f, ]% H5 n
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# X7 n9 F" t% v& f. v; ?% G/ c& ^( C% U
9 N( J5 d R3 E6 o" ANote also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 V. F; H1 V- i2 Gfunction to do the same job:
# c$ Y0 D# {3 x
# H* O9 k. S. q8 D, B0 X9 r+ c push 00 ; OF_READ( W: t9 [0 ?# M' P. g0 o4 p) l- r
mov eax,[00656634] ; '\\.\SICE',0
: @+ W$ F4 D4 A( m push eax
8 S! u* d& y0 ` `/ f call KERNEL32!_lopen+ n# S1 ~8 D9 S" x- b7 F# N6 |8 |4 f% W
inc eax; Q4 Z5 a/ G7 H. |8 w
jnz 00650589 ; detected
/ R$ h0 z. d; W* i) i) V) W push 00 ; OF_READ
Y' C2 r8 K% T4 W( | mov eax,[00656638] ; '\\.\SICE'
7 t5 ?3 e1 [8 V2 t# @" D push eax: |' y2 u" i" V
call KERNEL32!_lopen, \7 N! q- `) @2 Z2 ?. ?7 U# T
inc eax/ M, r( ?3 |- V% i+ ~' l
jz 006505ae ; not detected6 W0 H4 c" B. f9 e5 a
, E( W' E. c& I% C( Z
; T' V- T; [3 q* W
__________________________________________________________________________
5 \5 A; h' Z j1 v; ^$ E; i* k+ g6 p) I' F, _5 a6 z8 i
Method 12
' o0 j# V; R: ~5 E" J5 _6 G. k* g0 X=========8 a, \* b, X8 l& e( ^1 j
" a+ ?* E" g4 k4 x, iThis trick is similar to int41h/4fh Debugger installation check (code 059 R1 O8 S5 l8 Z) P
& 06) but very limited because it's only available for Win95/98 (not NT)
0 s# n0 y8 V' o. P; P+ A5 c! Xas it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 T m3 c7 D* ], g1 P6 S- c4 |8 t
$ Z3 x2 I2 j ^4 a, {
push 0000004fh ; function 4fh
9 h/ i3 x, T* a$ f A+ s push 002a002ah ; high word specifies which VxD (VWIN32)) S: ~7 A) R5 K1 q
; low word specifies which service0 K2 o/ x) C/ l, ?3 E
(VWIN32_Int41Dispatch)2 f. b: p* p) }1 U* u
call Kernel32!ORD_001 ; VxdCall
" Q. E; E4 ^7 ]& ~' ?, M cmp ax, 0f386h ; magic number returned by system debuggers9 ^6 Q4 W9 v& H: t) B
jz SoftICE_detected# r" d; }, h: v* V7 ^6 W) _. Y4 H1 g
" ]& K1 f; ?7 vHere again, several ways to detect it:
5 j$ L8 ?- g) W3 K2 O, N( _- T0 r3 }% x5 k) q3 i
BPINT 41 if ax==4f
& c" f# ]. V2 Z! u$ E+ Y. L
1 \: F1 Z+ T6 y4 H; x; i0 W4 z BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
4 N- p3 V* i9 d4 g+ ~5 y2 B! q6 D
9 |2 s" U! x6 d4 W BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A3 r0 ~& J8 [( }3 j1 q
0 ^% a: Y+ j" R
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- U; t( }+ d. O, g
7 n1 N; z8 m5 Q6 `. j- ^- ^, r__________________________________________________________________________
) _. @% }9 X7 j$ O
: V; e8 T/ A6 c4 P5 ~9 {1 SMethod 13
6 L! o' X- E; j=========
; z, j7 R0 I; I1 m3 L* B. b1 z% K0 J& g" \. p- u! b8 J$ f5 b0 }$ i
Not a real method of detection, but a good way to know if SoftICE is
* a( |3 ^0 l3 }installed on a computer and to locate its installation directory.
/ ^0 K* y7 j/ n: Y; j* b8 Q) uIt is used by few softs which access the following registry keys (usually #2) :
0 H6 A" H% N' y
, A9 f* p8 e) G6 }& w; [% F' a6 b-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% n2 p; D4 A1 K3 ?7 [/ K+ D
\Uninstall\SoftICE
4 [8 q/ _' f2 V0 W0 n) J-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 O0 W1 { h+ |7 h' a4 _7 r
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion L1 m. d2 ^- f
\App Paths\Loader32.Exe, @6 T: [& _) y$ K
4 L4 H5 T R6 l# G, O4 q
* u; \, H9 ~; r! [0 `+ M2 DNote that some nasty apps could then erase all files from SoftICE directory
) ?+ E8 a- @ n' [+ ?+ n(I faced that once :-(
5 C8 q ?5 t6 h, ?- D% ^, d8 o# b+ I
( B! @! T7 _/ q$ t7 d5 w3 n4 _Useful breakpoint to detect it:+ h- t( v# p! P) }# t
$ O" \$ U) p1 I9 V BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
; l3 Q* d# K, d1 ]6 v1 N6 D. E# Y0 Q5 j6 B: ]6 X+ Y
__________________________________________________________________________
- t' B3 C' r+ B, W' G0 E
; G3 N1 E4 @+ }# j6 M0 m9 S! H( B( F( d1 N6 O
Method 14 ' c/ }" S( D/ }) ^
=========8 u( W* h3 M& u0 ?1 U
) y* l. q* H' v! V7 l/ c: f
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
( j& i# O4 }( I% ]is to determines whether a debugger is running on your system (ring0 only).# l" l( f+ [0 ^1 v u
' r6 N7 L+ m- `. F8 k
VMMCall Test_Debug_Installed' x8 o1 t4 @" \# u, q7 H5 ^
je not_installed
* c/ Y0 A( G$ T2 D
9 T# Y1 {: `- N' D0 }' _" DThis service just checks a flag.
, [1 L. a( D: n; m) \</PRE></TD></TR></TBODY></TABLE> |