<TABLE width=500>( F$ U- F! c V7 w, n# v
<TBODY>4 [" L3 \! t* @% L
<TR>
, T) ~- S# ^8 m<TD><PRE>Method 01
0 K/ ~# G4 }3 v* J( C=========5 D% \. U( {2 A& u0 G" Y$ q
/ O }( Y9 I% b V* Z
This method of detection of SoftICE (as well as the following one) is+ B* `* _8 ]/ z' a% |& V
used by the majority of packers/encryptors found on Internet.6 C R8 _, f5 Z" `. P) W$ `
It seeks the signature of BoundsChecker in SoftICE- R& d( g% y: d- e
( y7 M1 y7 d Y5 h
mov ebp, 04243484Bh ; 'BCHK'# _: E" O: E$ D0 k2 F6 b+ g
mov ax, 04h) z! r- x: h' F; n; J2 J7 L
int 3 # Q' p5 c$ Q' _# I$ p/ `
cmp al,4
/ k6 t! m) e1 N5 J& p/ f jnz SoftICE_Detected
) J# }& ] n% \& A u; z" B' F7 n9 x) m$ c2 y l1 `3 L# Q3 p
___________________________________________________________________________
1 _* f0 @ E% X. B+ s
# e$ g# J: ]# j3 ` `. N, M. K- OMethod 02. t4 {" D6 V. Q2 r8 m1 A" J
=========
& M7 ^4 e3 v" C1 }' Y% C$ J
' ]3 C4 t) ]- y/ RStill a method very much used (perhaps the most frequent one). It is used
5 j# B1 R: L7 I) t9 T# C8 }1 Rto get SoftICE 'Back Door commands' which gives infos on Breakpoints, t4 {! e: B) V( |) [# w
or execute SoftICE commands...6 t5 x( Y& x& ?% o+ X0 j' j2 M
It is also used to crash SoftICE and to force it to execute any commands- i6 e) K/ c4 o, @! t
(HBOOT...) :-((
5 }( m* D4 a( o$ _0 u6 \- @; u- M6 p" w3 [0 p8 p7 g
Here is a quick description:
# K8 Y2 B3 u$ D9 g$ }5 m A h-AX = 0910h (Display string in SIce windows)
2 Z# G/ h' Z" d-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
R/ `6 o' z, v) D-AX = 0912h (Get breakpoint infos)
! Y0 P5 x3 f& k( ~8 s$ [-AX = 0913h (Set Sice breakpoints)
) h/ w, _4 E, Y( N, s# b-AX = 0914h (Remove SIce breakoints)
7 p& p$ z) S/ N
[$ I9 ` } `. B7 ZEach time you'll meet this trick, you'll see:3 V: j* q' v/ R1 ~1 Y& n ]1 r
-SI = 4647h
8 C0 V$ ?" j" h( q. U$ ]5 s-DI = 4A4Dh8 j' Q! s, r1 F
Which are the 'magic values' used by SoftIce.1 Q$ h/ D: C6 @3 F' k P5 {
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 f) T3 W% O9 o7 ~
3 t. G6 K2 f/ p$ {9 F; r- K$ s
Here is one example from the file "Haspinst.exe" which is the dongle HASP5 `& f- \9 [" {" t0 W
Envelope utility use to protect DOS applications:! U7 a) I! i7 N' B6 \- J3 k
9 t# Z i) p. b* |+ N
! q8 H' h! d/ c" K
4C19:0095 MOV AX,0911 ; execute command.
7 f. u5 M7 [8 d g7 ~) r8 `4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
: ^! r- [! G2 Z4 A2 _4C19:009A MOV SI,4647 ; 1st magic value.
- o6 [4 W: ~, u6 _4C19:009D MOV DI,4A4D ; 2nd magic value.4 X/ @: `) H$ s
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
& M6 [ E8 m4 q* j5 V" I4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& D$ [/ {( P' G: d# P8 i$ v3 h4 I4C19:00A4 INC CX
$ ^ C! J8 i- N. a/ u1 m4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
+ Z& L. G- O4 `4 x! G- x, s4C19:00A8 JB 0095 ; 6 different commands.
# @8 ~+ E; N! V, X+ f4C19:00AA JMP 0002 ; Bad_Guy jmp back., p6 G. S, T) Z- S6 z$ W
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# a: m+ v- z% r6 B2 Y5 Y1 f, h/ N9 s$ L. @
The program will execute 6 different SIce commands located at ds:dx, which
V2 x! H& J: I' ]0 j8 y4 p' M6 zare: LDT, IDT, GDT, TSS, RS, and ...HBOOT. r/ u9 x* Q6 @( d
. Q A* N8 x6 o. P& }3 T1 `' I, G* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., j9 J. s3 G/ I. I K; J
___________________________________________________________________________3 }: S8 `- ~/ J- h% n! |9 I0 o
9 U& N! @6 d* F6 _
( v3 g9 b0 L$ c' a8 M# FMethod 03
3 D, E& J# u- ?( s=========( P0 c1 J2 E1 p, ~# h9 R, Q
\& b* {" V' F) y
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
1 t" z U" R% P' X' _3 n% n% l A(API Get entry point); l8 s. n6 P2 j. d* u; V
; y: p0 I5 K3 H9 ~5 k/ Q6 h, t# i
, C+ [4 q8 `& B+ b% d: U" }
xor di,di
4 G) x. ~2 F, l* S$ ?. z mov es,di- e+ r, r! S3 K4 G
mov ax, 1684h
1 f# @5 a Q8 i) x mov bx, 0202h ; VxD ID of winice. S) D4 p5 R1 ]- _3 N' ?
int 2Fh* t! q7 f6 C( C p2 k- H
mov ax, es ; ES:DI -> VxD API entry point2 \' B6 J% [/ f6 A, B. j2 `
add ax, di
" q0 Q: ]1 l1 F test ax,ax
; ]/ X1 N/ E, N6 P! N1 f9 c jnz SoftICE_Detected7 l( T& z* V) y+ D
/ F7 C5 w2 O8 D$ z5 s; G! h, [___________________________________________________________________________) o+ A6 L& }$ n: b- d: L
7 T+ ~2 h' q7 X/ [6 Z: L
Method 04! d! k& `0 n X) r- p. E, Y2 |
=========" D' [1 n( `0 y- F
: S+ b! X( D% p8 ]# DMethod identical to the preceding one except that it seeks the ID of SoftICE
X6 ]2 G/ q2 K0 E: V. H# Q5 cGFX VxD.
k v+ ^0 k! h5 j
7 l. t+ d/ }' C/ N/ L xor di,di1 i) s2 ?5 \% F+ H9 D2 j
mov es,di/ H; y3 O1 v) G& a/ V
mov ax, 1684h ( `! m9 E) g- y4 D- V0 {7 Q
mov bx, 7a5Fh ; VxD ID of SIWVID% t9 C% Z% d* ~3 ^# ]
int 2fh( ^, O! b* G* y* U+ k
mov ax, es ; ES:DI -> VxD API entry point
3 }6 \! I% N* l add ax, di. K) f! d# {8 y1 O
test ax,ax
$ u4 u, U) ~9 n1 l$ t jnz SoftICE_Detected
4 \+ ]/ d; q6 j+ r8 i& h' i1 ^7 v6 ?( t3 v" ?5 g/ X' A6 c2 {
__________________________________________________________________________
; c! _" v7 ]) x) u8 l0 K8 X( k( Q1 X ~) Z
2 t2 h( ^& ^3 Y5 n9 b: z4 k
Method 05
, F, Z# f4 b! p=========+ P+ q4 p4 X z( B: d' q' F7 q
- z2 C& g+ }6 l! Q: A1 O% g
Method seeking the 'magic number' 0F386h returned (in ax) by all system
5 X m7 ^: i- U4 Ldebugger. It calls the int 41h, function 4Fh., n: ^- E: F7 n
There are several alternatives. 9 V7 K0 m, K% U5 i
' p3 h1 R& f9 `" u/ o: @5 \
The following one is the simplest:0 C; @0 B' ^" ^6 S- w0 _$ K. G" k$ v# Z
! A+ B* q# z$ \+ I$ ?3 ` mov ax,4fh
' k, F3 T' s K$ f0 ~( S/ n; H; e int 41h, r* |3 N! i% |; Y4 W9 a
cmp ax, 0F386; | S4 y8 f+ F4 U; Y
jz SoftICE_detected
i7 e8 Z" K3 [- A7 g9 O" l5 i8 t# ~8 i5 B
& @1 c+ E- t3 v; o4 a- SNext method as well as the following one are 2 examples from Stone's
5 h+ Y% ]4 @3 T% G; q1 x"stn-wid.zip" (www.cracking.net):
) W, M% h- `( b: Z% u* N/ ]8 |, C N7 ]: e4 ^
mov bx, cs2 r; l) e6 X( D) x' @
lea dx, int41handler2
9 @! R- w! l' W! B2 e( G8 Q xchg dx, es:[41h*4]( L/ A1 x# b0 n' A3 M, l
xchg bx, es:[41h*4+2]! J! ?- m' }1 k8 Q1 E. G
mov ax,4fh
0 b0 V. X/ Z1 W int 41h" t9 Q9 r* L4 w' |6 x% b. G
xchg dx, es:[41h*4]
0 D* ^1 l. y( x* `! V xchg bx, es:[41h*4+2]
+ L. J$ b& t3 P+ l8 t& }# d cmp ax, 0f386h
; s' z6 r5 N! h4 [( c jz SoftICE_detected, X7 I- W1 B9 Z0 ^. ]! a
" Y5 z0 @0 [( W6 z4 ^, p3 tint41handler2 PROC7 f4 q4 x0 O# e& l3 m; J
iret+ x$ [- ?* y% x2 o1 p
int41handler2 ENDP+ m) D! g; j2 H+ m
6 X0 `# M! I2 f+ Z6 F7 t, `/ C1 K
* {0 o" Q0 [; w( d) P_________________________________________________________________________
* J, g. H+ X8 l' b$ M
$ `( y, @0 `- e0 H/ ?
% {" }. Y5 Y* H. Q6 |! jMethod 06: H* l5 q! q8 G7 S
=========
& L4 {$ _3 j# E4 T, L& x: i- C y4 H& o9 L7 C/ f- ?* v; \
# N% B9 O; u* n7 T. l& e4 m
2nd method similar to the preceding one but more difficult to detect:
! q" q* p# T! T( |7 B4 ]! K+ s6 z; F& s$ K2 T
0 A8 q( ^7 b6 j8 }" j2 ?6 X$ Aint41handler PROC
. \, F/ t8 \8 l7 u2 W: i mov cl,al# \5 C, T! C+ I& e
iret
3 e2 _6 V& P% j8 C5 _4 _' Dint41handler ENDP. g/ m4 p0 s- I: d
# T# c6 G, ]$ W# Y" b5 V% G6 @& f' M% b
xor ax,ax
5 M' I! V* r$ x) O mov es,ax( s$ _5 M% T0 r6 @0 V( e! U
mov bx, cs
2 K- k- a3 D: O4 ^( ^ \ L2 Z lea dx, int41handler
! _+ `0 }: ^6 F% K xchg dx, es:[41h*4]( H) e+ s+ t* @) o( C; X' P
xchg bx, es:[41h*4+2]( P3 x3 g$ a9 p. H7 H0 _8 X
in al, 40h
4 c b" n1 g- o/ o% p xor cx,cx- `) _: n. [7 {+ @' Z2 v0 e
int 41h1 N4 }4 h8 B7 G! Q4 v
xchg dx, es:[41h*4]$ s& B+ Y) T* C' c
xchg bx, es:[41h*4+2]
* J% v# O* Y' g- f6 _ cmp cl,al
* N. H, o' }- w: b: r* a5 @ jnz SoftICE_detected1 ?. ]% S' S3 \# q N9 E
$ |8 O3 `/ j7 X. \5 c4 K
_________________________________________________________________________
/ x0 m8 C' M. Z" ]4 D5 j4 j0 z3 H) m" o) L) T" c+ C) `2 h% {* [# B
Method 07
7 i! S# b) q( h% _* T0 l=========) m. k! a' Q( L( U8 W/ o/ j! L
* x* s& S3 a' Y R/ Y% d; E2 R+ J
Method of detection of the WinICE handler in the int68h (V86)/ y3 p3 b- w8 V" h3 E7 ~
& i: ]) p# W Q1 {0 J
mov ah,43h# b0 T# i4 w; U4 s$ z+ n
int 68h4 l# v( f* G) `0 f- |
cmp ax,0F386h
. z) y1 o* C% x6 k' R jz SoftICE_Detected ], f1 r3 K" A! ^
$ N0 Q0 x1 `+ H, n) l; A9 H
4 N0 c' w; X4 h; [: J( y/ ?4 O
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# P& _ o4 f4 Q# x
app like this:
9 [- Z+ N1 J2 M) q" [9 D; {- v7 y8 _- ?" w) d+ N
BPX exec_int if ax==68
# q+ ]; M% Y& l! E (function called is located at byte ptr [ebp+1Dh] and client eip is
" r" T v4 g/ d- [, G& a9 t5 x located at [ebp+48h] for 32Bit apps)
- l7 z" f$ u3 j9 ^! B__________________________________________________________________________
. x/ f/ C' z7 U5 s- r! ^ z5 t2 j9 j3 d T/ p7 M7 H% d6 z
, `- l! L# _$ C; HMethod 08
: M' P/ J# n5 x7 P; n=========
0 U' A4 R: G$ x8 q l2 o. A( a8 D: u
It is not a method of detection of SoftICE but a possibility to crash the" i% N5 ?7 E& b( f
system by intercepting int 01h and int 03h and redirecting them to another
3 a9 F* J) t$ S$ Troutine.+ J% B; S8 x5 D
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* u: o1 G- ?$ y9 A+ y; `
to the new routine to execute (hangs computer...)
0 I6 C& p5 D7 C0 r( V( w' W" V" ~* _& R7 I/ i
mov ah, 25h
6 \0 o$ | M: _6 B( O c3 s mov al, Int_Number (01h or 03h)
+ |- N8 F3 ~4 s8 m O mov dx, offset New_Int_Routine
! m4 M2 l: G. Y int 21h
9 ]- g) I) M3 r y e2 x
) D, \* P7 D0 f2 e: v, k! ___________________________________________________________________________4 X- f# N+ P) H
9 n& H2 S% ?( w9 Y3 c0 D# T
Method 097 N9 J$ O9 V$ H
=========8 P# A2 {' p6 T% P' K
6 e% I5 W% \3 D. i0 q6 J% IThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' T3 ~3 g; e+ W* O1 uperformed in ring0 (VxD or a ring3 app using the VxdCall).& V; S8 T2 A1 s# L; x% v& }
The Get_DDB service is used to determine whether or not a VxD is installed, C' W0 M9 \/ G# T% K- d
for the specified device and returns a Device Description Block (in ecx) for( A$ u6 q) Y* O& X" ?
that device if it is installed.1 {# d" d R; s& S# R; _( y* I0 m
8 y1 J9 |3 L+ T( P t. b
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: p: h- y& l# O Q7 |! s
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)4 a; X" B7 c, u/ x
VMMCall Get_DDB s( h1 x5 R$ F$ q4 }# Q7 }+ g: z @
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed6 @2 s6 b* Y7 t* o3 K$ l9 {% {' q* k
6 A8 }# W# o' A! S: Q
Note as well that you can easily detect this method with SoftICE:4 i1 v) C0 T6 Q& N# J
bpx Get_DDB if ax==0202 || ax==7a5fh
. m7 m, ~1 n+ N* k u2 y# B, B2 t- P& R7 Q) m
__________________________________________________________________________
3 j4 [2 K) g1 q, `6 u$ M0 t9 P' T) o/ ~8 v
Method 109 ], m% d! s& i7 v& j9 ^% e8 K0 U
=========
3 n, G' h5 m! @9 ]' V. }4 d
0 H; c& m1 m% h=>Disable or clear breakpoints before using this feature. DO NOT trace with
$ l* y2 y( d. y1 Q SoftICE while the option is enable!!0 H% `' S# D$ e/ L4 W6 I9 s
V: |# o3 z3 O: P" Z
This trick is very efficient:: l( z; z; \& B
by checking the Debug Registers, you can detect if SoftICE is loaded( r3 G& l& f q0 R7 B2 |6 G
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if/ H U. m. d6 A- h" \! Z" q
there are some memory breakpoints set (dr0 to dr3) simply by reading their8 x0 p4 e# `4 u3 [" \* d, M# q
value (in ring0 only). Values can be manipulated and or changed as well
4 K$ X& }2 [# A* I# Z, H1 @- O- N. D$ O(clearing BPMs for instance)
0 S- J6 h. I/ `! Y6 k" Q N& p" b7 S0 I. N
__________________________________________________________________________- J; D# ~; m0 c2 T- N/ a0 a
: X2 T! \: J+ aMethod 11# ~% x; F( \& j% U$ V- K+ s
=========1 L1 B0 i0 g8 l4 m
: O, w8 B' l. t& @, E8 ]/ L% X
This method is most known as 'MeltICE' because it has been freely distributed
+ Y/ ^& k3 M% Evia www.winfiles.com. However it was first used by NuMega people to allow y% w L. ~2 r/ i
Symbol Loader to check if SoftICE was active or not (the code is located8 K3 K" }4 U7 w. \! @/ V9 R* [
inside nmtrans.dll).3 ?# P8 O; s) L A
, }0 l/ b5 q4 O; R
The way it works is very simple:( h ?, m% b. U0 {7 o
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 [8 u# r6 w* mWinNT) with the CreateFileA API.8 b9 x' r* v; G+ e0 M% `, v% K2 Y
8 Y2 K7 Y' }5 F, N& R
Here is a sample (checking for 'SICE'):" ]* |/ Y( e3 q) s9 t
( V( j2 H) T3 p) [# kBOOL IsSoftIce95Loaded()5 D5 l8 l& B: c V0 w. r4 R7 P
{
1 A3 O6 k$ D; j- ^. G HANDLE hFile;
& C7 o3 t4 h+ o! J N/ A hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ ]! }: k* u' c+ K9 T
FILE_SHARE_READ | FILE_SHARE_WRITE,
$ x1 p( o1 a( ]5 V# V% f. d2 U2 g6 Q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% i- I/ Z7 Y: k/ n$ `$ A5 N- I- ^, s1 w if( hFile != INVALID_HANDLE_VALUE )$ B; a- n0 s$ H
{
i, ?4 Z: v; \, B CloseHandle(hFile);2 m2 U: c% {8 R5 p& G
return TRUE;
* ]$ V7 P& V2 x; O7 V }
9 J, C" z6 S7 m! W8 k5 T return FALSE;; b& }- X' U" ^! _
}6 \5 g* E* ~9 s4 L
$ s# @1 i e4 ]* u4 ZAlthough this trick calls the CreateFileA function, don't even expect to be5 h2 L& i2 m$ ]$ u6 w, ~% Z
able to intercept it by installing a IFS hook: it will not work, no way!
3 t% ~/ o/ A* @6 |1 ?In fact, after the call to CreateFileA it will get through VWIN32 0x001F
C: N5 X: Z8 Q- w2 {' g1 K1 S# J. uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! i- w; ~8 }+ \7 O
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
8 N K: y- I$ {field.3 r0 s5 }( O$ F' j* m
In fact, its purpose is not to load/unload VxDs but only to send a
) G8 M3 j; L$ DW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! h$ }2 ~ N: Q) }
to the VxD Control_Dispatch proc (how the hell a shareware soft could try1 I ]+ m6 A% ^/ R0 _5 s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
) o; C& V+ o, h4 q) WIf the VxD is loaded, it will always clear eax and the Carry flag to allow
# l* q y- R# zits handle to be opened and then, will be detected.7 d5 D9 C4 ^3 L6 z
You can check that simply by hooking Winice.exe control proc entry point
. H: l7 Y5 r8 m# ]while running MeltICE.
/ {$ c- F) |+ }: R+ _ \" n4 X- E
* t& p A' P: L' M& O
9 p0 K k: ~( g3 b0 v 00401067: push 00402025 ; \\.\SICE8 U0 ]3 C% A- C& l* u# f
0040106C: call CreateFileA
" T0 L: R) U8 Y9 r8 C3 `# } 00401071: cmp eax,-001- m7 x/ i4 w n: }5 m$ I
00401074: je 00401091
7 K% X7 }1 @4 X0 c5 R" m, {$ W" ]8 Q' H m9 M) j
; @& n; T$ j3 E$ L; B0 o% H
There could be hundreds of BPX you could use to detect this trick.9 @* D8 x% Y8 p
-The most classical one is:/ _6 y, C, T0 g/ `8 J
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
/ `) B Z6 L Z/ H R *(esp->4+4)=='NTIC': F7 X& E. K: e* ]; ?8 j$ E
0 a2 M* o" v) l( Q& e v-The most exotic ones (could be very slooooow :-(
1 j% J* g' \$ k BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. N# d" Z k( W4 B& j% D9 m# b ;will break 3 times :-(" q2 f# {" _1 Y4 ?
1 ?$ p9 _7 T+ |2 b& T# W& N0 ^& R-or (a bit) faster:
" j, d2 s/ }' g- ^* L BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 V4 k0 o2 l' `. G1 O; R: P7 f6 v
: I& t- V4 N6 c0 s$ F* \" r BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' y, N& ?3 w. E6 ? {9 ~; E
;will break 3 times :-(: N3 H) I" L) [. ]
: q+ U0 E# u5 w
-Much faster:8 b% I" F8 a1 s- J% B
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 N- n* B$ T% G( H8 D# R7 a; [
: q+ l2 E& _ J# S8 ^* J
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" H) Z" G& z* U8 wfunction to do the same job:) b+ ^+ l( o2 m5 B" F3 N
" _; ?1 Z. `- `1 e) P push 00 ; OF_READ M+ v0 ]/ O0 ]9 ]8 N- y% n) }6 b
mov eax,[00656634] ; '\\.\SICE',0( \( R; O, V- Y4 s& L# P/ b1 E
push eax
% d' z) \2 x6 w/ F6 G call KERNEL32!_lopen
3 P! Y& W+ j) e3 b9 Z inc eax1 l1 R9 u& k# H/ e- }* J M+ v8 A
jnz 00650589 ; detected; C1 A, y _) V I
push 00 ; OF_READ
6 |5 Q; s& g. X; c. \( g mov eax,[00656638] ; '\\.\SICE'' o/ N) \& T8 G
push eax
9 T0 e* b% p' F. w5 W2 D call KERNEL32!_lopen3 g( q2 r. f1 _3 }+ F% ?) Q' h
inc eax6 T* F p; }( u- ^; @9 K
jz 006505ae ; not detected
9 ?- \3 v6 V$ {
& \$ b# R, \5 N7 {% ?8 w
8 O. p8 G. w. [# i5 B8 w& E__________________________________________________________________________4 Z/ o7 \9 }6 C$ {) }
0 N3 E; m# S* L! k+ o+ R. {
Method 12
2 H& [/ a$ h2 }1 ^/ U7 S5 i1 F=========4 j8 V4 g7 v# l1 d2 _& s
8 B1 L) b* z; L4 v2 S" {" i
This trick is similar to int41h/4fh Debugger installation check (code 05
1 X8 ?, L( J0 y$ v+ V4 s: B* r G& 06) but very limited because it's only available for Win95/98 (not NT)
# i1 x& L, H/ v" ]& z% w- Ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 g" }* b( L: r( b W$ k& c' g
# j b8 F! j# F1 [! w7 u6 c
push 0000004fh ; function 4fh
6 b8 I, G& l; ?$ t; ]1 Y push 002a002ah ; high word specifies which VxD (VWIN32)
: |* I; d1 h, p1 N6 | ; low word specifies which service9 o2 c& O4 _. n5 ^
(VWIN32_Int41Dispatch)
6 L/ J; s1 H; f call Kernel32!ORD_001 ; VxdCall
, T3 `2 f5 n) e7 k2 L4 m7 z cmp ax, 0f386h ; magic number returned by system debuggers
: r/ A/ H% n S jz SoftICE_detected
$ x' Z$ j3 g7 k0 o( ?" T, {: Z; Z) O0 ~6 @ A7 R6 i6 C
Here again, several ways to detect it:2 W1 q& O$ L, g; L
F- r$ d+ Y" A
BPINT 41 if ax==4f" v. ~9 L; T* z6 C; F0 H7 A
4 o5 G- k+ I- m Y& E+ B
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 R- I3 T& C6 z
9 W% r. ~, E" D1 z8 o4 s ?
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
7 X- u7 m I6 S" J# B6 Z! k0 q0 e9 b
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
V8 R7 r3 D" z6 b- F" U6 v* C. e/ A. y9 q5 S" _0 a
__________________________________________________________________________
6 H$ t) g& G* Q/ t6 v
! O( v4 M! E& r5 FMethod 13) D7 X$ ]) \ A% n0 M# A: u- h7 N0 j
=========" Z& [' y- o4 C
6 w( Q; \! Q) {1 F; F+ ]3 P, A
Not a real method of detection, but a good way to know if SoftICE is
I% O, g5 F( Yinstalled on a computer and to locate its installation directory.) h# n: v! z' v; N" V% R Q
It is used by few softs which access the following registry keys (usually #2) :
1 b5 R. @2 S. X7 y9 W) M8 e1 }2 _/ [# x8 I% T
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ L" I$ l _0 t3 O! W6 `. C\Uninstall\SoftICE6 g m. d3 w" _& a! E, }0 P7 Q) C: S
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 v! Z& n) N$ f) t- c {, h. ~-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 z; r# n/ J" g% u\App Paths\Loader32.Exe, T1 H& A* ?3 ^( j& O' N/ R
; T# c, a4 ]1 f2 j& A3 J! J# `4 T; t
/ J$ C7 M* K1 J; e: d; _: ANote that some nasty apps could then erase all files from SoftICE directory# E. I6 a9 ]% i k# j/ e
(I faced that once :-(
! |! ], @* O% p8 e9 \2 m1 j
/ A" ]- a. Y! ]- w4 `6 o: wUseful breakpoint to detect it:
( h. \; ~8 P' x
$ ~5 K6 [& {, p" Q: K BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
* o( a1 s0 Q6 F" t) _; Z3 F3 L: M1 ~3 j6 q/ Y* b
__________________________________________________________________________+ b, L! X) u+ }/ h! C; x
: Y$ f) y7 a* d1 E+ W$ m w+ t* S7 I5 v. @; }! K- c1 u: k
Method 14
5 R& ^$ @4 ^" A6 o, }1 u6 I=========3 v: g- f+ H5 M! K5 e% q2 z
! L- \3 }# i( e8 ZA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 B+ ]1 Z$ H! E& r, [6 s
is to determines whether a debugger is running on your system (ring0 only).
4 D" x4 g$ Q: t) Y, a
# X$ X3 l) D. l. h8 R1 p VMMCall Test_Debug_Installed
! F4 C. R* ?+ E4 S. |; q je not_installed
' `' c. }* D$ E+ T& P0 ~. V8 l* l
This service just checks a flag.
# O* O4 @& |* r& r b! }</PRE></TD></TR></TBODY></TABLE> |