<TABLE width=500>
' G* i& g4 o4 r; I( n<TBODY>9 u% A4 j: _5 g! s
<TR>
9 a7 S# S8 i/ z<TD><PRE>Method 01
4 X0 B J$ s/ N$ w=========3 W& P; h- ?9 z3 l
7 H& w, Z n( a- i# nThis method of detection of SoftICE (as well as the following one) is9 S2 [; I0 `2 z2 A/ u# f
used by the majority of packers/encryptors found on Internet.
, x4 j8 S( U, \7 ^) J- Q& x" }# \- \7 SIt seeks the signature of BoundsChecker in SoftICE3 f# x5 x# L/ |- `
* N3 s" o( C6 C- E `0 S6 w8 x: F7 ^ mov ebp, 04243484Bh ; 'BCHK'
4 s1 \7 e" p% H7 D0 _5 U, H' F. w mov ax, 04h
4 T/ e3 U* q) h- G2 p, Q; X" s! J int 3 * s& k+ E s( k4 Q7 w
cmp al,4! @# F* `$ b" V: E0 P/ h' l
jnz SoftICE_Detected0 P/ q6 |( s0 V. D( _6 O
9 u" {" Z0 ?. C
___________________________________________________________________________$ }* O- [" ?8 _- C g
* x1 _5 ?; y$ s/ D" l r! eMethod 02
2 h: o0 o$ P% u' D' h- i=========
* X V0 H* g; y. b5 s3 N8 H }
, @$ \" C" X# b7 s5 m6 aStill a method very much used (perhaps the most frequent one). It is used
( c: F( z8 d! s$ oto get SoftICE 'Back Door commands' which gives infos on Breakpoints," X( L4 A& u, q$ q8 @$ b
or execute SoftICE commands..., h5 V' r6 ]1 Q2 q" t
It is also used to crash SoftICE and to force it to execute any commands
2 M5 i% P" K' Y; b7 U' A$ f. p& }3 c( I(HBOOT...) :-(( + _" `$ N- \- Q7 P1 f E6 U
. H& i7 e5 N/ B2 M# Q, d
Here is a quick description:
+ w6 F9 p# _8 Q. ^" y-AX = 0910h (Display string in SIce windows)# F6 A1 a$ R' X+ z8 q. m) O! _
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
h4 i/ U0 d5 e" a, v-AX = 0912h (Get breakpoint infos)3 z3 a: A1 A8 P6 Y% @4 w8 ^
-AX = 0913h (Set Sice breakpoints)0 ~9 Q& p. ? W# @8 V# D c6 Z
-AX = 0914h (Remove SIce breakoints)1 C8 b3 s. b/ ]: h( w" ^$ K
# H* L! B8 {6 |7 Z! OEach time you'll meet this trick, you'll see:+ c. Q1 x" e+ N5 ~
-SI = 4647h% M2 v/ c0 f5 @, g
-DI = 4A4Dh
- M0 W1 O1 p1 u4 YWhich are the 'magic values' used by SoftIce.
! ^. K: k1 `$ n2 F7 B% `/ mFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 d' V8 k2 v& _: c' s
; F! s( l/ {* }9 gHere is one example from the file "Haspinst.exe" which is the dongle HASP6 |: h C4 W: K- y6 f
Envelope utility use to protect DOS applications:
: E( D. d# s% x$ v; N4 |. F7 M/ G- W' l; A1 Q4 G1 k2 A# k( |- Q; H
6 f& b9 a+ B+ ?4C19:0095 MOV AX,0911 ; execute command. ?- \' K: D4 O1 Q. s5 ~! @
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
' r- p( r0 [, F4C19:009A MOV SI,4647 ; 1st magic value.; b8 \6 s. b: [( E/ U I! O; p( F
4C19:009D MOV DI,4A4D ; 2nd magic value.
. `3 G% a7 N5 E3 a- w# o4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)# p+ T) G) @- W# _
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& e+ d) r& y& _6 q$ U4 v! F4C19:00A4 INC CX0 v# p4 D' [: m$ X
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute# M4 A; v1 ]$ q" }# r4 i7 C- z
4C19:00A8 JB 0095 ; 6 different commands.8 P1 z2 ?+ B# @" K
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
z5 Q% [& |5 q( A1 L* O4C19:00AD MOV BX,SP ; Good_Guy go ahead :)2 F5 G, u7 X& Y/ Y1 i' H
6 J# r" c3 M+ _The program will execute 6 different SIce commands located at ds:dx, which$ w4 f7 G$ G. d% j; t& i+ g
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# ?1 r; t- \7 @
- E" c* W8 r; n; m) ~3 s% W* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ C0 s) Y" A# o
___________________________________________________________________________
2 \7 `+ ^# {" U5 L: c6 S% H9 F0 G( [0 L. _( W3 l: f# }6 t. x
# v* G {# G1 m% c$ F5 G) y* q* ?
Method 038 G; b S+ B) n; r+ b
=========
& q6 R6 s# R* a
h8 [- s8 E/ sLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 h% ?& j0 x/ } M
(API Get entry point)4 w6 n m3 ~/ a, d/ z& f8 K, ~
5 {" H" Q( l6 q9 E# d
5 g, Q. c P1 b# s# K xor di,di% t! l2 Z* r* P% c& F1 V4 D
mov es,di5 W- c4 \- o' w: Q; ?1 ?: Y
mov ax, 1684h 5 S) ^) J2 b7 X- e" A
mov bx, 0202h ; VxD ID of winice5 I$ {8 i8 O7 |8 c4 d2 W
int 2Fh! ~* e7 ]. {* M# z) n( u ]
mov ax, es ; ES:DI -> VxD API entry point8 n, J2 ~( O% @9 m1 \( H/ t$ i
add ax, di3 o4 b) b! D/ `
test ax,ax
% C8 b- W' i2 V9 C' m jnz SoftICE_Detected
) m7 E& T n' g5 Z0 d2 t) g8 F& ^9 t* `- p. Q
___________________________________________________________________________
- l# E) p/ d4 V, u, w
$ s% M0 J3 M7 |( v& }Method 04
0 O( i- z$ L/ b=========, S+ C+ i. H6 _3 y2 `" k4 I
" ]0 S0 |* a7 b3 z/ X3 J
Method identical to the preceding one except that it seeks the ID of SoftICE" i- @$ e0 x5 o$ c# N- X$ v
GFX VxD.
: T: f S, z* }- i) m
8 R1 G ?- |+ F4 g6 \2 s3 v xor di,di
, S" X2 G: [* c mov es,di
; p9 @- I2 _7 |( L2 K mov ax, 1684h M, |# k: d. K& @
mov bx, 7a5Fh ; VxD ID of SIWVID6 _6 d, [8 e* k/ l! C+ I' X
int 2fh! e, D3 e5 k% z& i. P2 {
mov ax, es ; ES:DI -> VxD API entry point
# v% i$ i' F6 P7 z' i: { add ax, di
! a8 e* \+ Y; Z test ax,ax
/ H! ]# Z4 e$ k- s2 l* T' L jnz SoftICE_Detected
' W% A( B6 q- B: c7 V
: K0 R: k5 C1 S( h" y8 e, Z4 M__________________________________________________________________________
! }% i# e. |& }, A- n+ u
$ z8 C/ Z& `3 u R2 Z+ s, m; _6 b+ W, s I
Method 05, g1 C$ ?0 i( t! X: A% W
=========
6 Y# m/ M4 [$ `3 H8 J9 n2 x
) k- O8 A& m' P) {3 y* _Method seeking the 'magic number' 0F386h returned (in ax) by all system
3 a. z) X0 `' B6 d6 \5 y) w* w& ]/ x# {debugger. It calls the int 41h, function 4Fh.+ x3 }" b9 j, V& B
There are several alternatives. 5 Y3 t, I8 N" f! z# D: S
% ^& ~4 z! I4 e& LThe following one is the simplest:
/ s8 E1 \, J6 g0 T4 r) {
# A4 h( w. K2 m- D! B4 B mov ax,4fh- g( V6 Y8 f& i: L! w5 l
int 41h
1 ~" E* `$ L6 n! s z cmp ax, 0F3869 q* j& C2 }/ A5 I
jz SoftICE_detected+ h. p( c" n, k) d1 Q0 |% J8 E
: @/ e" p% H' E3 A8 E9 p4 @! j+ O" x& S) N7 y" g
Next method as well as the following one are 2 examples from Stone's 4 l( L4 _' t3 [
"stn-wid.zip" (www.cracking.net):. H; y- w, ^' M$ T6 W/ S
7 R0 K) \2 |. a' c- p
mov bx, cs
8 L( N8 r# A4 X8 _ lea dx, int41handler2( T: f- a+ r& |/ v4 c- Z, O: j
xchg dx, es:[41h*4]
; H4 I# J' q2 N5 R! z2 z, c xchg bx, es:[41h*4+2]" I, F3 w! f) ^) @/ H/ x& A) {
mov ax,4fh5 \3 a1 c% [/ M1 ]. R
int 41h
3 f9 `1 t% J& s) U- b xchg dx, es:[41h*4]
5 | s. L+ ~; b) l* m xchg bx, es:[41h*4+2]7 V' R* _$ t" @6 E4 @! U7 A
cmp ax, 0f386h/ I1 W1 K! W& y: I, l! I
jz SoftICE_detected
% g* R: |0 d) L; ?4 j( V& s+ |/ u F) h% z1 _3 [- q; R, Y* R
int41handler2 PROC
) u# Y1 k* a, c iret& c8 z5 m" c, {. u% w
int41handler2 ENDP
6 v/ w8 z" \1 V& m8 y2 y z4 I
% l, B0 @$ I) k5 m V$ ^ g H* R2 d6 J1 D% e3 U2 S
_________________________________________________________________________
+ a4 q5 r/ [9 d9 d5 S) d& f+ }. w
5 g8 d+ A$ U. W, J5 {6 Q$ u
Method 06+ Y' f$ d+ l; O% x
=========
$ }0 ~6 u" R. x% r/ l: Y( E- E2 A7 z% j _' o7 v& ]9 u0 d! C, G8 \) T
( q. P8 V8 S7 R4 m) ?
2nd method similar to the preceding one but more difficult to detect:- Z( D. O+ r7 K7 t2 e& m$ I; ^
3 w$ L( e8 x) {
% D! A3 [9 u) ]+ `3 Wint41handler PROC! ~. x9 Q- p6 Y* ]/ Y
mov cl,al
8 O! B- B5 f) @$ B L/ s iret1 F* F) N" k# e' h
int41handler ENDP) A; {! P' B5 ~# b; g$ A
) J1 N0 Q6 L; A# \3 M. E0 x7 v! R, C, @! h# u# M& d# I1 @
xor ax,ax" Z5 T3 E6 G, e! i$ L- k
mov es,ax
r' u& V- o2 o7 Z/ q, Q4 N7 | mov bx, cs
. l q0 [. q' t4 B& \9 t, S& m( C lea dx, int41handler
9 r6 \" o! ~+ b" x xchg dx, es:[41h*4]
4 P8 U, R! B- q xchg bx, es:[41h*4+2]( C) s% ^1 K: L- c2 P/ W$ V. O
in al, 40h
# G+ e+ A/ ~+ [3 k, M7 i xor cx,cx
+ ]( j8 K9 r* l% \4 Y int 41h) ^& B& ^# d+ _: h0 S. Y
xchg dx, es:[41h*4]9 R/ D! L3 R' b" E" H6 X% Y/ q! ]! q
xchg bx, es:[41h*4+2]
9 k5 J- c& i# o cmp cl,al
6 R) |# f' z! q! y% b3 U jnz SoftICE_detected6 `( }5 }; _5 A1 E% @2 q7 O! P, e
2 k- w: V% q" n+ s/ I_________________________________________________________________________. _4 \+ F; D0 J. X' W3 U6 L- r& |1 ~
8 V! {# G( H5 [* @
Method 07
: p5 a0 ^9 d: ? r' X=========& H& R" B; g. d" ?9 s7 D
2 i$ ~. y$ ?0 [" j7 mMethod of detection of the WinICE handler in the int68h (V86)) a4 C5 I9 l2 H0 R
" Z0 x* A! M4 x1 o$ @' C9 \
mov ah,43h2 w7 \4 n) t1 z) p
int 68h
# T, T4 A! _( F' p) s" O cmp ax,0F386h- B" F) \4 z7 c4 Z* u6 c4 D
jz SoftICE_Detected' n7 L' c7 z y8 M
: S) u$ g$ U9 T+ G5 C
# T- Q1 ~6 C$ p=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 S1 \; ?& {8 ]2 B6 z1 w
app like this:
: J0 b5 ^# D4 J6 x( X1 d
( x# Y3 Y" a$ E6 l0 t3 L7 Z9 @ BPX exec_int if ax==68
! u' y, ^- P2 l# W' V (function called is located at byte ptr [ebp+1Dh] and client eip is
. P7 B9 |% B: R- P' T located at [ebp+48h] for 32Bit apps)0 W8 o( ~# V" S2 ^( M! }( W4 `" w5 Q
__________________________________________________________________________$ r0 t! ?3 |: |, M8 t
3 _5 c$ T4 [# L, g {1 @' A- h* c
8 p# z+ Y3 {3 w) Y) A. G0 g2 ]Method 08
$ U( h& Q$ `4 q( d: F m; i1 ^========= b; ~, q& k# c6 c
% C0 i; y" Z- n% @* i8 d5 `
It is not a method of detection of SoftICE but a possibility to crash the4 `( Q. i9 ]& V q: L- l8 t
system by intercepting int 01h and int 03h and redirecting them to another( y- n) Z# H2 N
routine.
: ]) U" l$ J1 nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points6 N1 g: y8 X1 E U
to the new routine to execute (hangs computer...)
# B$ r3 d; u0 ^* u( i- \! O0 q) E. H" y
mov ah, 25h! M9 \" }$ W8 }. u
mov al, Int_Number (01h or 03h). K& Q" D5 J6 o
mov dx, offset New_Int_Routine: o: k. r6 e9 q1 n& Q8 P ]3 v( b
int 21h9 k# j' w7 o) L! P k8 R' ]5 n4 U- ?
& Z' N: F$ x5 s- ?# `( |' R1 }__________________________________________________________________________) T. Q0 E; {; J# s
7 x W) I( N% M7 R" {' [3 ^
Method 091 f. J+ q5 M2 @
=========
! h! r( v: U! i9 G6 O% S; S6 N" f3 i
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ d- s, x x1 V' K2 F" l! C1 j* `9 tperformed in ring0 (VxD or a ring3 app using the VxdCall).9 d0 a0 J D H0 l6 l
The Get_DDB service is used to determine whether or not a VxD is installed9 g+ U7 U. L; K# R8 g, w# C" l; j
for the specified device and returns a Device Description Block (in ecx) for: x. z" C) b1 S" s
that device if it is installed." Y" b8 l! \5 _3 W, j3 O
0 U! _. l% H; t! n7 m mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; F0 u9 f/ u/ [2 D7 D mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 \- w Q6 @4 A
VMMCall Get_DDB8 c0 Z% ~, e2 J7 t( _( \+ x
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
7 F8 J" q; M7 A5 W+ M. J: w5 E1 I8 p' U
Note as well that you can easily detect this method with SoftICE:% h: d0 O0 |4 \ U
bpx Get_DDB if ax==0202 || ax==7a5fh
$ l8 ?6 l' o5 C- A: S+ x2 a
/ F7 e3 _. D1 g__________________________________________________________________________2 E. n" ~' N' D5 P6 N8 m
2 d- F, Q+ J! [. {& wMethod 10
6 c. s4 A7 B% _! Y5 V=========" [0 |+ {' {* N/ g; E6 x# @
L& @7 m/ p D( a=>Disable or clear breakpoints before using this feature. DO NOT trace with
! A4 Q. Q8 D, L! t SoftICE while the option is enable!!# g- B; K* ?4 Z/ n2 O) q9 S9 J
- l3 z% j" }/ `) c% P6 E( }0 N4 [ AThis trick is very efficient:9 x0 v9 o7 ]" K0 \7 n
by checking the Debug Registers, you can detect if SoftICE is loaded0 c, C1 \& ~! e% N
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if/ W& ]) C. S; v9 W# g' B6 B# O1 g
there are some memory breakpoints set (dr0 to dr3) simply by reading their' _) I2 [- K) c- l% V- K
value (in ring0 only). Values can be manipulated and or changed as well
) Y4 S# Q9 E8 d( R8 [2 S& \(clearing BPMs for instance)) }: O) A; `! R
7 C' d3 b/ s. a4 k2 w__________________________________________________________________________
% P2 U1 K5 R5 q" K5 }# D' n2 c. U v' V/ V- S8 {& i7 K% k: B
Method 11
7 Y# G4 ]% n7 Y. c=========
( k. h* k3 f% g6 O" Q; P/ @# p2 j. Q, O( C2 n$ P
This method is most known as 'MeltICE' because it has been freely distributed
# q1 ~5 P, U, c8 J8 R3 nvia www.winfiles.com. However it was first used by NuMega people to allow
& ?0 C2 O( @9 J q- N& hSymbol Loader to check if SoftICE was active or not (the code is located
4 p n! n8 e$ O3 S2 Ninside nmtrans.dll).
4 Y' m, e+ W( Z, F' E& `( _. C1 T+ h, g4 j j
The way it works is very simple:
" m7 `0 v2 O i1 v( R- }4 y" AIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" g7 `8 q4 j2 d- XWinNT) with the CreateFileA API.1 N/ a8 {. `& B) G4 x: V
2 u1 g3 Q) |0 G# WHere is a sample (checking for 'SICE'):3 j6 g4 N9 ]7 `* A
; K. I8 n* t$ J: V# A1 MBOOL IsSoftIce95Loaded()* ~3 l0 ]7 d4 a/ e
{- V# u& Y1 ?# F- ~- [+ v* K
HANDLE hFile;
- m6 m" p; ^, _; d hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; g! Z l/ G/ J" t; z5 [
FILE_SHARE_READ | FILE_SHARE_WRITE,
& b7 _6 q* [# e7 E% r) ` NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 g& [5 `8 t( e' U! u5 M if( hFile != INVALID_HANDLE_VALUE )
0 ~, i* u" \" o3 [7 h$ y {+ g! ~( ?& E6 N* c: r+ o, j* w
CloseHandle(hFile);
8 u1 P0 _8 t' L! O6 H% b1 F! k return TRUE;2 A1 O5 C3 J* [7 H2 Q
}3 J1 f2 X# @$ L y; `1 F A2 S
return FALSE;
; c# l6 Q N" U5 u}
0 W5 `( w3 y6 j
& f Y2 a X( Z1 X9 CAlthough this trick calls the CreateFileA function, don't even expect to be2 c9 n! I9 Y9 J1 k2 a' ]: M
able to intercept it by installing a IFS hook: it will not work, no way!; h( T' q% n8 x9 U0 G1 x
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; i, V7 V3 p! D; S1 ?1 G
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 l8 ?0 o9 T$ f: Aand then browse the DDB list until it find the VxD and its DDB_Control_Proc* \3 H8 o/ D9 z2 m" `# g& w
field.
& [- Z5 {- R4 p, U% ~In fact, its purpose is not to load/unload VxDs but only to send a 0 f' z5 d' C2 V! c) C8 ~4 a
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
F! U# t' o8 C9 a5 a1 Q: Z9 mto the VxD Control_Dispatch proc (how the hell a shareware soft could try
$ R. y. E% a& N' x4 D# Lto load/unload a non-dynamically loadable driver such as SoftICE ;-).
3 h( G9 E! c5 b; ?1 S! k# R$ tIf the VxD is loaded, it will always clear eax and the Carry flag to allow! Z' b+ w) J' O5 ~; @. N
its handle to be opened and then, will be detected.5 E5 y8 ]( y9 ~' e7 o# V, T
You can check that simply by hooking Winice.exe control proc entry point9 Y0 y+ ~1 x' O, j
while running MeltICE./ H7 r9 {: h! Q1 [# v i
) q- k8 d9 v/ |1 p
) l4 {7 s8 S* j) w& x
00401067: push 00402025 ; \\.\SICE3 C' V P* O$ Y9 l4 H6 D! i4 ^
0040106C: call CreateFileA3 Z% _, C- \2 K0 E
00401071: cmp eax,-0017 Y+ R: Y3 l: ~0 I$ u( c
00401074: je 00401091
3 d" x; E6 W5 R! v
5 o- a) |( r# X' H H
. ?- P$ [# a2 d) h+ uThere could be hundreds of BPX you could use to detect this trick.
( G3 j# }$ s& d1 T! E, ^- D7 m) R-The most classical one is:
& ]7 ~4 W" \ E$ O$ _3 i3 h BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; M6 ?/ R" x7 u& q
*(esp->4+4)=='NTIC', j! X+ z$ E" P' ~# {5 ^
/ Q3 n% r" [ _# F
-The most exotic ones (could be very slooooow :-(
5 [( w' ^4 `& v# s BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
* a: q$ }/ T Y! e/ x! l ;will break 3 times :-(
! |( `1 O t- b
; _2 r( O& ?* }; {* l-or (a bit) faster:
8 D# P) \: |( C4 P6 `8 k# r+ K BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) |5 V4 a2 Y; i9 w* v) m- q7 L/ C% | s8 F# }# W
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
1 T! \) a/ @/ r- g) G$ _; N* e8 d4 R ;will break 3 times :-( E; ?2 V2 ?% u' B' U4 I. j$ f- A Y
/ m# Z: V! }% j9 x! g-Much faster:! y0 }9 W7 m. Q: r& m" @9 [
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
J9 s$ `0 C6 S9 f5 z8 y, }+ R o# V+ G _3 c/ t; r$ l
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" _0 \1 W5 |! R/ m' nfunction to do the same job:
0 A2 D9 n! C b% \& w
$ Q+ B8 n+ K( S$ t0 w. D push 00 ; OF_READ0 I! P& ~) P6 o8 l" ?
mov eax,[00656634] ; '\\.\SICE',0/ u+ w. p! u& C5 K. A ?: g6 h' `
push eax
' v! @9 ?3 H/ t+ Q call KERNEL32!_lopen& V: X) |9 w4 m. S* r
inc eax Q7 \( E3 E6 h% I. v( L. t6 ~5 k6 |
jnz 00650589 ; detected
8 \2 D! D! d8 z4 }) x3 n push 00 ; OF_READ: }: A) {8 b- A% Q. p. V
mov eax,[00656638] ; '\\.\SICE'/ K. V' Y( \ w1 b3 S3 B& L
push eax
4 q, P a. k, e+ {6 Z, Y7 X3 J call KERNEL32!_lopen7 y9 G, b" M6 I( v8 |: t V
inc eax
) w5 P; p7 q2 R. \' x( A& L7 s9 l jz 006505ae ; not detected
* ^9 C. e' b# M3 H% u. e- K; u
( V; Q# `1 G8 I3 H
+ o3 Y$ t5 z' a; X5 P__________________________________________________________________________7 m& z( L5 n y9 Q. C" q( [# u! y: Q
& T3 L3 @; x9 [; K3 t y: p# tMethod 12( H6 k, K y' u' c
=========
" T4 @, s9 v9 w0 L! p- y! Z+ H6 P" z3 y
This trick is similar to int41h/4fh Debugger installation check (code 05) X9 u7 f0 T5 j% w9 a" R$ l* y
& 06) but very limited because it's only available for Win95/98 (not NT)
# L! o* W8 l0 b' p' K0 Tas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; N% E+ q- }" W/ s: q8 L# e
+ M1 N i. G6 N8 P( a T push 0000004fh ; function 4fh. u7 f8 _) z1 {
push 002a002ah ; high word specifies which VxD (VWIN32)
# D+ i# {1 x6 n$ v2 ^4 I( _" [ ; low word specifies which service
% o2 @) K* `( K n, f (VWIN32_Int41Dispatch)
) x, m' }5 U" ~% X7 Z call Kernel32!ORD_001 ; VxdCall
I; @" c2 p6 ?! V& } cmp ax, 0f386h ; magic number returned by system debuggers
7 k- R: a0 l% x7 B jz SoftICE_detected4 H8 l2 x& [& q6 K
$ E& ^) h7 o, m# `1 y5 _Here again, several ways to detect it: X) L9 j0 Z, [5 }+ M
8 u+ o+ G. \# V3 a; u BPINT 41 if ax==4f) P0 v, L% W b6 J7 g0 D, M
- w* X) r. @% _4 N, F6 k; x BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one- T" I3 W: I/ ]6 z0 o; k
9 d$ m7 n$ l' m6 e" ?4 c' j
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) X& ~; \4 W3 T* c; U' y# c2 b3 i: L( U1 Q" Q/ _! W( B
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% K: ~/ T6 g; f" {0 S2 P0 B
( Q1 S4 V% {* o
__________________________________________________________________________
+ r7 I' N# D9 F: D# ^% l# F* P" R
B4 h k* q( }( DMethod 13/ w% F6 N1 u& F: y' C9 a# ^2 u
========= @4 {0 {8 c. }7 e) P4 i2 l
+ G1 F" u$ ]# J2 o' [Not a real method of detection, but a good way to know if SoftICE is7 a( Z+ O2 m1 ]+ v* u8 Z0 z/ i
installed on a computer and to locate its installation directory.
1 H- [8 C3 i' i- D7 nIt is used by few softs which access the following registry keys (usually #2) :" Y2 K1 C1 T$ V: E/ v# u7 Q5 G
+ [" v% a6 N# ?) e$ y1 ~; v-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 L4 H+ i# Q3 X1 H# ]& e\Uninstall\SoftICE' T- X4 c7 T9 Y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" w/ H+ G# U' n9 @! F1 Z% w( }
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 Q# d* q' X+ X" C\App Paths\Loader32.Exe, d: w& p) u) I
5 a" [. N: g# D& O( t- P J0 e. ^* n" F3 u0 T$ A+ C1 B
Note that some nasty apps could then erase all files from SoftICE directory
+ `' }: _) e+ M8 s- q9 s(I faced that once :-(0 Q% P' J3 e, p: D$ W3 I; A5 i
3 e2 G- |. _6 H- \
Useful breakpoint to detect it:
. E! \( p* l. y: \3 Y; x5 P6 t9 D) @2 x; ~# @
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
& x0 b8 Y5 m+ K
2 D! l* j2 w% j6 A! ?& w6 a* @9 b__________________________________________________________________________
v7 c$ h- k" |6 `2 k l0 @9 S$ v8 I4 t5 s: @ q4 b! i
9 l7 g& z5 N7 }% }+ {% cMethod 14
" H8 G) l9 h, {# f=========4 e h. D- I9 ~( h9 M ^: L
. r8 |6 Y1 X- m1 m
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, e; i1 e" f' V/ `% z
is to determines whether a debugger is running on your system (ring0 only).* S7 ?) ~5 _- q+ B
! |7 z5 W$ F+ J, a8 b5 d. e0 f* X
VMMCall Test_Debug_Installed
* d6 v: c) U1 u) _. _/ r; A- m7 K+ U je not_installed1 M. T/ ]1 @) a% p/ w
/ B# }* P9 c5 b# wThis service just checks a flag.9 T2 D# n4 W" ^) ?
</PRE></TD></TR></TBODY></TABLE> |