<TABLE width=500>
. Z7 I# S U$ ?0 _, s* x<TBODY>9 d3 p7 T% y+ R. }, z+ X2 N. Y
<TR>
) _: F7 n7 `/ ?3 {" o" j<TD><PRE>Method 01 # `3 q" |6 P% z& M. t4 K
=========
% |5 {- u* t8 j7 s# }
% ?4 ?4 K7 |' W. H, B5 k9 UThis method of detection of SoftICE (as well as the following one) is
) S- W! a: u2 s+ r# Yused by the majority of packers/encryptors found on Internet.
8 g* r2 |) @ Q/ N, f9 BIt seeks the signature of BoundsChecker in SoftICE7 m( q. |* p" u8 c+ D
: \. Q6 F4 m% l& {; B O mov ebp, 04243484Bh ; 'BCHK'3 v( h5 K( H: V @9 x$ B5 O
mov ax, 04h4 l, ~+ p7 Q/ b; C- R
int 3 0 p2 v0 n2 ^% O
cmp al,4& A% |: f5 y1 Q
jnz SoftICE_Detected7 ~, J. Y' t) H
: q) g* |1 u' l9 h2 b( e* R. J
___________________________________________________________________________
% b+ E: x4 Y+ ]. [ z
& ]' A8 _& ^. ]Method 02
9 Y) P) b$ C: E2 f=========8 i5 j2 F8 w; k
3 K" R# P/ ]6 J) B3 k$ r% C+ QStill a method very much used (perhaps the most frequent one). It is used- g$ i8 L% S: U% W/ v+ y: x' P2 T
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ Y1 c( \' F0 R- f- |or execute SoftICE commands...8 b. e9 v6 M& v3 ~2 e& A- `
It is also used to crash SoftICE and to force it to execute any commands
+ S v6 n* S' J1 b! P" D(HBOOT...) :-(( ! O# c$ U" {" z: y, i
. v2 A. L4 [2 ?% v
Here is a quick description:# a% c' o y# k+ h L4 Y
-AX = 0910h (Display string in SIce windows)
& M7 [: B: ^8 u" P$ z-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 Y9 J& @) ~( v# w# Y6 L
-AX = 0912h (Get breakpoint infos)" v% G' T& |: e( N3 r; j
-AX = 0913h (Set Sice breakpoints)
" ]4 L, m% @2 h3 k9 d-AX = 0914h (Remove SIce breakoints)
# ^. }1 }+ w+ n. A3 C* A' y( T$ X' O! Y$ K$ ~. `. @, b1 S
Each time you'll meet this trick, you'll see:6 S: H7 z0 t3 v
-SI = 4647h9 }% c2 S% o5 `" J. F; X/ ]
-DI = 4A4Dh* g e9 e& T0 s; w+ J
Which are the 'magic values' used by SoftIce.
' s& a5 V& v0 x b4 s8 N% [' _7 fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.. ?6 |! D1 p; }2 n
9 ]( q( s0 Z4 w7 ?) r* `8 S5 aHere is one example from the file "Haspinst.exe" which is the dongle HASP
. ^+ j! [; p& B& {. @ oEnvelope utility use to protect DOS applications:
5 m) `( ]: O; }* D& t8 n: I; Z
* t8 K0 t( B; G( y3 Z9 b$ [$ W7 \+ m; n& e1 I
4C19:0095 MOV AX,0911 ; execute command.
4 w* _3 c+ p" b4 \( {4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
( B$ n t5 r% x6 v" K/ M: d4C19:009A MOV SI,4647 ; 1st magic value.
4 r) v# @( }0 J. L4C19:009D MOV DI,4A4D ; 2nd magic value.3 h$ ~2 r' x3 l" V3 ~9 I+ d7 H
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)/ c/ |2 ~/ G9 Q V% E
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
$ i* j" H" J3 ~- A: d# j! Z4C19:00A4 INC CX
$ F8 y5 P/ V8 k9 }4 h) e4C19:00A5 CMP CX,06 ; Repeat 6 times to execute0 E2 K, W+ t' b+ r% R5 i
4C19:00A8 JB 0095 ; 6 different commands.
9 x- y6 e I$ A5 t- i$ X4C19:00AA JMP 0002 ; Bad_Guy jmp back." N1 X& j1 j9 \- _, l
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)- m$ d5 M' ^0 X+ a! S+ K" S
% @5 i$ G! y# B f. v4 s" UThe program will execute 6 different SIce commands located at ds:dx, which/ e1 W5 \. B0 l: d2 U3 z, |& {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 i: t% c1 |% X4 W0 R
/ w) `1 j6 K) U4 [2 z1 ]7 M* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" N' r% Z5 o3 k) o+ t1 I k___________________________________________________________________________$ q( J8 h6 d; j. _: ]' r1 u$ |
' _7 E2 V* |' O" O
$ r- j3 e4 i% T
Method 03
. K2 j+ w: [, h% S=========: |, g1 C+ Y5 G3 m6 o$ o$ U- S0 T5 D
" Y- L# w0 {: _* r; t2 F5 k
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 X/ B/ k( \' L(API Get entry point)2 j! a- ]9 \6 \* I* p3 H% a+ E
' A3 o1 _, s& K0 i6 I( Q c
8 e* u( d: k8 B7 f4 t8 N xor di,di
5 W/ p" q2 x1 { mov es,di7 C8 J) M l, i4 |# V
mov ax, 1684h
3 j( n! t! l3 x! S/ T mov bx, 0202h ; VxD ID of winice6 O5 r `+ C: V K$ G
int 2Fh
3 m! I) J; R# D5 X, L mov ax, es ; ES:DI -> VxD API entry point) { d) Z# k( \1 K7 t- L; c6 {
add ax, di
) Y& _" @8 [/ B6 ~) D8 L k0 O test ax,ax. L( c5 L) }( |4 D4 F% P' A
jnz SoftICE_Detected
0 ]$ \# I0 S* _# M$ I- B
: T7 [- \ i g8 ]___________________________________________________________________________8 g# E0 h& M& |3 l8 Z
& O) q- c/ S* M/ q2 s) Z
Method 04! T. B% Z/ h) @; j! k
=========
* k( S, O% B1 ?7 |6 a
' F* Z9 K9 V' i+ ]/ mMethod identical to the preceding one except that it seeks the ID of SoftICE( y( i c) g! i0 e J
GFX VxD.% n e |) ?" Y/ F
1 G+ W1 Z& }! u8 u4 ? xor di,di& A6 i. b l5 p; ~4 n+ a0 j
mov es,di
4 o/ J; E8 J$ b( | mov ax, 1684h 6 u) d- B$ T! S
mov bx, 7a5Fh ; VxD ID of SIWVID
+ g0 x4 ~6 _% o5 G1 D( s int 2fh
! A# P2 f3 {/ {6 q mov ax, es ; ES:DI -> VxD API entry point
0 t9 @% F! q7 T5 q9 @' A- P add ax, di1 N1 |! C( |9 t
test ax,ax
, c. ?9 o: f$ O+ E8 ^ jnz SoftICE_Detected
, j6 [3 W8 b% h8 C4 W- x4 e0 S: Y; ?) V" B3 P8 a3 k0 P
__________________________________________________________________________
! U$ ~. s3 m% F1 h( D7 R4 H: O/ e7 f
' p% d7 `+ Z5 q) G/ i( [) S
Method 05& U. W4 P0 l; X- X
=========
9 Q7 w2 H+ g5 y1 d( \2 K- t: V6 r* S6 T4 w4 m, ~& O. Z
Method seeking the 'magic number' 0F386h returned (in ax) by all system
+ R# `, S4 Q {3 n. B3 ^6 x, j* Sdebugger. It calls the int 41h, function 4Fh.
+ r0 g( ~) D. b, A- mThere are several alternatives. 1 j% {9 B1 u/ Q! U+ N
( ~3 [2 X' A* GThe following one is the simplest:
0 u# B8 n7 W7 R; t; G# ]% W8 w+ O( S) X) g: Z
mov ax,4fh0 x% [* N8 ~! r9 [2 w+ W6 j8 N
int 41h1 d- W7 f. Y) V B& D& e _: t# _5 B
cmp ax, 0F386( _$ n, B; t, V. U5 T, c/ M1 I/ H
jz SoftICE_detected
0 Q) y, q3 c9 I$ s8 U2 }; N
; M! Z) i: d9 h$ d: \- [
. G) y* v; Q2 S8 l; d% _" JNext method as well as the following one are 2 examples from Stone's
) h0 j ]/ u6 ?* a"stn-wid.zip" (www.cracking.net):
9 |/ S5 G; S! ?: Q. s
! S; t: i7 m7 w( p6 V) F mov bx, cs% m, k9 i2 l6 z& S7 v
lea dx, int41handler2
4 x" r( a. W; A$ l2 K1 U f xchg dx, es:[41h*4]" \0 z* K/ S- V" H. _% @3 X" `
xchg bx, es:[41h*4+2]0 I: W. ~5 w D2 K5 x
mov ax,4fh
0 S0 G, F& h, S* g+ |/ i$ A0 _ int 41h4 L9 F0 S4 l5 m& f5 P: s1 F3 S
xchg dx, es:[41h*4]
* _, J. _0 H9 i$ B xchg bx, es:[41h*4+2]: N. b" Q9 |+ z2 Y- ~
cmp ax, 0f386h% e6 _ N' T( X. O* H4 g( U# R1 L, Y" @
jz SoftICE_detected
2 x! E: D" g! F2 n" U* L, u! b
6 _. W" I% J) L1 Y. O! Iint41handler2 PROC
# ?' ^( f/ z' e/ L2 | iret
7 @" H' C* o# x" x" u( Rint41handler2 ENDP
" t# K8 `7 }/ N5 w! n$ V
9 F9 D( {4 @& X& l' j% O3 I5 V J+ Y* i, d( ^/ Y4 y) L
_________________________________________________________________________
9 j; O! I0 v8 H: ^$ z# L! l* ?4 Y2 Q! Q: j4 I0 _
" a" T6 v* b! a! {& u) a& t+ j! {
Method 06$ X: F: u, U# o" B i- J! B
=========3 \9 j& ~$ T. Y* K3 d
0 M$ W, W( x: J" s
5 ?1 P" a8 A+ w# L- u2nd method similar to the preceding one but more difficult to detect:
% ~" N1 j( `8 C8 |: P$ ?/ r5 j$ Q; z; M+ Q& B$ j: M- S
- s+ S/ b+ F8 B J6 Rint41handler PROC4 g- C) J, S* Y6 z0 c% r& P+ _
mov cl,al( E" q% T- j9 W7 T) j
iret
6 N5 G& W7 ?: D) xint41handler ENDP. O; g3 [ b& J% t
3 ^, J; H! c. _! c; r5 e# @* z# E6 j4 P/ v
xor ax,ax
0 Y8 ^- p) P$ r5 ~ mov es,ax" ]* v7 B) E+ t2 H, f: O
mov bx, cs
! M( y/ N# P1 q% l8 E lea dx, int41handler7 \2 Q* Q9 ^' V" A# d
xchg dx, es:[41h*4]' U' X- l0 D; x9 a3 N8 D$ D
xchg bx, es:[41h*4+2]0 ?4 `" N' l7 U! n$ k
in al, 40h
$ C' t" t0 k0 @+ e xor cx,cx
4 Z" K9 M+ a: j3 d' l8 ? int 41h
7 L; T, Z. j: G) N9 K/ F xchg dx, es:[41h*4]
+ n- ?5 R1 }* c+ f# o' G; n- i xchg bx, es:[41h*4+2]
6 q. M, d' @0 Z W# { cmp cl,al
; a9 s; i% C+ Q5 r jnz SoftICE_detected' l( H+ P* ?; y' B* W$ U
1 c9 @2 ?' x2 H W_________________________________________________________________________, }" D: s/ C7 G9 Z+ f* ^
$ x! e% Z, r9 @2 [0 c, y2 v
Method 07 Z5 P* R' O! e" R$ b$ I* o! O$ g
=========/ M' i0 L5 Z- A/ ~2 H- u
K- `/ M0 v" ~. p/ p5 s8 v! b! |# w* bMethod of detection of the WinICE handler in the int68h (V86) A& Q( A/ R i! t' c0 h. ^, n' `
" z5 t, s$ l5 e7 n$ B8 P f mov ah,43h. d0 c0 c9 I4 s9 x, z( W
int 68h
, L x( e! K9 V cmp ax,0F386h) ?) V( a# r/ j" B0 c! g
jz SoftICE_Detected
/ C3 G& {% K# u% x3 B7 n' A& q
% w1 Y4 O1 A T8 X; K: ^0 _: I0 M# U# ?3 m1 H% C o/ a
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 P2 h; }% s0 {; F! ]/ Y6 F3 G! `# | app like this:& h/ ?& Q: o. O6 n* O# Q: w, j# c
. F3 p8 q. @. x4 F4 ], @- W: f BPX exec_int if ax==68
0 Q3 h3 C7 A% z9 _ F" k (function called is located at byte ptr [ebp+1Dh] and client eip is
2 o$ H& X/ z2 L9 |. K# \1 Z located at [ebp+48h] for 32Bit apps)/ E7 h( i4 X' f& r, _# j6 J
__________________________________________________________________________
. S/ K- n3 H/ H3 B) s; C* L; B1 e" Q( M4 v3 M
/ ~, n, E+ J7 z2 a
Method 08& \& b5 f8 P: r* \% q
=========
% r _ @+ E. f" M) b* ~" l7 F+ z- k9 _/ I
It is not a method of detection of SoftICE but a possibility to crash the
6 n: w1 D6 j6 [) }8 Y3 P V" K# Nsystem by intercepting int 01h and int 03h and redirecting them to another2 a% c5 J% X3 m# m% [7 Q. C
routine.2 X" ]3 e6 E; e/ U
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 R3 }/ s# Q) e, q6 U0 mto the new routine to execute (hangs computer...); D% S$ Q0 j- S* n! D+ A
: a* G7 m/ s# I+ R- k) d* h* T+ d$ j mov ah, 25h
4 P# C0 d# |6 o4 i( U" s mov al, Int_Number (01h or 03h)
" B7 c- w7 x: y: f F* S mov dx, offset New_Int_Routine
6 U$ L: y0 ~: ^2 d. l int 21h: z2 @5 s4 q* M- d2 m9 k9 ~3 W
% ]( r0 X" U$ w: U- v ?__________________________________________________________________________) a2 {; R( R# H5 B% g z
+ c$ k) X' n2 }) d0 tMethod 09$ ]8 ?* f" y/ t+ k5 r( E
=========1 e+ l% r% A0 X! d/ i: K! {; B
7 o$ x! \$ {* ~) O! J
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ y. d3 [4 C/ G: h8 ]performed in ring0 (VxD or a ring3 app using the VxdCall).
8 W. [6 U& V1 `The Get_DDB service is used to determine whether or not a VxD is installed
9 e. ^. C5 n% I( H5 kfor the specified device and returns a Device Description Block (in ecx) for
y* i: b' ]: t% U* l% X2 vthat device if it is installed.. A& y: e: s, ?9 n8 g
: P2 ]6 p6 \( S; a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID# r: S3 ]& b7 e9 G: C+ K
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! @: E5 `7 U! x) [, U
VMMCall Get_DDB
1 z) V( V# K+ h- a0 {+ o+ k. [9 Q- { mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 |% N) z& I8 I; ?" R+ O4 r4 k. z+ e8 j6 y8 N2 @ f- G
Note as well that you can easily detect this method with SoftICE:
0 K% T7 ~! b$ k# n bpx Get_DDB if ax==0202 || ax==7a5fh2 m/ ?# u7 `+ t
3 Q& G( T- [1 ~+ K; P- Z3 g! y+ x) E
__________________________________________________________________________
: ^: U* m% U7 U! E* b; @ o2 E6 d' q: x* q
Method 10
# Q) z1 D% N" _8 i4 [" G=========
7 X0 {. _4 `8 w: L, S9 `
* m. J" M" s& Z" {5 k! J' I=>Disable or clear breakpoints before using this feature. DO NOT trace with+ b+ h2 v2 N% g* k2 I
SoftICE while the option is enable!!1 n5 X7 m! R5 B( ?4 }6 f! J
g# S; B ]$ n. LThis trick is very efficient:& c8 U. ?) H$ ~) J0 T) e
by checking the Debug Registers, you can detect if SoftICE is loaded
+ }; ^9 a/ A9 E7 D2 S& V: H# a(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ I) n+ ]; k4 tthere are some memory breakpoints set (dr0 to dr3) simply by reading their# Y! N7 J E. g; v, Y. _' h
value (in ring0 only). Values can be manipulated and or changed as well3 C: B3 I J' f5 S* z4 |! A1 N8 u# K
(clearing BPMs for instance)
9 n( w( i: b" D' z! U6 T8 O0 \1 n8 G# }( I
__________________________________________________________________________
' \; w& E3 I+ @" }/ |8 r
/ U0 W% b3 |$ {% Q" XMethod 11
5 a+ ], ` d+ r8 o4 U=========
( e K; z: B& r4 B- p6 q/ a0 J: I3 v1 U+ M8 f
This method is most known as 'MeltICE' because it has been freely distributed
* r! h- l* L/ L8 y" Hvia www.winfiles.com. However it was first used by NuMega people to allow
( e: V' { s/ x' @3 MSymbol Loader to check if SoftICE was active or not (the code is located
6 ~/ D/ ]4 [5 o8 Uinside nmtrans.dll).
7 C& M, q9 ^2 S+ R1 M% Y( K8 f- A' q' y2 B1 n- {; o/ H- V# g
The way it works is very simple: N, Z6 D* {* W1 ^$ G
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' f" n3 ?1 P8 K. q- k R" G
WinNT) with the CreateFileA API.$ i1 R- f6 q/ e0 |
0 ~& b' j3 R( mHere is a sample (checking for 'SICE'): v0 _8 j/ O. V1 c* P
, w' B) s! l6 p
BOOL IsSoftIce95Loaded()# |! J) I. t. | ]
{- B! J& z T& I' i% s4 K
HANDLE hFile; U) ^! k: n; S- a+ U) u+ M
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) B0 b! w& u; B9 M2 J- [# Q* [
FILE_SHARE_READ | FILE_SHARE_WRITE, a/ `- `. k3 T6 ]
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);. W% h& u. [/ H
if( hFile != INVALID_HANDLE_VALUE )
& R8 M, E3 V5 q; w/ C. [( k; r {4 `( _6 ?8 B/ D* F. i/ d: L
CloseHandle(hFile);- E% b* l1 H U# S: ^# U
return TRUE;
; K$ i; R! e$ T6 Q }! N( V2 l6 ^+ B' Q+ e
return FALSE;
4 D1 i* c# m7 c}& g: H6 e! I2 J0 B
0 b, a/ v# O8 Z$ G3 P( F! O6 `Although this trick calls the CreateFileA function, don't even expect to be o/ O: l8 U+ y$ O3 @( J$ U
able to intercept it by installing a IFS hook: it will not work, no way!
* E- Y& D6 e- t/ C: W& J2 fIn fact, after the call to CreateFileA it will get through VWIN32 0x001F" U( x2 R; A& t2 z. J
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& X1 K$ w! P ^& p; `
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 F9 L4 o% ?. R4 D! Z( Nfield.
$ i: ]$ D5 p8 ^: CIn fact, its purpose is not to load/unload VxDs but only to send a 4 m$ B. }9 }( B1 F
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 u W& z: t( c E. X
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 K) Q& j* u8 _2 Q% wto load/unload a non-dynamically loadable driver such as SoftICE ;-).& I/ H) r; V7 D9 L. l$ T
If the VxD is loaded, it will always clear eax and the Carry flag to allow0 ^- b5 v2 A, @
its handle to be opened and then, will be detected., B6 R5 }$ i$ d6 D( g3 f% e; {; W
You can check that simply by hooking Winice.exe control proc entry point
8 w& a' I) ?& I3 i6 W- Wwhile running MeltICE.
% w2 M0 G5 f$ ?, ?
2 X" W- e/ z! J! ?5 X
4 F8 h1 `) `$ I# A" y 00401067: push 00402025 ; \\.\SICE
s, n* c1 T6 x. h: p 0040106C: call CreateFileA
( Q; D+ H( v6 i 00401071: cmp eax,-001: Q. }/ M+ P0 `
00401074: je 00401091
& Y4 r- z; K& \. K: x5 ]0 |0 m. g/ S9 v' u W! W2 d5 e+ g
" x& x9 n5 x' X. n: @! d/ y
There could be hundreds of BPX you could use to detect this trick.& n c+ M0 M% {# d! a
-The most classical one is:( O. P" q! {% l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||/ \) N0 L! E4 H$ R3 c
*(esp->4+4)=='NTIC'9 x. _, Y$ u7 e0 W
1 W$ v* W2 a! j1 u- z-The most exotic ones (could be very slooooow :-(+ Z# H8 a8 m7 Y# Z. q) {7 S6 J8 I
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ?" I/ @7 }) D: j
;will break 3 times :-(
2 M& j+ P: y+ P- a- V
: N$ i& _5 f+ N* p) n# q7 f-or (a bit) faster: 7 j# J0 r. V2 p; J; e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')8 }: b# _0 K3 p( ]7 V3 i, q+ l
2 {, q+ t- i7 t, o( Z( T* ^# G, a
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 Q) w. l' b6 h( Y: L8 d9 ~. v- f ;will break 3 times :-($ g* v7 w. i$ D W4 Z# M* |9 m
# u7 ?1 d: i$ ?* F8 J-Much faster:
1 U% a- A0 @! L9 m BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( c# m& {. L: f, x+ `% P5 I4 C3 Y# H& D! L. j& D, ~) y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen$ X. U5 z8 d* E
function to do the same job:
; p2 v& r* O$ F6 {2 C' Q
0 h( d- Z% k" c# M push 00 ; OF_READ
) a& \, g7 _- V" B/ z$ H8 u mov eax,[00656634] ; '\\.\SICE',0& c& D ?/ k: \$ V4 o$ I' t
push eax' _& |7 s2 R$ K# V0 ~% W' ~
call KERNEL32!_lopen- B4 m4 I5 ~$ I
inc eax$ F" u% T1 I- z& U# b- m/ L' }: I! d
jnz 00650589 ; detected' X! y$ ~4 I8 M( p) ]
push 00 ; OF_READ
6 u/ K8 o& [: y3 I( V6 c: N+ w9 V" V mov eax,[00656638] ; '\\.\SICE'
4 k& A- k; T6 F* r8 w, i push eax
! y5 n2 q* }+ R7 e+ V+ y) Z3 L call KERNEL32!_lopen
3 D+ V/ y& e& x8 \ inc eax
- G$ ~# s4 v. W& {5 v jz 006505ae ; not detected
e5 k, c" T0 u& Q; J& u0 o3 \$ k0 a. O, G8 @
! E, V, G& J& K' U' a. J
__________________________________________________________________________
, r7 R/ e* X; ]+ c* u% t
8 t* F9 }3 r4 s0 y7 U! OMethod 12
; w% t7 Z9 n) w/ o=========
0 r/ T+ b' k( Q- i5 r6 g5 J$ U/ {
; r5 ^1 `$ X MThis trick is similar to int41h/4fh Debugger installation check (code 05
) i$ Z8 K: E9 P( s' ~; c. Z& 06) but very limited because it's only available for Win95/98 (not NT)( F8 p' Q e' n& ~9 u# h
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.. } C; P3 [8 X, ^
6 Q9 ]7 p$ z3 R! W" Q9 g
push 0000004fh ; function 4fh( e9 o. V, q$ I7 Z
push 002a002ah ; high word specifies which VxD (VWIN32)! C6 n f* m& T( i2 J
; low word specifies which service
% F# `7 ` r+ B8 h (VWIN32_Int41Dispatch)
1 f) L8 U* v; D call Kernel32!ORD_001 ; VxdCall' e. c: k- n0 G0 J
cmp ax, 0f386h ; magic number returned by system debuggers
) _% C: k( I4 a: k- z- {9 @) ] jz SoftICE_detected$ ?5 Y8 }3 w% {& h) f
% o6 D+ w' R9 n2 m- J7 f. K1 O
Here again, several ways to detect it:
- I4 B/ W6 U' |1 Y3 b1 g5 E# e( A+ g! W9 G* M+ G
BPINT 41 if ax==4f
0 d, `+ A$ Q5 D) S* I
# K1 \! C4 ^( I' Y BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 L+ n; p8 o# ~) Q
" [1 I; b5 @% A {; [
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 e# @/ B" ^) E4 |
5 n9 m$ B4 B- h8 L1 S! Z. L BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 E, @% c9 `2 O0 j) D5 I
, v3 F! |0 Q$ o( M& K- t7 Y7 i8 H4 @2 M__________________________________________________________________________( g2 Y& D8 y' O3 {
+ E t( N" j) @) R4 R
Method 13
: m X% J7 }6 r+ ~) W; P+ P; W1 w* f* W=========
- [: e/ _* O! q" f
6 u3 a+ p3 a& j$ D4 BNot a real method of detection, but a good way to know if SoftICE is: Z* j. @9 T9 {7 s
installed on a computer and to locate its installation directory.% {" Q: q9 n" R* o! [! o( i
It is used by few softs which access the following registry keys (usually #2) :
2 c# w7 f: d7 k/ r
$ P% O7 H& L7 T' j3 T9 E# C l6 C+ ?-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# C! \, Z: z* E\Uninstall\SoftICE. _/ ^( I% l6 X) Z% l; x1 V
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: U/ X# @4 n- `4 }* o! I-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
G7 o* c8 W: H4 |+ }8 w\App Paths\Loader32.Exe; V* z! w3 o+ S" l
4 ^3 i) \2 X/ w) A' V7 F7 M( l& V9 h1 x: N3 H
Note that some nasty apps could then erase all files from SoftICE directory
9 K1 c) Q+ U. V' K: m+ e8 Y(I faced that once :-(
- T! O0 R3 a ?4 w0 X8 Y' x2 ?+ u' c6 n7 g
Useful breakpoint to detect it:: I7 s+ c. l% \
z. r ]; L$ Y$ v, z
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ S9 A9 P+ K4 N- g/ c% F& \
* V0 Y' c3 i3 t5 z8 d
__________________________________________________________________________
+ x% c' i2 A n+ T, F% ^3 M
, y4 q) d$ n1 w/ _$ W' L E/ o1 \0 H
Method 14
: b; e- |2 f# \2 ~6 @( y. _! V3 Q=========
* _1 O$ @0 }8 m: {; o
! W$ |% C8 C# q5 \1 t) s& B9 JA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 u, q# F& ], L7 Z1 _# `% J
is to determines whether a debugger is running on your system (ring0 only).1 ?' U& v" u4 D
6 I5 J9 H) X2 c% Q
VMMCall Test_Debug_Installed8 D9 l; R: G$ J" |3 w
je not_installed
0 T, K* F% i4 }" r" {* M
$ H6 X6 `1 z% [5 y( yThis service just checks a flag.
6 T) L( V8 q2 `, i* B; c! c7 I</PRE></TD></TR></TBODY></TABLE> |