<TABLE width=500>
1 b4 T* n4 B0 v<TBODY>+ c0 g$ T" z, ^7 d9 k
<TR>
6 I( { ]' s& G* B6 r$ o<TD><PRE>Method 01 % C' k" r4 t; c# I
=========
# w/ ]+ @( U" c" z: X" z
4 K2 W+ R. A8 r% tThis method of detection of SoftICE (as well as the following one) is/ H$ m( Z" J. g' ?! j4 G6 ?% F! ]2 g
used by the majority of packers/encryptors found on Internet.
# \% H3 a9 g& N' ]It seeks the signature of BoundsChecker in SoftICE; V8 t' u9 J. C3 S
+ E. B$ |; j; r mov ebp, 04243484Bh ; 'BCHK'
{7 i, f4 e) ? ` D mov ax, 04h
' ] l/ o$ ?: h$ l9 c int 3
/ D. K% ^, y6 n7 r) h7 Z cmp al,4
/ ? V7 A/ S2 q, ^) p* Y jnz SoftICE_Detected
) _) r# k' a# f. p; z* C
$ ~+ t: f# o5 Z4 s6 A- W5 t4 {9 H; u+ k___________________________________________________________________________
, E+ [' i" C# V8 I$ J& Y5 W
) |4 o0 s+ k1 aMethod 026 o& F8 P5 j6 F/ g9 U
=========; I# P0 R! c$ J' V, G: e, x
4 M: U& K/ B5 P2 J* {
Still a method very much used (perhaps the most frequent one). It is used1 y+ o, Z. U2 v9 L& K4 P
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,% P& F" ~: Q E* h
or execute SoftICE commands...7 f' W& e3 h! n( A
It is also used to crash SoftICE and to force it to execute any commands
: o2 Q6 E5 z* v, L2 E+ P(HBOOT...) :-(( 4 d+ h W# `$ W) G( r% s
5 s( y) y$ h! _0 b8 ]! c0 H; GHere is a quick description:
4 v7 ~ B# \7 \& R+ L! L$ u" C-AX = 0910h (Display string in SIce windows)
k, Y! a5 q+ O+ J* [7 S V-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 h) z6 y: e ~# y- O" M-AX = 0912h (Get breakpoint infos)
+ I3 j: ^% q8 g" K* t1 i( \-AX = 0913h (Set Sice breakpoints)
2 e6 a( O' X! x( Q/ N( |4 d9 a6 J-AX = 0914h (Remove SIce breakoints)
! k/ M3 N) p, }4 J3 B9 x8 a0 ?' E7 X* v j) l/ s
Each time you'll meet this trick, you'll see:. g7 v3 }1 H6 r* @6 X& K: f' k
-SI = 4647h
0 e+ U0 h) z* x- V2 b+ k9 d-DI = 4A4Dh( x1 C1 K' K6 i& ~
Which are the 'magic values' used by SoftIce.3 q7 @. P8 U# R7 n E' I
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
4 P' ^+ A/ ?* l7 X. K! P5 _7 o# D& F, L; A
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! a; C& a |, m7 Z- bEnvelope utility use to protect DOS applications:
0 f1 U8 N |, R2 `3 E2 D
$ [5 p0 S& A: p* E1 E' I( L* w2 f! u& n" W8 m7 a% i ]. l
4C19:0095 MOV AX,0911 ; execute command.
4 K: q# u3 L6 N1 E. P4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! G$ w' c0 Z6 u4 G8 u( L4C19:009A MOV SI,4647 ; 1st magic value.( Y! z9 i! H: V
4C19:009D MOV DI,4A4D ; 2nd magic value.
# z* S6 t, A* r7 |/ a4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
! t2 m7 f; n1 y8 r4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute) Z9 b! x+ N( `- N
4C19:00A4 INC CX" y8 ?3 o3 u- A5 q
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute; i( t/ ^' c; z7 {* B, z5 Z9 R y
4C19:00A8 JB 0095 ; 6 different commands.4 i0 y$ R9 Q+ `) K1 M/ P8 E8 ~5 V
4C19:00AA JMP 0002 ; Bad_Guy jmp back.& Z P+ B/ G3 W. ^
4C19:00AD MOV BX,SP ; Good_Guy go ahead :), C( C+ P3 B2 O( i: h6 Q
3 A$ R ~8 V+ n9 @The program will execute 6 different SIce commands located at ds:dx, which9 b6 w5 M2 E+ p& W! \
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ I. E! [$ Z4 m3 X' J5 z" J9 ^; ^
$ s: V3 U3 u1 M8 D# L* O4 r/ Y) N8 {
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: T! M4 ]. E! S9 U" n, p0 r$ z
___________________________________________________________________________$ O( L% [; A5 ^
3 k4 j8 F5 j! k: m4 e
9 E4 e4 H& o, b) h4 l. y
Method 03
3 U8 c1 T1 w1 \6 m8 S9 b' B( y4 l/ l=========2 K6 {4 f5 k% u, {
. P# `; u3 L9 a4 J t4 K) E/ t
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
; h6 D7 |% e+ Y1 t0 n(API Get entry point)/ v, B) y2 B0 ~- |# O) z2 r: q; U7 {
) q4 o+ M( k& y: h) w8 h/ T& {6 }' }7 ^
xor di,di
z- a+ \5 Z( g4 F mov es,di
0 f' L, }$ s6 P3 U9 d mov ax, 1684h 5 F" L/ R7 |$ {4 s
mov bx, 0202h ; VxD ID of winice
! J1 A n7 R% {' B/ `9 z6 F' F9 f8 d int 2Fh
4 @( `8 k; t& p! B) U, H mov ax, es ; ES:DI -> VxD API entry point. K. j5 \5 K8 z
add ax, di
( _2 z# Z0 S. J' [5 q test ax,ax! x' D0 D, c" u! I
jnz SoftICE_Detected
. v/ m- P/ w b) k' g; n) R4 `
( j* B1 P) z. @$ u. X___________________________________________________________________________
/ ~5 C+ }2 C* d# P7 M' S) A/ J2 Q
- U2 q1 A ?8 P$ t' N9 O8 kMethod 04& k. H0 D8 [" Y5 m
=========
+ y, h# j/ G0 l: ^* o
; M5 P$ L+ v2 J, oMethod identical to the preceding one except that it seeks the ID of SoftICE* g! T5 h% e& H9 @$ p
GFX VxD.3 w& h) G1 A: J* i7 P9 _/ R5 }
7 D0 A: d# {# ~$ h' d
xor di,di. Z# j6 a# N( |- E9 S2 ?
mov es,di
4 t2 ?, n- k7 ]1 k% v mov ax, 1684h * q- @2 b2 c" U. }
mov bx, 7a5Fh ; VxD ID of SIWVID
( b# P/ ?5 b* ], i/ T6 y int 2fh
9 a$ v X T9 K3 P3 e mov ax, es ; ES:DI -> VxD API entry point# _6 |/ B6 ^0 i& ^( r' ~0 b
add ax, di% q) k; B' W' V0 ~& V+ G' m( H0 x! R
test ax,ax
8 v+ ?9 Y' O" S" r) Q% q: S jnz SoftICE_Detected+ _$ _/ a; o D# E. p2 G
4 \ `6 s: M; s__________________________________________________________________________
3 ^2 m' U5 s" J) ~% ~
# d% K. |! [. f/ J4 V! D7 N
3 F8 U N8 v6 d& R4 g8 ^9 QMethod 05, d0 |4 a( ~% E0 _+ v3 R
=========
2 q- i! X1 B8 O; M" |
& `9 V% |* U& aMethod seeking the 'magic number' 0F386h returned (in ax) by all system
5 a2 Q$ Q4 h$ B" o8 r2 Y& {debugger. It calls the int 41h, function 4Fh.
8 g$ K( C" l, yThere are several alternatives.
- M; E! t. c. v% l" n; i* ^8 r5 y7 x
- _- |' [2 I* kThe following one is the simplest:
4 D7 s0 C6 p4 u# H1 E4 B/ a0 p" u% O. [6 C! ^5 {/ Q) j1 s/ j1 w
mov ax,4fh
: m. r3 f5 ]( _5 _) [& G# K+ g int 41h; w1 Q: \+ _: Y/ @& o! i4 K8 E
cmp ax, 0F386
! j5 Q3 H8 t. T* y3 c) G+ y jz SoftICE_detected
; k& |+ L9 K1 I3 O' V( f S( {6 n) }& U' R8 b" C" |6 [. s$ W+ d6 |
5 ?3 [3 ~8 T4 O) G2 ~, s; {" c( q, ~- ]Next method as well as the following one are 2 examples from Stone's
2 a4 [( ? {2 y"stn-wid.zip" (www.cracking.net):0 C: c3 ?9 e5 P- R( [
; ^' L& e1 Q% O* \: i2 Z8 _
mov bx, cs) ]# p; u, ^9 {$ _
lea dx, int41handler2 x4 z9 Y% I6 S6 p" x/ t
xchg dx, es:[41h*4]- o+ q9 Q0 V; o/ E+ P) c1 C
xchg bx, es:[41h*4+2]
+ @6 J5 O4 A% n: ^ mov ax,4fh/ Z5 D' D" g0 f# i% |- e
int 41h R: a& Q) V4 K; } B/ \4 T5 q
xchg dx, es:[41h*4]: M* G2 M2 W; e8 c( q$ ?5 m7 \
xchg bx, es:[41h*4+2]' Q) h5 ]! |+ z4 c _, y" e2 `0 [
cmp ax, 0f386h
! f4 ^1 M, Z! \$ B! r jz SoftICE_detected) Z R1 G5 g) W; e
* M/ \0 A% J- q- B2 b- B
int41handler2 PROC
; ?7 Y. B$ f! u. O2 ` iret
. b% |& G& w" S2 u) ^, B* hint41handler2 ENDP
5 q# p( E& ~5 v: F/ I& ?* N
8 E8 Y- M! I0 O: G% e0 k
7 P+ E+ M, x& v( `" z8 z_________________________________________________________________________3 s3 o- {' e' F# x7 z- ~
) `3 X4 Z7 o' _5 N# j( q4 f% e+ c6 Q& c, a! ^
Method 06
! _. T: M0 d4 ?, _=========
B2 A2 M+ m4 F! a* f6 K- a2 |/ K# f6 L* E
# E: O, j P% I; e2nd method similar to the preceding one but more difficult to detect:
* ]7 e- i7 N; l* R2 m3 |, B/ o& e7 Y6 T4 o4 O4 v' N& X
7 ^ p5 ]% k4 p- U# ~+ oint41handler PROC: V( t# p& s6 I+ r% d& m
mov cl,al5 _: B2 h: h& j3 O9 T, h+ |+ g
iret! N4 {( B' W9 }# {8 @9 Y4 @1 m
int41handler ENDP& ]( p% i* u! c1 P
- K3 G1 y" _6 l
: p) K; q8 Z+ ~& ]
xor ax,ax+ U4 C1 Q2 r0 W4 @8 w) p
mov es,ax4 R0 \& K' Z3 ]- ?. ~2 h7 z5 f
mov bx, cs
. E2 |" ~ S5 q, f8 b) y lea dx, int41handler
: o& ?2 ]$ I$ m) {8 o+ ~ { xchg dx, es:[41h*4]/ T4 |+ J- R9 J3 H$ e6 H7 `7 k
xchg bx, es:[41h*4+2]( A4 r- T( b$ j0 T
in al, 40h% o7 J- m, e2 X0 x
xor cx,cx
/ S0 p, p. @$ i2 E, f int 41h
! [# ]3 c( Q& I xchg dx, es:[41h*4]7 `9 `, {8 e: }3 {' v+ x
xchg bx, es:[41h*4+2]4 L: H$ T; U6 E2 y. C5 i2 ?! g
cmp cl,al
* s) \/ l8 {9 r$ U jnz SoftICE_detected
9 p: n. W$ B4 Z* t+ F+ r6 i8 \1 N
2 `0 H& f2 G" T Z_________________________________________________________________________# y3 l3 Q( S L9 z
+ I7 r. x! q: ~* ^- gMethod 07. F. w& R; ^' c/ D. L3 b2 t& a
=========5 ^( L- J/ Y5 n U
. n9 d4 s. U) a; K+ R0 Q! F
Method of detection of the WinICE handler in the int68h (V86)
" ]( A- p- j. S, z5 d8 b0 u4 O7 ?3 N$ i' K) S
mov ah,43h5 ?- m% B- @& i4 }% b1 ~- m& J! m3 A
int 68h- s4 j: o0 o( L, p
cmp ax,0F386h
6 x* b4 t, q& Y% T jz SoftICE_Detected
2 j* }/ H+ T8 M1 c( v3 D5 W7 R" ^! }9 N9 e0 n
& `" W' H5 T. R% m
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& r0 z, k) B" |4 P/ Y
app like this:
7 M- @: @5 @. ?6 j, }
M6 H9 u' b' ~& D BPX exec_int if ax==68
. g7 O2 M, C3 o6 I. z (function called is located at byte ptr [ebp+1Dh] and client eip is
3 |: ~. g+ J; E2 N4 ^( t located at [ebp+48h] for 32Bit apps)
: ~+ B" D9 N2 a, T* G t__________________________________________________________________________
7 S+ ~# n1 }: p: a1 |) W1 B
# p6 H. `# C+ D4 { }0 A, n5 T2 d# z- Q- ?% s( |5 X F
Method 08
# W( P8 s# t2 \$ ~5 T1 u' E/ ?=========
2 U$ w- C+ X6 i4 t/ w9 z$ p" ~0 [; I
It is not a method of detection of SoftICE but a possibility to crash the
* h7 c8 L: a1 }system by intercepting int 01h and int 03h and redirecting them to another
1 ?" m3 y8 M- yroutine.' t+ f/ h1 E! W! ~: z& u
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% ?" s6 M. C: [) A: G' R6 ]to the new routine to execute (hangs computer...)5 N) u( d, {6 Q- [
5 z1 c5 J. Q8 T, w
mov ah, 25h
' t; i) k* ^2 W+ W& D- E mov al, Int_Number (01h or 03h)
3 Z1 X, z% p$ V6 ?; j$ n5 {. U2 L mov dx, offset New_Int_Routine
. E( n* h% U0 r( X# X; x3 n int 21h8 s3 D6 ^3 t5 ], v# ]% ?
) G9 F; f% V/ v6 _8 B
__________________________________________________________________________$ ]; j8 O0 ]+ @* Q: M; x) v' Z$ v* r }
' w! S6 i' f7 H9 t {+ `/ V# ]Method 09
U4 H5 X% x9 m- [- k3 |. y9 u9 U=========
# T! H- W/ A0 f+ L9 o, i) D" n$ x! j$ a( z' }. u
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
. f2 S# J0 R3 kperformed in ring0 (VxD or a ring3 app using the VxdCall).
, R& B3 _/ _9 q. u. i2 |) rThe Get_DDB service is used to determine whether or not a VxD is installed- l& e( r/ r0 e2 q" B; K
for the specified device and returns a Device Description Block (in ecx) for
- v6 D' Z2 M' a athat device if it is installed.
% m' Q, [( M% H% A! t4 G. J F; K+ Z( p& B
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! M. C( M6 {( @ P9 G
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- d8 Q( e1 n0 Y( ]0 z' d$ t# A+ M
VMMCall Get_DDB* O& c$ k; U" G2 `. n) w( `6 c9 R
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed4 F( g; Q; t/ l2 C/ ]8 b6 b6 s
! H- g7 ]. J2 b* `Note as well that you can easily detect this method with SoftICE:! N) k3 W4 m8 x: m/ @% q2 E
bpx Get_DDB if ax==0202 || ax==7a5fh$ M( _2 Z n, G& x' m
: W7 p. k$ w" b) ]$ l% g, Z: E" `__________________________________________________________________________, d+ L4 ]3 e9 S: z2 v/ f6 j
) z; u7 N& N$ P$ U7 z
Method 10) ?6 P) P4 @4 Y, ]& H; l3 c5 a; s
=========
- D. f7 H2 N! U8 f
& W* d" v/ r4 c=>Disable or clear breakpoints before using this feature. DO NOT trace with, E: T/ S. A7 l6 I/ `
SoftICE while the option is enable!!
# E2 K, q3 v' j- o9 M. `4 e
0 X& w3 h. G* A; [4 y: ZThis trick is very efficient:
. T/ S- S/ B- S# `( yby checking the Debug Registers, you can detect if SoftICE is loaded5 U0 K( K% A( ~
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if# R8 A2 z7 M( P6 ~; H8 p, v0 a
there are some memory breakpoints set (dr0 to dr3) simply by reading their- u# F* C0 {$ \0 d" q
value (in ring0 only). Values can be manipulated and or changed as well
3 l9 G7 r( f! ?% P- o2 j(clearing BPMs for instance)4 K, I! s: w6 B/ Q" I4 q
0 |; Q; x" |: ?! L$ S$ `
__________________________________________________________________________5 T3 _: `" D# N f" g/ g; n& n
8 F$ ^- V" B, X* ~9 X
Method 11# z4 W/ J4 r7 s% u8 v1 f" a! h' u
=========( U9 q( J" _- o+ w* ^) u
$ u% B6 v; {- i- FThis method is most known as 'MeltICE' because it has been freely distributed2 E- k$ p/ [; y: y3 O% t8 r' R
via www.winfiles.com. However it was first used by NuMega people to allow
. H/ \/ N. U. v! g- z# r$ U- BSymbol Loader to check if SoftICE was active or not (the code is located( I& }9 Q2 |, F
inside nmtrans.dll).
( w4 ~( Z7 T% s$ Q" w% E7 m* x B ?) y+ Q8 ]5 n: `* j
The way it works is very simple:8 a5 Z- @8 w9 d6 _( L& @4 q
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! H: l# O+ G6 \WinNT) with the CreateFileA API.$ W0 a$ ~( _, x$ C3 ]; }: u
5 T6 M+ J: B5 t7 ~5 p0 j) SHere is a sample (checking for 'SICE'):
- V% K) Z: [- `( [, ]" Z
% k( ^0 d# B/ DBOOL IsSoftIce95Loaded()% {) n. h$ P+ |8 x6 n" o& Y
{5 Q! h. F1 p" M" ]% l# x% k
HANDLE hFile;
* [/ o3 x5 t4 h, o( f8 Y hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; ^" i" ^1 U2 k' ^; f" s2 h
FILE_SHARE_READ | FILE_SHARE_WRITE,7 D: W. i4 X' v% L: r+ C
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 O1 O0 `( d. b" ~% W, g
if( hFile != INVALID_HANDLE_VALUE )/ g# _$ n% K! `3 U1 Z& d {
{
, F6 J V1 a, T O CloseHandle(hFile);& _4 S6 ]! T* H
return TRUE;
: v" N# d( Y! z" P! b' K8 a7 f4 u }
3 p" B. O% q* `+ X4 L* X# G return FALSE;
& G) _" Y# [& ~% |/ Y6 B}0 K/ s# W0 w) F* Z
5 l! R" C5 }- S/ T7 ?
Although this trick calls the CreateFileA function, don't even expect to be
: X7 A- n# p6 H) w& `1 x0 Yable to intercept it by installing a IFS hook: it will not work, no way!
; V) ?. e2 ^: N; W* ^ WIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 ]& {! W2 J+ t% F0 S' ^ xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& ?; P* o4 K- K6 r- \/ Uand then browse the DDB list until it find the VxD and its DDB_Control_Proc3 m/ P* n+ ?: j6 _9 L; R; ]
field.
$ h; l( J, `- W, ~+ x# T% DIn fact, its purpose is not to load/unload VxDs but only to send a
3 y( F2 E+ W0 H3 O: O; k% RW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
4 O! N/ C3 g9 S' y u% q M2 ]2 Jto the VxD Control_Dispatch proc (how the hell a shareware soft could try& r; b* {9 Q/ x
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ y1 [- C2 Z# t. W1 X4 K# lIf the VxD is loaded, it will always clear eax and the Carry flag to allow
; E2 n- n9 C/ y( a. z+ r- Cits handle to be opened and then, will be detected.( K5 ^0 J3 q6 l% V/ d$ z
You can check that simply by hooking Winice.exe control proc entry point
7 v: a. D6 j6 O. R5 z' Twhile running MeltICE.
1 F) L1 H, z# B4 P6 c% _5 s' ^- x8 S2 o; A7 j7 P% W
1 \! U2 e9 q( S$ d" q6 e; j9 A- |6 P 00401067: push 00402025 ; \\.\SICE W4 X. m- q2 b, C. ^
0040106C: call CreateFileA3 X# D$ R P+ K; e
00401071: cmp eax,-001
$ G5 H( ? T+ i7 g, t$ | 00401074: je 00401091 x1 `4 C5 r, ^6 [+ N
3 |1 Q6 Z* J# h o8 L# g; T( @/ ?$ Z. ?1 `' [8 I+ Y& w
There could be hundreds of BPX you could use to detect this trick.& T* E! `$ B- \: K" {
-The most classical one is:% y! u/ s4 o& O. D
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||. ]1 u1 y& U- ^. @2 I# X5 n
*(esp->4+4)=='NTIC'* B- N$ |4 K; i$ B& }
+ R/ e' ~: `/ M5 `1 U0 M/ a
-The most exotic ones (could be very slooooow :-(" q1 I2 r/ y5 c! D0 `
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') A2 |( W9 T3 g% }" b6 R
;will break 3 times :-(
1 Q3 J* p0 \1 c3 K" y: M
9 O; Z: d' p2 s4 @2 P-or (a bit) faster:
) m: d8 n, P2 h' t. o# ^% l2 ~$ ` BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 W: u" d0 |* V; b) D6 O& @) b5 e. r
% L ?/ v4 ?( a BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' . b: b4 b0 ~5 ]* B- j, ?
;will break 3 times :-(( c5 E* |! {" J0 i: u
1 k! B5 E3 k3 ^-Much faster:9 T5 M( F* n+ T" d& D
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 P& ~7 O5 A0 \1 v
" F: S8 E7 q4 X0 MNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 f+ w- F2 ~9 ?( i: w. S+ Dfunction to do the same job:( \3 _* o V8 c$ Y$ @
% Y. [: s" w+ L' e* x push 00 ; OF_READ$ a/ R/ L. T) U& W, x. @7 K5 g
mov eax,[00656634] ; '\\.\SICE',0! }3 }; @( n; s0 _
push eax
: F$ G. s- I5 l' b% _ call KERNEL32!_lopen4 N u4 Q" m' v9 U- i4 s
inc eax
$ q9 n, R7 e! a& Q+ l% m jnz 00650589 ; detected
0 v9 e3 q8 ^, a2 ?: S7 K push 00 ; OF_READ
1 _7 b; A& C" z( B6 ]2 e mov eax,[00656638] ; '\\.\SICE'
3 Z# [6 X! [; D2 ] push eax t- U% }8 z% n) f: y
call KERNEL32!_lopen
5 G. R, e4 B" E4 B) g8 Y inc eax
: n$ P% r( T- X# s$ p jz 006505ae ; not detected
- F# ?( c2 N- j8 \3 f4 C* P- M& S1 G7 t! J
5 p% y, G, E2 p4 v6 x+ j
__________________________________________________________________________
w8 U- y) l$ H/ L* i- q# R; O+ S
Method 12
1 L A8 { a4 F7 i k8 z1 ~=========
3 k; W" t. P/ A: y! A% r
s* Z* B0 A9 i, X+ c5 yThis trick is similar to int41h/4fh Debugger installation check (code 055 v9 F, `/ f3 v/ @1 d
& 06) but very limited because it's only available for Win95/98 (not NT)4 b6 [# A/ L. l
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ l' X6 A w4 u5 w. _: y: O# t
2 p( C: s8 y' l, h0 Q$ T push 0000004fh ; function 4fh5 h9 |* Q' T5 @4 Z! b8 Q1 G
push 002a002ah ; high word specifies which VxD (VWIN32)5 H' P% S1 O" |; @+ Y4 `
; low word specifies which service' L( h. d) i! \( }/ Q( X! u q$ Y
(VWIN32_Int41Dispatch)" `( `$ N5 N( e
call Kernel32!ORD_001 ; VxdCall8 q; r8 n2 c/ R, G0 r
cmp ax, 0f386h ; magic number returned by system debuggers3 ?/ [4 |" Y. ~* [# v; B! X
jz SoftICE_detected$ X& e0 K/ @7 u0 d- ~
1 h4 p( r" {9 ^- b
Here again, several ways to detect it:* u) M1 {1 C; ~7 w6 \3 y6 S" i. X5 [
" N8 a. L1 i# S, r- z% a5 D% N, N BPINT 41 if ax==4f; R! `1 N) j$ k/ k- a
' y4 ] W, O% u- o1 w7 T
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
9 N% C2 e6 y0 S- |2 P$ |" @0 |% w" R" {6 ^+ e
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. z. l# y8 m$ s6 f! C& b) y+ E' O! p1 H( V2 P% t8 ^& r7 s5 M
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!8 K$ {6 t; v( }4 o
~2 S+ m1 N+ P8 i P__________________________________________________________________________
2 K; S/ X1 U$ \6 _. z) o4 p+ z) D) r: v; ~7 d! w+ X
Method 13
u6 E" U( l" j8 L# D=========
/ v. [9 e* u2 j0 v9 C0 D% O- X- p! k5 D* U2 @
Not a real method of detection, but a good way to know if SoftICE is
! |4 @' u4 O& _( Q& ninstalled on a computer and to locate its installation directory.
6 s" Y2 k T& f' H% hIt is used by few softs which access the following registry keys (usually #2) :
. x, r7 y" y/ q# j0 ~- y7 P! M f X8 e6 c
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% P& m7 ?2 D0 X9 L* Y+ q\Uninstall\SoftICE
+ c5 @6 o7 `" b; m j9 K6 [! u-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* G0 ]$ l3 q, A
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. F$ k, ~5 s ^+ k
\App Paths\Loader32.Exe9 m n2 i6 \+ c
( `1 R% p5 e2 ^6 ?5 ?
& O* q0 K, G$ O: BNote that some nasty apps could then erase all files from SoftICE directory
2 t3 B: ^- c$ Z- i# F(I faced that once :-(
8 g& z# [2 |0 G! s' Q3 [& Z/ D8 D" F, ]9 d2 d; i; a
Useful breakpoint to detect it:
8 Q' U8 X- \$ d* h
* D0 U0 \4 E- Y. E. e2 k1 P; t BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% ?5 p5 z! O7 b
' ~( J- g& h! v( ]__________________________________________________________________________, g' K0 v; e6 n3 O. t
/ J. U. }7 g# n$ u8 h# m( }6 n/ t/ W% w/ U1 o" X4 ~# {9 J4 q6 y) ~
Method 14
! U* B* e, H2 J0 W2 r v! C4 T=========
$ V, d( }9 R4 h \" o" t, w. ^
6 c% Y' B: A1 hA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% V9 v8 k' _$ T# z$ R. Pis to determines whether a debugger is running on your system (ring0 only).2 o* x/ F+ T8 V
" o( P" D, M1 J
VMMCall Test_Debug_Installed
' a; I1 ]& a1 t; G; H z1 | je not_installed
/ L8 h9 i8 a) w" C6 P+ _
. Q* z7 F b& E3 P( y& DThis service just checks a flag.
; G2 z/ E7 y" v" P) l</PRE></TD></TR></TBODY></TABLE> |