<TABLE width=500>
% h; t# D G0 w# w) h9 l% A. U' I<TBODY>$ ^% J8 r- z$ j
<TR>. F) |& Y5 f- }6 s. ]
<TD><PRE>Method 01
# d. |$ l7 y3 A( }/ i0 N9 O=========" f$ f; d& y* ^1 f- k9 I1 s
1 o; V/ k& K! ^% m; KThis method of detection of SoftICE (as well as the following one) is
9 }$ f8 \" P5 sused by the majority of packers/encryptors found on Internet.
( J0 F3 D7 ~" ?3 N, f8 ?* h- \* f( fIt seeks the signature of BoundsChecker in SoftICE
2 d2 V! e3 C: n4 {2 f+ F; Q' ?) p
/ o) C9 `, y) X, t mov ebp, 04243484Bh ; 'BCHK'
9 j0 S) s9 B3 m9 D4 g5 k/ n mov ax, 04h, Y1 B F5 D& M
int 3
5 ]+ L/ h4 u$ [+ W cmp al,40 }2 G- t, W9 T" J3 J# a
jnz SoftICE_Detected6 m1 P+ ^( p) R4 v0 n
2 J! B3 m/ N& y4 f. j
___________________________________________________________________________
9 ~6 [; G7 Q& @& a# p/ p6 x
& {/ q! k' P. _4 O6 MMethod 02
( d0 E* L1 e, y# h( { l=========
3 W3 T" E8 h; L+ T9 G# Z+ M6 J T& i* D* X. Y* T. Q5 d
Still a method very much used (perhaps the most frequent one). It is used0 Z: z* b" M x1 [; J# N5 v2 _
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) P: P) l: V; K8 r3 ?; r9 Z/ ]; eor execute SoftICE commands...' Z0 O9 ^+ [/ e: U( X' T
It is also used to crash SoftICE and to force it to execute any commands- Q- T% F, p9 ^" B+ t7 I7 F: v" S
(HBOOT...) :-(( 0 c! W! E+ L& B/ m5 S
. t+ c5 i a) p) Q2 L
Here is a quick description:
9 x+ d. ~' W7 Q; K6 o. d5 `-AX = 0910h (Display string in SIce windows)
$ V) L# V H4 E7 d5 T/ C* X3 a-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)% L% ]9 v" V% H+ h
-AX = 0912h (Get breakpoint infos)
+ |( r% |7 [( P4 t! r-AX = 0913h (Set Sice breakpoints). Y4 {5 S* d2 M0 L+ i
-AX = 0914h (Remove SIce breakoints)
3 [6 ~. S' {# b& p- S- }2 o- p! q$ a
' u8 m4 t$ G) A! iEach time you'll meet this trick, you'll see:
" M! o' Y( [1 r2 O1 Z-SI = 4647h
2 K! q6 N) }% {% `* ~5 O5 S7 a-DI = 4A4Dh
7 T$ i, x8 j3 @2 ~- t- F$ ~Which are the 'magic values' used by SoftIce.
$ P+ o( U$ M1 S+ f, ~, b- EFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 T, ~6 n; _9 I6 C& K [* E8 r7 {/ n/ e1 B3 {
Here is one example from the file "Haspinst.exe" which is the dongle HASP
# x6 r" e0 t- `6 nEnvelope utility use to protect DOS applications:
! H" \5 k, Y9 u. N0 q- G! V" ]6 X9 U6 R# }" _ U3 q6 F
A: u+ K3 o* q6 @5 _. @4C19:0095 MOV AX,0911 ; execute command.
) ^+ p# S! }7 i3 ^# |9 D7 F* A4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
P' N# e; Q D1 ]8 X4C19:009A MOV SI,4647 ; 1st magic value.
! @$ d- h* r: n, N4 [4C19:009D MOV DI,4A4D ; 2nd magic value.
0 O. h; P: u0 e. _, |6 z" U$ }9 Q4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 L- d$ q2 K) B5 Y9 l0 A4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
! S/ X' R! V8 F" f& {4C19:00A4 INC CX
$ C( r& n) w8 E1 C4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* c; {+ D- }" m S% l6 h4C19:00A8 JB 0095 ; 6 different commands.
1 B$ N3 Q: k) h5 o0 p4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 l. g0 r- G6 |, w7 ?( n) R4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 W2 U5 E' s6 Y# q+ N+ t
6 J+ b2 Y, v2 l& `: Y& IThe program will execute 6 different SIce commands located at ds:dx, which8 s2 H. N* E# S8 u- y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 C% w& d) i% O* R& R1 |. _, `
0 T U0 {; u0 J2 \0 o* y6 x& t+ p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
, ?+ v7 C. y) B___________________________________________________________________________ R' c' `% M6 @( A8 ]- z
8 |6 @3 o6 [# |2 E/ J5 J+ u: o$ P' Z
Method 03
) R/ [# \. y$ j# L6 q! B=========6 O' ^& V1 s- k
, i( g9 K8 I2 q7 kLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 p& s9 p1 c: M" [9 y: \" w0 }7 I
(API Get entry point)- w1 d% m6 ~: d6 X4 D; f
1 ]+ {2 f* l2 d9 f+ H7 S8 @" ]+ L/ B K: B
xor di,di
6 h: f/ s0 z5 J: r4 U6 H. P mov es,di0 M+ ~( }8 m. R5 p! A9 R7 u1 q; M
mov ax, 1684h . q3 h1 `. b/ {, l1 d) B! \; T4 _
mov bx, 0202h ; VxD ID of winice0 X4 _2 g# |* q$ n& P
int 2Fh# p1 ~) J# E5 C
mov ax, es ; ES:DI -> VxD API entry point
7 G, w" B; u5 F! P1 k7 _0 A add ax, di
8 Q* H' R# r3 M) f- Z# ? test ax,ax
* x+ [2 a* D3 u! a0 t$ s jnz SoftICE_Detected
) s9 I- v1 B( K% ?
0 f8 J2 y: Q/ L- D$ q1 V8 k$ F7 Y9 P* Z___________________________________________________________________________- L' ]; V u. l+ G* I
" s# G4 [6 y tMethod 04 r* D6 t+ k( @
=========/ Q2 G0 L3 u# d2 l) V
, G3 B! ~- `0 \5 v/ G# _6 x+ x
Method identical to the preceding one except that it seeks the ID of SoftICE9 K) f. @/ ~ |- _
GFX VxD.
+ s; Z' {6 s5 n0 b
' q0 @, m- O$ U8 p" X5 M xor di,di
& Z9 c0 M5 g2 S mov es,di
) \- K* l+ @, a3 D) B+ K mov ax, 1684h ( h+ [4 D G9 ]
mov bx, 7a5Fh ; VxD ID of SIWVID
) }/ L" p/ k b# g/ {' Q$ Y int 2fh
+ Y. p9 F$ l1 D4 ]: Y' k mov ax, es ; ES:DI -> VxD API entry point
( h& X( ^) E2 |/ I0 q1 l add ax, di. K; E9 e5 B; F
test ax,ax
4 e; q- f& i E jnz SoftICE_Detected. b4 A; o1 \7 S9 m! d* `
7 B0 S7 F1 n( l$ H6 `6 ]0 J
__________________________________________________________________________& u* y2 v3 \0 W. F
% @) u4 T/ B+ c$ i% a7 t2 S) A( E8 G) D
Method 058 N& W: a+ { N k$ n7 q
=========& D4 d) g2 u( d, J" t4 t# j
4 ?. ^( s6 ]# d& z; m) I( aMethod seeking the 'magic number' 0F386h returned (in ax) by all system
+ `! ~3 k( q1 ^ h3 }debugger. It calls the int 41h, function 4Fh.
! A. H8 U" P4 m* f0 v8 c/ ]There are several alternatives. * u" c( R/ P0 s" Z" o& G
, F! I' t7 w, M8 `7 I+ @ v5 W
The following one is the simplest:& K: G$ y# Y* K# ?
`. g$ b+ z# ?& o! `/ c mov ax,4fh
- \9 w3 c3 r$ C( q& _ L9 S3 _' E int 41h
0 k7 E2 e w1 g; J8 O cmp ax, 0F3864 u( Q9 a5 m4 D5 b
jz SoftICE_detected- P7 q, e" b% p- Q: ~6 W) M
" L% \ t8 ~/ u! B& u* x0 Y. N6 C$ t& [2 S/ ~0 S
Next method as well as the following one are 2 examples from Stone's ( l, i) Q1 a/ Z) ^! z& N( w
"stn-wid.zip" (www.cracking.net):6 |6 i& W z- ^) n# f8 L: o A
9 ]/ Y; K3 l7 w" _$ r
mov bx, cs7 b. C A# O7 k. M$ _" |# h
lea dx, int41handler2( J+ D% @' w2 U4 t
xchg dx, es:[41h*4]
7 g: O: P, _7 ^( f- P, i xchg bx, es:[41h*4+2]
- F1 r# m# o* E } mov ax,4fh* B+ G" |% `% R+ b8 v2 c
int 41h( U/ X) o. |) w1 f" I
xchg dx, es:[41h*4]
* F( o z5 F* q6 _; i5 v2 y/ x xchg bx, es:[41h*4+2]& T% l# n. S$ P0 _4 C
cmp ax, 0f386h
! A" T5 n" F9 z! X% c3 G jz SoftICE_detected8 B4 R5 T6 ?" w9 h4 t- Z4 [3 x
3 D+ [* F& u9 d, @" [: gint41handler2 PROC
6 f- `# Q6 j0 L; y iret$ `- k" I/ `2 _! }6 ?* M
int41handler2 ENDP
6 H: l" d# s7 Q4 V/ n7 w e+ N6 |2 b/ L P6 ]( O! u, c" F0 k
8 K! ^, D1 }; q2 x1 Z
_________________________________________________________________________- u, y# |. P+ L8 F
3 n1 v2 E8 W+ p
2 j- A1 X% Z" y; Y
Method 066 t( A& {0 f2 `0 t! V. M5 Z
=========* P1 O1 F1 ~2 f
# {, y( _) ^% d9 g
6 h1 _/ D6 X( j% C) W$ L ^' d
2nd method similar to the preceding one but more difficult to detect:
% \ b, _# L6 i8 L$ }
- P8 A8 E+ r1 m% ]+ w
+ D& ~5 y' t2 Sint41handler PROC
& H5 }% r) V& `- x- ~ mov cl,al5 k+ [8 F! K4 S! \5 @
iret7 U; D4 J6 E% p+ m" X8 e/ ^
int41handler ENDP2 N' D- P2 j* e* ?
3 s- W8 R9 h+ Z
4 _* r4 N9 Z) r* n8 T0 r
xor ax,ax: O2 f, }& D. L# E8 N; l1 X
mov es,ax
$ g/ e, I# {) m9 V$ i8 f" |. n/ Q mov bx, cs
8 F1 r$ |2 |& m( K lea dx, int41handler
3 t! ?0 _- u6 ]' j xchg dx, es:[41h*4]: B% U: o5 P; e, S! K
xchg bx, es:[41h*4+2]7 w2 ~0 L4 l) R' j) g: f+ k t
in al, 40h
1 `/ I8 L0 {3 C8 _0 M3 c; K xor cx,cx
! `0 C# i2 c4 q# d, l int 41h$ v' ]: A m9 p3 _
xchg dx, es:[41h*4]- r- o# B6 C# V! a0 }/ K
xchg bx, es:[41h*4+2]
* b' |- j& q! {* C9 H: P& E& K cmp cl,al& h1 F4 F; q; h
jnz SoftICE_detected4 v7 K* M5 C# y' o; h
2 `7 v/ \- W0 d n/ x3 @_________________________________________________________________________' R6 @+ `$ H5 p
8 K, n6 F: k6 z" X5 s9 {
Method 074 n0 r& J Y+ y; a) t' e: S# a
=========
7 C& F0 _( C6 E. V1 [* m& H1 \9 I
8 K0 c. g# s/ g) R/ K5 nMethod of detection of the WinICE handler in the int68h (V86)) i$ t |9 r. a1 I6 i' [
. s0 \; }7 p2 Z- H mov ah,43h5 g* o; p( Y4 e* }
int 68h# [) ]0 |2 \$ v$ z& W
cmp ax,0F386h
( h: {0 [+ r8 p' ~ jz SoftICE_Detected
! _3 J( C! t! Y5 ]9 A9 h" L; b3 v, N9 [9 w5 O4 I! m7 W: \
; r# m0 a8 C& c
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# H" M' m# W) _; N( T- w/ {
app like this:) S+ d. N' { D! z# R4 p( a! d
7 j8 u# U0 G) |0 i/ O5 B' h
BPX exec_int if ax==68" v4 M+ K6 P! @& M
(function called is located at byte ptr [ebp+1Dh] and client eip is
! A' r {* x e1 o& l located at [ebp+48h] for 32Bit apps)7 S1 e9 f$ i% G6 ?
__________________________________________________________________________- P7 v \6 l/ n8 m+ u. b
$ b0 L2 G0 E2 d4 O9 B
% m; p4 y! o; `& Z) x0 UMethod 088 {9 L/ l! S; ]: b
=========
+ y& E: A* u* \. }3 Z( _
0 j/ h+ q* h+ S. I# z3 s5 mIt is not a method of detection of SoftICE but a possibility to crash the
9 }; _" @* }6 e% Q6 Z6 k1 S) jsystem by intercepting int 01h and int 03h and redirecting them to another P8 e) j5 m* e" L( i
routine.9 ~, i2 ?* ?7 E% i
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) _, j [& @& K _
to the new routine to execute (hangs computer...)) g- v9 j3 x7 e' y9 @% B
! U( D# q- D( `
mov ah, 25h
3 u; W; w, s* `" E6 C) B3 U mov al, Int_Number (01h or 03h)9 I4 N- Y; Q2 m8 e9 ~* p2 A
mov dx, offset New_Int_Routine' v; K1 ^' q2 G( K
int 21h3 p' y6 P, Z% G9 M5 ^" u
, v" c5 r) D: d5 W9 z8 s
__________________________________________________________________________; x u+ f8 P" u; \ O$ o
; B. V8 ?. I$ O9 g
Method 09
( t% b5 R2 j! @. M: T6 _=========: e# o0 w$ s1 `3 w4 R0 @3 E
( c4 F0 Q, G% W/ i5 OThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
- m; w2 Q& r$ c% J1 G! H( u& @6 o, vperformed in ring0 (VxD or a ring3 app using the VxdCall)./ X3 z8 w/ k2 r5 a% V% x
The Get_DDB service is used to determine whether or not a VxD is installed4 z+ I6 n) r5 T& X4 }
for the specified device and returns a Device Description Block (in ecx) for3 y g% i$ ?. d3 t
that device if it is installed.8 x7 G# Z; x0 W/ ?4 y$ K
/ r! V7 ^: W' X; q* y9 z mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 M/ [1 \" C7 \: ^" j0 r7 Y mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" a' b2 Z6 o8 I; ` l& ~6 x VMMCall Get_DDB; V3 v5 @8 M8 R c' R" S
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
% t( B3 t1 P) O1 W i( F! [8 s% s
Note as well that you can easily detect this method with SoftICE:
; b6 Y* g3 j" ^3 t bpx Get_DDB if ax==0202 || ax==7a5fh' I! G% h( a& B! t7 v) F. M% W
$ c+ s Y2 Z4 l5 h__________________________________________________________________________" U+ Y$ f* k. I+ U( T: m' }& [
1 B- H$ F/ s3 i5 B! Z
Method 10
3 K( q3 c' R* R% e9 j=========
7 Q+ M+ G4 x, P; M* S( x3 T9 g J5 s" d1 {0 T! |/ `
=>Disable or clear breakpoints before using this feature. DO NOT trace with
0 `$ b. N# c- s, C+ y$ _2 n6 |' w SoftICE while the option is enable!!
' V+ k1 P; b' ~' Y! A; M' K% g6 g8 t: ~' v3 b8 z! O
This trick is very efficient:& k5 R2 w" e- d V
by checking the Debug Registers, you can detect if SoftICE is loaded) Q( S; _* B( o5 C" f( O( B- B
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 c, H9 P) r- \# sthere are some memory breakpoints set (dr0 to dr3) simply by reading their- m, w& {" k# p1 T& L
value (in ring0 only). Values can be manipulated and or changed as well. k% M7 x& M3 R ^( M. L/ [) _7 x
(clearing BPMs for instance)
8 j* w1 e: D. Y8 Q6 G
, W1 } d+ d2 u4 ]" S! P7 R__________________________________________________________________________
, {: w7 v: f$ `( t" j4 r0 ]1 F% T5 C' D. f( @4 w7 t
Method 11
. R9 }: Z$ j0 l6 `) j( c O0 M=========
( {7 H2 n) D: J9 _. G( T5 G; X
~2 ?. ?0 i9 t- A. FThis method is most known as 'MeltICE' because it has been freely distributed' ?8 O1 U+ j; n" [8 a
via www.winfiles.com. However it was first used by NuMega people to allow" o B9 z3 Q: f! Q$ m
Symbol Loader to check if SoftICE was active or not (the code is located+ d( ]* a( Z+ e$ U
inside nmtrans.dll)./ N: L' R+ T2 W* }5 \8 O, p' {
4 l0 M2 a6 M$ ]6 x, D. P- v! i1 _
The way it works is very simple:: O3 d: O! M" ^# H
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for+ q) z/ C; l8 g9 ^+ H
WinNT) with the CreateFileA API." ~. k) S7 P8 I3 I" T- J
: q( t8 {: b; {+ T* Z6 r2 |. D
Here is a sample (checking for 'SICE'):1 r* a4 L+ {- o5 X% H. F
' W) y; W! L6 E# f9 w
BOOL IsSoftIce95Loaded()
5 i+ ?, r" T0 X* a7 y& G2 Q{
4 ?" L5 _3 r3 g HANDLE hFile; ' {3 t* s4 A4 y% ?
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,4 K) {+ { m1 j0 T) j6 Z; |
FILE_SHARE_READ | FILE_SHARE_WRITE,* [# _. s5 b! M; h8 p, B& h9 C5 r
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 D4 ^. K5 a; Q if( hFile != INVALID_HANDLE_VALUE )$ S' t6 @" O; L2 b6 ?; _
{
1 s" N8 D- x3 i% C, M. ?2 d, F* J1 | CloseHandle(hFile);7 M: e7 h% @1 P8 q6 @" Q
return TRUE;; w2 r; |$ G) k( n
}
3 T3 p; U# s- _7 k6 e1 \7 h return FALSE;) d3 R0 a; Z& P; _) j
}# [7 a: e7 ^6 s) p9 V0 i
. O/ {' Z+ g& ?3 `( CAlthough this trick calls the CreateFileA function, don't even expect to be
& r, g. W2 O: b" K. kable to intercept it by installing a IFS hook: it will not work, no way!) S6 o5 a% k- \5 s. P: q( O# u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 u7 E- x, q9 c- v) G
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: z: j( f/ O5 S6 n/ w/ Aand then browse the DDB list until it find the VxD and its DDB_Control_Proc: S3 t8 o' j- M# |* D
field.$ `7 a; t" m5 n$ {8 y1 U
In fact, its purpose is not to load/unload VxDs but only to send a + @+ y( D' w9 M2 y
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 ~1 I) E/ `9 f2 q+ J# r0 e
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! L, Y! J; |2 J9 O: g' Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).
" | Q: H7 U4 z2 r1 cIf the VxD is loaded, it will always clear eax and the Carry flag to allow
; X) x R. l; {its handle to be opened and then, will be detected.* c/ f* s7 U9 o
You can check that simply by hooking Winice.exe control proc entry point; e) N/ t" Q8 Q% C" j
while running MeltICE.
0 Y/ V3 [" G A x j8 p' @ O
# m: t& M( \0 T$ R: t4 f( m2 V3 O2 t! o" O8 H
00401067: push 00402025 ; \\.\SICE% b2 K* j" H% V+ N0 G$ \" R; X
0040106C: call CreateFileA H/ U7 W/ t- b8 ?( Z0 N f- T% {
00401071: cmp eax,-001
- L$ \; U2 T1 X 00401074: je 00401091
# w J( H. a% r2 S0 E: A: i. ?% n4 f2 k
/ {6 o. i5 I1 C7 H! S6 [+ j+ ^There could be hundreds of BPX you could use to detect this trick.
7 c7 d8 Q8 K& P& K: E' Y1 r* r-The most classical one is:8 C( Z; ~( l0 ^0 D% E% P& N
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- @; Y9 M, C& j# _ *(esp->4+4)=='NTIC': r% y& D% y9 t. s$ l+ B2 H6 r4 s
8 L+ p( G4 h/ m( R3 z
-The most exotic ones (could be very slooooow :-(% U+ s8 B _, k! d0 ^2 B3 H3 V
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 C. ?3 h% M! \$ h5 I
;will break 3 times :-(
- X" G0 o5 V `; a5 B
! I4 r% j* _1 n3 }. y0 o2 Q9 B% Z" X( J-or (a bit) faster: / K. v. Y k# B" m
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( a# Q% ^& h7 I: m2 ?" u ~
; m% D6 q* g) E m1 Z. o; C* v/ m- T
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 V) P) [7 Q% u" e9 v4 r ;will break 3 times :-() e* t+ K6 U6 e- M& U$ |
( X% x8 y8 s w-Much faster:
( I( E1 @7 e; [ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
1 }. \1 \6 ]" K: m: K4 b
, l. w9 [) }% y& w8 `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
* n+ a. q& r4 ^" `- Jfunction to do the same job:% y5 U, a, R/ W
& c$ s3 ~! I, x7 q& R8 B* z
push 00 ; OF_READ# _$ H) { E2 B
mov eax,[00656634] ; '\\.\SICE',0, n9 } u- P' v
push eax
5 |( W/ v6 ~0 T. J call KERNEL32!_lopen7 o2 _ U! c0 h. A) p+ ]! ~
inc eax. Y( L, [( b/ p; }
jnz 00650589 ; detected% Z6 s) F, R5 m' |- ^
push 00 ; OF_READ
- U3 O7 A% n$ `7 j! b7 g% ]6 q4 ~0 ? mov eax,[00656638] ; '\\.\SICE'8 a0 e2 n2 P6 T
push eax
6 I0 }+ r8 U! f* I8 z+ M2 p call KERNEL32!_lopen
# C2 p# ~- a$ z7 c& X inc eax
3 D9 n! o& d. S' e" F& |% F5 Q: k jz 006505ae ; not detected8 V# F# M: ?$ u3 c& X! D* t
0 l- a' f( z' e* O0 i
+ I. i& k _8 {7 s/ q3 p2 S8 ] H6 C
__________________________________________________________________________
" Y, }6 {, y* _3 Z6 `* a% Y0 F; S) X* D! @' b
Method 12( S% U+ c# E+ o4 F
=========6 n) R4 a# s, B' G% Z. \% k
( u# B& z8 w! B c, j
This trick is similar to int41h/4fh Debugger installation check (code 05/ D: x9 l) }6 R: @, k3 c
& 06) but very limited because it's only available for Win95/98 (not NT)1 t( q, T1 Q9 R# l+ X1 S
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
) X x5 ]% M9 P5 e0 ^# ~& c4 S) e- f( p# f( J, [
push 0000004fh ; function 4fh
# J) k) h% U& K# J+ E q) s3 _ push 002a002ah ; high word specifies which VxD (VWIN32)5 u: I8 m, f5 @8 d' I
; low word specifies which service
; m; i4 j, I9 X$ { (VWIN32_Int41Dispatch)
5 H0 n9 k+ h7 |; x8 F call Kernel32!ORD_001 ; VxdCall
# @3 F" F7 N I8 x$ w1 L$ ~6 L cmp ax, 0f386h ; magic number returned by system debuggers y/ M* {' A0 U& Z9 w* f ?
jz SoftICE_detected3 g' N, I* ?0 ]7 q) }( {
& l+ S3 Z' D! r3 n. [3 ]Here again, several ways to detect it:6 s4 V6 R- C) C3 J
4 k/ L; e$ x: w$ h BPINT 41 if ax==4f
q; h0 s6 ^$ }; [% `5 f* M! E
# V0 I# U4 C' G5 j BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
3 ^8 }, P2 e; W1 C% J! L* w) b
, J, R4 V# H& L$ ?( @0 W8 {6 S BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 B0 ^; v" g8 z; W' P+ m: a( h8 ^7 Y( [& b
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
" N8 i/ x H8 X% l$ Q3 |) r/ Q
__________________________________________________________________________5 e$ q, j3 e8 F" v5 |
, W3 y, I+ w+ C' jMethod 131 l( U# M/ B9 }# D2 b1 R7 j4 Q- Z
=========' w0 u2 W$ Y. k7 Q% c/ E/ m
5 F+ d. c1 Z4 `) T9 r/ D
Not a real method of detection, but a good way to know if SoftICE is' ^1 U" j R, V6 I3 s
installed on a computer and to locate its installation directory.# I* ^$ X+ |' ~7 L2 q y9 j
It is used by few softs which access the following registry keys (usually #2) :
3 z8 `+ a& E; `' W( b0 w; M9 O, h
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( Y+ n m, [( f$ t3 k1 J {- u' `
\Uninstall\SoftICE
7 x D- r. @% v9 B, s: }-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ s( ~& W$ W/ S" g7 o. U" K8 q. Z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# y5 A: ~ [, }1 W1 f# Y9 k+ V
\App Paths\Loader32.Exe, x8 s2 t# S, [/ S% a( `+ A- e
8 y C% M6 f, f& T9 g2 U7 k
@ I1 T) o% d" l2 b( [Note that some nasty apps could then erase all files from SoftICE directory9 z7 W! ^2 q5 l$ F4 Z0 ~7 c
(I faced that once :-(
* H/ h; `+ R4 J& f. @8 m6 `4 V: Q& u1 H
Useful breakpoint to detect it:+ L% o4 G9 s) V+ K3 G7 E0 P- d; J% ?
6 ^" f9 [2 _9 k1 Z- ? O! q BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 Q% E/ T/ X6 m
; W' t0 g% ]7 t8 m) P__________________________________________________________________________! ?) }4 z; _% D" _. T c
& g/ \9 H$ g+ D" g( L- w, A
/ k2 P# C' ~4 m; t7 C
Method 14
7 I' T0 O2 V3 j {=========
9 o E4 X, t& b/ I. E7 K) Z+ a
! c# ^0 l8 s; d# QA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
5 @7 }9 z3 [/ x: Zis to determines whether a debugger is running on your system (ring0 only).
4 M: [ j, W& V$ {9 t S
! @& {; \) r8 ]/ z n% t& u" o VMMCall Test_Debug_Installed. w) B; D5 c6 m7 K
je not_installed) g4 Y% w: a1 l. M
6 a6 X) }0 R! P! U, p
This service just checks a flag.
' }5 `/ {' K, k3 \</PRE></TD></TR></TBODY></TABLE> |