<TABLE width=500>
! n1 H; g7 o+ M& K7 q<TBODY>' s6 @, V& _8 j
<TR>; L8 b3 B, w; G1 d
<TD><PRE>Method 01 7 u( D" \" a! \# g! @) V
========= [7 |1 ^) @! ? ^+ y
* e4 f: w+ N& J! Y# J9 dThis method of detection of SoftICE (as well as the following one) is
( T) o# y; ?4 s2 p, @- {) Lused by the majority of packers/encryptors found on Internet.
- t7 {" y" }6 n" iIt seeks the signature of BoundsChecker in SoftICE( J7 n; G# L3 [7 D
7 p" ]; Q! M- h: b$ e
mov ebp, 04243484Bh ; 'BCHK'
7 P8 f) I; P: G! F+ Q mov ax, 04h
7 Z- [ i" i* A6 }0 I7 B9 [ int 3
- g+ {4 N; J4 C& p$ n" C( q8 q cmp al,4
9 W( |4 n* u0 Z5 _, J jnz SoftICE_Detected. X' F4 h1 W' j, y. e0 }
0 \# I% E0 N" x9 N% @2 l0 J: ~
___________________________________________________________________________9 J4 K7 {( `* {: D3 U; M& U( G
5 G9 B: }" |( b, y4 `Method 02$ L% g" v- A# w/ ~/ m
=========
3 ~& K) |' L& @" }# d
9 K4 k: I5 g" z# l5 ]0 {- L! [Still a method very much used (perhaps the most frequent one). It is used' R8 {, d( A) K8 v c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,# K' t% W( y- o6 l# D0 k9 T
or execute SoftICE commands...4 {+ D; e( S0 {. h+ U& ` D
It is also used to crash SoftICE and to force it to execute any commands
7 j' S* {% E. V: x(HBOOT...) :-(( & a3 m+ p& w7 @6 b$ ^
0 O! L2 U/ K) g8 BHere is a quick description:
8 N4 I+ t1 E6 I) _# m( u- y-AX = 0910h (Display string in SIce windows)4 C. t4 d) I c
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 W% J- S& P" ?. K
-AX = 0912h (Get breakpoint infos). ^0 t) D2 B) X3 }
-AX = 0913h (Set Sice breakpoints)% f! z+ n, Q0 U2 Z1 a: W8 @5 e
-AX = 0914h (Remove SIce breakoints) M4 ]) f, O& B2 G, T: H
* t7 q% ~, e4 `1 o! HEach time you'll meet this trick, you'll see:
1 t( T8 d$ J! V2 _-SI = 4647h7 X6 v. C& b$ Y5 a n
-DI = 4A4Dh" w1 F$ `& _0 d+ j' ?! w) f
Which are the 'magic values' used by SoftIce.
: x* B3 ~5 _, ^8 x$ [For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ p+ @7 Z- M$ o$ f: m* G6 u4 n; Q: E5 B8 y5 I% M7 h4 g; b
Here is one example from the file "Haspinst.exe" which is the dongle HASP1 Q6 X& {: m G$ n E N( `# C
Envelope utility use to protect DOS applications:9 P1 J$ Y$ n' d
I7 v, D3 _" c- p' S- T- q! p
0 [* Y( y( } w
4C19:0095 MOV AX,0911 ; execute command.
: M$ I' ~" S9 V) T+ p4 {9 Z% \4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% v4 k3 G& h, R u2 F$ Y
4C19:009A MOV SI,4647 ; 1st magic value.
6 t. P+ o- | D3 ?6 ]. a/ B% x0 X4C19:009D MOV DI,4A4D ; 2nd magic value.
+ s# \& F; | z1 g" i2 Z* K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 {( `# E5 A# c ]0 s: s }! Z4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute( p% h& s! A) d. j' P- v
4C19:00A4 INC CX1 Y* |0 p5 f" f1 t- h" O; A
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
( `# q2 h- x J h6 o/ ^" V$ u4C19:00A8 JB 0095 ; 6 different commands.
4 e- C- i2 h' W% g4C19:00AA JMP 0002 ; Bad_Guy jmp back.& i% W% F7 X- ~) f+ X
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ j O1 P! R6 k6 N5 {' ]5 V7 {0 k/ n) n( U; n
The program will execute 6 different SIce commands located at ds:dx, which, @7 Z3 j8 e& D" p M
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 v& M9 ?/ F3 c5 M1 P4 J9 D& o
% U5 D6 j+ Q% p6 H
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: V/ x+ @: {* X9 d* t8 @
___________________________________________________________________________' U" T- m M& ]: R
% y& w' |& _% N+ H S, s: O7 k8 T
4 c3 Y; v" S% K8 c& B% EMethod 035 g/ `8 F' a' B* S/ e4 S
=========
9 r6 z* N7 g' }: e# q2 l) J
. w& s/ ^9 y9 F/ x* z3 ?& p; vLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h" _! _" g6 D5 g( w' \" q
(API Get entry point)
0 n# A# u- L @& V& u! U, M
5 X$ d6 P% K% \# w V3 G9 R+ q, j1 u5 v* n
xor di,di
5 ^! X0 ]! h/ B9 {; P mov es,di
) \, K8 W4 S# i8 W+ u" N mov ax, 1684h
. X7 ]" I7 R0 e8 \2 x" k2 f7 h mov bx, 0202h ; VxD ID of winice* E q3 C; m; U# p! `9 m
int 2Fh$ z5 u! \9 t# d7 w) C
mov ax, es ; ES:DI -> VxD API entry point6 K4 f I$ S; O6 z# t
add ax, di& i5 b' E/ i/ R/ L
test ax,ax9 x+ _ a) y4 K# y9 |
jnz SoftICE_Detected
5 \" O/ u/ l7 [6 {3 K0 L7 R7 ~" W) ~* H; r: C$ I
___________________________________________________________________________
8 O# D* o: ~' X4 U1 c9 ^. ?$ }- X2 ^9 V, T0 {9 x6 z
Method 046 d# q0 c7 c3 w% P
=========
- G9 @* J' L0 c; }1 R3 O8 {
5 F3 \$ ?( y0 Z" ]# OMethod identical to the preceding one except that it seeks the ID of SoftICE! H; @4 k; D: ?8 U, P2 h7 h
GFX VxD.4 y! v6 X- U5 U+ w5 H( Q! ?. B
' h$ M3 k% R4 T! h6 Y* v
xor di,di
1 `) h6 K* B2 X% ?, S. A7 [ mov es,di" ^7 N7 w) f6 B+ @
mov ax, 1684h
$ {5 b: s/ O" z6 m$ N. G, Q8 Z9 T mov bx, 7a5Fh ; VxD ID of SIWVID$ h% z7 ?( r) q
int 2fh
% z8 A" V8 f3 @! J3 m, Y. @ mov ax, es ; ES:DI -> VxD API entry point# `. R1 V; |! |5 V0 H
add ax, di" P( y& R9 p3 E. _
test ax,ax
; b% m8 @4 k3 o% j" v @9 H7 _4 R" I jnz SoftICE_Detected3 |, ~/ |1 M/ i2 x+ |. l
6 Z( K+ y# }* P# t4 R' L* v- s
__________________________________________________________________________. W z: w- n! G7 A
& t8 r8 p( ^; x' I5 C7 ~: P
6 j( Q' g( g" v7 D8 w2 yMethod 05
3 y1 B$ x% o. p- s! V! m+ s=========
9 M( J( g& l. S( Q- d3 |
2 I3 l3 r8 ^0 C; z$ K, C0 |Method seeking the 'magic number' 0F386h returned (in ax) by all system7 v6 k) L; h( w" \8 d
debugger. It calls the int 41h, function 4Fh.
4 u$ N! E+ u L3 m! i5 jThere are several alternatives. ) p& F# r' }! B9 B' j& U$ c" R) B5 b
9 v/ S& O. w! n" ?% K
The following one is the simplest:
/ v$ \) k4 l$ ]/ c" g
6 E, ?: H% P9 v) l9 p1 C% Z mov ax,4fh
) C5 _! P# X y5 {" S' P; l int 41h9 @& ~, p( S2 E% ?* z% W/ ?( Q
cmp ax, 0F386, n( i6 ]2 {/ c- m/ ]; i8 s
jz SoftICE_detected* Q# n7 k8 O% u8 o
3 z7 `. F* u" n3 \7 ~( z& p
# Y5 Q" _ ]* L0 D8 V; ?
Next method as well as the following one are 2 examples from Stone's 1 f6 b- V5 ]7 s
"stn-wid.zip" (www.cracking.net):+ G) l7 o/ f' i U5 m
5 m1 D5 ]7 O4 ~4 A
mov bx, cs+ r+ \1 S1 G; w. T
lea dx, int41handler2
1 C. t3 p7 N1 D* \. E M% G) _# a xchg dx, es:[41h*4]" J# W8 F1 ]( y- j& U( X+ q
xchg bx, es:[41h*4+2]
+ G0 _! ^9 `" K: J mov ax,4fh
' o9 s( |5 i L* l8 }; ?5 S int 41h
" h6 Q j- V- S" q0 z xchg dx, es:[41h*4]3 Y- I) D( ?8 V
xchg bx, es:[41h*4+2]
$ {. L/ [ }2 Z2 n3 K' F& A& z cmp ax, 0f386h4 V9 C7 P. u0 O
jz SoftICE_detected
# ]% D' Y5 m/ [5 N, w9 ]9 O: |- i" g. W3 f0 X' B
int41handler2 PROC
|! ?3 G% I1 l iret5 G) H) A# M( g# x! \6 Z6 x! Q
int41handler2 ENDP* |9 ?* m' W, w ~
0 L& I: @; q0 r( ~( I" M0 ]
! a' r' J C# K0 v: A_________________________________________________________________________5 r W ~: M) x. R: S) ^ D7 p
4 I, Q/ J4 g1 e* c, b9 F# Q I8 y6 V4 B
Method 06
+ e) m& f5 T3 w, x# _* D8 q=========
$ K) `/ R4 S& S' U9 z* i$ k0 Z; z( u) A. I
$ d& l9 }' f. g
2nd method similar to the preceding one but more difficult to detect:
8 l" k6 t( ]. y* ~9 C+ z
# ]. C& m7 ~) I. U& ?$ Q+ U) b: G0 F1 x) i8 O" @1 W
int41handler PROC
" P# k8 ]7 [% m mov cl,al p, f7 H t) O7 S; k
iret
0 {- o' B# U4 ~& J' f. s/ dint41handler ENDP! b3 _: Z, N$ B1 _: A
. o% c! h. a" n* ?4 m* L9 j: @
: x7 C( T6 n- j xor ax,ax( s7 q+ n" I6 a5 p
mov es,ax# |3 ^ d' u6 z5 C* E
mov bx, cs& F+ ?- q9 o5 K& y0 L8 k
lea dx, int41handler
* Y3 g8 G) I2 @9 B/ ~" y xchg dx, es:[41h*4]( S; c5 N) _# o+ [9 T8 p
xchg bx, es:[41h*4+2]
0 S5 \: r% q9 I% ^ in al, 40h; {3 t6 @. R+ K! p( t1 d6 d( r
xor cx,cx) v# n% d9 S4 n L
int 41h
$ G# Y6 h$ \, K xchg dx, es:[41h*4]
2 z; X, M9 A H: v Z+ I xchg bx, es:[41h*4+2]6 |) k! z+ K: ~- e& M8 F8 D
cmp cl,al
* }: r: H# O+ L jnz SoftICE_detected$ K+ l# j' D( G
: ]5 h7 I4 G. Z$ B
_________________________________________________________________________
9 D# ?: a0 x, F! _, Z
) q2 m$ o) w+ u& ]Method 07
' [! P0 M$ n: F# { _=========5 X+ j4 D T0 w1 k7 J) c
1 y! O# `" D9 ]6 C
Method of detection of the WinICE handler in the int68h (V86)3 L4 }( U- X8 [% ~3 }* [
6 ~! \% ?: z& ^1 e mov ah,43h
0 A% \1 n0 r7 Z; W1 O5 w) T2 ~) E int 68h( T* \7 q" ^# P- D* e2 {
cmp ax,0F386h" {) Q' N5 `- `- a
jz SoftICE_Detected; \+ ]* k9 q f- i8 k1 c. z8 n+ b7 p
, ~$ _/ H' W+ e# f# D
+ s4 W- l3 i; R3 V0 c
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% u8 b' Z' @) o app like this:& p* s: H! o% o+ d" k [. M
. u% ?: f0 h' Y$ v
BPX exec_int if ax==68
- V% C2 h# Z7 t( h3 V (function called is located at byte ptr [ebp+1Dh] and client eip is
$ x5 i1 B5 a0 }3 v, z; g located at [ebp+48h] for 32Bit apps)! U+ @7 B$ k5 G" Y% ^8 ~1 s
__________________________________________________________________________3 _, Z7 e8 w2 i/ |9 P2 c6 ~
: Q9 E. U! ]% N# J5 Q% `6 w# s- M1 h: b& }3 m( V
Method 08
5 V" D a1 z" f% D {" H0 e=========
' Y1 a: [1 r' \8 f. t$ O' o# Z0 t7 K$ z1 O
# j# k4 w& N0 _" o) B9 R% }0 WIt is not a method of detection of SoftICE but a possibility to crash the6 i$ R' d* N) t- t' Y& j
system by intercepting int 01h and int 03h and redirecting them to another8 N6 y8 z9 n1 g
routine.
+ T/ i7 l$ U/ }7 v( k' U6 R$ uIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
I; z" B/ _6 Q, J$ F: Fto the new routine to execute (hangs computer...)7 R$ r) k( P/ g/ W6 e. G
& O: A# c5 `, h+ |) \, f: l* u
mov ah, 25h" V2 L4 G9 |- J; V; A0 V0 C; b
mov al, Int_Number (01h or 03h)
' H) L* k2 I F: ~: i% E+ ^ mov dx, offset New_Int_Routine
, ^) N3 p& m* V6 _* Z& N int 21h: O% a1 D& y- q9 h
+ m% [/ v p+ e' l. |9 Z. C+ d
__________________________________________________________________________0 Y2 u/ N, n/ M+ f0 m% T8 F
: |6 d* q9 f( H2 k7 j d4 QMethod 090 X& w4 X' e/ B* ~# _6 [: X
=========& Z/ M8 |6 n! q7 D
& A( t% p; _1 i: Z* a* ?
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 B8 V- E9 p) q. y
performed in ring0 (VxD or a ring3 app using the VxdCall).6 P3 V4 T) ~8 H; q8 v1 ]4 R! j' E
The Get_DDB service is used to determine whether or not a VxD is installed
# h- i' o; ?3 d0 Y0 [for the specified device and returns a Device Description Block (in ecx) for7 ]; M. R0 y% c7 r+ B' P, J
that device if it is installed.
" r# N; u8 H# e9 U1 y7 D7 _7 z. E- I( h1 m+ i
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& @, l7 m6 }# S; l! L mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
2 `3 y y" t9 V5 f VMMCall Get_DDB* p) B" P; S J
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 ~1 R8 n5 z/ ?8 _" j# y/ `$ n8 L1 ^/ Y1 [. N' @; @6 ?% d
Note as well that you can easily detect this method with SoftICE:- L+ |# }, Q0 s! U
bpx Get_DDB if ax==0202 || ax==7a5fh) D$ g6 G# ~8 u5 H6 }
7 [/ ?3 c, r+ t__________________________________________________________________________) ~, _" L5 w" G3 F m
5 W2 z+ t% g3 R" IMethod 106 ]" y ~4 U8 k
=========2 s& e# l+ f5 S$ F8 M
$ W7 V2 j: w1 Q% m8 B7 i# T+ k
=>Disable or clear breakpoints before using this feature. DO NOT trace with
]6 @+ \* \: y! l1 V; T. r; V SoftICE while the option is enable!!
' [! I; {+ _4 ]5 ?' @
" d7 W% A% I4 C+ E+ xThis trick is very efficient:
/ `7 p0 x( B; Vby checking the Debug Registers, you can detect if SoftICE is loaded, I: K# S$ k, l3 a5 y C) H; C
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ O# N: Q q& D" W0 o; d5 [. R/ y" L9 X
there are some memory breakpoints set (dr0 to dr3) simply by reading their9 s# X3 { s! X0 O9 M
value (in ring0 only). Values can be manipulated and or changed as well5 e: M4 z: H! b' a
(clearing BPMs for instance). ~5 m; J' c/ j2 L" i5 g
- d- ?- h9 P6 H2 h# G. X
__________________________________________________________________________# ~7 V' V% V; g! r9 U' W' Y7 e# u
& I! g5 Z) V2 o( WMethod 11# R& z1 Z& x* O, |7 _+ {3 q. `
=========. j4 k, H) f4 n, L* y3 t- S
5 C1 {5 w: H! ?$ [* \$ a
This method is most known as 'MeltICE' because it has been freely distributed
- H$ \; y. T2 B$ p" g- i0 f, k) Lvia www.winfiles.com. However it was first used by NuMega people to allow3 ^6 |! E. v- J1 F
Symbol Loader to check if SoftICE was active or not (the code is located
8 o5 L; N* D7 ainside nmtrans.dll).
- `- k- D. Q, x @* y2 c* }7 s
' Z5 \' H5 J, A" @" A0 pThe way it works is very simple:0 a. v% S( a i9 L2 F4 ]
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 H M, g% N+ |, D/ I
WinNT) with the CreateFileA API.
- Z" d( p- e4 R+ u+ f# Q& K; K; Y2 a: r- q; J& g
Here is a sample (checking for 'SICE'):+ U! E" r8 @" l: w
) ?2 f2 M' y% W7 W, n
BOOL IsSoftIce95Loaded()" |4 s$ T8 Y0 k
{
5 E) m# ?; x. ^% K HANDLE hFile;
U# @: X2 w. }- P! U: f hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 v# T2 K1 J! h( @/ G( _$ ^6 t FILE_SHARE_READ | FILE_SHARE_WRITE,2 ^" n0 ?% z/ n. Y- j( Y
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
' | E+ g9 z: J) h2 n- C/ ^: a5 T; a if( hFile != INVALID_HANDLE_VALUE )
: s+ T9 |: s, x, I* Z% l1 ^ {
1 O, \ G4 X$ O* s; ^ CloseHandle(hFile);
; y' Q% M6 p9 s9 o1 t return TRUE;
. N# m7 ^9 q# K) X# p7 ` }
6 _& E/ e8 B+ ]$ g- W( Q return FALSE;8 _ H/ D9 u5 {
}! ~4 S! D3 ^4 i( p6 j! k, H
# k/ `% O0 z" ~' ]0 Q# JAlthough this trick calls the CreateFileA function, don't even expect to be
5 c0 n9 ~" ~% C+ }9 bable to intercept it by installing a IFS hook: it will not work, no way!
, N/ _. S5 D1 e5 WIn fact, after the call to CreateFileA it will get through VWIN32 0x001F3 v5 a3 m8 D& Z% x/ _5 f
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 B# M+ I0 P# I6 t" W+ z
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
& k/ K2 C8 p0 P# S2 e( Rfield.7 Z- O* K8 [: m1 J4 e
In fact, its purpose is not to load/unload VxDs but only to send a 2 J* O; h. x% }1 s, q6 a
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 j" D4 T0 ]: ?. p1 W
to the VxD Control_Dispatch proc (how the hell a shareware soft could try( |" J" a, e1 ~* ^0 j1 S# c
to load/unload a non-dynamically loadable driver such as SoftICE ;-).2 K7 H, Y% U4 _1 E0 H
If the VxD is loaded, it will always clear eax and the Carry flag to allow
5 F; `' v. } t0 qits handle to be opened and then, will be detected.: r8 P) W& G8 i0 W( V
You can check that simply by hooking Winice.exe control proc entry point' e$ n2 {" J/ l4 S; P
while running MeltICE.# T9 V/ b9 V# P Q) i# F' d8 Z
+ Q l# R! X2 F& ]4 W0 I' p9 J( Y( ^- c
00401067: push 00402025 ; \\.\SICE
9 P4 d6 E! ]& [ 0040106C: call CreateFileA
, H1 o: T' ]9 K, f 00401071: cmp eax,-001
/ E0 \) c% N) v; _ 00401074: je 00401091
) Z2 s" ]7 r1 L& N4 d% h3 L# H+ G8 i& v3 T/ Q* u, a
7 ^* i& q( }9 F
There could be hundreds of BPX you could use to detect this trick.5 l8 q2 ~0 s2 U+ o; E
-The most classical one is:1 f% h' L# X' P: G- M$ {5 t9 u
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, e+ ?/ k2 a. q
*(esp->4+4)=='NTIC'7 c4 m u! g! ?: T' q' A u$ z
8 }% M( S5 F- \-The most exotic ones (could be very slooooow :-(
1 h- N) C- y# M9 j# f! n O BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ K0 l9 Y2 O# h3 G ;will break 3 times :-(
7 r8 q8 `7 A/ u a
5 C L, w r f+ ]: K9 D-or (a bit) faster: - `# I% Y) [" L# q# B6 R
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" u5 u9 B6 D5 w. j) ^& P* }
- c$ h. l1 X. y6 l BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 b; G ^( k m l
;will break 3 times :-(
9 J7 i, E! w$ Z* v
4 e# w1 ~) ^. C* d5 v-Much faster:1 O' p& m2 Q* y, P" y
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'3 ~5 ^) ?2 t" B' X- C
7 K' t& c/ l- G. m$ S% F" @- ]
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen# V6 `4 o: q& M" L b+ A, w
function to do the same job:
9 r( Y2 V5 a2 }8 T3 n% \* K
, y$ X- Q2 S& U push 00 ; OF_READ
6 K: k6 I) S! f5 ~- M7 ]8 l R mov eax,[00656634] ; '\\.\SICE',0! d: N+ d0 e& ~8 v |' h' F+ m
push eax3 X: B0 l% c; j6 d2 j9 F, Q
call KERNEL32!_lopen* c) O2 m, h7 h! C# D
inc eax
4 r8 h9 V3 r: m) @5 v6 H% ? jnz 00650589 ; detected' y! W0 z; f0 D) ^( r1 P& G
push 00 ; OF_READ
0 J' D; t9 g% m& g( ~' h mov eax,[00656638] ; '\\.\SICE'4 y1 m( D) j& n/ Q, |& `. J
push eax' x* @$ ^1 G7 V8 p: S t
call KERNEL32!_lopen
5 Q7 c! y$ n; |% ] inc eax) {& i, g% `8 F* `+ X" F+ R0 z
jz 006505ae ; not detected" y& Y4 e T0 m7 M$ p! K: s' @
) c0 k" d8 j1 }7 F: o; m& |+ M
6 Q% X9 Z5 W6 \3 I1 X# a/ O9 C1 P
__________________________________________________________________________
; \) {' ?7 L7 e: q9 G" B7 C, ^( A8 E/ u* U0 t) ^$ @0 b$ A2 k; s, n9 {% F! W
Method 12
1 U- c0 C: L% {7 {, c=========
! x7 a: U; @6 W' I! S
3 m# m- e8 f! {# e( BThis trick is similar to int41h/4fh Debugger installation check (code 05$ o; `" a8 z' g
& 06) but very limited because it's only available for Win95/98 (not NT)
$ O7 v; R" c. s' P8 Eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 G2 C7 K! w7 B: W* }1 G! ]6 u" r% K5 K, d \9 y, \' Z1 T* g& Q7 ~
push 0000004fh ; function 4fh2 @) ~8 K4 H& M6 L$ X8 V0 o8 }
push 002a002ah ; high word specifies which VxD (VWIN32)
9 g, O' `! l4 z0 Y$ p2 N$ E5 P- T ; low word specifies which service
9 K& n7 n, V* Q" \7 ~* g (VWIN32_Int41Dispatch)
2 Q$ T* R; O+ d call Kernel32!ORD_001 ; VxdCall
' c0 {1 o+ Y+ X, {* x5 ` cmp ax, 0f386h ; magic number returned by system debuggers) b9 K, d! @, o* `
jz SoftICE_detected3 d9 G; r, a7 l* p0 g5 w0 d7 k$ c
|* n f; k$ z2 Z& l; j2 b
Here again, several ways to detect it:
. r4 j6 a6 L8 v# a. U5 E; @" U1 I' v; e
BPINT 41 if ax==4f
7 E( C! P/ w0 n% L& ]% n
4 z+ D4 Y. Q3 s& Z1 p$ s+ D BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; o- F1 r' V) k" s- r9 ~ S, X
4 j$ R8 Y( z( k* A% J% }- }- E) A
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A4 W3 ^8 n! X0 ]) h( e! V3 t
# d# g/ |7 c/ e1 o" M BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
5 C+ x$ O0 \. U( w9 R$ D! V
1 b7 P, j$ N0 m. L" {# E: J0 V__________________________________________________________________________
. Q# B/ ~, N n- N7 k+ w& y" u F9 C, M# O- q7 ]( H2 t; t
Method 13
# A) ?7 B' |8 A$ y* X=========6 z2 I8 E6 N* ?/ A; C8 K
( y b, J( {& z% r `/ e$ i- Q
Not a real method of detection, but a good way to know if SoftICE is
# W9 m) [0 ~* V. r# l$ oinstalled on a computer and to locate its installation directory.
! ^$ D2 P7 t7 R4 d' iIt is used by few softs which access the following registry keys (usually #2) : M8 |) @ O$ Y) R
5 \" l, \& J# S6 [& F
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# j) L* D6 p2 z& }
\Uninstall\SoftICE
: ~, B" P( D0 s% z7 _- }9 k% b1 R-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 [0 a, z* ]" m- Z) I$ c& E
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 P8 S4 H% |/ L3 v( Z) {3 v
\App Paths\Loader32.Exe
0 U' b3 }( J2 F% E I
, X& S9 x% t. D' i6 H* M- n4 y3 b5 o6 x2 @- ? w Q( T4 G
Note that some nasty apps could then erase all files from SoftICE directory1 ~9 h! _" t' y' S, ~2 c. m$ w3 ~
(I faced that once :-(5 `4 k& D k& b% W9 W b: `5 I
& s O' z( ?; MUseful breakpoint to detect it:+ a4 t2 S6 E+ g( V9 Y
0 s0 m6 s& i. Q0 ]. X) e
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" |: @# z2 }. t2 L1 _$ D# l |: _% r& ?' r8 [6 L
__________________________________________________________________________
% G. X0 [% V5 L7 A+ ^2 w
% D& m, h7 ]& x
3 m4 K+ m, x PMethod 14
6 W& n9 {: ^4 }5 G- M, n3 {( q$ ]=========; g1 d0 H6 a4 P) o( X
& M9 P2 |4 B5 i7 gA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 o7 w: @$ ]/ w/ l) R* M; B5 ?
is to determines whether a debugger is running on your system (ring0 only).4 O' K3 j D0 _0 u, O! r
# N; U; W5 y9 R9 k8 V
VMMCall Test_Debug_Installed
$ q M0 E# G, ?+ [0 p* ~9 e je not_installed
3 i0 @0 s" ]3 o6 T9 b
: N! s7 h7 h" c# J- pThis service just checks a flag.$ `6 e4 F& p9 U1 r F4 F
</PRE></TD></TR></TBODY></TABLE> |