<TABLE width=500>
' `4 j5 y& e+ n% q4 C# ~<TBODY>
. `8 [2 M% e5 F/ q3 P7 r<TR>
" {0 L9 c- i; t<TD><PRE>Method 01
/ u" K$ y t% @; S6 _( V- r=========
; a+ p1 V% H( ~7 b& j9 a
7 T- i! j6 E( T P1 ], d' SThis method of detection of SoftICE (as well as the following one) is
# V3 a$ T* K0 @+ gused by the majority of packers/encryptors found on Internet.
1 D4 i) Z3 T2 K, u x+ T' jIt seeks the signature of BoundsChecker in SoftICE# j& p7 R/ l1 I/ P, }, g
$ q& C9 |2 b$ a$ n* J2 v8 r
mov ebp, 04243484Bh ; 'BCHK': B6 W# L, p$ u4 I8 i6 ]/ a
mov ax, 04h+ @' [* ~' B: ?; m7 U" G
int 3 $ ]3 N+ s7 i& D; r4 D7 @
cmp al,4
) j2 d& @# A! ? jnz SoftICE_Detected
z' A m# `7 ]7 N/ Q3 Q8 s" F; a* x3 T* e! G$ \" A5 _
___________________________________________________________________________
( ~+ |. q. n5 n( @+ c1 ^! d E' }% a4 w1 S
Method 02
' K5 ]+ e/ N- g. D& q3 [- k" i1 ?=========% A+ E( b' e. N
" v1 w" q4 q$ k" i" Q5 ~
Still a method very much used (perhaps the most frequent one). It is used
% \8 O# o; V8 {8 u0 U6 L. x) ?% _to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; @5 W) X' z- g: P0 {or execute SoftICE commands...
) {5 U0 p7 c9 |# z3 ?It is also used to crash SoftICE and to force it to execute any commands8 r/ v% U& @# }& `3 m+ t
(HBOOT...) :-((
8 I- z6 v7 U) Q! i' J; ?
X( L7 G! `4 I9 U1 B5 FHere is a quick description:5 G7 ?# U5 E# D: v- k- \
-AX = 0910h (Display string in SIce windows)! o6 n: T4 b/ G! N" l+ X
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) h; H+ ]+ B% I7 g1 o$ K2 X-AX = 0912h (Get breakpoint infos): t* E6 e# A" k+ E/ F! v
-AX = 0913h (Set Sice breakpoints)4 w. P4 m1 C" D) U" Q
-AX = 0914h (Remove SIce breakoints)$ @* R% }$ ?- I z7 D/ y
5 d$ M1 H6 j* S1 {
Each time you'll meet this trick, you'll see:
! }) H6 o8 y3 Q S) U: W/ Q. R$ X-SI = 4647h/ s- J; [0 [) z$ p* F; Z( u K: m( N
-DI = 4A4Dh
" y* Z; N# q( d1 P! g& e, LWhich are the 'magic values' used by SoftIce.3 r T N" ~2 w( \+ m* B
For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ H+ e: ?. Y! | F) V
# I0 Z- t1 ?+ \& o: GHere is one example from the file "Haspinst.exe" which is the dongle HASP
2 T8 n9 E( [( X2 |Envelope utility use to protect DOS applications:4 o! ]* W4 q! k
8 ~5 ]8 Z3 ?- `+ [8 T X) S
( s$ c V& J1 h4C19:0095 MOV AX,0911 ; execute command.3 h4 Q4 `! I* i) E5 Q
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).9 |6 `6 Y& T/ E! f; R
4C19:009A MOV SI,4647 ; 1st magic value.
4 x/ e: E- ?4 U! q: Q4C19:009D MOV DI,4A4D ; 2nd magic value.& Q: n" {0 A$ Z& M" c2 L s% E
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)1 L- U, ^; o5 B
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
) G) d& }: \8 V. I0 p4 c i4C19:00A4 INC CX
* e: `% G% L* ~! ~7 N" Y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
7 R) R# j# [3 d3 [+ N9 X7 y4C19:00A8 JB 0095 ; 6 different commands.
& z1 f- b) l2 k1 \" y4C19:00AA JMP 0002 ; Bad_Guy jmp back.% z; C! L; a* _! a+ [- z$ D
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- b' g$ [2 J' e% m' U1 Z& z: ~" x7 `) V0 L5 i6 {) |1 d
The program will execute 6 different SIce commands located at ds:dx, which( R4 i' |' O' C/ e& _) Q* {4 K
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 U" ^: ~2 C) O5 r6 _' H
. `6 f3 ~, ?7 p% {% n) G2 [7 i5 p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' b3 d: j0 f/ ~, u5 A
___________________________________________________________________________
4 y& o3 ~: g" E0 }' U, K
/ m- [: T- l4 z+ b7 k$ D. }( w& K8 y
Method 03* _3 h4 g- o8 Y$ E
=========
! a" e* U5 b" g$ g* S& K$ J; s& k
1 v: I1 e% D" M/ SLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
3 ~2 V' u c7 {9 |$ Q(API Get entry point)) g8 N9 t6 h% ^9 J8 s$ [
, ]; _4 f$ q' n3 @! ~) S
! [( p& l, j5 x3 h5 `9 X& i
xor di,di$ U8 Q( a& H. n9 L
mov es,di
* Z/ Q, G* N" c mov ax, 1684h
- z; x+ N- Y6 t( M. U7 X" E mov bx, 0202h ; VxD ID of winice
$ Z7 `; K& b; r1 i6 z, l3 J int 2Fh/ S$ C% ]) [0 m% ~- l: B
mov ax, es ; ES:DI -> VxD API entry point1 t+ h0 ?8 d0 t) f1 T2 T
add ax, di/ y( n2 v8 q0 Z! P1 |; G* }3 i7 i
test ax,ax. S0 r$ ~7 L9 b1 \) f. Y, F+ d
jnz SoftICE_Detected1 @6 j0 Z) I1 ]4 ~, B; c
$ l) b$ ~3 L( S1 Z
___________________________________________________________________________
# \/ F: F- o1 F% q6 n. D; ^; j1 V$ J$ l1 I8 t
Method 043 @$ A3 y' p2 g* ~. @
=========8 N# n, s, ]8 x; `
4 [% ^2 j+ e9 SMethod identical to the preceding one except that it seeks the ID of SoftICE6 }7 Z6 {! D: @0 e/ ^
GFX VxD.
3 c( b* s, ?& H6 a% r: M
9 p1 R/ H) Y$ M' J/ S xor di,di
8 ?4 i1 ?+ L3 Y! q! N: \" S: n mov es,di' j7 {, o( V- [0 p! q
mov ax, 1684h 1 ]( G# m8 D/ j8 g8 A% m3 `( W+ s: I
mov bx, 7a5Fh ; VxD ID of SIWVID
; l4 [2 w j0 L: `7 Q* E int 2fh8 N/ T) ]9 }( b) W' ]3 x7 p
mov ax, es ; ES:DI -> VxD API entry point5 Z) H7 D, Z* K/ Q/ ^4 |" q
add ax, di
3 k( \& M5 w1 o( s; S$ q+ a test ax,ax+ I+ Y2 j# s+ u: [) Y
jnz SoftICE_Detected
- J* q9 D) X2 t& D1 p' Q1 P' M* a! E) y4 _6 f1 ]5 |; c) R
__________________________________________________________________________- W+ e7 a* H# H/ H
2 X4 G% s: `( M4 ^$ e# j
8 x' [* M t9 C1 H5 G! KMethod 05
. F- c, n4 [# Y5 X6 P; o=========
( \8 t1 R9 A- Z5 h
7 t, R$ {8 m& V+ K2 t* PMethod seeking the 'magic number' 0F386h returned (in ax) by all system6 ~5 \% B2 R- q0 H
debugger. It calls the int 41h, function 4Fh.
7 V$ q" `- h) |There are several alternatives. I# b0 L J6 \; N2 i3 g2 b! ]
! j# i: x$ @$ l( d* G
The following one is the simplest:
/ z$ Y% z* t$ x: ^# `0 X7 D* r i/ x, g$ {2 h; I2 j4 F5 f; X
mov ax,4fh
, O' f, k( U7 X int 41h
- T( l6 R2 ?$ f& _3 B cmp ax, 0F386& Z$ P7 t5 e# B( z: o: R
jz SoftICE_detected
: o2 K2 A) w0 z3 u* Y
5 [# O5 a! |" w1 A& L$ y; L" J! ^9 [2 K
Next method as well as the following one are 2 examples from Stone's 0 Y4 E5 g0 B( V, X3 G8 w6 x
"stn-wid.zip" (www.cracking.net):
% e; ~. w3 W/ R
5 M8 Y1 f# u, w s! H; V mov bx, cs
: T. s1 U% d; o# h lea dx, int41handler2
- n0 y, v* h; [ xchg dx, es:[41h*4]
3 y9 f) z2 ]/ n1 s xchg bx, es:[41h*4+2]
6 J& E# o# t* j" B mov ax,4fh# o9 W; I }4 ~+ l: j0 {% d, V
int 41h X* _& s+ a$ _
xchg dx, es:[41h*4]5 x7 t7 i' b% ]3 C5 N
xchg bx, es:[41h*4+2]
: j2 `5 d% m; U; W cmp ax, 0f386h5 o; k( Y* j$ {; }% x c2 |4 B8 M6 p
jz SoftICE_detected
0 U3 d! ^" Z7 v3 o+ j; H; K1 p1 t$ Y
int41handler2 PROC6 f0 u" ~! S! h: U9 Z, Z1 J/ Q
iret
" |' [; [2 Q7 Y/ U. Zint41handler2 ENDP
$ }9 p4 n' C( c
/ h- ^/ m, a7 ?8 v5 f+ @$ A6 R. x
_________________________________________________________________________' e# p% [; h; |5 ~
/ }9 G, ^: f; ~6 i! `6 _' b& ?
" ]$ q0 v! r6 h+ gMethod 06
" u% b3 `* B+ d/ y; r=========% R6 K k3 j) S3 }
4 |0 b* S" L: O
- D. t, k" s9 B2 M+ D2nd method similar to the preceding one but more difficult to detect:
% F# G! ?3 X: i9 L, o# [! X- k+ P2 I/ b# k: Y* l5 z
, e3 l7 u* |6 I9 c% [; S; M: F
int41handler PROC
. l- A6 K/ |, R' C9 u mov cl,al
+ E0 S, Z& W. l, g, o) Q iret
6 x/ q7 c) c+ P+ J0 p3 S( Eint41handler ENDP1 x* e# f2 z' p0 b9 ]! k4 C2 j2 q
$ a6 m8 M" O" W7 Q4 ]+ b1 W- w6 W
5 x: z. O! V8 A2 B5 e xor ax,ax
2 K+ ]$ ]0 a: E& J$ b/ n! l( j4 K9 k8 p- m0 q mov es,ax6 D6 c. l) Z% }' y8 r
mov bx, cs
: e, \3 j* S; y. ` lea dx, int41handler! h( N( Y4 f. Q. g: W6 W
xchg dx, es:[41h*4]
8 I" c# r; E6 X xchg bx, es:[41h*4+2]
; X/ L& ?! P5 T' w in al, 40h
7 \" B1 [5 ~: m* e" W$ V) N3 ^& ] xor cx,cx, s- |* ?4 j3 B: k$ C. j
int 41h
3 C* b" r/ x6 t7 a+ } xchg dx, es:[41h*4]2 U( V. o8 y Z- `' U
xchg bx, es:[41h*4+2]
- s+ }$ ^/ t# t cmp cl,al' S& S! l4 r6 z7 s$ w6 \1 u) }4 h
jnz SoftICE_detected
' A# {; z+ G! S$ C
5 V1 D' y% D$ `6 v0 n ?: Q( y_________________________________________________________________________
: }1 l( k- y. U( r/ G {" b- X
* V& `9 {0 V1 f& R% q N7 s- SMethod 07
A) j) Z1 s, q: [, K, l' u( f=========. v+ k9 q2 l( q4 s) e1 y4 y% }" {
) x; E( j3 E& ` J5 Q* m6 {Method of detection of the WinICE handler in the int68h (V86)
3 z. u# a" q3 ^# M7 @; v0 i" }2 L* S, Q% O( y; O, E* r' G7 _, J: v1 y. x
mov ah,43h
) l7 \ E% q: M; T: G& }5 s) L int 68h- {( t2 u0 F2 I% y; ^9 H
cmp ax,0F386h/ u5 b9 J4 ]+ j
jz SoftICE_Detected: i( i1 z2 z! z+ t% w2 u: q3 L4 O
1 l$ m! ~1 r3 G
j5 R& f" ~+ \; A: P9 S( ~
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% B$ j! F- }- ~6 E3 V! } app like this:
e0 Q6 Q \/ A# B/ l0 j, |
/ U) r/ n5 V; V" l5 e BPX exec_int if ax==68
4 T4 A- G) V- ?' ~* t8 |0 r (function called is located at byte ptr [ebp+1Dh] and client eip is5 q5 K" z4 [) ~9 O9 U+ T
located at [ebp+48h] for 32Bit apps)1 {# u( v1 b! a& ~2 E
__________________________________________________________________________
9 Z' |5 i7 O% j3 `0 s" i# Y! Y& z# @, ^
" e3 ~5 V9 ]5 ?+ |' S( T1 ?( u, L& W
Method 08 x4 x; O: M$ v
=========
$ q+ ^8 D8 N3 c+ w6 g* S- T% F" U) B8 \1 w- w' d8 s
It is not a method of detection of SoftICE but a possibility to crash the
- E! X" h( V/ n. t9 z' C0 v4 Asystem by intercepting int 01h and int 03h and redirecting them to another
" r- T0 b- x& M! F9 z$ e- froutine.3 l5 ~* ^ b& J9 d2 o7 R
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! @8 z- ~) a2 F0 u, z7 rto the new routine to execute (hangs computer...)& y# ?5 e# e5 k/ m& j3 F7 v- e
6 X- s( U$ q) E' F+ \# T% R: |/ S mov ah, 25h9 e1 O. S2 _4 |( @: F
mov al, Int_Number (01h or 03h)4 a) K# W a' p+ J q, h
mov dx, offset New_Int_Routine
5 m7 q( g w( F! L int 21h' c _( c5 L, S f9 F
* Z" ?; s9 y" E- V& Y
__________________________________________________________________________
: l% l. x1 f6 [/ A+ H" B1 O0 G2 S3 v+ C( ]- D
Method 09
t {3 r' q8 T8 ]" E=========5 S0 o! r- S1 T0 T1 q
1 P! d5 s( ]" C. @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only P; A4 q6 [" P; D5 g
performed in ring0 (VxD or a ring3 app using the VxdCall).5 X- M9 O* G4 T" ?5 [8 O
The Get_DDB service is used to determine whether or not a VxD is installed) ]4 A5 H" ], R
for the specified device and returns a Device Description Block (in ecx) for
" d; N5 z$ a* ?6 Zthat device if it is installed.6 U: p: n) Q6 h+ w E- j2 @! M
4 l' g# c+ J+ Q D* v3 H) P! V3 s
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
6 F/ i9 {# ]' [* W) g) p mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)) n" W& s1 v5 v' G$ o) ~
VMMCall Get_DDB# X9 {- s" \( M2 [6 d
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 s6 P- g1 @' ?
% D# [3 ^0 p: l( D( F: D8 @9 z
Note as well that you can easily detect this method with SoftICE:! Z( O- `! C& g4 e9 p; m2 {
bpx Get_DDB if ax==0202 || ax==7a5fh
" b! H0 _/ k9 O, P3 C" U- `' d- ?- P% X) K7 v7 w4 U' p
__________________________________________________________________________
( j7 R4 r; Y9 [' a
* V* h+ V2 l6 DMethod 104 B4 y' W8 [' Y& U6 ]0 p. c
=========
1 O% j0 U( M! }. @8 ?( F$ w3 s3 C1 @( ?6 j$ H/ t: \7 F
=>Disable or clear breakpoints before using this feature. DO NOT trace with1 y5 b; a) O% b* Q8 F. y4 |& g: G
SoftICE while the option is enable!!
; S. G- {6 x' L; }8 w. A3 R2 |1 s7 A
This trick is very efficient:
) K6 j/ I; B2 {$ J5 oby checking the Debug Registers, you can detect if SoftICE is loaded
, v* {* z8 ^; |& e1 G! ](dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; t- ^! B; ?8 V! p7 f0 h# E! Z6 mthere are some memory breakpoints set (dr0 to dr3) simply by reading their; x) ?/ C( s: b7 f9 j
value (in ring0 only). Values can be manipulated and or changed as well
% S7 f; D! H+ `! Z: S- S5 _5 L(clearing BPMs for instance)
8 S# n8 o- Q k N" }- P
; l/ w4 ^# j- O5 U# R4 J: `__________________________________________________________________________& K5 {( ?7 K" d3 H8 A: H: H3 v
$ x( X( m$ l2 h, ^$ oMethod 11
0 g" t1 D& m, \, d' v=========
# K3 P4 {' g7 M( f8 U2 I# N3 k/ r7 T0 M) X! |1 R& e
This method is most known as 'MeltICE' because it has been freely distributed0 u& _' d# |& ~( W) z
via www.winfiles.com. However it was first used by NuMega people to allow+ h0 i& x4 T1 Z% H! w3 ]6 J
Symbol Loader to check if SoftICE was active or not (the code is located
" O! }7 H( M3 W: b2 ~inside nmtrans.dll).4 e! ~) E1 M% w* C2 d* @6 ?
i+ K C; ]: _& W: ]
The way it works is very simple:
* a$ I1 M6 o; N7 q% b6 M+ F/ ?7 n# N% YIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; w4 k% J4 G2 |- d& j* Y6 a: h
WinNT) with the CreateFileA API.
1 x$ |" U. L' m. H6 f9 d7 U" K0 F5 z4 y# p, S7 Y& \: o, E5 R
Here is a sample (checking for 'SICE'):
( v9 q- Y# `- N% q0 \" o/ G% Y3 |8 K5 ~2 h
BOOL IsSoftIce95Loaded()
, C7 w. B, t2 f/ `/ _6 n' h6 z9 r7 \{
: s6 n* `8 }5 v. J HANDLE hFile; 7 A5 L8 ^) k, L# a, |& K$ _+ ~
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& Y! O/ v) Q8 n7 w E; s9 p FILE_SHARE_READ | FILE_SHARE_WRITE,/ F( a B5 L( N$ M: c5 p
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
; V1 B" x k' R4 s) U+ Q4 ~ if( hFile != INVALID_HANDLE_VALUE )
* T$ i8 N$ \3 N* @7 ^% ^ {; V2 s- U* ~) r2 o1 N
CloseHandle(hFile);; d1 \) p9 q3 S; r% }
return TRUE;
" [+ w3 j. ?8 D" @$ ]( O }
- c d @* S5 P7 E& e5 R return FALSE;
6 j: S. @, t5 p, }. U z6 }}$ i+ j( M2 ~. @+ I3 B f
$ s1 }1 x; ]- ^& f' `" t
Although this trick calls the CreateFileA function, don't even expect to be, Y( L- }% L, N8 E1 h, `, w# ^
able to intercept it by installing a IFS hook: it will not work, no way!
& A$ n4 ]0 g3 v% SIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
. I2 x& a0 d# n) j5 E* `service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. A9 a* m6 j: |' T: J# ?' Zand then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 d; i2 Y a2 @0 a( Ufield.+ ^8 c( P, I6 ^" R/ q
In fact, its purpose is not to load/unload VxDs but only to send a
! @* B; L) q$ k2 P6 W7 F: x& q BW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 v9 s/ {3 u6 g2 T. E6 Z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 `% x+ \+ S( c4 N% i7 u' N9 D+ U
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
- ?- @: v( l$ n6 n! p+ c! `If the VxD is loaded, it will always clear eax and the Carry flag to allow
2 M) S9 r8 L0 y. vits handle to be opened and then, will be detected. i; f; @3 B! T8 M$ S
You can check that simply by hooking Winice.exe control proc entry point" g/ M: u' \3 |5 q
while running MeltICE.
/ d& a& L8 E Z# a+ V) s( q5 z% F: D. i, x* n1 O; u2 h- m& @2 j' c
- V$ c: s9 j2 }; G" @2 L" s
00401067: push 00402025 ; \\.\SICE
/ _( p, X$ C5 v, I- s) M 0040106C: call CreateFileA
$ Y2 t, O( C/ h. \ 00401071: cmp eax,-001
2 ~7 H$ J4 U6 g# Y3 D+ y; Z 00401074: je 00401091
' n3 m" @" E( a0 _. u
, p9 ^5 c* J. S$ j
0 v+ f0 H0 ?4 J/ ^7 {$ XThere could be hundreds of BPX you could use to detect this trick.
$ ~ B3 q" ^' j/ V9 x-The most classical one is:, i* x/ H4 _* |: k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 B- O. r5 r5 M% u% k *(esp->4+4)=='NTIC'" Y/ ?+ l( f3 h! b4 G8 a7 X; [
+ [, y6 X$ b q-The most exotic ones (could be very slooooow :-(, \0 Z7 t( D- L5 R2 O. T
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 W+ x% n" d% m3 Z5 M7 E
;will break 3 times :-(
, r- m5 s" ?- d+ h! j X# q! `( h" a$ F- I$ g+ F/ l4 O: u& ]
-or (a bit) faster: , ]. Q$ ~1 G3 c: B
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% g( |* a& P: Y1 B; K O! E
2 D; @2 M6 K8 E+ S9 b BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
|1 m2 F4 U/ x5 v( V* a) d5 V ;will break 3 times :-(/ P' Z3 \0 g/ s* E" ?4 ?
6 Y5 p# }3 l4 _" ^
-Much faster: H# d5 h( L5 X. t. T
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
6 K4 r' ?+ g$ @ r' R9 A4 V) E) I* g. j6 g& ]. O. g
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ K! Z; y- {6 I; k+ D! ?, rfunction to do the same job:
: R- H5 g( e& N/ F7 ^7 j7 \+ g; s8 O& q$ [4 W" v
push 00 ; OF_READ! n) |9 u8 H* y! @5 t: W
mov eax,[00656634] ; '\\.\SICE',0: x G: @; t) s& f1 `( @0 s
push eax
6 `8 T* I' C8 e* m7 j6 q call KERNEL32!_lopen1 a+ J7 B; V% ^. Z: Z4 o% C& P
inc eax: \4 ]: B6 V% l, c
jnz 00650589 ; detected4 J, b8 V' ?6 |, T
push 00 ; OF_READ
3 H! c* P6 }9 r- a2 O0 q E) `2 M$ Y4 H mov eax,[00656638] ; '\\.\SICE'. N4 x0 F7 z, b+ ]. E6 Q1 ]0 _* {# ^
push eax
+ M& X) k# N9 d% A+ { A5 t call KERNEL32!_lopen4 h% l& g2 F( o
inc eax
W( ?$ o; V6 P2 u; u2 c/ | jz 006505ae ; not detected; G0 x( O J1 Q3 c
' j( Z- a$ F7 S7 M! ^' X9 {% w
2 ~. w( w* B: t: _8 I* @- w
__________________________________________________________________________
. C, ^) I7 V$ L" ~" [- U
s& Q; `( y( Y" J! KMethod 12; g5 z/ o# [4 A4 w, }* Y. C
=========% p; {8 H# e. I( t3 l3 ^" K; v
- @- ?4 Q( _3 K$ C7 \
This trick is similar to int41h/4fh Debugger installation check (code 05) a: N6 b0 K5 h8 \+ n
& 06) but very limited because it's only available for Win95/98 (not NT) x/ ~: h7 H( P) i( N5 z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' \& Q2 s' X3 H" b* L! d9 n; e z; d1 t
push 0000004fh ; function 4fh
, \0 s( V, t7 |2 g push 002a002ah ; high word specifies which VxD (VWIN32), Q: n- Q$ A$ l0 J4 K
; low word specifies which service0 e4 j. E2 c8 [6 A
(VWIN32_Int41Dispatch)- K' u1 k* i. \# ^. Y
call Kernel32!ORD_001 ; VxdCall' J) k+ z& L" `+ a: ]# I
cmp ax, 0f386h ; magic number returned by system debuggers
8 ]) J/ b5 g \5 V jz SoftICE_detected
R0 W a: k0 h& e5 V8 B
) a* a6 C* T6 S2 o# m0 S, CHere again, several ways to detect it:3 V9 m2 Q% `7 I* ~0 R8 ]- t2 k# x
8 Q5 D4 x- a9 P5 T! H BPINT 41 if ax==4f5 c+ O1 u, s9 w' L
" q% G8 ~/ ]- |8 V) W
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
, J; A, r+ B8 C2 f/ K# y" _( I% c! J' J
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A" c; @& q3 f/ ]. J+ @5 g E
* q& i6 |9 `$ i5 J$ _1 G
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 ]6 i5 R$ J8 u$ C+ J4 t# g+ o. `' t
__________________________________________________________________________
! {) H, U& f/ F' a* \8 a; h! v# b
$ i7 `! L* W9 t c6 r% y* C% K9 h' ZMethod 13
$ t0 X% f) V+ X0 P- ^* l3 T=========
1 x2 n" f" D. b( s" W. H) V6 j( q, F7 Y" y1 S! h/ p" J
Not a real method of detection, but a good way to know if SoftICE is
! e- c" T, f) u% B4 [installed on a computer and to locate its installation directory.* v6 R6 F- s8 U! Q. {2 w0 j
It is used by few softs which access the following registry keys (usually #2) :, Q/ ? }5 ]: p9 b
& n( a& m( y0 `/ f5 W
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& [ l$ g8 R8 P& O\Uninstall\SoftICE
# h! u& `) z: G6 \-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 e; f6 K a7 n0 I$ N5 B3 p7 x( V-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# H Q3 k; M4 T" s7 n5 Y; @- W\App Paths\Loader32.Exe2 {1 O( m; |% F" Y0 f6 Q
; j3 J7 K; O6 w6 w3 }" O3 _) L0 e
" ?/ R+ W- Y1 n- s) W* [
Note that some nasty apps could then erase all files from SoftICE directory
: W! V7 o/ i7 V" A( H; p# F(I faced that once :-(% [" w) q' {6 W1 U# B. M
$ e- J' ?& G: V& cUseful breakpoint to detect it:
/ @/ U1 ?- o" n k/ U8 K! o! k8 l" V1 a5 i+ Z, |& H3 ]
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 y* r4 f. E) q7 I& c% q) w( Q3 f# W! q5 z8 S
__________________________________________________________________________! Z% y. h$ X9 g- m! ~9 A I
9 u7 V) s8 Z7 [ U3 e8 L4 e& Q1 h0 R2 C$ `( _( Q3 `8 v
Method 14 ( y6 J. T) J1 J6 }4 f5 {7 j9 X- ~
=========1 _( `5 T1 Y: v' s8 l( a
6 G3 z! y4 e* ^
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 o7 k3 G: d# i% ` D. U
is to determines whether a debugger is running on your system (ring0 only).: a k. H- i5 Q _
- G! u2 G5 u6 u' ?# a5 O VMMCall Test_Debug_Installed. N0 V5 l' G+ }/ a/ g8 y4 g0 g; i
je not_installed
: C9 P' }! g( G" g0 I8 ]
- b. ~3 \2 [( E9 B3 MThis service just checks a flag.
M3 @4 q: q* F! J2 h. I. k/ ?( n</PRE></TD></TR></TBODY></TABLE> |