<TABLE width=500>
6 I) N W4 Y1 C3 D( u<TBODY>5 G1 w& I! i( f. c, ^. X% V1 A) J
<TR>! H2 ^) I: a5 O
<TD><PRE>Method 01 ( X% @0 r0 x" B* M% H5 t/ e- R
=========
+ N2 w" A; m' {1 e/ o5 `% V9 t3 M2 B6 C: Z
This method of detection of SoftICE (as well as the following one) is d) E3 G' J$ i2 x4 D3 o& J$ a7 g' j
used by the majority of packers/encryptors found on Internet.% [7 l3 b7 {: ^7 y( r0 @4 u
It seeks the signature of BoundsChecker in SoftICE
4 E3 ~; G" _3 y+ P4 `, n) M) w' \; t9 [% b+ J3 `) {' g5 p
mov ebp, 04243484Bh ; 'BCHK'& M' e5 |. g) B ]7 B# |
mov ax, 04h
1 ?# ?, ^4 t* e- F int 3 0 ` l7 Y1 {2 r I8 {$ F" m
cmp al,4# J4 B8 [1 l# V$ s2 ^! m1 E3 ~
jnz SoftICE_Detected
; G1 b8 P, L6 N" N( T
^! Z3 }- V9 ?$ e/ d___________________________________________________________________________+ Q, @# W5 I+ A+ W# ^6 P' z
$ M a, N1 k7 W: {# E4 `. z* q
Method 02
+ `" O, n' m* y V( L=========# @/ R8 i" P! g, }& m. l
3 B: g: w! Y6 \Still a method very much used (perhaps the most frequent one). It is used
; g0 m; k: n: S3 y% ~to get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 q& S0 k e/ O; A" x2 _* l
or execute SoftICE commands...' Z: m& K( b, g- T
It is also used to crash SoftICE and to force it to execute any commands3 X, j5 G- Z/ u
(HBOOT...) :-(( 6 R! Y) n" S( d" D6 z2 W% y
" {/ L; J. c) ]3 R
Here is a quick description:
1 w# s* n# J, X$ J r/ {$ o* ]-AX = 0910h (Display string in SIce windows)
0 z+ X0 I* E* B- |9 [-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& }, Q+ ~8 h% E9 V. _; O
-AX = 0912h (Get breakpoint infos)2 i% ^/ i6 R( O# @$ i N ?
-AX = 0913h (Set Sice breakpoints)
: K! b- }4 w) A, T6 R. Q& m-AX = 0914h (Remove SIce breakoints)
4 {) ^! U$ w6 j! x' E! o
* Y- E" u$ G5 X* o, gEach time you'll meet this trick, you'll see:
7 x& K$ }) p& E4 y-SI = 4647h
3 L1 v# j$ v" P-DI = 4A4Dh r2 n* X7 A$ \
Which are the 'magic values' used by SoftIce.; L9 l/ [' Q* S( ^2 t
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 k3 c5 Y& w' L* E
& d' R2 H3 N3 y" I# |Here is one example from the file "Haspinst.exe" which is the dongle HASP P9 X5 }1 f7 t" t( @
Envelope utility use to protect DOS applications:
: H7 T) A, I( e* ~
; }- W& g* e+ t& m% ~
; n0 g$ u l6 A4C19:0095 MOV AX,0911 ; execute command.) @4 P7 n2 v' |
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).$ Y- A9 E1 H& `/ `3 A
4C19:009A MOV SI,4647 ; 1st magic value.% q4 S$ S% h6 u) |1 Q' W
4C19:009D MOV DI,4A4D ; 2nd magic value.
% k4 o& \0 i9 O4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
& J) l7 i& z! C- j S4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 X; ~/ i; m0 ^+ W) M4C19:00A4 INC CX2 L6 C' ~1 t* Q4 \! W* Z
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. E- {/ M, S0 a1 J+ C# `% i
4C19:00A8 JB 0095 ; 6 different commands.* ]% t7 M% F) c2 X4 A7 O
4C19:00AA JMP 0002 ; Bad_Guy jmp back. O& C/ V% F* r0 i$ a0 E5 M8 ^
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- P1 W. L" ~( i, B" D' i1 Q" X5 n. f- y2 `
The program will execute 6 different SIce commands located at ds:dx, which
* S; ~ Y6 w. @, ^0 ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
6 R4 S1 Y$ G/ Z" R5 S, y# D5 s' W3 i8 X: E
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ U/ l5 D- o) z( p
___________________________________________________________________________2 [- u4 y5 Q) ~
3 ] i- x1 r4 w5 t$ S
( q0 E8 d7 Y+ f- j
Method 032 h/ {& T4 k. |7 N- p
=========
: b6 c0 d: w- |% w+ Z
. n7 W$ d8 H8 h5 o$ J g+ cLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. w0 y% T( h- D4 D
(API Get entry point)
8 n3 d' B3 H4 n0 H: r* J 3 }4 y" m( |* q
: ?5 Y) i9 n4 \$ _9 }% r xor di,di/ `) B3 H- h* K' s; r
mov es,di
; Q$ s2 T( j% w7 \+ f+ @$ e mov ax, 1684h & H! t' q! H a
mov bx, 0202h ; VxD ID of winice
' e% V! s+ U" g4 u4 f) u; k* \- ~ int 2Fh
3 Y) x$ N8 f* { mov ax, es ; ES:DI -> VxD API entry point" {: ~2 v6 j6 p9 S6 w( a
add ax, di
9 x7 c+ Z) V) k# B& [$ {' ] test ax,ax* v' s4 }& O9 z, \9 [
jnz SoftICE_Detected
0 U9 i# w, g$ w# L
7 D# k! ?4 n/ n. G& g___________________________________________________________________________! _6 p( Q( v( M& ?* S$ l
( f' y+ G5 F t$ a
Method 04
% G: ~8 p0 y# T" g5 o=========
) L7 v3 Z# ]3 p( T! M, ^) b- V$ v6 C, |$ C) y: }0 \1 K
Method identical to the preceding one except that it seeks the ID of SoftICE `- G; B( B, b4 U
GFX VxD.* _ I0 B& E- t# f. m# F) B' N
& o& b y8 H; ?$ q" d xor di,di
, V' L8 r/ |: P+ q {, i# e mov es,di
3 `/ {$ g. q8 K- R8 @ mov ax, 1684h
p" I' j9 r0 \( a, b9 X L mov bx, 7a5Fh ; VxD ID of SIWVID
% ]# l3 \/ R" M% K int 2fh
# Q& i) M: [- P( ~: i1 T mov ax, es ; ES:DI -> VxD API entry point
4 F* U& r& q" N- J add ax, di
' d# l5 Q0 b T" [4 b test ax,ax& y3 R4 i% V8 B. ~
jnz SoftICE_Detected+ u- Z6 W+ e# o4 _# X' D! z/ T
5 l% q, G3 k: \0 [__________________________________________________________________________. v9 m6 {& F6 |
3 C5 O2 r$ b: {4 s1 p" R
' I! G9 q* j" [9 l. g
Method 05
h7 W& W) ^ y5 E2 P& h& R8 |+ v=========
/ \- s: g; M% w$ [& X/ ~* B( T* Y% y) y: t- ^) E
Method seeking the 'magic number' 0F386h returned (in ax) by all system0 r# x Q% c l) \" N$ Y9 j
debugger. It calls the int 41h, function 4Fh.$ o5 ]! d$ R+ a% p
There are several alternatives.
5 }9 t# l9 U8 O1 k3 D7 g8 M3 g3 e- U, t1 {$ r: L
The following one is the simplest:
: N, L8 W- T) P! m9 a$ x9 o6 i5 g
mov ax,4fh
( T7 f" m0 X3 b1 N! C8 ] int 41h
! c" Z$ J- ]9 t( |/ R5 J cmp ax, 0F386" y( ]6 Z) k4 S8 d$ \+ n
jz SoftICE_detected- E* x/ T' R5 @/ z
" b( C# K# W- N7 s2 T) @/ u8 p
Next method as well as the following one are 2 examples from Stone's . h* K" C/ g. k
"stn-wid.zip" (www.cracking.net):
1 }( H E( G. o, {* y# y
) b' w* V: x* y# J" _6 ^" U& Z mov bx, cs
" L' f. {0 j# h4 R, P' d4 [7 ` lea dx, int41handler2+ L5 ~% T/ x+ p, z% x
xchg dx, es:[41h*4]
, G6 H+ w- g' _) e8 I xchg bx, es:[41h*4+2]
5 @3 @9 S' Z0 N5 t mov ax,4fh4 [- e4 u/ Z H% Y. x
int 41h: S e, N& k% u. c0 Z0 R
xchg dx, es:[41h*4]
# K3 {. C4 S$ l! p& ^9 N3 Q; S xchg bx, es:[41h*4+2]
) ~+ \9 l3 b& X3 _; | cmp ax, 0f386h
8 g& c: k5 t+ Q+ X @4 F jz SoftICE_detected
7 {, P; x* s: y/ H7 {
1 ?2 A5 W/ q, d% o! {( j3 Pint41handler2 PROC0 [1 ^( L; R5 n- k6 V; f! B* m
iret% R0 n! O \2 s, x. i+ |0 C* g; T
int41handler2 ENDP( d" N1 o$ J9 g4 n1 E
) j: @% a; g' X9 Z: b. l
7 J, V* x ?3 z3 @; d# r/ W
_________________________________________________________________________
% L+ M* b- @/ V# G9 W. S* m" q9 ~. F
9 r" T9 A6 a+ WMethod 06 k0 g( H% W$ d* d& M( G! _! ~
=========
8 Z+ H: y) b7 w) u) P; f7 `
7 \5 V* w1 [3 _0 c7 P7 |
8 @/ @) K- k9 {& v2nd method similar to the preceding one but more difficult to detect:
1 O1 h' L5 _6 p5 J* c6 I# c
# C2 o$ T# k; n2 F/ m. X( w! I/ r' d2 L g5 K y; V
int41handler PROC; O. v) q& `. q1 U
mov cl,al
( M4 p6 a7 N% S/ h/ R, p iret- X5 j% l% I: R" [) Y, K# x# t# u
int41handler ENDP- y5 @9 v j8 s) C- l' V
& G: R, _! ]! e9 W
2 u \6 |5 o( R& O- ?$ \) B6 r0 n/ k xor ax,ax
$ L* z1 Z3 G$ _8 F1 A7 w% O mov es,ax6 B# J1 L3 j: N7 V8 I+ M# W
mov bx, cs- }4 E, @; e, _2 f
lea dx, int41handler
& t* U2 N- l3 `& D xchg dx, es:[41h*4]
4 g9 q' C5 i+ K) Q8 c% Q; A xchg bx, es:[41h*4+2]
; x/ Y9 f- [* t! K in al, 40h
/ {0 `: T( q- @2 K0 s xor cx,cx
' |8 X2 v7 s5 \9 S8 H int 41h
- C$ V% i1 b4 b xchg dx, es:[41h*4]! a7 y5 F; W% E
xchg bx, es:[41h*4+2]
5 f# W* D/ ]" A- G# }0 @ cmp cl,al
" _' y" {' G& s; E9 @* v" Z+ ` jnz SoftICE_detected
9 ^: H9 P/ v' G" F( S2 ^: E% m) _) u- S
_________________________________________________________________________$ {2 u; ^- ]2 Z2 o" W" F9 O
. n* i$ }$ \- O' U
Method 076 { a, Y& ]- e" c# o4 k) `
=========
' ~3 M: N @/ _$ r4 _2 F% T1 i9 {3 z* D( r; _; M" n5 F
Method of detection of the WinICE handler in the int68h (V86)0 W( [4 R5 W2 H3 {$ D
$ H! a! _4 ^, I( }" V" ?; G3 l
mov ah,43h
* p2 J% f K7 \7 @! Y& n int 68h
! L( F* K+ b B0 y6 m# l cmp ax,0F386h
+ w/ f. r3 F1 G( d jz SoftICE_Detected, i4 T# ^8 v. x. J k9 m0 c
# E- P& I9 @+ s
+ \7 h- _9 t3 m _2 [=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit2 s, ~# H' P5 X% M$ R: L4 t
app like this:( ]5 A2 q9 a: u
8 m6 n) k3 I$ c6 d BPX exec_int if ax==68
& H1 z1 p+ h; k6 \& ^1 J (function called is located at byte ptr [ebp+1Dh] and client eip is( V& ~6 V8 E4 X0 k& _) e
located at [ebp+48h] for 32Bit apps)
- a3 U: @1 L: Y# |1 H6 D( \__________________________________________________________________________! T3 e# ?7 d& G# M2 \
+ ^+ q8 f* c! d& [" ~+ e
4 e# u: v( x* t9 p! u. g6 R
Method 088 n1 u, k6 f6 J. X; \0 e/ b7 d
=========
' z" \! y. Q5 F0 V% m& e$ o4 S- R4 A0 l
It is not a method of detection of SoftICE but a possibility to crash the1 }2 g! B$ Z+ ]' u4 q3 D
system by intercepting int 01h and int 03h and redirecting them to another
7 h; k n& [' Xroutine.
L6 p" m$ A* w3 zIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 `. c/ h" G; F7 L! s) z2 ^8 L
to the new routine to execute (hangs computer...)
# W* b- f( h6 |+ S: k- ~; b
6 P6 s1 l' V& ]% `2 }: s8 [( ~) P3 ` mov ah, 25h. _7 a0 @, P' G$ a
mov al, Int_Number (01h or 03h)
' p+ h7 m V! w( F# p mov dx, offset New_Int_Routine
9 \. V4 ~! C( o) q/ z int 21h
/ {( a2 b2 Q& r- i( V5 n( K/ W. U: E- c% Q% t2 g0 E" o3 I9 G' T9 k* f
__________________________________________________________________________
3 R" y) v9 q1 W- I
5 _6 q; b1 x+ F5 D. }Method 093 m3 `, g) }; l/ l
=========) f u8 N+ C1 f1 S3 D+ R
- z; g: j k$ `6 Q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
4 }$ J/ k7 n+ P% q1 B9 ~performed in ring0 (VxD or a ring3 app using the VxdCall). X+ A: r7 Q1 x) c/ w
The Get_DDB service is used to determine whether or not a VxD is installed) O* z8 B% }4 O
for the specified device and returns a Device Description Block (in ecx) for
6 K8 @ L2 G1 |6 c- U# Gthat device if it is installed.
$ \, k3 {; O& j, }5 [
& i4 { t- f% N' L8 _6 I# E mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID( D; h+ z% L8 d5 O: w0 j" G
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( a& Q4 I) v9 z
VMMCall Get_DDB
! P( X e U, j. B mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 K( D# P* W: x! q3 z u, ?% D
4 E1 a$ i9 V9 G' g2 uNote as well that you can easily detect this method with SoftICE:
" b2 j/ C+ o5 D4 F' w9 w; r# ` bpx Get_DDB if ax==0202 || ax==7a5fh
* f( r! w0 S! X/ A1 M y
- h/ k" s. I$ v% m% v) l__________________________________________________________________________
9 G1 G$ J# x5 e U) l" z1 N
, E1 H- w6 p( w; H6 jMethod 10 P$ b, @5 f! J8 A: t {
=========' X% G% u7 z% p0 }: Z
; u; Z2 H; ]9 d7 @7 L) M/ ~
=>Disable or clear breakpoints before using this feature. DO NOT trace with8 n9 S) t: A6 z7 |- Q; U7 J
SoftICE while the option is enable!!2 a& A0 P' @; n6 ]
$ t6 p- Y% z* I' O* j) a; DThis trick is very efficient:
' L% {3 A( Z$ W! B4 [) }# Hby checking the Debug Registers, you can detect if SoftICE is loaded5 q7 f6 j; d3 w' m( u
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 _: Q6 C: U7 z/ ~: _" M
there are some memory breakpoints set (dr0 to dr3) simply by reading their% ]9 E6 T6 M4 M5 k' m& e' M ]
value (in ring0 only). Values can be manipulated and or changed as well. s7 G/ z' X0 a& ^* U& _& H
(clearing BPMs for instance)
% I; ]7 Y7 n/ f' M' S4 L9 E. p0 ?/ O. O- L. M; B! N) M% o3 Y. A8 e( \: l
__________________________________________________________________________* W+ M5 a( |! h: i8 j3 i8 g
' M4 ~! F" R8 `* N0 sMethod 11+ O% k+ }4 I- v
=========5 _( Y( Y8 G ]" g: D* h
- l) w+ s% y6 t8 G5 OThis method is most known as 'MeltICE' because it has been freely distributed
% D1 x6 U$ r. o2 Mvia www.winfiles.com. However it was first used by NuMega people to allow
& s8 K5 M; U. Y" j; Q8 VSymbol Loader to check if SoftICE was active or not (the code is located
2 \5 B9 n v! L0 ~0 minside nmtrans.dll).6 M/ L' D$ h; _3 w, d0 @0 q
' h0 N- d- w8 x& K4 E+ K+ C* a1 UThe way it works is very simple:
; F" R# c6 L- g( w. Y. d6 AIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! ^5 R' ~5 }, E' Y+ X7 Y$ M! Q7 C
WinNT) with the CreateFileA API.
* t( c% _6 N8 ~8 _2 e
8 s7 W" C9 h8 \* ^, z4 ^Here is a sample (checking for 'SICE'):
+ X9 a# l5 [ C/ y
0 G# z: c$ w7 [2 g" [; W" tBOOL IsSoftIce95Loaded()
. U2 H5 }; ]) S8 o+ f8 q{2 N, k- ~2 c! b- H7 J R2 Q
HANDLE hFile;
1 ]/ ?( q; ~9 x$ C hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
- t k. M5 l5 y6 R$ N7 d+ H. l+ r FILE_SHARE_READ | FILE_SHARE_WRITE,
5 C% d' Z4 ~! D0 }) Z1 q3 o' }& L NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 S1 k; S G5 Y0 p1 E. O
if( hFile != INVALID_HANDLE_VALUE )
! w8 w) `) R3 [$ Z, h' r {! \) Y, d! Z9 u- q) Q0 H5 G
CloseHandle(hFile);' Q; Z$ n, l+ D8 D# X
return TRUE;
. I1 V) S# `# G+ ]0 F }' B4 H( t7 I: o1 {
return FALSE;* U% i) v/ \! U( E
}; K% i$ }5 \3 T' n" D
" G2 x; n4 v. Q6 M+ i% L P
Although this trick calls the CreateFileA function, don't even expect to be. t6 v. q7 Y8 J
able to intercept it by installing a IFS hook: it will not work, no way!
+ m, r& \% \/ p2 J) EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
* E1 X, Y: P% e6 b4 _+ B7 [, Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) Q" N% P; t, u' S: _" U4 pand then browse the DDB list until it find the VxD and its DDB_Control_Proc
& o+ N, Z( ]% D5 @" A' Nfield.$ n2 f! i. j( a" T# l2 R) J8 P
In fact, its purpose is not to load/unload VxDs but only to send a
9 D' L' ^' Y5 K. V* I4 J% {( OW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)+ f) p L* p8 Y. [8 D8 j( w7 N
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 h" B, Z v* }6 n" f$ p2 l" w: h6 Q
to load/unload a non-dynamically loadable driver such as SoftICE ;-).9 l! G( e: b, V1 B3 i. i
If the VxD is loaded, it will always clear eax and the Carry flag to allow
; c* u3 K6 j9 eits handle to be opened and then, will be detected.
$ ]$ m; \" c% m- i8 ?0 q) _; _You can check that simply by hooking Winice.exe control proc entry point4 J: b2 \- h& s H2 y
while running MeltICE. f& x4 n: i% G4 K( y7 K- \# T
: \6 K2 S5 ]* A7 N
' j" `. b: Z' n 00401067: push 00402025 ; \\.\SICE2 [ }# ?/ ~. h8 x! U, y0 ~
0040106C: call CreateFileA
. |; c2 ^+ @' a5 U; ?! y: _4 y4 ? 00401071: cmp eax,-001" ^: C5 ^" }- ^) U% Q7 z) S
00401074: je 00401091
+ A+ y% l" E, n! d0 l8 T: I( K6 `" P7 j6 F' J; E2 s
7 l$ x$ S. y5 M4 ~There could be hundreds of BPX you could use to detect this trick.
% C, X( S8 _! I! L-The most classical one is:
6 p3 k/ t4 t* N) H BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
( y1 s. g- e5 Z @( z1 c7 M& B+ A *(esp->4+4)=='NTIC'2 M/ l& a% E) Y v1 P( k
( {& g* ]8 z$ |-The most exotic ones (could be very slooooow :-(2 N9 z* m1 `6 a" d+ _2 x- p7 U7 k4 o
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 H( W% u- f) j0 P2 O9 | ;will break 3 times :-(
6 B! W' R) v' A0 x$ e* g( o: g" J- K
-or (a bit) faster:
. M$ |# n$ Q% S/ [/ H2 {4 Q: W BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 n* \( U$ c# g7 Q! d* g
) K/ Q0 z+ y- \) h" P: p BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) f' O" h, q$ N m7 n% J ;will break 3 times :-(+ }. \6 J0 d: @$ y" [2 |! B) ^
2 y4 d6 F/ `1 a. v# C- |# v-Much faster:
) N5 u% W; m7 ?. E BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
- F& C+ T4 ^* b0 D& i
: f* R+ E1 ~5 t* I) [Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ v' L1 n+ F! |4 X# Gfunction to do the same job:7 {3 {* F* d# \) @
! O' d1 v0 y& ]/ T1 C( E
push 00 ; OF_READ* g5 C2 c3 p! Q+ J" K. ]' P
mov eax,[00656634] ; '\\.\SICE',0. X* v* Z0 f* \; d
push eax( W& l% B( Z" a' u
call KERNEL32!_lopen' ~4 L" Z- r e% p; F
inc eax: A9 e' H: I+ R- X# }$ i+ K
jnz 00650589 ; detected' t9 b1 T% u* h& X
push 00 ; OF_READ& |! N" x: \ o* s9 d
mov eax,[00656638] ; '\\.\SICE'
. ]* D. [; g* K" R. U h push eax: t: g* E/ S) z( O) W ~2 z0 ?( |
call KERNEL32!_lopen0 ]+ B8 Y& J3 B) y- k
inc eax
& C0 O1 P- Z4 Z" v% y8 }. }- x jz 006505ae ; not detected
; ]) k' u- [8 H5 R1 b) R3 n' n
1 S+ g% o' e" F; m4 G+ h9 K6 R
3 ~9 k5 u. N2 P* l__________________________________________________________________________
5 J" E& G I6 s; X% y0 y- v$ N5 t; H x. [
Method 12
% P5 @% g0 {8 }, Q1 ]=========0 O4 w9 Q# L5 X8 b) f/ A
, c+ V7 O5 s5 f9 j. r; @2 S
This trick is similar to int41h/4fh Debugger installation check (code 05
3 [' G4 V2 s5 E( o& 06) but very limited because it's only available for Win95/98 (not NT)8 _8 p2 I! Q- x/ f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 Y, q! Z/ d( b4 Y$ ~
$ P9 [% L* M0 _1 c
push 0000004fh ; function 4fh
2 K* Q/ J' F: c; q push 002a002ah ; high word specifies which VxD (VWIN32)
0 K* q7 T8 a; M* s% e9 b3 e ; low word specifies which service0 w; ^& M7 k3 ]/ [
(VWIN32_Int41Dispatch)
: m# \0 e: f2 G- P; K4 a call Kernel32!ORD_001 ; VxdCall& C2 r/ w# ^$ n2 d0 V: x' X
cmp ax, 0f386h ; magic number returned by system debuggers
! f6 O R+ Z( a( @5 [3 L jz SoftICE_detected
' a0 o8 c& ~& j
2 ?) P/ j3 S/ Z5 q. X. a" l/ v$ hHere again, several ways to detect it:0 Y! Q. \& C! h8 N' f, d
0 A4 u1 ^' O/ e/ a$ z, T( |8 t" d BPINT 41 if ax==4f6 f4 P& E# F0 l% h o6 C) s' J
5 E( y0 P0 [/ E( }- A% Q$ _ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, M0 u/ q% C$ `8 Z- ]; }
5 @1 a" _9 V1 Y: h9 e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' q, z1 p5 o( J3 ` |3 n1 m, V6 C9 y: E8 u0 d" ]1 f8 A
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
) J2 s) p: ^2 |3 K# R0 A9 @! [4 M7 @& O# U Z; ~
__________________________________________________________________________
3 N- f& { F N; z# v; {% E5 j7 R# ]: e" s
Method 135 i' v, j+ U1 r* `0 P! j
=========
1 o; p; w0 u9 K2 y& x
9 N1 _/ G: Q8 t$ ]0 M' \ | O7 ONot a real method of detection, but a good way to know if SoftICE is
8 q3 \5 v9 D7 V; }( ?! o+ Sinstalled on a computer and to locate its installation directory.: E. L6 {5 m5 \/ E1 J
It is used by few softs which access the following registry keys (usually #2) :0 W1 s! _) C) R
$ }* U6 E6 s) _( x1 u& s& v-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
P# S, a& T' [" s- g$ @\Uninstall\SoftICE
5 L; \, U0 U* G: x5 O-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! ]7 j; O& j$ }9 }! b
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; p+ Z$ M/ L* p2 B3 r+ F! S
\App Paths\Loader32.Exe7 L& _" t. X) y, O) ^1 ^' C' U
# O0 I) A* \4 D1 m2 T& j4 m7 N( w! {+ [( k7 W
Note that some nasty apps could then erase all files from SoftICE directory/ O: I0 a# h' l7 I
(I faced that once :-(# [; D# C- W6 o1 f
6 a9 q7 v$ y/ `. S' \Useful breakpoint to detect it:
9 B5 r6 T+ p- t
0 E! P& N { W9 \) W& t* e: Z BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ e: k" h$ T4 J4 q# S- s9 u; W+ r, m/ s+ G4 w% c$ C
__________________________________________________________________________
3 l, f( n8 x+ j8 ^% B
: c* |: y4 w! X) E( z
; \& Z) S4 @7 E" I$ aMethod 14
9 i; d$ s; c5 B3 Q6 L( e0 I=========2 y# ]3 {& d: {$ U( K
6 h: E$ B8 \4 x, Q8 y8 }
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose+ x. X1 O/ c, Z* r) W0 {
is to determines whether a debugger is running on your system (ring0 only).' s5 M) ]: P7 T
7 S! E# t+ a+ [' ~- D6 u VMMCall Test_Debug_Installed
" n- M+ A$ D6 z5 T4 O je not_installed
& _1 A, Q+ r) f" j/ K+ I
0 ?7 R* p% O# Q XThis service just checks a flag.3 v" s' e' B! d) O8 C
</PRE></TD></TR></TBODY></TABLE> |