<TABLE width=500>/ O' k3 q! D0 R# O* ^
<TBODY>: H8 Y( v# t4 ]; A) N
<TR>
! h7 c* e# N, D" c+ z1 i<TD><PRE>Method 01 1 A. G3 Q& f L/ b! a, g
=========
* x- i7 `/ y( v5 C& y6 l+ b+ Q1 P( d6 q" P- F/ L" e4 i
This method of detection of SoftICE (as well as the following one) is9 y* h2 g; q# z7 J0 g) i
used by the majority of packers/encryptors found on Internet.
+ c7 L0 H2 `! i: ^6 [) sIt seeks the signature of BoundsChecker in SoftICE4 `1 Y/ {! M$ d m5 I0 S9 \
3 `- `, `- n) P: q4 ?" N/ y7 m/ c mov ebp, 04243484Bh ; 'BCHK' q, A' c( m2 |9 i: s4 U4 T5 ?
mov ax, 04h
; }. S2 s3 o' ^- k* p int 3
& [9 l8 O2 S. {8 O cmp al,4
y4 O$ t9 O+ a& r6 Q3 J jnz SoftICE_Detected
; ]# Q7 k3 `; \* x- t0 S
/ c' l) y6 U+ a" j7 u; g8 x' `5 R4 O___________________________________________________________________________0 G" ?: \3 W( H3 U& \* }' v
$ m$ N! t# n. h2 d: j: K0 k* hMethod 02
+ }8 c4 ]. x' x8 g=========
2 Q& T2 q9 F% w6 K% V5 C0 D& ^# B0 c2 A
Still a method very much used (perhaps the most frequent one). It is used* `$ ^5 V" A' v" C: M
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,) J( C$ _& _& ?/ K; x+ q
or execute SoftICE commands...4 q' H% Y1 S0 d9 J) E4 i4 N
It is also used to crash SoftICE and to force it to execute any commands% u. }, [+ m. { J [! L3 e
(HBOOT...) :-(( & a2 n6 K& r: W8 A& P" Y# B
7 Q; g0 S6 T; I7 Z
Here is a quick description:5 H0 Z$ U1 M8 A7 M
-AX = 0910h (Display string in SIce windows)( Q8 [6 m' m: k3 M! Z5 o
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)) H6 |& h7 S1 k5 z7 ~7 K
-AX = 0912h (Get breakpoint infos)
) _* T+ D- \# l( Z$ M* t8 w-AX = 0913h (Set Sice breakpoints)
! d0 `5 G9 ?+ z& y- K; d-AX = 0914h (Remove SIce breakoints)7 o+ v& f" d" C2 Q$ N0 Y/ }, w
G! t- V/ L3 Z& c7 s! U9 ]1 d
Each time you'll meet this trick, you'll see:# O" H; ^$ y1 w1 ^* i' M1 y6 ~+ E' U$ U2 ^
-SI = 4647h8 j0 Z U, V$ P
-DI = 4A4Dh
% @. |( _, r4 L I. U% cWhich are the 'magic values' used by SoftIce.
. u# S5 I' v: J, @& _For more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 B- d ]" k4 V' ]9 ]4 G" ?
; l v# d7 P7 c/ z* ^! b
Here is one example from the file "Haspinst.exe" which is the dongle HASP8 A, i; v' s. H, S8 j% F7 ]
Envelope utility use to protect DOS applications:
2 W j- G" M1 u* F: B7 v: [
2 R( v- _ g; t$ b" m) u. I" L+ p I$ H
4C19:0095 MOV AX,0911 ; execute command.1 `8 w( U3 V7 o
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' K% D/ n" K; `% a7 V
4C19:009A MOV SI,4647 ; 1st magic value.5 m( y- U) \! P0 M$ l$ C
4C19:009D MOV DI,4A4D ; 2nd magic value.
* G: Y7 }9 S7 Q) Y4 e2 F8 V' H4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 K- l; B' k( s- S& d4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
% d8 y" @3 | U% G) C; t4C19:00A4 INC CX4 e0 {$ b% s/ @3 q! j- x
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: u+ ~% e. D. O$ {0 a
4C19:00A8 JB 0095 ; 6 different commands.
0 W" F7 |2 p) j4 [4C19:00AA JMP 0002 ; Bad_Guy jmp back.* P, O: t/ a7 c7 g% s9 w2 J. e
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% ^3 B7 v* z, B" o- E
# Q, S/ }$ l2 K3 ?, ]) V' q9 z( V
The program will execute 6 different SIce commands located at ds:dx, which
& n# H! |9 `& u* ~% P" n- Uare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 @; ^1 @) E! C2 A9 n! c7 _" U" D2 q
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; a- @0 Q( l+ G, }5 M' w. h
___________________________________________________________________________
7 I3 P1 V$ c0 |: m: F8 L d' E& [( K- I- W7 u6 D; c
4 u" J& N* y( h: hMethod 03
+ K7 m6 c2 N. K2 P; X) ?3 ^=========
( z) G6 \7 z6 H) Y2 B0 k; K% G# u$ W* u5 U
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% s( w1 F! D+ |8 @: @(API Get entry point)
) ]5 \6 P" s+ S+ w, W
, ?! i( G% F# I
" e) u5 j* @3 d xor di,di+ L$ a* S' d# T! @
mov es,di
1 R! }( ^* ~" x mov ax, 1684h & N \6 _7 e; l6 T1 |" a- O" T7 y
mov bx, 0202h ; VxD ID of winice! g+ z! A' n7 S& G# [
int 2Fh
: |$ W& X- O; K4 f1 p mov ax, es ; ES:DI -> VxD API entry point+ j B- _: X1 i/ S7 {# Q
add ax, di
5 o( C& T! G$ o' L4 {: b; B test ax,ax
; U, N3 k, E1 S. C* M& L* t jnz SoftICE_Detected3 p' I0 K- O0 y" v- p
+ w, f# P9 v, j0 N' X' A7 }% h# s( u
___________________________________________________________________________% s5 p' r9 S) d
' J( y9 ]! x$ s& }# N
Method 04& y- |. O" P. K- {! j" U0 F
=========
7 x3 {; j( d0 g. d( B6 _- ]- N% p% c& Y8 j W0 i" p" {4 P
Method identical to the preceding one except that it seeks the ID of SoftICE
1 e, G0 I$ V7 s- Y" o/ I4 t* TGFX VxD./ s( R0 q6 ?; F8 ]$ d5 o% a
& {- |$ _8 t9 z& s+ ~
xor di,di7 |. \7 {+ \; l" _& Y
mov es,di
2 E$ d# f8 Y: w8 S* k" g: h mov ax, 1684h
* J. z& ]/ Q8 b6 ^# V( J; c( J- ` mov bx, 7a5Fh ; VxD ID of SIWVID4 h7 e% W, F- ~3 C# k
int 2fh; Y4 v: y z- Z* h4 Z
mov ax, es ; ES:DI -> VxD API entry point
- e" S$ d0 m: z* q7 ]5 l. F5 m add ax, di* R6 V# Z; W* h' m) R! x6 N9 E
test ax,ax
1 B% }) R( V! Q, E7 k jnz SoftICE_Detected
k4 w. w$ a; H( P0 H4 Z) N* v2 K0 A7 ` b/ i- N3 ~0 d
__________________________________________________________________________
" H" q# ^1 q: U$ w* ^4 R9 u1 G( N
1 n3 k. U" I6 c% ~" r! @
4 i8 f+ a w( x. G* HMethod 05. L$ L% Q' k) B! q- R( D8 ?; [
=========
$ x: k: ^7 u2 L2 T f6 l# c% s/ u& K
Method seeking the 'magic number' 0F386h returned (in ax) by all system
/ e! y9 d' b4 t* j4 j! s) Zdebugger. It calls the int 41h, function 4Fh.- o" Z8 {6 `5 E+ }- R+ z4 n6 D
There are several alternatives.
4 Y# f$ }5 Z4 [! b
' A% h. }. e) Y, K- V5 w0 hThe following one is the simplest:
# W& H; v7 S& H6 B# ?- {
3 f1 }" H& W6 j1 L+ u mov ax,4fh
& W& x% M0 J, H! |' v; |: d# U, U5 x int 41h' h- q. e$ p3 P9 f8 h
cmp ax, 0F386
: D0 t7 D; C! D jz SoftICE_detected( P1 T3 _4 f: D- E5 E: |* m$ T( }
; l/ I5 [, m% |
$ `7 X$ ~- |6 ]6 k7 v) r
Next method as well as the following one are 2 examples from Stone's
% K& g( g% _" p% v8 n% D7 C7 E' ]"stn-wid.zip" (www.cracking.net):
. a+ X2 M' Q* _# w1 Y
4 U8 I' C# _, ?3 e3 _4 @ q mov bx, cs- e8 R( u8 Q k! ~# Z- W& \; n
lea dx, int41handler2( w- e3 v. }% _
xchg dx, es:[41h*4]
8 D8 f c5 K; l xchg bx, es:[41h*4+2]2 T( o) {3 X1 J" x# v% `; I
mov ax,4fh+ f- c; m4 E8 f4 M5 m
int 41h; [9 X* I' T9 o3 W9 }) J/ ]5 ]1 v
xchg dx, es:[41h*4]
% d( J& \! W; L/ W7 U* w xchg bx, es:[41h*4+2]6 S# o' P+ [( e6 w2 @. T0 `
cmp ax, 0f386h6 S% O8 z" @! Z; a% a
jz SoftICE_detected
o5 e6 L$ h$ V2 P' t/ j0 O' ?( l
int41handler2 PROC
3 j+ Z# x4 K7 f( I iret: I. u$ ^- d+ x: }' z
int41handler2 ENDP
" f+ @8 E& q' u" a; t* [0 l, z% D0 \% C6 `2 N5 D5 A# f+ H
3 t- P+ x( A. q& w3 W_________________________________________________________________________6 q. X7 }' U& m( @9 z8 I
* _4 k, [. O3 A) i0 _0 E8 @7 n3 ?# R2 |- N/ |$ ^
Method 06- s, p* h8 G9 m: |6 I7 d" x8 X
=========: X: x& p& l& j" k$ W
/ c& \1 m, d$ @0 O% X4 e& A0 o' s' C
% _( i Q3 L& @6 k# D6 t2nd method similar to the preceding one but more difficult to detect:
$ W( H4 `; P i) C) D: z- y/ A/ H
3 ?8 X: _# T$ T; F- d
int41handler PROC
0 f4 I3 V. h' Y. s mov cl,al: X$ W( h; i! L; w
iret
4 S, Q ~& P1 [# Qint41handler ENDP
/ r% Y5 ^ n5 N* ?( M
+ s0 Q6 _) [' l, L/ \; r/ d+ R' `, d) s& v( v
xor ax,ax0 d6 F9 z# v; V! H' l8 _0 }
mov es,ax9 R+ j2 c$ G1 \! ^7 G
mov bx, cs: ^1 I* M% z3 d% u6 d
lea dx, int41handler& K/ H/ o& {. x) k, ^& U: `2 M
xchg dx, es:[41h*4]
2 u) O, O) [7 _/ F1 k xchg bx, es:[41h*4+2]
* N0 a$ z* N) J in al, 40h
7 k6 i4 i5 K! ~& n, X# i6 l xor cx,cx
9 V% c. j; @- v. {4 x: G int 41h
* I$ U" O0 J) |- ^ xchg dx, es:[41h*4]1 `/ K) E" i3 {: v( t! X' s
xchg bx, es:[41h*4+2]
) m( ~5 v, C9 k. w4 ^+ n' _- Y0 V cmp cl,al
6 Z& C: E* G7 K- i! F/ x3 R jnz SoftICE_detected9 i+ l. p( ?* R! L5 V
0 V% _1 z/ C1 I: Q) y6 P
_________________________________________________________________________$ R6 o4 ?- a. a+ B5 y' Z+ `
& W; a# Y9 v7 B8 y2 U
Method 07
z& K$ |4 K8 p" [- N2 M=========/ ?% W( L! V+ F, Q6 I8 r1 V C4 W
' H7 T% [+ k2 d( IMethod of detection of the WinICE handler in the int68h (V86)
% n+ B/ H/ s* L1 j. z8 M& o% o; t2 B8 g" Y
mov ah,43h
w8 Z5 y8 C: e/ X$ q int 68h
/ c3 e) S" ~. f9 f) ^ cmp ax,0F386h( _3 @& {1 E+ ?3 A0 g
jz SoftICE_Detected
) W0 @9 t. u' r7 y& e, X0 \& t
$ _3 u* |4 H# c2 M2 X
, r9 v5 r+ N, F T=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( |+ ]' b3 u- p app like this:0 A* a$ `, _" L, f+ H
. U U: t: Y8 ]: r6 ^8 J* f BPX exec_int if ax==68
5 i6 O+ \$ s9 N. F0 Y, h (function called is located at byte ptr [ebp+1Dh] and client eip is2 p# I4 i: P& m* N* a5 j
located at [ebp+48h] for 32Bit apps)4 B6 k% u9 r) \5 c
__________________________________________________________________________: M- |2 d w' y
$ A/ s- p5 [6 n" Z% s
. [+ t% ] K" Y f7 N
Method 08- m- @. P- H0 L ~
=========, @5 Y+ f5 e/ p- w E1 a
6 E& i; \4 f5 I# r# NIt is not a method of detection of SoftICE but a possibility to crash the
6 n; k% t$ S# c6 p8 Dsystem by intercepting int 01h and int 03h and redirecting them to another
$ @% V/ v5 E/ a; [3 Y& [routine.7 F' F5 h- M) V( V8 J) l& d8 t9 e. A
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 Y( y" i. j- N4 Kto the new routine to execute (hangs computer...)
! }0 s& |: }7 ] G$ ~0 O2 {3 i2 T& V' o! s- A- y5 ]
mov ah, 25h
3 z! K; |! i, h( \. [7 g mov al, Int_Number (01h or 03h); M5 Z% }5 @! w }8 i6 {$ U, K
mov dx, offset New_Int_Routine- u, U$ C3 h% y2 ]% `
int 21h
8 A. F" J4 }% I1 x, e0 ?
- e; k9 t- ?1 f+ N& C% T__________________________________________________________________________ A; J) ~* ^. q8 u* D4 e4 S
* F4 g) {% s8 W: Y- I
Method 09 P8 x$ r0 a' Z9 D9 z
=========& M4 d3 r i6 Y
& ]% z- y M4 J! t5 w1 L |This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only6 U& p& P2 B* `3 A7 _9 X, z3 G7 H: Y
performed in ring0 (VxD or a ring3 app using the VxdCall).9 X( i4 c4 s+ `" N
The Get_DDB service is used to determine whether or not a VxD is installed( v8 ?5 \% ?+ e8 _! S7 }+ h
for the specified device and returns a Device Description Block (in ecx) for& o8 F4 e; [4 o7 B2 |
that device if it is installed.1 ?, H& W2 R1 G4 N
2 J* k( I- _8 R6 _, ]
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, k( T( U3 F8 e9 ?, N2 E mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 Y( E: J+ u2 H5 c% ]+ J3 U: u; k
VMMCall Get_DDB
7 G) f6 O4 U+ H mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
- u t! v9 h% t+ T
* E* g+ s" `7 T8 C5 xNote as well that you can easily detect this method with SoftICE:
( ^- W1 J* I( n8 @# K! `! P, u8 _ bpx Get_DDB if ax==0202 || ax==7a5fh5 A3 m: f, j/ S, F6 r9 Q& X
5 Z) l2 {- C4 g8 O( M2 t0 Y( O
__________________________________________________________________________) {9 C4 K8 J- \4 @
; |( b7 D6 F, ?) Y
Method 10( K* p4 a' A8 T0 n5 J
=========9 A4 a$ v5 d% h2 u) Y& B9 Z0 x
; I' Z6 r5 b6 o3 i- a* e# X* q
=>Disable or clear breakpoints before using this feature. DO NOT trace with
) G5 a2 A/ ~6 @+ K" ^! w1 E1 \ SoftICE while the option is enable!!" I/ R6 O0 P( q# t
+ ]/ A4 E. w. a) J$ M% Z2 w6 c; d# O& d
This trick is very efficient:
: L2 {- x8 K6 Q. k J: b4 nby checking the Debug Registers, you can detect if SoftICE is loaded4 J' R2 d6 ?! P6 v" P6 G7 S; M# \
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" a4 W7 \ H% e% q8 Hthere are some memory breakpoints set (dr0 to dr3) simply by reading their) l" @/ S' `3 Q6 i
value (in ring0 only). Values can be manipulated and or changed as well
( L8 R+ ]7 B% v5 S# l l(clearing BPMs for instance)
: r- | ?5 c) |7 c$ ~& a# Q* t. P
( n7 x$ r, _5 w& H" D__________________________________________________________________________. c' g$ d! ?* ^0 w0 u
# k& k ?- [' \! ]& T0 l) E# wMethod 11/ P* R6 e6 @7 ~! {8 {& {1 |
========= r$ T1 g/ O; C& T3 a' x
% {% n) I! h% H0 ]/ |1 i
This method is most known as 'MeltICE' because it has been freely distributed
) G" `: N% ^) cvia www.winfiles.com. However it was first used by NuMega people to allow# A& s+ E* M# h7 w; A% y
Symbol Loader to check if SoftICE was active or not (the code is located
) w$ c% M2 k% N1 i- |inside nmtrans.dll).6 d c. ]- ^- M! g- c
9 O# V7 L/ |) wThe way it works is very simple:
# i+ s8 t1 F9 q3 j0 P4 w0 iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( z d4 a1 o# vWinNT) with the CreateFileA API.9 l" }$ U, s7 j" X( l
/ L+ Y9 X& [6 j2 j
Here is a sample (checking for 'SICE'):& @4 s2 r/ y# m& v
0 G" e6 n; n( v; PBOOL IsSoftIce95Loaded()
. U" X5 D' P1 ]" Z; v{' R' N* r5 S0 g# n
HANDLE hFile; $ g/ a7 x6 O- t; v( g
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. S3 V* [/ l3 x6 k! }9 x7 k
FILE_SHARE_READ | FILE_SHARE_WRITE,
* n) R, F$ `, w) J* U NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 M' J+ t: A, z
if( hFile != INVALID_HANDLE_VALUE )" ^8 @: a( F4 u! a# @- p: U
{
1 R1 [" \3 J* o/ E3 W: D CloseHandle(hFile);# ]- n: q9 X" z9 u# T
return TRUE;
- L$ ~$ E0 }0 _4 K) G8 h }& Q7 O( `, w3 V+ K) r6 ?
return FALSE;
0 |( c. z# k0 w6 F, S9 y8 A}9 N+ f( d6 z, ?% x u
$ |1 b! z4 J9 LAlthough this trick calls the CreateFileA function, don't even expect to be( o9 \6 _0 ?1 M y1 q3 {8 T
able to intercept it by installing a IFS hook: it will not work, no way!
& v1 O8 v# b9 F8 jIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 f {1 H# ~. P wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" O+ Y3 A& K# l6 U& Qand then browse the DDB list until it find the VxD and its DDB_Control_Proc8 _' D4 y! g% C$ C7 n5 G
field.
& @7 M& M# V4 k" p% S) VIn fact, its purpose is not to load/unload VxDs but only to send a " F L; g4 w5 x4 T4 w# l; B5 k9 w
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
" M* B& V' }8 Y$ Xto the VxD Control_Dispatch proc (how the hell a shareware soft could try2 v6 } t8 x( T, c7 ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 n/ X' @) F' ^& C1 z$ dIf the VxD is loaded, it will always clear eax and the Carry flag to allow6 {; \+ q/ O& s7 q
its handle to be opened and then, will be detected.
& K: j7 B) s+ T1 M( jYou can check that simply by hooking Winice.exe control proc entry point( A$ \( C6 K+ D; `; ]
while running MeltICE.
, \ q: }) q9 y5 U, ?) e/ j
6 M, ^) P3 b7 F3 g* [
+ ^& j, x) G) u6 ] 00401067: push 00402025 ; \\.\SICE- z; l/ x. @0 a5 ~8 H2 s
0040106C: call CreateFileA2 A6 E- h6 |8 ?9 _
00401071: cmp eax,-001
! s/ k/ O* y" [ N 00401074: je 00401091
! v) ~1 S9 m" [: `* |, b
! E, d0 D( @) {0 N6 T
1 S F, S5 x2 e8 A! ]# VThere could be hundreds of BPX you could use to detect this trick.+ T' ~6 s$ ?) n8 |: j3 L
-The most classical one is:
$ h! m y9 {# O( g* I! D BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||! u* d" U# M. m
*(esp->4+4)=='NTIC'
8 F% O. c5 D% `- @8 ~& g8 l% h2 _3 I# `% f
-The most exotic ones (could be very slooooow :-(
% O7 u0 `/ ~( v; i BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
; ?# ]2 P* h" E3 p* C( J ;will break 3 times :-(& H6 [# I1 l# o/ f
' D5 @: F7 S0 }6 m. A5 U/ m-or (a bit) faster: 9 f0 T% k8 ?" Q5 e1 y
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 n" Y0 D& m z9 k0 C
1 x! z; v' G3 s4 f Z$ u4 ? BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% K( @3 M j0 w ;will break 3 times :-(2 K" V- s1 {/ U% s7 g
2 S% m7 v$ q" g0 C. W8 p-Much faster:$ Q4 U0 N- I! E+ l' Z6 O
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* w( j4 H+ ]: A4 r" v! x; R! x0 K
" i( l' y9 G( Z8 {; xNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 Q7 g. s5 P+ e9 afunction to do the same job:2 }4 z9 J9 N2 ?
/ E6 f, m6 r2 }( v7 Z push 00 ; OF_READ+ Y" w: L: X7 |6 A# g$ U$ P
mov eax,[00656634] ; '\\.\SICE',02 z: e* n5 H* d% [: k6 }' m
push eax
& y: `2 g9 f: g& y6 f4 k call KERNEL32!_lopen
4 q9 k9 P l) K) s8 f w( q inc eax- @5 Q' ]3 i: |4 [
jnz 00650589 ; detected
- F% l; b# ~# W1 c. D) \ push 00 ; OF_READ
2 N# `6 V( w* Q0 u mov eax,[00656638] ; '\\.\SICE'$ `+ \2 Q' f8 N0 a$ _! J9 I
push eax9 G& b; n- m/ |
call KERNEL32!_lopen' E' t; O" c/ _7 K/ Z
inc eax
8 I% D+ C& D/ \% o/ b; a jz 006505ae ; not detected
. ^0 U1 T0 f1 g* @: U2 ^) w4 w$ W2 R1 f: G R
! o# T. w0 _1 t. [- I5 B$ k
__________________________________________________________________________* @: G- U+ m# O- K! r) T" u8 U
% c9 x/ B- `6 V/ i6 {3 C
Method 12
6 f6 j4 g( b3 k=========* b! X" u/ b% \. S( S
" p+ \0 ?; E2 |
This trick is similar to int41h/4fh Debugger installation check (code 05" c" M+ v9 i, i& [
& 06) but very limited because it's only available for Win95/98 (not NT), Y- k4 A' e0 A. j! i' _
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 `% x [, X# x' L4 L: J
3 E- K3 C& M' u
push 0000004fh ; function 4fh' l! w {7 D* Q! I4 [. K" N7 `
push 002a002ah ; high word specifies which VxD (VWIN32)
' Q# d |$ H" M+ n+ S+ S% E( I5 r ; low word specifies which service
/ Z z6 J M- ?# w7 Y (VWIN32_Int41Dispatch)
: e* M, q W5 @$ I: m call Kernel32!ORD_001 ; VxdCall y, ~! Z/ e$ l' ~, {& b0 X
cmp ax, 0f386h ; magic number returned by system debuggers
6 Y0 I, ^& [% n6 A- P jz SoftICE_detected) H1 |, D5 f: l6 x* h8 D5 P
, A* n3 w% W) l6 h; zHere again, several ways to detect it:2 U3 z" w( ^9 A7 k" n. V9 Y
: f( y% R, r2 H7 l+ V( O h BPINT 41 if ax==4f
" y" k" k1 v. ?5 O l2 ^ G7 z. p3 J: w- Z* x
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
k0 N& }2 B3 O( r
3 }3 P2 c J |) } BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A2 j' _; q3 o$ r) T& \
7 R* ?/ \0 |4 A2 t BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) l% K$ }1 q9 N9 k7 k, O, G
' Z* }& V3 d& B( h5 P H; c9 x" J__________________________________________________________________________1 B. z7 B2 O' f
8 A2 d% F2 t2 P# {5 X
Method 13
- U! _+ b! e4 u1 K0 ^8 h! N) H V=========
5 ]9 W. l4 u, x5 s% U; r |" [, f' I1 x- C0 ^" o2 g0 ?# V* o7 m
Not a real method of detection, but a good way to know if SoftICE is+ L# A) \0 U) l$ y0 w
installed on a computer and to locate its installation directory.4 ]+ [6 F% i4 Y5 |7 |( i$ ^
It is used by few softs which access the following registry keys (usually #2) :
! j" E5 I# } {( ?8 A# c9 H; }( V S8 M; A9 F
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 D9 O1 `" Q7 o+ \: d2 J\Uninstall\SoftICE
: h% C& y3 ~; F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" E6 {! [' A7 |4 a3 N-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" g+ `- J! @+ [, D5 c$ G$ `
\App Paths\Loader32.Exe
' ` ^+ V+ [4 n: T A; `/ J6 t' l6 h. x
" I: K" H3 z5 K T) SNote that some nasty apps could then erase all files from SoftICE directory6 Y i% I& ^% Q. t* x6 L" {: g
(I faced that once :-(1 V) I; k8 }& X2 A7 Y/ r# y% V
e- N/ P0 {5 C/ Z- r5 {) qUseful breakpoint to detect it:
: \2 m' D* o' f8 z3 r* L# F9 O# K2 ~9 K, r; ]* G% R
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. I* H4 m9 W7 c% y/ d% m
- n& a! Y% m9 b9 V- t) A# I__________________________________________________________________________
% ~2 P* w1 J: L+ \
( z+ H$ r# p$ d" S; P+ d5 i1 B. P L+ T/ ]4 @1 V. l
Method 14
- @ K$ [' N- }=========
w2 i6 i1 V) o5 {; Y! ~
- f2 |; q K4 Z$ h, m. a/ yA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- b# \" g2 s" V; `$ nis to determines whether a debugger is running on your system (ring0 only).0 V" T1 N5 Z+ a' S
; y3 W" n- X0 i+ N, v7 a) G
VMMCall Test_Debug_Installed
* ?1 |% c D! t/ u je not_installed
! u# x) ]; Q/ r4 ^ ]
$ z% J5 J8 R9 f8 ZThis service just checks a flag.! u' k+ g0 i. v- S2 G2 u
</PRE></TD></TR></TBODY></TABLE> |