<TABLE width=500>
( E$ w4 i( h1 [<TBODY>
p4 v$ o' D/ _( w<TR>
6 {$ \0 U: }3 ]5 R" @( j<TD><PRE>Method 01 3 q5 u) {' D! E5 k1 x. }) I* w- a
=========. r4 q/ ?- J' u" `* |
6 ~. c+ m L" c6 y' q& I6 X
This method of detection of SoftICE (as well as the following one) is9 l) @- Q. \6 [) o$ P9 B
used by the majority of packers/encryptors found on Internet.
4 Q, t) e1 r$ i" _It seeks the signature of BoundsChecker in SoftICE
9 \ X4 w8 t8 t6 @6 I# A2 a M$ [0 e
mov ebp, 04243484Bh ; 'BCHK'
4 }# d) C0 |' v) @! z7 h+ Z6 S mov ax, 04h) i! a. @2 i3 C2 _
int 3
( M( @8 F9 A! |/ }) j cmp al,47 E2 J9 e& F1 H1 f* L
jnz SoftICE_Detected! q" g+ i0 Z }) [0 s* `
) x; Z& S& ?4 A9 b$ K5 W# F4 ]___________________________________________________________________________
+ O: u7 M6 j5 ^: c5 L% n8 j# `1 f. U3 S) |0 h
Method 02# m+ ^/ I3 L# ^8 k. R: {
=========
: x- _: ^8 y1 J
2 L" i( d% k; Y; M; E; dStill a method very much used (perhaps the most frequent one). It is used. `& ]: e7 ?# h8 O$ ?7 _ H1 L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ k% U& P5 L2 J5 e' U; d
or execute SoftICE commands...
- n1 J: R' t; x+ F* MIt is also used to crash SoftICE and to force it to execute any commands
n: w7 x8 a* Q2 y7 F! V8 C8 @) H(HBOOT...) :-(( n- v. T7 }; ]' \
1 B4 D/ q( t. [& L
Here is a quick description:2 D( n7 {, j7 n: E" X% v
-AX = 0910h (Display string in SIce windows)
, k5 C% C1 K; U7 D, _; C1 a) ^8 E8 j-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)4 i1 |( {$ S d) L
-AX = 0912h (Get breakpoint infos)
9 y. W0 F" @" R+ x1 J+ |& x; v. P-AX = 0913h (Set Sice breakpoints)& z2 R9 |- w9 x1 o; O& }
-AX = 0914h (Remove SIce breakoints)
1 i$ @5 b( g$ g% A% T4 W; N
2 O7 E! T/ N& F+ [8 F" c! B5 GEach time you'll meet this trick, you'll see:
' ~" k6 R" a3 C k2 c$ m) r-SI = 4647h
/ K; q! ]1 `% y7 P9 Q1 m6 U-DI = 4A4Dh5 f" \6 Y4 }2 ?& |
Which are the 'magic values' used by SoftIce./ l7 x& q2 V9 i" Q, w6 l3 F
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ \4 `: i- \: c6 r+ K
& U7 v+ W& F9 |Here is one example from the file "Haspinst.exe" which is the dongle HASP
1 W5 K; n4 `) n0 C+ {, r1 s; bEnvelope utility use to protect DOS applications:
6 I4 ?1 ~2 J! U* F5 o0 @! Z) ^; r/ d/ ~9 W5 z
/ R1 f+ ~& y+ v
4C19:0095 MOV AX,0911 ; execute command.% e% t8 d& U% D) Y' D
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: |) u' w4 N, Y% ?" v
4C19:009A MOV SI,4647 ; 1st magic value.9 b5 F" r5 l# G, |* c
4C19:009D MOV DI,4A4D ; 2nd magic value.
& d2 i) B' V% A. A5 n' v* \& [4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
3 x: X0 H% \! D4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 q+ q2 o: d8 u) w" r9 }# T+ l4C19:00A4 INC CX" y$ A4 {8 q4 ~- N
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, j t) ?( u% Y) x+ r
4C19:00A8 JB 0095 ; 6 different commands.
9 y- f& a4 m& b2 v* v4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% _6 c8 @$ _. F I; H( d4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
1 U' K1 D" a/ i q0 f9 H: E7 |2 |) d) w0 l
The program will execute 6 different SIce commands located at ds:dx, which
4 R7 U0 y A9 {9 t: e8 p/ K& O. aare: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ z4 K4 B. u. ] v
# D0 s$ \7 F2 g. F& c0 ?* _- D2 s
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ g3 `* p* L" k( e___________________________________________________________________________- u5 B5 H' e! Y1 j/ c* f
! G/ g: | j$ s4 V
: _8 V% H8 h& ~; A3 y: xMethod 03
. w' z5 f4 e8 ?% h+ m6 d=========
; Y3 w" {3 G. M, ~: D$ I: i; R! i5 P. ~
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 p( f: C4 N% ^
(API Get entry point)
4 s: l; w7 {8 I) {
4 R+ ^; j0 I7 } k! b* N2 H( s# V( I8 F r" I
xor di,di
; x, h+ V( n7 U( F. H mov es,di
4 R) D) m% p& ] mov ax, 1684h
! N9 H l; j- B) X% i; Q mov bx, 0202h ; VxD ID of winice
) [7 ^2 d# q* ] int 2Fh( P5 K% M2 G2 h9 k
mov ax, es ; ES:DI -> VxD API entry point
# N) V/ X6 L9 Q) X add ax, di. D" [8 c5 J" O( [+ ^- w
test ax,ax, q" W: T+ Z7 \! G$ L6 ?0 b
jnz SoftICE_Detected
4 Q9 }& g2 }6 f: o2 Y
& J. }% `% ^; D; |9 p___________________________________________________________________________' h* [2 U9 J* x# _8 h
. T# u6 x$ X- H3 I$ {, W
Method 04& v+ E" _% V1 I b
=========
* k+ {& M9 t# k. Y: q' j1 w* q8 \6 a x+ d7 ]- M6 [
Method identical to the preceding one except that it seeks the ID of SoftICE
! n$ o/ N4 [: RGFX VxD.
- u8 s' D9 h4 `9 h# ~+ J
( S6 o( j3 A* F xor di,di
F0 l8 H M1 k+ K: h7 ~! I mov es,di
2 Q ^0 [) V$ I P' f, r# H2 |: K mov ax, 1684h " \" _, g( g! W8 \0 R% ]5 p `
mov bx, 7a5Fh ; VxD ID of SIWVID: e0 i4 N1 X- ?2 f' s
int 2fh7 g- y$ m8 r# H3 E; d
mov ax, es ; ES:DI -> VxD API entry point
8 ?6 o6 C- Y, n: V8 E" T0 i add ax, di$ g( \, M( b8 M" l% }8 h. \9 p
test ax,ax. C5 M3 z* w N n5 }/ z
jnz SoftICE_Detected
9 _' l0 t4 f. u/ j K5 a' r: M
1 a; l5 n1 `6 Z6 R7 Y ___________________________________________________________________________
" J/ `1 T0 b1 j" D' r; ~" |1 T% v5 P, j) l! C
. \% m- M# ^* T$ D9 X+ Q: x" B6 uMethod 05
! i2 Q2 Y; J" C: u+ \3 b=========
, O% G' M0 K" o- x* X8 [2 H2 B+ F
2 n& u0 f5 C3 d9 k7 C: GMethod seeking the 'magic number' 0F386h returned (in ax) by all system9 Z2 q3 k2 J; j% r
debugger. It calls the int 41h, function 4Fh., F. f" H2 [7 f: j3 G; B
There are several alternatives. 6 K" E% d. p$ h$ |& G7 `
, j$ }: V2 |6 o1 H5 V: B
The following one is the simplest:, W7 o( e& d* {8 @7 a+ }$ ^
. m) v: s" ]% Q3 `+ H" v
mov ax,4fh
% B+ p9 M2 Z# I5 T8 O' H int 41h8 H2 j) m6 R/ j
cmp ax, 0F3866 @7 B/ c$ L1 q* t
jz SoftICE_detected
" P+ {6 H( q8 b0 H+ @1 _7 F2 d6 ~% y5 s2 l+ Y- U; O1 L; f
6 p: l2 S; C2 n& J; e! T* LNext method as well as the following one are 2 examples from Stone's
7 C# A' [* F4 R2 g4 p"stn-wid.zip" (www.cracking.net):: A9 n) T7 M, E; z; g8 E q
. I4 _# `7 H# ~2 g" D, a- F! ` mov bx, cs* f" V) S! r! E1 f/ C0 p
lea dx, int41handler2
) G" S5 G. C W. h. r! p xchg dx, es:[41h*4]
, T! j" k2 w/ l6 J- { xchg bx, es:[41h*4+2]. |6 q4 [+ \- n2 [- p4 T. f8 k& e
mov ax,4fh
+ |& m' A0 [; ]7 R9 L! J* u int 41h
& {2 s6 c7 f6 ~7 Y$ \2 @# G xchg dx, es:[41h*4]
7 F# |6 n, x3 b% z) @% O1 h7 u7 y [0 D, ] xchg bx, es:[41h*4+2]
, P( r% M3 K1 Y7 i4 W cmp ax, 0f386h! z9 s! w5 N! I/ B$ p
jz SoftICE_detected8 ~1 s4 ]' v7 c. F4 A* N
$ ?5 [9 r- t/ Wint41handler2 PROC
3 r' d( Y. N5 z- x5 M' O iret5 |5 U$ g* j, k2 Y8 C
int41handler2 ENDP
; X1 ~- F3 J$ P* H5 G, n( I2 {% v. I) E8 X4 H8 B8 z
" k2 h: j7 E3 h# Y
_________________________________________________________________________ H4 C, _3 r6 ^$ f
( \0 {( Y% j7 h% _% q9 L. e8 Q
) F% q7 {: q! }, ]2 PMethod 06
$ i7 @' }- F3 o$ ~% R# L/ ~$ D=========
: T8 ]3 ]2 Q( u( d' e* P/ y, I2 a- i2 B! Q5 ~+ v$ U% y2 {; B' M
" s* K# [: y1 {: e7 T5 l, f
2nd method similar to the preceding one but more difficult to detect:. m' t4 @3 C+ w. k7 Q2 c
4 ~: o5 ?+ i, x* N9 m
2 f1 v3 {" h1 I
int41handler PROC
0 Z% |+ E( Y& \7 ^4 n mov cl,al6 J0 q/ X. T. U5 `% F
iret
: u7 E, W, x; Y& I; Gint41handler ENDP
9 \% y( L, q! z8 t1 ^8 \) e+ ?6 b0 ~" i) `' f9 v. v
5 B0 t; B" ]9 k xor ax,ax
- X8 G* \6 O0 n6 e& d& n: h# o mov es,ax# y( e5 ]1 t% o' V* o
mov bx, cs2 O) i5 i) \( e5 @& @) I' A
lea dx, int41handler. T$ l; I9 i& \* V
xchg dx, es:[41h*4]4 }: P2 M# Z2 D# K
xchg bx, es:[41h*4+2] f% U8 A, ^5 |2 q0 A1 T, H
in al, 40h/ O* m5 I! W+ }7 g. w
xor cx,cx2 s |. g' a7 w- G9 h* ~
int 41h
' K D( p& ?4 I" h$ T, U xchg dx, es:[41h*4]$ [! {' W, H7 H* |/ S
xchg bx, es:[41h*4+2]
6 S2 z6 L$ ]# m+ g9 b1 t. y cmp cl,al
! t; ^! E% @& Q# |# U: A jnz SoftICE_detected4 F0 ?0 ]* L6 C! {! A' e
1 Z' W5 [8 G. w
_________________________________________________________________________9 V& L: ]; G" ^- y
; U0 r, v: w8 W
Method 07
' K0 F5 ]- s: B/ {7 }6 N=========: P2 e7 a. G! H8 @
# s, _- [8 D* [& Z7 T# }' u4 rMethod of detection of the WinICE handler in the int68h (V86)
5 m2 X4 J$ Q1 ^6 q1 M* M5 \" d) R2 o
mov ah,43h* n. x2 {/ k( t( D
int 68h
7 w* t% O: j3 F* t, B) M cmp ax,0F386h
5 \; j% b% v! I5 y+ }' h* q+ Z" X jz SoftICE_Detected
' a- ^. [% ^8 G* s) f2 _/ p! k* S- F
& ?' i8 t4 Q$ C: }, V5 n! E=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ w- D- o3 a7 G! c
app like this:
- C; N/ w* r( l( f. R0 C6 ? ? c9 q# @) }- t u
BPX exec_int if ax==68
# e& W/ P; _7 D% p (function called is located at byte ptr [ebp+1Dh] and client eip is
) }, H! `0 p d* ?* S6 W4 v located at [ebp+48h] for 32Bit apps)
) n* O2 H2 q7 q, J5 ]. T! `__________________________________________________________________________/ p v. [3 p" z E, L
4 x; G+ E& [) r/ M5 d1 @8 `
# m8 y3 v6 I' PMethod 08
4 h* v2 H3 n, C=========; O9 l: U R5 ~( t( }
* z( o% A# U$ ]8 k6 V
It is not a method of detection of SoftICE but a possibility to crash the6 V! U6 d/ P) g6 S/ Q
system by intercepting int 01h and int 03h and redirecting them to another- R, B3 k- `2 F; |0 [, |
routine.
" B/ D9 h1 k/ n7 t T2 m& IIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 D/ q7 J: @5 x4 o) L# W3 ]
to the new routine to execute (hangs computer...)/ s |" K4 Y, {6 F0 ^
& j3 A' [" B* c ], P2 n9 K mov ah, 25h
+ a4 U! ?8 b* J mov al, Int_Number (01h or 03h)
9 [1 ]1 p4 n) p7 J( ?# W1 Y W mov dx, offset New_Int_Routine
# P+ X. i! A* m int 21h5 Q0 ]9 `- w1 L. {+ o- j1 q! ~( e
, d) o2 X# S+ `, \. ]__________________________________________________________________________
) j# q& P7 i- B0 X2 u8 ?1 x5 l8 f4 `, x. k8 e) }7 y
Method 09" x3 y$ X/ J0 @" U2 a
=========
- L8 s- z8 a' R2 Q7 i- k9 l3 D5 T, @ _# c( g0 h( H! g
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 a, n/ a( x$ t
performed in ring0 (VxD or a ring3 app using the VxdCall).
3 f6 i/ c7 V% G, d% B0 W, J/ P9 RThe Get_DDB service is used to determine whether or not a VxD is installed
' o a- n q; U! n9 ufor the specified device and returns a Device Description Block (in ecx) for
/ A! m) U+ O0 N0 E) wthat device if it is installed., K" V2 Q% b0 [! h. D# a! D. {
- H% v- B3 D- O/ ]7 x2 p# f x
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
X$ P A# f# x4 E7 d3 W; g* { mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-): V8 m3 Q7 j6 u3 [3 D5 y6 B5 W
VMMCall Get_DDB, Z$ X1 y: Y3 {; G6 Q' N1 S& T/ E7 ~
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 K) t/ F0 F$ u# c
/ w, A2 r# t: {# x6 W XNote as well that you can easily detect this method with SoftICE:; v. h- P/ s0 X8 _2 R9 Y; v
bpx Get_DDB if ax==0202 || ax==7a5fh; K1 K3 q: s r0 `6 a0 g* ^, ?
1 m: m% }. C3 {" P__________________________________________________________________________+ j/ z0 ^$ r: P* ^/ b G$ N1 _
% |0 ]5 T" [; w& n& u" W' IMethod 10
^5 v- @; u5 A# C( d% ]3 U=========* y ]$ Q, T) O
- {1 X% [9 q. m: ?- i, ~# f=>Disable or clear breakpoints before using this feature. DO NOT trace with
$ n+ |( x2 @& t7 O* Z SoftICE while the option is enable!!0 z/ N6 l1 O; d
, `. O2 z2 w$ YThis trick is very efficient:
O6 J9 |0 A" |4 p' p& aby checking the Debug Registers, you can detect if SoftICE is loaded& d# R* ^& X5 K& p# q4 Q
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) ]$ a7 B# q/ A0 \- b0 _+ A/ D
there are some memory breakpoints set (dr0 to dr3) simply by reading their
! }8 x" h1 w$ m& Y3 c1 I6 V7 avalue (in ring0 only). Values can be manipulated and or changed as well
6 T/ W& v/ m9 i- H2 v(clearing BPMs for instance)! O7 k6 q3 X& N( P
1 [" t9 F5 P: m/ U3 ^& e7 r
__________________________________________________________________________
: n' q7 K* y7 ?& w
2 R3 C4 w& m! q( t& x& bMethod 11
- e. t* j+ E1 c1 g( ^: D=========
; C% G8 U7 S4 q8 A; l/ z0 X, g' I {. {/ O P" P' W5 @
This method is most known as 'MeltICE' because it has been freely distributed. a2 @3 G! f# ]' J% M/ T: n" z
via www.winfiles.com. However it was first used by NuMega people to allow
0 Q3 @, n T; B8 Q* r: M, o/ gSymbol Loader to check if SoftICE was active or not (the code is located
$ l7 c( [* l: {2 N6 Z$ b% c" xinside nmtrans.dll).7 P. b7 L9 A; @9 r6 V
/ ]' {9 i& o6 C. c# ? \& g5 T8 E
The way it works is very simple:, {+ M, m+ B% `
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( [% D H; G+ X* p% dWinNT) with the CreateFileA API.
1 ~/ B9 g2 ^+ \4 [8 n1 b& |! B' W1 K7 ]. Q
Here is a sample (checking for 'SICE'):
3 [/ {# Z# N, |* C5 Z& e: K# u, g, ^7 d* r4 K
BOOL IsSoftIce95Loaded(): Z+ d$ e5 I- I1 y4 }
{
& Y H2 l# c7 x2 y. n9 ? HANDLE hFile; 1 U& T, j. t, Q. G) Z
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,4 f) I8 ` p: k! z5 |& {3 j) I
FILE_SHARE_READ | FILE_SHARE_WRITE,
+ r! F# Z4 O: ~& G; T' g6 Q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
O4 l3 {" t' U/ ]* F; O if( hFile != INVALID_HANDLE_VALUE )
; v' |# y5 I6 G {2 ~& B( G; Z7 X
CloseHandle(hFile);. G4 ?0 x6 D" b9 u( w
return TRUE;
' `" Z9 z/ R# ^( v/ P* A2 r }
$ b2 j) }0 K, u" h2 o3 t return FALSE;# z3 _7 F: C- ?% s% }5 ]4 H+ ]6 t
}
/ X/ x& L9 E# ]/ p% j4 s! ^1 ^- c6 u3 m0 m& S S8 L" y/ p
Although this trick calls the CreateFileA function, don't even expect to be
0 R9 H0 {0 `5 H3 b( b/ dable to intercept it by installing a IFS hook: it will not work, no way!
( G8 p# H- u4 PIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
+ ^* [: K3 ]+ R1 ~service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) x* K0 @' C. ]5 G
and then browse the DDB list until it find the VxD and its DDB_Control_Proc- r" X7 {+ G# C! C/ S) {. l, \
field.7 b9 r1 Z$ H6 S& N0 T, V c( P% F
In fact, its purpose is not to load/unload VxDs but only to send a
! o/ G' D/ I) E5 v5 P- M: c8 nW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
c( h, X" T) F* [: c% K6 gto the VxD Control_Dispatch proc (how the hell a shareware soft could try
. p5 b4 _+ q, `4 b, t$ Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ h: I1 w1 @/ fIf the VxD is loaded, it will always clear eax and the Carry flag to allow$ S1 [, V% z: f& [, S& _1 Y' h$ u
its handle to be opened and then, will be detected.) M& T; d' l0 y0 p1 |
You can check that simply by hooking Winice.exe control proc entry point) S: N8 X+ m5 F: w7 P5 H; V
while running MeltICE.
, F. E# B& ~: v c
O! S5 _. L2 e/ b2 Y, X
2 {. N5 }; e* {$ O4 K" O: ^ 00401067: push 00402025 ; \\.\SICE' h# A2 J9 m x& l5 U+ l
0040106C: call CreateFileA
/ O$ o+ B: r8 L' M8 ^% D 00401071: cmp eax,-001
- \( g/ z" Y: ]9 \" j! f 00401074: je 00401091
" V# m# l5 z* p' S" L3 i% Z; V3 @9 ^
: z* Z) m5 \( N8 A# TThere could be hundreds of BPX you could use to detect this trick.
9 X. x3 I- l" M6 s t% Z-The most classical one is:: e* `. q& v, {4 P9 \: u$ D5 `
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
" d' I) s. A v) @- d *(esp->4+4)=='NTIC'. b+ S4 `3 }( c# ~% N
, P' J" _. C9 j-The most exotic ones (could be very slooooow :-(' A( W- h7 C7 M/ N! m. ^4 k5 u
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" O( m4 Q7 f, g: ^) H9 E6 \ ;will break 3 times :-(/ k( I5 a( J% N1 ~
1 B7 ?( G1 y- K, K9 N' W" S% _
-or (a bit) faster:
5 C y$ a8 l2 Y' R0 Z) e BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 c2 V, X8 c b C
) n l* z. O3 I
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ o; M5 A1 h& u, x B0 e! k ;will break 3 times :-(
{$ h2 Z1 i9 Y5 l/ K4 \+ I0 v( H* c$ |9 T" l0 T
-Much faster:
+ \+ @, I% [9 X; J BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' o+ v* e1 O5 I# w- p* C/ T3 b! U8 C
: }# U# f" q( T* q, _Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
X% W2 [4 N6 G" m/ X% m# B" Dfunction to do the same job:9 B' @! m6 q8 |: y& N$ _' K
( m. D* Y- x: i$ ^3 r! N8 Y, g push 00 ; OF_READ
7 m; `/ u9 u& v7 m0 u+ l mov eax,[00656634] ; '\\.\SICE',0
: N$ o' t6 C# u3 H: _ push eax
0 R( p( z0 {( d- b3 @ call KERNEL32!_lopen3 K6 q9 u5 J8 z3 \
inc eax1 `1 }; _$ m$ C3 K4 W
jnz 00650589 ; detected
( Z- U, H( a/ K7 K2 s push 00 ; OF_READ: A( {' d7 O7 F& `
mov eax,[00656638] ; '\\.\SICE') r" o8 x. U+ |' q$ s+ _6 y& i, j
push eax! r1 G& h. { |0 a, m8 v& _) X/ q
call KERNEL32!_lopen6 `4 r, Y" Z) f$ i9 n$ Q
inc eax
/ i g: ?! k7 D' K; Z3 f$ B2 \( a jz 006505ae ; not detected5 } n0 i" y: N: Z4 n* Q' _
; r) X1 {; f$ r3 P' O5 W
; G! H( M2 i3 m" h
__________________________________________________________________________
6 j" `) q/ B L: N& s3 {. }. }) f) U' L
Method 12, r" f* c# i* G: x
=========
, Z; {% ~ e. |, S3 x% g/ E3 i
/ p& G' E" f4 q ~( L4 N1 R7 rThis trick is similar to int41h/4fh Debugger installation check (code 05
+ H5 D, n- I6 Z& 06) but very limited because it's only available for Win95/98 (not NT), C) M) ~$ M. e6 B0 t+ Q- P J
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, s" o3 U, {9 Z
& i5 M: a$ O! V! }/ P% V1 V push 0000004fh ; function 4fh
+ H& I) h9 i, c6 t* \9 L push 002a002ah ; high word specifies which VxD (VWIN32)
" Q+ o+ }( l: F I. q ; low word specifies which service% R$ K/ d; A1 l* [
(VWIN32_Int41Dispatch)
0 A: I- C7 P, T- r" D1 l. X/ C call Kernel32!ORD_001 ; VxdCall
0 t1 `! K9 V! }* w/ r+ d cmp ax, 0f386h ; magic number returned by system debuggers1 v% W3 _# L& R
jz SoftICE_detected
( Q% w: j8 \: W% j! [+ b- c, d, t- a7 f
Here again, several ways to detect it:% l4 t& D( r8 @& M
2 v5 i' y. p0 W' ^0 N BPINT 41 if ax==4f
* D+ q) G' F9 Q; A% f+ b( N
) G3 {1 @* G- O BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* r+ r, V* M! `+ W; y$ I; l
) M4 w. g' H5 t; a3 X BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A8 [/ `7 {! j5 w5 V! S7 x
, }9 P: }# A9 \) n BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
( `* l" N1 ]+ e8 _( z% Z+ z- Y- N& B. j, @% U
__________________________________________________________________________
( I3 \. o! Y1 I4 F* q% Q
3 N9 I" s8 y( p: q. h' a& eMethod 13
0 R0 Y' {) m7 W) ] F2 Q8 G=========2 Q/ W. b8 T% [7 d3 k- P! [" R
, w$ [3 J! D" q7 @) y( |
Not a real method of detection, but a good way to know if SoftICE is* w- p# `: n7 \: l1 b9 A5 |
installed on a computer and to locate its installation directory.7 f' q- J3 z( w
It is used by few softs which access the following registry keys (usually #2) :! X) W l ~7 M; l% F# {( B
s5 f" b' H; }* s! l
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 a7 N9 n% A% w- H6 m' M
\Uninstall\SoftICE9 x# A' _5 ~% R8 A [
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ U8 M0 f, f+ y: ?: n-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 C- P7 s# E. e% k7 l0 H
\App Paths\Loader32.Exe
( ^5 A; h# F1 w: }& V4 u% s/ K; J9 a6 w% F
: y$ R- K- y' p. x N& iNote that some nasty apps could then erase all files from SoftICE directory
8 r- s0 Y0 |% s1 A/ z, _( O(I faced that once :-(
% x! `/ b/ L E6 C1 x* _) x' {. [8 N( E2 I2 ~4 [7 G
Useful breakpoint to detect it:9 f8 ^* [9 H3 E( r; w1 S0 i0 h
/ w( F: k" x" |6 }7 ?+ p6 b* x BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( N! A$ p9 g/ S5 X$ }
, K8 c0 j7 c8 a% ~/ m__________________________________________________________________________" \4 Z4 v8 n# V. x3 G4 Y1 E
$ b1 p3 d2 \4 q) A7 C( f' `, j$ r$ r7 ]* Z
Method 14 5 G8 w! X9 P# s7 d
=========
" F% z' o! J+ c; ~! k- Y6 n: p9 Y2 Y+ [ t* w
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose9 H2 x6 l0 j! k v( q1 T8 r8 F" f) P
is to determines whether a debugger is running on your system (ring0 only).& f& J$ D6 z* H+ U0 F
- q, `: j8 B, a' I
VMMCall Test_Debug_Installed
! @: Y% k3 t- E* j% L( t4 [( n je not_installed3 e% c0 M9 P& P3 X. d% L& H
9 v; h* M0 E( u0 ^' cThis service just checks a flag.
D+ i7 {* S& G. E/ N</PRE></TD></TR></TBODY></TABLE> |