<TABLE width=500>
8 |, T7 V, b4 U5 Q ]<TBODY>1 I( b# f. w6 I5 m5 |; ?
<TR>/ s' |0 Y6 Q) F1 v# U& r
<TD><PRE>Method 01 # [* W9 o% l/ T, h
=========! e4 B5 C2 \$ b9 K! d+ P& q: k
- ^. e9 n( K3 y: m0 P% e) f% yThis method of detection of SoftICE (as well as the following one) is
7 {) c, ?$ G; R; `/ |9 Vused by the majority of packers/encryptors found on Internet.) ~' O/ ^* T1 @$ k- q4 E! |2 V8 s' {
It seeks the signature of BoundsChecker in SoftICE
0 i4 }0 Z8 r! x2 q2 J' \" ^) X" k e" U) @# o
mov ebp, 04243484Bh ; 'BCHK'7 x5 o( w+ p9 _) a2 l
mov ax, 04h
( W/ k9 p( ^5 G4 k int 3
9 l' U& }) N: m) N1 s" A cmp al,4) N: I' V" N/ B4 T% x9 ~. t
jnz SoftICE_Detected
. R* C* v% i4 h" B9 n2 t/ A! T- v; c. y1 ?
___________________________________________________________________________* p) ^( Q! t- N$ F1 j# ]7 n
& G( V& g' @9 J' X( v2 Q# c
Method 02
7 M0 `) l) W; f+ v=========2 s/ i0 E2 {" i$ @
5 n4 J: H. P5 M# KStill a method very much used (perhaps the most frequent one). It is used" |& b+ ?4 [! `/ b
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,0 X: v2 G- P5 v0 a- {
or execute SoftICE commands...1 l) q) w1 v' G/ t# u# n( _
It is also used to crash SoftICE and to force it to execute any commands
% m) q, v8 k0 X( T3 _9 U(HBOOT...) :-((
& h9 ?0 B* R# [9 u! O1 [% ]1 `# _: P3 {7 l1 e& [$ b: s
Here is a quick description:1 ]4 S, d! S* V7 [5 Y, n" _
-AX = 0910h (Display string in SIce windows), ]+ Q0 J2 W2 Y; ^+ X
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) V& ?+ `$ c+ s! e+ y0 S) O( ]* ^-AX = 0912h (Get breakpoint infos): Z. f+ k3 {# s" p1 P
-AX = 0913h (Set Sice breakpoints)
- S' q) S5 e3 U( u7 I-AX = 0914h (Remove SIce breakoints)3 R% F. o) m/ g; ]# k Y7 o
6 ` S# [5 Y: \, pEach time you'll meet this trick, you'll see:/ S* ?# G. s+ e; i8 c
-SI = 4647h
8 Z" `# \4 j2 u5 i+ F7 l-DI = 4A4Dh# k; P, Z7 c! U+ w9 H4 P
Which are the 'magic values' used by SoftIce.7 Z$ P' W6 f8 G2 x2 s
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 w) @8 S" _6 ^) n+ W/ M
/ e6 Q( s; m1 _1 J3 D' N2 d4 }Here is one example from the file "Haspinst.exe" which is the dongle HASP
2 x$ s; @- L+ k3 N, o) H: S% UEnvelope utility use to protect DOS applications:
2 z7 w! b7 I8 B* m! z- r" S+ I! @+ r e( J* L% x
7 A0 e- ^/ h0 H6 r
4C19:0095 MOV AX,0911 ; execute command.
& N, T9 B# l4 C4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; `: B& _* k5 [- U. c: M- b4C19:009A MOV SI,4647 ; 1st magic value.0 \: h8 U0 z2 X
4C19:009D MOV DI,4A4D ; 2nd magic value.6 \2 R$ \) B8 p, a- g) P
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
% i4 }$ Y% q: @; {' u8 }) M4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute5 I1 ]* c/ Y" m* v
4C19:00A4 INC CX
: X D! Y) F- J4C19:00A5 CMP CX,06 ; Repeat 6 times to execute0 e7 Q( i$ o1 \3 U' Y O C$ S
4C19:00A8 JB 0095 ; 6 different commands.
; V7 x' ]- z& l& G3 F& _4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ t ]5 H& o0 z4 k) H1 b. f6 L
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ |- j9 z1 R* r/ k ^5 \. v j: l. M" e, Z# g5 J% {
The program will execute 6 different SIce commands located at ds:dx, which
. }* V" `/ B4 `% A9 h3 T" ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 R3 v' t3 O& C+ I& k5 L/ D c' D0 B5 ]. m7 J
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., H& T& Q$ H9 G
___________________________________________________________________________1 s/ E+ g' y1 }4 S3 d& v' A
4 G: N* p8 h4 A7 g4 i, ?
; q- b+ u: F. IMethod 03
: Q# g! ?4 p+ r( v, k6 h, J; s=========; H! R4 p( v1 b' V$ Z9 O6 R
. I8 w2 w( u) Q
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. f4 k* `& n6 {: O
(API Get entry point)- I- g8 c1 D& n$ m6 `! s" j
! o- Z8 d8 _* _ B" s2 _, J! m' m% U& m/ m3 O4 \+ F; B7 F
xor di,di
" t6 f' J+ j" I mov es,di
6 B. a0 f, X: W" U [ mov ax, 1684h
9 J1 q# R7 c! a2 W, V$ y mov bx, 0202h ; VxD ID of winice( v+ P7 X- q2 _4 \- r
int 2Fh
. `& f% b( @5 M$ K! C mov ax, es ; ES:DI -> VxD API entry point! }# |5 p! d( P/ y
add ax, di
. C/ [% o, u( C1 o" d test ax,ax
+ P4 n" b, c) i* {, A. f jnz SoftICE_Detected
. o) i7 P# }+ l. u, I
' |# [8 }2 ^1 [___________________________________________________________________________
7 G3 {/ G2 r2 d+ P) O
' ]; J' Z9 |- vMethod 04
+ c: M* J3 W6 l# |3 t# J=========% p! W2 O; t0 \+ R7 | i
8 H5 m3 a+ I' u! I. ~5 P, e
Method identical to the preceding one except that it seeks the ID of SoftICE8 S# y _& [4 t3 y) B! I$ A) e6 A$ j
GFX VxD.
2 C- C; A, k4 v4 H
3 \! x' J a9 t7 ]" H& [" L2 X( R xor di,di
4 l+ {+ M: x3 H0 `, _7 y8 |, N mov es,di E) G- z+ ~* w. d6 m9 l, E! t
mov ax, 1684h
6 }9 A2 x3 x6 @6 A mov bx, 7a5Fh ; VxD ID of SIWVID
0 e. | ]# q, {# P9 _ int 2fh& L" E: H/ i( j0 b6 }2 d
mov ax, es ; ES:DI -> VxD API entry point
6 ~. H; \1 Q. K3 U add ax, di
5 @; \3 f. ?- z8 r0 H' | test ax,ax9 a3 H. Y2 a% b. G! |
jnz SoftICE_Detected+ f# w- W7 t4 _/ E2 h) x( B& n
2 `. ?9 H! F- y7 E7 l
__________________________________________________________________________
- Q5 y6 Z4 `4 z: ~) A9 h3 ^. E8 V6 d- j( W4 b
8 }- N. n w5 w! SMethod 05
5 |/ v* N: ?' b# _, l [: B+ u=========
' Y# H) ?5 u3 E' q
7 p7 ?- D9 L5 E7 Y( I+ rMethod seeking the 'magic number' 0F386h returned (in ax) by all system3 ]3 X0 L1 U% t1 ~
debugger. It calls the int 41h, function 4Fh.
+ P. P, P: M: \7 u& |1 A5 W6 l( z; TThere are several alternatives. % y0 Q3 @. P9 C* D+ P0 n: z( K! o
& f5 s) K2 O8 v2 C' }' `6 {. c
The following one is the simplest:/ ]2 t, O! D/ [ `
" R% b0 b) D; v/ x- X% W% w3 m
mov ax,4fh# P, T' V' ^+ H1 a; n5 o6 _
int 41h
* u+ ~( h. C6 M+ b" s9 O! i! f cmp ax, 0F386
* |0 z( d) v' x6 A( i: b jz SoftICE_detected
, R% `: e" [/ r, T+ k! p7 G
" g, t! @3 h, Y" b+ L5 g: ^
, j G+ z( B0 m3 aNext method as well as the following one are 2 examples from Stone's $ A: i& _4 B y! A
"stn-wid.zip" (www.cracking.net):; K- m# t7 {- g$ d4 @ Q
$ g. d& Z, a7 N. C; q" A- ?
mov bx, cs
# u1 b' `# H3 W e { lea dx, int41handler2& ~# B% X7 j% F0 P
xchg dx, es:[41h*4]
6 G+ k2 _. z( _3 x xchg bx, es:[41h*4+2]# Q7 m% \5 H5 h# Y1 i
mov ax,4fh. ?, o; ]5 _, ]/ }
int 41h
* r6 C1 q% F3 i3 l2 o# @ xchg dx, es:[41h*4]
( e5 b. a* U% P/ n% S' ~ xchg bx, es:[41h*4+2]
6 H6 D6 Z, r; o7 z cmp ax, 0f386h7 b L- `: T$ V' I# c
jz SoftICE_detected5 q8 j; k5 `5 I4 M/ a$ n0 G1 [ q
% S- F* n- k, e# T& Q
int41handler2 PROC A }' I" Z% z$ I* D& F. ^
iret g( ^+ m( }' C! v0 S* j
int41handler2 ENDP
5 O8 u2 ~7 l+ S
2 o+ ~2 z% c) R! Y Q' ^. v- d8 C; r" P8 Y. C2 `9 g
_________________________________________________________________________
4 e1 q" U" p; U0 T+ g4 [
/ G- _3 |: E6 W: `: X/ U1 U
! O2 R- N7 x$ N& m% O- r! IMethod 06
" ~$ D- B# R( ]8 n=========
' }+ a" c+ q; F; i3 M Q6 c, o$ K! ?; F4 u5 y. U' d D& q6 p
: b- t8 F; D1 f+ u' W6 V$ x, _7 M
2nd method similar to the preceding one but more difficult to detect:
5 I( Z5 z1 e. O+ D0 G7 O5 V8 \+ K; P+ Z: L+ D& T
5 |# V% P2 ^- E( b& t
int41handler PROC
5 x7 g+ T1 s8 c mov cl,al0 n3 o. d& `# O5 R$ W
iret
& L( x0 X# G# ]. V/ zint41handler ENDP
$ {3 I$ {* L$ m- w8 }2 ^
& D$ h1 t A. g- O$ ?$ \/ z, n7 L9 r$ \, V7 ]; k
xor ax,ax
) C! F% [0 }4 W5 \* O mov es,ax
8 B' i# n/ y$ i, @# [4 t mov bx, cs, M) j3 x- s8 x* T1 g+ {
lea dx, int41handler) Y, b, w0 z$ l# G/ D
xchg dx, es:[41h*4]6 H' H# A& i# e3 Q8 |6 a
xchg bx, es:[41h*4+2]" r1 Y$ n7 B' p& ]7 x' m# X
in al, 40h5 g# o6 d( o* g6 T) [
xor cx,cx
1 \9 Y4 x) ]% n: V int 41h
7 J! R, C8 n! ]0 R5 L. J; ] xchg dx, es:[41h*4]. Z1 ^3 M1 j2 u+ }7 d
xchg bx, es:[41h*4+2]/ c8 n6 d) y; r0 D0 D/ g
cmp cl,al
, X3 y( m& _: ] jnz SoftICE_detected
4 m: P2 N+ G9 G: `+ T% h4 \3 I
+ h, @, D& M6 V3 N( x_________________________________________________________________________
# V, |' `' m# f0 c% l) N1 F
b2 i- M& u# P" q. X( h' Q& L4 QMethod 07
8 L) F: d4 a1 `& c" B3 K: e" B=========
x! [6 ]9 [4 U" P+ l
3 ]# c3 C0 ]' u8 B# IMethod of detection of the WinICE handler in the int68h (V86)
n; t2 X7 e. S( {% u7 E
7 G5 m" R" @; }) p mov ah,43h/ N1 w$ d7 ^0 ~
int 68h" |9 G6 A; _& o% S- Y' c
cmp ax,0F386h4 [# q! @" B+ [8 f$ C l
jz SoftICE_Detected
! x, X! Z7 l9 J. Q m9 T) }' j. _9 ~3 m) N+ z: N+ f# p# l: L+ m1 B
, b( c3 k4 h8 f3 ^- U
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, l# u& z3 M3 W: V: z* k- x app like this:4 y0 A9 ^; ~& g, Y+ s# k
0 k( [: i5 o5 C) i0 A9 P' G, h$ I
BPX exec_int if ax==68, y: N5 |1 y& y+ D5 S
(function called is located at byte ptr [ebp+1Dh] and client eip is$ h0 K" o- @% R! n9 R. q5 q
located at [ebp+48h] for 32Bit apps)
; P z5 E& V; I* G, }__________________________________________________________________________
5 ~, w$ Z _! _/ @# R% B1 v0 R. N# x7 |
. z6 z6 `5 N+ [, c
Method 08+ [" J% N! f1 H2 w* i1 H
=========( D$ v+ p& u; G
* @( {$ T7 L3 R. T9 R$ U' ~
It is not a method of detection of SoftICE but a possibility to crash the" v- A) h7 C, V! X5 [. D. z2 m
system by intercepting int 01h and int 03h and redirecting them to another
1 h0 H7 y3 ]6 T2 Iroutine.
+ H: ~* L) c; d# n* kIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" U/ t1 R1 G% d
to the new routine to execute (hangs computer...)
. H+ A* H, C1 P/ D3 ^% n$ d4 r* v! f% n( ^1 P3 Q
mov ah, 25h
8 K( t: ]. a- V% Y4 l mov al, Int_Number (01h or 03h)
* ~1 Z& n2 i3 C0 X2 ]: ?% ] mov dx, offset New_Int_Routine
, A' R7 t/ W& ]0 b4 ~, K4 A int 21h
/ k$ f1 N. H/ e; B
/ w* c, ^2 ^& x( Y) j9 ~3 R! H1 I__________________________________________________________________________
2 p" W8 P a3 j8 ]+ E/ l; W. @
1 y# u9 e o+ {Method 09. V1 H4 U: ?& ]! [ f# J3 N
=========! O2 n1 z' X2 X* q2 z
' A* I/ q- ?; x$ @% qThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* Y4 T* X; x6 e7 i8 f' `
performed in ring0 (VxD or a ring3 app using the VxdCall).0 C% Y2 P/ L3 k* F$ ^6 R, r
The Get_DDB service is used to determine whether or not a VxD is installed
- n$ U: e: s/ R' Vfor the specified device and returns a Device Description Block (in ecx) for
1 I6 z$ ~ O: T! Lthat device if it is installed.4 [* S8 S3 j! M4 W& Z9 U" a( O
4 u( [9 T' K. Z2 w9 l
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- B3 f& K: L/ p, Q1 M* v5 L mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 E4 y+ ~* b# L8 G0 H( m; \2 ` VMMCall Get_DDB5 N. B; c+ J% s @7 u
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
' i; v" {$ a$ O+ B" ~8 [; H
6 A$ F" A# K: g8 j) HNote as well that you can easily detect this method with SoftICE:8 y+ B2 w( c& Z; G4 e
bpx Get_DDB if ax==0202 || ax==7a5fh
: J& j3 @. i& p/ G0 d. i9 n2 e+ H: E# r; ]' D
__________________________________________________________________________
+ `6 [; v& e! Z( B8 w! m
& U7 V4 P' d% `! ?" CMethod 10( g# K- ?" t" z: Q: r
=========
" F0 x7 F( }$ A. v6 i M
# @% M6 p: k% z# N=>Disable or clear breakpoints before using this feature. DO NOT trace with7 b/ y8 O, U+ l8 G# O! |1 U0 ^5 o" v
SoftICE while the option is enable!!
5 B5 X% A5 k4 g0 u2 \1 U5 k8 c2 u: E+ F8 J2 m) _
This trick is very efficient:
; |; k4 D) f3 Q$ S& Q" Aby checking the Debug Registers, you can detect if SoftICE is loaded
6 I, W/ j4 r; Z$ `(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, M3 w% N* U3 ]3 bthere are some memory breakpoints set (dr0 to dr3) simply by reading their5 K+ n( L9 k5 }- N
value (in ring0 only). Values can be manipulated and or changed as well
6 M% p% `- i! i- C(clearing BPMs for instance)0 y) U% @, j, |- x7 y6 ~$ P
/ D6 a' V9 \* o__________________________________________________________________________ w+ c* {5 ?# k2 S' z Z
+ K5 l0 w8 B7 I
Method 115 ]& M3 p/ n% R8 o. H
=========- z+ S+ B9 i( P+ v3 ]7 u. [
0 F7 e4 j1 m6 Z5 q. eThis method is most known as 'MeltICE' because it has been freely distributed5 ~# e4 `( ~- z8 H" Q
via www.winfiles.com. However it was first used by NuMega people to allow4 }" P& Y: Y8 m( h) a
Symbol Loader to check if SoftICE was active or not (the code is located. V0 U3 R. @$ @" [6 B5 C" @
inside nmtrans.dll)./ E' S1 Y$ A. g# S
7 o- k) @5 \, S% v) NThe way it works is very simple:
, a% r$ x k% X2 t; qIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
8 A: w7 S" N# x9 DWinNT) with the CreateFileA API.$ ^4 r. E8 t, w
0 V: {- j% ]; k4 \& C& _
Here is a sample (checking for 'SICE'):7 M( c! D0 N! F3 w/ C
8 J1 x: Y2 E, ]( y; T. X( Y
BOOL IsSoftIce95Loaded()
* [2 i1 J: O; s: M) J# T e) |+ H: ]{
3 t1 c5 i, b0 c HANDLE hFile; . T4 l+ _7 U( {1 w. F* H9 u% z
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, f6 {' U7 |* O
FILE_SHARE_READ | FILE_SHARE_WRITE,
1 p+ D/ H1 ^% F4 ?4 j( S1 m+ g8 h# { NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) @9 M" M+ \+ W `0 }! f0 n- `. ~* W if( hFile != INVALID_HANDLE_VALUE ); N+ e* a0 ?* M
{
4 `: \6 U: b- P1 W \! ~1 q CloseHandle(hFile);5 \+ a0 g) R5 \+ B5 n: D4 {
return TRUE;3 ?1 X* L6 {! {' ? j& o
}" D) s+ i/ M) _
return FALSE;
$ V6 G5 _! \7 S. m1 M}
" Z) Z0 h( }! |4 Q( f# r+ q9 n `1 M5 d, z/ B
Although this trick calls the CreateFileA function, don't even expect to be
# U7 N5 s; F8 h7 R5 H: |able to intercept it by installing a IFS hook: it will not work, no way!7 U: I6 p1 ]/ a) \1 f4 h6 y
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 w! b/ d5 q0 ? ] F5 W" X$ r! Hservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* ~+ E, b( K% I* qand then browse the DDB list until it find the VxD and its DDB_Control_Proc
- \4 W9 O d$ L$ j: D; V& Ofield.
9 G. x& L$ d8 H: P/ M. s. XIn fact, its purpose is not to load/unload VxDs but only to send a 5 w% \4 R# p1 V, z$ w: d
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 a$ Q7 B( W% vto the VxD Control_Dispatch proc (how the hell a shareware soft could try* {8 u% q$ d$ ?# Z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 u0 f1 l1 m; E1 v! n5 b4 t" jIf the VxD is loaded, it will always clear eax and the Carry flag to allow
+ s1 O( @" i% T4 ^; w1 eits handle to be opened and then, will be detected.
- O. |% v8 v* gYou can check that simply by hooking Winice.exe control proc entry point& q- k4 G7 g/ p
while running MeltICE.. N2 Z0 B7 O6 t
: F B0 f1 Q( S: ^& C! v
. C2 l! q$ B4 \% V1 i6 U9 y) ^ 00401067: push 00402025 ; \\.\SICE
5 C$ I% ~! A+ p& i, ~ 0040106C: call CreateFileA- ?/ d: [9 A8 q: _5 H' k' u$ o
00401071: cmp eax,-001/ ?0 M. Q! @1 A. b- O" Z3 @
00401074: je 00401091
], w% D+ K& l: V+ f7 d& Q! W% ~# o4 S5 a9 @; t9 k7 l$ I# f9 Z
3 }5 i. H0 [3 K* c# S5 c
There could be hundreds of BPX you could use to detect this trick.9 G- u# H( ]0 a. K& ?0 B$ {
-The most classical one is:, @9 {- {. W q7 n
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
4 T! ^8 {1 f% Y *(esp->4+4)=='NTIC'/ R' V0 c- H! q6 o, E
& M1 ?3 Z- |# g* W-The most exotic ones (could be very slooooow :-(
7 j! O l$ n4 F4 ]1 j4 A BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; G ~8 f9 [( S4 o5 Y
;will break 3 times :-(5 |0 X2 j) j! |4 g( [9 O/ [' p
/ w2 y- a5 K! z: M K* f
-or (a bit) faster:
: n( @4 I) f* X' W$ K BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 @6 B/ e9 Z0 Z5 `9 o Z
$ ~8 ] W* x. q. p% g5 Z BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ; W" q3 y5 x6 Q |$ B, ?* m
;will break 3 times :-(( L( F) m I( c( E) n" a
1 I; |: v ?7 f0 ~6 _2 l# p0 O k-Much faster:
! S, ^& [ {( \$ y! `! _ z1 D BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
. c5 R( _, @3 R7 l' C8 W- g! h: y& d/ x7 g. b8 x" F2 g$ z. N' S
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 z4 g7 O8 _7 ]! F5 m, p" p* [function to do the same job:
# T$ g5 E* r# Z- R& r
8 X6 U0 x) {) g2 p+ }# [; \" l8 Y2 [ push 00 ; OF_READ
4 [; a3 \! I3 z4 A' _. N o) M mov eax,[00656634] ; '\\.\SICE',00 C1 l; F- i6 A
push eax
1 x! Z0 ?0 F4 A" @% g call KERNEL32!_lopen+ `( t3 R o" v
inc eax* ?8 g3 s% B/ k# A
jnz 00650589 ; detected
/ i- \6 H+ c2 R9 B O push 00 ; OF_READ& N8 O! E! C6 D6 ~
mov eax,[00656638] ; '\\.\SICE'
8 u- |$ J- t# i# L push eax
: t V: U: [: k9 F5 n# O$ t2 h call KERNEL32!_lopen
' j/ X2 a% t, V% k _+ i7 `* y inc eax
& J4 N0 f2 ]& S* p1 l3 } jz 006505ae ; not detected7 t) d2 F" C; l- P( ]
0 A* B$ x8 x4 h3 Q/ X( G+ \
2 W" ]7 ]4 _% S @) [" e$ |& Q
__________________________________________________________________________ A3 F$ U5 g* h; Q. [9 _; A
5 ~2 d$ M9 A5 cMethod 129 r* [3 I/ C) O
========= @+ W7 W, h9 j% a) Q! D
5 Z9 N. q1 G" P3 wThis trick is similar to int41h/4fh Debugger installation check (code 05
/ z3 p! b8 }" ~, |+ f) Z& 06) but very limited because it's only available for Win95/98 (not NT): O0 O" M8 i8 |( `. ]
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 z0 k3 k. W V# P$ W, Y5 F! }8 n6 \$ }5 V, W% l
push 0000004fh ; function 4fh9 C9 S3 U6 e* H0 D1 ]
push 002a002ah ; high word specifies which VxD (VWIN32)
7 i3 A2 D# U o# |7 K ; low word specifies which service+ B8 e& o |- l f2 l' r. k8 C6 P
(VWIN32_Int41Dispatch)
, K+ P% s% W, ~6 U! Q/ Y call Kernel32!ORD_001 ; VxdCall1 _: w0 A, B0 z( _ _
cmp ax, 0f386h ; magic number returned by system debuggers% N. m( m/ u; B- m5 \3 l
jz SoftICE_detected5 e1 ]9 S5 \' L' _
5 Z' J2 y+ L7 ?' `6 T1 x0 f
Here again, several ways to detect it:3 A1 p! h( g4 `8 V" M3 \
, o$ k8 g& b8 G8 e- A% P2 W& v9 z BPINT 41 if ax==4f: Z0 R5 A' R9 {) l. d1 w
# q) B( Y' ^6 y, o% O ^
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
% Y+ n. l' ?$ c: F! Z7 E0 m2 Q @& M" }& e |. f7 @9 C
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A& d1 r- v# q: g
2 L! F' ^3 g6 Y/ j BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. V$ W: C# N5 ~4 R: f7 q& i; T. C
__________________________________________________________________________
+ z: ]: l) f' c0 B. Q: u* T# j2 o
, Q$ N( O5 g% x) cMethod 13 s) L% q6 V5 D6 v" c& f$ }2 x6 ?
=========0 m- R9 q% z% d$ U3 Y- Z* e
) |3 F7 J* H W# a8 i; G6 u+ d: i |Not a real method of detection, but a good way to know if SoftICE is
' s& k% U, n- k3 u2 Yinstalled on a computer and to locate its installation directory.( y. J- ?( _ Q1 V) }
It is used by few softs which access the following registry keys (usually #2) :
# B( v9 t t9 A0 t: _: O- K; C# W8 v
' w! k' B9 m, q) G4 p-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; s+ q0 u7 P k6 }, r! s" ^$ t
\Uninstall\SoftICE
" X# w' W+ f0 k& |0 f4 k7 t7 M-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" e) w+ q1 Z0 ^3 B% S9 u6 L
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 x8 f" Y) V9 V0 z% ?
\App Paths\Loader32.Exe/ [% y6 r2 v0 Z4 U
3 I: H: c& p5 i6 T
" e' m* }8 f4 k6 b& vNote that some nasty apps could then erase all files from SoftICE directory* s: O8 L7 y! T- c
(I faced that once :-(
$ w y& }' S# A5 P4 d, y3 l0 C1 S# Q& G% C
Useful breakpoint to detect it:6 S$ W- G( `- M0 U- E' s
3 G6 K" J0 D% Q8 u& v$ R BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 k7 L( _3 c& x( U
6 ~) K9 w4 d3 }) F! ^. f5 U. C
__________________________________________________________________________3 Q6 E+ Q& Z; H% n1 |) g( {$ y
& G& J, @" y% P# H+ {6 N* S. {( J9 x: n) Q8 f
Method 14 2 {" m; C: ~; n" ^6 M/ H x$ |! {
=========+ }& K& v$ d. I0 K; f; M
' a. \9 N+ a9 Z% B
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& q5 D5 c8 ]1 e1 Vis to determines whether a debugger is running on your system (ring0 only)./ V5 Q k- D( M A6 m
7 ]( G7 w. n1 I. U7 M VMMCall Test_Debug_Installed+ v& ^2 z8 \5 k; B8 N0 A
je not_installed. B2 h1 |5 p; g* j# @+ e0 x- }
, B' U- Y6 w9 ~# ]& M/ nThis service just checks a flag.
4 n* o8 z7 w& w4 P4 D% j</PRE></TD></TR></TBODY></TABLE> |