<TABLE width=500>5 M. M' R9 P8 N, l2 L( o* Q
<TBODY>
$ U; H) f0 F" r8 w9 u<TR>9 s4 C. b" P) z$ M2 x
<TD><PRE>Method 01 4 P. p# x& N2 O2 {, O2 t; S; S
=========! Q( l, k" H7 k
$ F4 g; M* K, I4 f" `+ Z/ t
This method of detection of SoftICE (as well as the following one) is
! k7 @, f5 L6 o; A' E/ O2 e+ x; V: Aused by the majority of packers/encryptors found on Internet. L. _. C Y! n+ N
It seeks the signature of BoundsChecker in SoftICE# ^* W9 S9 Q; O) f/ A; y; O& e
# e5 s9 D/ i7 G5 W- E3 l- B mov ebp, 04243484Bh ; 'BCHK'
$ z" X! b3 Q% N, i4 ]" ~% X mov ax, 04h: T3 [! e2 r* ?9 S
int 3 + D6 J1 h! [7 b8 \" `
cmp al,4: o+ y. _; b9 E4 E B, K" ~9 D5 O
jnz SoftICE_Detected
/ v9 R5 @" N8 Y0 c* E) }# n: b
* o# |0 K9 q* |% q" I+ M___________________________________________________________________________' I3 K! Q% u+ _" j3 Z3 P3 {
7 V4 L6 r8 Z1 f7 W: m6 V* k. G7 i6 RMethod 02
' T$ J+ H4 b& h) Q=========
5 `4 e$ w* C7 }6 g3 e' L' j& b3 i. Z0 D
% p0 R# @# c6 V yStill a method very much used (perhaps the most frequent one). It is used8 G3 \* G1 |' ]+ N9 D8 m3 k v
to get SoftICE 'Back Door commands' which gives infos on Breakpoints," }. o0 @3 u, r5 Y
or execute SoftICE commands...9 D% _" L5 p, a) A
It is also used to crash SoftICE and to force it to execute any commands
, E& @5 O! c% ^/ N! X. q(HBOOT...) :-((
; u: k1 b8 f0 V Z% ~( E6 r. E
/ Q6 y3 s' L7 R: P! @* QHere is a quick description:; R% v& W T' O
-AX = 0910h (Display string in SIce windows)
1 z8 W+ d5 M7 D U" ~. R-AX = 0911h (Execute SIce commands -command is displayed is ds:dx). W y4 i/ l# ?2 f0 z
-AX = 0912h (Get breakpoint infos)
$ X; u' ~0 X! O9 E-AX = 0913h (Set Sice breakpoints)
# n& p6 C- u1 r* u-AX = 0914h (Remove SIce breakoints)
# ~) t1 K4 p' b9 ?" ~0 t j
: z1 E/ B2 C8 C; L7 u% hEach time you'll meet this trick, you'll see: U' n" L; t7 \+ f1 N% k4 \
-SI = 4647h: {6 Q7 S k9 D+ f$ F6 ~
-DI = 4A4Dh0 U7 G6 a( ^3 X/ q
Which are the 'magic values' used by SoftIce.
6 P3 j* e5 F" ~5 |: x; b% E8 \For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& @' `/ m: |/ C% G
& m1 i0 v2 g: ?9 [- |1 U4 x f6 |8 }Here is one example from the file "Haspinst.exe" which is the dongle HASP
% V# |9 b+ [0 b; W$ }8 UEnvelope utility use to protect DOS applications:! s% V, g( D4 K" ]. i
/ p& E7 x; b. o
; E3 ]" K2 p; y9 _4C19:0095 MOV AX,0911 ; execute command.. ?& h5 J! I9 W) [
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 n! y. ^: o) z: U! L/ ^5 \4C19:009A MOV SI,4647 ; 1st magic value.* @' D4 D; W; s0 v
4C19:009D MOV DI,4A4D ; 2nd magic value.9 @1 U6 A" Z) ]. R- h) p9 b
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 W! X% U# X' i: F6 x4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
2 E7 {7 `; [, S) j4C19:00A4 INC CX3 y) T- D3 s) D i7 j
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" v2 A7 v: F/ v
4C19:00A8 JB 0095 ; 6 different commands." c: B( L! l4 c/ x/ ~
4C19:00AA JMP 0002 ; Bad_Guy jmp back.: c2 l6 }0 `( _! U6 h, F2 ^
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)) |# k; i* S- c% Q* m2 H( k+ T- L
& u! n3 \4 t* ^' O/ A' i5 Y
The program will execute 6 different SIce commands located at ds:dx, which
! m, P( ?' Z5 { c# zare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. [2 }8 _. w& ~! h$ G6 |7 v$ Z- a- O
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- T8 ^4 S9 S8 T$ k
___________________________________________________________________________
$ s$ v( N/ ^/ I' K- G' A
7 t4 a: o! p- q" i! V/ l# e/ \# g& j' e, j( q! [1 `
Method 035 H2 S" ^( m& D6 e
=========! j! {2 Z5 ?# ]
1 }5 |/ M; q! b) x" X4 kLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 Z) T; q$ v( t7 P! ~; T; c1 V* o" c1 S
(API Get entry point)1 Y9 y7 ~) R" l* m, h
# z: d) p9 F: c+ t d& n' w4 s7 T
( z" L& }/ z7 `1 f$ H: p) y" h xor di,di9 i: H/ Z ?5 U8 B; p7 U$ B; N
mov es,di- K F) {# ^4 q4 T& M% I) }
mov ax, 1684h 1 O( ~7 N" s+ e: X
mov bx, 0202h ; VxD ID of winice
% C" q) x" t) l& y* v b int 2Fh
( Y3 ?- C1 { t% D mov ax, es ; ES:DI -> VxD API entry point" \' ?0 X# c' ?; S
add ax, di
: q/ s) Z C2 {+ ]8 y. h test ax,ax
0 i6 d0 h9 I) M1 W! j jnz SoftICE_Detected
7 R$ g3 [5 R+ f! r" [5 x% m2 M" z1 L% s) V4 {* V
___________________________________________________________________________
- v$ m' g% h$ I3 @% W
- T8 M/ {/ q3 wMethod 04
2 K _- e% B) \/ f* H( _ }=========& ^5 U" b3 R9 K* S
( L b. f& f+ R% j0 aMethod identical to the preceding one except that it seeks the ID of SoftICE2 B$ p# S* }7 F; }1 s
GFX VxD.
! |0 o" y- G3 ?$ E2 K, Y+ M" f5 E7 u4 |5 }# d% M" N, L
xor di,di
, U$ @8 D- n; ^9 d: E) L mov es,di* m, S9 r: D" T6 O/ S
mov ax, 1684h 0 J, l9 l2 f5 [0 a$ I b9 q7 |" b
mov bx, 7a5Fh ; VxD ID of SIWVID
$ | i/ p: { E& v! f. H) p int 2fh0 S; G- Y7 J" j* x$ A; Y% l
mov ax, es ; ES:DI -> VxD API entry point' w* E- h. {5 P4 B/ b2 N! H
add ax, di
! R4 q$ Y9 \5 w5 b4 C& Z. ^ test ax,ax. G! V w) f6 G
jnz SoftICE_Detected
' P0 i$ r: f8 @; \. q8 x2 }! J! F% w/ l# d# o3 x# R/ Y& J, v4 t
__________________________________________________________________________
/ [, W3 O8 L; E; {' D0 m ^, l) \$ {# U( }# l9 f% }3 s( n
4 r+ j- d" u, O {8 Z- o7 IMethod 051 ~+ ]( ^' d( W. b8 h) l
=========- f; a/ c2 I7 u- t& d% F+ R% d+ ^
2 X7 o# Q2 v% M: H& E! \- q
Method seeking the 'magic number' 0F386h returned (in ax) by all system# C. c/ y& P" c8 v% U# b
debugger. It calls the int 41h, function 4Fh.
1 D, ~' b* @3 L4 M2 t; \2 [There are several alternatives.
f9 d2 J5 ~4 b+ n+ E/ K
9 e# g$ |" a4 vThe following one is the simplest:+ O5 l" `$ c/ o+ L2 ` i' F/ c
/ U+ Q2 h% X+ J; H% e1 l* {$ f
mov ax,4fh
' _& y# j; l1 a8 m) N int 41h
) }* j2 |# T% z3 x5 V0 F8 Y cmp ax, 0F386( g- Q' A8 u8 [3 N( g, C
jz SoftICE_detected
/ | ~# B* w* H5 [5 u5 R1 ~ [9 Q# A, }, j% H& M/ D! o
3 f- w% z. `( L
Next method as well as the following one are 2 examples from Stone's
v9 l: ], C% z+ N8 Y. W"stn-wid.zip" (www.cracking.net):
) B: O$ H2 M9 S; i! N* d
7 S& A# |4 L; s; O+ \5 M& j( N/ d mov bx, cs3 L2 j2 d8 {; g7 i3 R, [; g
lea dx, int41handler28 w. v% v& v& o
xchg dx, es:[41h*4]
9 s. i! D/ E% _4 `1 I8 v' p* C xchg bx, es:[41h*4+2]# C( X4 [: d3 S5 k% O# n9 D
mov ax,4fh
" B9 J2 N& N8 n/ D int 41h
3 {; O, k `& m6 b! t0 G+ \' T$ ^ xchg dx, es:[41h*4]; O F8 @. p8 |" e
xchg bx, es:[41h*4+2]
) L% w9 m7 F S cmp ax, 0f386h
" c* G5 Z7 W" o0 I* F { jz SoftICE_detected" L% J& d/ n9 j8 j0 {. m
& }6 Z; p# c2 w( U: m6 H" `int41handler2 PROC4 `% d6 p& ~+ n6 X" e% `+ P" c% q
iret9 Z% I" {: J" @* e) G5 s! p1 \
int41handler2 ENDP9 ?, B: s- k( R* S0 Z M# G
9 V% _7 {! |) L! z$ }0 F7 B4 }
5 v: x8 w' w1 S: [; G' u. f% z_________________________________________________________________________1 _$ p2 b, ~. }. V' u* j
+ }+ F- y# z' l4 e
5 l9 |7 q6 T7 f. u5 ]( T! { _+ n
Method 06" l8 M9 y( t/ ~) I
=========# T5 x7 w! W6 L) e2 \
4 A8 G: i; F0 H2 E5 M/ S H+ ]1 O7 T8 |" h# H+ g* y
2nd method similar to the preceding one but more difficult to detect:
$ P% U6 @- M3 R, X6 {0 P5 u- ?' o
* A8 C/ {9 u9 Z& ?( S- n: K
" [5 c( x* b: ~1 M& xint41handler PROC
. G3 `, l7 N4 p# L _ mov cl,al, \( [* o9 L( w9 P: v
iret* N+ {1 Y* `( L% e! t
int41handler ENDP
* b9 e @. @5 p1 P. W# \. r7 S/ H( d" C" D, B2 _
2 @; C* Z3 }+ b1 [ xor ax,ax* o" r: t/ _. ^2 S- z4 {% X6 H
mov es,ax
# a! e/ F( Z9 {( x) ?5 Q1 u mov bx, cs
3 H4 D& k* O9 k lea dx, int41handler
( f8 h; W3 l9 y; v. u xchg dx, es:[41h*4]
" `4 K6 [* c$ H) m xchg bx, es:[41h*4+2]' }* R5 g& [8 |, b" h
in al, 40h1 v& j" _" S2 J& b
xor cx,cx
7 E$ Q) p1 r2 ~" w% C9 G L int 41h }' A" |4 m1 H+ J" t M
xchg dx, es:[41h*4], ]; q. {2 ^4 r* {# }7 K# I
xchg bx, es:[41h*4+2]
, m( O5 B! G. B: y; O cmp cl,al! s7 f' t% } j% x; A
jnz SoftICE_detected
: d1 R5 ~- p, r& V* n$ E
# S4 B, i. `& h: G_________________________________________________________________________
4 B! c5 ^$ ? i* T( A$ i- U8 _+ W! [! [+ b
Method 07
( o' ^( ^4 v0 B# u5 d=========
: O) t$ b1 H% ]5 ?- O% B; q2 |- P1 u3 g/ B0 |& t5 x% @7 M' x0 i0 m
Method of detection of the WinICE handler in the int68h (V86)9 m, ~, \$ K7 F u/ Q' {; I
+ _ k# b' b0 D( m0 i) G0 J4 l
mov ah,43h
5 I9 j- |. Z( K. T int 68h
" m* A0 H! `& `: `* q) x cmp ax,0F386h
# h3 A0 t7 A4 p jz SoftICE_Detected! i5 C! k! E/ A/ ~
0 g1 h1 B- H4 B7 n! K
) K" A q/ g4 d2 {0 l& x" w) ?=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit- ~1 G4 Y6 |5 A# d0 \; M0 n
app like this:
0 g+ f7 g9 j* y4 Y
3 ` s$ l* n' U; t BPX exec_int if ax==68! V2 s7 k, u1 }9 r+ p2 C- N3 b
(function called is located at byte ptr [ebp+1Dh] and client eip is. T5 l9 m, t2 u) s; e
located at [ebp+48h] for 32Bit apps)9 p/ |. y5 Q# K8 c* B) O% P
__________________________________________________________________________
3 ?2 X" I7 y. U. Q' ~5 H( B. q( X4 c
! P/ R, }# B! x; ?) d) `) _
Method 08( J) L9 I- h2 n- w9 i6 ]
=========
+ K/ C, l0 Y6 J1 J1 n) d& T$ S# C) ~* n- T& |- G6 J. }) G
It is not a method of detection of SoftICE but a possibility to crash the
$ u, \% P% p) C1 |' h* csystem by intercepting int 01h and int 03h and redirecting them to another
, X! u5 a# i8 G* h: D6 ^routine.! f, w) k; s2 o% D2 R
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' t: ^, m: \; {7 `" z
to the new routine to execute (hangs computer...); a3 |4 _3 ^* r) c2 J8 E. [/ W
# c1 R- h" J. I0 [3 J8 o# W- a mov ah, 25h; W) ^- F" D& }7 S3 f
mov al, Int_Number (01h or 03h)
% l% m* M1 F7 U mov dx, offset New_Int_Routine# v0 E" ]! [" v
int 21h. Z7 s6 R" ~/ t, z k/ i: d4 S
( M8 R, n# B7 P# o* M
__________________________________________________________________________
1 G5 A$ O8 i) P6 \* H. ]# r( m! |$ }% S
Method 09/ L2 D, m$ |3 s0 s0 e
=========
1 p) a1 X1 R8 m4 R; b2 h7 h
3 B. ?+ d, M3 X x! A2 y8 bThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, I! N/ P: D" C
performed in ring0 (VxD or a ring3 app using the VxdCall).
4 m( o, e( I6 k# z. ?* a0 W. uThe Get_DDB service is used to determine whether or not a VxD is installed
( d! z. z# P- ?+ P# [for the specified device and returns a Device Description Block (in ecx) for
: Y, A7 V- ]8 v1 Othat device if it is installed.2 W1 n* }+ E3 @
; }/ L! K, ^" d1 `$ a7 \7 r& ?) G
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- O* f) N9 l0 v6 Z mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& }% k9 Y1 S+ r3 C
VMMCall Get_DDB5 w# g7 o4 c" Z2 C+ Z
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) _6 V) E% B+ P+ t
) T& _- r0 Y' ? U
Note as well that you can easily detect this method with SoftICE:" E- j, e G2 M- E
bpx Get_DDB if ax==0202 || ax==7a5fh+ a0 t0 v# Q" W* W) M
& v* E1 L3 ?+ F2 `5 }__________________________________________________________________________
A7 C8 u+ W% H* O1 K$ ?& H* H; I0 R9 d3 M
Method 10
, G6 c" C0 @) V! l=========5 l& e7 u8 E/ @" b- l' c2 O. B
& }) J1 p6 D/ E! z: z2 ?. I1 r
=>Disable or clear breakpoints before using this feature. DO NOT trace with5 U3 I. {+ p; I! |; L1 O, h) _7 O2 @
SoftICE while the option is enable!!
7 X/ A( {, c$ E6 F/ P. r
0 f- o! p# H( n. gThis trick is very efficient:/ G. x; _3 G! m8 _* X4 F6 c. S4 \. M5 @" l
by checking the Debug Registers, you can detect if SoftICE is loaded
Y: l" O9 P2 b( L, J5 f( S(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ \/ Y3 T* t/ E( z3 }) ?* ]+ T
there are some memory breakpoints set (dr0 to dr3) simply by reading their
$ n% o& Z( I/ z6 T! Ivalue (in ring0 only). Values can be manipulated and or changed as well9 ?; x' W+ L# r/ p
(clearing BPMs for instance)
% j/ B k* s( Z. G# i
7 s0 v9 ^; S% w__________________________________________________________________________
8 i" C1 T1 G4 }8 F3 r) R* A$ u- J! Z8 b
Method 11
: R4 b5 z: ?5 \, S! v0 w=========. \* l+ d/ c1 z5 ~$ |+ L
; ~8 q2 M1 Y0 x; D1 p+ I& ?This method is most known as 'MeltICE' because it has been freely distributed6 d8 o8 i9 m# Q$ }, |. |
via www.winfiles.com. However it was first used by NuMega people to allow$ Y$ J! O9 r5 d8 \* d" X6 A- }7 _
Symbol Loader to check if SoftICE was active or not (the code is located
6 N# M6 `3 q( Q( a% M8 y+ vinside nmtrans.dll).
4 V7 Q! i+ t' y. ~- M5 {) t! n- q- Z5 X0 g9 g/ v; R
The way it works is very simple:
5 j4 {7 ?. P# F+ q4 UIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 e/ ^4 l, D/ c j! K7 zWinNT) with the CreateFileA API.
4 [# P% y9 y* _8 v& _; c% _9 q! I, @
: \! j {* {; z5 ~Here is a sample (checking for 'SICE'):
) I( E+ K, |$ a' z7 W7 p& z4 L& a1 k% g! S5 A# U
BOOL IsSoftIce95Loaded()
7 o7 z, _; M! y; }/ z3 V0 h{
% P7 p& n! g- `3 G# b) R& R HANDLE hFile;
/ K# _; y+ I3 |3 s6 Q8 \$ ?2 n. x hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 A+ B2 s& B4 K6 ^3 O! m0 d FILE_SHARE_READ | FILE_SHARE_WRITE,
2 {' C, i/ }8 F# R7 |, Y; d NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: r6 S1 I+ l% Z4 B5 E1 T" M if( hFile != INVALID_HANDLE_VALUE ), n+ O" z; ~5 c
{ T8 o. [8 M, e O
CloseHandle(hFile);! a% {2 S$ v$ u4 A: p
return TRUE;: v" X5 j% h4 x8 f# K
}
+ z3 q9 E7 k- Y; n- ~3 k/ K return FALSE;: Q! O3 `6 f1 Q
}" V4 T# k) \8 F5 I
. V: }' ?' P1 e. [5 ^Although this trick calls the CreateFileA function, don't even expect to be
; O, \) T1 g" |able to intercept it by installing a IFS hook: it will not work, no way!3 k. [6 E; p3 w; t
In fact, after the call to CreateFileA it will get through VWIN32 0x001F2 p A9 U4 N8 l
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* R! Y8 W! D% @4 O. k& e8 q$ wand then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 e( D) Y% t/ z2 Dfield.
8 M7 h- i8 Z1 i$ wIn fact, its purpose is not to load/unload VxDs but only to send a ! K9 V! X+ h6 w, W
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 z1 Y4 S6 T7 s$ K
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# R' e' j$ }3 R5 Z& I7 l) @ H- rto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 U9 L5 j9 G) B5 V# ]' Y
If the VxD is loaded, it will always clear eax and the Carry flag to allow
" Y2 ^" {0 H3 N) A3 P4 h- y' uits handle to be opened and then, will be detected.7 g% k4 G3 F/ P
You can check that simply by hooking Winice.exe control proc entry point
1 E* r; S9 t; F1 A$ R3 xwhile running MeltICE.
- g8 A, Q+ M# ^0 D5 [2 H4 |* j& Y
2 }( x* j7 g% C6 l# b- Q, n3 @1 ^# C3 n% T
00401067: push 00402025 ; \\.\SICE
3 p- i; f K# ^( \- g" T0 a' ]# Q/ g 0040106C: call CreateFileA! I8 o& n. ]6 ~& t# F5 a; i( q) y0 `
00401071: cmp eax,-0018 C1 D6 c1 C' ?/ n8 Y$ q3 Y1 ~
00401074: je 00401091
% k, a0 D$ |7 w* y' B( _. ]
# ]: ~1 G# p0 X3 p% Q' \- X( W( L- M
' ~3 e* s$ Z8 yThere could be hundreds of BPX you could use to detect this trick.
, t7 c5 W) {6 b1 K-The most classical one is:
% D* Q: ]4 L0 @6 _* i4 _ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* Z/ ?+ w# ^7 A% U, j2 M, g, U( a *(esp->4+4)=='NTIC'
8 h# m" Q( d K3 Q( r ~
- Z1 e+ P! ], \-The most exotic ones (could be very slooooow :-(
! e. B$ c7 O U2 H: A8 x" ?3 M" F BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
/ ]3 I# O5 v6 r- E; ?) ~ ;will break 3 times :-(" Q( \" r, z: `& r( f" e4 z B
3 `/ S1 @0 [( ` j-or (a bit) faster:
8 a+ f8 w( @6 @# M3 x) N BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 C5 q3 z9 {' [* y/ E5 I
5 A* t- S/ a$ a BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + U5 z/ H) P/ M
;will break 3 times :-(: k7 S+ e. v0 W+ S
3 {8 l9 ]% X$ ]) g, ]5 Q-Much faster:( p& A. X* x5 d" a/ t5 v" s4 F
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* A0 _. a* h* O
8 _/ ]8 ~ Z. K: v# nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen' ~/ @5 N; I8 u7 D- _
function to do the same job:
& ?1 y9 ~5 O7 \# e% ~. k8 b7 c
& }/ t$ q% t5 [. i' { push 00 ; OF_READ
- y. E$ b" j2 K mov eax,[00656634] ; '\\.\SICE',0
0 L6 ^# d9 X; \/ L+ M' q5 z0 k push eax% v9 s; d0 p2 n8 ^0 c% W/ m7 }
call KERNEL32!_lopen- Q6 h# n( g& Q) i5 D
inc eax, S6 n4 Q! C. J4 R6 h4 P
jnz 00650589 ; detected5 h+ `6 _- n2 O' j9 ^3 g
push 00 ; OF_READ$ v4 G0 C* \; _: ~' Y' ]) [; ~) _% |
mov eax,[00656638] ; '\\.\SICE'6 |) I; f4 {" l
push eax
9 B% d, `4 y: L. T* r4 ]% G: P call KERNEL32!_lopen
( |0 K/ E6 Y. P* B, m inc eax
$ z! P3 j7 r- {$ H- b# H jz 006505ae ; not detected
X: _, Q* K0 w* [ `* e1 X8 `% _0 _5 `6 q
6 @5 X3 b: u5 E4 ]5 ?' @; `__________________________________________________________________________! l& s) y2 X% H( P. B3 K
- t8 }7 @ e4 i4 P% }0 [8 bMethod 12- H2 L: s! \# |# E2 ?$ l# Q2 z6 b* E$ a
=========
0 K5 R- Y+ L6 w7 ~7 V0 I" Z
# w, P; K) D" |$ g$ S8 O5 Q8 E) UThis trick is similar to int41h/4fh Debugger installation check (code 052 T, q* D7 ]3 u5 h1 r5 M& a* \) j
& 06) but very limited because it's only available for Win95/98 (not NT)$ m: M" }; q5 g9 `1 f8 T
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 M1 \: X* U; l. g
& Y7 w+ V8 X4 L j9 c* _ push 0000004fh ; function 4fh
6 N" A* t1 z0 S) p& g/ Y push 002a002ah ; high word specifies which VxD (VWIN32)
3 ?1 n0 @% u/ T5 |* T8 F ; low word specifies which service. W$ h$ J7 m2 P
(VWIN32_Int41Dispatch)1 L& B \5 q- B
call Kernel32!ORD_001 ; VxdCall
. T& E( p. j& h9 m& t: y cmp ax, 0f386h ; magic number returned by system debuggers
5 }* f& t9 |% \# G; m1 f# M* i; d jz SoftICE_detected [1 ~5 ~! d) G- _( l3 W
& i6 T4 b0 |. f+ Q, q+ ]8 qHere again, several ways to detect it:5 W2 R0 D6 y& K# E- E
& q0 h; x- ~+ R0 Z* V ?! c9 C
BPINT 41 if ax==4f# r8 ~: b1 g" d& H: q: @ r" y7 D
0 @, r) r& T/ D W4 Y! E BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one6 L- c$ b Z7 N1 ]1 J( i
* ` ~8 b5 e# y, k2 ^3 U
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ I/ {/ a8 x: n6 i
- Q; C4 d( L$ Q: q& W" Z6 t' w1 @
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. k4 O# o- q/ h7 V/ P$ G# K6 z2 ]# l
__________________________________________________________________________1 w4 L0 P. j' t9 q7 V0 W0 H* t
! }8 Y$ `0 d: M' O) ]4 \
Method 13$ r! O% J! e5 D2 A2 X# v7 |& t
=========
0 ~0 W" g$ b2 U5 e& Y% V+ P# A3 @! W
Not a real method of detection, but a good way to know if SoftICE is
3 `- h+ x( X& K, u2 ~installed on a computer and to locate its installation directory./ L: S* M- m0 [2 P
It is used by few softs which access the following registry keys (usually #2) :
3 V, a5 P2 L5 v% C$ j. W: k' W+ L- {: z( k
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
s: Y# `: n# l" J) J$ t3 H\Uninstall\SoftICE# o! J& L, {" \
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! J& S) Y. y+ q- `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 I! x5 y4 y9 v/ _0 D! R
\App Paths\Loader32.Exe" w6 B$ v! B7 \$ e) ~$ @
) ]( ^4 B$ R9 U* k: ^. `7 ?7 q/ F) P
& h, ^* d& ?# m6 LNote that some nasty apps could then erase all files from SoftICE directory6 S0 i7 p0 H* f* m7 B5 m' |' B7 U
(I faced that once :-(
$ l" o3 q' Q; E4 I) w% y5 U6 s) A# g' r5 C9 k: Z( j
Useful breakpoint to detect it:# b" G: h" M5 A. ?- J+ Y
. B) ~2 h6 }" B+ e BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'. x% `$ ^$ o* C: D( p7 e% d- Z( v( z
Q: {3 L# e! o. L__________________________________________________________________________- N+ V& v) A0 ]4 I' k a
7 N9 f& M- z8 G7 W7 i6 `: X) e. D# \" I, H8 b& D
Method 14 ( B' x& }: X# B, Z7 a- t0 X9 z
=========
8 Q4 _' _9 D' W3 L* `$ F( X; ~; l7 H) G2 W2 m$ M; Z& ?
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
( v/ y' H& v5 Cis to determines whether a debugger is running on your system (ring0 only).
' u8 h( p) V" N, Z/ y
* e7 A. m* f, {$ _2 ? VMMCall Test_Debug_Installed: C# o( D2 K% w, p/ @
je not_installed1 B( g- |* u$ K. l
/ U7 @! `8 e3 g* n7 UThis service just checks a flag.
. b! F2 P$ K$ c( d/ A3 S' U</PRE></TD></TR></TBODY></TABLE> |