<TABLE width=500>
- E9 T. c! E* a/ c R( F<TBODY>4 Q+ B' t6 t* E! ~
<TR>6 y* T# W5 o9 |( D$ |: J
<TD><PRE>Method 01
) t3 I" F6 _0 @=========3 S P: {" ]5 D3 `
/ }+ `3 D2 L' {) Z k* s
This method of detection of SoftICE (as well as the following one) is
' ~, u, K0 s4 G$ T w5 N/ Yused by the majority of packers/encryptors found on Internet.7 Z- z) ~% j( Y' }9 V7 Y
It seeks the signature of BoundsChecker in SoftICE
( W0 Q5 D# Q& X, ]! p$ M
4 [( s0 Q1 E8 ^1 K* h) S mov ebp, 04243484Bh ; 'BCHK'
3 r, |) P4 F" t9 ] mov ax, 04h! ]0 Y M' d0 e* r9 s* C7 z1 @
int 3 . s/ \: a5 i) e5 z4 }8 C3 i$ d- z( R; t' t) I
cmp al,4
7 n L0 K5 k5 x# i+ m7 y: ~, p jnz SoftICE_Detected8 g: I" F! Y" w+ e7 D
& V3 p' c, T& I- q( C' T+ m___________________________________________________________________________
' Z4 {" `; F L" e
R, [7 s) o4 ~Method 02
% R6 U& W% }+ F=========; a3 v* t7 s! H3 W0 ^
& z8 V1 k3 I6 B7 q3 `/ I1 U
Still a method very much used (perhaps the most frequent one). It is used/ w0 a, M- M6 }3 q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,; r, \1 Y0 U$ h1 @* _& ?
or execute SoftICE commands...# B. }" |$ q" r8 `
It is also used to crash SoftICE and to force it to execute any commands& w+ ]* {7 V. y: U, C2 i
(HBOOT...) :-(( , `4 C$ R5 U+ ~( t4 P
- a! g, i, {% _" \8 k7 q5 }/ f
Here is a quick description:
( J7 s; R% c$ g/ R-AX = 0910h (Display string in SIce windows)
9 E) h: \: `" Z, X+ R% K-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)* U5 O/ I9 S; s, E2 ?* N' V/ z, B% Y
-AX = 0912h (Get breakpoint infos)9 A. U8 R6 K+ c4 Y" n0 j5 n
-AX = 0913h (Set Sice breakpoints)
0 I0 d% l* w9 w. S( l" ?-AX = 0914h (Remove SIce breakoints)
, ?3 n4 x2 C' B2 ^' R
3 T4 I( q9 W& H) t/ ?Each time you'll meet this trick, you'll see:. i+ Z. K1 q. o2 T0 a+ H) G5 I
-SI = 4647h7 ^* j L/ i9 W) w6 b1 {4 F* T5 v- t
-DI = 4A4Dh x: z& }3 J8 X l( I
Which are the 'magic values' used by SoftIce.
5 \. z4 X; s1 v o% y5 t' A- vFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 a" q" t6 r0 `* P4 [1 {: D/ \2 n( v1 w
Here is one example from the file "Haspinst.exe" which is the dongle HASP5 v+ l+ [- S/ u# t7 z; j
Envelope utility use to protect DOS applications:* ?7 |: s+ K' X# l4 E4 H
2 \: j! s% M4 u: t! A
0 S' P& D; M+ j2 p9 D3 {; K4C19:0095 MOV AX,0911 ; execute command.
8 Y9 A2 _$ M- k' u4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 G' q6 g; c2 f, X0 c% A# A {' p7 D4C19:009A MOV SI,4647 ; 1st magic value.
. ~5 \& g: b" c/ X3 U4C19:009D MOV DI,4A4D ; 2nd magic value.
# K3 Q* \; `+ H6 N4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)( o1 R( I Q# R
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
. {6 c" h6 i# ~7 r0 g1 i0 P4C19:00A4 INC CX
, N' c p" s7 a! U8 Z# D8 i1 t4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" @# J9 ]9 \& |* O) p
4C19:00A8 JB 0095 ; 6 different commands.
: u( d6 U' b/ r$ W! t! i4C19:00AA JMP 0002 ; Bad_Guy jmp back. w5 @3 M" @2 k/ r1 I
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
0 ]& f/ \# J# B3 t
2 |$ F0 V' T, {) Z: gThe program will execute 6 different SIce commands located at ds:dx, which
7 U. C3 b2 c% {8 y2 Z9 R; Care: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ K0 H; |) F$ C
' n" R; s9 w, l: B5 Q) n
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- ?/ q" }, i5 B, ?$ o
___________________________________________________________________________
. z9 H# n) N3 D+ j: `5 R; ^8 E
C3 i; C- g& ?1 y5 e# e
Method 03
]4 }# [- B+ V# q( N) @=========
: F; x0 `4 `, T: W; N6 g
, \* Y# I, c) ?9 D6 \Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h% ?* B+ r% m; [8 Y( w, [
(API Get entry point)3 |8 Y4 H3 n) V# l$ z/ }
( e7 n, D7 ?4 j' ^% ?4 {5 L3 C R7 i7 t# X
xor di,di, @# W/ u3 S) m. G- H: h+ `# N3 _2 w
mov es,di& r1 K* E4 Y! Q$ y: s2 I
mov ax, 1684h x0 K& `, b/ o( `% p
mov bx, 0202h ; VxD ID of winice) w. k$ F7 ^: G* t9 z/ Y- |
int 2Fh5 L% o1 w+ H1 b7 O- T7 F8 s" Y+ w
mov ax, es ; ES:DI -> VxD API entry point. c& O! y& \5 h
add ax, di
6 d( T: z! f2 W test ax,ax/ E; ~( s8 x0 p
jnz SoftICE_Detected
# {" G: s6 e# s3 U1 ]! U
: q: d3 D" i- F! m$ O: J' V3 Q0 `___________________________________________________________________________
3 r" ^' H( u8 s; A5 G, p! h9 E
! q- U8 R, G3 p4 OMethod 04
* o, ], b- ?. r3 u( ]) _* `6 a=========
( w4 X6 ]6 l+ d
2 @3 r% }! P( h4 i H6 YMethod identical to the preceding one except that it seeks the ID of SoftICE
+ r: L+ c5 M' |& d; T7 J, p" T& oGFX VxD.
# v* l; o: M, r! V- @
# W% D- ^; o- a; D) H) s! M xor di,di
- j- f2 j" [2 J$ [9 }9 J mov es,di" F+ I" O: E3 e* p$ `
mov ax, 1684h
8 G: A+ i D9 u3 H! }7 z mov bx, 7a5Fh ; VxD ID of SIWVID
$ S5 A F, A% T$ L int 2fh' `# {9 w& |/ I) s
mov ax, es ; ES:DI -> VxD API entry point
( J1 o' O1 w o' _ add ax, di
0 C% K" u- w9 w+ T1 U9 z) ? test ax,ax
: K) }+ ]- {" g- [& n jnz SoftICE_Detected
" n1 n9 d. ^' Q' j( d* {9 U5 z- X
) @! ] _7 J: H2 S__________________________________________________________________________1 C- h# J6 |4 S0 R5 ^& Z
- j$ \2 I+ F+ Z4 Z- D2 e
8 S" p @0 [$ W! }5 X( a$ a5 }Method 05: g$ j% K* i- `) `5 S H& s
=========
4 M# g7 O: H$ h6 p- |/ q- A+ ?" p. ]& P" z
Method seeking the 'magic number' 0F386h returned (in ax) by all system
, G7 |3 I/ I# N$ d. B" l# Zdebugger. It calls the int 41h, function 4Fh.
1 k V, ~- Z8 U4 g' FThere are several alternatives. ; z+ V% v$ N: S/ g
$ Q. X/ q* K( J1 ]( T6 k6 [The following one is the simplest:
) m7 K# |/ b- A$ e; X0 C
$ M9 G5 y" L3 {0 j, \ mov ax,4fh5 n% c: X4 D( Y) q- q: ~1 T
int 41h
& w0 V8 C7 |% T cmp ax, 0F386
% E$ [2 L8 u1 }9 f jz SoftICE_detected
& p4 W' I" @8 k! Z+ N5 ?" D& g( l" F: M, m8 X3 K7 x1 z2 v) _
+ l& ?' T6 b8 Z9 L1 INext method as well as the following one are 2 examples from Stone's / K* z! t$ }) w3 s4 W# x0 S
"stn-wid.zip" (www.cracking.net):, @! e. u! u0 G
, O0 t: ~. T0 M2 B- k2 N$ K. Q
mov bx, cs
% Z t5 f4 d+ Z6 k- F0 b- F lea dx, int41handler2
2 v2 H+ P) T3 K/ Z5 n d xchg dx, es:[41h*4]
! ]3 v6 Z8 h: L- Y* {5 T xchg bx, es:[41h*4+2]3 j% w7 G. ] d" H
mov ax,4fh
. Z/ d9 `8 V; Q! @8 q, e int 41h
# P2 X9 M* j* A; \5 G xchg dx, es:[41h*4]
4 n" E0 J4 [9 D xchg bx, es:[41h*4+2]
( G3 l0 H* I+ p0 u+ s) y, Z cmp ax, 0f386h2 K( ?8 Y' A! a- t2 S: y, f+ S% V# A6 b( ?
jz SoftICE_detected
# z; O$ V9 e/ t: o+ z K4 Q" b" t) z" Q: W
int41handler2 PROC1 U" _) x) t3 u, b5 H; ^' y$ N4 w
iret7 J+ a/ ^( v5 E5 _" ^
int41handler2 ENDP9 \8 H$ E2 [; ]7 [% I
/ m- B5 r- C. D C q& G5 o9 G4 h# ^1 @
_________________________________________________________________________! e. d) s/ V+ z
' s1 `* D2 s' V* _0 O, W$ d- y9 @; A% c
Method 06$ A: t/ ], k# P. ?
=========( `, S1 t$ l: X5 U {
! Z8 d; w$ i/ m2 c1 v2 s
! `+ ?0 z \/ V. Z/ X, m; |2nd method similar to the preceding one but more difficult to detect:7 u4 i3 V: B+ @1 i( L1 F2 `1 w( [
% p7 O% ~# i* t, s O+ P
+ W+ X2 J0 F/ q2 t/ e
int41handler PROC
# |6 g u8 c+ c, S" W ~& h/ L mov cl,al
; N9 A" K0 k& ^" u iret5 X. p% j" r5 l6 \3 z; D8 }
int41handler ENDP9 F" X" `! k- n5 i1 \! p
' a" C" o7 J' [% ~$ n
2 M( p6 b/ P4 F) ~# g; N! B7 C xor ax,ax
2 y/ `, }& l! c p, V mov es,ax, z* Y: P8 Y1 @
mov bx, cs
8 W8 i2 A* Y$ P lea dx, int41handler
& y# H* f$ Y" F xchg dx, es:[41h*4]
- W, f- r8 I- m! P" R5 Z' B xchg bx, es:[41h*4+2]
; s3 Q% V1 T! e in al, 40h
4 N& s6 `! B3 Y3 P xor cx,cx+ p* s2 R* N, E k7 K* S8 v; a
int 41h( l# x( R) x6 i% D
xchg dx, es:[41h*4]: |5 e- d+ g4 a, a+ R: S
xchg bx, es:[41h*4+2]
, o- v) x$ w. Y+ ]$ F cmp cl,al
* h q q& p+ b! \3 j6 j jnz SoftICE_detected$ X% Q ]; ]2 q8 c4 N! `
5 @6 I9 _; |/ r+ d_________________________________________________________________________7 k& s) C/ }3 C* _3 C* [7 T5 `
1 O; j2 ~! S7 E
Method 07$ Z) @1 l' G$ `2 c& z6 D
=========
; |) T' f1 b) x* w9 S8 m h! R, i, h* a' e y2 j5 a+ J
Method of detection of the WinICE handler in the int68h (V86)
R/ o- L/ m9 W Y, B( a
. M1 o0 N; ], S/ v7 @5 \ mov ah,43h
. n, w% F5 `. _* ?# q1 c) v, P int 68h/ |: H- _# e* L+ g9 r
cmp ax,0F386h
: F ~' M8 a* r4 S$ b% G, e jz SoftICE_Detected
6 x4 O6 G: d$ Z' F, s/ N+ E7 ] E3 k3 `2 c" }
" z# b9 z. ?9 w4 D, V# n
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 M: s8 g( E; d( _- U2 I/ S app like this:
% L: s/ n3 R0 g7 M
" {2 ~! F3 D' L0 n1 W+ E' d1 N BPX exec_int if ax==68( P$ N! c- Q) Y9 d4 L/ S9 i9 \
(function called is located at byte ptr [ebp+1Dh] and client eip is
$ }9 @' C0 @" D+ ?2 D+ ~+ ?# S located at [ebp+48h] for 32Bit apps)" } M2 r* r: C$ g r$ R7 C/ c+ D+ {1 y
__________________________________________________________________________( Q8 L6 T% e" S+ O) t8 T
8 v" w) C* [- a1 U& \
: W5 d$ d* J! S* k7 c
Method 08, g: q5 N, O9 d, d; M: N6 T$ L% R
=========3 B4 H3 b) t1 S# _8 E
, ]) l3 I3 ]$ r- f0 ]" r }It is not a method of detection of SoftICE but a possibility to crash the
6 [! \) y0 i& ~$ c, l) \system by intercepting int 01h and int 03h and redirecting them to another
8 Y% |; Z8 c! O K {4 N- Croutine.
, {* E/ Z5 i1 Y6 P Y# N* e! RIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& s: S; h( n q& Q* i% O; G- Fto the new routine to execute (hangs computer...)* N. G6 v/ b& C$ ?
; ?; L4 p4 U, Z' o" w7 N
mov ah, 25h
7 s! G0 E' ^8 V. X8 Y2 X mov al, Int_Number (01h or 03h)9 P o+ X6 z5 C. g! M% Q* I+ o3 F
mov dx, offset New_Int_Routine6 R: i- t8 h$ G: [
int 21h2 P5 l7 I: x2 ]
: A3 I5 ]& B) `5 U# m5 L: ~( ^5 J
__________________________________________________________________________. v* ~* b+ n" v% h" {, p) K
# ^8 n5 R% x1 m; P2 m4 H WMethod 09
" w6 h( W- f& L$ B% T$ {9 Y* E=========
3 Z% H& d; ^5 k- R: r1 N
' z3 r! i; w+ u& P+ c5 X* M/ QThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: J% W" G* S7 ]" E a7 i/ I" ]
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 B9 L" k9 f3 Q2 ?) ` TThe Get_DDB service is used to determine whether or not a VxD is installed
* e; u: L# l; c( Z! Cfor the specified device and returns a Device Description Block (in ecx) for8 r, ^8 S; h- o; `5 f! x
that device if it is installed.- L. f- q j2 g. E& q/ _$ R
- k9 f y. W, E; x8 c
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ [) \7 F; K; w- N4 r mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# y& c& A: d3 X M' n; N$ F
VMMCall Get_DDB7 I4 l6 c6 o; P% `4 |+ t" G! C
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) f0 g' D/ m: c/ ~; V4 O' E4 I
9 u: \) v# w3 e* h1 g5 I+ @& J. r
Note as well that you can easily detect this method with SoftICE:% Q8 e8 ~5 P. g
bpx Get_DDB if ax==0202 || ax==7a5fh
( N# i2 q. }2 F! R; Z2 E% F; o) ^- T$ B7 F
__________________________________________________________________________
: n8 a' x3 z+ A% o9 B5 ]$ w
: M1 C7 k) b0 k4 Y' S, `Method 10
% h: S1 l0 G9 W1 N" P=========( T, ?* @. t, N* I
2 w* R8 h" P; K3 Q! [2 L=>Disable or clear breakpoints before using this feature. DO NOT trace with
& J" J" J* w& r$ o. N7 u- ^ SoftICE while the option is enable!!
- W' }/ g6 W* r( Y' o E; u0 O6 ^. }/ |+ ?% \+ i( A
This trick is very efficient:
' @- z, m6 I( f8 `by checking the Debug Registers, you can detect if SoftICE is loaded
5 G! G7 M9 l- _5 Q# s% v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if& G7 C' ?1 F2 C- \5 y5 u! v
there are some memory breakpoints set (dr0 to dr3) simply by reading their
& \ f! Y: u x$ Dvalue (in ring0 only). Values can be manipulated and or changed as well- d" v5 c( c3 K) P
(clearing BPMs for instance)) n: l. d5 P9 y, `$ O
: H8 k. M+ s+ C5 D1 [
__________________________________________________________________________
; o0 l/ A* @( w Y
2 ]5 ]% r. x- T! K" zMethod 11+ F, B) G2 z; S8 S; M9 |1 h! @
=========
, K* X0 a4 y( e, F: q3 B4 x8 @; a
& k+ U2 o, }) x( PThis method is most known as 'MeltICE' because it has been freely distributed
+ i1 X$ C' N% w! X! V8 wvia www.winfiles.com. However it was first used by NuMega people to allow( Q6 `. B3 S3 h( ~
Symbol Loader to check if SoftICE was active or not (the code is located
' ^/ a5 N) p" }$ Y' U7 Zinside nmtrans.dll).
6 {/ Q5 h: B! l) C& ]4 v4 C3 k6 w
( i3 B L# E' F# \3 m$ f5 C% i/ ZThe way it works is very simple:& F, Z- U$ M3 W# C
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 V; W- a4 T( M" `( kWinNT) with the CreateFileA API.
0 t- m! S! K0 T5 ^) n L+ D u3 P# M1 T9 |8 R
Here is a sample (checking for 'SICE'):
, Z" x( [& i7 r5 J8 k5 X, _( j! C6 k* I
BOOL IsSoftIce95Loaded()4 P: B( M4 p& C) h% ?2 E4 M
{
3 r6 ]8 z* Z0 s+ y, w HANDLE hFile; , U+ i2 o: ~' `2 [6 ?
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, Z* h& `( v3 i) ^% N
FILE_SHARE_READ | FILE_SHARE_WRITE,
|+ q! R0 p( ^8 B9 n% k9 Y NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- k. f, i. o& r; m2 I3 _( N$ | if( hFile != INVALID_HANDLE_VALUE )( w3 w: F$ @ }3 Z. Z, F
{
: W7 k, N. ?! l8 Y6 m! U CloseHandle(hFile);( x4 I" X4 }' [8 E( n' O
return TRUE;
1 j$ {" d) U j! w }
" ?/ c6 g1 I x d return FALSE;
$ ]$ w) T2 Q( a4 b: B& @$ l}7 W- c; f8 X Y0 E
7 ]+ u6 O! Z3 Q! a) d5 IAlthough this trick calls the CreateFileA function, don't even expect to be
, Y- b# Y7 }6 w4 |5 B$ ]/ e7 ^able to intercept it by installing a IFS hook: it will not work, no way!' Y& Q6 O3 m B! C& f; ~4 |8 @
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
Q) ?/ J2 o3 {* j5 Fservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)* m( E6 H# L; [/ ~
and then browse the DDB list until it find the VxD and its DDB_Control_Proc7 d. {, m0 {0 }1 N- P r/ z9 l
field.+ o8 e# M2 P5 _* Y7 Q6 m
In fact, its purpose is not to load/unload VxDs but only to send a 2 G5 I! R/ _8 e' @, c8 s7 ?
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
O' R6 g# n; y+ g: u; ?to the VxD Control_Dispatch proc (how the hell a shareware soft could try) m; o) C' i/ Z, {6 x2 G
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* l; K3 B) b$ i1 x6 M% I% H0 l/ PIf the VxD is loaded, it will always clear eax and the Carry flag to allow
+ E0 p8 H% s# |: b. ? W4 e% f, A2 wits handle to be opened and then, will be detected.
/ n' x" |) _0 @1 a9 O1 h6 qYou can check that simply by hooking Winice.exe control proc entry point
& J, `' r6 @& [' W" J3 |$ ?$ awhile running MeltICE.
5 C5 E- O9 g! L. B8 a( a. P! D2 H; h9 c: S
# J- }& T% m; r9 R+ T1 \" m$ j {
00401067: push 00402025 ; \\.\SICE$ h0 w$ s. E, b+ q) i$ M; N
0040106C: call CreateFileA
* p! }. g( D$ v. C7 H l 00401071: cmp eax,-0018 D" _7 ^* l) U& C
00401074: je 00401091* C3 U t3 x) m s8 w ~
3 l* n# w. @+ a; A* c3 B) C/ _" r5 a z' s: @. P" @* a
There could be hundreds of BPX you could use to detect this trick.7 H# K F- n# [
-The most classical one is:( e6 e5 g3 V5 H# t; `
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
) `0 l: c; V+ ~& b p) V) s *(esp->4+4)=='NTIC'
; B( D" U' U- z8 w( T/ {( L
1 M5 v& T' P* s, G! F) H-The most exotic ones (could be very slooooow :-(
6 ?/ M, A( {& c7 p- g/ D BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( J' C& K- f7 m: f
;will break 3 times :-(
1 ^" B( w( b- @6 v8 ~
! q' O X6 x: M1 `-or (a bit) faster: $ i0 q$ h' Z% [' m7 {* s
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 A& _8 o8 B- I" O
$ z! c+ r2 p; q. r e BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' , Y) x9 q, M; }
;will break 3 times :-(( |$ k! u0 g6 P, F# f
. _6 Q! Z0 b9 a) {9 r/ ^ j
-Much faster:
$ R# ` ], z) V5 m+ O# I" c- _# o7 Z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 ], S/ o9 ]4 Q0 ]" O& @3 N
% R6 O# U2 C7 D
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: [* o) t3 o- H) D. D8 n/ ]' M3 Gfunction to do the same job:' o" t% o6 h, K+ e# I" q
( {; f' O8 v" c6 z1 ~* ]# R( | push 00 ; OF_READ( `+ F& s9 v( m" {3 W
mov eax,[00656634] ; '\\.\SICE',0- m' Z9 H6 s& ~/ J1 t6 q m
push eax$ f8 V" {' }0 n# [& E \; o
call KERNEL32!_lopen7 M5 w7 Q: C* n; F0 X9 v
inc eax: E+ Z; p! l6 \
jnz 00650589 ; detected1 T# q: x# H( d+ G6 l0 x9 K
push 00 ; OF_READ4 e* ]: |6 U2 ^- M
mov eax,[00656638] ; '\\.\SICE', T' v% t9 u. ~; v
push eax
* D) b8 {5 z* p9 W call KERNEL32!_lopen) G/ S1 w' N' D+ R& b
inc eax
3 |% U% j) O/ s& U9 I' Y jz 006505ae ; not detected1 s+ Z; n- O; v4 B5 }( m' I/ Y
! _; Z! s+ L4 d1 l& p5 b( K
2 m4 B& Y5 N5 O, P3 k4 K
__________________________________________________________________________
6 ?4 R9 D7 f/ r. r
# z5 x) f. n* F9 M3 d4 hMethod 12
+ R- i4 ~) k) |3 p=========
# a7 I* }) B, i8 K0 s4 R# p2 p* u$ J' l
This trick is similar to int41h/4fh Debugger installation check (code 05
( B c! ^4 j- G5 K$ ]% f& 06) but very limited because it's only available for Win95/98 (not NT)
$ D; i3 m$ T5 j7 zas it uses the VxDCall backdoor. This detection was found in Bleem Demo.1 ~! O: Y& `/ G! E/ n: w6 L
( c. M. |( K: q! Q+ J. E, g% ~; u push 0000004fh ; function 4fh
$ d5 R) i2 S) H2 {7 q# x push 002a002ah ; high word specifies which VxD (VWIN32)
9 F6 l o5 @/ l4 U6 L4 T3 l ; low word specifies which service4 o, L$ u9 m8 Z+ M
(VWIN32_Int41Dispatch)3 _8 ~2 X6 c+ ^' V; M0 L% `
call Kernel32!ORD_001 ; VxdCall! t5 }+ C8 G) Q& d0 p
cmp ax, 0f386h ; magic number returned by system debuggers
C, z$ e4 |, A5 R8 @2 e jz SoftICE_detected
6 ?6 W" t- p1 V/ T# N. t& S
$ T6 M% ^: A0 `' G) D8 H( C& lHere again, several ways to detect it:
# W! f' A' x H. u& i. n9 T+ x" F# a; o; i# R! T1 w
BPINT 41 if ax==4f4 W' y* M$ q* }8 Q6 k
2 L0 E$ O- c1 q BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one6 Y5 A, D# p$ _7 j$ @1 n. j& ^' |
5 A! _' x/ G( j5 F8 X9 X% ? BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A" U: Y6 ~# s5 E* P, B8 w
/ j+ [; W) {1 ` BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 L3 W8 \1 G+ ~ q" |; O
; a9 A1 w4 j- e6 a__________________________________________________________________________% R% ?8 A6 r+ U
3 \5 F* j( [" o8 b6 b+ b( r
Method 13' b0 r4 v! Z' j6 ]7 r7 @6 ~# L
=========
% t8 B; D8 m. g+ X4 H0 w, ^6 _; ~! h+ c2 i
Not a real method of detection, but a good way to know if SoftICE is
" [/ U# q! ]. A9 l8 @8 {installed on a computer and to locate its installation directory./ K; ]8 |7 J W9 ?# i2 @
It is used by few softs which access the following registry keys (usually #2) :5 f3 d& M4 C g; ?
1 A, `& S5 A& m k: L+ Y. k-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 U. e/ o+ Y- T( d
\Uninstall\SoftICE7 Y, ]* M1 n$ M. a( r& k! t; ?
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 f! G- X7 [ v, g6 ` O3 k
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 R7 {8 ^( V/ f \0 c\App Paths\Loader32.Exe
6 I+ l# I, P/ f+ @7 V( J; |! Q$ B7 D6 \8 T# F% {8 C0 O
% z) x6 k6 \& J4 v0 R
Note that some nasty apps could then erase all files from SoftICE directory
* h& a C# p, U+ b# e( r(I faced that once :-($ T3 T. u+ \. N1 m# Q1 q7 ]7 |+ R. f
( Z: m; }8 Z3 |
Useful breakpoint to detect it:% c# O3 s6 K( o$ \% u
& n4 [6 B& W% S( @- G# _ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'/ {) }# H0 t6 I4 _* w
( G; |" v: R1 s. D2 E* u$ p A* X
__________________________________________________________________________' a, q( @: o) m
+ o2 R h& X" E. r3 _3 W4 {& R' b1 i ~
Method 14 " j0 x7 i* [( j% P
=========1 N+ W% ~: u0 _. L6 R( _7 Q( p
/ b5 Q" b3 a$ y0 I, W! wA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose5 s1 l* c' K: N2 R; Y/ v" X
is to determines whether a debugger is running on your system (ring0 only)." W' m2 }( b) i: @* ]; b
1 D8 T) }6 |7 G% ~$ |1 K VMMCall Test_Debug_Installed& a5 Y7 v" r; d6 t6 i- n# D, D! `+ p
je not_installed7 U6 I0 f3 s7 b1 p; b! k
- e# t4 m+ T U1 tThis service just checks a flag.8 k/ K" k2 ~7 K' p; M; n
</PRE></TD></TR></TBODY></TABLE> |