<TABLE width=500>" z" F; Y) I ^! w+ X/ r4 X; k! M" p
<TBODY>3 o8 G1 ]" [1 z& v
<TR>4 V1 m3 n! m0 ^% [ a1 n
<TD><PRE>Method 01 - x4 E. c& P1 U4 p2 h7 O7 q
=========
6 j4 b: S' ~+ F( ?3 ?! a8 Z& ^, k( \8 g
This method of detection of SoftICE (as well as the following one) is: w. }! R) J' k- v* ?
used by the majority of packers/encryptors found on Internet.: I' x8 U M( G. |0 Z% k
It seeks the signature of BoundsChecker in SoftICE6 T( ?9 E! I7 I2 N O. }
+ {/ @* y& V: r! N- F
mov ebp, 04243484Bh ; 'BCHK'' p# z' B4 H8 }. V; y0 |* Z6 |
mov ax, 04h
z% ]% Z4 s# q- d int 3
) f# t5 F/ x8 L1 [% } cmp al,4 s/ F2 u2 L E1 g1 g7 K& N6 m
jnz SoftICE_Detected
3 \0 L" T# z8 }* B3 l+ R8 S* @( @" }; R
___________________________________________________________________________; V1 i7 D; X( q$ |& u4 ?3 F
3 O% P, ~4 p( _5 \1 M/ j+ R9 k# |Method 022 i$ n8 u/ E0 N2 F& n
=========/ |3 z3 Y! e- Q4 @, ~
" G9 R" t) U) v% C' ^' PStill a method very much used (perhaps the most frequent one). It is used
- t; F9 G! e+ n: r& j# U3 M& Hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 s) Z3 p" ]/ o2 I$ s* i
or execute SoftICE commands...) Y; ?1 a( ] H2 h l
It is also used to crash SoftICE and to force it to execute any commands, E. f0 A f4 d4 H% M& F$ N
(HBOOT...) :-(( + N0 B5 u' ~2 Q: k4 r( a
; ?/ D6 l9 G r- F0 `6 u
Here is a quick description:. Y% B$ b" R) t7 H
-AX = 0910h (Display string in SIce windows)
' o6 V, I/ `) b; y-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 S# _$ @" E' b: i
-AX = 0912h (Get breakpoint infos)' ]. V: b: h2 c' j& N
-AX = 0913h (Set Sice breakpoints)/ c8 c/ t$ k4 F2 ?) [; r7 q
-AX = 0914h (Remove SIce breakoints)
6 d2 M/ D( M- z8 M" Q; Y C0 K8 X' o: Z% ^- O3 e; u$ o
Each time you'll meet this trick, you'll see:. O/ S( [5 f: R8 @
-SI = 4647h
v. b* s$ W/ |-DI = 4A4Dh* p4 G" l# ?5 M0 k# {0 t5 A
Which are the 'magic values' used by SoftIce.9 z$ _. E0 |. J2 ~( z5 d" J
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: y- ]/ B: \9 ~. d
; x- ^1 l, I. S* j5 Z3 NHere is one example from the file "Haspinst.exe" which is the dongle HASP
$ A- t7 M3 v4 k* T( z4 y. L M' X) HEnvelope utility use to protect DOS applications:& [0 n0 g. O- w8 p0 ]
% R6 F U" n5 T5 z1 W# z8 {5 C+ u$ b; l. R2 N
4C19:0095 MOV AX,0911 ; execute command., y* a! Q g. P+ c
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
% q& `+ r8 Y/ {3 n" P0 S( L! K" Z4C19:009A MOV SI,4647 ; 1st magic value.
" ?& m; W4 O) \4C19:009D MOV DI,4A4D ; 2nd magic value.
" z: ?. A' H5 W9 F2 B( a5 j; O4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- y, d# ^# F2 p# F4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
7 p* N+ c/ _ f4 Y+ I8 h3 y" l4C19:00A4 INC CX L+ L: G# C$ O/ I, |
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* U9 z+ ]: B( |+ g3 @! d6 T4C19:00A8 JB 0095 ; 6 different commands.) W. ?$ o( `8 P/ |
4C19:00AA JMP 0002 ; Bad_Guy jmp back.( s! t% c2 {/ E) a k8 d6 I6 m
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)/ f5 _% |7 B# K" g- L8 [' r
2 i) x. I. S- @$ tThe program will execute 6 different SIce commands located at ds:dx, which7 s1 D6 `1 T; c) c; B# E( y* c4 m
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
h# Z$ b) H2 D
( R: c$ e: }6 ?7 l1 @' Q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
8 T& b* |) w0 \( p4 d% o___________________________________________________________________________
4 b, z7 T9 X4 q$ q) K1 i6 v) v# c
# n# t+ d: X! P5 }
Method 031 Q5 Y2 e7 O r% O! e+ ~- F9 s( X
=========
6 r# j6 D" t |! _5 K$ `9 \; L3 m7 g0 ^5 Q/ V# n: U* y# ~4 `( x* H# s
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! Z7 R/ F' `7 F(API Get entry point)
1 y* U# W6 p. _ ]8 T4 ` 4 {& C9 p1 {; Y, v
8 @! d9 \8 l3 O. A% u# Y
xor di,di
* o: `: B; q/ i* o5 Y mov es,di( A& T" n/ I; c* f
mov ax, 1684h
9 K7 G& }7 C; \' |! ` mov bx, 0202h ; VxD ID of winice, ^/ F( c7 @& y5 U6 A. R
int 2Fh3 Z; U' a' g, g. L% H5 }! y! n6 d
mov ax, es ; ES:DI -> VxD API entry point
. N/ |# _; b& p0 O4 x" ~& V add ax, di, u( O2 n8 O3 [2 d
test ax,ax
2 w3 U/ Q5 b' e; K6 v jnz SoftICE_Detected0 u& G1 ]0 t3 f: G
: v/ e% k* P! q# ]
___________________________________________________________________________
# C$ e* I) N: A2 l# j" F1 b R8 X* R% o
Method 049 j4 o/ P/ q/ N( d6 m6 x
=========+ H( f$ T- J3 ~6 _( V7 ]% c" h
% P& o: d" g0 q9 N! l
Method identical to the preceding one except that it seeks the ID of SoftICE4 a: ~9 e2 _% C, Q% }! T5 K( V, u
GFX VxD.* U9 q/ f# A8 \+ y: i" t
$ Y* C K9 p; r+ s. w. P# ^) a
xor di,di
6 u* G _; p& I1 J mov es,di
4 ?3 _/ k8 o. L% U% ]/ E mov ax, 1684h
) V8 f3 K) C& H; e) h9 T) r mov bx, 7a5Fh ; VxD ID of SIWVID8 J) @. T5 P& K
int 2fh
3 \ M. N) N5 F% v0 {! s$ J mov ax, es ; ES:DI -> VxD API entry point- `. E- N2 p2 A9 |
add ax, di! ^( B2 D. S, l5 J }% k1 `
test ax,ax
7 m8 r+ t6 F5 v$ @7 z# {0 S1 R jnz SoftICE_Detected' D7 V3 A0 e, d* { [
" b; g, [0 q2 y6 C$ g
__________________________________________________________________________. Z6 h4 g; y6 m8 w! q
. i1 y* A0 H( _
- u& C$ J% z2 S* V y, B1 W. _
Method 05
c$ m* g, G+ r5 s9 l% _ R( T) s=========
) W1 `6 Q, p" v$ g$ c: t% }5 W
Method seeking the 'magic number' 0F386h returned (in ax) by all system
/ L* R) h, L* n: F: R7 }8 @, }debugger. It calls the int 41h, function 4Fh.- v# C* ?8 d8 Z. |, U
There are several alternatives. ( X7 X5 N% s+ K+ [' v
8 X5 F5 O+ q% W& ?
The following one is the simplest:# w. R ~/ F% V# _- O3 O$ ]5 V0 @
+ y( c# t; p7 u
mov ax,4fh
( Z, Y/ O6 L3 E2 r" Z0 L int 41h7 h, O. g& Q5 y
cmp ax, 0F386
1 D' V' s O# {+ O9 J2 ~( ]" p0 l! [: C jz SoftICE_detected, y( f Z9 M# b `$ N
& O6 X# F- r# h. l
0 ~" ~2 \+ L1 Z* _. j! hNext method as well as the following one are 2 examples from Stone's 1 b9 f @, B" s, Z# q5 p6 a
"stn-wid.zip" (www.cracking.net):
0 W/ U; c% S6 }; y: C, L6 h
6 v' U5 l0 D: M+ }, J mov bx, cs
9 |: X9 L0 z* g% \! |! D* D& b4 V lea dx, int41handler2- H: k' L2 \1 ]# t* [3 ]: n
xchg dx, es:[41h*4]* y" ~8 x' Y# r4 r) ~; I6 U$ [
xchg bx, es:[41h*4+2]
% C9 [8 j7 v' q- Y mov ax,4fh
) v- k5 H# q7 B& b% h8 p int 41h
. C# T: W) Y" f1 P( M- K+ K2 x xchg dx, es:[41h*4]8 F7 o/ b3 O+ V* a3 {0 B5 f! V# y
xchg bx, es:[41h*4+2]1 R) B* T( {( R% m2 v+ `
cmp ax, 0f386h9 p' [. f n8 n+ P
jz SoftICE_detected2 p) @9 C( B/ b k5 ]2 \9 k7 g
, ?/ K. S6 f1 ]7 J) a% Cint41handler2 PROC* ?' @9 k( R$ j7 B
iret& P: d* q. U- F8 s8 i$ t
int41handler2 ENDP6 W; H( e& r* D5 V
Q m, Q& u" D# d* e
# O/ r" T- @3 r" T1 _5 ^% U4 r/ q_________________________________________________________________________: L2 b; x) h! y7 ]& f
2 I- Y8 Z3 y! m8 [: r+ i
& Y8 x7 q1 h* T+ y3 OMethod 06
4 y# V! g8 R" K1 f* @! e0 ~$ z7 s=========
/ B$ c/ z3 h' }) \" [
& Z! {2 D. N" m3 |- u. C% j1 N# c( y6 N% x, ^* x) c1 K
2nd method similar to the preceding one but more difficult to detect:
h$ Q8 ]+ Z4 i; m, c+ x
$ E k; w6 X ~7 [& u
$ ]! y/ r: y' ?* s' d4 W$ G0 eint41handler PROC* J' ]' a4 r5 J" r! Q& Y
mov cl,al
2 B4 V) P/ g% [7 v: `' H+ x iret
; E! j, L# Y; X( V! `& Rint41handler ENDP; ` Z3 K1 q' Z, ~; S
, P$ Y1 w: [$ s
4 A$ H8 \* k- j0 H+ v5 l xor ax,ax+ H8 V' {; |, E! z* B3 j) j' T; U: G
mov es,ax9 X/ m* @# q" h6 h, ~* d2 a5 u
mov bx, cs' @: i9 q, S/ @1 x# I* _; |
lea dx, int41handler X# |7 V4 i7 H* x) x, w$ L
xchg dx, es:[41h*4]( t0 x- ~. W$ m8 o6 l- B% T2 l
xchg bx, es:[41h*4+2]
+ }! i$ e% k, Y& X4 U in al, 40h
( \2 L! e: J! h% [8 i, O: { xor cx,cx
2 E1 y/ G) p. h4 { int 41h8 x M$ x0 A* Z2 H( u' T* g6 D; W# x- X
xchg dx, es:[41h*4]
( y% z* J5 a/ @7 H+ V) R Y xchg bx, es:[41h*4+2]
, z# ~" `) M9 X' _6 x: S cmp cl,al7 ^/ W! ~) [$ N X
jnz SoftICE_detected
: L& b+ \/ x, z4 H' z0 D; m5 V% c* k3 j3 w1 f( ^/ U
_________________________________________________________________________
* e, S- c( L$ C4 o7 n* u( O
0 {" a9 r3 R' }1 F& dMethod 07
; R: r/ C0 \( C9 w# ?$ e/ Z! J=========' p( q- o2 h7 _5 t
3 Y- v1 F6 P/ X; f6 {Method of detection of the WinICE handler in the int68h (V86)3 Y: H. H2 }( H4 ?7 u. O# j
4 Y/ t5 |( B/ _. ~) W Q
mov ah,43h8 d9 U/ }3 N: `. u& [ R3 {+ w! C
int 68h: R% D% n. ], B" D& \" T
cmp ax,0F386h
/ ?6 Z% I( W l8 r( o jz SoftICE_Detected/ s l4 U9 n2 I9 y2 u* v
0 b: W# ]: b8 m) c/ S- E1 _
3 R: w- `- L% M; z* s=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- Q2 O; K" h8 w' M# E* W; x app like this:
" G# Q: d. A8 y% Q# Y2 B* @
$ r5 g) m0 }+ k+ N6 k% E. p BPX exec_int if ax==68* R" @$ b( r3 A4 x5 u
(function called is located at byte ptr [ebp+1Dh] and client eip is3 e) q+ z3 @8 ?7 r
located at [ebp+48h] for 32Bit apps)+ c9 S3 F7 q; V7 N, O
__________________________________________________________________________
, t1 E- \0 j+ T. \1 L5 \) O
( |3 I" B& r- H$ A. k8 q
6 x4 N/ ~3 j9 J% Y9 {$ N* J! EMethod 088 p$ C; f, s6 f3 s
=========
$ I6 E( Q- L3 l/ G" c- [: T9 {2 X# O( R; P* J. u Z
It is not a method of detection of SoftICE but a possibility to crash the
6 M8 a0 x3 g4 [9 b% Osystem by intercepting int 01h and int 03h and redirecting them to another
2 ]0 D, |' c* Droutine.* P1 h( [* E: g
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 f: b" r, d9 L7 \to the new routine to execute (hangs computer...)/ x+ J8 d/ @5 }0 q- G, h. H# }; k$ N
- Y" s; C2 C1 C
mov ah, 25h
' s5 ?6 {% H7 g ]! F2 f2 T* v mov al, Int_Number (01h or 03h)
" K( ^7 ^, a; A5 w$ O; v mov dx, offset New_Int_Routine
4 _, {5 a' Q0 z) r$ m7 O# M; w int 21h- ]# B q+ T8 T" Y6 N5 Q
0 P2 G6 {- f3 H
__________________________________________________________________________) t! E$ v! t0 u0 }
/ s! V- w- R9 g6 b! r
Method 09
3 O$ T; C2 T: |9 v& ^0 v% H=========! }! B) `) V. _1 Q! W# e; U
# M$ M; D$ v) f8 l, iThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 B: F; z# Y+ O3 Lperformed in ring0 (VxD or a ring3 app using the VxdCall).
y1 I, E, O5 u: I/ [' hThe Get_DDB service is used to determine whether or not a VxD is installed
8 O7 N( Q9 z7 l1 @7 R8 Ifor the specified device and returns a Device Description Block (in ecx) for
! v% C% D( b- _2 b0 @- U0 athat device if it is installed.
2 z- z) O' C& |, B; v* E
. ?. J5 t& J- F- J1 X7 ? mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
6 q% e. M1 H' S4 B; E mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 e* v; p, {! j6 h4 a
VMMCall Get_DDB/ k. Z/ W( S( l
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed6 S8 Y, ~5 l( r4 Z8 {3 Z
, i2 t5 x: D! d: D D
Note as well that you can easily detect this method with SoftICE:5 z, `. d4 E" J6 h2 o [- U
bpx Get_DDB if ax==0202 || ax==7a5fh+ S0 j- ^2 A; N6 z
. Y- @$ K, Q7 I__________________________________________________________________________
2 E, e4 F( @8 _2 q8 u4 b% L: L/ t; E, m4 G2 a$ ^
Method 10
: L9 E+ @7 j% U( f1 z=========. d: ^8 F6 U4 k1 ^4 W- V
0 u+ n7 U. ?4 [9 l2 M" c0 s
=>Disable or clear breakpoints before using this feature. DO NOT trace with: B% d5 s; J9 i1 E! k
SoftICE while the option is enable!!+ x) i5 q3 D/ k4 x
C1 G( |- ?2 f( u7 _This trick is very efficient:! |# E9 ^# J0 n# q+ {, O/ p% H0 i R
by checking the Debug Registers, you can detect if SoftICE is loaded; @* k3 _; u. V' H4 Y
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 W# N! G$ t5 |2 f* n. ]there are some memory breakpoints set (dr0 to dr3) simply by reading their# g. `+ S' x- e2 \! R
value (in ring0 only). Values can be manipulated and or changed as well' Z; F# P6 a- y
(clearing BPMs for instance)* O: E) `0 W& ^* t+ {
/ b) E/ |: r. } V__________________________________________________________________________$ c. s& g- O# f6 u$ p+ \9 f3 z" x
! I2 P; q; S) g9 h& ? w
Method 11
2 o- |+ D7 J$ }; U=========
9 f# z0 ]/ t$ l: y# `0 C( G2 Q3 X7 _" T
This method is most known as 'MeltICE' because it has been freely distributed
" A& O$ h: D9 u0 D& c1 q; pvia www.winfiles.com. However it was first used by NuMega people to allow
( z- @3 a# W) l9 F' w7 b4 u' J. F0 tSymbol Loader to check if SoftICE was active or not (the code is located
6 t9 S8 r2 A! s" C9 b) l5 winside nmtrans.dll).4 @1 k9 m! i! }% \9 J
2 }/ g* b; c N) i0 o
The way it works is very simple:
! k. {7 ~* Z& N' \) |2 nIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ d3 l' K, D: R% R% X
WinNT) with the CreateFileA API.: X) d6 C5 |) \1 `0 Z
8 a0 \& @, q* H9 xHere is a sample (checking for 'SICE'):# S8 W. V6 O |! u p/ J% T- z
- e5 }7 L4 m$ Z* h8 A/ k# I0 MBOOL IsSoftIce95Loaded()
, O, w1 ^, ^7 b3 C{5 [8 i$ j$ _5 ~" \4 W+ ^6 l
HANDLE hFile; . N1 \7 x3 B x: c" v) H! ^
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,8 m! D* f& w0 u
FILE_SHARE_READ | FILE_SHARE_WRITE,/ U K |& t2 K- G A
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
9 M+ F: m0 Z6 O z1 o if( hFile != INVALID_HANDLE_VALUE )( }# C2 n+ M! y; q
{& K' u' R7 q4 x; _' l$ [
CloseHandle(hFile);
$ y( J7 d0 [; z" n: F return TRUE;8 y4 A* p; V/ Q: p0 }4 p0 r4 l
}9 E, a7 M: {( M; ?! `; p e4 C- N
return FALSE;
* m- P! r7 L% g% ~) k4 A$ d5 Q' P}; T5 s! `6 A0 u5 H5 b. I# i5 ?
# c. a; q5 I7 T$ R& r+ ^
Although this trick calls the CreateFileA function, don't even expect to be
" c) j: A+ I8 E( u3 N% B$ j cable to intercept it by installing a IFS hook: it will not work, no way!1 e3 x/ ^5 ?( i; ` b- r
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 q/ S3 d6 W4 w- D1 Jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function), N$ ~' u- {2 G* ^" x- c
and then browse the DDB list until it find the VxD and its DDB_Control_Proc% b$ |6 Y: A# `% a& Y4 J' F
field.
1 `5 f' d, q1 { }& aIn fact, its purpose is not to load/unload VxDs but only to send a
, y" }# ?# A, `0 _W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 Z* }9 d, I% kto the VxD Control_Dispatch proc (how the hell a shareware soft could try! S, u; v& V0 x4 m0 n# T
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
3 C+ q( g& V2 t, b4 nIf the VxD is loaded, it will always clear eax and the Carry flag to allow
0 T( M* N; p r& E0 o# z9 rits handle to be opened and then, will be detected.
9 w; n1 y* y6 x3 \/ e2 iYou can check that simply by hooking Winice.exe control proc entry point
' G3 a0 L4 `- fwhile running MeltICE.
& h$ B: N- f* O6 U8 `5 }
# b! H( O4 P! k" A/ T+ d7 y' b
; }! E$ O% f2 Z( I 00401067: push 00402025 ; \\.\SICE4 K1 r) c7 x1 d- J
0040106C: call CreateFileA& R5 U/ Z0 C' H
00401071: cmp eax,-001
u& t, ]# b9 I7 Z3 ~4 Q( \5 l 00401074: je 00401091- m8 \" b0 j6 L% A( o! i% A* g) t
9 F: [' G! f# X' l1 J) C3 o5 A
" G% U9 e" x+ [' H, t, e
There could be hundreds of BPX you could use to detect this trick.
0 A( t3 v; b/ }0 e8 P7 Y1 O! g2 r5 J+ r-The most classical one is:/ U( a6 f) {8 s0 D: @. @
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, F2 y$ h& m% N+ f& T
*(esp->4+4)=='NTIC'. h7 O% w( a8 v" i) \) v J
6 I1 S: f9 @; P7 s
-The most exotic ones (could be very slooooow :-(
( ^9 Q4 i- R% m& _ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' Z7 Y8 \7 Q( `; ~5 i ;will break 3 times :-(
" F/ W6 Y- u% V) A2 ^6 R0 ?2 g+ E* |
-or (a bit) faster:
' ~1 S9 r( |, F# q5 a( w BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 T8 s" u. K: w8 C& C/ k) t. _' D
7 E: |# ~4 \9 Y% ^. H BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + J2 h% F' |# _6 k# x& \. M
;will break 3 times :-(1 `4 o" |7 |6 R' O5 M8 K5 v* J
7 M/ i1 P. W3 A7 w* f-Much faster:
9 q1 X4 v1 v0 `8 t/ [( e c BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 z# r! \# U3 X8 L
% D( A# ?/ h* \% s7 [: [0 K. iNote also that some programs (like AZPR3.00) use de old 16-bit _lopen# V: W1 ~ s! S7 i$ m' x2 `5 u
function to do the same job:
$ }! \& a5 o) \
. y0 E& J9 y- G' X& M2 w9 c# ~( S+ t* E push 00 ; OF_READ# T" q7 y- h4 q+ w% a( [
mov eax,[00656634] ; '\\.\SICE',0# _, |& R5 Q& o( p
push eax" @2 N" u* G: B* O" @. u
call KERNEL32!_lopen- g: [) [6 l- ?" n. m* D7 L8 Y ]
inc eax D* ~& Q- O3 H0 t5 L
jnz 00650589 ; detected
1 S# l+ _+ P- r3 c& e push 00 ; OF_READ
& x& l2 c! ?& g: H+ b4 q* E mov eax,[00656638] ; '\\.\SICE'8 g0 d/ K) q @9 r# a7 O3 w
push eax
% x5 N( @7 A# I) j; ~( [3 v call KERNEL32!_lopen/ N* ~7 i; a! e7 \
inc eax
- `1 ^) j0 a* O$ T jz 006505ae ; not detected/ F2 a/ Q2 W3 q) H$ V
. Q+ q' n8 l! x6 ?6 U% u; z6 b5 q/ Q2 P, z7 U
__________________________________________________________________________
& Z( E, Y0 [5 C9 f* A( R9 h' ~; o) O* }5 u. s( R2 f
Method 12
6 [+ b8 Z: R% }! r$ }: ?2 p! G7 F/ q=========$ w5 T7 E. A& \* U# r: W5 G9 G
_2 c3 T0 {* C2 Z5 u7 O) u$ P; U8 m8 uThis trick is similar to int41h/4fh Debugger installation check (code 05
p* M$ [& K4 f7 A' I& 06) but very limited because it's only available for Win95/98 (not NT)
4 ` Y+ t( s5 B8 |as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' w- R& e$ f U- t. f
4 h0 k, x" C9 D7 d6 j push 0000004fh ; function 4fh2 B$ Z- Q# C. d, N. ~& W8 u
push 002a002ah ; high word specifies which VxD (VWIN32)- b; e( d$ _& o& T$ e: v; ?2 K, x
; low word specifies which service' [ \* g! j8 x( r
(VWIN32_Int41Dispatch)
% ^% D( B! ]+ v" [ L call Kernel32!ORD_001 ; VxdCall( l$ L* V$ y1 ^" g. p1 v/ D( \
cmp ax, 0f386h ; magic number returned by system debuggers, ?7 E+ ]+ ^2 v2 Z- K& n/ D% g8 e
jz SoftICE_detected
9 y0 W9 D5 D& `; P2 r9 q
! Z5 [( u" x% Y0 m7 v b) }Here again, several ways to detect it:1 l5 R, ^$ n1 s" W& q6 D
, M! Q y) P- k& l t BPINT 41 if ax==4f
' y- {/ g+ T+ t; Z0 t9 q: k: z6 k
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one' T0 ]6 G' ?; u4 k( ~
( F, t3 p, N, e6 y$ s& J6 u! e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
& `' C/ N! q* m* R' x X
9 j; C- K5 a& F" K' O; e BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ n* ?: [; s. ^( P3 u) i {6 W
8 e9 b6 T* L3 S( N__________________________________________________________________________
& |* V, Q4 U/ A1 U3 v5 c. s% ]/ K7 y. @ }" f
Method 13% C& Y" @6 a9 E
=========
% q% k" ?2 ]! z# h; D& c1 k
- i8 M* ^$ T$ i$ R2 H( G9 u7 cNot a real method of detection, but a good way to know if SoftICE is* ?/ P4 o% r1 Y: ?+ b( j: u7 l- Y
installed on a computer and to locate its installation directory.
# }' l+ R* |& k% q& A" KIt is used by few softs which access the following registry keys (usually #2) :5 h- B1 P9 Z8 k% }
8 e0 e! [; n3 F$ R/ e6 S# I
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 [: W) m9 ]. s
\Uninstall\SoftICE$ H; D. i' N9 m1 P
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# b% d# Q% h' V6 E-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- q8 e1 X" {: [% u" b7 n. P\App Paths\Loader32.Exe a7 z. V. r) j5 K! W) l
9 F, b1 h% G8 t( v, b/ X
+ s- c2 h% Q: {
Note that some nasty apps could then erase all files from SoftICE directory
# f, l* w! l. O(I faced that once :-(
4 C0 ]9 U3 ^, a7 `5 i% |- ]+ N5 N
" d' } T6 P4 d- d9 J5 GUseful breakpoint to detect it:( t0 s. V, U9 s
# _ p4 D2 a& f6 {
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; E0 w/ j3 G1 _. Q
: I8 }% i% V! q1 C__________________________________________________________________________3 Z6 @' t* p# W8 E
, a" P6 g) G& ?" {" X" m- s
0 ?0 g# q; [4 {% P: X! @Method 14
3 N' x" R6 _. }# Z# d. d=========
, n ~3 l! |; D% k" p3 D
. }: [; `2 d# C$ Z' `7 z5 Q+ u/ h* TA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. s1 |" a) n5 g% O% c
is to determines whether a debugger is running on your system (ring0 only).' l d* O, x3 ^+ `! ^( y( V5 ?
8 ]& i6 a8 I/ n: ^( n VMMCall Test_Debug_Installed, U6 X/ ~: A8 Q5 t% C7 @# T, }
je not_installed
3 \$ O" O2 p' Q4 e
% G# E. o: b/ u) wThis service just checks a flag.- A$ {" @5 F( {' Y, t4 w a8 l8 W) r
</PRE></TD></TR></TBODY></TABLE> |