<TABLE width=500>0 B: \2 ^* d `! ^, m
<TBODY>8 J* V7 c$ F, l; _' ~) e8 X
<TR>
' a8 ~4 k0 V4 }" J) Y<TD><PRE>Method 01
}( L3 T( ~, v+ P2 |& d o6 g=========
3 `9 C* ~5 O4 @/ m. F) o
; B& Q6 C* u. l8 A) ?This method of detection of SoftICE (as well as the following one) is, M' z, i, @, w. ]$ ` H& J
used by the majority of packers/encryptors found on Internet.9 x' I5 {# s' N; F8 ]: U0 b6 l
It seeks the signature of BoundsChecker in SoftICE
# Z1 l, J/ J4 H& S4 |& m( x6 Z( A7 { O( V8 r! M
mov ebp, 04243484Bh ; 'BCHK'8 N+ W5 p2 K- m; U, o1 {
mov ax, 04h( n" l8 I' s& x) H& Q3 d0 X
int 3 $ \" ~2 T" Z Q5 m
cmp al,4
% \8 |& P- w4 @ b# T7 A jnz SoftICE_Detected4 {3 F5 E) T: k% C i
' W# K, {5 s, @! Y6 G% ^4 A% I4 _
___________________________________________________________________________8 n5 i8 M6 R! r! D
0 q, C! E3 W& y: Z" L0 R" Z1 y/ \
Method 02& Q, x' G% ~3 Q* t8 f& f2 ^! E; M
=========
! k( [/ d4 J5 Y, E
6 S C% @7 u2 S# ZStill a method very much used (perhaps the most frequent one). It is used
1 R9 o: K. v% ` m+ c! d# Wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
1 P" a9 y2 B% p8 F$ K( x. uor execute SoftICE commands...
$ m" S: i9 T+ t( bIt is also used to crash SoftICE and to force it to execute any commands* d& U: H# j A4 n( {% H
(HBOOT...) :-(( 2 K* _' |& x5 P+ x4 _9 x, }
) z% {" y' }( A. CHere is a quick description:
6 L2 w) P C. k0 C. s, X-AX = 0910h (Display string in SIce windows)
5 P" ^4 }+ v+ ^) ^- z-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
4 {5 |7 ^/ W: Z-AX = 0912h (Get breakpoint infos)
( A! c0 n [! }; ]+ j. A-AX = 0913h (Set Sice breakpoints)8 S1 S* q J& s. }- P( Q
-AX = 0914h (Remove SIce breakoints)
: v7 @5 x/ ] t, G* F/ [: S
+ Q u% c% k$ z1 P$ Y/ _Each time you'll meet this trick, you'll see:
: y+ C7 r1 q- W# F: e' [! q8 m' J1 X-SI = 4647h
$ w: v8 D1 ^* ]! D-DI = 4A4Dh B, o) e: ~9 C" |! ?
Which are the 'magic values' used by SoftIce.
' _/ i( {8 d; H& k/ k5 j! aFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.! N8 h' s" v0 e. H: q, n
7 U) P5 ~9 J" u- m$ {# L- VHere is one example from the file "Haspinst.exe" which is the dongle HASP5 Q- d& ^! g3 y- X
Envelope utility use to protect DOS applications:- H) f* W; `& \1 j6 u' {: Q
" P4 [8 R! F1 d
( ^# _, G7 k8 M) U
4C19:0095 MOV AX,0911 ; execute command.
! M$ m% _: f. M2 f4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).2 H% H7 L. O( e! N
4C19:009A MOV SI,4647 ; 1st magic value.
0 D( Z$ M/ U3 a$ ?/ e4C19:009D MOV DI,4A4D ; 2nd magic value.$ N( p% ~0 E) ]- u# U
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
7 K4 j# y9 V6 [' S Q: D1 O4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
" x) E: R Y$ @( t; e% |8 n4C19:00A4 INC CX
2 K, s1 |+ i. j$ d! v- h4C19:00A5 CMP CX,06 ; Repeat 6 times to execute1 E' ~' E1 F* v H
4C19:00A8 JB 0095 ; 6 different commands.
4 Y* P) h( c4 `( T. f* v. N4C19:00AA JMP 0002 ; Bad_Guy jmp back.6 c ~7 C0 S& k, D! u
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" ~& [- R* U$ ^ j! w% P4 \0 B$ v: g: A$ m4 a
The program will execute 6 different SIce commands located at ds:dx, which/ F4 ^2 s g- Z/ c
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 J5 K/ R& p9 y" [& K
5 b7 d2 O# _+ f' s4 n9 E& J- s& T
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 l" n7 b1 w3 q___________________________________________________________________________' M' P( I1 @+ t+ h9 w8 W
! R9 M; V% N& m3 d0 X# Z9 d2 {
; Y9 m6 r2 y5 N' XMethod 03+ y+ N- _8 t0 B. K
=========
$ p9 a+ w+ w! f! \
* _% t% ?! P/ e$ tLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h" C, ]. b$ r6 A! y
(API Get entry point)0 ^8 T: N- T5 O$ ~
) \2 e3 i. r, Q6 m% n, Y" M6 q9 h- ]% z1 l! w: d$ @( ]
xor di,di
- {- j0 o3 w- \& C, c1 b. n mov es,di
7 e+ V5 S: C4 E* z3 P; n& w mov ax, 1684h
1 V! U/ F6 H, g' z% I mov bx, 0202h ; VxD ID of winice' w# j/ S# U) u; s& F, n
int 2Fh) b, z0 d; n% r$ M) L0 `3 g
mov ax, es ; ES:DI -> VxD API entry point+ b/ e6 h: E4 ?# N" q
add ax, di
$ T9 J& O- ]$ w" l6 [6 u test ax,ax
1 g. @2 H& E1 c$ L% v6 D- |9 } jnz SoftICE_Detected
. e; W1 z$ ~) \5 i) Z/ i' R; @5 Z) P6 A2 u
___________________________________________________________________________
/ L' u7 l* g4 V. ?
! E2 ^) {* w* A7 R9 qMethod 04
9 d* J# U, \, W6 v/ w8 [3 I& Y5 m=========
! e- ^, b }& N# h( q0 [/ e; q- J8 A2 U+ d4 J/ }
Method identical to the preceding one except that it seeks the ID of SoftICE
5 d) ?) \$ C$ iGFX VxD.
- S# F9 t/ A/ t; y' N: I1 T/ _- h8 D' h: M
xor di,di( K, K- `7 E3 }; F& l& Z' }
mov es,di7 L5 Z3 b- `8 q3 K( O: u z. ]
mov ax, 1684h 9 i; [4 Q( J$ \" o+ J" O1 K
mov bx, 7a5Fh ; VxD ID of SIWVID
/ P2 o! |6 L0 [1 V int 2fh+ N% a% Q. F- B
mov ax, es ; ES:DI -> VxD API entry point$ j; ]! p7 x- ?" J- f5 P
add ax, di
' s4 d) \% A' F test ax,ax
$ J0 X/ ?/ Z1 U* G% d jnz SoftICE_Detected
: W$ w1 U% A" L( a" f0 z, t d1 X \( S9 u
__________________________________________________________________________& f9 S/ Y: E8 Z$ @* M9 z- G
, m( `! ~9 a% J. E" ?
; B9 R- p/ |: E7 a4 Q0 `1 W2 KMethod 05& m" r' A: D$ b# e. F- F
=========
7 E( Z. E" T# E, j+ d9 d" r; N4 p
Method seeking the 'magic number' 0F386h returned (in ax) by all system
; Q0 y7 D8 d7 w9 Fdebugger. It calls the int 41h, function 4Fh.
6 y5 L3 J5 ~" D' m* n) S! O* zThere are several alternatives. P+ }/ P2 S/ `& D! h
7 [3 `# Y" t& q
The following one is the simplest:+ q% X1 t. f* O6 D- O
- `5 d; N/ E6 J& b$ I mov ax,4fh* W* L# M" p# F y
int 41h3 F, }+ X- z# y" l4 i( I- Z
cmp ax, 0F386
" G6 x; n; p4 N" w6 E jz SoftICE_detected0 `9 v; a6 Z- o" h# M
% f) c' K2 z G* U% \, r1 O3 H6 m6 {/ C
Next method as well as the following one are 2 examples from Stone's / P. f i0 {( S5 a# N
"stn-wid.zip" (www.cracking.net):
* ^6 e! {8 t& ]: V/ w
$ G2 H7 z2 V! }" y% e mov bx, cs
/ j$ K4 p1 t% b" u lea dx, int41handler2
6 k0 [2 g' a% M! Y( ?5 s xchg dx, es:[41h*4]/ C7 ^: h6 x7 _! \/ }# x
xchg bx, es:[41h*4+2]1 e( ]( d3 A2 v, W7 Z6 w' Y
mov ax,4fh
2 u$ J8 M8 G$ R$ d int 41h" n G+ x R4 @+ ]
xchg dx, es:[41h*4]8 `. I1 l1 o+ r- n! M% x
xchg bx, es:[41h*4+2]9 w% Y" G( d6 p3 o/ \& b0 {
cmp ax, 0f386h
' W* ]" R: Q% l, H" C4 i/ r, s \ jz SoftICE_detected
5 ^ q# r' P1 j$ z. a3 b K3 Y" W7 h/ X! W
int41handler2 PROC0 s+ M, g0 `! A& x/ W, a+ ~$ W$ F
iret$ s) i/ u+ N6 H" E! m; _+ i
int41handler2 ENDP1 `( x( }2 _7 w3 b4 E
' a7 Y* W% y. L
4 U. _3 v, \. g& n- H& e; z& T_________________________________________________________________________
! V& Z& I6 |1 r. `* ^& l; l' i* \! d
+ h$ m7 H( {, b. [: A! `2 e& h, d$ }: |) G7 C$ a3 K' T
Method 06- Z9 J- M+ U8 Y9 A2 `# a; g( s
=========" Q* C% R, l+ k' p! e0 l% Q2 G- h
e+ [% h1 ?% E! k2 r- ]- `
3 g8 e R- L( }9 E4 E& f
2nd method similar to the preceding one but more difficult to detect:9 L8 u, P# A& U
& S7 M H& @+ A( a& ~ q
* g- x6 M; u5 y/ P2 D/ F( o/ yint41handler PROC
( T; }- M/ C8 R" y9 M: h mov cl,al( G% l$ e! ^' M3 N' G" V
iret0 ? T( V8 X- u& u! u4 D7 \7 h+ _. x
int41handler ENDP' h5 S& L* d! E8 C7 u/ _6 _, ]( D
0 i2 \1 S. Q9 R; d* e9 v
9 J+ M. v8 j3 F7 s$ F( [
xor ax,ax
1 `) X9 Z* z: x& j mov es,ax1 E/ \6 w& ~: s6 [
mov bx, cs
2 O% H* W/ X9 k" u$ D* u lea dx, int41handler7 ~9 i, ^; ]9 G( P. |7 R3 D
xchg dx, es:[41h*4]
K- {7 w1 u. c xchg bx, es:[41h*4+2]4 y1 K2 X; E9 D) z$ S
in al, 40h
% {/ E( l _0 \8 n' W0 { xor cx,cx
P! R, K& x9 Y" \& u int 41h i8 |0 E7 D' I
xchg dx, es:[41h*4]5 x# g' z0 I$ G& i, m
xchg bx, es:[41h*4+2], r1 `" D6 X0 N# t* R/ b+ C
cmp cl,al
* A1 H }) A% p6 V3 q; @4 N) p jnz SoftICE_detected
; c. K- E; X! ~0 E w
& E5 }+ @4 l6 `3 g' J& i_________________________________________________________________________
! ?5 W/ a4 `% x5 o! u. _# z7 F$ {; s/ z! S0 j8 _
Method 07
& a/ I3 q4 h: I% ]+ s0 @=========
3 T3 G, T2 a4 P7 ^, Z) q; T) Q# n# L* ]; |/ i
Method of detection of the WinICE handler in the int68h (V86)
# `0 ?$ z3 Q9 a% U' ~; d1 b. W0 Q# F7 Z( v! b: m8 B: Y
mov ah,43h1 a/ l+ w9 v$ X$ F, i
int 68h; f# R( C0 h/ {
cmp ax,0F386h
3 D1 Z/ n3 P+ N- {& [' r$ t jz SoftICE_Detected) c2 H- h, O: ^1 i# V
1 q5 w( [. p! o4 S7 ^0 |+ P. x4 { J- d0 ^5 I
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 l3 h, X# m+ ~# o
app like this:4 s; K$ s- N( \ |7 ^# d6 p
8 ^8 D) e( Q: \9 G0 \3 r# B BPX exec_int if ax==68" m; \$ e- @1 f! G
(function called is located at byte ptr [ebp+1Dh] and client eip is
. n- l; n6 V8 p- z5 i located at [ebp+48h] for 32Bit apps)
, G% Q/ K# K5 q. C) H, v__________________________________________________________________________' x8 p, ^3 Y% I3 I3 L. a4 L1 u
8 ?' V5 B7 X/ q$ t5 m
& N9 A B1 v6 r3 |# _Method 08
1 \8 o0 f+ O9 X: O- \=========8 z* r) A: @* i" l" E/ i& _& C
) M+ H- W; a* L5 K Z4 h& O$ K6 MIt is not a method of detection of SoftICE but a possibility to crash the
* k+ u) V& d6 f$ B% V0 Esystem by intercepting int 01h and int 03h and redirecting them to another
0 R) i7 X% L, H9 x' }7 k+ Wroutine.
6 X8 ~7 S( ~8 i( Q) ^" }/ N) ]" vIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( p9 f+ Y+ w% O+ J' T
to the new routine to execute (hangs computer...)
% l( J. l( t6 ^+ n6 p) B7 G0 o: ]* ^4 O
mov ah, 25h
, `/ `; C* D0 N mov al, Int_Number (01h or 03h)
1 g% [) R8 q9 X) h+ S mov dx, offset New_Int_Routine
* \9 X& `# E6 R: x6 B int 21h
* s0 ^2 C/ F2 ?6 A+ V! q% H5 c( a7 N% O* z" s w) G
__________________________________________________________________________
5 O7 O' }; Y H3 l# M( ^2 h! z
p' t& Z; W$ h+ l; H0 L% A! c0 y2 Z' {' kMethod 090 P" R) }+ m3 {# E
========= i. d- D6 c9 Y) _7 o2 o! z- J$ J
5 l: d8 }' n/ O8 oThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ c+ i; {6 }6 A. Q
performed in ring0 (VxD or a ring3 app using the VxdCall).3 R2 B. n; F9 Z; N, t
The Get_DDB service is used to determine whether or not a VxD is installed
, k* E$ M' z3 V& efor the specified device and returns a Device Description Block (in ecx) for' f3 U4 ~& \5 |5 C# F6 U, _
that device if it is installed.
& J# J0 C3 j" |1 c- u/ K
) A6 Q! Z: D g* w' c3 ?8 u4 ? mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% E1 b+ ]0 F; [0 c5 l
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
2 H: Z, z! A9 E+ n VMMCall Get_DDB
5 g7 j8 x2 O2 {) ?/ d1 T: F mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed0 z+ g! C: U1 E3 o. E- x
+ J0 S) q- j4 Q* ^1 h8 X
Note as well that you can easily detect this method with SoftICE:6 T l2 u6 s- P7 w* V F7 K3 ?
bpx Get_DDB if ax==0202 || ax==7a5fh8 t9 g1 V" t4 h% O! i$ {
. P6 x0 `, g7 Z3 M, h u3 D" i
__________________________________________________________________________- e: y! t9 S7 m! e: [
0 Y( V/ Z5 {2 u9 i* JMethod 10
; W6 {/ B: J6 y5 g* X7 E=========% N; C) [: q+ i( @0 ^
: y) m+ ^1 C, [4 T- W
=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 u5 i$ ^. @! [* }% p# J1 ^ SoftICE while the option is enable!!; D2 j' p9 h2 G# r
: ]( T& y, h! F+ r" z1 H' Y: H
This trick is very efficient:* V! r/ Z* D2 G, P
by checking the Debug Registers, you can detect if SoftICE is loaded; t3 S9 Q5 u! l9 k
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 f" ], B$ v1 h* m* e3 s# Y; C+ G
there are some memory breakpoints set (dr0 to dr3) simply by reading their
; J3 J8 Y: D( X+ f8 R |3 ~value (in ring0 only). Values can be manipulated and or changed as well% G E! X) u+ J. {* F4 \
(clearing BPMs for instance)! A! F9 [% h, ]& ?$ F
2 J) M- u/ K1 y5 n; Z__________________________________________________________________________0 T0 F4 v. {* R
; T( `" n: F5 m; _3 N
Method 11
/ s0 @% s# F4 ~ n$ \6 y F, D=========
+ d4 X+ I% h4 m3 n4 s% m" Y5 f" h9 { H
This method is most known as 'MeltICE' because it has been freely distributed; ^7 [9 b: ]" q5 _: @
via www.winfiles.com. However it was first used by NuMega people to allow/ k7 C1 X- E n
Symbol Loader to check if SoftICE was active or not (the code is located
% W' @6 A, |# |2 L4 {& f- M2 hinside nmtrans.dll)." k1 a. p5 ~% V" _. t* H k5 y
+ a7 x: Y% r% K: O7 vThe way it works is very simple:
/ ?/ k" q8 U) v" SIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for* F; O# Q4 Y- _, X
WinNT) with the CreateFileA API.
, l9 ~* d. D4 r; m. ]! e# g: F8 X! f. z+ [( K
Here is a sample (checking for 'SICE'):. i9 l% r5 [3 e d z7 x
$ l; {" f# n2 H0 B/ n. I
BOOL IsSoftIce95Loaded()
, a) C2 w; o% i; e5 e2 o{, U. |2 Q4 Z2 E5 g
HANDLE hFile; " G. F, p7 t j& `9 Y) H
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,4 U P2 |% s! O! \8 U: j6 m
FILE_SHARE_READ | FILE_SHARE_WRITE,
1 t& F) \2 s# _. C NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ I: c I+ o- _' t
if( hFile != INVALID_HANDLE_VALUE )& V: D2 w+ @, d# J: `( Y& B
{
3 V/ e$ X6 X2 s& d: } CloseHandle(hFile);5 P$ @& S+ A/ Y0 O+ L* C+ M
return TRUE;
i# Y S# o2 b% ]7 s }$ d' `! I* ]1 @. U/ o9 D+ w
return FALSE;
6 I( a. u: ]7 f4 w/ d}
- X/ k) h; F/ O7 E: U& _2 x. e3 a" Y8 \- k. E1 j7 x7 P
Although this trick calls the CreateFileA function, don't even expect to be
7 o* }7 O0 S7 y7 S7 B% I% Fable to intercept it by installing a IFS hook: it will not work, no way!/ s3 M" t4 z/ h! [
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
) V5 ?4 z0 P, b$ o' t; W$ H2 nservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ z" [" c5 r( l! t- b9 {and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 `+ z3 i2 w1 g, K
field.
& M0 p/ C0 R G2 T. _In fact, its purpose is not to load/unload VxDs but only to send a
! l) C8 k: m q) U5 {W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 [9 X o& D+ E& V- {to the VxD Control_Dispatch proc (how the hell a shareware soft could try6 ^6 C. ?0 x' _5 O8 k& Q5 {6 A
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
& h. @- c: V4 K9 D2 \8 RIf the VxD is loaded, it will always clear eax and the Carry flag to allow
9 x: i' S3 F& ?. cits handle to be opened and then, will be detected.+ C' `+ M2 v! n- B; ]& [
You can check that simply by hooking Winice.exe control proc entry point8 U6 w4 g ~$ p' F
while running MeltICE.8 \7 f5 f& x2 s1 }( ]& z! ]& h
" U1 j9 E5 c$ c" U' \& D& Y g& x: ^/ [
00401067: push 00402025 ; \\.\SICE! F, O. \. i% G7 u
0040106C: call CreateFileA8 B" S2 ?% j# S3 q$ k' r# t% o& ~# z
00401071: cmp eax,-001
Z$ J# e+ R/ c9 } 00401074: je 00401091+ V8 P; G; ~. B" M. C1 S+ M; \0 s
) i g* K! A; g1 z. S
4 w; s! c, z; m( ?/ I% v2 SThere could be hundreds of BPX you could use to detect this trick.- L# M5 }+ V$ G1 f/ k) g' O' Q
-The most classical one is:% c" u1 Z* T: {$ G( E
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' || b X" V; g. Y. M
*(esp->4+4)=='NTIC'
+ Q& u: F0 y) T- Y6 F o3 W8 b4 T/ w3 G$ H6 C- }
-The most exotic ones (could be very slooooow :-(3 e% u2 Q" J1 p* O% q" @
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" c+ d( M% c& \0 V- W0 a ;will break 3 times :-(
3 S% B9 ~+ }& W
4 ~1 y* M. ~* `; p+ |% F-or (a bit) faster:
3 v; ]" s0 K6 x0 _' V BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 h) X3 u$ }9 q7 h$ P( s- H/ h
/ f0 u: \4 o' c- a: l BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' . w' R9 I+ @5 W: k
;will break 3 times :-(
3 f5 _7 H! ?2 x: _
* S: H* r6 ]- e# {8 J' i1 E-Much faster:
1 O$ ?8 B' ^! E BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'2 \0 i4 J' S: O) v
" _$ H- n! d( u4 T2 c& k/ |- y& ?Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
. |. k, W$ l. ]& }4 Yfunction to do the same job:
! O: E. w$ c& q/ I2 d- @/ p
6 m# x# @0 d9 g" E( q push 00 ; OF_READ: J7 t5 b. U% _3 K' [% L! k
mov eax,[00656634] ; '\\.\SICE',0
; e. F: _0 w, b8 Q4 s7 T1 k push eax
* D: V! e; X- g* ?" j! n call KERNEL32!_lopen
% Q5 Y; r0 U% p inc eax" a* ~% U2 ^: X7 K& q S! J+ z
jnz 00650589 ; detected! N7 N7 x) T+ h" Z
push 00 ; OF_READ9 B, j$ J/ z) C: |: U6 t
mov eax,[00656638] ; '\\.\SICE'
6 v/ K6 S$ V: v/ m push eax: k& l% m4 ^# \6 H
call KERNEL32!_lopen
5 D6 ^7 z; w1 H& v: d inc eax) q( h$ Y! F& c; W% e. D
jz 006505ae ; not detected
1 e4 }( a6 |# t b) s) [% C
7 S( H- w6 F' O# d5 E& t; O \" N# M
__________________________________________________________________________" K4 L( R) Y8 P: W* S6 X% W
/ E) Z( U3 j' jMethod 129 V b9 {( l5 Y9 X# X0 }0 s- j' c! D" K
=========; b0 z$ ~0 R7 y+ X
6 X' H! }, M' |% L2 P3 k
This trick is similar to int41h/4fh Debugger installation check (code 05
; a- t$ G+ m- r& 06) but very limited because it's only available for Win95/98 (not NT)
2 z" t0 X- K7 W, y# vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
q3 x9 n8 Y* G. ~: D0 ?
) a4 c% Z1 c( @$ M2 G push 0000004fh ; function 4fh
5 o8 s; o! q$ `) ^9 Q7 a push 002a002ah ; high word specifies which VxD (VWIN32)1 \- [8 L1 b7 d' K7 E- u, q
; low word specifies which service" X; R; ~ [% P2 i5 g O
(VWIN32_Int41Dispatch)
2 X0 X7 q2 C0 A; i: o call Kernel32!ORD_001 ; VxdCall
6 ^3 N( X' ^) A cmp ax, 0f386h ; magic number returned by system debuggers4 y0 q5 A P& j& E
jz SoftICE_detected7 C+ s! T3 A: r( _; z: k
( T, S" m1 N; }$ Q' KHere again, several ways to detect it:
# y( f! q5 x# k" C6 k& ^' ~) j# x: e7 e9 p
BPINT 41 if ax==4f
5 {# n) N# Q* c5 j0 Z, b& ~2 f4 ^
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
4 Y! Z0 @' J2 x' J1 G6 E0 T; Q/ R! e- H$ G
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A* j+ O2 V' g, q
2 W. M' ?1 {1 D D% y% T% | BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 }& G B5 b }9 A) x+ |* f8 @
' E3 L. I; u" h* _& J* k3 ?7 B6 D__________________________________________________________________________7 {, R; S& N/ ~: O& g
3 W/ d7 }5 w) _Method 13: k" ] J' d7 ]7 f
=========
$ |3 G7 P* P( Q! K1 C: n$ R' s; ^% ?2 m* w" A
Not a real method of detection, but a good way to know if SoftICE is1 p1 s R- X p7 r! f- f a+ ?
installed on a computer and to locate its installation directory.
6 z7 r+ l7 b8 f! C9 c9 _It is used by few softs which access the following registry keys (usually #2) :
( P. M+ _. H, }1 H- U/ h2 ]8 Q. _8 P
: G4 [7 B7 c! {" S-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) S3 g q3 Z6 n% A0 H! C\Uninstall\SoftICE
5 H* a& b2 v/ V+ |) G- r- L-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 R7 E, D- y. J$ Q7 D# }, j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# a a+ n: q# S: q$ k; \
\App Paths\Loader32.Exe
- }% r' C2 t6 b5 e0 V
2 h0 N3 O: O2 S. D( c, J8 }% I$ i
4 c3 L6 l; I% d& l( v/ Z# F9 N. pNote that some nasty apps could then erase all files from SoftICE directory6 R' b" d, H0 @6 J0 ~
(I faced that once :-(' a7 C' _$ J+ `: {' I
1 e" v: w, z/ v F8 L$ i+ xUseful breakpoint to detect it:; ~# D" \6 ^* q
, ?" y' A8 [! U, r# ] BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'! @9 b E' H, N; \6 w) Y- \( W5 u
, p7 Z8 q A# F7 Q8 n; T2 e S4 D* V__________________________________________________________________________% b" {# R$ }) D1 `! j' ], Z
( B6 o' q6 H0 b8 V6 @5 Y6 }, n# }
5 W3 Z* v) k8 N: m
Method 14
b2 I! V5 S$ ?- v========= j; q+ i b+ d) |" n$ s; V# V* Q
; [6 k1 ~) y1 u5 d0 [! |: L2 PA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 P& ?# X, ^* wis to determines whether a debugger is running on your system (ring0 only).: b( K0 p J9 h4 @. S
" h) B7 A; ?! I VMMCall Test_Debug_Installed% O9 H" s8 d# t; v2 \ w
je not_installed
) b. U- Y0 y5 }( u6 p) D1 j) h. ~! _2 F& a$ e' j: ~; e
This service just checks a flag.; k3 f' \' i# R& C1 _% G1 ~+ D% W
</PRE></TD></TR></TBODY></TABLE> |