<TABLE width=500>
' ^8 C! C/ l! s* y$ {<TBODY>% Z8 I5 D6 S, P7 i: a9 ~8 a
<TR>
4 y8 v+ j# t1 G) O<TD><PRE>Method 01
7 e- H) w# G- v& R0 P0 V=========) r4 Z N2 n$ H E0 g' g
( @ y, j L' M
This method of detection of SoftICE (as well as the following one) is
/ [7 C" _/ `! H4 Yused by the majority of packers/encryptors found on Internet./ s' A' _ g9 U0 S% c) q3 q1 O# M4 W
It seeks the signature of BoundsChecker in SoftICE% ^3 n, ?+ g2 N" x% h P
3 \" B. u; @+ B% I0 \+ d# {
mov ebp, 04243484Bh ; 'BCHK'
1 K5 ^! u$ }/ G) ^6 m% t# x mov ax, 04h% g( t0 L$ E) g' N% z4 C5 `
int 3
/ }2 w& D' P; U9 d! v cmp al,45 ?. c. w1 [5 W$ t" l% J: m
jnz SoftICE_Detected
" }0 A+ R4 m5 I: g1 b3 l
7 I* S9 [8 ]4 h/ v) N___________________________________________________________________________
- U1 m# A: ~9 o* K% N$ m6 n
7 e" n. w% Y+ [+ OMethod 02# D+ B! D) {9 x2 Z( p# r
=========
( g: Q, X. a" s8 r* E' k( T/ @
1 C; ` A" V0 IStill a method very much used (perhaps the most frequent one). It is used( n6 k! P, w# U( {* C% M
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,% s# x2 t6 U$ N- Z0 v! I+ o
or execute SoftICE commands...
* s$ r( u, f. i/ y: n6 C8 KIt is also used to crash SoftICE and to force it to execute any commands7 C. }* q. i8 o+ P' N5 t* ` \
(HBOOT...) :-(( 0 } K5 |" o( A
X7 y& C* T$ T' } dHere is a quick description:1 U" s: L8 f% ]) G/ {
-AX = 0910h (Display string in SIce windows)
0 }7 S. T* c; T4 q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)) H: I* v# L/ g0 J {: ^
-AX = 0912h (Get breakpoint infos)% B& K9 D9 F1 w+ }) _6 r
-AX = 0913h (Set Sice breakpoints)7 w% |$ s' l; s- d* V
-AX = 0914h (Remove SIce breakoints)
7 u$ _9 M' o, R' Q% M" l, G! r* Q& q
Each time you'll meet this trick, you'll see:# G, Z$ ]; M+ `' J: z: X
-SI = 4647h5 M% N; S" Z4 P3 b/ @5 u! e4 Y8 n
-DI = 4A4Dh1 b% o/ w. Q, [+ P% R4 ~$ u
Which are the 'magic values' used by SoftIce.
2 c& k" ~+ Q6 E5 YFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
. ^8 G n2 q$ g4 |9 [# s: Q/ U4 C* u' B
Here is one example from the file "Haspinst.exe" which is the dongle HASP
- p- P$ \9 I7 A aEnvelope utility use to protect DOS applications:' E; U t; _- p1 I% G
* _0 n% w! `6 f* `, v- e- I
& @; @) E' w# ^- K3 {1 x5 F4C19:0095 MOV AX,0911 ; execute command.% s* L& S, x+ b
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
2 u1 U/ l! E$ `6 @# z* ?5 g( H# v4C19:009A MOV SI,4647 ; 1st magic value.4 B$ U& P# {+ ?: j) H2 \, o O
4C19:009D MOV DI,4A4D ; 2nd magic value.
' g9 E4 V5 |( P6 q4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)) i8 v5 A f p: c0 X& |6 h, y3 x
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 x( v) p7 }8 l7 J. Y4C19:00A4 INC CX
* I2 B, F( d2 F/ W: }+ @4 j4C19:00A5 CMP CX,06 ; Repeat 6 times to execute) v8 c: V* l8 T V) C
4C19:00A8 JB 0095 ; 6 different commands.2 {& b4 f( w9 Z, F
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
. z( c- ] X( `9 j; _4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ s5 {) G8 p; m* R$ k4 A3 d8 u, B( c
The program will execute 6 different SIce commands located at ds:dx, which
1 K! W4 q( S a5 E/ c1 Bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 q, z4 i6 c; Z3 O1 m/ H; @! q+ r: J( h- t2 d. K4 q6 {+ m
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.6 u0 x' `2 E' L2 m
___________________________________________________________________________5 ?: D' t* P/ L, ^8 g3 U
3 H: i6 b% F, B) o, j
" m8 ~1 B; G2 [ S2 P0 kMethod 03
+ s7 B6 X4 B5 Y4 j0 r=========9 R* g8 `* K" E1 a
% g! x# e: }9 F5 ~7 m
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
" R$ @* w* z: P* r3 i! j(API Get entry point)
8 o4 c5 o* R! q' y$ c1 ~5 C
$ a8 d4 G) U" t* q2 o
- ^! R9 y) f7 F7 g xor di,di8 {: l* h& A% u/ |# ?) N9 ^2 d
mov es,di# X4 B9 C* H' z& q
mov ax, 1684h 9 u1 B" W( _' G- s, {
mov bx, 0202h ; VxD ID of winice
% S# g& g$ M( ? int 2Fh" e- X/ z4 }" H' Q; ?
mov ax, es ; ES:DI -> VxD API entry point1 q: d1 Q" E: }6 l8 y
add ax, di
! ]; b& \$ R9 a6 H" @/ Y test ax,ax/ Y' g# @& U$ l& k6 X
jnz SoftICE_Detected
( S M2 `- W/ M7 S; q: p0 K; j; F. |" \; L$ v
___________________________________________________________________________) w1 J4 R1 t, u! {
; Y* V- F/ G& U5 @$ |* ZMethod 04
$ ` B/ `! d" d, S, x2 u- C7 ]=========
% W5 i/ |; P- t* g$ u: b4 e
+ [/ R7 D7 |. m6 g; L& ?Method identical to the preceding one except that it seeks the ID of SoftICE
5 A0 D8 u* H8 TGFX VxD.
1 x* h2 o$ A0 `
7 W& \; d$ r8 ]# B { xor di,di
3 u8 k+ p# H1 p L* E& W mov es,di# r% [" [+ q. i, r7 _) T* @
mov ax, 1684h
+ D; m3 a6 y, q0 e$ L3 D mov bx, 7a5Fh ; VxD ID of SIWVID
7 S) M D3 J2 ?8 F; X& k" P0 { int 2fh' P4 _8 B, x' k" E/ |+ O
mov ax, es ; ES:DI -> VxD API entry point: [' t; R7 g# w
add ax, di
, W0 v) R Y6 q- U9 N1 v test ax,ax
) }; D" V+ j$ o4 @$ [% w jnz SoftICE_Detected
" {# c/ o# G' ~" m
z4 k P* K- @' [__________________________________________________________________________
4 `4 F, j8 Q7 v: x8 {- o6 ~5 v- o9 |# | n. y2 f$ r& M& n8 D
, [4 x' U$ v g i* E% Z VMethod 05: z+ s. C- d' {, m8 u( y6 |2 V% i
=========
% T' v+ P3 \% }3 n) T. W1 d% d
R' s% b. ?, UMethod seeking the 'magic number' 0F386h returned (in ax) by all system" F! @$ Q7 X7 C9 r; ~
debugger. It calls the int 41h, function 4Fh.1 ?2 [0 p. u! o, `- B7 }2 y Q
There are several alternatives.
7 h1 ?& h) A3 E( r5 f; [8 y" p: c+ ~, U
The following one is the simplest:' G z1 t% q% Z/ v- Y
: j2 S4 f' e" r4 X' M; c mov ax,4fh {+ ^4 v, \9 ?' O2 G T& H" x
int 41h& b- [( y7 p% k5 r; ]* P
cmp ax, 0F3869 _- F0 e2 j* b3 O+ q, A
jz SoftICE_detected
& f0 a# M! t5 L" R3 x
2 f4 B+ ^2 I% j4 M/ b s6 D2 R# q, @1 c9 g: k
Next method as well as the following one are 2 examples from Stone's 6 T8 F% ]& n, u8 r) |7 k' R+ o/ ~# x
"stn-wid.zip" (www.cracking.net):
, i. C1 D# y2 V& P/ i' w* c( m4 W
. |' s. ~5 E W' r% m mov bx, cs
3 S! F1 G4 A, C+ }! ~ lea dx, int41handler2: A. b: G) W. k9 x. F2 L: J8 z
xchg dx, es:[41h*4]. n, N3 m; E7 q" J7 a" Z- o3 M7 g
xchg bx, es:[41h*4+2] ^2 |1 z" r) R: N/ J- c H9 V1 L
mov ax,4fh3 p7 t" O) j7 z: Y p3 G/ W' ?: X7 c( r
int 41h
9 F b% e8 `0 S* h xchg dx, es:[41h*4]
" `% [; Z, F8 A7 e xchg bx, es:[41h*4+2]
; m2 ?8 ^# m6 s; V cmp ax, 0f386h
1 A6 R% i) @4 i jz SoftICE_detected5 l9 J' Z3 @& C" i
# h6 N4 F. Q9 F/ {# |int41handler2 PROC9 q: t" `3 F, H. r7 ~$ M) K
iret# i( ^7 J! A1 D' C C
int41handler2 ENDP Z% M$ x7 A9 n3 E" u/ z& _/ v) F$ k
' i7 w i+ U, e. h) ^
3 ]$ m* q0 ]* ?7 E& m4 ]
_________________________________________________________________________3 m" o: t6 {: _+ n
1 o3 W% j: R5 S4 H
+ t2 b3 _- V4 B' E8 V) q" T+ UMethod 06
! v- _ k$ \( u$ A=========2 h+ q4 g) V& C; [
& g, N; m9 I4 E8 v, Q' R A9 d) }+ n/ h) ?4 x( \
2nd method similar to the preceding one but more difficult to detect:! x& O. A/ a; x6 s0 I _1 `
# i# w' \1 s' ^4 N
5 Y$ k5 Z; h' {. Aint41handler PROC; V. j& T: a/ `2 E/ @2 l& J( d
mov cl,al
. k5 u) o9 _1 @/ L iret
, ^0 R f% M1 p1 ^' k5 oint41handler ENDP
+ l( {0 c$ h0 t" g6 U( x0 l. |! n
& j+ d1 J1 J+ m3 @6 M, G' {* S6 P/ {# a8 n$ d# a! v y. v1 E
xor ax,ax
7 h2 ]5 A! M# [6 U5 h% _* ^9 k& b mov es,ax: [- V( ~8 o- x
mov bx, cs
( S/ @# L1 {7 b# [, \9 A lea dx, int41handler
4 ^2 b+ l, E% u0 S- X0 H# a6 h- l xchg dx, es:[41h*4]8 }8 ]* @6 D/ G; |( J
xchg bx, es:[41h*4+2], D; b# @1 p3 B7 f* x+ k7 R8 @
in al, 40h
- R8 ^! @7 f' [ Z8 O8 U1 Y xor cx,cx+ L w5 n. h) W! y
int 41h8 S- P! \! w# c4 L3 V" ~
xchg dx, es:[41h*4]7 A" _/ r* w9 y2 j
xchg bx, es:[41h*4+2]* _' ~) ?2 [, J1 k! d# Z
cmp cl,al
4 T D) ?4 n8 V+ Q jnz SoftICE_detected6 ]# C! X8 P P" j' v& L8 a
" J6 F. j/ d$ X* e, `0 c% G_________________________________________________________________________
6 U# @ E" x: z
- ^3 C' f* X, z* z) M+ c: P3 Y. C5 nMethod 077 d, A+ k; y0 n% X
========= A+ k: R* H% d1 G- G0 |/ |. ]
- D8 @$ h" k# [0 a- v1 z/ I+ |# H
Method of detection of the WinICE handler in the int68h (V86): g. U. ? Y/ }
$ e% [5 B* C, p$ k% o* r
mov ah,43h
- ^$ R* U, e1 d9 n# T. g int 68h
% Z1 }" H: H! d* ] cmp ax,0F386h
% x) {) z M0 _& T+ U' ?% b jz SoftICE_Detected
0 n$ v1 U, @4 I+ g" M- j& a9 ^1 c! W C2 A% ?* u" }8 x0 w+ m
G8 b# t6 d/ p" b$ R* C
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# Q% m, [5 w' z k, |' y. m: @0 r, y
app like this:
; p& I1 X; E3 N
8 R( z. g: w4 L% M6 \/ F; I BPX exec_int if ax==68+ b1 e8 L4 C/ l
(function called is located at byte ptr [ebp+1Dh] and client eip is/ V+ p2 c$ b7 H" o5 z! N
located at [ebp+48h] for 32Bit apps)% d& W: f# o; Q! y1 O7 W' v A3 J
__________________________________________________________________________$ l; `* a% B7 \) K7 J% Y
% H9 G u" [6 H( I& e0 K& V
, ~( H8 ~- _% g0 ~6 vMethod 08# }* ^+ a4 G. j& |: ]( F$ t
=========* L+ G1 r6 B- B' @- k+ n
6 j. X# @& m4 g3 e* d2 V
It is not a method of detection of SoftICE but a possibility to crash the
, j' C7 p3 k- W' _: ^% b7 X! gsystem by intercepting int 01h and int 03h and redirecting them to another
3 \% b/ F6 r9 H* P7 z8 |routine.9 X- X( D" g& i! h
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 `7 B7 h' e2 w2 ?1 d1 V5 k1 K# Fto the new routine to execute (hangs computer...)/ A: Y; l3 [, W$ ^. D1 C
9 \# \& i. z2 }6 z+ M
mov ah, 25h
! b ?( V p& _. F) \3 L1 l7 [ mov al, Int_Number (01h or 03h)
3 }- L* y7 r; V- d. M% Q' X- f" s mov dx, offset New_Int_Routine+ }5 J! D. c- V( `
int 21h
3 y2 `. H5 \* [( x3 q# @3 A+ c8 [! O
; u( ]/ _' D3 \- x/ V( J- g" O3 v__________________________________________________________________________3 l& W& c$ q* K3 k" f8 y; p' n
' q6 H& a# }; `+ f9 F3 _% p5 S$ q- T
Method 09
2 Q0 N$ e* E9 L4 N0 {=========" p5 y. x; O, Q, D7 k9 ^5 u, P% C
6 i% k U$ r8 ZThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ @5 [8 Z& s9 T3 v4 l
performed in ring0 (VxD or a ring3 app using the VxdCall).
- ^6 [3 g" m; `2 N3 D8 XThe Get_DDB service is used to determine whether or not a VxD is installed
l: `+ S8 H9 ?* Kfor the specified device and returns a Device Description Block (in ecx) for
\- Y4 W9 t5 I& _3 Sthat device if it is installed.
! b$ ~$ K6 _, f. |+ a2 z J7 {. G4 l4 u* H, b: \) O3 O& z/ h0 q% A3 Z' {1 |
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 l% S/ r9 @, @) d8 N( X2 f% E mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) U2 l7 x( ?9 @# k5 ^( L3 M0 ` VMMCall Get_DDB0 R/ [7 ^2 K4 G5 E" P( b+ H+ ~
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed$ w+ B6 L- {/ j9 V) h( J
+ k( z& f0 Z+ X" N5 F6 NNote as well that you can easily detect this method with SoftICE:8 N' N Z# z0 ?) L
bpx Get_DDB if ax==0202 || ax==7a5fh
# k7 Y: r# e+ j2 f- w% S9 ?9 {& M
5 T3 `; b9 { y' N__________________________________________________________________________
6 c% ~. \. q# _/ F5 O
+ a: d# B+ F/ m9 Y3 f/ V, {7 ]Method 10
9 m7 ~% s- A1 i/ w u0 \9 n" I9 s=========) W$ l" P. k9 G( u+ J' @
' B, ?: C! n5 B7 h" A+ U) e
=>Disable or clear breakpoints before using this feature. DO NOT trace with# Z. v! |6 @' h$ b* H& l
SoftICE while the option is enable!!
4 _ [2 B' C9 Y8 G7 [
- `4 m: U3 }( c6 F1 F- hThis trick is very efficient:- t/ P" w* ?0 f- J0 n
by checking the Debug Registers, you can detect if SoftICE is loaded2 O0 [4 C4 o2 ~+ {' U# s9 w1 U7 |
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! U0 X" _' L, ^8 z. _9 Y' ?+ f. o5 h! C
there are some memory breakpoints set (dr0 to dr3) simply by reading their; v4 Z @* W9 Y& a; g7 t
value (in ring0 only). Values can be manipulated and or changed as well
- X% _! A1 d" S& L7 W6 M' s(clearing BPMs for instance)( H5 F! n1 M. t' e- n- F
\6 ] u* w7 j) W& _" ] c6 l
__________________________________________________________________________
2 ^6 y/ @: `/ n% a' P5 `
/ C$ R) k) b) g( sMethod 11
4 O. ^8 P$ h( ?& {3 Z9 `=========
9 C$ N; ]0 p5 L& _! x# i5 v8 n) t0 }/ v5 |/ q$ d1 P$ ~+ n* y
This method is most known as 'MeltICE' because it has been freely distributed
& U+ ^4 m- O! G: yvia www.winfiles.com. However it was first used by NuMega people to allow
' r8 G9 [$ {. z# RSymbol Loader to check if SoftICE was active or not (the code is located& @5 K9 x0 a/ Z" }" ]6 B8 w) {) l% ^
inside nmtrans.dll)., N* r, }% |1 d" A6 s: | f- | g
2 Z- m# K" H$ V) H' T( k' h/ x" ?The way it works is very simple:4 y, s8 u& D3 O/ j9 X
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 g. l' g+ f* `2 s$ ]% Q
WinNT) with the CreateFileA API.
Q; a5 j$ P4 o/ K7 g6 X
+ |: ~; i; G* u" VHere is a sample (checking for 'SICE'):/ L$ e7 g, T6 R0 U, c+ r2 w" W4 j
+ q: v. r0 e1 q
BOOL IsSoftIce95Loaded()
. r4 Z7 P# e1 |) G5 b; w. o( q{
% l( m& P( Y& G% x3 m' } HANDLE hFile; b; \& F4 l" \5 T1 O2 _4 {1 C
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* D$ ~; A: S, |
FILE_SHARE_READ | FILE_SHARE_WRITE,) } |+ ]' q( R
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 J5 c; b* g* U. B$ J+ U2 V
if( hFile != INVALID_HANDLE_VALUE )
& K& k6 n' v% | j. w {
1 p$ e [4 E" n+ @& g CloseHandle(hFile);/ g2 C( j0 \4 ?& D
return TRUE;
1 I( J$ G4 I5 s }
/ j* X; n; a1 |& a9 ~- E5 C4 `8 x return FALSE;
& h/ ]- K) z/ q3 A# P- f/ l}
7 g$ Q0 |' }/ \ u2 |- i8 G3 y; N6 }/ \1 Q: s3 l
Although this trick calls the CreateFileA function, don't even expect to be/ z" }- n! _# g* O! X$ s& O
able to intercept it by installing a IFS hook: it will not work, no way!
9 e/ e4 Q8 }0 c7 B2 UIn fact, after the call to CreateFileA it will get through VWIN32 0x001F: _( R; h: ?: V3 L/ n6 e/ E1 I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 z0 O0 y" {9 |/ a6 mand then browse the DDB list until it find the VxD and its DDB_Control_Proc* k q9 |# ?( c$ x# W+ ` }
field.
+ [# h% v/ z( J6 }+ I7 p8 E3 GIn fact, its purpose is not to load/unload VxDs but only to send a s$ b7 B/ T8 H- j6 i2 }
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). z; a* @; y) l
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
8 q! P" Z( p& F' z; i$ tto load/unload a non-dynamically loadable driver such as SoftICE ;-).
U7 Z: B, A, V; V$ W3 M/ K$ a/ \If the VxD is loaded, it will always clear eax and the Carry flag to allow) {* W: H8 \& r$ f5 {8 [5 m
its handle to be opened and then, will be detected.% M( N: Z, S& X: O
You can check that simply by hooking Winice.exe control proc entry point
' j2 K( M3 j' Q5 R$ r' `: xwhile running MeltICE.8 P3 u) W6 [0 L- z+ e% [
" ]1 X$ A, F$ D/ D* B% C7 y5 Z7 ~* x7 g8 t- Q
00401067: push 00402025 ; \\.\SICE
" H) i) w8 L4 D0 n2 H 0040106C: call CreateFileA9 P6 V( N4 A" F: W7 n) u- _1 p
00401071: cmp eax,-001+ Q9 L O: r* M) ^2 n4 u8 ?2 ]
00401074: je 00401091% O$ y' \; Q& P# Y
+ d6 w/ }7 U; }* c/ B/ l: T) I$ W; O4 E& e( k! J, Y
There could be hundreds of BPX you could use to detect this trick.
0 Y, B3 Y I" m+ L9 l& W3 {/ E6 j- y-The most classical one is:
" r5 Z! T; s: Y BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||! b* L' v' P/ c5 ]
*(esp->4+4)=='NTIC'0 v. a+ l6 ~* S
1 H8 } B" ]* f+ g& y0 Q-The most exotic ones (could be very slooooow :-(
1 U9 V* M$ t* f+ I) q BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' o& i# u" `5 Q: K& o ;will break 3 times :-(" h2 H1 r. y3 K5 Y
) Q$ s' H- k0 y! ? @
-or (a bit) faster:
6 d. s: I2 g: @5 { BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
8 M R% e9 \( q8 Y' ^
( O* c0 n: ~# c( K# z" h7 r BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' " e K2 D# T# Y1 |& n; s
;will break 3 times :-(! k r9 S. _9 V3 l
6 u, p, i9 Y/ d2 O2 E4 `5 d9 n# ~-Much faster:
, X9 u! J! C9 n" Q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: S: a) J* d3 ?' h
) v; Q9 L8 p7 B/ D' W# FNote also that some programs (like AZPR3.00) use de old 16-bit _lopen7 m! m' h' Q' | G: M: Q7 b
function to do the same job:
% E7 r _4 d& m1 }1 e3 t; b) Q$ O7 E9 U$ J! Y
push 00 ; OF_READ8 t: B* G8 O7 t# e3 n3 z" L
mov eax,[00656634] ; '\\.\SICE',0- S& j' U3 G" l* b8 Q9 [
push eax
" ?4 Z4 Y0 f+ a( R1 }; j! B5 G call KERNEL32!_lopen
4 K' x; L# y# k0 ^) t3 S inc eax
' f0 W. a |" H9 W jnz 00650589 ; detected% k5 ]! { p5 g5 J6 [. y0 W: b& V
push 00 ; OF_READ! N7 W- ]/ s! _
mov eax,[00656638] ; '\\.\SICE') l- {1 M/ P& G+ C9 b; r
push eax; L, Q1 {) ]1 Z6 ?) V- j% |' D
call KERNEL32!_lopen" A* z' @6 C1 j7 x2 Z' [
inc eax
9 O" i/ H$ e$ P3 W* A2 K jz 006505ae ; not detected
8 p/ X6 B, k, X k5 h
# T; w- T) ~+ d' m
3 W8 T, t$ e. V7 t__________________________________________________________________________) o& m, f, x- y5 i, @/ m. Q j% W V! E
* [! o0 V( T' L+ u6 @" K, ~) R
Method 12 p6 O$ e! e: H5 Y) \4 Q# P% R. y
=========
' a1 O- `# o* a, {: p$ x7 n
) ^' {& y; q; O0 }This trick is similar to int41h/4fh Debugger installation check (code 05
3 w% Z3 s- Y% R6 s1 P8 C. I4 F& 06) but very limited because it's only available for Win95/98 (not NT)- I0 K D1 P( c) j" z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ G" {& w( I) y% p- c( B( Q% _& [# Z5 J D
push 0000004fh ; function 4fh
/ x! t9 A5 o% r- @& e push 002a002ah ; high word specifies which VxD (VWIN32)
, \( x" f! J/ z) u3 S7 [* J& h9 i ; low word specifies which service
" ^- D `- Z2 E, \2 ` (VWIN32_Int41Dispatch)' @: {! c; @3 U! Y0 G4 j
call Kernel32!ORD_001 ; VxdCall
" T2 F+ a- |* {& M/ O: z. q cmp ax, 0f386h ; magic number returned by system debuggers8 H4 c* ^% y$ C/ _4 N e! n+ _
jz SoftICE_detected
. c- P' c [. o$ k
( Y& i, l% i8 P) `$ g5 s* O+ p EHere again, several ways to detect it:$ p# v; s1 E6 s6 o0 ?
6 O' s: c3 t: M! [# b4 {
BPINT 41 if ax==4f
& q& i% \& j- S- d
' p, s9 q. T! E& N8 L) g' X4 F BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 o3 l6 c L7 z7 F
! L' Z0 \+ M7 I+ a! H BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A* J! F3 ~' A. h- d
+ T' o5 u3 {& `: c U+ m6 _4 @) ~ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% \! ]. @ e7 a: D5 t
& ?$ g, s1 ?6 @; f, L6 L$ p9 _
__________________________________________________________________________0 I7 G9 k1 {& R
8 m0 _ z- `! B* i! \9 iMethod 13
. |( d: T' k$ I X* |1 l+ W=========
" o" t* ]5 d: V6 n/ j" s4 ^& d! O+ r% k7 ^, h. B& U! y9 b
Not a real method of detection, but a good way to know if SoftICE is
6 C3 c0 a; ~: @0 } T( jinstalled on a computer and to locate its installation directory.5 g0 U9 j' T& o2 j- ]
It is used by few softs which access the following registry keys (usually #2) :
" v T6 s; { F( }& [$ K4 t3 {% A/ b- z% f
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# f' c7 @: D* E! |& U- N0 y& h) ~
\Uninstall\SoftICE" }: X1 o& c5 O% P, Y# u$ u) V
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 [. k" d5 |& m9 s-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* ~5 c3 H- ^" c, @1 a7 A
\App Paths\Loader32.Exe
( ]) B9 f/ T% b% y/ e2 {. T# y" ?: m* S+ z% G3 M
8 O$ w+ N' Y3 l# H4 O/ }$ c/ @
Note that some nasty apps could then erase all files from SoftICE directory
+ A3 d0 P0 f) y(I faced that once :-(" U5 _& {8 _" [0 n
9 k% W) |: e+ c" y/ g
Useful breakpoint to detect it:
* z8 e% ~8 h" ?' a b' C
0 A1 m1 |! c+ D& ? BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 c5 F8 V" S6 J& D l! E$ m
7 y! r# v, M+ `2 w& L2 w" Q
__________________________________________________________________________) y: C% [8 C0 j1 L0 q
5 v% E% V1 q* q/ ?" \9 c
/ p# \4 Z! F! v) q, t# f. o
Method 14
+ B( [( `. d* A" l$ `; N! b========= X4 z# T7 b* v5 T5 F
( T. b r* F& @+ C5 ~1 F7 y$ vA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ S! ^/ y |4 W' o
is to determines whether a debugger is running on your system (ring0 only).
: ^2 A5 _: {1 R s: F
0 h$ i9 ?' U' J4 j VMMCall Test_Debug_Installed
& s/ ?, j8 J4 O$ g7 ^ je not_installed) u) h. r) u. u, s
" \, y9 v: F8 X, n: }This service just checks a flag.
' M$ Y( x% C6 `0 A- F0 c0 @4 p</PRE></TD></TR></TBODY></TABLE> |