<TABLE width=500>
% j* e/ p4 H+ w6 d Y<TBODY>4 Z0 b8 r5 M) R* v
<TR>
; t0 |4 a H% s4 V<TD><PRE>Method 01 " P2 f, C7 N) K D8 A4 X
=========- `# F% i+ U" u J" F i2 |* E3 v
0 @" @2 S# _" o% yThis method of detection of SoftICE (as well as the following one) is P4 Z- a9 S* \
used by the majority of packers/encryptors found on Internet.
* v4 v' _1 h3 t9 @It seeks the signature of BoundsChecker in SoftICE
) q4 @# l ?; }0 F
: N1 J% Q6 W( W0 E+ q% h- H4 b; ~ mov ebp, 04243484Bh ; 'BCHK'6 J! l! C6 k: Z2 V7 t5 v
mov ax, 04h0 ]2 ?8 r& e- l1 I' G
int 3 . Y6 y* k V# }* o4 i
cmp al,4# J5 z) D/ S6 L6 J8 k
jnz SoftICE_Detected
: b! G: F- Y& U+ l4 j: X" S; z v& L: G% F2 Q/ D& b
___________________________________________________________________________
* [0 x6 x. m) m- S O
2 p6 p: s9 ?% Y8 S& Z. d! I; }Method 02+ d6 ~" ]* B; w1 G
=========1 H$ x! O# ^ Y: }; f' e7 G
1 q, l6 ?, h. S- wStill a method very much used (perhaps the most frequent one). It is used. }# r- Q. H) T6 p6 L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ y0 ?4 o/ j* D$ O% z* w; Vor execute SoftICE commands...$ J+ I2 A2 v- _' z$ ^/ ^$ F
It is also used to crash SoftICE and to force it to execute any commands
- T9 D8 E( U2 ?9 [% h" N(HBOOT...) :-((
, a# V5 D% v( N: s$ U" Q' \' X+ q% m- p
Here is a quick description:
+ o9 b9 ?! q7 t8 L0 c2 K6 t-AX = 0910h (Display string in SIce windows)2 n, m" j! I* q5 W
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
/ {, a( V, H: q8 |-AX = 0912h (Get breakpoint infos)
! j: H9 P5 B% b$ d6 X9 G-AX = 0913h (Set Sice breakpoints). T2 @; Q) Z3 O- t# T( u
-AX = 0914h (Remove SIce breakoints)3 _0 L1 J. M* N5 x
! `1 J2 [" p5 O' S6 ?2 m
Each time you'll meet this trick, you'll see:1 h6 r' ?& f- G; V8 Z
-SI = 4647h
R3 i ~" H( |-DI = 4A4Dh- l, }$ V3 u0 w0 i, B
Which are the 'magic values' used by SoftIce.0 v2 W6 `; d* r, M$ Q6 N
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.( S- y. J" R8 P+ u$ @$ g
! U: e; v, @) T( L
Here is one example from the file "Haspinst.exe" which is the dongle HASP
t4 V7 N" L4 W/ G( nEnvelope utility use to protect DOS applications:5 _ H- h" f1 j
- @2 r3 @- j+ }9 s7 b2 C
4 z: {. d5 h, D8 ~( D9 J6 o m
4C19:0095 MOV AX,0911 ; execute command.. |: }0 }! n$ ]7 K9 j5 i' c
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).0 p6 Y' p/ Y- U6 i' A
4C19:009A MOV SI,4647 ; 1st magic value.
; |6 f2 J7 u o$ `% M" m& g7 [$ L4C19:009D MOV DI,4A4D ; 2nd magic value.
, U! C2 Y% `- D4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ j& M4 ?0 _# b4 s. T! Y. Q0 i4 h
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 M- g" ]* e, q" z/ h7 K4C19:00A4 INC CX0 Q2 |4 C+ R9 S8 G9 y8 U6 W
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
$ ^: M) A- V: V2 _6 g' T' y4C19:00A8 JB 0095 ; 6 different commands.3 U) F5 U# ^( `$ y' X; o; O
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
8 b7 c1 t; h; N' J A, y3 R2 I4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ _& p, T' g6 t7 Q4 F
) c- Y& D: ]( I( y) Q8 OThe program will execute 6 different SIce commands located at ds:dx, which
% z% p3 h0 `% }; dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 o7 E# x t8 q1 w0 i! _& E" V0 z% Y2 \
2 F) P9 h$ N h9 Z# ^' E1 b/ ?4 Q6 F
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& h9 {( C, D, s& M/ b& S1 P___________________________________________________________________________
( a7 |' _. u4 F; O% w: U: h
. b7 P+ A7 R+ S. {
* H9 i0 V; P3 UMethod 03
_9 J4 A# t; M$ ?% n: c8 W=========0 D" G, ?. p M4 ], a4 y* u
& K: n+ H5 U9 N4 x* W. S" }
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 t4 u) V$ u$ R! b* J" |
(API Get entry point)
! o8 ~: w- J) P2 D$ Q! I
6 h$ P+ T! [3 g' K* Y9 o5 e8 k
) _( ^( ?! X% R+ ]" ^ xor di,di7 \1 ?! e( [: h' I6 `
mov es,di$ a! T" }- T, M; M
mov ax, 1684h / r' d# R! i" `) i
mov bx, 0202h ; VxD ID of winice. x( j+ ?' ?; j. M+ h/ w
int 2Fh/ o$ _/ C6 c- ~) @
mov ax, es ; ES:DI -> VxD API entry point9 ^; h4 @- o2 K8 b) [4 R
add ax, di+ R6 E8 p5 h. u
test ax,ax; ?) {& n! E4 Z* p' X3 l
jnz SoftICE_Detected0 w) ` P! P) K$ V: x. \
% {( p5 Q+ b2 g6 ^+ Y/ {
___________________________________________________________________________
5 R9 B/ D9 g: v0 D0 @/ C/ L9 l# D( `+ I0 e% C+ q' W
Method 04
) @2 L! G' U- Z=========, }) p& ]$ r( U0 L
/ N% }, x0 d% J/ N9 Q* M" w
Method identical to the preceding one except that it seeks the ID of SoftICE% L; r4 u, H* J7 f+ K
GFX VxD.; D0 n2 z0 X# l
6 G1 R- W4 g# ~( U4 s
xor di,di
% ?' [& Q4 h0 Y7 c9 i, e9 H mov es,di
5 z' ?4 @% ^) y( E1 a | mov ax, 1684h
# M1 ^( r, K, \; w9 W" A8 I mov bx, 7a5Fh ; VxD ID of SIWVID- [9 p9 B; y- B4 p
int 2fh' f' ~% }. E1 t6 ^$ f( N
mov ax, es ; ES:DI -> VxD API entry point) _1 |4 P0 o# F& c2 I+ D* p) s
add ax, di
1 G' f2 P4 U% O( f1 N test ax,ax
+ C* l3 d. S! n, H) `) a# \3 `' O jnz SoftICE_Detected
( @* U: B4 e, S5 W- z" j1 r( t9 J) i2 O& X( P- G/ m; G
__________________________________________________________________________" V* O5 Y# }4 _: k7 N) q$ [
! n" t% a9 K. M; [2 Y
! v# ]8 p% [) g& S* BMethod 05
3 [; U" I8 {' u=========* K! T* V& i3 ?
! W/ q& X5 r2 N7 E/ L% R# r
Method seeking the 'magic number' 0F386h returned (in ax) by all system" E6 m- x' H) u6 u7 t5 y0 S9 \
debugger. It calls the int 41h, function 4Fh.
" Y8 O9 t* ]3 _ I1 e; R0 FThere are several alternatives.
. Q: @& X. ]8 U% d) z: z0 q
3 q" \* ] w ]0 J$ q0 o1 _The following one is the simplest:0 N; ]; G: l* h6 S& R* X* Z" D2 ~6 W
. z. J3 h* M9 S+ u# i
mov ax,4fh; f9 U2 j( }7 k6 l# B
int 41h
* |+ l" I2 R2 f cmp ax, 0F386
$ P' m, m6 p. W- y0 d1 i jz SoftICE_detected
) @7 H8 A* |$ G7 m. F% g6 l) B- H1 E
1 E z# U$ I1 d1 ?- H( y% p5 I9 F; |" j/ p% e
Next method as well as the following one are 2 examples from Stone's 5 Z' L; S( M) s3 K/ O
"stn-wid.zip" (www.cracking.net):
; {% z' z6 u6 R- E+ @6 }3 \
! j+ b s3 z% x2 x8 }* T6 j mov bx, cs8 ]7 `& I/ ~ D; H
lea dx, int41handler2/ a2 W9 t7 ^- y" k4 j6 T
xchg dx, es:[41h*4]3 ^7 C2 }9 o' M5 k" @, O
xchg bx, es:[41h*4+2]
. g7 m) ]6 H6 [- R# Q) v% T mov ax,4fh" |: @# o9 r8 p2 Q3 o+ g( {
int 41h/ D# W5 K6 ^" _% R0 M
xchg dx, es:[41h*4]
+ s. L' m! a+ _ xchg bx, es:[41h*4+2]
9 l8 ~* z; c N' a cmp ax, 0f386h
4 M d# o; Q2 E! V+ h4 A# R7 t5 f jz SoftICE_detected
9 T4 h+ K H" _* O; s. i
4 R6 c4 S* k0 z. v. mint41handler2 PROC
I! F. ]+ R4 ^+ K/ C4 w; | iret
8 Y7 J8 _8 H5 v; |! [; L- Hint41handler2 ENDP
2 S, j8 g# F( m' B8 Q7 T# H* J" O @7 A; ]; S3 y1 `' t5 x
3 x: _% u! a. R0 E- L8 o
_________________________________________________________________________% n: ^+ _6 i& E9 l$ {: j# i2 K# j
, h& c# F; j1 Y" @: L" {4 _; P4 [
- q" B6 G. y+ }: E: [2 v% g
Method 066 |# s5 w: R- U- ]
=========
3 e# i9 t/ }/ w3 C+ p
5 t Y( e3 O( N6 x# s
, Q8 H4 E/ O" G2nd method similar to the preceding one but more difficult to detect:# k/ P( x; b( _
% H1 P" z# l k- f
& t. _2 @ F4 C3 s5 ]
int41handler PROC% `7 h& a/ k( F* c- u: ]
mov cl,al
8 Q$ i& D- H+ j' _9 E C1 Q1 ? iret
7 J) N7 T& `3 |' \int41handler ENDP2 A" m) C* B. c: d/ U; q" j! e* ?
9 y1 v) |! ?5 } B- Z4 _
, Y1 f5 v9 G/ j+ {' J9 [" E
xor ax,ax: d: ]: ^8 r+ ~& g
mov es,ax
- U- `0 ^: [2 k0 M( ] mov bx, cs1 l; J, X% X) _9 ]
lea dx, int41handler: Q; {3 \" m2 z. ?
xchg dx, es:[41h*4]0 ?7 H# _) y: n; _& h
xchg bx, es:[41h*4+2]' K3 z$ Y. v# K
in al, 40h" ^' A2 P* h& E- S' ^
xor cx,cx+ S# e' S9 w; u' o2 w
int 41h8 b- f0 L! z; l) a" q4 N$ w9 _
xchg dx, es:[41h*4]: `) C' D5 |$ B; u
xchg bx, es:[41h*4+2]
8 X. ?* ^$ x# j* c cmp cl,al
4 S' I) o1 e4 @* S: a" ? jnz SoftICE_detected1 D5 f' n" \' L {* V9 g. t9 B1 i, i
1 y. c! s7 D1 P$ S: t_________________________________________________________________________
. n) m s# e; [/ Y; g
) n$ i5 ~2 u+ s3 d' f% c9 WMethod 07
! k) a7 n( J' e& `+ I7 X2 Y) L: B=========# n! r( Y& M9 |, U
- t0 y7 y* L; U, K9 y$ X- y( h% CMethod of detection of the WinICE handler in the int68h (V86)
+ Q, g6 B9 A$ | L& S* P; R) I5 o% j
) H. r8 d, Z5 U2 U# q mov ah,43h) n. g, j2 |- W4 p
int 68h; \3 `- b# \1 _3 z `: R3 U
cmp ax,0F386h
2 ~3 N3 {1 Z$ I6 Q ^- K5 K jz SoftICE_Detected2 k! g- x: X$ O
) }8 K+ k6 ]3 |" U; I" z
. T% n! g. M" D8 \ O
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ r5 @4 P. P" C: [" u3 {
app like this:( f N/ p3 W: ~
& P$ H5 w6 r* w, d7 E2 _
BPX exec_int if ax==68
8 N' F: k& P$ p8 K (function called is located at byte ptr [ebp+1Dh] and client eip is+ f8 T* A9 C$ ~2 Z1 \6 k0 _# k0 j* ~
located at [ebp+48h] for 32Bit apps)% h5 r' l2 t7 D8 a% ^! p# }! I
__________________________________________________________________________; l) \; y, `1 w9 k/ l
N& B" U: r' Y. C9 B
8 }0 ^3 p- O& d# k6 |Method 08& w8 O, n& Z& h+ c: {
=========5 W, n, N p% u3 M3 Y
/ X6 ]0 P$ @7 c6 h- B) aIt is not a method of detection of SoftICE but a possibility to crash the
- Q; C" [' U; i& f" asystem by intercepting int 01h and int 03h and redirecting them to another
/ F" F# Z( a$ i/ m* T) o$ froutine./ l" U4 r* R0 n
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! R# G; `- v8 c cto the new routine to execute (hangs computer...)6 X) }0 [" L; N
% f4 A2 Z2 k; O9 Z mov ah, 25h
% n9 J$ t* i! w" |; Z mov al, Int_Number (01h or 03h)
8 Z* y3 ~4 Q4 e6 g% X mov dx, offset New_Int_Routine
$ S+ Q4 J+ w S int 21h
( N6 N& G8 M( ]9 K6 ^9 I
6 @" t# q* Y& l1 u# p" p6 [__________________________________________________________________________
3 p5 n' p5 H+ d* j
, b' W% W* I; ]" fMethod 09
% s( h8 ]6 B' u- V=========
& t9 s9 F0 D" Q9 I* O& h& X2 v- i$ B1 O( F
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* ?1 ?$ ~4 B$ P. Eperformed in ring0 (VxD or a ring3 app using the VxdCall).# c) u1 f( u3 Y* ~ z
The Get_DDB service is used to determine whether or not a VxD is installed" p# }% v0 a# e' D% E F# s5 n' ?5 I
for the specified device and returns a Device Description Block (in ecx) for. g0 {4 _: q/ H. f0 U
that device if it is installed.: }0 j, O& f4 e7 O/ Q/ Y
# C- s4 n/ }6 @5 ^+ |4 u3 B8 T
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID Y3 \& l; H& a* y
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. t2 M c5 h, i0 S- F VMMCall Get_DDB
+ }8 m3 j5 W% z' D mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 y- E5 I& o2 @/ T$ z# o1 ^% V: B% H$ N5 }
Note as well that you can easily detect this method with SoftICE:- [3 z! Z- Q0 j- i
bpx Get_DDB if ax==0202 || ax==7a5fh
& t M: I. T- w& a4 x1 M- x5 ?" `' g' X# Y% d) `
__________________________________________________________________________" B8 G8 p. L0 f+ K6 V
, a. i& [9 v& TMethod 10
* H$ L( l8 h6 N. g* k0 R3 K7 @" _=========4 K# l% W- F0 F9 o( \6 m) w1 T, C
Z2 m. D! U6 X. O& k=>Disable or clear breakpoints before using this feature. DO NOT trace with8 d+ b! C2 k' X. T& b/ ?
SoftICE while the option is enable!!
5 w. k* m- [5 {7 L. Y5 u7 h" P
- Z' A5 D( e* }0 L( h) NThis trick is very efficient:
5 z0 ^# `# F3 e6 U7 F8 R. c/ Jby checking the Debug Registers, you can detect if SoftICE is loaded( o6 Y: G& e+ m+ x- K( V
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if% ]1 W- y& A! C6 X
there are some memory breakpoints set (dr0 to dr3) simply by reading their8 I& e1 V' i" K: t# |
value (in ring0 only). Values can be manipulated and or changed as well5 Q3 G# u& q. ~: _
(clearing BPMs for instance)
+ D, R5 [7 m: @0 C U& I6 p7 l0 |
__________________________________________________________________________) b! d% d0 |2 A- ^
/ K+ G* w* x& m& [3 ^: ^* ~
Method 115 c: Y1 I& T& l
=========
2 ?. c" a% ^5 H+ x- m. ?2 L* r7 a5 I( g( K3 h/ h
This method is most known as 'MeltICE' because it has been freely distributed5 U1 Y) ?( i0 O+ r0 e0 C
via www.winfiles.com. However it was first used by NuMega people to allow+ w" a8 G& _* P4 ^* ^9 o% w
Symbol Loader to check if SoftICE was active or not (the code is located
, r' Y" ?1 o+ d* v/ F1 rinside nmtrans.dll).
$ i6 E4 ]" O3 X3 v5 V# k0 z0 M" }: Y/ l+ ]9 F
The way it works is very simple:7 D; g& T- j" E
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for1 N/ X" D% x2 h* ~- v' E. r
WinNT) with the CreateFileA API.& l' Q, p# E q
1 J u5 ^3 }: g& \( c) OHere is a sample (checking for 'SICE'):. @9 t$ U# z/ X0 {! D( b' p
6 {9 o: M1 V; v& MBOOL IsSoftIce95Loaded()
: j1 [, a u" V0 g0 J: {{% j' v6 U/ V8 p4 n
HANDLE hFile; ; A5 f$ S/ v0 a, M9 i9 O
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
5 I8 ~* ^# w j+ g4 y3 T6 G3 c y FILE_SHARE_READ | FILE_SHARE_WRITE,
+ _+ I& |% I0 o& Q4 N* n NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) d; M5 C2 k# C if( hFile != INVALID_HANDLE_VALUE )
) J2 n# \% z6 f4 `# ^7 u' R, s {" T& B# { h6 u6 ~, `" y/ Q: b
CloseHandle(hFile);
" n$ ^2 x1 k- V. c5 q' k7 U) e' f return TRUE;+ P9 K B& R# N/ i& y$ W
}
; b8 Z. F2 S( ~5 Y return FALSE;
; x$ k% |: e& E% h2 B( |, G1 M- D# N}- l9 W% r# e: d9 C0 k7 K- V
5 H5 R( a: D7 }- W8 H. L% c- V
Although this trick calls the CreateFileA function, don't even expect to be0 |+ z$ y" A) k3 y2 u
able to intercept it by installing a IFS hook: it will not work, no way!
+ i& l7 k* K0 V; p, yIn fact, after the call to CreateFileA it will get through VWIN32 0x001F# L8 U+ J' i1 Z3 _$ K/ M# Q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! G/ I: o4 z2 M8 P" g1 g7 s; G
and then browse the DDB list until it find the VxD and its DDB_Control_Proc* b* K; |% {6 U
field.
4 l" b+ N' v, vIn fact, its purpose is not to load/unload VxDs but only to send a : }6 x! c" J& T$ }2 A$ p9 I5 M1 F; _
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
6 o5 M1 v* ^% H4 u4 ~$ F( [: G Y( f5 i3 Jto the VxD Control_Dispatch proc (how the hell a shareware soft could try/ W, g+ }& l- L( b9 ]- M
to load/unload a non-dynamically loadable driver such as SoftICE ;-).. V6 |& N' A8 j7 [
If the VxD is loaded, it will always clear eax and the Carry flag to allow
1 E/ f j; j% W. lits handle to be opened and then, will be detected.
) [, ?' X- f7 E; RYou can check that simply by hooking Winice.exe control proc entry point
Y5 x/ d) o. bwhile running MeltICE.3 ]0 p' I# ?' q3 _" S) Q
; C4 C! C2 f* V7 q8 O x* R
0 J7 Q& R9 f# k6 i6 c/ Q2 i3 m
00401067: push 00402025 ; \\.\SICE
5 h8 V4 p* q- f6 E2 f 0040106C: call CreateFileA, k8 d _, E5 b% S( }. G
00401071: cmp eax,-001 J) H: B6 C$ R7 w) X2 E
00401074: je 00401091* W& U, |( s: r
) i; k1 B2 s. g1 B& P- E/ `, v2 L- V. {( {5 y
There could be hundreds of BPX you could use to detect this trick.
* L* ~0 B3 J% h8 X1 q; a y! I6 k- X-The most classical one is:3 i. F" B, a' P3 G* r. c1 k6 F
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 ?$ |. I2 b' w* Y *(esp->4+4)=='NTIC'7 k4 y2 {% {- q1 x% b3 w- ]
, W- U) j" }" B6 X% c
-The most exotic ones (could be very slooooow :-(, q% X: P1 e0 v2 X8 X$ O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
7 G5 P8 E' x9 m" E7 H ;will break 3 times :-(
; m+ |2 Z3 p; Q d$ ?
6 h- ^" I! e& A# R5 i% {-or (a bit) faster: ! g. y# G! R4 i. ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')# j) O5 I8 @2 q9 Q; V. r( A
9 S( M/ S7 W- f& C' h i+ | BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. r M" F, m$ U" s ;will break 3 times :-(
4 s# J* O2 s/ Q+ F' J' }
: z4 h* F" `! k-Much faster:
; \8 e1 J6 M$ t, R1 I6 G7 n: F BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 Z6 [; M* K0 @5 ?9 ?* V
4 k0 B' Z; C. s: T. G0 X1 {9 k& R6 e* s/ eNote also that some programs (like AZPR3.00) use de old 16-bit _lopen5 o l' F* N9 E7 A, k
function to do the same job:
6 U; J( q7 t) K5 [/ K1 g7 d+ N7 z! m6 z, K+ ~7 t4 j
push 00 ; OF_READ
5 x A/ _3 E8 l# g* g6 e( N0 K, Z mov eax,[00656634] ; '\\.\SICE',0( G2 Y$ e! L d5 ~1 p2 q
push eax
4 M k0 ^/ {* H0 t: {. |/ K call KERNEL32!_lopen
$ C3 P+ H9 q: A: q% ` inc eax" n- _" v. j1 n
jnz 00650589 ; detected0 ]/ c. `4 b% o- I1 b
push 00 ; OF_READ
) H) }1 G% ?) Q a: b2 R0 T) y8 a% d mov eax,[00656638] ; '\\.\SICE'
& U$ G' h, |- n/ F5 h push eax
/ L9 w2 q0 |) N2 x call KERNEL32!_lopen$ i3 U7 {# h) Y+ P* K+ d6 f
inc eax
5 w6 }# h; Z8 c a jz 006505ae ; not detected
1 W/ L' G+ Z& m5 d, e, o
6 c3 \1 w0 E) a( U. E8 T; {2 {: W! n$ S D! L
__________________________________________________________________________) r4 Q: ?5 K' y/ z& V
- b" f: c5 d- T$ tMethod 12
$ G2 P8 @1 g+ S! c% r" q=========! d" r u# e2 R3 J4 v( n, A. d
2 b9 `: ]+ N; c4 ]" TThis trick is similar to int41h/4fh Debugger installation check (code 054 m/ Z1 r p% r& m/ T
& 06) but very limited because it's only available for Win95/98 (not NT)
0 g2 B4 k. b7 A7 Bas it uses the VxDCall backdoor. This detection was found in Bleem Demo. I5 z. \5 `% I% L4 i* {# R
2 d, A( p5 m# }: F' M( w% x
push 0000004fh ; function 4fh; Z" G9 H: r9 r) i7 a$ L. k
push 002a002ah ; high word specifies which VxD (VWIN32)
7 v/ P' t0 S: _6 h ; low word specifies which service
8 B _/ Z( ^0 l- o% |4 f (VWIN32_Int41Dispatch)
2 Y4 h8 H8 V; V( c- A! L call Kernel32!ORD_001 ; VxdCall
) W9 \& D# K2 F/ C! N( F4 H) ~ cmp ax, 0f386h ; magic number returned by system debuggers7 p/ Q8 W( W7 d- P( s' y4 C3 \
jz SoftICE_detected
5 C% e* m- W+ a9 i6 {1 u( l7 b- N! J6 B
Here again, several ways to detect it:
" X. c$ r# u* p* w. b0 J. n
2 l& U* J+ b; g2 z BPINT 41 if ax==4f
7 D3 T N& m; v x8 f! W- {, S# ?, V" z" y$ k. H) |/ q
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 j0 t* r0 y( z; e" y# {: f1 ^' @# C, {" a
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
; U9 k' o8 @! y3 `$ y7 O$ n: |3 Z) r0 ^+ N( [# _" Q
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
' a* S3 m8 ~; M& u q: \8 C- V! X* w, l3 W1 J
__________________________________________________________________________
6 I: w. `0 v8 }, z9 ^ `1 e2 U- G0 s3 ]) t8 ~
Method 13
: j7 Q; O/ \7 k0 c# S& ]7 i/ T6 u=========
" e+ X3 N/ v; e0 \$ z8 g. P, H' Z* N2 ~ w
Not a real method of detection, but a good way to know if SoftICE is
/ t& H! M2 v p+ T* pinstalled on a computer and to locate its installation directory.4 X+ L3 Q2 d0 R9 ~
It is used by few softs which access the following registry keys (usually #2) :9 u( I, U' W t- |7 b$ a: L- t/ s# \
7 m, u9 J5 m6 B) B" W1 ]
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ r" T8 v$ B: \0 R\Uninstall\SoftICE
9 n5 d: l1 w5 Z6 Q% I/ D9 W-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
% {& ^' T6 d5 g7 V* |: s-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 ]& z. T; Y5 D- q
\App Paths\Loader32.Exe
8 f1 y9 T+ _- m% K
/ z1 q# l8 `1 I& J
5 V% C: }: q( W' m6 ~. ANote that some nasty apps could then erase all files from SoftICE directory
$ g9 Q3 P& s8 w6 W(I faced that once :-(
' H( A! `& C+ U: G
! L# E* ?" l; S% NUseful breakpoint to detect it:
' I" r3 O k+ `' J* u$ [ J2 H3 }3 }- T$ J* E7 m
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'5 x, S0 m* B/ I: _8 j; u7 }
3 Z' h7 n4 _5 l5 [+ @" T__________________________________________________________________________1 V) i. y {: ~) R
]/ l. M2 n) e- [! ]
* a4 R' J C6 N- q' ~, \' l) |Method 14 & f& k% _7 Q( W3 J/ M+ D
=========& d$ K4 Z2 } Z' @
7 K1 h' \5 S# w aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% i5 x4 a9 n' R! kis to determines whether a debugger is running on your system (ring0 only).
6 c/ U$ w+ U* I$ H; h& m0 y. k% G2 g2 q" \9 w! Z5 r
VMMCall Test_Debug_Installed
* E% z9 ?1 B9 N* n: O% I2 {* ? je not_installed
+ ]+ I( W: o+ o6 w6 _+ ]/ v v6 N6 D4 g2 S5 M- h; [0 `# q% Q( d
This service just checks a flag.
0 A1 F5 A A+ e' h$ n1 ~5 i* D0 \& u</PRE></TD></TR></TBODY></TABLE> |