<TABLE width=500>1 `+ M3 I. X5 \0 }* M7 C7 F
<TBODY>) W, T+ Y t/ Y3 J
<TR>- f; r# T0 R- i
<TD><PRE>Method 01 - F- k1 A1 {: A
=========
3 ~; U* E8 {" x8 r5 l% e) ]( B+ E3 x5 w2 C
This method of detection of SoftICE (as well as the following one) is
* `3 G; d2 X* z& U$ gused by the majority of packers/encryptors found on Internet.5 v9 o' `" w. k4 i$ }1 a
It seeks the signature of BoundsChecker in SoftICE
. l, G8 F5 {. Z: {. q
8 u# m6 _; y) y mov ebp, 04243484Bh ; 'BCHK'
/ ]/ t' n( \4 G mov ax, 04h4 A) {* w# h7 W" a4 O; G& I
int 3
4 j% v4 y6 j8 |! |9 Q" h cmp al,4
- x" g! \5 x! W* r6 @3 q0 f jnz SoftICE_Detected2 P; V- @+ ~* ? o: P, X( U, B1 N
0 t' M9 Y2 {/ j___________________________________________________________________________9 a- Z6 G2 B, Y% f! w
5 `, u+ @+ z* N2 V- |: V7 C. l
Method 02
0 E1 v. f) _! m, ]" A5 ~=========
7 m3 L0 |* I9 C$ W: R& _
. g0 |7 A% N. J" }4 g6 \5 hStill a method very much used (perhaps the most frequent one). It is used$ q1 z2 B! ^* J4 l+ x9 T
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 V& v: X* d; I$ P$ \- E M
or execute SoftICE commands...
* c7 z4 D' @6 x5 L; LIt is also used to crash SoftICE and to force it to execute any commands( F; G2 I" p: @( a
(HBOOT...) :-((
2 V$ Z; ?+ K& B, W1 w
0 p, u$ z1 |3 q, |7 bHere is a quick description:( e& J" ?! F. @: O h+ E Z
-AX = 0910h (Display string in SIce windows)3 x* s& d! t( Q3 k
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
% K: b3 P- n% c+ F8 v4 A5 {; m" h-AX = 0912h (Get breakpoint infos): ^. Q3 d0 G2 L0 x+ X" i+ Y9 i
-AX = 0913h (Set Sice breakpoints)
) | {2 N# K' b6 b-AX = 0914h (Remove SIce breakoints)8 T7 a3 |! M6 U' |4 \, M$ c2 Z
" j1 e% h9 ~+ g3 K( h# T
Each time you'll meet this trick, you'll see:
2 d" T# [" P8 t) t0 P9 c' |-SI = 4647h" \" I4 j! k. y: H, ~( ~
-DI = 4A4Dh9 A0 q: K3 f3 u% Q5 r$ ]% r% o
Which are the 'magic values' used by SoftIce.
0 A) A+ T+ w; L0 S" L) gFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 ^3 v- ?4 Y1 u; X/ ~' g. C" U! \, N& j" V
Here is one example from the file "Haspinst.exe" which is the dongle HASP
3 n& G' L5 u }) X# x. l" pEnvelope utility use to protect DOS applications:
2 K( X& S* c+ x7 F0 [0 r* W5 V8 w4 n( l% z$ e/ q
9 N* H- X, o+ f; r9 v4 a4C19:0095 MOV AX,0911 ; execute command.5 g$ s v. \! V
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 B8 ~7 ]1 ~( V, h7 q
4C19:009A MOV SI,4647 ; 1st magic value.* q' o! k; }2 a. p
4C19:009D MOV DI,4A4D ; 2nd magic value.
: \3 t6 u& s4 h2 A$ ~1 a# E4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# Q; g- f: a4 a2 d4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ H& d4 m: M+ S+ k) [
4C19:00A4 INC CX: m7 K* K l! l
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute l/ I2 S5 P2 Q- h u& \
4C19:00A8 JB 0095 ; 6 different commands.
: k# a4 J+ c4 W4C19:00AA JMP 0002 ; Bad_Guy jmp back. [- t$ Z) `. R3 i8 s+ x
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" i7 A! {0 b/ b7 e3 s4 K
2 r* e' S% Q$ J( |4 B) Z5 P# h6 mThe program will execute 6 different SIce commands located at ds:dx, which
; X0 O' ~# A3 C8 M6 ^: eare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ U0 z7 ^1 |5 E' _: m7 S0 u
* V& m6 N$ W! U& ~, `* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded. M- ~+ i4 `) X! I' L& L8 [
___________________________________________________________________________% k/ Q* z- m. ^* q" m
- F% Y& W6 ~2 {5 a, B' Y
5 D6 Y. [6 E1 ^, }Method 03
# E$ F- H5 s w2 E# |8 Y=========: J- t* n' {$ t
: z# ^6 ~+ U5 T- t
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 z: ]# ? o9 {4 J. d
(API Get entry point)
, b( I8 j- D8 a1 w 8 s. `& S, f& ]9 |2 U/ O% h
" @# q- N2 L \. f% t) i
xor di,di5 M# b9 R& e( Z% \4 ]
mov es,di
. x; {# S1 Z9 j6 b; i mov ax, 1684h . Q. c) X8 x" T( o6 G
mov bx, 0202h ; VxD ID of winice
" K# I" Z1 A |7 F/ p( h, H6 F( H int 2Fh/ A# F. g. Q$ V$ h* B& ?
mov ax, es ; ES:DI -> VxD API entry point" J% B7 ]2 ~: z/ R
add ax, di
) P9 k7 I0 \. @) B9 Z L4 f& _* \0 e$ c test ax,ax a0 m. n" }+ ~
jnz SoftICE_Detected
0 {9 o: W! h+ t; O, U: K. y8 D6 j. j' x8 M: y* g* G
___________________________________________________________________________2 L x( H1 ~& A" J
; F4 I( m' _# w- K( ?6 S
Method 04
4 z" E g3 I. i+ K1 J w3 ^=========, w9 o6 L/ F: h4 N
! e3 V* S9 J8 M/ [- V5 y9 k
Method identical to the preceding one except that it seeks the ID of SoftICE7 _: P: a* I4 P( o' j8 Z4 M
GFX VxD.: G% k( d- ~4 V( U+ ]: [( ?
1 J1 P+ R& D6 u( n+ S
xor di,di! t8 T3 R$ B G7 S! Q$ g* K
mov es,di. Y! A* c: p O, B. _- u/ a
mov ax, 1684h " w1 D, V- i! ?0 p9 v# E. s7 `- x0 H
mov bx, 7a5Fh ; VxD ID of SIWVID
! F' ]! h) k5 H% \ {; T/ V, b int 2fh) R8 S& \3 \$ @# d5 U% [' g# ]
mov ax, es ; ES:DI -> VxD API entry point
/ {$ a8 {5 W- {+ v. m add ax, di) ^$ H! N8 c0 r. x/ k9 z
test ax,ax
; R4 ?* V6 I! k" k& Z jnz SoftICE_Detected7 l, u* L8 f+ S" Q
0 F) w4 u- |( S" u5 r: p( t__________________________________________________________________________9 ?9 O8 ]5 B! M; S
- ^# ~+ y* G9 w/ P v$ n) O. k1 M2 x R- \
Method 05
" t/ }# N+ ~3 O=========7 B1 L- z/ \0 W& }7 V4 c
* T3 n; G7 X/ F# U" r2 M9 p' [9 G
Method seeking the 'magic number' 0F386h returned (in ax) by all system- Z) T, M0 t- j; R2 c; K4 s6 Y* G
debugger. It calls the int 41h, function 4Fh.- a2 @) T( [9 u7 J# l
There are several alternatives.
! | w. a8 N' _+ {- @
8 h4 x4 L/ i' a3 O* J/ ?( ]% yThe following one is the simplest:7 ?% i) e8 _( ~ ]
9 W% n J1 @. B; Y- }: }
mov ax,4fh
! |( [- _& E3 T0 f$ Z int 41h
1 M# E" w! u' x# i$ ~. j6 L cmp ax, 0F386+ w! q/ K2 z* ~
jz SoftICE_detected2 \+ J: A2 b# d2 G6 b
( D0 [5 A- O# W, I/ ?3 t: r) P; c
# V- w* \8 ^7 m$ GNext method as well as the following one are 2 examples from Stone's
6 O2 M% a, z; r) s u6 L* C; |"stn-wid.zip" (www.cracking.net):/ |2 ] V- i+ [6 N6 b
# C/ B+ B5 R6 W' A6 L! k2 A7 P
mov bx, cs) Z: A1 V; @# v: ?& [. ~
lea dx, int41handler2# D! i5 u2 f4 {
xchg dx, es:[41h*4]
9 K/ z+ G- S3 H" K: ^% f) n xchg bx, es:[41h*4+2]0 V$ [1 V) a$ A: R T4 W
mov ax,4fh
/ \- U% ` P8 v int 41h
, f( W) W# ?2 E! d& j9 ~ xchg dx, es:[41h*4]. ~: V1 p. e. y
xchg bx, es:[41h*4+2]7 c d, m m. y5 `" I; O. ?
cmp ax, 0f386h. ?7 `3 u c/ e. P: x
jz SoftICE_detected) @3 f( Y- g6 S) H2 x5 r7 G6 l
0 R6 A9 W. w0 y1 }7 X: r3 K
int41handler2 PROC
8 T5 X, {' p7 }5 _. [& S iret
! m H$ T @8 K+ X% u0 z8 E/ hint41handler2 ENDP" E8 |/ a& d1 g: d/ s
, ~0 P& ], e( D) ?
2 M; s; B' o7 m' f- N( [. R2 [4 X7 f2 F_________________________________________________________________________4 J+ ]$ Q- |6 w
( X, J" e7 W- D
3 S- V6 u3 O5 sMethod 06
2 H, K% B( C( D3 e=========
8 \# }; ^% U. q. X$ i9 e* ~$ ] V& f4 a
3 D2 h9 J3 }1 q4 K; C- t
2nd method similar to the preceding one but more difficult to detect:
! q' k7 p' V' x3 B! H3 Q! ~' W0 _& _
1 u* G6 P! X0 e, r3 m
int41handler PROC4 {4 ? O% p8 L% i6 b$ }' e
mov cl,al( F8 s# i6 v8 {9 \
iret7 Z3 t6 e6 j8 ?& I
int41handler ENDP0 [$ ]# @ i, y- K' g. r3 G- c
& V' E8 b; m7 _
! h2 p5 k& m4 I5 X1 W" U xor ax,ax
8 E& V; @7 {* X# M L mov es,ax0 ?; L% o7 U) ]1 E/ z
mov bx, cs
, [7 W& b1 b; c4 H. [. A4 K lea dx, int41handler
2 y* H: K- u) a9 V' g8 {/ N3 u xchg dx, es:[41h*4]
% k- X5 X6 H! R! Y# C! O% z7 A xchg bx, es:[41h*4+2]: q3 j2 Q+ g' k3 I7 ~$ p4 F
in al, 40h7 p6 l* G2 |6 k* `2 v* L% `5 \! K% H( Q
xor cx,cx3 ^4 M7 I% i& g8 v- ?: D
int 41h
- z! U2 k$ H7 l8 {. y4 P" }1 m xchg dx, es:[41h*4]
. o: ?' m0 e7 R* ^5 ?8 y0 ~2 [5 P xchg bx, es:[41h*4+2]$ d( q" w& G( A' M
cmp cl,al
. b+ W. W& x; [" t, F& p6 Y% j+ W jnz SoftICE_detected, Y$ p% F* V- F, `6 V/ B( V, p
7 I5 P$ f1 i) n) G1 \_________________________________________________________________________
5 \* B. U2 a/ t" K
: Y* @+ {% O& B- I0 D" b: xMethod 077 N9 l6 H2 h, Z+ e
=========, `: [/ y: U2 F
: b7 s/ \- `: H0 Y) ~Method of detection of the WinICE handler in the int68h (V86)9 k7 `- H7 k# }1 n: s0 v2 H
. N0 q& H% O5 m4 Y) y/ o
mov ah,43h: t, [. R5 n1 b& P' `: C* D
int 68h9 M1 o( S* c0 A' S% Z
cmp ax,0F386h
+ W& q8 r1 h; H' v; i' K jz SoftICE_Detected5 f" b5 J5 r8 _. q; V% F; ^
8 m% ~0 d! k7 O# [7 G2 q5 A1 d" }2 }5 \2 f
9 |! Q+ w5 I+ S0 T1 p=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 F: |6 e5 a+ ^ app like this:
: x( F% M) k* J/ r) g! P% ^! Q
f" G7 t8 O0 H& D BPX exec_int if ax==68
7 [6 q4 z8 p) G (function called is located at byte ptr [ebp+1Dh] and client eip is
" k" C F( v4 P6 {1 J9 N* Y located at [ebp+48h] for 32Bit apps)
, S# ]# {- P& p__________________________________________________________________________
* v" k7 F x/ p) ` B* b) G
: J5 J& x% B" z; ~
! V1 ?/ _/ o9 A) A. l; @2 ^0 v+ z4 NMethod 08
& B' t( R* q. U. X Y=========
5 R5 G( P4 H1 l& P( d8 E6 N, J* r7 |/ Q; j" K. f/ w
It is not a method of detection of SoftICE but a possibility to crash the
6 \) [# h1 X9 a+ @# V$ o, ]7 s3 esystem by intercepting int 01h and int 03h and redirecting them to another) W y# D, y. m! S, Q- `! P
routine.
; o/ G$ s2 X, r9 P& s2 M' V/ kIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 R) c8 o2 o$ ~" H0 ~8 o9 nto the new routine to execute (hangs computer...)# \6 t5 \- e5 T# z1 B3 a9 W q6 T
3 i) T3 X+ K( l
mov ah, 25h$ B4 \- t7 q5 k
mov al, Int_Number (01h or 03h)
+ ?5 T2 Y v' A mov dx, offset New_Int_Routine& h) H; |6 q9 [# W& P
int 21h. e9 c$ g1 P: h
0 |. B+ p$ _8 v$ f3 H__________________________________________________________________________
9 l# s9 c2 Q- `2 f8 F$ g
. V) F0 F0 C* v. w) cMethod 09% c( h: S! G0 e% A/ }" r0 P. d: t
=========
5 ^0 ~8 I% H0 J! F& y3 r1 x" c7 p% X3 d
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 h* d/ T0 s4 N
performed in ring0 (VxD or a ring3 app using the VxdCall). Z' c7 Y4 h+ t! y6 m$ {/ ?5 C7 w |
The Get_DDB service is used to determine whether or not a VxD is installed } X! T6 f4 Q4 k7 R
for the specified device and returns a Device Description Block (in ecx) for, V, F, o7 @; Z; e3 }- m
that device if it is installed.
/ }6 a' @) i' E9 l
2 _4 u1 r! Y: `1 \" t mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ [3 {& W$ l, u2 v mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) \6 ?/ z4 y' K# X7 `2 r' d VMMCall Get_DDB
2 I* v) }& u- F# l4 k+ K; j. v) D7 d; q mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: R2 ]1 h! W$ Q6 V- x3 i
7 n: s+ q1 j5 n7 F6 Z9 ZNote as well that you can easily detect this method with SoftICE:
8 k: m) V0 _6 [& w bpx Get_DDB if ax==0202 || ax==7a5fh! |+ K' q9 k& Q' j" ?% S4 u
$ t7 L/ V, o& N. E* j% j, ~__________________________________________________________________________+ M/ W7 v0 Y% k4 j! m$ l r9 e' U% ?
" g7 ?8 s" \3 ]% `Method 10
0 P/ q/ m- X. V; j) t2 [3 l" ~=========2 j7 l: s- O% e: M) [& e0 N9 ]5 u
" A/ h0 ^- W/ q0 u=>Disable or clear breakpoints before using this feature. DO NOT trace with
Q8 L& j' X" l0 A- I SoftICE while the option is enable!!
/ @; q9 O: d1 v6 g, O" u \' c/ `. f1 n) c/ L. B
This trick is very efficient:
5 N( y9 b/ T" h4 V5 ^7 O' uby checking the Debug Registers, you can detect if SoftICE is loaded
+ b# E8 c1 z1 R7 w$ M" V- Y7 R: U(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if: X# W- M* B" @4 m" X
there are some memory breakpoints set (dr0 to dr3) simply by reading their
' T) V5 ?7 d7 ~2 ~) jvalue (in ring0 only). Values can be manipulated and or changed as well; d5 D" h; i& S. B1 a/ Z
(clearing BPMs for instance)0 [) U0 F$ }: V9 U
% ]$ V! b3 O* C4 t
__________________________________________________________________________4 ]5 I9 Q: p( q3 }+ C+ I4 n: I$ X
3 I! A+ v6 D7 {Method 11/ l8 ]) h8 Y: v& R/ j- j/ P
=========, `9 | \9 g9 q( L X" [1 A/ e
6 j4 a+ G1 j0 {8 m% }' j6 D2 eThis method is most known as 'MeltICE' because it has been freely distributed
, f: |/ `8 D3 X/ B; w. Z5 }5 Rvia www.winfiles.com. However it was first used by NuMega people to allow# u7 {' V, Z% r& D* b/ M0 y* @
Symbol Loader to check if SoftICE was active or not (the code is located# W( F' r, N) l
inside nmtrans.dll). |* X3 H: S( ~( P9 L! |5 N4 A" `, M; y
: l8 p* Q8 @) B
The way it works is very simple:, w4 r9 B6 H/ k6 h$ ^6 ^
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
@8 B4 P! m: @, AWinNT) with the CreateFileA API. L, R2 I* z. c, J7 p5 g' O5 S
/ g( k7 Q* w( t& t9 |# C) ^- GHere is a sample (checking for 'SICE'):* v2 g$ @: [# j, t- a
1 @9 u3 y1 C( M6 c: m
BOOL IsSoftIce95Loaded()! P, ?6 z4 o& m0 |. f# Y& X( B2 G
{ k5 s/ w! A. Z- `' x# O
HANDLE hFile; 3 T3 Z! b" W# O2 y" p
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 d- D) R- o. q4 N FILE_SHARE_READ | FILE_SHARE_WRITE,8 K2 I7 X- p- t! @% y( [4 X* U/ j I
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) x: \ t$ |' I( v; J if( hFile != INVALID_HANDLE_VALUE )
. B9 l( N3 C3 e2 }4 m0 _* G {0 ^6 v1 h4 b: w( z' W
CloseHandle(hFile);
% z6 p( b; i9 \1 T0 Z: Z, T return TRUE;7 q' H8 i5 b/ f4 k! X. @5 e) L
}
( T0 u, j: h/ G7 R* P" c2 m, y return FALSE;5 J4 `1 C; K, i/ I
}
/ j# L( l. p2 l0 [9 ~# C# r; P2 G5 {( P4 P3 [9 W+ o
Although this trick calls the CreateFileA function, don't even expect to be# g' r7 B& b/ i+ z+ U; O" W1 M
able to intercept it by installing a IFS hook: it will not work, no way!
; |6 x. v9 s+ A3 o5 ~2 r& b* P3 EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 v, P( }- P" z' @, N& Gservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 G3 e* r9 J" ?/ `' Z5 N( N6 Q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc# ^1 L1 d" ?4 Q$ W' ~. G
field.. L3 C" F# [7 A6 r% H
In fact, its purpose is not to load/unload VxDs but only to send a " Y0 Y9 M6 c* C
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) G, M! z# r: Q, Q% b! L& W
to the VxD Control_Dispatch proc (how the hell a shareware soft could try% a4 Z3 ~5 J2 r1 j P- j9 d& ?
to load/unload a non-dynamically loadable driver such as SoftICE ;-).9 s% D7 R, ?4 f3 N
If the VxD is loaded, it will always clear eax and the Carry flag to allow% ~' u+ |/ z( u
its handle to be opened and then, will be detected.
5 y+ r# z3 W7 d7 g4 G! ~6 nYou can check that simply by hooking Winice.exe control proc entry point
9 v# _ ?3 W( ?while running MeltICE.
. a+ D8 v' Y0 U& c5 C- H4 C. m
3 l# P0 H8 z; D/ o
/ R1 R" Y4 t0 X9 ?5 Z 00401067: push 00402025 ; \\.\SICE
; j/ ~1 q: X+ u5 N& d0 j* V4 A 0040106C: call CreateFileA
! _: Q# n5 m$ P: } 00401071: cmp eax,-0016 W: W* b* Z6 M
00401074: je 00401091
: n" g# A! d1 \ j( G' g! Q* O0 W7 Q) |/ R
, J9 P% i5 {& G6 _; J) C' s# i: ]( Y
There could be hundreds of BPX you could use to detect this trick.
- y, a! P. O, b3 q% j' @, }( |-The most classical one is:2 f: z% Z) N& { [9 W5 L: n
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
9 \1 b9 E: ^8 A+ s% z5 N" d& I$ o, { *(esp->4+4)=='NTIC'
1 U$ X- E2 u! A+ g# a
4 I& E2 t3 `4 a" k ?8 L1 }-The most exotic ones (could be very slooooow :-(! Y% C! r: S, d
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 v$ y: p: i* I! B( F
;will break 3 times :-(
+ ?( \0 S+ `; O* l$ B( r
* y# v& z8 c; C0 L: A-or (a bit) faster: : S# |. Y S; m, a/ U; {
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 o |1 l F/ _0 [# N" O1 a5 l* L4 ^, A5 Y; G% B
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' # N% \3 o P- S" f. h
;will break 3 times :-(
5 r) \( N9 W( g" G
9 I$ Q& `( W1 a6 u2 p-Much faster:
( U% C, z& }# {& c# q) K BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
2 i9 n) N( A$ Z |4 `* j) g
7 b s0 }, L& @7 KNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ W6 y0 P8 U- _- K) h" ffunction to do the same job:' L3 r2 X- _! O& K l3 G4 ~
/ V6 o2 g9 k. q" {
push 00 ; OF_READ
& e( F: ^, b3 r+ F+ O- S1 ?7 A mov eax,[00656634] ; '\\.\SICE',0# D$ W5 z! x# b" W% e- z' s9 Z! m
push eax* S2 Y" P, M2 Z
call KERNEL32!_lopen- z; N+ m/ i8 Z% ^& |( J
inc eax- R# O. J, i0 g
jnz 00650589 ; detected
2 h$ {$ P8 e, _& z push 00 ; OF_READ; @( \& }/ ]# X& M0 M/ N/ C
mov eax,[00656638] ; '\\.\SICE'
9 m+ J% p9 h, e( l; Q [/ ] push eax
% g& E( a% N$ L: p* w0 a call KERNEL32!_lopen
: ^" T2 S: E/ |" h$ p inc eax& `6 J7 Q+ a; z8 \2 J* T3 f- y
jz 006505ae ; not detected
3 g0 J3 s& J) i0 W6 A, U! a" k2 w% a
1 X+ }1 Y$ g- ]) }+ J8 r& E! O__________________________________________________________________________/ J8 N& s9 s$ _" c- m# l. j! ?
8 I% J$ r1 l3 G8 g: ^+ Q7 {8 N# L' GMethod 127 K4 D _4 N5 b3 y
=========
" u& B& g/ T) e0 |$ X0 F0 \9 h, }/ y* y2 R& n( B+ y
This trick is similar to int41h/4fh Debugger installation check (code 05- s& y/ S2 D9 J2 e4 i' m1 |
& 06) but very limited because it's only available for Win95/98 (not NT)
' p( L, A4 P& m1 V9 Las it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, m2 W# O) l' O0 m
8 }( [9 m3 `! x push 0000004fh ; function 4fh1 y& S& ?' ^5 V1 q
push 002a002ah ; high word specifies which VxD (VWIN32), r* m; g% ^% Y5 M3 M. e
; low word specifies which service/ T% s. Y* K7 D6 s
(VWIN32_Int41Dispatch)) U, U5 s- }5 u% {: b. K% U9 K9 s
call Kernel32!ORD_001 ; VxdCall! k6 a- \& l5 j
cmp ax, 0f386h ; magic number returned by system debuggers$ U }% |& X% g7 b( F- W+ A
jz SoftICE_detected
) l2 H9 ?: ~& W9 c6 p1 Q" Q( b- W6 ~9 l6 @0 e! b# p- Y& A
Here again, several ways to detect it:- ^# J# X1 w$ Q, s
! u# C: f. B; h BPINT 41 if ax==4f
" G' r+ P6 ^2 R, c: l1 i9 y5 L
' V' O! }, e% |) z BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
& [& L+ a/ |% J
. D9 `( g* c2 C% }3 b BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# J+ `7 s+ {) v1 U5 u( ?; {
# Y: }. [7 G3 W( c- [5 h! i BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!- s: W U1 E0 @ X6 D' Q& b; n
% E1 t k; u2 F# ^4 i6 Q
__________________________________________________________________________% Z5 R* n, b2 G2 s+ A# e2 }4 F
: G% b" W5 N X; E9 A+ V9 C' F
Method 13
, ]) [# z7 [5 m( A/ u/ V=========) N! ~ \3 U8 j" h
% ~4 W: T3 M* U5 g' K9 UNot a real method of detection, but a good way to know if SoftICE is% N1 S5 W! w! ]9 \, S/ Y3 Y
installed on a computer and to locate its installation directory.
" Z" [1 E# ?# s! DIt is used by few softs which access the following registry keys (usually #2) :
" \% o: @6 I! p3 [0 k7 H* d& K. R) b9 ~, u4 d6 I
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: G' k9 Y3 ^9 N( ~7 a* h# r
\Uninstall\SoftICE
5 E! c+ b1 r5 {; \" h-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- U: S0 I9 u) H8 B* z-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( k! I- b7 _3 c. U" i: u
\App Paths\Loader32.Exe) q; F* m: X b
6 p* N' d/ I$ d4 R4 G
3 K. T( U6 p2 S. W/ zNote that some nasty apps could then erase all files from SoftICE directory
- b9 m# Z8 i% f# ^(I faced that once :-( r8 f; s. ^8 }
8 }4 |+ w4 U( SUseful breakpoint to detect it:3 B) H2 K) _! j5 W. B, d
% m. q( [4 ]0 J
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ f/ H5 p! z B' @1 T$ y, t
5 h; m: Y& M% S \6 b/ E__________________________________________________________________________
9 ~5 E3 [/ X4 |9 |; |& a6 @; O0 d+ W: O
4 |' y, Y9 g9 f1 T# ~+ f( Q# \
Method 14
6 ]6 o3 O- ]0 @, x! b=========
; ^- z( B4 }" v$ |9 ^) K& [) b
2 _4 K1 q9 A0 k- |7 @A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- f6 \9 t/ K3 A5 U7 p1 ?; ais to determines whether a debugger is running on your system (ring0 only).
0 V6 O, [6 G. H# W e* K% J4 y5 y' ]2 L8 y) H+ V \7 M
VMMCall Test_Debug_Installed# F, m5 @5 M6 \& C/ }6 S* f& }9 V
je not_installed9 O5 m2 C$ a: c K
% B" T4 X) g4 a1 `( f+ @ E' W! F; {This service just checks a flag.
9 j; N' W2 X8 B: k! z A+ l% y* U</PRE></TD></TR></TBODY></TABLE> |