<TABLE width=500>
- k( D6 @& s% N8 H# D$ ~( E- E<TBODY>
. f9 {8 J6 ~0 }( |<TR>' ~0 g3 |+ @* V9 r i- a8 V8 @
<TD><PRE>Method 01
- ~- U' { j# t3 V6 u1 c" {/ x=========
7 |1 U0 j- ^' A+ Z9 e0 q9 y2 d1 t+ l( D' E2 }# Z3 Y
This method of detection of SoftICE (as well as the following one) is7 y0 f# P4 c+ y% }" Y. }& D5 n7 e
used by the majority of packers/encryptors found on Internet.+ L4 l* }7 f8 ^7 X
It seeks the signature of BoundsChecker in SoftICE
$ G3 I- l9 h. F! z b, l
, t) u5 m4 @# ? mov ebp, 04243484Bh ; 'BCHK'4 A& O# a, g3 f: G
mov ax, 04h
- P; I2 I- z' } int 3 7 Y" r. U$ g {! Q2 y
cmp al,4
- T9 \( p2 q, x9 w1 J' q jnz SoftICE_Detected
( P& Z: K. A* G5 @! Z2 H! O4 t
# d! c+ b3 y O& F& A___________________________________________________________________________/ o, O- X' G5 c% i. Q. t2 x. c
9 n1 S9 o5 F2 M7 F9 R) F8 @
Method 020 f6 f9 g9 m, ]& ^$ d
=========+ d0 c0 r; c t& I; a
8 I! L0 W3 U( w% a. [. |1 @
Still a method very much used (perhaps the most frequent one). It is used
7 [3 O8 K. e! [' ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 p( G- g/ v) @9 b7 D+ `or execute SoftICE commands...
: j( U' ]5 y, B: d. ?; y3 }It is also used to crash SoftICE and to force it to execute any commands
4 H, [! ]+ J: ~! D(HBOOT...) :-(( % _/ S9 a$ l! G' z4 v1 _5 q
/ b& Q' V' H- i# s' b' \
Here is a quick description:( P" ?0 d3 N. w1 T2 p2 L
-AX = 0910h (Display string in SIce windows)
6 c2 F% ]6 D0 }, f& x/ q$ e-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)7 b4 s3 k2 U! i [" M! s: w" {
-AX = 0912h (Get breakpoint infos)" P) ]# X% |( @
-AX = 0913h (Set Sice breakpoints)2 q# |, T$ _$ m2 E p
-AX = 0914h (Remove SIce breakoints); _6 S9 Z" [- e* \" }8 x
2 E) p! ^5 I) J; i0 B0 D* S/ K
Each time you'll meet this trick, you'll see:, ^" |) j+ b& h* C4 M
-SI = 4647h$ Q3 L" H @$ s3 G2 d
-DI = 4A4Dh$ [: o1 K4 B9 X% J6 U: ~% S* l1 Y
Which are the 'magic values' used by SoftIce.
+ }! `, ^, M* H1 eFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.. I1 M1 |# @: h6 ?' K- z
+ N- r5 A' Q/ v) U- d% O8 n1 r
Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 Y. a0 J) P8 a5 k3 eEnvelope utility use to protect DOS applications:/ j3 u3 R# A+ R& m9 J0 p+ N+ k
; J. A0 m$ r0 G( a8 b: ]# ~! |
& h/ k2 j4 K% I4C19:0095 MOV AX,0911 ; execute command.% P3 \5 Z) J# g2 }& a7 v! e+ \1 ^
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: ^, K0 h/ ~2 }) a) j4 ?5 f* f
4C19:009A MOV SI,4647 ; 1st magic value.
! I* g8 r" y' B! a. i2 n* G0 O5 l4C19:009D MOV DI,4A4D ; 2nd magic value.% c9 R8 Y6 {2 M% L
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)( R! L7 K# R9 Q) z4 Q) c3 \5 B
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute/ \+ p& b3 G" A/ p$ [# c$ l
4C19:00A4 INC CX8 f0 e' B& d T/ B/ ?
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: R- g) R8 n+ I% J! k* L
4C19:00A8 JB 0095 ; 6 different commands.$ p& s6 ]+ B& E1 C# e# F
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 a: b$ S: ?& \) I% O/ P+ k2 ~ ?/ z4C19:00AD MOV BX,SP ; Good_Guy go ahead :)9 ]% T3 L- r8 a- d+ T4 c
3 x) u+ ^% ^* r
The program will execute 6 different SIce commands located at ds:dx, which9 V: |7 {- T4 M/ V; e( R
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
9 z6 e- ~6 l' `! o& Q' i/ z
# b8 W. U5 {6 c# ]' K T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 S' T. L8 T! \. J+ x1 I: D) K
___________________________________________________________________________- E* ?& A ~6 ~ K4 o4 J
' G' X5 b' j7 D
4 l8 u0 y8 h# M' Y+ K. ]Method 03
7 {( O6 i; |( n- r=========# F5 ^# k- Q+ \) y, y% F4 K( |
9 n! v: l3 d- P* W
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h+ x5 n8 r5 ~" j! Y5 `! c
(API Get entry point): }$ F5 B3 R5 P a& \6 J/ i' Z
* \* B; }0 Z* |4 h# F+ t1 a
( \+ v/ y: C2 I
xor di,di% a& w5 ~4 {4 H9 ^
mov es,di
+ r2 E0 u5 ^% Z8 y mov ax, 1684h
6 G, R0 l |8 C3 s mov bx, 0202h ; VxD ID of winice/ J# Z' k1 m9 k7 Y! B! v
int 2Fh
" D5 a9 C0 D% h1 I mov ax, es ; ES:DI -> VxD API entry point
7 z: d! i; E1 X) S add ax, di( |* p! S7 ^9 }& B5 [+ d4 G
test ax,ax4 i/ `2 K8 P& B) m; U
jnz SoftICE_Detected
1 R1 }/ X$ v% n$ R8 ?5 J/ i8 \% e) h. b# t8 q3 \
___________________________________________________________________________+ ~" e% B3 q5 H9 [7 N5 y9 [
. _; I* v/ q, z8 q' M
Method 04
: J* Y$ h; \4 o n) I=========
: [. o" A2 N. r1 b6 e! c
& i* s) }3 J/ y+ pMethod identical to the preceding one except that it seeks the ID of SoftICE
' @ g4 @5 o. _% S YGFX VxD./ s% g) }' h3 Z/ r
/ g. z+ b; y9 O% {: \6 g xor di,di( x) [( G% t7 L3 u; E/ Z! e
mov es,di
2 y# J5 \$ S6 E: C mov ax, 1684h . r/ T3 G: r' i1 y6 Q; d/ c2 H
mov bx, 7a5Fh ; VxD ID of SIWVID2 Z0 |% m" t* L6 F" ^. `
int 2fh4 `5 {4 l+ B/ t2 D- P! _
mov ax, es ; ES:DI -> VxD API entry point
7 }1 n* U& d! s, v a add ax, di; ]: v7 P9 {" J9 H1 E
test ax,ax
$ i1 S! I# m8 f/ ~7 B jnz SoftICE_Detected1 `/ l( m0 g5 A3 j) l5 W' O M/ A: p
" `8 Q& [: q' v$ S% ^; v
__________________________________________________________________________2 E7 I' O3 H5 s$ J/ L$ N
7 o( i" O$ N( j& |$ w
2 e# U9 R+ c, n- f v+ R$ W
Method 05( D' K9 U! P3 A
=========
+ g, e3 U, `- w' J, ~1 b" h
, f9 e* i2 m6 y5 f+ M% g/ ~Method seeking the 'magic number' 0F386h returned (in ax) by all system, Q( p1 g6 s) P# }
debugger. It calls the int 41h, function 4Fh." n1 r- T5 @; d0 h6 h r
There are several alternatives.
+ b/ ^1 q. _' l6 \' E& J# z5 R0 d- h7 r @! g* x/ h/ h' u1 I
The following one is the simplest:5 K' `2 j+ c7 O0 H
# F% K9 k0 ]" E6 y4 b mov ax,4fh
3 H4 f; `, t0 k0 ^8 ] int 41h
( u! {* l6 a/ U( V cmp ax, 0F386. h# A, K+ v) ^6 t# T2 {
jz SoftICE_detected
5 F; I/ H8 q# l0 ]# B
/ M1 s; ]1 y+ a) I- {6 d. H& @; |) t# b8 W& {
Next method as well as the following one are 2 examples from Stone's & p) D% I5 K% @
"stn-wid.zip" (www.cracking.net):7 w5 H" c$ \7 \' p
+ f' c9 Q9 q( T/ v
mov bx, cs
% v( G) [4 N3 ? lea dx, int41handler2
% h. ^/ C2 Q& E' P: I* k xchg dx, es:[41h*4]
7 J' k* b1 d: c1 g, E xchg bx, es:[41h*4+2]5 c G. X* U% { Z" |7 f! V& r; Y' _
mov ax,4fh
0 Y4 A4 ^4 f' n# Z6 ^& w) S' o int 41h
4 T% p4 g( Q2 N, {1 { xchg dx, es:[41h*4]
8 k) t1 M* a6 u' x* _% O8 A7 w xchg bx, es:[41h*4+2]9 C7 R9 h; e0 a* ^, E, n' M5 W1 ?
cmp ax, 0f386h2 U/ K) K+ ^, g1 b s
jz SoftICE_detected# D9 `7 m0 v' L% | y6 H
. q! |" K. [" v) [, gint41handler2 PROC
9 s4 i6 y0 U$ B* T+ w, p9 Q! A iret, @( a3 p) c5 Z2 R; P
int41handler2 ENDP7 Z; ]9 @" T2 s) v4 [5 o
" l V7 a& a1 K
/ U G) w, z8 h" B! d4 T_________________________________________________________________________- f4 o ?% R. e0 ]) P- s
1 P! q& {' w! j2 V" Z1 W# x5 h+ z+ ~: N
Method 06! y( M$ @/ k% n& ~. N9 v7 U
=========- P+ F9 C8 e; [0 }
! L/ f" K& ~+ u* [
y7 N" O! T$ X* C- b2nd method similar to the preceding one but more difficult to detect:
5 J X* E+ R5 p0 A: g( l/ f
1 s% B( ^1 E! J+ A6 e) w- l$ A* d9 V9 P& s
int41handler PROC3 d" }! r1 |; |# T& \2 ]% D& U
mov cl,al
G% v: V" f' Y0 f( h iret: J/ o# o p4 L4 W4 I+ [9 a& u
int41handler ENDP
& |9 L" N$ Q9 Y3 K, b8 o/ M, o ^9 R- ?) N3 w# m
- o4 {* u9 L/ F. N# J, Y
xor ax,ax
% K; }5 p* M9 s- [, g mov es,ax
6 g, y8 N2 m# V, l% l9 | mov bx, cs
/ P: ^6 v6 B* H8 `, k8 v* @ lea dx, int41handler
, [" [9 ]5 x% W& I( M7 ?5 [5 k xchg dx, es:[41h*4]0 Z0 Z9 T/ ^9 D1 q* X9 c
xchg bx, es:[41h*4+2]. n ~$ w9 X$ W8 W
in al, 40h$ w w9 I+ _$ Z6 l P, A8 C' g
xor cx,cx% O G1 U2 r$ N# e. o8 x8 D
int 41h
8 R) m9 |: c$ R4 K xchg dx, es:[41h*4]
/ O( | ^, C2 x; N$ {; Z/ P2 R xchg bx, es:[41h*4+2]
7 P1 i# b* d7 [- f: b. k cmp cl,al
2 ^( o! g8 M, i9 W jnz SoftICE_detected3 C2 [8 Q7 r7 i2 t0 c1 |
# D' b5 n+ A7 ]) t( @/ \, k0 ~
_________________________________________________________________________" y5 d( Q) l9 P- h
$ K! T6 a; V* k5 k% b- P& }; g; m1 lMethod 073 ^8 X+ g8 H3 ^" h3 y. L
=========9 m" Z2 v* T. h7 O
: s$ M- r8 d" Z" Z; O7 U* OMethod of detection of the WinICE handler in the int68h (V86): q8 `$ @& O* _ i9 d
: _9 u1 Y7 l) v: C( b3 I, l mov ah,43h& \) @% Z" U3 ?. j C
int 68h
1 M8 W H& ?2 X+ Q6 E- T# A cmp ax,0F386h( _# X( D7 Q6 L( K* y# G
jz SoftICE_Detected
: ` a: d: z" |. d O8 v* E) [4 L9 ]7 ?, }8 z& S% w3 G. Q
( ~! P5 Z+ C2 G4 K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
v( C- ^7 t$ F$ |1 r+ B( s app like this:
; J: i( M3 h0 R, C' D
: B$ d9 w% ^: g& \' J; r5 E BPX exec_int if ax==68
7 R; V' m P7 z (function called is located at byte ptr [ebp+1Dh] and client eip is
, U& c a. ?9 Y+ J2 n located at [ebp+48h] for 32Bit apps)
3 A3 A1 v W; f__________________________________________________________________________
. M" N o3 j; g
5 E5 b' O% F4 ~+ ]3 c, ?8 ]# Y2 L
6 Q9 \& w# y. z7 m9 x7 QMethod 08
9 N& A# J) d; l=========% N- f% M2 o# S8 B% K1 V* Z) Y
! P; B0 j" I7 \! ^4 IIt is not a method of detection of SoftICE but a possibility to crash the. z1 }3 p0 l c, D4 }
system by intercepting int 01h and int 03h and redirecting them to another& r2 x6 l3 w# \$ a. `% O' n1 K
routine.
" s" t3 ?# C- }1 F: F: aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points L! w( X9 y# M5 G, z# V4 F
to the new routine to execute (hangs computer...)5 k1 q9 D/ w5 A0 z9 S9 {; s" X! u
$ X: l, e) c( { mov ah, 25h
% Y: S+ C. _# i- Q, u# @2 a- d mov al, Int_Number (01h or 03h)
4 K8 F+ Z# l$ x mov dx, offset New_Int_Routine
6 Z- z6 ]2 c. b+ k1 \5 c) n# m int 21h. I3 h' @3 S, S- l# g6 e7 R9 `1 ?! t
! Y" w, ]9 z: {! a8 F. k, r& e: N+ U
__________________________________________________________________________
5 V2 J0 _2 Q4 W. j4 H, c; E; T4 `3 [0 s( t8 X2 n
Method 090 g/ w" w$ m6 V& A
=========' A; t+ e/ l4 F& W6 u
# G: R* H U; C: M4 w8 cThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! `- ^8 u7 b& m+ I, @+ x$ t
performed in ring0 (VxD or a ring3 app using the VxdCall)." X$ u% P* ~, Q: z4 G
The Get_DDB service is used to determine whether or not a VxD is installed
* K" v p# E# R( b' o' | e" pfor the specified device and returns a Device Description Block (in ecx) for
8 Q" C7 W$ E o/ J& r, ]8 Gthat device if it is installed.
. A, |/ a+ X5 e
. ]& v% G6 w' k8 K. n( E: ^ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID) H$ X9 y$ K4 F$ \0 K
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 B2 ^$ y$ W$ y" R" I9 D VMMCall Get_DDB1 g% F [. t! F8 ~' y' t
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
d5 b- w3 U2 f$ E
1 [( K3 u! ~ Q |$ F6 u9 G1 [" }Note as well that you can easily detect this method with SoftICE:8 T g0 N+ D+ ?9 O
bpx Get_DDB if ax==0202 || ax==7a5fh
7 U* m" I% k0 Z0 D* X0 }( q w( X4 z: f/ B7 ^3 B2 Z* Z- Z4 Z
__________________________________________________________________________0 p" z0 Y& \9 q
. i3 [ v, u2 b! K
Method 10' e% {7 }$ b2 c7 Q: r; K, ~. z
=========
1 [- C1 w K# d4 x
: x2 Z8 d( Y/ C4 p/ v=>Disable or clear breakpoints before using this feature. DO NOT trace with
+ y5 t- w3 O" w/ U SoftICE while the option is enable!!# N6 A, O; i8 ?: ?& [3 C7 u2 s
/ }+ Q; B: f/ J& c* n; ]
This trick is very efficient:
$ U: J; H! s4 a7 K0 H/ }+ pby checking the Debug Registers, you can detect if SoftICE is loaded
6 o# w# @" R U) v/ o1 Y8 G(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if s5 o% N- c- [' z3 N6 Q8 [
there are some memory breakpoints set (dr0 to dr3) simply by reading their7 [& \/ R! k- q* N; Z1 b2 K; B
value (in ring0 only). Values can be manipulated and or changed as well
% H) f) ^) c/ D8 S5 h! \(clearing BPMs for instance)7 p, b; w' u! f! k ~% U/ T* D
7 H3 f0 C) y3 \) X- z7 f$ I: o__________________________________________________________________________6 R. f1 E9 x! I' s; j7 l" v, H
y8 y/ |7 B9 O8 N/ d5 \7 h) o; M
Method 119 @$ z |9 [& v7 P) C
=========
) \; C6 v! Z% W# p% o1 I2 ^& C4 ?! N L) ^! G ?
This method is most known as 'MeltICE' because it has been freely distributed! i7 v8 ^) ?. N& ^. x7 w0 f& |! M
via www.winfiles.com. However it was first used by NuMega people to allow$ |& F+ c8 F6 v; K. k' m
Symbol Loader to check if SoftICE was active or not (the code is located
1 k" J2 ~5 s9 o) O1 binside nmtrans.dll).
' k& n9 y6 V& ^2 _! L
T# E& _: v8 f$ K6 H5 jThe way it works is very simple:
5 Z" B& q) ^# y, H/ Q) {1 iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 s k' X3 ]4 D5 Z) ]1 C- ~: G2 [! I0 iWinNT) with the CreateFileA API.7 C- S' F9 S, u2 p
& O* I; _0 n" j& i( q: n/ M/ C
Here is a sample (checking for 'SICE'):
! p8 U$ m2 J# Q
7 i4 X- ]4 g3 N1 SBOOL IsSoftIce95Loaded()
/ f3 R, J2 l4 s- g{$ [1 @2 M" j4 P0 m7 e8 c0 P
HANDLE hFile; 9 v6 b7 K4 x L5 R& h* R- V
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& J$ n3 r) R3 y V# e- F% n FILE_SHARE_READ | FILE_SHARE_WRITE,
/ i8 |0 y% M: b NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 o5 q7 `: p3 G/ [# [) z6 P
if( hFile != INVALID_HANDLE_VALUE ) a0 t1 g! U" R
{. P2 P, m" p, ^
CloseHandle(hFile);: `6 y! S' @) s
return TRUE;2 v8 j/ y/ @. ~$ B
}
: q7 ~7 Y' Y% `8 Q5 R$ G b$ W0 K4 l return FALSE;
* N0 g, [6 [* V0 }4 Z& l4 E2 o}4 o" z1 Y; f% t% z% X5 Q$ r
% c3 {4 z8 J7 P: k! S9 }Although this trick calls the CreateFileA function, don't even expect to be
; ? }6 Q& F& D0 _, i/ r; N$ L8 Fable to intercept it by installing a IFS hook: it will not work, no way!
1 }) {2 ~5 L" U5 p4 gIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
) o, F/ i+ @2 C5 v0 hservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
; E$ k9 O/ F" B5 {: b$ X7 R$ \. G9 ]and then browse the DDB list until it find the VxD and its DDB_Control_Proc
2 ~5 w) s5 d; O+ v! a3 [3 _field.5 @7 P' l4 ~0 h, F ]
In fact, its purpose is not to load/unload VxDs but only to send a - M1 }3 Y* d" G) N5 r' n
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 u, Y2 g+ O/ z; Zto the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 v: y; ^6 K$ [; P3 Qto load/unload a non-dynamically loadable driver such as SoftICE ;-).8 X6 M2 _4 J% R# C% r
If the VxD is loaded, it will always clear eax and the Carry flag to allow& u* y( Z) j9 ~$ J" W& v V+ X
its handle to be opened and then, will be detected.
$ f$ C- q- \, T* I0 m: s" cYou can check that simply by hooking Winice.exe control proc entry point7 V* ~+ q0 s- d$ \5 v s, n
while running MeltICE.! U9 ^# w) a% k) n/ M
. V$ X9 w7 t; V' T% a% M& G8 S6 @
8 j5 q( F7 S; W- ~4 `4 e 00401067: push 00402025 ; \\.\SICE
% i# X3 U% [) s' e" f 0040106C: call CreateFileA
& L! d: L; k" p; h, S, W2 E 00401071: cmp eax,-001
' G6 B: z- g9 a2 H 00401074: je 00401091
# {- x h% Y' s4 i% F- `3 L5 V8 f& F5 c6 j( m9 }& K
+ w' j% U% q* ]/ V
There could be hundreds of BPX you could use to detect this trick./ P3 s8 `3 ~6 u! h. b* V
-The most classical one is:5 V( x0 O/ h* w: w2 Q/ P
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 \; v% J k$ D+ Q; X* T; w+ r *(esp->4+4)=='NTIC'
/ O# e+ `. U. Q3 C' B( k& K' M7 S" G5 l$ K# D# x
-The most exotic ones (could be very slooooow :-(
3 `+ U2 v/ }0 |& ]" x6 j8 ? BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
! F/ c, N& O& z7 M' J ;will break 3 times :-() u, m0 l8 H) K' ?% ?
z x9 L% w* e/ Y7 G; E% A
-or (a bit) faster:
% ]+ ~: P# D8 r* N. j" c8 b BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
: `8 L% V1 u9 S e; _/ y9 T
6 @" A( m `+ I9 l- j: U8 u BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 y; b% |2 |# _4 W I
;will break 3 times :-(
0 L8 N9 q8 Y" O4 z) [& i$ y( H7 R. E( w( G4 u9 g! a
-Much faster:
% ~1 N3 z1 @7 D) Y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" F8 S; }+ h& v! v) {/ p* `% @4 C
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
, s$ K) l5 Z! t# t8 E7 ]. Rfunction to do the same job:
& O" g, d% m+ E- R7 I) f- V
/ c! q5 h. C; y& h. Z b) a push 00 ; OF_READ' z7 m) a; @! ?/ R' @: g
mov eax,[00656634] ; '\\.\SICE',06 o8 P; I) Y1 }3 a1 K; ~$ v, u2 `
push eax
5 B0 C5 l' k) m call KERNEL32!_lopen
3 |5 a6 i9 [( G8 w inc eax: N' ?+ A2 l- J; Q; ^" V1 v( o( Q
jnz 00650589 ; detected
3 `6 `5 P' b0 D1 |' g push 00 ; OF_READ
" b8 ?# @$ b c- S& ` mov eax,[00656638] ; '\\.\SICE'3 Z2 t( h2 n4 `" c
push eax$ A% s" }% m' _' h" X
call KERNEL32!_lopen& p) q4 Q/ d: s
inc eax
, n6 a8 J/ Q( e( m! [ jz 006505ae ; not detected2 `9 t" K1 z$ |/ I9 l
! V; U+ N( V: j. n9 ^! Q
) Z: c% a& d2 q J+ s
__________________________________________________________________________
- I+ D- E2 S& o( n
& n* A8 l# K/ `6 z, d; f8 bMethod 12
+ n1 w5 Q5 ]3 v1 Q. ]; Y=========% T2 I) a0 y5 y5 Y
. z0 x" r+ O& e/ V5 G" nThis trick is similar to int41h/4fh Debugger installation check (code 05/ r, g" {) R2 ` M; _# E
& 06) but very limited because it's only available for Win95/98 (not NT)
) l6 w6 J9 h0 t6 @1 N* ] F: las it uses the VxDCall backdoor. This detection was found in Bleem Demo.
7 \0 q, H$ B7 W/ P
4 h. E# I9 B( a3 l push 0000004fh ; function 4fh
/ a! c8 D; S8 Y. {4 K/ T push 002a002ah ; high word specifies which VxD (VWIN32)
: J0 O" A [! z ; low word specifies which service1 E& h5 m9 q. p; Y' n
(VWIN32_Int41Dispatch)
% W' m$ D$ F1 t5 T' S$ ]+ ~ call Kernel32!ORD_001 ; VxdCall' t6 `/ p7 Q; Q9 i
cmp ax, 0f386h ; magic number returned by system debuggers' K* [! G* P8 c- P$ I
jz SoftICE_detected
" L$ n! [- T7 }* l- S6 u+ R2 M% }3 C$ G& ]* G$ X; j# f1 C
Here again, several ways to detect it:
7 A: o$ U& X- ~. q
& c4 v& s; N O' i6 _& \1 D7 t6 u BPINT 41 if ax==4f$ \. f# j0 @. I. i3 C% t
' V, L2 D: u( i" d. l4 D2 G8 w
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one1 r& M! _3 ^9 a. M3 m' W# }3 Y
. H; D0 i) b2 L
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 h3 y2 K6 b9 d: y5 n2 O$ Q
5 \5 v9 J0 [$ Q( I
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!6 Y/ r3 ?5 H5 ^+ B1 s3 V. ]3 D! T
0 ^, `1 m& s, G }" Z( e' o' S" N% U
__________________________________________________________________________. [. v9 h `. V/ E5 n# s
# ?% j- O9 S9 `) `. i
Method 13
! p8 w6 l9 D" B) Z# ]$ T$ F0 k========= D$ Q0 J: v, F/ F+ D
7 f; B8 u- a/ T; M
Not a real method of detection, but a good way to know if SoftICE is$ L* s+ ^2 V7 }4 Y" c
installed on a computer and to locate its installation directory.
9 f. s0 m! H% l2 Z) dIt is used by few softs which access the following registry keys (usually #2) :
0 L5 ?0 u# t4 Y* e0 c% L; v# | C
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 P' y4 d/ T' A1 H\Uninstall\SoftICE
/ {6 n- B# {: I- k3 e, B ~ ~-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
8 q. P( i8 }2 E- e" b$ `; H6 u' y4 `) N-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 [' F; g/ S8 t( d t# B
\App Paths\Loader32.Exe
( j. q- Q# p& E9 [
; w# o0 h( E* x6 W; R
9 W. Z& v6 w8 eNote that some nasty apps could then erase all files from SoftICE directory/ w7 k/ Q. m6 a* L- R. r7 q$ }
(I faced that once :-(
& X. ]6 B7 o6 v" ~* s
. U) C2 [# l0 l# VUseful breakpoint to detect it:. B. E6 B, w9 { j8 u# v
_: _- H+ G/ f; n% c9 s# ] BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 Y: w. v7 U0 z% f* F+ z+ y
3 p( d2 J2 k0 T$ z; `
__________________________________________________________________________
6 R8 B j* Q& ~2 ]/ M
* l# H" u7 @9 v4 z7 U
9 t2 z4 p1 B: C' t5 d q9 j2 _/ NMethod 14
# t. S2 Z N& k* O! ^=========
4 P* _* O. |" a3 T
. {8 _* s6 k! R, A* MA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
N! H$ \/ p: I' Lis to determines whether a debugger is running on your system (ring0 only).6 g+ M* y- E+ ?- P
; X, Q) T: @3 E: R* ? VMMCall Test_Debug_Installed
) D, x+ Y4 y# r je not_installed2 D7 h7 ]( K/ E2 N! w7 e# m
5 ^: Z0 Y. L9 \0 C. a5 l6 cThis service just checks a flag.; `* Q4 G1 G L& _) N: ]- p
</PRE></TD></TR></TBODY></TABLE> |