<TABLE width=500>
5 M2 p2 c" }- Q9 w2 T8 C<TBODY>5 g8 v5 p7 O8 N' g/ j( R
<TR>" U8 M0 r% s/ v4 y8 ~/ ]+ j
<TD><PRE>Method 01 * s1 @' C+ |) B/ c( F) `, |
=========
9 a% ^* w- l( S: A/ `/ a
* a) K+ C9 l. z& i! U& KThis method of detection of SoftICE (as well as the following one) is1 k3 Y2 h3 Z5 P9 w0 E
used by the majority of packers/encryptors found on Internet.# A+ W. f" ^6 z* {6 N3 b
It seeks the signature of BoundsChecker in SoftICE
; \( V9 u% A& i' ^! o- u% U
0 h) a: _) A, f6 V( ^1 z8 q& a+ u mov ebp, 04243484Bh ; 'BCHK'
3 a/ [) a2 }9 n6 S+ `% d9 e. Z, d4 A+ b mov ax, 04h$ `" X/ l/ ^) L: u/ P7 r6 C5 n
int 3 $ n/ u& q% R2 B3 f4 t8 i
cmp al,4; }# P8 X* Z% S3 I- v. b
jnz SoftICE_Detected1 o( T/ \& [; Z" m4 o6 a
6 O: g: b5 w4 R0 {+ ~1 ^
___________________________________________________________________________( j0 k7 p; D3 _1 w
2 @; r6 d7 d3 N) w0 E: |
Method 02; M; ?- T) n6 Y
=========
0 M2 ] B' b0 U' Z) l. i( R) V: x- @: I; i0 Z
Still a method very much used (perhaps the most frequent one). It is used
; z! j! q( p( F2 C8 Sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 s: v3 Q7 a6 C% l8 b, `2 ^. z! ]& r$ ^* nor execute SoftICE commands...
( F" r* ~8 M9 x+ u' f$ @It is also used to crash SoftICE and to force it to execute any commands
$ O1 ~( a6 x- R; x4 [(HBOOT...) :-(( " N0 d1 }8 z# t1 J" b
; v U5 n$ r9 F6 a5 _6 t' S( P
Here is a quick description:
$ s, S$ b4 j* R/ d/ b6 U-AX = 0910h (Display string in SIce windows)+ G& n8 `7 d# K/ m9 ]/ \) K0 k
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# _! B4 D$ b; Y1 ?
-AX = 0912h (Get breakpoint infos)2 u# K6 J1 {8 u
-AX = 0913h (Set Sice breakpoints)0 t3 u! b4 g$ p& E1 b( r
-AX = 0914h (Remove SIce breakoints)
6 G( T2 M# d" w1 ]8 j! Q3 q4 p7 }( g+ g( ^4 i2 D6 D$ p
Each time you'll meet this trick, you'll see:% R( F7 a- W- l; a3 I; f
-SI = 4647h
5 Q6 P e/ X, i$ |# C-DI = 4A4Dh7 @. ]7 J! N7 ]3 F3 p' ~5 l# M/ a4 l
Which are the 'magic values' used by SoftIce.& M' w" {: y% W9 x' J4 q% [' B r# j
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 _ G1 F/ r' `) t
" _: B1 l5 r/ ]! G! F+ x* R; mHere is one example from the file "Haspinst.exe" which is the dongle HASP
$ N. e# |% Z% P# jEnvelope utility use to protect DOS applications:1 T% {* H( y% ^) l9 C
8 |! @# O4 h! J) Y# Q+ F* U: i3 d' H7 U0 }/ `* j6 e, W; F' I& ^" ?! J
4C19:0095 MOV AX,0911 ; execute command.
; C b) q( M% U% b' q1 n4 D a4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 l2 K9 E2 i( L& _8 s+ `, B1 Z9 ^
4C19:009A MOV SI,4647 ; 1st magic value.& ?- _ X2 {4 d( @/ H
4C19:009D MOV DI,4A4D ; 2nd magic value.
+ h5 z; ?* G1 c9 j: M/ y3 k4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* w" ]5 z7 Y. k) g9 D9 E; J. F
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
9 O4 {4 h! I! S$ F, [4C19:00A4 INC CX
L' o `5 i' u' W, p" g1 q4C19:00A5 CMP CX,06 ; Repeat 6 times to execute* r+ N% g0 h/ a3 ?' ]1 O! a
4C19:00A8 JB 0095 ; 6 different commands.
3 B3 w! g/ h( o3 P. e J: z3 [4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& w) g: {& h& ~+ @+ p9 M4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; _1 A: ]+ ~8 Z& C6 n1 ?8 [; I/ W
3 P7 h8 g) l1 V3 t$ W" { |4 LThe program will execute 6 different SIce commands located at ds:dx, which
5 l+ M q; Z/ i% g: Ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, q) d+ g$ h) C6 a" g
2 ^- T, `" W1 j3 b7 P _- _* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ f- c3 X& \( ]/ b- G* N1 z___________________________________________________________________________9 W9 O1 n* j' ]1 t6 f
* c3 f5 b/ v& i
9 Q8 @1 X+ Y: B* c2 y; s
Method 03
0 g2 R( {! a* u E+ _+ q=========9 x, n. n) g: J
: r; O9 C& y0 ]) b" n9 h- M, i
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. @- |. n" E; U; V6 G
(API Get entry point)
( J/ {8 L8 `. x; h' g! f% d 1 {% J" G' C" |! y Q7 }
; y, E; L' s' e% c8 ?9 O
xor di,di f, s7 N; n1 J$ n) d( y) h# U- o& D
mov es,di$ M7 |$ S3 V/ T! s' Q" |
mov ax, 1684h * l$ F- i$ Q8 U, H: v; w8 }0 t0 l5 s) h; s
mov bx, 0202h ; VxD ID of winice
* W4 {" Y0 x, c4 Y, ` int 2Fh
1 U: S+ J: d. w5 J- ]+ D* {9 P: T$ a2 h mov ax, es ; ES:DI -> VxD API entry point
2 J, `) U/ I" o) m; j% y add ax, di
7 b8 x. x0 O" o2 w6 j4 x3 M test ax,ax- P0 C, V7 W7 I
jnz SoftICE_Detected
3 `, @2 Z( u, c$ ~% z, `) y$ Q1 o- s9 f- N3 S
___________________________________________________________________________
/ J8 {, D/ u, F( O% N4 n M/ v2 ? h \! H6 ^2 {9 H
Method 04 F0 D) @% f' N4 j0 g" @
=========
8 a3 Y% g: C* y% }+ g
" a( }' G9 E1 O2 g9 zMethod identical to the preceding one except that it seeks the ID of SoftICE0 i$ o% n8 A: _9 I Y# B
GFX VxD.5 ]# b2 B" H" O/ ]7 o
# w T" c/ @# }6 y4 d xor di,di) e, E: g. i6 v0 }8 \' f
mov es,di) f5 w. A5 a2 f8 N& O/ t
mov ax, 1684h
: s3 A6 ?. P/ j2 i mov bx, 7a5Fh ; VxD ID of SIWVID
T3 E6 C/ g% u( B int 2fh
8 I. D" Z$ c- M; M2 H2 O mov ax, es ; ES:DI -> VxD API entry point
+ L% n8 P/ n, S7 M! Z" x' T+ { add ax, di
: E' G4 \5 j- B$ ^, J6 M4 Z test ax,ax5 N) R1 K$ ^- u& w7 g
jnz SoftICE_Detected$ ^( J3 X1 c3 B/ K/ o; g' h3 Y
! ?# @- `/ ^' H, B9 I__________________________________________________________________________
% F4 f5 R( D0 F: K+ _' {! Z! U) X) y
7 E* I# ]6 O* b/ `& `9 i
5 x, v. f' Y4 HMethod 05
, O& \% y/ F2 f! L, Z, x2 u6 z=========% T# q+ D4 L. Y, V$ _$ K5 E
. k9 A* N7 F0 s+ J8 [/ L/ Z. \Method seeking the 'magic number' 0F386h returned (in ax) by all system* Y2 l- m. h. \; X/ O: R
debugger. It calls the int 41h, function 4Fh.0 ~) n% K. l' T4 U: A- @! K' d
There are several alternatives. 9 F9 b- o, }* _; y
/ Y, \& S- t3 {, Y) ^
The following one is the simplest:! s. _" ^4 m& ~, f* Y: L+ l0 J1 i
- r/ [& B* Q- j* ` mov ax,4fh
, m) c- b+ H, e, U7 P) G4 h# N int 41h( x9 j+ Q' ~/ a6 f! ]1 X+ h% ]
cmp ax, 0F386# n( B$ i7 D& w
jz SoftICE_detected
! E& o; Q% W) N8 f6 f/ i i" c K" r# r& x4 B
4 F+ s" A8 k* E) h M
Next method as well as the following one are 2 examples from Stone's
, L0 s. J8 f# D0 m* H& Q5 e4 U* A"stn-wid.zip" (www.cracking.net):- f0 r3 b. z6 Y: @" n3 w: ?
/ W+ M; N8 k$ p( i t
mov bx, cs
9 F! ^) F& z, K6 f1 S- ], {; v lea dx, int41handler2
0 y1 I$ ]1 l7 i, o1 c. l0 K+ T/ q xchg dx, es:[41h*4]% J5 E$ c7 V1 C. Y; E0 P
xchg bx, es:[41h*4+2]( F+ y1 f; \- }& B# j% b2 g
mov ax,4fh& Q7 U% y1 l: K* m. g* B* c
int 41h, q% y6 Z3 k9 L0 V" x9 a+ ^
xchg dx, es:[41h*4]$ i) L1 v. B" n p5 {; s, ~( D
xchg bx, es:[41h*4+2]
8 u; r1 u/ q9 C; W I% | cmp ax, 0f386h
+ x$ y9 Q- W1 l* i9 b jz SoftICE_detected
: @7 t2 i2 V0 ^0 M7 f2 B% \2 M: q' U( K# Y9 D0 g, q
int41handler2 PROC1 o4 _5 d1 i1 B8 |
iret
4 E8 Q6 }# M4 q5 c' }int41handler2 ENDP' r. g/ _5 a, X5 ]
- @% Z( ~/ {! a7 D6 \" ^% K5 X R- L7 h( C4 u$ k
_________________________________________________________________________
7 h W' D4 o2 [' S3 O, X7 w3 i' s j) `3 ]. I
2 V9 J, M% {9 V1 n K' W8 rMethod 06
3 @" v9 q& ]/ w2 U) ]9 M) _=========" N! C; n4 |3 J" q/ @
k7 ^0 K; y! y9 _2 M1 ^4 }
- \" f6 P6 R8 [$ `
2nd method similar to the preceding one but more difficult to detect:
3 M. b6 z; T; c& V
0 o# q7 ]: m2 `. C$ i' p% ?% a! i! r! o
int41handler PROC: t- ]' @6 ?5 I* |
mov cl,al
2 c' H( k1 U8 \/ x( v iret; O7 W' ^4 e+ L6 u9 @, Q( @
int41handler ENDP9 a3 Y% z: B( Q' P
, g) G$ r9 z- v* L
4 @& k$ T7 [( l" r6 o9 A
xor ax,ax; r0 _- Q1 D, B1 f% w2 q( y, Z
mov es,ax
. e- g0 E: Q& F: ]. _- X# j' u mov bx, cs
% R6 G1 [' g1 z/ b+ w8 A lea dx, int41handler) N7 t; B, X2 v
xchg dx, es:[41h*4]( X, D6 U0 w0 J s" }
xchg bx, es:[41h*4+2]
# p% O( c+ M7 j0 L! P) v in al, 40h
. _8 P+ ~( s% U xor cx,cx
1 E* \, ^ |- A' v; F- z int 41h
& W9 p6 i7 [0 A; o$ |( Q( q xchg dx, es:[41h*4]
2 ?: B' y u# x6 H! X3 T" e xchg bx, es:[41h*4+2]! W6 q2 b: L2 n7 h- T4 [% a6 W( X
cmp cl,al
" t: _5 p; l' I. x' \! L jnz SoftICE_detected
7 Y0 W, v; ~ q& D; V$ h1 M
8 l3 l5 y/ d" C5 U_________________________________________________________________________9 d# y( q# u0 ]4 S% ]6 d! @
: Y& }- G! {; M# F& l% ^& oMethod 074 r/ t h+ |8 M+ A8 E* ]0 Q- F
=========
) J7 Q" T5 N! F- ?9 l; e ~, _4 B7 N7 H8 t8 l$ J
Method of detection of the WinICE handler in the int68h (V86)" M4 m/ s6 ]7 W0 e
# d+ }8 t0 c, J% J) k& L
mov ah,43h
) T% E/ j3 [1 M5 E. x- [! } int 68h9 F# ~* {: A0 B( M
cmp ax,0F386h
+ {8 ~) e7 E8 E# T6 s$ W jz SoftICE_Detected! R/ Z& n' h4 @/ [: Q1 B
) H+ m ]4 i) i: L1 w% s
/ V7 T, U, l! m1 t4 d6 H
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. D7 p3 l5 x, C! z8 F. { app like this:
0 B( ~/ `4 w& L, `9 A8 ]$ H, e8 _7 }* I
BPX exec_int if ax==68) ?3 I5 D" m/ x' O
(function called is located at byte ptr [ebp+1Dh] and client eip is
`, X, W \. ]6 w/ h3 o( F: p located at [ebp+48h] for 32Bit apps)
" q) c' I: q/ M; x- t__________________________________________________________________________+ X) S; g" {. @, H
8 o0 ]5 o$ j4 r* `: K' M" x9 S9 _( H# j& |, J3 o& z
Method 084 z0 l' q# o: b% p+ L* _/ I5 \) K
=========5 Y! Y1 v, Z9 v8 G# u6 L1 _
" F4 |- J- S8 j8 y
It is not a method of detection of SoftICE but a possibility to crash the3 R0 ]( v2 \7 F7 x( b+ P& w
system by intercepting int 01h and int 03h and redirecting them to another
* y0 M1 g- J0 b( `4 \routine.9 y7 B, z0 b6 r" h& S' b# ]
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points f3 B+ D+ v; |- c. p
to the new routine to execute (hangs computer...)( {1 C1 [: i+ b
; s' O7 s* N8 G U+ q1 E mov ah, 25h& L* x' ]5 ~" R) b
mov al, Int_Number (01h or 03h)" r5 g, G, _8 k8 b
mov dx, offset New_Int_Routine
0 i5 S" j f5 c/ h! {0 t int 21h/ n) b, b2 I E8 g
# `5 o( \" G ?; y" ~__________________________________________________________________________* \- _: \ Y6 o5 ], x) r i Y% v/ y
. L* p: ~9 M7 v* {Method 092 h6 b2 `- g& G! P' \1 R
=========
: ?# ~$ @) Z/ i9 |/ m% e: P. C! K4 [' b6 a+ |& j" N' }' C) K2 N
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! |- Q7 ?" P/ s4 y: n
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ I- e5 F8 o# }, @The Get_DDB service is used to determine whether or not a VxD is installed
, d }& h3 U; l. A! {- tfor the specified device and returns a Device Description Block (in ecx) for" K: F. Q0 O. a8 H
that device if it is installed.: u9 T9 I8 [! J; K
# l( ^( v+ c; e0 |
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
7 V: b* ]4 a! h5 \% I1 v, a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- M5 W2 T% Y7 v3 C8 m% W VMMCall Get_DDB
: |+ g4 @" v2 z+ s( D mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed1 a$ A! t6 |' c) I
& z$ K, I a7 v" C9 R; o
Note as well that you can easily detect this method with SoftICE:! F" G1 X2 S' D3 V4 G
bpx Get_DDB if ax==0202 || ax==7a5fh
& N+ h8 G. i/ b4 `# k* H3 ]9 P4 l/ n. f. U
__________________________________________________________________________$ I! d) Y2 J; E( y
: h n |2 C( n0 e/ N
Method 108 U& [. y9 N4 `; H) }, a4 t2 h: d
=========
- j% ~0 |: ~% F! T7 g# D, H0 o0 b: W" C
=>Disable or clear breakpoints before using this feature. DO NOT trace with
2 } K& p' G, N- g) R. r+ X SoftICE while the option is enable!!
6 W7 N$ _( ~0 y! y2 e$ J: r; s7 U/ ]4 [
) D# r) l" L# s z' u" lThis trick is very efficient:
% u7 `7 J7 u+ B' w: U8 c! Rby checking the Debug Registers, you can detect if SoftICE is loaded
" r( Z" N' R6 |5 r9 f0 t1 [(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if" z% F$ y& ?0 F7 \! B( B- r3 m3 F
there are some memory breakpoints set (dr0 to dr3) simply by reading their/ w1 i" E7 z6 Q4 ^
value (in ring0 only). Values can be manipulated and or changed as well
+ z0 _* a3 a% G( ]* X- R(clearing BPMs for instance)2 ^0 S- O7 o. z& Q
. k# q$ v5 K1 X4 y; c0 ]
__________________________________________________________________________
8 z8 p* t! ~5 a! u$ g* w+ H! M' }; m0 i% N/ ]
Method 113 U7 L8 I' Y6 u s6 m
=========
' G$ V2 i2 j1 y9 @4 e/ r- {9 X! ^. c( i4 c+ y
This method is most known as 'MeltICE' because it has been freely distributed
% y5 Y. }; D9 C/ a2 ~6 i* V1 ivia www.winfiles.com. However it was first used by NuMega people to allow& V' }) X: l# |$ m' w# ]* m+ t
Symbol Loader to check if SoftICE was active or not (the code is located3 z' p5 x5 G N/ w# x6 b7 @
inside nmtrans.dll).9 O) o+ l( ]. q! \' A! a
6 c+ W+ {! o( s2 h6 @" sThe way it works is very simple:
+ Y$ }$ O0 F6 k iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ f }2 |. w' z, U8 ~/ fWinNT) with the CreateFileA API.8 A2 A: s( o' u+ E0 T
$ Y* f+ k% e4 X; r. B
Here is a sample (checking for 'SICE'):
; E# X- m+ u9 S
9 z6 p8 X* ~4 _& j0 r% dBOOL IsSoftIce95Loaded(). a# O! T# e. u* P
{
4 R$ m6 R" r+ n# u HANDLE hFile; , `% F( K |7 P3 p+ a1 s
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
( G9 Q/ c9 T0 @ FILE_SHARE_READ | FILE_SHARE_WRITE,
' j9 M! p1 E" [, n) B. u) b NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( r. v/ U% | Q( v$ g/ Z( t
if( hFile != INVALID_HANDLE_VALUE )/ \3 R6 d T" K5 u
{, z2 s9 _0 E: s( |) _+ y
CloseHandle(hFile);
0 K8 n/ e8 C5 h0 ^. T$ V# Q return TRUE;; Q: J2 e# @4 p8 ~
}' |$ u/ F5 k( Y, d9 m- C! P
return FALSE;& ^& b, `# u, N6 W6 R
}
5 r. ^& m; B; I3 c) F' l. q% F6 R9 V
Although this trick calls the CreateFileA function, don't even expect to be- [* n) q# d# F) |; J
able to intercept it by installing a IFS hook: it will not work, no way!8 K: B& d) F: r/ S' Y0 l
In fact, after the call to CreateFileA it will get through VWIN32 0x001F9 s: ^; S W2 u- u/ n( V
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 X5 s0 n' _& R1 C8 s0 N) [
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
) C6 W. f5 X5 v5 G& A' ^field. `; X" D0 [0 j" P& D {
In fact, its purpose is not to load/unload VxDs but only to send a
8 k( Z/ ?, t t. c0 `W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 N S! T. {! z: r: g- S1 @
to the VxD Control_Dispatch proc (how the hell a shareware soft could try1 s" l2 M& S" O
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
2 h8 x7 y1 V' r5 V6 F4 KIf the VxD is loaded, it will always clear eax and the Carry flag to allow$ w7 d) j* O! p
its handle to be opened and then, will be detected.3 O- A- ~6 O5 V& t
You can check that simply by hooking Winice.exe control proc entry point W$ n* U9 G$ r6 k& {
while running MeltICE.
( @) w, k0 C2 @. K$ E7 e! s4 F
4 c, A8 Y! M# Z. z0 a( V/ ]
7 Y) I1 M$ Z( J7 ]8 \5 ?7 l 00401067: push 00402025 ; \\.\SICE1 M" ~5 G! v& j; i7 X
0040106C: call CreateFileA
, @5 d2 b& c/ T4 e$ N# R/ b7 o3 i1 ^ 00401071: cmp eax,-001! W# _% x6 M7 E A" M% p1 y
00401074: je 00401091' e/ S, `8 N; d# m# ?* v' {! W
, \1 x" v" f; S. h q% s) L
5 Q) I; ?" N6 }* `There could be hundreds of BPX you could use to detect this trick.
' o3 R0 o! H7 m' z. p2 P9 }9 G-The most classical one is:$ C" d6 ~; l$ v8 |, z: D9 l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
& c) X, m7 Y( b* K$ V* Z' ~! o9 I *(esp->4+4)=='NTIC'
" q" J* U# E0 E$ E! u/ g* o
' E; ~8 _9 Z5 A2 b% n! a' H/ a& B-The most exotic ones (could be very slooooow :-(
6 X0 ~ Q5 A0 A BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
+ ~, ?0 _* m8 z5 y ;will break 3 times :-(# d( s/ \: Q; J& {
# ?* D! E3 [* J! Y4 d6 l) P-or (a bit) faster:
0 {0 y) {, U; r2 D) P' ^ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, z4 k. T! c5 g: s7 d: w
, y/ f. e' H5 D C0 H BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 7 i, ^) X9 G# H Z% S |: R
;will break 3 times :-(
8 Z5 y- Q0 N& u8 {! W# y, G! z* `$ [6 x, G% M6 B+ U3 `
-Much faster:* ]1 |- d3 J8 a- \" | i
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' Q, Z: ~$ i5 s
" i" }0 b3 d. x+ Y2 j4 z% ^Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! Z& w0 b* x6 r }& }! j5 Z, Afunction to do the same job:7 Z4 F O! Q6 w2 Q$ R
$ r3 R" V2 f* }6 w. E; z9 ]6 R1 p- H
push 00 ; OF_READ9 k6 C& B! S7 V" t$ U
mov eax,[00656634] ; '\\.\SICE',0# U- U) c' M* s" R
push eax
$ ]* k- D8 M* f4 V) A( X# Y call KERNEL32!_lopen
H* S/ q9 |. H inc eax
: ?+ L l! a, O jnz 00650589 ; detected4 [1 ^ @' l* s4 C E( f
push 00 ; OF_READ
+ s( O6 n3 e Z/ k4 B3 ^ mov eax,[00656638] ; '\\.\SICE'- ^8 I8 o# e' z
push eax
* V1 W- k' A3 e; W2 | call KERNEL32!_lopen
. [+ [8 s! W j' v' P inc eax
% B6 M; a& S, z jz 006505ae ; not detected
4 W( |+ O$ M6 X1 w: h' x
- x$ c( d/ [- D7 _+ p% l/ l6 ^* l
- Z) s+ P1 K" P__________________________________________________________________________* }! F1 w N: B) K' }8 v* i
" ?* z; ]! c$ f+ wMethod 12
/ q9 @/ e8 \8 I) J' z: |=========% R; \6 w# @6 P; q7 {% k' z* w
% _% Z! `: a$ { @) L0 BThis trick is similar to int41h/4fh Debugger installation check (code 05* }+ q, R }8 G# o- p5 m
& 06) but very limited because it's only available for Win95/98 (not NT)2 r) P: G6 r5 Q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
- a0 Y* J: \6 E2 A7 i5 E( d. k' E! y t
push 0000004fh ; function 4fh& C+ X$ W7 B: X; K4 B
push 002a002ah ; high word specifies which VxD (VWIN32)
9 q( h# d# v# b6 {9 m ; low word specifies which service
7 s1 j& q; \! V' z( W (VWIN32_Int41Dispatch)
7 N: S% V& g9 D call Kernel32!ORD_001 ; VxdCall
" G1 T. t- ~1 i0 Z cmp ax, 0f386h ; magic number returned by system debuggers
0 D3 }5 G9 o4 n8 E$ D* T. V T jz SoftICE_detected8 {# y$ q7 _! |1 q6 Q4 u2 k/ p5 T
% L2 ?- E0 [* G: }# U4 K# gHere again, several ways to detect it:4 ^0 k) j4 N4 x
1 Z+ n* G7 N. k. m& O BPINT 41 if ax==4f& w: F% @) a4 A3 ?+ }$ R* ^/ p! K
+ i1 U0 N% [) p; G! D, S0 W. F BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one1 ]9 i. E- _' N# Q% \$ v
1 J# l6 l& o* ~5 I) l: O4 ]6 k) R BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 D: X+ ^& y4 u3 v
$ f5 [0 V6 ~# t5 a+ X& ^, Q) z) D7 l
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
$ ]/ B3 R) k7 U5 B6 G- e1 q. F5 D+ Y( a. [2 K& _5 [" H2 F: S u
__________________________________________________________________________
+ T1 j1 j' a9 @- R( b- D6 p# e7 f# ?1 e; T+ y# X- ]* r
Method 133 d" L/ j; [( \. \; x
=========3 W0 A& _7 C! b% K6 s/ m
/ V4 q) v4 R" cNot a real method of detection, but a good way to know if SoftICE is
4 w- ^) x' M+ }7 {7 N9 N7 winstalled on a computer and to locate its installation directory.7 }' M7 l" P1 ` \$ Y, E8 }% b
It is used by few softs which access the following registry keys (usually #2) :& X6 O% W# A2 T8 T/ I2 n
0 k+ \% S5 u" J
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; y6 j, _4 d& P$ `" T9 h\Uninstall\SoftICE% ]* s/ |7 u- U
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE) d I0 p9 V5 @0 |, l
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 @2 G! Q. }$ `5 O\App Paths\Loader32.Exe
& d0 s5 O0 Y& A/ j8 N9 ?
# \9 j% j* G, Y7 B0 u
# j! z$ W1 w+ U p+ [+ m v( u! ]1 ENote that some nasty apps could then erase all files from SoftICE directory
: m; P* m" q) P(I faced that once :-(
) h3 S% ]+ q8 v. X4 J) H) V" l8 O: G1 R( `
Useful breakpoint to detect it:9 b6 J, S0 y. U0 ^% s
/ E3 A. x; \2 H) v: J
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. e2 r5 D# ^' [# l! F$ W- R
- C2 p" ]& `+ I__________________________________________________________________________
$ Z6 a/ V o4 s* y6 [% r
% Z1 x; J1 Z5 X2 }7 R9 t
0 `9 K% Z, X9 U7 j0 ~4 sMethod 14
' u& R; V e9 y1 L U5 I: H( J, ^=========' o" ~! |* J, o, s% x) F
- U' L# z& t5 z! P0 l' ~) E* Z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) b. y. N) D# ]8 \
is to determines whether a debugger is running on your system (ring0 only).
1 z# L. T/ m& S+ f) }
* c, |; q9 O3 C. J VMMCall Test_Debug_Installed! W: D! h4 G' Y% n& \' b
je not_installed6 ~8 r5 I8 \0 x* G
H2 _3 P# |1 y* oThis service just checks a flag., v) W9 ]' s M% j. d
</PRE></TD></TR></TBODY></TABLE> |