<TABLE width=500>2 i5 O# M$ Q! ^: S, {
<TBODY>
, q1 D! z+ \: X5 w+ K k3 c% u<TR>
, l3 g5 e$ J' A! [* ~- O<TD><PRE>Method 01
1 q j Z4 j' A! c7 Q=========$ p) m0 W8 c& \0 c+ I: j$ X
z, b$ O* C# k& I, AThis method of detection of SoftICE (as well as the following one) is- s2 u4 t# V* \; x+ S4 x" f
used by the majority of packers/encryptors found on Internet.
" I# b! D, y8 M* L+ c# gIt seeks the signature of BoundsChecker in SoftICE
, J7 k. p0 H& [; D0 |( \ z7 u) h4 v! p$ r$ O
mov ebp, 04243484Bh ; 'BCHK'
! T; K0 e! l+ ^1 A, q' c* n( j, _ mov ax, 04h
4 u( Q/ W& Q1 Z) [ int 3
: L7 ^; X9 Y3 O3 l! f cmp al,4
9 E% ^* V. v% t4 @ jnz SoftICE_Detected
/ j8 V% V* i: E' v# A9 o) |4 f$ c3 f! B
___________________________________________________________________________/ N6 v* t! q( _- |3 q* l( K) T
* H& \, m) i& o5 b5 j! y
Method 02
& J, n/ p/ ^9 A1 I) [=========3 D6 _) i6 d1 z5 b
! |: C$ p) @$ v) |4 BStill a method very much used (perhaps the most frequent one). It is used/ L3 S3 I, u: j D h
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,) i1 b1 V, j- c- R, V8 x$ ]
or execute SoftICE commands...
' Y$ ^- T/ @" Q3 y# Q* d& QIt is also used to crash SoftICE and to force it to execute any commands
1 j- K: o S; e(HBOOT...) :-(( 7 h$ i2 n' u! n9 y
$ w' [* j% _9 W- W4 s, v6 o
Here is a quick description:- |& r6 a2 J5 A1 k- }# Y/ ^' j" R
-AX = 0910h (Display string in SIce windows)- {! M7 D# l8 c( `2 W3 q' X
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 {5 t3 m. E$ K1 v0 \
-AX = 0912h (Get breakpoint infos)
1 B1 x4 I, i, v' ^; [) K-AX = 0913h (Set Sice breakpoints)
2 m1 e0 e1 o1 k-AX = 0914h (Remove SIce breakoints)/ @2 C2 j8 P+ \9 D
/ w7 J+ ^ f* x
Each time you'll meet this trick, you'll see:
, h z2 w3 Z/ X- ?3 R+ R-SI = 4647h" @& E0 _, c$ V5 _
-DI = 4A4Dh
" l% o: J9 [; H! ~9 K. ^4 k* SWhich are the 'magic values' used by SoftIce.9 I/ _$ B+ Q. v
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 O2 @9 l. {$ V( ~
9 P. M! N, {. g+ x: ?Here is one example from the file "Haspinst.exe" which is the dongle HASP
$ l: m! G! F9 {. QEnvelope utility use to protect DOS applications:9 `& C1 [6 I+ x! p
b9 w3 w! h4 |# p2 x- V
" g0 f/ \0 l& w+ K% C9 d4C19:0095 MOV AX,0911 ; execute command.) S) Y( C9 q9 }0 `" g8 [8 x
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., i. k0 H3 D, G+ _ V
4C19:009A MOV SI,4647 ; 1st magic value.
5 u* w! B6 q8 Q0 d, ^- A4C19:009D MOV DI,4A4D ; 2nd magic value.
0 \& Y8 k4 [9 q/ N9 [4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*) J+ L6 x, o2 r
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& n" r8 h; @# B6 q9 W. ?; y* C4C19:00A4 INC CX: W5 w& Y+ X! o a
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: h+ q& r( ~4 `7 r
4C19:00A8 JB 0095 ; 6 different commands.# O9 K9 t2 e5 ^) V0 c5 V1 D( a
4C19:00AA JMP 0002 ; Bad_Guy jmp back.% f# b0 _$ q- X5 x4 I4 |) W
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)' W& X5 g% {9 ^. V6 J- ~( |- g6 T
8 \& i4 j5 S8 w" eThe program will execute 6 different SIce commands located at ds:dx, which
, }3 i1 r; O. e9 a, ?are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
( B) A) e: G4 `6 h ]1 @$ Y& `2 M2 Z8 C7 l. [+ u
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 ?* W3 a0 R+ g" G
___________________________________________________________________________
; d" `5 }/ U, z/ y. ~6 J. _' x+ m, r, I* f/ X6 a; W
. r5 W; @8 G1 ~* {
Method 03
* ~. |: L8 m, p6 Z0 F0 _7 \ f) ?========= n. J. d f% k6 U; w! z* _8 {! Z
! j# O, Y. y! f& g# c! OLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 L0 E. q. B( t8 z# _9 e
(API Get entry point)
2 a2 i! M+ f+ r6 `/ x" m
; I/ L6 W; w5 m5 r
) R, F) Z/ A4 ^ xor di,di
2 H' v8 F/ g( e3 T$ p; r) l mov es,di" e: f% l) G- Y$ u8 o2 q
mov ax, 1684h
6 X, V0 `0 l' L$ j" z mov bx, 0202h ; VxD ID of winice
* d0 q x& V5 @ int 2Fh
6 P; L% u2 i# g) L2 K9 Y$ w1 g2 H/ c mov ax, es ; ES:DI -> VxD API entry point
: i9 X4 P" C6 Q" E" ]' P; _1 z add ax, di
" J% h7 ~5 U5 O0 }& c% y# z test ax,ax M4 a" n+ g5 s1 q O0 Y& ^0 q6 K
jnz SoftICE_Detected2 ^8 ?: B, D0 V5 u6 M+ j
9 o* x n, V1 b% n. U0 \___________________________________________________________________________
2 V+ C7 y* s0 i1 c
9 U! q4 ^( w0 Y+ ~! @& BMethod 04$ @/ Y/ u( w* G" ~! }3 S, R
=========
1 b+ t8 O4 J. X
8 [5 ?: [! Y# ]/ K8 i+ eMethod identical to the preceding one except that it seeks the ID of SoftICE9 w# N" S1 M7 N8 s' K7 G/ P
GFX VxD.
# C3 K I) _. X# a5 e/ x+ e( o% U) L& T. c) F' ^* i
xor di,di
$ T4 [5 h0 b" L ]2 v" f( R0 T% S mov es,di
7 a& E J6 ?! E, A' P6 O6 f9 E mov ax, 1684h & k# u2 B. |/ W
mov bx, 7a5Fh ; VxD ID of SIWVID
* C2 z4 I4 i% [" m1 b7 S/ c, W int 2fh# [7 H: s3 F7 j9 C; `
mov ax, es ; ES:DI -> VxD API entry point2 ?: g' Z2 g/ L# _# m: ^- B( ^: F
add ax, di9 x5 P- e* E1 [& @" |0 F
test ax,ax
( h- h" W5 A6 V5 i. }" p0 B jnz SoftICE_Detected
4 J: [. w. O7 ^" J$ L% f# p9 ]4 F& `7 A8 U2 N' k: \( _2 j
__________________________________________________________________________) c4 l" ^/ \ V$ G" V! J9 M
7 m. x4 [1 K2 ^
. R, K( X3 g$ \& a% B. h
Method 05& P; H ~/ |! ]. x/ x2 B
=========
x/ R7 K) |% `- t$ c7 _; S X$ c4 p9 r2 w; J2 [+ Z
Method seeking the 'magic number' 0F386h returned (in ax) by all system
2 I* M. N9 w3 A, ydebugger. It calls the int 41h, function 4Fh.
' ]; [) @9 ^5 qThere are several alternatives. $ B$ l; q0 B3 `$ X! O
* k* X6 X) O* c, ~4 x% mThe following one is the simplest:) x* E F1 U' K* h; w V9 n
: ^ B/ r9 M- Y2 ~: I, y$ b$ z mov ax,4fh
K, [: C' u9 w( j# r! {7 N int 41h
) _3 t8 x d' x* Q n$ T9 E cmp ax, 0F386# ?- k% }. @. @
jz SoftICE_detected; {4 B9 `1 X6 [( M- l
1 _6 |" {4 ]) A% i4 X: ]' Q6 L, S" b( M$ \; K" G; Q
Next method as well as the following one are 2 examples from Stone's
+ A' Q h. z+ u5 U"stn-wid.zip" (www.cracking.net):3 w {6 J" {; a( y# `) E
. n/ E# l4 a6 F' x mov bx, cs
! u5 V h1 {8 P lea dx, int41handler2
F% m/ ~3 J8 E0 H! g! H xchg dx, es:[41h*4] _6 V$ `4 u2 Q* N" L: N
xchg bx, es:[41h*4+2]- u2 P; l# m7 O+ g. _
mov ax,4fh
3 Z# k% _* x( J" i) l5 T# W0 m int 41h9 ?: l4 g2 N: Y
xchg dx, es:[41h*4]. O4 V {$ d1 q. ^) O, {
xchg bx, es:[41h*4+2]
* L; M6 e6 ~) K0 ?8 ^0 W& r cmp ax, 0f386h
: ]1 i6 l1 i/ ^% Z) { jz SoftICE_detected0 X# F. V7 M6 o* q$ }
# b% m2 w: Q$ N" J6 n1 ^8 F
int41handler2 PROC
. @5 O# }8 J/ o x9 ^# o7 ]' J iret2 _9 b, B1 v+ J* B% P2 E
int41handler2 ENDP' k P* x% h/ g/ C) k% o
- E3 O/ k6 O. Y9 \7 o" l8 x. `' M
_________________________________________________________________________; t/ J% q; P5 J& p$ j
" N3 _" a" r4 I" R' J
3 t( i: J# e0 tMethod 06
" U5 {( S' y/ N4 n=========
. o# P# Y2 A( X6 s2 x; W8 h8 K% Z, A+ t, ? \ F
( m" z! Z& D4 U( F: U; S) x. a
2nd method similar to the preceding one but more difficult to detect:$ C$ Z: W- h) [- ^# k8 N% y2 K
5 Y' k1 s4 Z5 f- a% @8 W" Z
9 A; V: j, r6 _
int41handler PROC% \. d* y W2 M, _" y
mov cl,al/ k! g/ x3 j7 m- O& n5 |
iret. x& v" C* Q" L1 m6 `
int41handler ENDP
1 c9 v! z' i2 k! Q' `* s( L
6 z7 v! E# N( m/ e" k1 C; H9 R4 a! {5 }$ r$ ?
xor ax,ax
h4 J) z% O& M( f! p" A: v mov es,ax. C$ K' ]3 {0 P5 [+ T
mov bx, cs0 d9 ~3 L9 J' o* ?* c
lea dx, int41handler5 u8 L! ?) N0 `. D3 Y6 G6 \
xchg dx, es:[41h*4]* X( t( c; s. n: H5 \: B
xchg bx, es:[41h*4+2]
: ]0 c& }' U# e" n: _ in al, 40h7 }3 s& i7 v" h0 e3 q
xor cx,cx
5 R0 N" d8 O+ L6 r( a9 _ y int 41h* A' T, p O8 Y* j/ z
xchg dx, es:[41h*4]' [- C) r& p5 t* Q$ h5 x
xchg bx, es:[41h*4+2]
- h B8 \: ^. u+ N0 d' V1 t( [ cmp cl,al
: K. f8 `: n# } jnz SoftICE_detected
t5 z2 h' k: W8 J+ |, @: \
! P9 v& O4 G7 \9 x4 N, B5 G_________________________________________________________________________, P5 f/ X1 F6 \" {5 V- I
/ P& v8 P, F0 d% Z9 L( ]; S+ UMethod 07* v K5 H) T9 v, d
=========
! i8 U6 o) C8 z$ R- f2 i, b9 H7 q" O; e# Q. C: b+ g9 |8 j1 n( f8 k
Method of detection of the WinICE handler in the int68h (V86)0 M! u# E: b$ t. H$ c
8 @% V/ {* _( `1 R7 l9 q) s& i mov ah,43h
. c k3 f" h6 }+ o2 |, u3 @; h, P int 68h' _; A* D3 b$ x, P, m! W$ z
cmp ax,0F386h
' \ {. t; j8 M- F5 l) P! @6 ^ jz SoftICE_Detected1 M! V8 K9 g% A6 D3 J& L
4 W9 y* o: a" ~/ `& ^% X1 Q
; u6 ?- ~9 D1 u2 s7 I=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
3 h1 O- o) `% I& l& p( O' M$ [( S app like this:. G1 k; K. n5 o" U
3 {% j& b# U2 U2 H D
BPX exec_int if ax==68
0 u( ]- y2 t# t- B( m. h: r! [2 G* T (function called is located at byte ptr [ebp+1Dh] and client eip is4 Y" t0 f7 a U( f
located at [ebp+48h] for 32Bit apps)9 D* c4 n& m; V2 E/ Y
__________________________________________________________________________6 A" B5 f k6 U& S
6 y/ v. r# Y, F8 @4 }
8 s3 [3 d4 c% R: e8 |5 r- |Method 08
+ p9 m; \" M, d9 d p j0 _" B=========4 w' k, A" }. V" s8 e) I/ i7 S
3 Y4 P' X' l0 E+ MIt is not a method of detection of SoftICE but a possibility to crash the+ Q. O Q a* N" y3 E
system by intercepting int 01h and int 03h and redirecting them to another: T" ^# N6 m [6 x
routine.$ ]9 Z5 O% ^4 g! C
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ ~, w5 _( Y% j: L8 N4 j, E6 Z
to the new routine to execute (hangs computer...)* I! C$ t% O& Z b. h) `, E
/ d( Z, S3 y* i5 |; c4 k. u mov ah, 25h! W) w- [/ K# F3 }1 O! t& O; F
mov al, Int_Number (01h or 03h) b$ a% c( T' m" ~0 m( j# j r
mov dx, offset New_Int_Routine
5 b0 `- L3 r5 E int 21h
9 |6 m& H9 L$ [# I$ X* I J' z3 k
__________________________________________________________________________
" d& w: P; Q q. {! `/ g! q/ @% }7 T' Y( P* a, X& V3 V
Method 09; \# s. g2 ^! A* N! D; N( |% e
=========, m/ i5 W r0 ]% |7 p# X6 X
8 a8 `. H( U# wThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! C; X% k0 w& h W9 t, j/ @# j
performed in ring0 (VxD or a ring3 app using the VxdCall).
6 P) }7 a5 ]; f: y5 F0 W- ]3 }) v$ ^The Get_DDB service is used to determine whether or not a VxD is installed
) U. e: F. i, c9 ?for the specified device and returns a Device Description Block (in ecx) for
# T: M% J1 C2 v2 u( c% g' pthat device if it is installed.
" E. n( a: D3 |
/ Z, ]# w. H0 C- ?& y mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
+ ~- y. B( d2 l0 Q3 m mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)* @ u( v5 s' L L% J5 T5 B+ v3 Y
VMMCall Get_DDB# L; S( I" Y6 T6 Q, T4 x( t
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
0 [5 h1 @/ F# \) Z1 V! ?* B
+ L( O) G( g5 TNote as well that you can easily detect this method with SoftICE:, a1 K+ P8 _' U/ f7 t
bpx Get_DDB if ax==0202 || ax==7a5fh
1 Z j. L7 V7 @9 `8 Y) \ s5 A
__________________________________________________________________________
: ?" y, ?0 q% h4 o+ t2 u0 G( `2 M5 l# ~1 s: h' L
Method 10
. X% H& T) A5 W$ Y=========
- q8 H! l' _, G5 W
2 ~: O" j- t) Q# f( o=>Disable or clear breakpoints before using this feature. DO NOT trace with
6 g7 |5 {, u5 Q7 q. Z3 X6 O0 Z0 K ~ SoftICE while the option is enable!! z& @! U; Z+ P( _
8 I2 X; I% m+ J& M5 `) l6 d1 SThis trick is very efficient:
4 k" }* X9 S d% H, `8 S$ t. ^by checking the Debug Registers, you can detect if SoftICE is loaded
7 k7 q! g5 R! N, U(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 J i5 M6 l; `' N6 R
there are some memory breakpoints set (dr0 to dr3) simply by reading their
, ]* Y& v+ w3 o# `3 Y& C- Vvalue (in ring0 only). Values can be manipulated and or changed as well
* Q$ L2 I+ n7 O(clearing BPMs for instance)
, o3 a& z/ e$ ?5 X
9 D: f) m7 I/ i' }__________________________________________________________________________/ w- i S! F( u8 K/ C
( P+ S1 }- T" l; ?6 qMethod 11! N" a' g/ d8 k: n6 e* ~
=========
# f1 ?0 f6 A- s2 o" ?2 P7 P* v& d9 N4 g4 m
This method is most known as 'MeltICE' because it has been freely distributed' g) j6 x0 y) s3 b( |5 |
via www.winfiles.com. However it was first used by NuMega people to allow
2 o5 L! }$ d+ ]6 T7 `+ cSymbol Loader to check if SoftICE was active or not (the code is located% Z8 k% _: i# z
inside nmtrans.dll).( }- Z8 d( }4 H
1 L* P0 d/ o) FThe way it works is very simple:
/ t3 H* A4 B* X0 w/ ~$ }0 y dIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; S, C9 Z& v* h9 d4 x: M
WinNT) with the CreateFileA API.
0 v# s4 x; f" e
6 ~- m6 e$ X6 m7 N' i/ ~Here is a sample (checking for 'SICE'):
6 U- f+ w+ q( g1 S# X$ Y. S! H& l2 a9 t- w- n! j, w+ r
BOOL IsSoftIce95Loaded()5 g7 e2 z3 Q3 N5 s
{
9 r t: ]$ i' W4 O8 E HANDLE hFile;
9 E5 X5 R( _% ] hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. j4 \6 o; {, S& {+ V& t+ ]- P
FILE_SHARE_READ | FILE_SHARE_WRITE,
( Y9 i6 s8 y2 l/ V+ V* m( _9 D& T NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
# R( j! r' e2 J1 Y7 G6 p/ J if( hFile != INVALID_HANDLE_VALUE )
0 q$ W* X7 K7 o2 N+ T {
. C3 I+ s, A3 G; t! ] CloseHandle(hFile);
% K1 C+ G0 f. F0 m2 A return TRUE;
; D( R" }* ?2 }2 O3 ~6 _ }
7 g* i3 H: M; X5 _0 ]: |" d9 F return FALSE;1 T. r: t% I" r8 g
}
# k! R* D* D3 O* I* a/ W$ Q- D: D7 w* w; v
Although this trick calls the CreateFileA function, don't even expect to be
; M# |4 R2 u9 t( yable to intercept it by installing a IFS hook: it will not work, no way!
& w' C% j; R( @# C$ ^In fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 J0 r) h8 f" P: `" A4 \service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& p6 a* g0 ~1 K) [, V
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
! Q, S' w% r) n& B4 p6 N4 Lfield.% ?1 I1 W' g* j1 H4 Y, i/ J
In fact, its purpose is not to load/unload VxDs but only to send a
& B. Z8 g T" `) x, EW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 k8 f6 X- Z1 ~to the VxD Control_Dispatch proc (how the hell a shareware soft could try# v; Z0 D5 ?* G. X3 D
to load/unload a non-dynamically loadable driver such as SoftICE ;-).3 m! \5 r9 t, ~* f$ U
If the VxD is loaded, it will always clear eax and the Carry flag to allow
8 `" s z6 t8 s1 }9 {its handle to be opened and then, will be detected.
. `* U: ]0 v$ `" `2 DYou can check that simply by hooking Winice.exe control proc entry point( ^5 p! I( T4 e* H! w& L" _
while running MeltICE.- d% }- j% F' Z- x' s
; E3 e. [+ }9 B( ?/ o: U3 S
- W: S& [ g1 ~% m/ h, M 00401067: push 00402025 ; \\.\SICE
8 y/ U1 \* L1 G- ?+ e 0040106C: call CreateFileA; O: F* E' r3 q4 }9 h a q: I
00401071: cmp eax,-001
) V7 q8 l( T+ d& R* J: i 00401074: je 004010916 r4 w) \' Y! E; {" Q: e# n/ k. @
0 P1 R n8 w: ~/ b _" z) Q
, H; |3 N% s3 q' {6 m4 w# pThere could be hundreds of BPX you could use to detect this trick.4 T: A! U% [# T) k. C4 k p7 ^7 K
-The most classical one is:
8 Z, b/ Z, q9 W, r' C BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||5 Y+ R( ^8 v a
*(esp->4+4)=='NTIC'
* }- s. K9 y4 E: |
# C% \3 N+ N2 s) Q7 Y2 \! e-The most exotic ones (could be very slooooow :-(
3 ]" f. g2 c/ ~/ I" ? BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
6 }: H7 h% x2 y; m ;will break 3 times :-(
/ e8 Y3 B( W8 ^ c7 d' a. u
4 {- m; N: ~; W" n- m-or (a bit) faster:
9 b" i0 {# {0 a& s) V! T* R BPINT 30 if (*edi=='SICE' || *edi=='SIWV')8 J+ P% i3 B5 }% a% U
) t% {; A& V( e; n4 t) d; s
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, w. u1 G7 e0 y3 d2 i4 Z% p( W ;will break 3 times :-(! W- V' S- _. b$ b* @! K2 n1 V+ \
( h" U5 b K2 t+ |" ~7 _- H-Much faster:
. G1 [" A# }# x BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" d1 t# @/ H1 L
) Y) ~( K% g/ r# j: O7 XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen; a: g! y- `. ~0 [% V* |
function to do the same job:
3 w; R" y5 I9 D! Q4 r3 Q/ u0 g. o: c _% U. E
push 00 ; OF_READ" m4 k- g) o4 r
mov eax,[00656634] ; '\\.\SICE',0
8 `' R9 g! F; r! B9 \ push eax( N. b8 Z: z! r+ u# Q; D( U' p
call KERNEL32!_lopen; S9 p; V) M" _9 b4 }! a6 r3 }
inc eax
& f3 d7 I. }! C; V2 [1 T/ C jnz 00650589 ; detected
: e+ ^) ?, Z, Y) f push 00 ; OF_READ
: u* m( ?+ I5 ?$ d: R mov eax,[00656638] ; '\\.\SICE'
8 h& S6 i3 X- `8 y7 x9 S1 T push eax5 _/ T5 B. d. L- O) }4 i+ T$ }" A5 c
call KERNEL32!_lopen
& a0 P* q. d3 [2 s$ \ inc eax4 Y* ^' E: A) f( h
jz 006505ae ; not detected1 Z8 t. P) ?! x3 x) }- i
0 E% a& U6 g5 q) J5 E2 D3 N
' ^: R; B, d. \9 i__________________________________________________________________________; T3 O+ S+ K2 m" s0 {
! s u" t: F/ R& A& oMethod 12
) G. p" U$ Y; d8 |( i( V1 g=========
& a9 I5 F7 `2 S3 D& A! d; i/ d3 O6 C' I+ ?. ~, o+ q9 j& k
This trick is similar to int41h/4fh Debugger installation check (code 05
. A* ]/ v: _0 g& 06) but very limited because it's only available for Win95/98 (not NT)
/ M$ S) [8 g& q/ v+ mas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ U$ r8 N' _, ]" s6 l& r( U4 Y1 ^7 Q I/ s0 U" N6 O" R. K: N
push 0000004fh ; function 4fh
/ O G2 A+ ?3 g9 P9 s3 p T0 j push 002a002ah ; high word specifies which VxD (VWIN32)
4 a) T1 ?' o$ @7 l- \ ; low word specifies which service0 J/ J0 U9 B% `8 d$ y
(VWIN32_Int41Dispatch)
( G$ P! v& r0 H) Y- J# Q call Kernel32!ORD_001 ; VxdCall3 e8 ]% |8 ~0 G, F$ c3 U- H
cmp ax, 0f386h ; magic number returned by system debuggers' O$ V% H! H' \ k8 k4 U
jz SoftICE_detected2 H; b: M- I3 H
8 b' ~ @$ v/ K$ {
Here again, several ways to detect it:
\1 Z; c, b; A
5 K/ x, y6 Y( \) g/ g( |- p9 _ BPINT 41 if ax==4f; O7 t7 d9 l) T. E
4 Q8 a$ l! e2 u% | BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
1 U( m: V5 N! z ~% V
1 ~6 U- ^7 g4 I. \" t7 E% r7 r BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
8 V4 K/ V" ?* o5 P. W0 d& t2 ~5 @& N/ a! T
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 r( D1 F& j- W3 j; {) O* U S, ^# G! K( F9 Q. g/ y
__________________________________________________________________________
8 y$ E/ b. m$ q$ Q. ?9 v' O- T. D- M' B9 E5 h# g
Method 13" j/ e# X V2 o* U+ _3 N! ?, K
=========8 a! h' }; b; t1 T
$ a- r+ h- l; xNot a real method of detection, but a good way to know if SoftICE is6 Y& s5 Q, y" f* }9 i9 |8 k
installed on a computer and to locate its installation directory. [9 G' b, g9 Y$ V6 _3 G7 H
It is used by few softs which access the following registry keys (usually #2) :
1 \8 c' ~8 }# m P+ n4 |4 S
) v$ H+ z j9 u7 t6 B" U-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& V4 E9 I7 N0 H& o$ ?+ W& \7 N
\Uninstall\SoftICE
8 ~; i% V% f- f+ }2 c" ?-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% i4 X8 Z8 T4 O0 B! P' E+ @
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 L2 `6 T' K. C* x# I& r\App Paths\Loader32.Exe
& p4 p% H) z1 V* a& F7 L7 ]$ {# \5 ]( j* t' }
4 I, v4 [1 y& s; [& v4 uNote that some nasty apps could then erase all files from SoftICE directory: P+ a! o; a! H+ @" u
(I faced that once :-(
6 T( D' X E" C( c
! Q g+ c8 C3 ~7 D# LUseful breakpoint to detect it:
: ?: a8 I+ @( [! `; N# }5 v3 |/ t5 |8 y; L# q
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' @7 ^0 K+ \. }9 M& F' H
2 v/ \; D/ a1 f0 Z
__________________________________________________________________________
4 ?: H" a! G6 a; o: Y5 \: A
* z# a9 K! f6 `* H- M- P% ^0 _" ]& }: e$ p# k& c/ M
Method 14 3 m, H8 } U5 g/ P7 A3 i& M+ x4 j
=========% Z3 x. ~( r$ n
: |6 h* l6 h7 X" ^9 v9 y" n
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
0 \5 C: ^) V5 b* gis to determines whether a debugger is running on your system (ring0 only).( l* p+ A& J) f% ?) z* p
& P P$ m5 A' _! R2 f3 V
VMMCall Test_Debug_Installed% m, Z; V, C0 g% o0 f
je not_installed% R @" M) l* n4 u
* R! d' x+ `+ w3 G6 KThis service just checks a flag.
3 K6 |1 O$ j" g% _1 v& Q3 u+ s</PRE></TD></TR></TBODY></TABLE> |