<TABLE width=500>
; @; \! ]# Q, V: z<TBODY>3 H$ L! t) ?) x
<TR>
: J! C5 K1 b6 G/ }" B<TD><PRE>Method 01 ( Y( ~: B# t, h, B% F
=========
3 E1 I3 H) z$ |8 K. }# Y' ~* c& E+ U* _) b
This method of detection of SoftICE (as well as the following one) is; p6 w% S; w8 K) b
used by the majority of packers/encryptors found on Internet.9 D! @( A9 _4 b, r$ V
It seeks the signature of BoundsChecker in SoftICE
5 o8 W7 r% }3 |. z1 v
4 r8 |; A6 Z5 w8 ]$ Z mov ebp, 04243484Bh ; 'BCHK'; ~& G; Q H. R. R6 {1 M! q
mov ax, 04h
; N6 {' b6 w& q* |5 t* c: X) P7 K int 3
9 O P8 R5 M! x, o1 `5 F cmp al,4( H6 W; u0 v7 z0 z$ w v" f5 v
jnz SoftICE_Detected7 `9 G2 [. w! [9 Q
) J V& s! h, }- R; n4 ~0 |___________________________________________________________________________+ L1 J1 L! f% |
7 h/ Y2 N+ x& s9 _! [Method 024 t ], h& M* N& l% Y& K# z5 g
=========
* _' e1 R& L$ Q6 c8 R, u2 g$ |5 L& `/ o4 C% v# q" J' n
Still a method very much used (perhaps the most frequent one). It is used
4 E6 w* f2 s( Z* C; A' Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,4 d! _) H5 ^- L
or execute SoftICE commands...
+ \: j1 U/ J; \9 H) }6 F9 G, V$ aIt is also used to crash SoftICE and to force it to execute any commands
2 ^& ~# v' q+ B N6 J(HBOOT...) :-((
0 ~" s: M, y1 r, J$ T
# W7 i' C6 o% sHere is a quick description:) K6 \1 i P: `# R0 t0 b6 J
-AX = 0910h (Display string in SIce windows)1 S, V& X% l; w; i% k: E
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
% `* h+ y8 H/ s7 D) {-AX = 0912h (Get breakpoint infos)
L8 S. C1 M' i$ O9 ]-AX = 0913h (Set Sice breakpoints)( V2 h& M4 @0 }/ c$ N9 w
-AX = 0914h (Remove SIce breakoints)
) o# H% f# u$ A! r4 S Q. m" P- x2 x& d1 y/ e5 W7 G$ C
Each time you'll meet this trick, you'll see:$ M$ I1 {: C4 \' M$ F4 P
-SI = 4647h
6 f- {2 w2 y/ ?/ |' u-DI = 4A4Dh
6 E! u0 t& r) `: T8 NWhich are the 'magic values' used by SoftIce.9 c H7 i1 Q# o' J: g
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.. J( k! P4 W% O5 i& Y. ~
! t, V: c8 I& WHere is one example from the file "Haspinst.exe" which is the dongle HASP
2 g, |1 A9 Y% V7 ]2 R: jEnvelope utility use to protect DOS applications:- Q: X9 A# O+ l9 D% M! ?6 y3 ]2 Z* f
2 G2 l8 f$ [$ [& {7 f+ G- W( t
9 A6 V7 W1 q0 z$ A* `4 Z: o l4 K
4C19:0095 MOV AX,0911 ; execute command.2 c* r$ R3 c' i' y* @
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
1 T4 u0 H) c1 S2 P* \4C19:009A MOV SI,4647 ; 1st magic value.
, j6 Z- W" Z2 ^3 h# j% W4C19:009D MOV DI,4A4D ; 2nd magic value.9 a$ w) Y$ a; e9 ?
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)4 H) b9 q c* b2 X# A7 i+ \: V: j
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
: f: ]4 D8 m; }' k: N- N4C19:00A4 INC CX! y/ s" u+ j8 U; e0 o; A8 ^$ p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- b9 f: F+ e5 \' G. K
4C19:00A8 JB 0095 ; 6 different commands.2 i. H0 m% f8 y' D V7 n: s1 C0 T
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
7 {( W; x7 I' I+ A& z3 K5 Y4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 v$ q9 i; c3 r' ^" n. W5 ~& Z1 ?
The program will execute 6 different SIce commands located at ds:dx, which
' j; f: T" N6 k8 D+ }" x6 \are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ {1 H \$ c: [7 p4 X# ~, F
) s1 D" v! x0 P- g# j* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 `! |; A6 \' E2 u9 u2 t; w___________________________________________________________________________ j1 f' p6 Y( h x' |
8 Q, V% R# ?( [9 R
; {: ~# j, |" M& m- n8 o" K% _
Method 03, K: P9 f/ o/ C; Q% J0 W- I
=========
" N) `! T, D0 A7 t
. \$ H1 c( `. l: {& d2 s6 hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' m3 }; T7 D) O5 G' g
(API Get entry point). y% W# C3 [/ b; \
R% Y0 d2 o! b' N
' k% D. I0 v3 X xor di,di9 o" D# `. J4 p% r! ?
mov es,di
0 h7 h# `8 u& u% _2 z9 I mov ax, 1684h 6 {6 \8 B# l0 h. A \# F/ U
mov bx, 0202h ; VxD ID of winice0 I+ p% @2 i2 Y5 A0 ^
int 2Fh$ m3 Y6 W7 \3 H
mov ax, es ; ES:DI -> VxD API entry point
1 n% m; K) K* {8 q& Y add ax, di
1 A, k( h" }& Z0 p test ax,ax6 o$ ~0 Z8 {2 I' h+ F
jnz SoftICE_Detected
. _; c7 r/ U; B) u v- V+ x: }# k1 Y( Z( c8 l$ ^
___________________________________________________________________________
1 ^' e' x4 \; f+ E/ W6 j
( b7 D4 O/ g3 j1 d6 Y9 r0 T9 V# YMethod 04
4 M" O2 \+ X* x. W! a- {=========# z! ^8 o3 ]" O8 {( w( I
' t% [) N3 L2 X# p7 A* ^) }! ~
Method identical to the preceding one except that it seeks the ID of SoftICE9 O% z! T; R- e. \) d) z
GFX VxD.
' v& q2 n: m q; `; V7 [# | k$ h. z; f8 o7 l* e# C
xor di,di+ h" ^5 U& k6 r5 v9 t/ D3 l7 |
mov es,di9 Y( o7 R m, j" P: H
mov ax, 1684h
8 v& V- j* ~7 B mov bx, 7a5Fh ; VxD ID of SIWVID$ B& {% b- n1 ^8 j& s5 R m, b! d! b! @; M
int 2fh: d# L2 M5 i0 j( X. }/ v
mov ax, es ; ES:DI -> VxD API entry point
3 m. t0 s: l% N3 i* X add ax, di: ?2 S4 x" D4 N0 j. ~
test ax,ax8 \# T" ]. B$ |# x
jnz SoftICE_Detected( M) G+ R* C& Q8 }
; s! t8 N' ~1 w/ F. s
__________________________________________________________________________
; Z$ V' ?6 F! ?; B' Q4 B8 a' i7 ]/ v6 ?! m. ^
' ~1 w/ i# T' j, EMethod 05* G$ A* j# b9 I, Z! N
=========
( U* k! v6 k" Z5 m: E" n! ~% l
6 J1 n+ x, K8 r( UMethod seeking the 'magic number' 0F386h returned (in ax) by all system% }* _" ~" m* p
debugger. It calls the int 41h, function 4Fh.
" `3 a, B7 ?5 s& o3 O8 rThere are several alternatives. - D" y1 u3 H0 X$ S" [
+ D# b v1 `3 S3 S9 A
The following one is the simplest:4 `- {3 V3 N0 e
3 W( s0 a6 b3 t3 L mov ax,4fh3 n2 s; x! M7 {
int 41h
8 Y8 j2 D) r$ p# v cmp ax, 0F386
1 N; W! x x" Q jz SoftICE_detected3 X2 D% I/ m2 ~ h* E
|: L( a1 V& E7 X) O, L
+ h- p7 o" ` k; A. d4 R w7 T) PNext method as well as the following one are 2 examples from Stone's ) V# Z( v% F! M) h4 P: b% p8 F6 e) o% L
"stn-wid.zip" (www.cracking.net):+ K+ `$ m% j& u8 N7 o
# l' ~% ]$ Q& v ~% b; P
mov bx, cs; X7 g' t5 G5 F) t& W0 U
lea dx, int41handler2$ [2 ^1 T7 b* M+ P
xchg dx, es:[41h*4]7 z1 Z) K7 w% n& e
xchg bx, es:[41h*4+2]* J0 z: e |4 T% W c
mov ax,4fh0 G2 d0 g, Q7 B6 T8 p7 f) v9 I
int 41h: B- Q9 d. F e* b6 L
xchg dx, es:[41h*4]$ e) L: Z K- H4 x! w
xchg bx, es:[41h*4+2]
7 u) S1 |1 k6 k; E* R cmp ax, 0f386h
9 T' Y# @' I8 k7 E: U* ]! E+ T jz SoftICE_detected8 }9 Q. w' Z& D7 Q) Y# m
4 _4 C+ M: v. `- o- zint41handler2 PROC/ Z, _- K7 L5 @7 t" e/ R7 B
iret! [1 |* i* F: j2 U9 g+ B4 _
int41handler2 ENDP; l6 Y3 f' O8 s4 e1 J0 F
6 t' Z1 q- M- ?1 ?9 y; d' C
, V7 c9 o/ x6 ~_________________________________________________________________________
. e- Z$ a$ |; a4 d" K( M" y! ^8 x; v8 O
" Y" e* j; ?" x# f3 ]$ Y
Method 06
1 ^ u% `( \ \) }/ s4 S! X4 u=========/ e# e, Z, G! e4 Z" T& B2 f
. ^" e' M& @0 z8 C9 J
5 T3 v* g$ S% o1 l, p2nd method similar to the preceding one but more difficult to detect:" j X6 e3 P' W7 z0 w I( I
; |# V4 i% u) |& ?* r" X+ n1 \/ |' b2 ?2 V' z: P
int41handler PROC
5 z: A$ r" P0 o/ Z mov cl,al* H2 V/ [0 ?" @
iret
. n, P& Z( O; d, C9 r9 c' eint41handler ENDP
, T1 Y; Y& S; h/ l; k& o$ t6 V0 x3 F) S: Q
5 I1 ?- v t6 q' j
xor ax,ax! R7 M. N1 O7 D; F, E
mov es,ax
7 T0 `8 b5 E6 s mov bx, cs9 L/ x p: A' d' c# W
lea dx, int41handler
) o) w& M& z: V& t h xchg dx, es:[41h*4]/ H& E- I0 Z# u# Z1 V1 ~8 S3 R) m
xchg bx, es:[41h*4+2]1 \+ I4 _% ^' _- w- i: N
in al, 40h
! {, s, f8 F% z8 _6 H& I; ] xor cx,cx) t1 O. I8 `$ l9 \0 _
int 41h- a6 p- J4 P" D) T
xchg dx, es:[41h*4], G. o" I, w5 c
xchg bx, es:[41h*4+2]4 E( A. _, G4 x% e
cmp cl,al
) _% e/ o, M" |3 g& O, z9 J jnz SoftICE_detected
) A! d5 J5 g- F5 {0 I9 V! h4 @: _: s5 X! c4 q
_________________________________________________________________________
9 n9 @ L. r4 D4 {' x) x* ?" v; M o7 L$ [( ?+ w' n
Method 073 H+ R c0 U* S0 W/ k' F5 M# b
=========4 c& [4 r. A$ T, y) W( B1 r% q" \# y
% V L8 i: @5 Z+ ?Method of detection of the WinICE handler in the int68h (V86)- t( @- u* s" K, V
2 z" z5 S' }. B8 B
mov ah,43h
5 W, @# {% x0 i0 n3 b int 68h$ E8 t) V8 {( S$ G- h: [
cmp ax,0F386h
8 _- A# @5 |/ K% S jz SoftICE_Detected
) M* x: b' n( B3 M% ?" D
, _& M; ?) {* | k: D# s7 U; z7 a- z' J+ |
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' i7 y" H9 L% f& w$ }3 _2 }
app like this:
6 x' I% Y7 m" c8 V- a5 X2 W) z+ o
BPX exec_int if ax==68) n* R1 A& j& ?, P1 }, }! `3 @0 `0 c
(function called is located at byte ptr [ebp+1Dh] and client eip is4 i# n" ^( [4 \. J0 f/ _- I
located at [ebp+48h] for 32Bit apps)7 _6 f4 }& S9 c' I
__________________________________________________________________________
0 @. W# g: w) i1 R# h; N- d
# ^, B, N q3 B, L U$ L* h& p# O3 b( f* R8 \9 t- T
Method 08! J! b& F K, Y. ` O3 H h
=========. {9 N, W m; L& ~# g5 t
6 B) C7 F* X& y2 }" C! Q( c
It is not a method of detection of SoftICE but a possibility to crash the
0 D7 L3 D' R3 q) B! w* fsystem by intercepting int 01h and int 03h and redirecting them to another
7 ]6 a3 b5 g- B" s! n- M; froutine.) k, M d- P6 V& [# v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) C" c$ N0 {' O" d* P
to the new routine to execute (hangs computer...)$ U8 ` P( D6 I
6 q" p2 @' M6 H, ]! j* p mov ah, 25h! S! P* S# c4 a6 r
mov al, Int_Number (01h or 03h)
( k2 I" S$ b9 l5 z/ W7 n mov dx, offset New_Int_Routine
+ W# b1 h; F9 ~: }. e int 21h
! W7 s4 K( |2 d) y6 O' A7 c- o3 ^5 \. s6 `( l
__________________________________________________________________________
7 p; n8 b- P1 Z \% W
& y6 D+ v+ z2 N, d; h1 d. ^1 lMethod 091 R0 a2 N& m: u1 h$ S
=========
7 _+ E3 Y4 B# I
2 f% B! R- ^( rThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
7 M' L) Z2 ^" ^6 s) Jperformed in ring0 (VxD or a ring3 app using the VxdCall).& M, n/ y4 T0 ?: d# V# n k8 z
The Get_DDB service is used to determine whether or not a VxD is installed
: i M2 F6 {2 x9 }for the specified device and returns a Device Description Block (in ecx) for
' ?1 k3 C+ G7 K; x# Gthat device if it is installed.7 o. c) t8 ?$ o
. ~) N, n) [! [( o
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* K, q+ ?) x$ d1 X: e mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ @2 Q0 G$ Q+ w! L& b7 D) E, G: I- m VMMCall Get_DDB
! K7 l1 F+ Z4 Q! u mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 k2 e7 p1 k$ S2 N8 D
" E, t- ?0 e' f6 y0 ~: vNote as well that you can easily detect this method with SoftICE:
" i, _* R% B5 `- Z9 e2 f bpx Get_DDB if ax==0202 || ax==7a5fh
$ W3 ?) O0 [+ f9 C: ~
) ], n9 b! h; j. m9 B__________________________________________________________________________
3 `% o: \# x- P1 p
! Y6 `7 Q- z/ C2 qMethod 10
s" O. V# T8 B, N ]6 _/ u1 d6 K7 F=========
4 \! i! K6 [9 x9 k+ Z- k
; L2 ~ s5 k2 e- M# ~" |=>Disable or clear breakpoints before using this feature. DO NOT trace with& Q4 k, S: N1 f" Z6 z0 Q5 O
SoftICE while the option is enable!!
2 E4 _ p- M4 z4 g9 i- Q. p' e2 ?, |) N( Z, R9 R+ P
This trick is very efficient:* l o; j4 L: x* e: k* D6 ^
by checking the Debug Registers, you can detect if SoftICE is loaded
& w7 s' q" M" Z$ U7 [, |5 M(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if% }. K/ W8 `6 L+ B0 v
there are some memory breakpoints set (dr0 to dr3) simply by reading their8 N. e' j# \- I' [4 c9 U' H3 g$ w
value (in ring0 only). Values can be manipulated and or changed as well, e+ ]- } v: @/ O
(clearing BPMs for instance)
1 z( `! a+ z! H! i0 M+ [4 U/ J# t7 p, z: @2 _
__________________________________________________________________________ v7 D- l8 G/ ~
( p( R8 q. y6 ?: p9 ~
Method 11
: i" E; c/ N$ T' b5 H=========- |; e2 ]# N/ f2 a/ ^* S2 Y( G+ ^
3 E5 H$ u; X. a- `, L) U" d
This method is most known as 'MeltICE' because it has been freely distributed
- z: n' K; A$ Tvia www.winfiles.com. However it was first used by NuMega people to allow
6 t" C- t3 A0 ?$ B. }- C+ NSymbol Loader to check if SoftICE was active or not (the code is located
4 }% k2 r0 l! W- `& c; P( R1 Binside nmtrans.dll).
- U+ W2 Y" v) l5 G: x
. e( _ F; }' X T5 h! @! RThe way it works is very simple:& D+ W; h |9 A
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( B& E0 W8 z( ?
WinNT) with the CreateFileA API." I/ Z2 z' H% S, _* q7 T+ |
1 p% Z8 M6 s7 J% k/ \4 t7 Q+ {Here is a sample (checking for 'SICE'):+ o* [0 ~- u4 f8 Q4 }
+ b+ @/ n g4 v# t: W3 K" ~; @
BOOL IsSoftIce95Loaded()! t s+ G$ |1 x, N# A
{
9 J2 y! ^- T( `3 q. b! h% g HANDLE hFile;
0 t$ o$ K X! m+ w+ ~' w' L5 n hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" v! d; `3 \* g1 E1 s FILE_SHARE_READ | FILE_SHARE_WRITE,
/ G9 w" p! r- B( a: b NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);& P0 ^5 Q# m: q% G- g# y- C
if( hFile != INVALID_HANDLE_VALUE )! @* Y5 {( L( n
{9 y) Q0 ^# G6 G) B p
CloseHandle(hFile);
( b" U& j' P% i: I' b return TRUE;" X5 V7 z# r1 l1 r8 y; F8 p
}7 @& o6 n" _7 d- h) u6 Z4 {9 F% w
return FALSE;* M1 v4 D1 k) x# C: J( Q8 y
}( |5 v4 f2 n1 D: u) l
2 E7 h" v L ]( f1 \
Although this trick calls the CreateFileA function, don't even expect to be* o8 }& \8 t# `; G/ L! g& P+ p B
able to intercept it by installing a IFS hook: it will not work, no way!
* l) Y7 k7 q4 T0 s* CIn fact, after the call to CreateFileA it will get through VWIN32 0x001F; Z% v. o% t% X5 b+ u( _
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- n' H. r. D- l- Y) j
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
. d, o: L. x3 ]$ e4 Dfield.
5 [" d" I' i/ ~2 t* R. iIn fact, its purpose is not to load/unload VxDs but only to send a
0 ~. S5 D5 e5 z iW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
+ n0 S2 H# c3 ]* [to the VxD Control_Dispatch proc (how the hell a shareware soft could try
9 {" t* R4 k+ R/ Gto load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 t; a8 Y+ {. N8 [) Y' v$ R6 B' sIf the VxD is loaded, it will always clear eax and the Carry flag to allow
1 Z, {2 M! J5 u0 D) O9 ^8 |3 L1 ^its handle to be opened and then, will be detected.$ _$ |3 D0 ^/ K$ `
You can check that simply by hooking Winice.exe control proc entry point) d8 D- _9 \1 B* q0 p8 d& L
while running MeltICE.
- e# J8 u7 {9 c* Q- K! j& x2 m8 J6 T( V. g
( p, A8 Q# K w. N3 O& T" C
00401067: push 00402025 ; \\.\SICE
|( @- ^/ j, E( B2 F 0040106C: call CreateFileA
- M$ H+ E3 g, w2 x 00401071: cmp eax,-001
7 ], u1 A% q0 U4 P$ Q( ]) Z, \ 00401074: je 00401091( `* n4 R) I3 p. w8 Y
" c. a4 E, w/ }( Q
4 `+ H7 E5 G6 q0 o rThere could be hundreds of BPX you could use to detect this trick.7 [$ q2 R- c4 p% d5 U* A
-The most classical one is:! n; P7 n! z" |; O
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||+ n8 k _+ \" x# D% J8 o4 N# W
*(esp->4+4)=='NTIC'1 v+ f9 s" }5 ~1 t: C, `0 y% K) h
! t& G. c8 l8 K! ]/ E
-The most exotic ones (could be very slooooow :-(7 B$ Y/ O2 u) W
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
) j T# Y2 G) p' _$ Q( r ;will break 3 times :-(
7 X# Y' _$ |: \6 ^; n% K% Q, m# }: j
-or (a bit) faster: / ]5 v- G- r9 \- p1 l
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) c5 n: k0 c$ l3 I1 @
& B- U9 l( [0 y( i5 E BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + S2 Y* j" B9 _8 o, x! @$ \/ T
;will break 3 times :-(( z; M" O/ E; j; o" V4 J1 J
* V9 f1 A# g2 P0 ^3 x! w- D
-Much faster:% S/ K% x0 {* ?" O8 {& ~
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' q7 E2 G8 @$ C( `" h' o
2 ]( z9 p) ?* o" X
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen( m4 x) {! T V' P- R; W/ k. k# W
function to do the same job:: \- Z. T( g/ w W3 ~; T
+ ~3 Z6 p% P/ S$ ~: K9 j9 K push 00 ; OF_READ
# }7 o; u5 v |! m& H6 b' I0 h9 h6 S mov eax,[00656634] ; '\\.\SICE',0
. {$ n: l% }$ J push eax
* L) @2 }8 Z! U call KERNEL32!_lopen
+ K( Z% L" V6 v& B inc eax
! W, G( A v* K7 P* n jnz 00650589 ; detected; u7 j' ]$ O2 ^9 s' Z; e* k: {! B
push 00 ; OF_READ
6 B- |* `$ `5 |1 [* @ mov eax,[00656638] ; '\\.\SICE'8 a. {- w$ @+ w* N* D
push eax
4 h1 y7 ?) ~# w8 x/ I call KERNEL32!_lopen" N1 Y# n. L" D8 I) @1 b
inc eax; `& L2 k, e; I" v- B
jz 006505ae ; not detected
6 ~2 E7 k9 H8 O0 f8 K$ {7 z' c+ F7 p! l# Z
- f: }% \3 j! s6 \! q- x
__________________________________________________________________________
5 w! i2 T2 z% T) z8 P3 n' O
& N5 J7 e5 ]/ Z( \- }9 }% cMethod 12# \; k- ~, I0 j& a/ b/ }
=========- S+ s3 b! K& P1 D- k" B" \; y
# p( [& `# M; c4 O+ x4 O5 R" [+ r* V3 S# E
This trick is similar to int41h/4fh Debugger installation check (code 05: p: y* v, i, h2 l9 Z$ k0 ^5 _' G
& 06) but very limited because it's only available for Win95/98 (not NT) [ l- m& _/ s2 Y5 x- j% x7 v
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' l' v) d! p2 G, W) Q
. ^5 n9 H0 W) \$ N* r- g$ l push 0000004fh ; function 4fh
. z; x0 O1 k8 `! g7 T push 002a002ah ; high word specifies which VxD (VWIN32)( l7 L" y; p$ Z+ L$ ?( ?" A
; low word specifies which service
. h* f. w" i9 ~: d4 C) ~* Z (VWIN32_Int41Dispatch)# I \3 q! F2 D# j4 E( ~9 l
call Kernel32!ORD_001 ; VxdCall( s+ u+ W: E$ r
cmp ax, 0f386h ; magic number returned by system debuggers
/ N! T7 {! F0 E T9 h jz SoftICE_detected* y Y, ~# B) d/ Y" }! L
- E. ?- W4 K1 N4 A1 q' k+ L& J2 ]
Here again, several ways to detect it:0 i! u# o% Q7 {. f, I9 b7 l
: P u& [0 ], e( e' ]: m6 w( c BPINT 41 if ax==4f
0 C1 z3 ^, Q8 D; b' g
" ^7 N% c. Z$ @: o0 `( q BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
7 S7 H: ?6 f$ m! T
. \$ K* @7 U! m3 @1 G4 _ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A: g y2 H! i- b
$ N7 v4 n5 b$ K' @; K5 r
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
" D3 H/ F# c/ h- B* K& @ @( \; l6 l5 g$ ?
__________________________________________________________________________
3 Q3 R, H1 C0 p8 ~- |2 h1 s: [5 e1 n5 ]( f' q+ }
Method 13+ h+ w! \" F6 A& S; w1 ^0 X
=========
: o8 h) p( w9 P" ~- i
1 P5 }$ Z! z: KNot a real method of detection, but a good way to know if SoftICE is+ C0 W7 B) k; c) x- I4 f g
installed on a computer and to locate its installation directory.
4 P+ A/ B$ B* lIt is used by few softs which access the following registry keys (usually #2) :6 M, b' b5 t$ @) p5 G( M
; q' W y: B1 r* ]* y- x- @: t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) j: \. j$ L* o, F* W) B
\Uninstall\SoftICE
9 Y) n& [. P8 D" o6 l2 s# Q+ i. F3 f$ X-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
& w' U1 f8 ~8 z% c0 W& E* \: \0 j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 j. d3 Q) o; C" k3 ?; L\App Paths\Loader32.Exe
6 l. f/ ~. I0 P ]% A$ }4 Y, a# \+ K
4 X8 s$ C- s0 U4 K9 [' ^
Note that some nasty apps could then erase all files from SoftICE directory# @$ T5 e, Q6 P3 T3 L
(I faced that once :-(
+ |* R! U8 h' {- O2 m
& H9 E5 `) n; CUseful breakpoint to detect it:
2 Q" @+ W. G# r" m' k" |5 J/ x' `! S+ ?$ p( U8 x
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 M( s A) t, H6 c/ m3 k+ E& e
* a/ `. G0 M8 u6 U( q9 l
__________________________________________________________________________
d7 j' a, y2 G& h& _) n) _3 |
3 O0 n: D* L4 qMethod 14
! @. x- K( A5 s0 l=========
" r, J0 x) ~# r$ I5 I# K! B; s
9 V8 K) N8 F$ s7 m3 _/ z' tA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
+ O1 u, F3 _6 T/ Z* ^9 S. Jis to determines whether a debugger is running on your system (ring0 only).
# p: e% \9 A& W; G" b) ?5 V9 E9 D- D/ X" F9 s
VMMCall Test_Debug_Installed0 e" w# R3 o' A; o4 G# i
je not_installed2 ^# C) e4 h' f
" O: w; [- {* }1 BThis service just checks a flag.
/ h9 r6 K, N' j1 F</PRE></TD></TR></TBODY></TABLE> |