<TABLE width=500> {3 h5 O; N; [% F6 u
<TBODY>6 I+ ]0 N7 U9 J; j4 _9 }
<TR>8 s0 y' ^( z, h' [
<TD><PRE>Method 01 ~. K: y k5 `0 w' x
=========
* [% ~! p/ k* O7 H% E- Y' W) H! c) ?1 a- A# v
This method of detection of SoftICE (as well as the following one) is
9 U. C, Y2 Z4 c0 S- D+ s1 jused by the majority of packers/encryptors found on Internet.4 N% y% g! c6 P6 I+ [5 S! d
It seeks the signature of BoundsChecker in SoftICE3 ?! P; k( [" a- V; F5 `
. Z( x3 a/ p' S7 U" @9 f+ F
mov ebp, 04243484Bh ; 'BCHK'+ _3 c8 W0 |! R% F
mov ax, 04h! V- Y7 p9 A' `' L$ J- X/ I/ n) D
int 3 3 r7 m9 F% q+ R3 J- k
cmp al,4
; r0 B: k. S) q4 G w& v jnz SoftICE_Detected& p1 ?+ ?7 C3 o
' E$ I2 l( L% L' R) L8 Y___________________________________________________________________________
" Y9 I4 C, z2 P6 q0 h6 q" W$ v* S; r8 c$ Y7 \. p
Method 02' B2 [- N3 _' h, O4 Y1 V8 W
=========1 [& Y: Y8 G5 W1 G8 W
: d6 \# q3 g3 Q( N aStill a method very much used (perhaps the most frequent one). It is used4 Y5 B3 P) _. I/ y5 h
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,; y7 E3 C9 Z& _: F G" {. a
or execute SoftICE commands...
7 m' d* T# x; IIt is also used to crash SoftICE and to force it to execute any commands, D: {, Z- C% k4 O
(HBOOT...) :-(( & j+ t7 `+ i/ Y1 E3 W
. u" ~ r7 X: s+ w) AHere is a quick description: K. O6 {+ i( p2 w6 W
-AX = 0910h (Display string in SIce windows)* b+ Y5 C8 M1 a$ H* `- E. q
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)) i. B0 ?. g, j2 d! G: @
-AX = 0912h (Get breakpoint infos) p7 D% R( x$ j
-AX = 0913h (Set Sice breakpoints)
' v/ T' ^! Q+ J- r2 u F- @-AX = 0914h (Remove SIce breakoints)
# G8 p6 Q. M* I; ?! K: v2 C+ L' s
Each time you'll meet this trick, you'll see:7 q: v4 Z% l! Q' b( Y8 k, ]
-SI = 4647h& i5 m9 I; F* C* F5 m, q
-DI = 4A4Dh
; h+ n) y, f/ ]7 P' J9 \Which are the 'magic values' used by SoftIce.
$ n6 M" B9 o! Y$ z; bFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( F1 N9 h& q" K! n$ ~, X9 h, f" W' L
Here is one example from the file "Haspinst.exe" which is the dongle HASP
+ h3 D& n( X' ?+ yEnvelope utility use to protect DOS applications:5 D7 M3 T. O0 p
7 y, F O" ~8 h( N W" J* Y
2 C+ O8 z( ~, \. e' A! h
4C19:0095 MOV AX,0911 ; execute command.
$ P i+ `- p! | N: j4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).! D5 ^% S- Q8 D3 V; L* b
4C19:009A MOV SI,4647 ; 1st magic value.
& H* B- O: c# O: A. k5 u4C19:009D MOV DI,4A4D ; 2nd magic value.% r# y; M$ A* C
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
. x+ {: z e r! Z4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute2 P3 X5 o5 a2 o, o) U* O
4C19:00A4 INC CX9 `9 r( {1 Q- S# u
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute% \2 `$ e/ `1 V: a! V
4C19:00A8 JB 0095 ; 6 different commands.+ n1 P6 c1 K; Z: a/ _
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
8 o$ a" s8 n$ R4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- }$ v, Q4 U, k4 A
3 w' H8 y2 T: P# }. L: S U. qThe program will execute 6 different SIce commands located at ds:dx, which/ w8 S! b- O1 j6 {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. b# F) K; m Y7 Z+ k) |# _/ j
% X2 ]% T7 j" d* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ G: M2 c( Z4 f, u: [! a$ D___________________________________________________________________________' `, d% p" O0 J
: ~" y1 _4 E! S2 D
: I8 }: o# r5 x# \. C9 Z$ X" eMethod 03$ j+ H$ K% ^) D$ p
=========
* t' i' Z8 r; A$ a) D. v
' S# n& Y4 x* a/ D/ u& K; gLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h* u1 y0 o5 q# O& A3 t; V2 Q9 L
(API Get entry point)( c( k' d& ~0 f6 `5 z; `% r. r
- Y$ e ]$ k. S$ ~( A7 z# q. \
% ?8 Y7 d5 K Z( u/ [/ T6 M' T& k xor di,di$ w' M$ N. S$ [5 x9 R4 E; g
mov es,di
; ?- p- c4 A$ U+ p mov ax, 1684h 9 L+ N, u5 P" r
mov bx, 0202h ; VxD ID of winice. q5 K# C$ n" f
int 2Fh% s5 u; w0 G7 ]
mov ax, es ; ES:DI -> VxD API entry point
7 O0 q3 x0 G+ G% S8 S f$ M( m/ L add ax, di0 c7 D3 _8 h* |9 B3 A
test ax,ax' e' g s* n4 R- c8 r* g3 j" C
jnz SoftICE_Detected! O7 I# p5 h/ ^+ x( g
* N, m3 w7 t: @___________________________________________________________________________1 U/ r/ \5 F6 O
/ [- `8 C8 M$ k& f* |- UMethod 04
) A3 U# I3 l. G; u$ g=========8 Q/ O' v) G2 i( W
) S/ N2 R* U/ A, d' [, k0 B! x3 E
Method identical to the preceding one except that it seeks the ID of SoftICE
) H, W$ U: w9 M6 F1 gGFX VxD.
' I; j9 m& Q% |, W/ K# T% s G0 ]6 b$ O& k; E8 [ r
xor di,di
& c m( d8 e W# T3 B mov es,di
A* T+ k8 a& C9 ?8 @, o; \" D) q+ o' Y mov ax, 1684h
1 i! ]4 ?0 `6 x+ W( ^ mov bx, 7a5Fh ; VxD ID of SIWVID
+ ~: \: s& A- I0 d, S( ~4 h f int 2fh8 v4 u; N" M% h k( n% \
mov ax, es ; ES:DI -> VxD API entry point
: g. ^8 d0 m R add ax, di0 N3 T, E- r( V4 m& ]( \
test ax,ax
0 \- ^* n Y1 f- ~) C jnz SoftICE_Detected4 S+ N& r3 ^$ z: R; ]* S
8 U$ J7 ?' o. G
__________________________________________________________________________- u/ u+ Y* m1 \" z+ u# k# Z
9 `+ Q8 V) r1 r
% p# d) R, X3 ^9 iMethod 05
1 g; O/ J6 u. c9 `4 x$ l========= S1 q" x/ s: |, N
: `4 T) x- x5 f1 z# P
Method seeking the 'magic number' 0F386h returned (in ax) by all system8 ~) f( r6 d0 V+ P6 I/ A
debugger. It calls the int 41h, function 4Fh.% r) |' F7 B' a9 o
There are several alternatives.
% n2 V. x& Y9 S( C4 w4 Z
/ ` {* h+ f C3 k% R% wThe following one is the simplest:% \1 Q( g* v6 f, r
+ Y" d0 K6 W8 `( l2 l M
mov ax,4fh
, F0 d# k3 G" t int 41h6 i. W5 U# r5 [4 I- I1 C4 S
cmp ax, 0F386
# |/ @; y' d* I0 ~' \! Z jz SoftICE_detected' I f$ B' G( ^* g
' y' ?4 C6 ^8 j
5 E. n& y, G7 e! J- e+ x# l
Next method as well as the following one are 2 examples from Stone's
3 H1 Y0 Z8 D' y8 d' ]"stn-wid.zip" (www.cracking.net):
2 O# R# Z; z1 V7 f/ x0 G$ f
: y1 z7 n% g* Y5 J2 @% d) t mov bx, cs
+ @; y! T" ]4 S; K/ ~. p; D% e& {) y lea dx, int41handler2
1 x! G& ?; ^$ z; K$ P" }' a xchg dx, es:[41h*4]
( v7 C# N, `( q* d% F xchg bx, es:[41h*4+2]# g7 w8 ^5 |0 R/ E0 U) |1 b5 h$ X
mov ax,4fh
5 x0 _3 [# @2 q: B- Z% V+ _4 @) L% h) @ int 41h8 u& ~; x, ]7 s- z. E p7 i; j! U
xchg dx, es:[41h*4]& \4 k3 U% Y) a- B' n) C
xchg bx, es:[41h*4+2]% s" N! P! f6 b; s
cmp ax, 0f386h
( i* D9 G7 v T3 H jz SoftICE_detected8 p( _! F* I+ [- T& U, y& h
( F% T* l5 `# a! z1 e+ `2 uint41handler2 PROC# Y0 B4 ^* j9 e4 \% |
iret
0 r) ~0 `6 `! ]; Bint41handler2 ENDP+ M _' O# t7 b7 H* M" F) W+ x3 @
8 C) u$ k$ [' u" H/ e) W9 x: G: ~' n- C7 Y s( k
_________________________________________________________________________
. U! G7 a. ]2 L0 f2 \8 ~5 {' i- m
% u) {7 |% p, c" `
, j5 Y; H4 l3 C$ j! u4 ^" |- E9 o: NMethod 06% T: q/ ]) A! b/ {4 J" g/ o8 l
=========
" m' ~# ~0 w" c# }4 \# I1 D
, V2 {# v2 @* u9 G
) t$ U5 T |" l. c" U2nd method similar to the preceding one but more difficult to detect:% @. t( P3 s8 s' L5 l, E4 v
4 i2 }1 s4 i# O% U( T% \, _& {5 ~& R! v7 O% c
int41handler PROC
& b2 q& H' y$ f/ I- x4 R: h mov cl,al
3 J% L5 d9 [7 H3 h iret
4 O1 r0 y( r& @5 V1 oint41handler ENDP# R# X# x; z' F( r
' T, C" h$ c, X5 L7 Q# n' w' v: r
xor ax,ax8 s- r* [: {+ K/ |* L9 r
mov es,ax7 j: O* t* [0 } H, N5 G
mov bx, cs
& p3 Q. i9 }6 T. C, Y+ @ lea dx, int41handler
, D m V) ^3 ?4 V+ L9 U) X4 g xchg dx, es:[41h*4]' G0 q# v9 h# r* E2 w& n9 A% f% c- x
xchg bx, es:[41h*4+2]6 V! Q$ |: I7 p% U# M' g( k
in al, 40h
2 u% `0 C" B; d: |; @5 m" q xor cx,cx% C5 w, N1 w$ E) z5 I. a. ^
int 41h
5 n& ]/ q2 t8 V: O# E) k xchg dx, es:[41h*4]2 a5 J% v8 Y% P
xchg bx, es:[41h*4+2]% ^6 q. Q8 O" W9 @0 H$ z
cmp cl,al
( a- \# {4 v9 U( l/ C% k jnz SoftICE_detected
% a& {) B: e1 S( T, K" E% `9 I2 b4 q% z& h5 V& @* A
_________________________________________________________________________: Y2 W1 Q- I5 M
9 D3 u, f6 s# W# Y; n* N6 o- b- CMethod 07
; u" X6 ^$ O9 v# E7 m) C=========
( t2 t8 F+ F5 I1 X7 F! ^% ^! ~0 E
. ^/ z3 ~# V8 r& gMethod of detection of the WinICE handler in the int68h (V86)
( C* t9 y! V' l6 O R- Q: l
: N+ z n7 k U* `1 L9 g/ t mov ah,43h8 O0 ] K" m8 t9 }( i
int 68h( A. J. w& b5 N& i3 K5 d6 k
cmp ax,0F386h9 Y: i d7 i- C1 m6 J
jz SoftICE_Detected
: k% ~2 g8 [9 u) V8 g. ?3 Y! d( b, V6 K/ q8 O* m! G8 r
7 w$ B5 ~9 {6 p6 ~3 z: _
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
' e/ T4 B! ^; J% K: r app like this:
" v9 {# l9 ^7 e0 y) X* E5 p. E' l" J. m; s( q
BPX exec_int if ax==68) H5 e T+ _" v" ]# q
(function called is located at byte ptr [ebp+1Dh] and client eip is/ x2 e D5 F$ K6 z7 [+ p, f1 ?
located at [ebp+48h] for 32Bit apps); l9 P/ h5 d# X$ z3 m* q0 y
__________________________________________________________________________; s3 b3 F7 @4 L& C5 |; M, B
! T& z4 C5 i9 s! T" F) ]( j
. X. z5 g( ^0 f* Y' YMethod 08/ c" Y. K: o- @7 l! o6 h' K. ^) E
=========: y9 d- g/ B5 P8 [
8 T+ U1 {% o RIt is not a method of detection of SoftICE but a possibility to crash the
4 Q; s' Q5 d; U2 Y4 {4 ~ B* Hsystem by intercepting int 01h and int 03h and redirecting them to another$ G& C/ K$ f5 K: d; z8 d0 W" B# F/ p. R
routine.$ E, J, S+ H2 }4 ]# V2 r5 s/ r I# Q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" d$ c) Q" T; M- p* a
to the new routine to execute (hangs computer...); g2 O6 t7 ` i$ l+ H) k" x( {# s
$ Q: x& i, R- O mov ah, 25h n$ R, }/ S: r
mov al, Int_Number (01h or 03h)( E1 n z, x- N9 K
mov dx, offset New_Int_Routine6 w0 O: q2 ]# L# r9 y& r: _
int 21h+ {0 A. m! g7 z3 U9 C
: W1 N! ]/ C+ J
__________________________________________________________________________
( G7 S# r B: _. F1 J
4 C. `/ E- h5 {! o5 cMethod 094 G Z2 o0 D o7 }2 X4 E3 d
=========
2 @9 W( K5 Q! Y. T3 O! a: o y# Y7 R K* b: R. u9 i& ~& K( V a
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
- q0 j2 ~1 n( ]performed in ring0 (VxD or a ring3 app using the VxdCall).
& ~6 ]. `; ^$ F! z) q' }The Get_DDB service is used to determine whether or not a VxD is installed
% S% K3 ^# } h9 h/ U/ a6 [5 O* ?for the specified device and returns a Device Description Block (in ecx) for
7 \7 Y' I! Z) ~7 z, lthat device if it is installed.; m3 h- t! m4 U
; [1 Q! p f, g2 M9 J8 w4 m
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, I& t( j' X+ K- m1 W3 _8 R6 i$ w' v% u mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 Q+ L* z' ~$ J# P VMMCall Get_DDB
$ \- }: T+ y7 `5 t. S mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
3 r6 l7 H) Z5 p- [& H9 x2 G7 r& |* D9 J
1 m7 I Y: [& fNote as well that you can easily detect this method with SoftICE:0 n! h8 x* c0 j* p
bpx Get_DDB if ax==0202 || ax==7a5fh
$ x6 F0 `$ W5 ~+ i7 B9 Q, L( U2 h% g
__________________________________________________________________________
* Z; O" d) i' D2 x; k9 s4 l
4 m# u% Z, |% j( b, Y2 VMethod 10' q% f$ i" Z0 D- S8 b
=========
, O: t5 |( [& c4 z0 C) b* g* M2 E, _9 f- E. ]1 _0 F; f
=>Disable or clear breakpoints before using this feature. DO NOT trace with
# C3 r) n. l" C* o SoftICE while the option is enable!!5 t" O7 m6 n" J1 S1 n* o) d$ Z1 a
+ _# i2 b5 n6 l1 a: i8 z* I
This trick is very efficient:
6 a; P5 w& m6 g4 X2 A: Gby checking the Debug Registers, you can detect if SoftICE is loaded
( X) E- Z7 s! j8 N& T(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
5 R3 N: Q+ [! E. n; q3 \+ q4 pthere are some memory breakpoints set (dr0 to dr3) simply by reading their
, t! l+ c3 J5 Uvalue (in ring0 only). Values can be manipulated and or changed as well
1 U" M& Z( ?- z( V8 B3 }(clearing BPMs for instance)4 \+ c! x) Q1 [3 e) }6 z4 l
! v Q7 N0 e* f/ p, r7 W__________________________________________________________________________
7 m: t: x8 _# d; I" n+ i& r& k _/ Q% m& D! m) G- k
Method 11
6 ?# S+ e7 Q' O) b3 p9 e2 D# e0 C=========
, p% t$ j* p5 V6 g6 i/ F
$ X+ o$ x$ d( y+ a3 |This method is most known as 'MeltICE' because it has been freely distributed
7 ? P/ \4 h; R4 M9 Jvia www.winfiles.com. However it was first used by NuMega people to allow/ x7 f% F/ o8 X# w( j
Symbol Loader to check if SoftICE was active or not (the code is located7 x6 x& k6 b! f9 t' B
inside nmtrans.dll).; B; o ], z8 a8 ^3 l" Q
; }8 ~' @2 D+ `) x5 _: ]The way it works is very simple:
2 ]* h, H/ P; p/ Z% A$ B/ Y; lIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) x! w+ Z1 w. [" c3 B
WinNT) with the CreateFileA API.+ Y0 \7 ]+ q; _3 _+ S8 [
- l9 D& w- h" V5 w f" wHere is a sample (checking for 'SICE'):
! s: w, y9 ?/ E z7 Z( d& i- @3 c, N# d4 I. W& {
BOOL IsSoftIce95Loaded()7 R6 k8 ]/ G5 p0 m( W$ U# H: ?
{
2 x8 P' Z' o6 }( `; H8 N HANDLE hFile; 0 K& Y0 ~4 j/ G
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( W1 j8 S9 H8 Q% g
FILE_SHARE_READ | FILE_SHARE_WRITE,
8 }' f: Z& C5 a. b* G0 V NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# t" t8 R9 Z: |2 u7 m- E
if( hFile != INVALID_HANDLE_VALUE )4 }( M2 q/ ^; Q. D9 u& p
{9 P: c+ h1 R4 K# _
CloseHandle(hFile);
. z/ e8 Y& x5 U$ J2 @4 W return TRUE;4 t% z& l. j( N- U- m( Y4 e: c
}
; P: v& @) m5 j& P" h" S2 R return FALSE;/ h8 q8 E. e/ Z, i
}
* a |2 J7 O: Z' A8 ~
) I4 h- e& b9 e' H: RAlthough this trick calls the CreateFileA function, don't even expect to be
; [# n* l- g, q' \! n. x1 C, Kable to intercept it by installing a IFS hook: it will not work, no way!; X; k0 {% `6 |
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
) O. @2 M- O8 F1 `# Cservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); V, w( _1 I* L( L8 Z
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, g7 n0 _5 }8 @; z) h3 n# t' [9 Bfield.6 l8 g+ p" @' U
In fact, its purpose is not to load/unload VxDs but only to send a $ i4 o: T7 S7 f% S
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
# L) }# t& p' L& }7 A1 |; vto the VxD Control_Dispatch proc (how the hell a shareware soft could try
8 B$ W0 ^# ~! M: J: ], a. T) hto load/unload a non-dynamically loadable driver such as SoftICE ;-).* V4 X4 l5 h( i
If the VxD is loaded, it will always clear eax and the Carry flag to allow E# D* Y. C f `
its handle to be opened and then, will be detected.
2 c$ F0 M. l4 |4 pYou can check that simply by hooking Winice.exe control proc entry point
0 B. K3 V0 \; e% swhile running MeltICE.
# A& p9 Z4 | g$ U& h) s0 i5 U' A9 }; ]# i
- T/ z5 \1 v0 A 00401067: push 00402025 ; \\.\SICE
" d" e, p t) X' r! H9 ? 0040106C: call CreateFileA
9 j: e8 g5 t. s# Q1 E7 ` 00401071: cmp eax,-001& ^6 ~4 y4 C8 O! y+ M, Y
00401074: je 00401091
" v! r, @' q9 m% k r+ j3 K
, [0 U5 t* m6 X/ m2 K
! a) s6 |+ H, A& K* A7 fThere could be hundreds of BPX you could use to detect this trick.
- x) u( @! r6 p) M-The most classical one is:) [* j$ q- @: B9 E; B
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ ]+ k1 k: c g' t; J. f5 l *(esp->4+4)=='NTIC'
: Y: Y" \0 C( g5 V1 F' Y/ @9 ]3 s) A. |, I6 H9 ?8 N
-The most exotic ones (could be very slooooow :-(5 ]. D( ?# s& ?0 E! y2 \
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
) a) u3 g8 i0 }4 V1 i0 [ ;will break 3 times :-(5 T0 s# n7 a0 g n6 L. R
' `' y1 j/ v- q5 s/ c6 @
-or (a bit) faster: % g% b+ a/ ^/ b8 w! G0 G
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! U! ~& t5 m U- v
) b5 M/ Q# c( c8 ~ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ! G7 g% D, F/ v6 y8 I% h7 _
;will break 3 times :-(+ Q9 t6 v: M {, _, \8 Q" p1 T
* M7 z' d9 N- k9 H0 v- X; \+ S-Much faster:
4 Z# A9 c0 F- x+ \ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
+ j {9 V; i) q" `4 a+ x8 F: w. U- G! [# s
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
b1 f& c: O2 r% ofunction to do the same job:
! |: `3 A6 a" X8 u) @0 H
0 D# W$ e& f" M push 00 ; OF_READ/ |4 u; A* v) z4 y) _' l8 c0 W
mov eax,[00656634] ; '\\.\SICE',0& O: r1 O, q% o+ T) h
push eax. C' `4 V1 `7 ^4 n8 a
call KERNEL32!_lopen/ }3 k0 P9 o4 p2 U8 F$ @
inc eax6 g4 `& z" {! \
jnz 00650589 ; detected3 R) d" @( _8 T& { W b
push 00 ; OF_READ8 h* f4 m. z, K3 S R7 I
mov eax,[00656638] ; '\\.\SICE'" R+ y: l# t7 u' F* M) P
push eax
0 H7 r$ Y7 A. ?) y3 k call KERNEL32!_lopen
% {. e: v) l4 e4 Z/ N: u) b# ] D inc eax
8 m/ v! v' n* ]/ u" F jz 006505ae ; not detected, ~+ ]+ [: e; i/ i3 f' W
& l4 b3 ~3 V, h2 t8 Y7 W9 U' I$ q. @1 k
__________________________________________________________________________
' M- f) J1 m+ A/ ~1 D9 y$ l# Q
! d/ g$ m6 c* w( z4 c! b4 vMethod 125 J% H, t& g: R2 E; ^
=========/ `2 Q* A: N U" ^8 \4 F' |
3 Y( ]8 m- U& \, A2 cThis trick is similar to int41h/4fh Debugger installation check (code 05
/ E: t! u+ i& Y4 Z3 m& 06) but very limited because it's only available for Win95/98 (not NT)
4 P6 ]( n, b/ {as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 v8 q+ z, _$ i& o( D2 p x$ y$ k! ? U: \ g" v$ v+ g
push 0000004fh ; function 4fh B; c3 e0 {( A/ {9 }% e( y. ^ l
push 002a002ah ; high word specifies which VxD (VWIN32)4 f8 `2 g {. ^4 U
; low word specifies which service0 C P2 f5 T: o7 y- G1 @9 E1 Y
(VWIN32_Int41Dispatch)
7 h/ F4 D4 Z- Q9 B v9 | call Kernel32!ORD_001 ; VxdCall1 v: r7 ^* D( N1 R8 B) @
cmp ax, 0f386h ; magic number returned by system debuggers" f9 Q3 v( `1 I! L' d; r1 A
jz SoftICE_detected
3 l8 x3 ~9 E! c7 A$ _" ?
' m: }+ Y$ \; P4 THere again, several ways to detect it:
) w1 `1 w( S3 J. ?- @6 [; Z, u, B8 T- r2 W$ a5 o* E D+ c
BPINT 41 if ax==4f0 }+ g9 |8 I' @6 m
0 B& G* k( X( l0 y7 a BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
/ n' e% Z L n% O) e' u
1 g$ @; q4 K/ E3 m) H$ B2 D2 X BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ g2 ?3 ]8 p7 w* v
) h! H6 d7 l. J% Y% o5 a BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! I$ w7 d# G0 @7 |& s5 \ W3 M/ i2 I- y, F) h8 N+ M1 k! p9 X, U+ S
__________________________________________________________________________
# C% a8 K) e1 o1 W f9 i
/ F8 w3 k1 A6 S8 v! Z' D! IMethod 13) n! p$ _( z8 O- g( f
=========1 T, r8 y. A0 j
- B0 P( N. _, P* H
Not a real method of detection, but a good way to know if SoftICE is
& L' {# K* g9 rinstalled on a computer and to locate its installation directory.
9 R) L' ]' D$ v" Q2 C9 ~ jIt is used by few softs which access the following registry keys (usually #2) :/ {+ K" ^3 a# m) F
" d# ~' a6 f5 |: P
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 Z$ m: \# u' ?1 {$ j) P# W
\Uninstall\SoftICE) ~. N4 u7 G, B9 p
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 |; x0 A$ z; j! @/ b8 F
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 d0 _. d U9 _! L0 l/ F
\App Paths\Loader32.Exe
1 U, Q! | R' q. [( X/ N
: X- I/ F4 E) T. H% t
. j& j+ e4 a2 e+ h8 t2 fNote that some nasty apps could then erase all files from SoftICE directory Y) Z/ i8 d- C; @3 D9 g) {
(I faced that once :-(
2 U; T" i: p: r! G3 ^/ S
( v1 N3 l& k1 A& q3 ~Useful breakpoint to detect it:
6 _. s# ^, f3 ~+ k6 O
8 I" _2 A/ w% X6 T9 V# C BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE': \5 B G+ @& T5 ~8 ^
1 d+ H. k7 M7 J M% D
__________________________________________________________________________
! I5 U! e- a+ l; M; J& i! }' Q: |+ m: @$ j7 U$ v: z7 Y
2 u/ a6 [$ y, ?$ R- \Method 14 ! W$ W0 l5 j6 h$ z8 J. g* n
=========
- z) E# l3 E5 `3 M
- V: ]6 l% I; ]% z3 O* YA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
; Y; g8 `3 L% X0 [' d% P1 T! t9 Nis to determines whether a debugger is running on your system (ring0 only).1 U3 O# E3 }- j
: A: R' B v( ~, V- b4 w VMMCall Test_Debug_Installed; p, H2 E0 y/ s5 U
je not_installed
$ c3 O' r* d. E. \
( D: e3 ~5 X* p$ O9 C( IThis service just checks a flag.2 H, k+ L. u3 S1 Z- U" }5 ]. Z
</PRE></TD></TR></TBODY></TABLE> |