<TABLE width=500>
% H$ [- u. Q- W* s<TBODY>
/ `* `% w( n+ r: b5 F<TR>. l7 l6 y" r* V" T0 b. g/ B
<TD><PRE>Method 01 0 v2 q8 N _5 @8 a
=========
2 T' J2 a7 P4 y6 N: i+ L- i% O9 w7 B* K) F
This method of detection of SoftICE (as well as the following one) is
6 O% q! R; k3 g: q5 Vused by the majority of packers/encryptors found on Internet.
/ X* W$ s* ^0 p! T3 C, CIt seeks the signature of BoundsChecker in SoftICE& d! ~0 ?5 O" A! s7 d
; a- X3 q5 s# |: ]0 S2 u) Y mov ebp, 04243484Bh ; 'BCHK'4 X( O8 G6 X' j& \8 w
mov ax, 04h. k9 E9 P5 o0 j+ P4 r& T2 ?0 I9 Z
int 3 " q9 Q; v& ~: b! Z5 E8 W& V+ ]
cmp al,4
9 U/ t: `2 n1 d, ~% p N jnz SoftICE_Detected
: G' I2 G4 I2 r! I. M* n& ?& g9 e+ I% t6 C, f8 R% E) M: D8 G
___________________________________________________________________________
1 N! N8 |' |/ N
/ Q `7 }; a$ V' f. ZMethod 02- P. A9 v& v" W
=========( X T; o! M. r# x
. U) J) U e+ `& a& A( f( ^; u
Still a method very much used (perhaps the most frequent one). It is used
8 l; {$ A. Z/ P1 F$ bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
& w. M2 ?$ u. [or execute SoftICE commands...
3 y, E3 k* A# E/ WIt is also used to crash SoftICE and to force it to execute any commands
% O/ V1 a) ^$ u) R4 M(HBOOT...) :-(( ; w7 E5 Y+ _7 X! W [
. {3 t, a2 V. R) A9 h$ NHere is a quick description:/ u& ]; M+ O. A2 r& ^7 x
-AX = 0910h (Display string in SIce windows)
d0 ?$ {% H+ d# R, v: p/ H-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ c1 }) _# z6 w( G% `5 [- y5 ^$ T-AX = 0912h (Get breakpoint infos)! r! ^4 n$ L) @6 _6 [4 l2 Y
-AX = 0913h (Set Sice breakpoints)
8 p) \" \5 H8 |" Q0 ^-AX = 0914h (Remove SIce breakoints)" W& p' j3 X& q) p
2 B) J* C- k& a
Each time you'll meet this trick, you'll see:1 Q% \. j6 _; u0 j# F
-SI = 4647h( X' B/ D" _8 Y) m2 f+ o
-DI = 4A4Dh' O5 _4 z8 Z7 h P
Which are the 'magic values' used by SoftIce.; ^: Q5 u5 [! x' u* B: c% O: I! I n
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 l9 w* f& U% y2 K6 X8 g5 }& u
1 v: _& g& D9 I4 d- Y k' ^' BHere is one example from the file "Haspinst.exe" which is the dongle HASP9 ]% J! |! n2 k( u ^
Envelope utility use to protect DOS applications:
1 M) m! @5 n$ E. y* [6 F+ C
+ j! a0 k( K4 j7 E' X" Z! d) P! V0 P: b8 D' \
4C19:0095 MOV AX,0911 ; execute command.
) R$ L. J) S# A# F3 h1 |4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., @& Z7 u( o0 A* ], f
4C19:009A MOV SI,4647 ; 1st magic value.+ H7 i$ V' B+ X/ Y6 c( S3 m; U4 \
4C19:009D MOV DI,4A4D ; 2nd magic value.0 V. b& U9 \& T$ k) H6 L
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 | l8 z. v0 _6 A% X7 I4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! t7 O9 t% A+ D# h
4C19:00A4 INC CX' u9 R$ |6 d* s( L( O' j: D
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute) a5 V5 F$ m" f8 ~+ R
4C19:00A8 JB 0095 ; 6 different commands.$ X8 B! B' i% v
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& b: c4 |& w$ d" r9 Y2 U" v4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
7 y8 u- W3 ^# w; F
* z+ ]2 J+ X C4 n" w: u/ MThe program will execute 6 different SIce commands located at ds:dx, which+ F5 J; W' ~ J5 q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
- v$ a) X9 w: i. }5 Z# {
$ w% C3 j6 F1 B, h% J- }* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
Y/ _$ ^7 g3 q, k$ Y) r5 d___________________________________________________________________________
6 z7 U. M: k" z3 j% r1 S) N, R1 f" D# j1 I7 L! p
) e6 a! z. b) S6 }3 s* |Method 03
' d1 @, K% S0 y, R=========% e) y( M9 c* w2 U8 c, T4 V
3 D, o. _/ |9 F1 }3 ]7 i
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
6 l! m2 c' X/ a2 Z G' o8 X! [(API Get entry point)$ K2 r' s- z2 w* }5 O/ {
: Z( \, K5 R4 ?' B9 o+ y
& f" S2 Z$ { e' R+ g% i xor di,di
( W, w/ r; U" u( }2 o( { mov es,di/ r+ j L# v/ X/ O, X/ b- l7 z h7 f
mov ax, 1684h 5 v0 \' m/ [- r7 N5 T9 H- K
mov bx, 0202h ; VxD ID of winice
$ L( ]* t4 u; K1 u$ B1 w4 I int 2Fh4 h' ]& g9 Q3 y- Y% K
mov ax, es ; ES:DI -> VxD API entry point
- I. ?& G, |1 |$ d- ]( E add ax, di
9 D; P" k8 y5 c& B2 _: C& a) ], _ test ax,ax+ A9 j. ~) V6 q4 w1 A0 }
jnz SoftICE_Detected
, j; e. J5 J* H( } u7 R# j( ?
1 u3 n' `- M. m1 K$ E- F, L___________________________________________________________________________; g* h& |! ? U. b
' x- N; s4 a. F7 x) z \Method 04 G8 w8 r& B0 a$ \; x) F/ j0 u: m
=========
& b5 _! e. ~& W, B/ r9 M# d5 N3 |# Q" w# M# ^& ~- l
Method identical to the preceding one except that it seeks the ID of SoftICE
B& T: P+ N8 w5 H8 X: ~- GGFX VxD.
" S* G, n0 i' Q. d6 }' K2 `9 U9 F4 W Q- ?' f' w
xor di,di
' M1 y8 ^' g8 A7 f( H& r mov es,di
: g- v: f+ G& B$ Q) N/ |) v) S mov ax, 1684h
1 U3 ?- w0 K+ q: n mov bx, 7a5Fh ; VxD ID of SIWVID
1 T4 u# P$ P$ I. y# f int 2fh8 G% n( O) P- m# D* M
mov ax, es ; ES:DI -> VxD API entry point( h: N/ B( W! r3 l
add ax, di
: [& p" L7 F4 h( T test ax,ax4 N! ?& a5 ]. r {
jnz SoftICE_Detected3 f& p$ u4 c1 Y) q3 t5 i2 `# u
2 d5 `/ s8 O7 E
__________________________________________________________________________: c% |4 Y3 C0 I" ?0 }
( R/ o1 F3 h4 j( ]7 l& s/ ?+ S8 J5 c
Method 05
( N: k$ S7 I2 w* C3 I=========
6 S8 S. q+ r( \4 \- u" d5 b8 h5 P5 z( I# K; C
Method seeking the 'magic number' 0F386h returned (in ax) by all system) U9 ?8 ]" O* t$ I5 W E( i
debugger. It calls the int 41h, function 4Fh.
1 L% C1 H5 X( w3 R: b7 b: y% fThere are several alternatives.
# A0 K: d2 b' x/ z: l7 F8 A
* r/ x: V, [, j& q8 T! a9 I, CThe following one is the simplest: z- r- b6 X8 u- g8 J7 p
2 g3 I8 }' Q, \: A( `2 z mov ax,4fh9 h' n% Q: k3 I$ V) T/ u- ^2 s+ ]. G+ Q
int 41h; H7 c' q% I8 X) o
cmp ax, 0F386
4 F* ^6 m! l" u3 `+ w jz SoftICE_detected* G3 @/ i) Z* |! r% b" r
: X0 j* C1 p+ i
0 i8 Y: T; a" G# |& N$ B4 iNext method as well as the following one are 2 examples from Stone's
o9 c$ V" ?5 |( M9 A"stn-wid.zip" (www.cracking.net):
. B7 Y ^4 A: N: q7 Y2 ^$ M5 `& B) b; G2 r/ t
mov bx, cs+ g& x: o/ l4 P6 s
lea dx, int41handler2
: @; }2 f2 x: Y9 ?) @ xchg dx, es:[41h*4]
" a: v/ x! Q1 J: S( @ xchg bx, es:[41h*4+2]1 p0 j5 e. b& ^
mov ax,4fh( o8 ^7 `' n- ~" C u9 F. n
int 41h) M5 q4 f& M: m' w8 D5 K2 G
xchg dx, es:[41h*4]
" r5 L9 V. \' j4 D; R: ~* V1 K4 N xchg bx, es:[41h*4+2]8 Z+ N# ?6 ?5 Q( s% D! P
cmp ax, 0f386h
P1 e7 ^/ I1 G jz SoftICE_detected5 m! [7 V1 [% X- ?8 |' t: \9 M
7 a) l8 p) Z/ S; Q$ b. W; aint41handler2 PROC
, L; j i3 ~* G iret
0 W. O& ~2 `/ g" s0 [int41handler2 ENDP
1 r$ |$ z5 N! X* a) S
9 _) @7 B6 [4 ?6 d. W" c: d% J
6 J( K) G% r$ x8 I4 P( u( x_________________________________________________________________________
& D! u7 U4 }( V9 Q2 b+ ]) I0 L8 n6 A4 D3 E* V: A! f
% K2 e& A5 b' i, R1 @Method 06( y; K# D4 w; B! M( D, {! @1 p
=========) x8 E: t- G* u5 K: _% [
" }: h+ I0 z" v6 } s
- O t# L& Z8 o: _5 A2nd method similar to the preceding one but more difficult to detect:1 F! \0 w5 g H! G- p$ Y' C
) w: } m. F, C) T( l
# }; ~% t0 f5 K2 Q, ?: O0 c6 Gint41handler PROC
2 C$ ?& L* u# R6 I8 S( L1 _ mov cl,al% H5 G( k2 t: D [6 `1 _: u6 {9 \
iret3 ]- h2 ^ w/ ~! M3 I
int41handler ENDP
! a, l. |. n( @! J& J- g8 g- M# S! X5 b) k' K4 P
, L0 {2 \" J+ Z! x xor ax,ax# O8 i; k5 _$ f* s& I$ y2 O. O
mov es,ax5 H5 @% b$ n. q' o$ S1 E- D( U
mov bx, cs
7 b1 M9 p0 Y9 r lea dx, int41handler x0 R/ Y0 c4 \* e5 o( e- d
xchg dx, es:[41h*4]$ J7 m( M8 m2 O8 O/ {+ Y
xchg bx, es:[41h*4+2]8 m" G. N7 H5 @+ H9 D( @
in al, 40h: l" s) g* y( j4 L4 w
xor cx,cx5 x- R, t; \, h* l* f
int 41h
; f3 X# U4 f- Z1 p: D" V! [$ B) w xchg dx, es:[41h*4]2 ^+ F0 z' m9 @$ `
xchg bx, es:[41h*4+2] h0 t3 C1 h* X: F1 N4 j0 ?6 ?
cmp cl,al7 ~+ ^2 g5 }: B- @4 G& O
jnz SoftICE_detected
- T1 f% Z, k0 a/ M7 y: ^7 p7 R$ @7 n8 g. t* A/ D
_________________________________________________________________________
7 s+ a3 e) H# M- _3 Q, _" q# D8 I6 x4 U
Method 07
8 j% f1 d" u" F& i8 w1 B( b=========
9 L5 c- ~0 y( _9 a$ Y y6 o$ Y. c/ a" @5 ~' k7 [( h3 D2 |. G
Method of detection of the WinICE handler in the int68h (V86); A; K* c8 q. i: y+ F! {# y3 g
0 O: x$ Z; ^4 w- U mov ah,43h
( \5 x) @ `, _1 r/ x/ \& T( z7 z int 68h
w* w0 S* g2 Y0 v cmp ax,0F386h
0 N. Z; [4 F& h" h! A; {/ e# t, @ jz SoftICE_Detected
+ g, U: L2 M1 k
, C4 v' V4 s" \+ N* |
8 B3 i( i; D6 X% B) M=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit2 u; G% Z4 z1 E% ~4 @' I
app like this:
: d% X4 `* J; N2 [0 H* i' l4 g9 b5 }, i5 i6 ?" T; Q
BPX exec_int if ax==68
T8 o! x' ^" p4 O- g( z3 I (function called is located at byte ptr [ebp+1Dh] and client eip is
! E' D" e1 ~0 w+ A! N located at [ebp+48h] for 32Bit apps)
# i! J z( o7 _' e- B4 p N1 A: g% |__________________________________________________________________________$ q% J/ ]5 D: d/ _# R% R
# J7 d+ v9 g, a5 S- }8 I5 d0 c
! B. `% T4 Y4 N: M5 ?0 a
Method 08/ H3 x. x. S* j( N5 u
=========7 f% |& s& z' f3 Q2 t5 V9 _
# V* O- Y) T) b# h
It is not a method of detection of SoftICE but a possibility to crash the
! W+ v8 B3 o; y* A- K0 ysystem by intercepting int 01h and int 03h and redirecting them to another
, L" t) J/ ~! q: K6 kroutine.
# B; @7 i& q, c ?+ ~. S Z) U" I$ F! [It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points; I( {2 T% x" u
to the new routine to execute (hangs computer...)& e3 M7 D M+ j, M/ A
# S, ?& \) Y- y/ r! J8 f mov ah, 25h, d% o, o9 y* v" w7 K- h3 I
mov al, Int_Number (01h or 03h)
3 Q w# @0 }+ [2 s1 _4 l+ [! l" t mov dx, offset New_Int_Routine* e+ s7 Q! _7 ]1 ?( a; [8 M, ]
int 21h
! r. r+ e2 o: J& Q4 w3 L. Y8 k/ C6 @3 ~2 i
__________________________________________________________________________. S' u! Z7 L M' p8 E/ i
" x9 a5 b7 K, J: q
Method 09
?6 z; J* D5 t, k5 k9 f=========
: J6 e/ W& P4 Y" V: t% ^* O I% X
+ @* b/ m) k, A1 q( }6 uThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
# \' B- A% S6 v- T. o$ K$ a4 m/ Vperformed in ring0 (VxD or a ring3 app using the VxdCall).6 y. I# c0 U5 B. W$ \4 ^
The Get_DDB service is used to determine whether or not a VxD is installed+ ^" P& R+ |& z2 \9 \
for the specified device and returns a Device Description Block (in ecx) for& K' _. b* X+ T1 J
that device if it is installed." j7 [+ a. J+ N6 M, @
$ J+ {& @, H0 l1 C
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID) L+ i4 u% P' {# M. i
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-), E2 G0 C& V7 |: N- @2 S% Y8 i
VMMCall Get_DDB( W+ J% t/ j9 W, M& ^2 M
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed" |* x) ?8 @* m) C7 A3 O/ e
- j! k W/ W1 d
Note as well that you can easily detect this method with SoftICE:
/ o5 l, `3 J& y9 B1 C bpx Get_DDB if ax==0202 || ax==7a5fh% O* m4 M7 ^. h" N5 Q
1 H. s5 `( i" s2 j7 u__________________________________________________________________________
) T7 k2 x( Z# V* S1 j/ E u H: M3 W# d% v
Method 10
) r& l7 v( r8 e) E9 s2 M) |=========% }/ t3 [6 k, f. X8 ]9 g2 {/ H
' Q& o! {$ t) R( t" }
=>Disable or clear breakpoints before using this feature. DO NOT trace with
! u2 J3 u. E7 D4 U SoftICE while the option is enable!!
' N$ z3 Q' z0 \$ z: {( K/ y+ \
5 R% B) t8 ?: uThis trick is very efficient:
( \2 |, S2 K# Y) K& S% Xby checking the Debug Registers, you can detect if SoftICE is loaded
- r. \$ @6 R" @. q3 ^7 Z% i(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if, r/ {' E1 u( A: z6 q/ A
there are some memory breakpoints set (dr0 to dr3) simply by reading their
9 k* ?' P5 ?" Y9 A( t2 ivalue (in ring0 only). Values can be manipulated and or changed as well4 ^6 G3 ?+ b/ }; H# Z8 t
(clearing BPMs for instance): D4 c8 s) f$ j) A9 y: x
1 s3 T9 B; u+ y1 p8 o3 C0 C9 [) |
__________________________________________________________________________
8 r# q) v: P' J' ?/ L! C4 V d1 S! ^9 d" q O8 B) u7 J( H% o
Method 11
% R, ]0 Z1 j4 d6 [' g=========- _) f1 Z% S0 n* S: h$ ]1 W
% O6 O- \$ C7 w7 {, U+ A' y
This method is most known as 'MeltICE' because it has been freely distributed5 v# X$ v4 s7 }3 W; c
via www.winfiles.com. However it was first used by NuMega people to allow
; q* A1 k8 C# i' kSymbol Loader to check if SoftICE was active or not (the code is located
( ~+ _% r! `- Z: Winside nmtrans.dll).
# r0 |2 V$ N% }* A8 p! V* P' Z3 s+ B' [
The way it works is very simple: ]* F7 p0 S% ?0 f! c: G0 N) i$ j
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 i, Y d; n" R9 ?7 p c7 I* H' u
WinNT) with the CreateFileA API.
; ^4 Z& N6 N k5 D; o" |1 [3 q4 m( c$ o* d% n- F- ?* }9 K- y
Here is a sample (checking for 'SICE'):# Z+ h& a! Y" J! f3 o
- v; E& p; v8 B- A9 x% ~+ Z0 iBOOL IsSoftIce95Loaded()
2 K {- L0 m$ a{4 d* i( c5 ]( t6 \" S
HANDLE hFile;
M( x% q/ d- L; z+ \4 A# o8 {9 Q hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
5 X( R" u# b# W- N1 w: n FILE_SHARE_READ | FILE_SHARE_WRITE,( ]1 R, M' `" ]8 F# l
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
. l) n$ P. Y# y9 J9 V if( hFile != INVALID_HANDLE_VALUE )
# _$ p( ^# ]0 V1 R/ @. ] {
: ?! U( x% `' g2 P" }! l CloseHandle(hFile);
" h- y- R3 M7 K' G: T. {" L( @4 Y$ r return TRUE;2 X' T! m; }$ p0 C, P0 M o
}: W/ Y7 ]' u2 S! H7 R8 e
return FALSE;
) Y; u' m2 n, @% P p3 c i% |}
# {* h/ h8 J/ |) U
, n& ?# W- F8 j1 n/ C- DAlthough this trick calls the CreateFileA function, don't even expect to be# Z1 _- j. y, ?4 i# n
able to intercept it by installing a IFS hook: it will not work, no way!
+ M7 C1 s4 K% s2 t- E& YIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 N" Z1 g8 u; Pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. d6 X+ H- P" [4 j0 Y5 Iand then browse the DDB list until it find the VxD and its DDB_Control_Proc2 v) ]8 O: f2 N* c# R
field.1 Z6 F9 l* I7 P( w u* \4 n
In fact, its purpose is not to load/unload VxDs but only to send a $ ~5 f4 d- C; f. t- W" B( P
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 B1 n( _5 g. y. v' \$ ~1 M* @
to the VxD Control_Dispatch proc (how the hell a shareware soft could try p# a% U: y" y- d0 H
to load/unload a non-dynamically loadable driver such as SoftICE ;-).) O9 } G7 `8 }3 E( o9 K6 k
If the VxD is loaded, it will always clear eax and the Carry flag to allow5 T6 I, M1 m0 A" @8 c+ S' R
its handle to be opened and then, will be detected.
6 n9 |' o9 V3 b) Q# W4 D6 SYou can check that simply by hooking Winice.exe control proc entry point- w+ ]8 o( ]2 J* x( ^
while running MeltICE.
9 `( O/ r. g9 n. w
. l1 l, ~1 H" M$ }9 V0 }) z" ^& O6 Y8 N0 N
00401067: push 00402025 ; \\.\SICE
2 e2 C1 A* X7 Z- ^" u! _ 0040106C: call CreateFileA# W p) [' E$ Q2 `( z# e
00401071: cmp eax,-001- O0 l2 }! l/ Z
00401074: je 00401091
4 b: R) K. ?0 F+ m, z# d- Y
5 m) e4 a1 J C& i0 ]; M, s. ]% `1 N2 M: a1 q
There could be hundreds of BPX you could use to detect this trick.: X1 i' Y: _$ H0 P T
-The most classical one is:( o* v) n! r3 _* G' B- m
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
0 ~* x5 U+ A# {1 G0 }5 z2 K *(esp->4+4)=='NTIC'
8 |, n0 J- c8 d! `8 i2 {, e
( z; B% { d t$ I: f" S-The most exotic ones (could be very slooooow :-( o- b$ i# b, O/ a: u$ ^0 ~
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( o* k% w) u- J9 n3 K ;will break 3 times :-(
/ S9 s' b1 n) ?: V3 V! n% T1 ]+ D: e) J; z
-or (a bit) faster:
) O& K P9 ?4 a2 N2 \ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 {: x p" V0 F k% R( Q ^4 `0 @/ J- M; k; D/ T/ O
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 x# G N3 |6 @) e7 [: `
;will break 3 times :-(6 V# S2 [* P6 I2 v" Y
! M' R S# a t2 G ?-Much faster:7 `/ _( K! y' z0 M
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
. _: `' `5 R6 E! H T, ]% Y6 y9 U0 ?
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen7 b% H1 r# o/ [0 g, @) R% F
function to do the same job:/ j- v2 Y% @2 ~# L2 k
5 N! {% N: T. ~" |3 i push 00 ; OF_READ
+ f9 Z0 g4 G5 c5 o( |1 s9 o# X mov eax,[00656634] ; '\\.\SICE',0
$ l% Q! c3 d: \. L. k4 r5 g$ C2 o0 D push eax
( V! B# m$ l. l/ N2 \. W2 p call KERNEL32!_lopen
- B* `5 J1 h5 x* J V$ d inc eax
- N5 x" h2 ~3 \5 V) T jnz 00650589 ; detected
6 Z/ q3 V% ~( o5 q& X$ [0 u; x push 00 ; OF_READ. o$ N z# _% r; w8 X8 ~6 v: q
mov eax,[00656638] ; '\\.\SICE'; E4 ?+ Q6 r9 t7 m5 I
push eax
1 R1 o2 k- ^; h6 m( c, J call KERNEL32!_lopen
b C5 ]2 n6 I) K. G$ Q- c inc eax
! {$ z8 ]0 x7 R# e2 a jz 006505ae ; not detected
; E- D; A0 f6 M7 t9 x0 d
6 p; K1 Q0 j+ P! \2 y" ?$ |4 D& u) D! k' Z% p ~) f$ O0 ~3 I4 \; k6 F
__________________________________________________________________________& {. {3 ~* z- g
: i0 x I1 T3 {3 g, y+ Y/ T
Method 12& s z9 P7 y( [- \7 Z; X- ]
=========0 h* q3 g) f2 }& ^7 A, G
4 v7 X. O* v8 N2 GThis trick is similar to int41h/4fh Debugger installation check (code 05 k2 M4 X( G4 w G. `6 m, }2 _8 _
& 06) but very limited because it's only available for Win95/98 (not NT)
( u$ K8 b8 @' x1 s- ?0 c. }$ L" e! zas it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 P, T0 P# d1 d1 R# |/ D @
( t. O+ X6 N3 E+ \. P. [+ a6 I push 0000004fh ; function 4fh+ e3 ~1 c5 L2 c& Y+ W
push 002a002ah ; high word specifies which VxD (VWIN32)
9 R# |& g9 c- U. e' Q3 e- x ; low word specifies which service
: I7 {. y! K0 w5 J2 r* |7 Z* F, b (VWIN32_Int41Dispatch)
* E7 ]! |, v1 H/ L, } call Kernel32!ORD_001 ; VxdCall3 A. M8 D( `9 k' U4 v7 N
cmp ax, 0f386h ; magic number returned by system debuggers
4 y" S5 l& y4 Q) V! ]4 e" ` jz SoftICE_detected
- b! e( F" a0 R6 }$ S3 s, q; e
7 o* M, v9 J5 P1 w$ `) aHere again, several ways to detect it:( V3 R' N* s! w2 L
% a3 d! b$ R$ V, F
BPINT 41 if ax==4f
3 J0 ~; z& [9 G9 t, y8 d' y# O0 {9 @
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one' T3 g) O3 X4 b/ x1 c) D. r
) O$ r: E1 u" G$ ?6 B
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 C" N9 O6 C5 s" @) S5 H6 K
& z2 B4 H! f! Q# A
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 U5 E/ D1 h: v h9 N7 p# [- E
+ O; e1 `# w3 U$ Q( r
__________________________________________________________________________$ e3 V) z3 L: j R( Q) H0 i- e
7 E! ^- u# ]& |% S6 |# ^& h& }Method 13
% M4 g( i% B) p& n0 {9 M! O/ u. V=========
& B1 m2 M: l7 F8 F
: h" Z) @; Z( W, U0 qNot a real method of detection, but a good way to know if SoftICE is8 o& X" d6 i( _/ C' K3 t! f
installed on a computer and to locate its installation directory., J* f' u$ G3 ?; ]% P
It is used by few softs which access the following registry keys (usually #2) :; N& e( |' V! Y+ }: x2 }7 {
d# V/ D$ _; I5 v! X+ S
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion+ Y) U7 h' e. a8 K/ A- _6 \# W$ K
\Uninstall\SoftICE6 ~3 d5 S R' b/ B
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* [7 d$ Y/ c; a-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& w- |8 q5 x! Y
\App Paths\Loader32.Exe
! q+ G u$ I' R
5 l2 _/ v Y. y( x# f* ^, Z6 G& ] I* J, m6 k, Y/ X$ G9 ?
Note that some nasty apps could then erase all files from SoftICE directory7 V% e* i1 f2 v2 u
(I faced that once :-(
" ?* g4 s4 q; j" t& n7 Y0 t$ y9 p, w2 z9 N+ E2 E
Useful breakpoint to detect it:
/ _( [$ T( T/ M: o% Z
( B+ a' h1 y! N: i5 A; D. ^ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
/ Q; F9 `$ { i0 \* B
5 p; i( A) }" u6 W& w$ P6 X! }__________________________________________________________________________
/ R [- b. H9 K- T
6 k: Z: r0 Y( r; S+ ^6 \0 }4 J4 h; y' L7 C, r% J9 \: s
Method 14
) j, g$ J. \0 e2 u* D=========
1 ~% r6 G& o- _* C% t- m( n' {
% F, m- p- M9 \: O5 eA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& I0 F; A# ?/ g/ r/ A c8 H, p
is to determines whether a debugger is running on your system (ring0 only).
+ _+ v0 [ W) ]
+ |2 ~/ e* M6 D `& D) ?9 t VMMCall Test_Debug_Installed& F8 X) g {1 w( ~
je not_installed
! c$ W; z* q9 ~8 S ~+ r
) Y: l8 m+ |2 `( y# U) z5 B& `This service just checks a flag.
" a" L, Z) v: N</PRE></TD></TR></TBODY></TABLE> |