<TABLE width=500>
h) j. g, e; b7 p* i<TBODY>
5 u8 j; W! ?% b1 W<TR>
: W1 y3 @0 n3 I2 X$ \% V j; h0 h<TD><PRE>Method 01 2 t; _/ U; k0 x
=========
5 k: q' G# H" q: H" \; c& v0 r( {* _, f: A
This method of detection of SoftICE (as well as the following one) is
9 f; U0 P' x9 ` mused by the majority of packers/encryptors found on Internet.+ w# J. l& S) b
It seeks the signature of BoundsChecker in SoftICE
- M& }8 u+ l; t, i5 s1 e5 R9 q) A" ]/ P: N2 ^) @! e. H
mov ebp, 04243484Bh ; 'BCHK'3 Q7 U$ r7 s; J- k/ I& O
mov ax, 04h
& @/ U, y' {/ n5 b int 3
3 n- d& o4 z( {- a7 {8 x cmp al,4+ @; D$ E% L/ g# D7 b, C
jnz SoftICE_Detected/ I) R0 E, p# l0 G+ p- Y
/ @* k& p6 _; i5 ?6 m( v) [) D/ C: A' D& _" \___________________________________________________________________________" U" J% M1 |" i5 \ T
3 m6 d4 o A/ l' d8 i" E
Method 020 P( `: _% S9 ]
=========
5 i; d3 W; ~8 j+ }1 ?2 y, I2 P f8 ?0 q
Still a method very much used (perhaps the most frequent one). It is used
! g) A# n% |9 Y ^) \9 {3 I: nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,% c# q2 u( s! Q8 N# v
or execute SoftICE commands...
3 b7 P z7 I2 u, `0 e6 HIt is also used to crash SoftICE and to force it to execute any commands" v3 D: U7 d ?
(HBOOT...) :-((
; \( J) _# i# V) V* J7 N$ ]
" V9 u/ a% n9 E; P* v+ hHere is a quick description:7 Z( E1 U/ F3 T4 J: w0 X0 g
-AX = 0910h (Display string in SIce windows)
- m8 ]: S& R5 ]" q7 C- J-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( R$ B2 X/ s# B9 u; S9 m) t
-AX = 0912h (Get breakpoint infos)! w3 _4 o) s* |7 p, p3 T
-AX = 0913h (Set Sice breakpoints)# b9 w/ R# t' |) P0 V
-AX = 0914h (Remove SIce breakoints)+ p9 X4 I7 q/ K- {1 o8 M" @% @; [- _
) B. Y4 P5 r S. b$ g9 K: d1 tEach time you'll meet this trick, you'll see:
) w2 A/ Q: ?- t6 n( l* A-SI = 4647h8 X' W! T/ ?. G. P
-DI = 4A4Dh2 w, w0 t9 P$ j$ s
Which are the 'magic values' used by SoftIce.& u, O& m' p0 s# v. r3 Y4 k5 o
For more informations, see "Ralf Brown Interrupt list" chapter int 03h., \* L3 `/ _7 l$ C$ w
% ]; W0 J' I B! m
Here is one example from the file "Haspinst.exe" which is the dongle HASP" n: Z( s) T& ~& ?0 i3 }
Envelope utility use to protect DOS applications:
4 u* q+ Y- h I# {3 D P3 M1 P' D
/ l( w: e' Q7 V/ C0 ]9 c8 e' e- U( B C3 [# L' q
4C19:0095 MOV AX,0911 ; execute command.
1 N' y* R Y7 L. J4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* ~; J$ o. K3 D4C19:009A MOV SI,4647 ; 1st magic value.0 m9 p! O/ x. Y* X2 P3 [: z
4C19:009D MOV DI,4A4D ; 2nd magic value.
. L7 G7 x# C, y7 O0 j) k4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*) l, G' @* T( s( T2 v
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ E6 N. {; t: S3 N3 q
4C19:00A4 INC CX
( ^6 E4 b o( R1 {. |4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
) I3 A2 W; v& O4C19:00A8 JB 0095 ; 6 different commands.& w5 W. F0 M7 V* W
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
2 Z8 }9 }' x$ h% m, D }: S4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ V2 ^0 I: X- d9 ?& [/ R" l. J6 g1 Z4 M8 p* R* ~0 S
The program will execute 6 different SIce commands located at ds:dx, which
. B) Z7 \; K* ]7 xare: LDT, IDT, GDT, TSS, RS, and ...HBOOT., k& |' o" E$ G" T, g
$ b% d/ g# _0 w+ d4 L% M* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% g2 m% B: a4 R1 S
___________________________________________________________________________
( `) W, |, B, Q" r1 o
" O& `9 ?9 k' }5 T# [7 q* a; e2 w* D. a( `8 g
Method 03
3 r& K0 t) [. I=========
+ [1 B8 A i# M m. a* B) e/ b8 L
) X7 J( k0 V$ t1 q, m/ hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. ~2 t+ L, b2 D8 E. \5 Z8 a
(API Get entry point)
8 C- ?, k3 m/ a1 L, J $ l' I, d% Q& Q% V8 N( g0 Q
8 C8 R9 ?' q! U( B r
xor di,di
2 U' K6 ?9 q; N mov es,di
- x9 V& T. d6 N" T- y mov ax, 1684h & }; k* J3 n9 N* }
mov bx, 0202h ; VxD ID of winice
" P# ]! t6 s2 P% X6 j int 2Fh+ O$ `2 U0 |, U1 k8 W' B/ c S
mov ax, es ; ES:DI -> VxD API entry point
2 Z# F$ u- g& _5 q' q6 D4 A) i add ax, di
3 H/ z. f& H8 W7 u, p% D test ax,ax+ M1 X4 c: Y2 ?9 ?9 b7 b; r$ ?
jnz SoftICE_Detected" n# u- Q5 E9 b* K, i5 G+ G8 O2 G
# a6 k5 [8 F8 D___________________________________________________________________________' }1 G1 u3 ^: J: t* U' ^
" k: Z" [3 b+ n' P; }
Method 049 _* A- m% V0 T, m! g" O9 J9 q) u
=========
D' b Z) I# {# s' L# c# [8 a1 X8 Q8 R! K4 n' M" o/ K
Method identical to the preceding one except that it seeks the ID of SoftICE
D( j4 M/ q$ p: p1 j( |GFX VxD.5 E8 h2 d; _- W! {. C# ~. W! D
0 @% W: a9 F: |4 J$ U xor di,di- c. H" d2 [0 _* } `
mov es,di4 F1 }9 l3 P u; p, [5 ?! V' e2 o' X) W
mov ax, 1684h " v% Y* U1 R) v) W4 ^& c4 z/ i
mov bx, 7a5Fh ; VxD ID of SIWVID
4 i- f! W0 }, \. U4 N4 ~ int 2fh
`) P ?: [- Z) k mov ax, es ; ES:DI -> VxD API entry point& H" d- K; S" O7 q4 j; y
add ax, di
. I) o7 ^/ V% x1 X+ y3 ]% q test ax,ax
9 i$ w9 b& q* a5 s9 C8 x% X jnz SoftICE_Detected$ h4 t+ T! m: B4 e
c7 T# Y( I) h3 }! L; B__________________________________________________________________________, Y1 p5 o6 n2 U* u' h5 g- E7 k
2 g9 ~$ x' g3 F7 F. M
; R) u+ o b% h; IMethod 05
v0 b; j5 l( G" ~=========
$ `& U* {; l+ Q: y; Q! Z) m8 m) l6 \/ p% {4 }6 I1 O, X$ d5 Z
Method seeking the 'magic number' 0F386h returned (in ax) by all system
' ~- g7 l- q3 M# Jdebugger. It calls the int 41h, function 4Fh.2 _ M/ e9 Y9 R1 p
There are several alternatives.
$ w/ M6 j( A3 O; E6 L, c9 o
. E+ G! g0 R/ ?( G4 EThe following one is the simplest:
0 q' H+ v" E1 q% O4 j+ l7 s
5 i) ~4 z& X1 I2 t/ {, t& Q1 Y7 y0 ~ mov ax,4fh
, S5 m! ?& X! j4 s+ }( u+ h int 41h
+ ?3 r, S! t+ B9 n! F/ A cmp ax, 0F3865 u" ^0 ?8 d1 T! U
jz SoftICE_detected
1 `' P. {% Y% r( K& Q3 _# y$ g o- z7 N; n
! @1 i9 Y' C) s) K/ g0 ]% R% X. GNext method as well as the following one are 2 examples from Stone's 0 R! l5 E; {% P6 j" q& j1 Z- u
"stn-wid.zip" (www.cracking.net):6 N4 @- a: [5 b3 |5 `! A" R
# J' Z+ A; D+ Z9 Z6 j; L# c' `, S
mov bx, cs ]1 ]- m) j9 v! x, \1 r
lea dx, int41handler2, _4 k6 |1 z- U1 s+ F
xchg dx, es:[41h*4]) @) z# c1 [9 _0 z6 N! _3 U
xchg bx, es:[41h*4+2], E$ I7 L& y+ G+ z% ^
mov ax,4fh
( Q" r2 Q' a6 F: C int 41h
2 G9 \9 X7 I& _* W$ n xchg dx, es:[41h*4]4 r4 _& O5 k x: Y, @
xchg bx, es:[41h*4+2]
r, Y' S& Q) C0 J6 r" d. J cmp ax, 0f386h. ~1 [& ?" x/ `& k
jz SoftICE_detected
* h- S* S7 b- V, a$ V0 ~3 B1 j) [) ^; h. s4 O& R" J2 s
int41handler2 PROC
# G. s# C6 H1 D# D8 h iret4 o9 h* k. a6 ]9 _; b4 M2 [7 B
int41handler2 ENDP
; D& E' g1 A6 g9 W- r1 o! t, o- _$ Q
/ f: D" ]- b) q" k4 ^/ w" f_________________________________________________________________________# J$ K" |1 h2 _; W+ Z. Y: g" b3 ~
o' \& f# c) ~' a: t9 \
1 P: B: _/ G5 x; W, Y! r
Method 06. E, Q, e; G7 v$ ]8 j# m# V
=========
0 |: i# m# |) S& Q7 F: s
6 L# ^$ n% z$ A. A% h8 G
J9 o8 c k9 ]6 e2nd method similar to the preceding one but more difficult to detect:7 m/ B* E' [/ P$ Y
1 z, d; b- j2 q6 n' f& q2 W8 U" u
: F5 W: |) p5 l1 O5 S+ Z/ aint41handler PROC
# u0 ^2 Y' P7 p mov cl,al
& q4 [! J. I) Z$ Z iret, o* S. x& j# J) I: J, T
int41handler ENDP
+ T4 u, W# E# H a. ]. f& \: D( G0 B$ ^( A a; a
: j1 M5 P3 O7 J8 p. |9 [
xor ax,ax. q1 M* U- n( c6 B3 h
mov es,ax
! K6 p+ Q, T' _. w7 H: ^# V% N, t mov bx, cs8 T) H1 u" N8 y
lea dx, int41handler
, e0 V2 W M2 R+ r- y5 s) j' s xchg dx, es:[41h*4]$ J/ T) i0 e9 U% s; L
xchg bx, es:[41h*4+2]
% U& w7 N. h5 N4 q- Q in al, 40h
4 ^4 _- I1 [& G2 g w0 ~: g xor cx,cx
6 _& ?5 o4 Q3 g) B int 41h
9 u2 e% Q* A/ J xchg dx, es:[41h*4]
' M* G' N% u: o @2 J xchg bx, es:[41h*4+2]: v( P' L' A7 u
cmp cl,al
7 `$ W7 r0 I7 M3 T( ^. z; ~ jnz SoftICE_detected, S4 T) k1 _. ?8 z' E- W
$ c9 t7 Y1 {) K
_________________________________________________________________________
6 [( m' K2 e2 _7 y( I: L7 r& y/ P9 g A6 A: {/ ^) {" T. R
Method 075 A& n8 Z! T7 Y( ^9 l! P; d9 g
=========/ B" ^0 P: W5 P9 P, ?* |9 ~
' r' y" q7 b; V9 ]; v* [- jMethod of detection of the WinICE handler in the int68h (V86)4 \: q. ]1 ?; f
0 {/ b G: H3 Q! a' ]6 U mov ah,43h
- A3 g: v6 I2 J; q int 68h
K8 X/ K4 y' C# i cmp ax,0F386h- @9 O1 h- \2 E
jz SoftICE_Detected: X4 W$ @+ ~# W2 a0 N m
9 }! Q# I8 u2 Q8 \* y- l
6 O4 X+ ]/ f" b/ |+ T9 s* o=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! r+ v- q b; C. [ app like this:
% x K& Z7 [) R3 R' J1 A% r. H3 }$ J: l) T) _
BPX exec_int if ax==68
e- y6 d7 N. l$ ?. N( N4 F% K4 i5 H (function called is located at byte ptr [ebp+1Dh] and client eip is( L7 P9 X/ _' R5 ^% T% G3 X
located at [ebp+48h] for 32Bit apps) y. V$ Q/ d; R8 u
__________________________________________________________________________
( y: Y4 W9 Y' c# r4 U. G& A- L5 I
8 P, b* n3 t$ M. F
- @7 {: u# Y* ~! ^Method 08; d0 F5 o& H/ `; y0 a7 S
=========: P5 Y' N$ x0 T' N8 r( b- R
2 ~4 l2 B3 `) J( \/ z0 b: L8 d
It is not a method of detection of SoftICE but a possibility to crash the
+ H8 O& x" f1 zsystem by intercepting int 01h and int 03h and redirecting them to another
. R9 N8 e" L" P3 J; {& Croutine.
9 f- n$ c7 o; g2 ?6 H1 E6 GIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( D& B" i( s" D9 a9 ?( e0 R* |to the new routine to execute (hangs computer...)" W' \" U, x) z) ]& e- e
H- _/ f; ]: G% W' x- i mov ah, 25h+ r' O2 z# n& c- r
mov al, Int_Number (01h or 03h)+ J, n1 r9 C ?6 a6 M0 k2 _+ ?
mov dx, offset New_Int_Routine0 ]7 Z1 d, k, E; C T
int 21h
% Y" Q, E6 ? t( T3 D, O/ B# Z
) a6 y t: `0 k1 {% V: t__________________________________________________________________________
6 s9 B% q. `+ h/ m" P h. o E1 D# ^" E, y" n
Method 09; h/ E+ B% T% W2 k, R/ }
=========
! l, ]& M. _6 F5 A" \
% w+ _+ S) V; W+ z% Q* ZThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only; C' }* B7 `8 j
performed in ring0 (VxD or a ring3 app using the VxdCall).
) [9 ` Z3 b, q- F1 v$ dThe Get_DDB service is used to determine whether or not a VxD is installed
) F# F5 L& X! o5 H2 M) n/ F" Wfor the specified device and returns a Device Description Block (in ecx) for& Y* {! x# \ e3 y& \; W Z5 [
that device if it is installed.& B" \" W: E5 Q* Y# m+ N$ C
! c$ _0 T: S k# J# i9 v
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 C& m+ q* u: e1 x! u
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& J& y* X" E, h; N, r
VMMCall Get_DDB# U) c! X$ O; ~7 D
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
L; v" H/ e$ W7 p, g1 y' l( ~$ h: k
Note as well that you can easily detect this method with SoftICE:$ s* G# w# Q) }9 t
bpx Get_DDB if ax==0202 || ax==7a5fh
/ N) G( S% F% Y! _. y4 E; X& ^
7 f: Q, l9 W6 I) x7 \% U t__________________________________________________________________________
3 B9 v z V6 _ L0 h" B% s: L5 d. K6 ^4 ~
Method 10
2 ~+ h% c; w8 Y* q=========7 j) q) e5 w% ?7 n4 |
4 s Q0 t$ B: @+ x=>Disable or clear breakpoints before using this feature. DO NOT trace with
0 H' J, A6 P9 K1 @% L SoftICE while the option is enable!!
8 [6 k- | _# Y; e: \
G2 ^ } g0 ]- HThis trick is very efficient:9 K/ }( K3 M( v. P6 C, w
by checking the Debug Registers, you can detect if SoftICE is loaded. x; m2 C, s+ n8 x
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 A6 H/ @6 \+ G1 X& f
there are some memory breakpoints set (dr0 to dr3) simply by reading their1 l n1 B8 T! c% c
value (in ring0 only). Values can be manipulated and or changed as well; e. T6 X( x7 K* E+ b
(clearing BPMs for instance)
5 @+ M c4 l" g. R6 S. Q! H
+ w0 ]* Z. M2 s0 H__________________________________________________________________________) k+ g: ]% h$ \4 E0 ?
" R2 |! e% H6 H e& H! l" s2 f$ x
Method 11
: Y& U% @! v' n7 G: S=========
0 P5 o- `+ M4 [9 p* N( r
& z* P6 Y/ d R! M! _, S6 wThis method is most known as 'MeltICE' because it has been freely distributed4 W* y: i# g/ E5 h7 a
via www.winfiles.com. However it was first used by NuMega people to allow
0 ^6 R& V! Y; c q- g* U4 Q7 oSymbol Loader to check if SoftICE was active or not (the code is located. K0 D0 J. L* Q1 {6 I
inside nmtrans.dll)., d$ {* q5 g5 {7 f
3 I+ ]; z& r+ N" G
The way it works is very simple:. f( q. c: H5 ?; R! [5 y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" l- J* Y1 P E: L$ x7 c
WinNT) with the CreateFileA API.
( e/ n9 h" W: j$ S$ x2 w, s( w
Here is a sample (checking for 'SICE'):
7 U# \0 A* G$ J* U* b# `
. }) L# Q3 |( @3 H2 h J2 S- b6 wBOOL IsSoftIce95Loaded()
. e! J! F U+ Z" C{) F' \' G& ~% |
HANDLE hFile;
6 Q3 x1 n7 D% c hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 I0 H5 z9 l; a* ]1 U. ^* F FILE_SHARE_READ | FILE_SHARE_WRITE,' f+ ^2 H3 B8 r, @5 V% n/ D
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ ^/ k- ^' W, w- }+ j/ x if( hFile != INVALID_HANDLE_VALUE )' U9 x" u; J4 v- b4 f. `6 V
{
4 i' v+ O! y* J7 n; \/ V CloseHandle(hFile);0 ^# n1 n+ p2 g6 K
return TRUE;/ [ k$ c5 f# ~1 Y, H) a' _' V
}
/ O9 m1 P. s/ p" b# S return FALSE;
0 u& x6 _% }8 X2 G1 D9 i! W, s}
- h+ j, {1 n6 c, Z" `5 w9 w1 j
" {: c! m4 q; h: V6 \5 KAlthough this trick calls the CreateFileA function, don't even expect to be( o" v2 f3 S% j; p2 I( B4 t
able to intercept it by installing a IFS hook: it will not work, no way! @) e7 e4 s9 `, Z! C& _
In fact, after the call to CreateFileA it will get through VWIN32 0x001F& y9 @# B+ o6 F: n& {) |/ ]
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, L! S. T* g7 _: J1 W7 xand then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 V# f7 [+ E( I% [: n, Dfield.$ H6 l, B% Q0 }+ ^: u
In fact, its purpose is not to load/unload VxDs but only to send a : k3 o1 ?2 N' v8 c, l
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
V9 ~$ e1 Z8 _+ F$ H5 p: H4 Pto the VxD Control_Dispatch proc (how the hell a shareware soft could try+ ~2 }# z2 d5 Y0 R7 m; N* P5 M
to load/unload a non-dynamically loadable driver such as SoftICE ;-).. [/ z6 K) ?* n
If the VxD is loaded, it will always clear eax and the Carry flag to allow
! P9 d" l# }/ k( S* T/ v/ vits handle to be opened and then, will be detected.
: E/ h! }# ]+ F" e. A/ cYou can check that simply by hooking Winice.exe control proc entry point9 d( t; S9 A" F+ G9 P
while running MeltICE.) X+ ?8 | p* U/ X4 O
, s+ ^$ ?$ ~8 ~7 Z/ d2 f
& u, b; X' `6 c5 s2 ?; F& a 00401067: push 00402025 ; \\.\SICE
( Q; E5 A, J0 q1 ^# X7 M* F 0040106C: call CreateFileA
8 s/ P7 [6 |" j' G 00401071: cmp eax,-001
+ w8 d4 u% @" V! v* G6 |& h 00401074: je 00401091
7 @. U+ ]0 U( y
" N+ @( W z( o# s% c, w$ p7 @ l7 V' T4 P, Z \4 J
There could be hundreds of BPX you could use to detect this trick.
. \4 Y7 {# e. {5 w! S X' U, k-The most classical one is:& W1 z# r/ ~$ e$ e0 Z( Z
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||7 H& @8 o/ K. ^
*(esp->4+4)=='NTIC'
, n: ~+ f- k4 I
" O4 r0 W8 t/ k, F% G# \& V/ s-The most exotic ones (could be very slooooow :-(
8 g& C1 t2 y/ V BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: ?! \. b5 ?% U+ S9 m& f1 b9 k/ ? ;will break 3 times :-(
. N% [7 b0 f, [3 V2 M; ]/ [8 x2 c) W" G+ }" D3 R' i
-or (a bit) faster:
% {+ D/ h4 X1 x6 f- A BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 f. o* n" R8 E; R3 I- G
3 e2 W, V) v* F& @ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
9 v1 T3 }& s! X: U+ ~/ t ;will break 3 times :-(# Q5 K; c; c7 Z: D
9 \" s% g- U0 K; _
-Much faster:& w" k; l6 W3 A- \. f+ D
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'+ N% O1 u7 T- g e
8 U5 g# X0 P+ f$ o3 R9 r
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 c! X0 m/ N0 A) `% Q: q W
function to do the same job:) [: _& |% P" ?( w8 R: n' A u
+ X5 \5 b% x0 c& Y' a6 ]- X8 ^& j( s
push 00 ; OF_READ! D* x* H/ W x; M' M; \
mov eax,[00656634] ; '\\.\SICE',0# `& k, @. J# v' X
push eax, S7 z3 V# R* G9 I7 z% s
call KERNEL32!_lopen
@. j8 p7 ]4 n: `" h- [) j inc eax
+ j- }0 s! c% X jnz 00650589 ; detected6 X6 Y$ ]& s4 n9 q7 A
push 00 ; OF_READ2 S( q- S$ K! u$ {
mov eax,[00656638] ; '\\.\SICE'
. Y4 i% s: D/ Q push eax4 i- L: i6 O: g
call KERNEL32!_lopen
# l% v% y" ]$ e4 Z4 }& b" {5 z5 D# ? inc eax# d# V4 }+ g6 F
jz 006505ae ; not detected1 j: [+ o9 ?) L7 }- @8 {+ v0 A
& q6 ^/ X3 S( n0 t/ x, `/ h
/ X- G6 @# r( V
__________________________________________________________________________
# }, Z8 E/ |( j5 v% c- k6 t, l$ Y7 r8 b3 N/ r9 R. |4 q1 m2 Y$ R
Method 12/ B9 }# g6 P g3 c* ?5 h
=========, P( B% \$ R2 D0 E r
: q( [5 y! D4 p0 \# o
This trick is similar to int41h/4fh Debugger installation check (code 05
. A9 B% c, j; Y: m& 06) but very limited because it's only available for Win95/98 (not NT)
) h5 {" F7 ?% Z$ P; Uas it uses the VxDCall backdoor. This detection was found in Bleem Demo.; S8 F) [; v8 l
4 f7 e/ W8 j1 b" j" w! h( J$ r" @
push 0000004fh ; function 4fh
) E$ w9 F) X( } P push 002a002ah ; high word specifies which VxD (VWIN32)
" _ x. \+ F' X6 W* [ ; low word specifies which service
: z2 S4 D& u7 E7 | g" J7 V (VWIN32_Int41Dispatch)
$ ]5 A- W% }' l% I call Kernel32!ORD_001 ; VxdCall
5 i/ m5 @3 G! A+ z! Q cmp ax, 0f386h ; magic number returned by system debuggers
/ T4 o. s8 ^8 R3 u" Q jz SoftICE_detected1 p! w* U* J$ b# r, H* Z
# `! M, M; F( \" d+ o+ K
Here again, several ways to detect it:
6 _# u( m& S4 s/ T
# \& i: h7 i/ m+ j3 v& s* l; o BPINT 41 if ax==4f
) E" X6 d! E: U# J8 Q3 a
( A I# H; B: ?" D' c# D+ Q6 r BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
1 C5 G/ R w; |; o* Y$ `2 B/ l5 ?4 M
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A7 ?5 J* U0 ^( S; u* l. G" D% h9 O
- ]: b2 M0 ]% H
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
" Y8 F6 L0 l4 Q/ q) L9 S- I* P6 V" E
__________________________________________________________________________! }( F4 c$ w, i( o' n4 J
, f; y/ B/ f% c# `
Method 13
& N* K" Y# D: Y' b$ q1 y+ `=========8 u! S5 F" C/ ^( S
# f. K: i* q% cNot a real method of detection, but a good way to know if SoftICE is
/ n$ k8 x Y* b( Kinstalled on a computer and to locate its installation directory.
: a# o0 V) X/ v* C5 |: r: ZIt is used by few softs which access the following registry keys (usually #2) :' C: c( r2 E& A O8 L2 |
j. c% ^( ?% X& T* B3 X0 u
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, z8 m" _* F) x
\Uninstall\SoftICE. }( [5 l: K. a/ U2 [
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" M9 C# q0 V' a: {- }1 |-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' Z6 _7 M5 ?9 W2 a. n# G\App Paths\Loader32.Exe
' G9 N/ `+ [" {) o9 u
7 S: n% ~4 q: |9 y! ^4 m8 l3 |$ _" y7 \, ~, J' g' ?8 H0 u1 A
Note that some nasty apps could then erase all files from SoftICE directory
5 R Y I" \2 y& |: z% B(I faced that once :-(* X; T6 E) p: V' S! U
6 o6 K9 l: f2 `; c' gUseful breakpoint to detect it:
( O' k( j5 Z, K( c' n# S9 \5 S6 R7 {# e6 W9 y. d
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 W8 l) e# V! V' a2 @9 f# j( _
; I' i1 m$ s) N6 R__________________________________________________________________________
; e n8 h3 M; u/ U* [$ i2 v9 j
! |2 Y6 l# P2 x1 o4 i9 v6 w# o# n* Q# P0 Z; E2 e* d- f G
Method 14
5 Y& @; C9 g0 q=========
( p1 t0 \1 k/ w; H! ]% t
) ~- J+ z$ a5 o+ r. f2 tA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 K7 ^8 ]1 Y/ O( ?
is to determines whether a debugger is running on your system (ring0 only).9 J- A% t* s4 x6 M3 g% k+ t" o
* b' u' X0 Q4 n5 X$ D
VMMCall Test_Debug_Installed
; o F' h- e3 A6 L je not_installed
, r6 J$ i7 b8 } Y* a+ L T
2 @& F/ v$ ]4 c" IThis service just checks a flag.: B: {% P/ i$ l" X& f" V' g: O( u
</PRE></TD></TR></TBODY></TABLE> |