<TABLE width=500>6 |, a$ F. \5 y; Z
<TBODY>
. w" W3 F" g: m9 u- _<TR>
( {( u _; l. Z% F<TD><PRE>Method 01
! }/ b7 I. G( I4 {; o* k=========, a t# M% {0 }8 o$ t# }; K
% e7 J& ?: [( _8 IThis method of detection of SoftICE (as well as the following one) is3 k; V2 I9 x. O
used by the majority of packers/encryptors found on Internet.
& b2 j8 ], f6 o! d3 YIt seeks the signature of BoundsChecker in SoftICE, I1 O9 ?9 c9 h) ` R, n$ b$ u8 `. i$ T
! Y- {9 V3 Z/ K8 x+ R mov ebp, 04243484Bh ; 'BCHK'1 o) A' Z, N; [1 K7 R* D
mov ax, 04h
6 [& K4 e I7 ]) T; V) l int 3
+ J& ]$ p/ k/ e- U cmp al,44 e+ R! ^3 m( E I
jnz SoftICE_Detected
' H5 `4 K& ?6 |' _
5 H$ O; a: l' y( I% N2 j1 C___________________________________________________________________________
$ C" ^7 T$ A4 [ e# B; D* i7 E
- v2 P5 h1 R* t8 L1 r) NMethod 02 X, g& s; G4 s! H1 e- m
=========( |3 |/ G Q O; w( E/ F
" f9 w9 S. [) ^$ V) I% c ]Still a method very much used (perhaps the most frequent one). It is used1 J7 u- K% R* q7 _
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
8 j, o+ ]( v: j8 R7 e1 N4 a' hor execute SoftICE commands...6 D3 X i6 q. y' ~) W B
It is also used to crash SoftICE and to force it to execute any commands+ u0 Q4 z* s: D0 p
(HBOOT...) :-(( " x7 P U" Z+ e) u f9 j l
?4 @$ v& v$ U* a. qHere is a quick description:
2 y0 ^$ b" C8 i2 y! C, t-AX = 0910h (Display string in SIce windows)
5 {: r8 j% F/ T% }-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
7 A0 d3 F7 \8 N6 w6 w) k( t& |& y-AX = 0912h (Get breakpoint infos)
8 D% U$ k) Q% n; T" l-AX = 0913h (Set Sice breakpoints)4 @" a1 i- N, y4 N- `
-AX = 0914h (Remove SIce breakoints)
# |/ k g; S/ F# s% J
7 H5 l/ r% H+ d# fEach time you'll meet this trick, you'll see:
" `9 u2 V9 j$ I; N-SI = 4647h
1 ?( P& U! s8 f-DI = 4A4Dh
5 {/ g2 p. X8 a1 L5 u, ?, i; W4 qWhich are the 'magic values' used by SoftIce.
- J; ]- {* S$ @6 \ D( i0 PFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.) b; R$ t/ D8 i; Y$ ^
* g: U3 h1 [8 f$ o( E- S/ U
Here is one example from the file "Haspinst.exe" which is the dongle HASP
+ a+ E# d$ Z: LEnvelope utility use to protect DOS applications:- s9 {- p' S) d' |! M' n
8 j8 ?% A' i0 p+ s. X' p% c4 o8 G
$ @. k& x7 r+ p5 ~- V; f
4C19:0095 MOV AX,0911 ; execute command.3 S0 z2 D: h! Z+ F- h
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).- w* n. E7 ~$ v; R% h0 o
4C19:009A MOV SI,4647 ; 1st magic value.' u' k4 f6 f# _+ ~; {1 N
4C19:009D MOV DI,4A4D ; 2nd magic value.6 Y$ ?( E3 Q6 r
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; f0 l# a: ?1 c/ O) R4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute v% O$ _: {7 P5 L8 W7 z3 U
4C19:00A4 INC CX
3 F0 \! A) w% o1 |9 \4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. E1 Z. I/ s' A/ F5 w1 G4 C% @; _9 U4C19:00A8 JB 0095 ; 6 different commands.
2 r/ W. ?( X" A& n& m8 s' J; {4C19:00AA JMP 0002 ; Bad_Guy jmp back.
- a) {, [8 y0 R) y) R; B. [, s7 O; L4C19:00AD MOV BX,SP ; Good_Guy go ahead :)! ]! `1 S3 p+ ?# {4 o# w
8 u8 a/ I, h" o! O6 s
The program will execute 6 different SIce commands located at ds:dx, which: x; S* Q( @! ^- h6 N; i/ S! _
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% u* `6 e4 v; m* `6 e- W9 s
, g9 D) {6 }0 [/ I* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ u0 I: l6 k# b& S' K4 ]
___________________________________________________________________________. l+ o4 _) ~; j7 U P
. V7 i! X0 \# L2 Y
$ |) c( C5 S5 i: c+ ^. A' H6 @Method 03% i3 i3 E# f4 v- I& Y6 U4 o+ I6 m
=========
W3 T/ W2 m4 v: Z; i: r& g% M$ n" h6 K2 G
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) u `: l0 x$ k5 |9 v. j(API Get entry point) T6 I* w6 d0 t% v
% v& [: ?; {" u. {
. Q! h' @; p4 F2 s" b' P! b: l' A
xor di,di" M4 Z. c$ Z1 I% r6 K& G4 _
mov es,di* G7 h: |5 v6 |. ?
mov ax, 1684h 0 v+ g9 i" w0 I2 X# a
mov bx, 0202h ; VxD ID of winice" ]: K- R6 ~; q3 Q
int 2Fh/ {2 D2 N- O8 p. r# H
mov ax, es ; ES:DI -> VxD API entry point
& l7 ?; d3 U* V; J. o; I# M add ax, di5 R- s; N# z. |1 U5 K! Z$ W; ]6 [
test ax,ax: i* T6 _9 m+ Z% h* g0 W+ H) C
jnz SoftICE_Detected
8 F+ w5 X6 ?; l7 ~ @3 A/ U6 X p
___________________________________________________________________________$ j- _6 Y w. p7 w9 }5 R
) Q9 t9 ^ Z: y" d* w" @Method 04
' J- n* q/ B6 u4 l1 t=========3 m- i/ x6 ?- B2 x
) {6 l: w+ v6 A
Method identical to the preceding one except that it seeks the ID of SoftICE* M r; ^+ j, C) F0 v
GFX VxD.
% ], c: T D2 ]# t+ ]8 b% n
+ N3 Z8 d$ X/ y# A* w xor di,di1 o- E' [1 v3 V3 L5 @
mov es,di" S( l7 P+ P a: [6 E
mov ax, 1684h
( X1 j. f' L5 j/ a6 x/ S- c# T) `6 F2 j mov bx, 7a5Fh ; VxD ID of SIWVID
* U* \" S1 d3 B6 m& y- m$ o, s int 2fh& ]' K% f$ ]7 o2 T
mov ax, es ; ES:DI -> VxD API entry point" ? p) q/ G% ?4 [
add ax, di9 c5 Z, [9 v U
test ax,ax
/ F4 h* I" N! J) z" G6 R% ] jnz SoftICE_Detected7 K; m5 h/ A- S: E0 ~, t2 ]
( f @* A; n) F0 h$ ~' Y: ^__________________________________________________________________________
9 y2 }( ?& ] A; C A3 x( y- w
$ E3 P4 q/ A9 S: [+ K/ K. `% \& Y0 d8 c4 H7 b0 R
Method 05
, S6 D4 u. p% s9 Z& |) Y( `=========
" U+ v+ F5 D+ Y" F
% m7 C1 s4 Y% r' @Method seeking the 'magic number' 0F386h returned (in ax) by all system
- z" |% x. q* |* Z8 z( Idebugger. It calls the int 41h, function 4Fh.1 K6 D9 e( q z
There are several alternatives. $ r, K3 S$ t) j1 I* V
; w$ Z! P8 o8 ]3 u9 l3 x
The following one is the simplest:! x5 q: q `3 D; [' m
T$ y3 O( T$ n
mov ax,4fh# i2 P5 ~$ Y% a
int 41h9 U9 C2 G' \* |5 L
cmp ax, 0F386
; G+ P2 I( t. e/ f) y9 p+ H jz SoftICE_detected
% w# e7 e7 V8 D( h1 v+ J: m
$ k7 u. w% a" v4 E3 K- T7 n! J5 s" x3 G" B+ C
Next method as well as the following one are 2 examples from Stone's
. e/ W& ]7 g- H) v/ ^* [6 w6 R"stn-wid.zip" (www.cracking.net):) I6 }* W% R# f! k, g/ \
: a k& L2 s: S- k% p+ a3 b# k/ T mov bx, cs
9 J/ Q/ M% `5 e) l% v7 J lea dx, int41handler2, \' {$ q$ P3 U/ s) X. J& v. W
xchg dx, es:[41h*4]
1 x2 A6 A1 a4 _" N% U9 c xchg bx, es:[41h*4+2]
( U% n3 M8 p: s9 v. A8 b mov ax,4fh
# `0 k: Y! X4 b. [$ A int 41h; N; E3 h9 Y) R/ Q5 M
xchg dx, es:[41h*4]# H: ~0 T4 i* p+ {, L
xchg bx, es:[41h*4+2]
# l( _, ?% G, P* \: u* N cmp ax, 0f386h
% q: T, c" a b/ V jz SoftICE_detected
0 [- ? ~- {* s% B5 }
! b% v) g: f& W! R4 ~4 I$ Q0 tint41handler2 PROC
* c) V O( v6 q; R* ~1 _ iret
& a: w) E4 q" d: u) c) b# o% {) iint41handler2 ENDP
9 p/ F3 a3 F. D% y% u/ }- r) i
- p5 r; @* v) k8 V$ m. ^4 \# v
3 n* L4 @1 C0 O! K+ i, G_________________________________________________________________________& }% S& J8 J+ }9 @+ N/ [
* _+ i' Z0 {* ?; Y2 c. S3 F l, u* P: U- W% G/ s+ c
Method 06
6 U. ~- u" B. x4 A6 k3 O4 _=========
- _+ g/ H9 l8 G: | Y6 j7 o$ q( g; a% x# k) [* n: g( W
) j1 v9 o/ ~5 f9 i
2nd method similar to the preceding one but more difficult to detect:
2 x2 n5 w, K3 y$ I4 R5 h9 m- Y4 y$ U" o3 J @, O8 f
$ O" I) D' ? T5 o0 @; k6 r
int41handler PROC$ m/ D* e3 t X6 Y1 {9 L
mov cl,al
) N! J9 e6 D n iret
4 x- `: _9 I m d) {' \& w- i, rint41handler ENDP
" f0 m j* q" `" ~
, ^( q& Q( ~- `" ~7 H6 H# l, K0 y$ u) |( U6 z5 X
xor ax,ax) t. Z9 n9 m" `' `' w+ \
mov es,ax
% e8 H+ Z; Y, y) P mov bx, cs* H) T9 K9 k0 t6 m
lea dx, int41handler
! b+ k9 h2 ]5 u3 D& U xchg dx, es:[41h*4]
- P- q. j" F7 X6 W: e xchg bx, es:[41h*4+2]
5 L- a' e6 u7 c1 G' \2 a in al, 40h
4 ^) @/ U7 f p% v% h6 A0 X+ Q! S4 m0 w xor cx,cx( ]7 @. W3 k" m5 B
int 41h
' a3 X* J8 o+ p, U, D- S' F/ ^& s xchg dx, es:[41h*4]
2 h. }! Q P7 u* i D/ Q3 q/ _ xchg bx, es:[41h*4+2]
( B6 r, o) h7 m, ]! b cmp cl,al
/ V+ \3 ~' W9 n5 w- ^4 O( X jnz SoftICE_detected' n: p) | {' D( @
" P! s* h: o1 \4 {; n O3 V_________________________________________________________________________% e6 K) ^% |5 v7 B! y
9 y/ ]. ]* m; ] b0 d
Method 07
& s; p, E5 U: X! x1 J0 b=========
) C+ t; O3 l8 }' A8 i+ ^7 s) [6 c9 X, E2 C! K
Method of detection of the WinICE handler in the int68h (V86)
+ u. i% a* m# w# B; M; X5 M- @: s( H) g. O% ^
mov ah,43h1 [$ C+ h( Q) n: ~9 u8 H. ^
int 68h3 G( Y# F. D5 T0 t
cmp ax,0F386h+ X# |+ p1 `* ~0 w- ?
jz SoftICE_Detected
( {9 y& u" d" c: `0 M3 g( L, k6 Y: |, S( t+ s) j
" }& M" b' }5 Y P3 W2 _=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& s. V) H# W- e5 }$ @
app like this:, w2 d0 {. v- n( ^
/ r: T6 ?( Q+ Y' _! W q m
BPX exec_int if ax==686 N5 O( q+ c9 ^$ z, u
(function called is located at byte ptr [ebp+1Dh] and client eip is) `! {' r6 s, t5 T: [
located at [ebp+48h] for 32Bit apps); @$ F& a" A, q1 X* q6 F2 Q6 H
__________________________________________________________________________
# u7 G* U' P# `2 G5 n
/ O1 @' @# z0 a n5 N( K
) i2 f- u: H# I, l: d& w$ dMethod 089 U% M" P; w' T9 j% l
=========& V) E: c. X5 p4 e) F a' \' L0 E9 V, t$ _
( N! ?2 j' w. W3 `
It is not a method of detection of SoftICE but a possibility to crash the
$ {7 I- ~( b3 Y b; |( F& fsystem by intercepting int 01h and int 03h and redirecting them to another
3 E* v8 k! C* C1 n) broutine.
- ^, M6 O) A0 L! D2 Y7 W4 sIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ c! m* b; F8 U$ M8 r4 k! c
to the new routine to execute (hangs computer...)$ h( d4 A$ l; D% d' x
9 H& F# A. t: U! @' n7 s$ t
mov ah, 25h
) h/ `5 q' C* ~6 i/ B9 }" k8 B mov al, Int_Number (01h or 03h)! a2 D ~ i9 u2 Y
mov dx, offset New_Int_Routine) y% c2 \9 K) O4 M( k# C8 d4 L/ K
int 21h1 O7 b$ I7 Q7 N2 y6 g$ Q
" P: e9 h" w7 ?( G8 v' B1 y__________________________________________________________________________
. }+ I$ u" ?" s$ n" k- y9 r& d; O/ j4 Z
Method 09: y0 W# Z$ k$ Y: A
=========
3 |9 H/ a6 }" L: E; \# Q3 v3 r+ M8 b8 B2 O, B& u, A( V
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( |8 [$ m4 | p$ J$ Y
performed in ring0 (VxD or a ring3 app using the VxdCall).
. n! X1 l7 t: p1 b& r; s) k; nThe Get_DDB service is used to determine whether or not a VxD is installed
; w+ x9 d/ C* Y5 F: gfor the specified device and returns a Device Description Block (in ecx) for8 v% R7 I# I# |1 c1 i5 @$ n5 M
that device if it is installed.! a* d3 ? f: m* x! a# _
. e T8 _: S8 M1 F( |8 S mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( P$ f! J8 p5 w; O1 h& c mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-): V: q/ w6 O5 \- F6 p
VMMCall Get_DDB
$ V) Z0 ~. o! X, i mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed, H# K; l# G3 x, L3 \
5 j+ R3 }5 N) \2 K
Note as well that you can easily detect this method with SoftICE:
) O* \1 v+ w% A' G9 q5 l bpx Get_DDB if ax==0202 || ax==7a5fh* L6 V4 E, ]% V$ l1 A
& R. z' @- S z! |: K__________________________________________________________________________& q& l* a: m; m
) `! O& B9 [8 t2 w, oMethod 10" r8 C( f# _0 P* c H, p
=========# n' A, \; z* K! E8 O$ ^
9 M/ o K# X; C$ y. U; P7 ~0 _5 y
=>Disable or clear breakpoints before using this feature. DO NOT trace with% v1 b5 a. F9 c' m
SoftICE while the option is enable!!) {, P, o. D: i0 Z# B0 q5 `
, ` b! r0 k+ tThis trick is very efficient:/ U5 N7 ~& }. r# b- W1 N% N
by checking the Debug Registers, you can detect if SoftICE is loaded
( \2 q5 [/ y4 y! c4 Q$ p2 D* v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if7 n" ^0 ^8 `3 I( t. b! E0 @
there are some memory breakpoints set (dr0 to dr3) simply by reading their
b3 M8 N+ D( B9 p4 r3 r/ r5 Ovalue (in ring0 only). Values can be manipulated and or changed as well
7 `+ p l* A* P(clearing BPMs for instance)
7 V2 i1 L% y1 J/ ]9 ?4 d7 i
- r, V5 V* E0 R2 M. N% A2 T__________________________________________________________________________/ e* l4 \1 d$ `# S2 ^4 J/ Y% y1 n, Y; [
9 b2 k6 m" t, G ~, I5 n. t/ {Method 110 M7 m5 v9 u C; u) ?6 e1 S
=========
# y$ z9 Y3 I2 ?8 X- I! L- Y. b/ ?, K( L& i) f+ {* l7 y
This method is most known as 'MeltICE' because it has been freely distributed
+ I* H* l T/ g& e$ ivia www.winfiles.com. However it was first used by NuMega people to allow
[2 X1 Y: X3 V" T9 w% t0 T+ z5 mSymbol Loader to check if SoftICE was active or not (the code is located
" a' s( r, W/ p* i, Ninside nmtrans.dll).
: t$ q) y, a% t9 I- J, J! X5 _# y3 w
The way it works is very simple:. _% |* |! b6 s, V0 C4 ]$ b/ X0 c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! [" N' c' g. m1 \WinNT) with the CreateFileA API.
# O4 O+ }, @6 t( U; p0 z" b) J6 U# s
Here is a sample (checking for 'SICE'):6 f$ C' z8 j4 m0 ~% P
* O6 H" E: B( V5 _8 Q6 wBOOL IsSoftIce95Loaded()
, l3 t( u: G( F' [" a& q{1 H0 \ n4 c& g- O' P
HANDLE hFile; - h# y) w/ a8 P i2 r
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 ~0 W1 D- }: y1 `$ X- h FILE_SHARE_READ | FILE_SHARE_WRITE,0 q- Y) _, \! X k# g
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% B( f- b% p- I5 i9 L! H9 ?
if( hFile != INVALID_HANDLE_VALUE )
q2 p% o4 p/ h1 | {
; E, y( |, y0 d- P n CloseHandle(hFile);
% K! p1 }" O# E0 r* t return TRUE;
; v R6 g$ s$ o& V }
6 U# v' z) T$ k& M' o, s return FALSE;
- J# e* b$ z; o$ B: n( ]2 N}1 ?; }' f$ b1 f$ M
8 \" p; V* c tAlthough this trick calls the CreateFileA function, don't even expect to be
$ J0 N+ A: U. ?- R0 ]able to intercept it by installing a IFS hook: it will not work, no way!
. {9 \; `6 g- a7 w4 AIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
[9 E! N# z" E6 r0 ^: pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% ]0 K3 y5 z5 X( x1 m
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 g& `" [, e9 ^2 W4 x/ G1 sfield.
g; X' b1 G( c4 @In fact, its purpose is not to load/unload VxDs but only to send a % {8 c# W+ Y' C
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- Q' ]3 I* ~3 \3 r
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
8 e% K' E* `+ t) f" A7 v8 \8 oto load/unload a non-dynamically loadable driver such as SoftICE ;-).
; w9 y8 f/ I! E0 s hIf the VxD is loaded, it will always clear eax and the Carry flag to allow
" q n6 n7 A+ H$ Q2 fits handle to be opened and then, will be detected.
$ `/ R2 `/ ]! H' k( [8 K/ g }! Z$ KYou can check that simply by hooking Winice.exe control proc entry point
% e' t2 W. m6 \ Q8 W! D0 kwhile running MeltICE.
! P, U( o$ j( x l9 R7 V" E5 L, R: T- c% @1 F* O
3 y# D4 q7 ~ F2 [# D3 l: M4 E 00401067: push 00402025 ; \\.\SICE
' y9 y# t" V$ d+ }: P 0040106C: call CreateFileA
4 v! s- A6 c) I 00401071: cmp eax,-001/ x! R% X2 I0 m' u( l! |/ Y
00401074: je 00401091
. o/ q0 s. ?/ q" a% q* v5 W6 p% o# v6 |, B& a) J
L! a: z+ h' v" h# f" u" ]
There could be hundreds of BPX you could use to detect this trick.
. W. P) |5 ]7 ?/ |8 f-The most classical one is:$ ?+ |7 `% D* G1 M) l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 r6 Q7 f6 H& Z* O
*(esp->4+4)=='NTIC'' u8 k# B" w5 o5 ?7 E
' s0 L8 n$ j8 [
-The most exotic ones (could be very slooooow :-(
: Z) _+ d, S' a: q BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
+ y& l+ Y8 K) Y. R ;will break 3 times :-(9 B. i5 L: {( Z
( @. q& G0 U7 Q! i1 D+ D-or (a bit) faster: ; o: `+ v% t2 X! E7 N, w7 I* ?0 G! u7 O
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% Q3 M7 G# Z, P5 _! o4 Q, @: d; v
* E# R5 B5 h+ V BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' # l1 o" f+ y2 d; y7 Q& M0 {
;will break 3 times :-(
: b/ ^" T# B5 T: t' x/ `6 ^* _, H4 U3 G/ H5 x9 y% n- j! m
-Much faster:
: O9 C- t) l$ d9 s# c BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
9 K6 R S K' ?$ t! c. g2 G
% ~$ j! p: Z! |' ?Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 \$ j. K% F3 U( n1 r9 Gfunction to do the same job:
' g; B ]+ F! M( C1 B
+ ~1 w$ n3 V) z- n Z: V$ c push 00 ; OF_READ
! J& U( i1 U4 [# s mov eax,[00656634] ; '\\.\SICE',0
, |3 B6 G; D2 l" r5 V push eax. b# Q( z7 K! [
call KERNEL32!_lopen
$ u9 |; B! f2 X% ?+ e! j inc eax4 |* H7 K6 ^, g. I: k0 v
jnz 00650589 ; detected0 c9 M7 c7 ?1 k. e$ C
push 00 ; OF_READ( {1 |8 V8 a5 M' ]" ~2 P
mov eax,[00656638] ; '\\.\SICE'/ X ~& o# s" |. ~! _! p
push eax3 V& r& q5 E& r U# p6 B! ?
call KERNEL32!_lopen
0 L7 S) @$ b |# F e" d- L inc eax
& I: z1 f/ _" j* n jz 006505ae ; not detected
, h" ? k) j ]
8 A a# u/ o" b3 G' K
, m- g. F9 e1 ~3 D' I- R__________________________________________________________________________7 s7 a) E4 {1 c( y/ _
4 A4 P# V4 @( a. ^) E+ Q/ p/ P7 x+ _Method 121 a# q# ?* s' n! y+ e3 G' Z
=========
# I1 K7 m0 P* ^2 Q
) A% H8 I) S1 GThis trick is similar to int41h/4fh Debugger installation check (code 053 p: Z) f" `# W
& 06) but very limited because it's only available for Win95/98 (not NT)
* P. ?7 G* {+ was it uses the VxDCall backdoor. This detection was found in Bleem Demo.1 N7 `' k: f+ e, `/ X" }( J
/ F) p# C& G- q push 0000004fh ; function 4fh j* [8 J" P* p& F. F
push 002a002ah ; high word specifies which VxD (VWIN32)
2 ~" X" B+ x" }. T; S ; low word specifies which service
1 P* G# q8 S: P' @6 N6 M (VWIN32_Int41Dispatch)
( C8 v0 c' z7 f4 O# R. Q call Kernel32!ORD_001 ; VxdCall5 ?% v" ^/ o' ^9 O$ M. n
cmp ax, 0f386h ; magic number returned by system debuggers1 P, N; z# e0 j, o. K4 p
jz SoftICE_detected+ t' d* P8 L; Y
. b# b. ?) g! hHere again, several ways to detect it:; |& J' U+ h% f) P
, T+ s- b6 s# v. L/ E; M+ N BPINT 41 if ax==4f! T8 C, K4 z7 f. A8 `* h1 u
! n; Q+ ~* ~4 R' Z4 c ]! t) c& G
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one$ f6 I) |' F5 c, G( d4 e p7 Z
# Z F' q1 i* q# [1 {" \ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A2 c- q1 ^" d2 o+ e
a: A' A" w% a5 V
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!" I$ q1 |3 X' z- o& D' Q
! O n. i& q7 E. W/ X/ a
__________________________________________________________________________
0 q7 @5 F* \) @9 _2 `. N. H/ g. w/ g4 B3 M9 l
Method 13
@. H2 G! H5 ^4 e$ e=========
/ n" @$ M9 q* s. |! ] P/ `0 b3 ?* b' r) k, c
Not a real method of detection, but a good way to know if SoftICE is9 x( Q) t1 z9 d; ]9 u+ T9 f
installed on a computer and to locate its installation directory.4 D. P# ?, F' V4 n$ Y. P$ i
It is used by few softs which access the following registry keys (usually #2) :
5 Y: g+ Q! w$ |! r9 T; `. R0 d- I6 [8 U5 D" T1 h, m
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' @6 k C& |4 T9 a& j- B+ s( K0 |5 ^
\Uninstall\SoftICE: ^% y5 Z$ S- I! D# ^
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE( ^( B) F( d2 Q5 R+ S" D! \
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. [$ c' @6 D/ E K7 n- _, z\App Paths\Loader32.Exe) @ z+ ?# z0 |$ R6 g
m3 P# r5 t& C5 L8 R. H
* [& x# `' Y& O, y2 K r
Note that some nasty apps could then erase all files from SoftICE directory" D* M7 o$ D M) d: Q# n& y5 l ?
(I faced that once :-(
' _8 B6 O$ j& Y$ i6 r( q: I8 j) A: \% Y4 ]! D) g+ f
Useful breakpoint to detect it:7 L5 P; j' t. W. D, h# r; f
6 Z" x6 X2 w& c3 |
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
! F7 ]4 y4 e1 t7 v/ @2 q9 |2 S% }4 X9 P% d* p% Z2 x
__________________________________________________________________________7 G* p; B& H! [
1 Z$ K1 W) x5 c
' L2 j, F; [8 s. S, v
Method 14 ! A$ a0 h( Z) {# |8 e; r0 L# ?! T
=========
9 `, h" _7 j; c8 K6 v/ x5 u
; ^( `! S+ M g. p3 X; AA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: m3 M7 Z8 n) k0 ]' a0 y& m
is to determines whether a debugger is running on your system (ring0 only).
* O- O, {" V5 g6 O3 i
) a7 `1 o& {, a- W- M! }/ @ VMMCall Test_Debug_Installed
! w/ Y3 \0 P( u" v) U$ M* U2 B# b* T je not_installed8 Q( v( K- N. `/ d
( U5 C3 `/ C8 _6 J6 P, ^; E* N
This service just checks a flag.
2 o: k6 W6 L0 x& C/ r</PRE></TD></TR></TBODY></TABLE> |