<TABLE width=500>0 j7 h& E$ X7 i
<TBODY>
: H8 h. x% u" t; @<TR>
( ^5 I6 A3 U9 j; d<TD><PRE>Method 01 % m4 V& c" m& _
=========
; u0 i" V N/ v8 u+ b' `. `. M! k+ |3 v3 e, ^$ \& u) q
This method of detection of SoftICE (as well as the following one) is
* A+ e' E2 n( X' D+ s# G4 \% t5 Uused by the majority of packers/encryptors found on Internet.# \2 f; O$ s6 e6 d; \
It seeks the signature of BoundsChecker in SoftICE
/ T* y5 e+ G$ `; \+ } G" ?' ~! p" S6 {- q) o
mov ebp, 04243484Bh ; 'BCHK'" B- i6 ]( T0 q/ B
mov ax, 04h
2 j4 F7 |+ [ J+ j2 b int 3
7 _( ^8 ^2 P0 P: `' A9 x cmp al,4
& U% I# E A H8 a- T) A jnz SoftICE_Detected. L$ {; @+ V; p
8 h a" G% }/ f. l; z7 M___________________________________________________________________________
0 Z# D: L, E( }1 r
: W ?5 J! z( z. U; DMethod 028 C7 ]2 h) q+ v6 W. `% k
=========
' M( i, H0 a+ P" W* _- ~7 c# y6 v6 N" e: j* Q! J3 M
Still a method very much used (perhaps the most frequent one). It is used; o# _6 t, S; c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,4 z9 N( K4 t- w5 j4 P, q1 \
or execute SoftICE commands..." K& q0 s' [. ?& l
It is also used to crash SoftICE and to force it to execute any commands4 C, k& U9 `' a8 F! v) Q
(HBOOT...) :-(( % K* F. f+ x$ r1 l9 h/ [9 R8 `
& s# S; F. m" X6 u
Here is a quick description:
0 j# C( x5 j) Q- n-AX = 0910h (Display string in SIce windows)
/ G) I4 [* D4 u-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)* F& o. r+ |7 f: ?. y3 z+ j
-AX = 0912h (Get breakpoint infos)
% p- K1 ^# |3 P, `. s% O: x$ g, i-AX = 0913h (Set Sice breakpoints)2 g* }7 E, p0 P+ \8 ^+ M
-AX = 0914h (Remove SIce breakoints)
, }# j: A; ]/ s9 k( s; X
8 g/ ? X/ O# r- G' BEach time you'll meet this trick, you'll see:" b* I+ A% Y j" t- ^, o( [
-SI = 4647h
# a* |) E3 D& X) p1 W-DI = 4A4Dh: T3 L: `# I% o9 L- S
Which are the 'magic values' used by SoftIce.
5 n! L( t$ X8 PFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.* I- m7 u1 h H% J; l9 n
$ ]# }, |; z" @" t" w2 ?- M( iHere is one example from the file "Haspinst.exe" which is the dongle HASP
5 j0 r( h0 z9 Z2 T: jEnvelope utility use to protect DOS applications:
# D& k* N2 |) U! L5 M1 R
7 a/ M6 I9 x# q5 Z A
/ C$ w, ^% J2 Q* \4C19:0095 MOV AX,0911 ; execute command.
4 m/ E3 @8 H3 t7 h7 @4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
( c+ n% L1 y0 \( z" d0 g( \4C19:009A MOV SI,4647 ; 1st magic value.
6 Y3 T' v/ X4 O7 j4C19:009D MOV DI,4A4D ; 2nd magic value.
; }, U! u" |5 |. A( T' @$ F# Y4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- d p) s" o1 W0 t" O) y5 K2 s4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute) [' B; [" X& K% X& L
4C19:00A4 INC CX0 N! O+ m) ^8 h2 g; G
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ X# @# G" o) Q& @
4C19:00A8 JB 0095 ; 6 different commands.
& R$ ^) Y& \, w! r" h' h4C19:00AA JMP 0002 ; Bad_Guy jmp back.
- F2 w( x- @- U8 V4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( y* [, B6 D% a4 P: k
$ }# L" t4 Y; J' Z o1 ^
The program will execute 6 different SIce commands located at ds:dx, which, Z5 |2 h8 n2 {4 r' \
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
( P, X4 D" s# E" s8 Q! E6 U9 B/ J( u) @; g
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 e& f w8 d: s$ z; e- H4 G
___________________________________________________________________________
4 q/ p; U g) V3 _8 \4 x: w% F U( [( |+ \
; O: L0 g9 e3 u, x# @9 Z% YMethod 03
2 S( T% c* m+ @ F% I, b l========= z3 b3 S9 J, B$ ^4 ~/ ~! s$ I( e
" l3 M/ [2 U1 Z
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. `% B2 P6 q: F6 J# Q6 @9 v. m4 u
(API Get entry point)% k3 S( ~) O4 F" ?
4 ~8 p. c2 ]9 I
1 |$ U0 m! Y2 g' C xor di,di8 k0 ^6 P" T: n# j" v8 J8 h; A, D6 @
mov es,di
( C* x- o% W; | R% C, \ mov ax, 1684h , n+ J1 E. N0 U# e) L
mov bx, 0202h ; VxD ID of winice/ F: K, w) T& i" p" s
int 2Fh
/ _& \* ^5 z& \3 Z mov ax, es ; ES:DI -> VxD API entry point
5 |0 T: N5 i; U; ~ add ax, di9 V; U# ~! q4 R
test ax,ax
0 b4 N) \! r' h+ ^9 J- I jnz SoftICE_Detected
, e Q5 u# @7 c. y E3 g g
$ f! Y' P: o! i1 H, }2 m5 o___________________________________________________________________________ D9 o3 j) x: ~+ W( a
! N8 ^4 v2 A; Q% @7 P& nMethod 04( b( G x; b4 d& @1 }$ X
=========) V# i$ l. M! ]; w
2 e9 ^6 M s1 ~8 EMethod identical to the preceding one except that it seeks the ID of SoftICE
/ ~) E( ^9 p- ?$ |, zGFX VxD.) g- y- S% ? H
# Z% f& P+ s8 G4 r" ]& S xor di,di3 q. B; \5 S; F
mov es,di
2 k9 h/ H: ?5 T! O* K mov ax, 1684h , m; ^5 f6 y% }2 q
mov bx, 7a5Fh ; VxD ID of SIWVID
% u8 d7 h, W, y3 t: R int 2fh3 H7 a( [$ C9 C& ?
mov ax, es ; ES:DI -> VxD API entry point
' ]; Q5 w$ P! N& ^3 v. Y add ax, di
. V: y9 f* J4 h: n- t9 u. o test ax,ax4 j0 K( n4 n H; i! e: X! \/ e
jnz SoftICE_Detected
0 \) }1 I2 z3 k" ~
2 A1 x$ N- u6 t1 M0 g0 O6 O& D' `" z__________________________________________________________________________/ `( u9 ^0 V6 |! g: q
/ U; l' ^# \6 p S# N3 E! I' U2 |! }0 [" u: r& \2 [
Method 05
! f' `2 z8 z: V0 W1 h=========
U& W2 Y) ~" Y0 ]. V1 z( }5 `( l# V/ r9 Z+ a% A" H
Method seeking the 'magic number' 0F386h returned (in ax) by all system
) y7 d2 m- K, Z3 e9 zdebugger. It calls the int 41h, function 4Fh.
1 E; d. `7 K4 X4 x6 pThere are several alternatives. / @* m0 D- \1 b3 ]& W# I
/ u' T: i/ D/ h& w, j
The following one is the simplest:
; d; ?& y! V6 a1 M* F/ ~
7 P$ I& r1 p! t. E# B mov ax,4fh
6 v% K4 W" ^; c int 41h
5 k; }1 u" V+ t7 S cmp ax, 0F386: V( d* I( Y, F5 y' v+ C
jz SoftICE_detected3 Y/ A7 Q; D/ Q2 k$ \
; G2 ?/ l! l/ N" A
; }9 P* o( A0 e) ^Next method as well as the following one are 2 examples from Stone's
4 N9 e2 N$ p4 U& ? i"stn-wid.zip" (www.cracking.net):% o% N( W/ I G; F0 z1 Y/ z1 F0 V
4 O0 Z. ^$ T* S9 h3 T mov bx, cs# ~/ ~" N# m$ M( j
lea dx, int41handler2
" [+ X0 o% Z: H( ^ xchg dx, es:[41h*4]
; J2 G- W5 U1 s5 ^ xchg bx, es:[41h*4+2]; m6 ?# s) |( }2 D- q$ t: R; Y5 M4 N
mov ax,4fh% d5 Z; v7 I7 A9 Z
int 41h
% {8 l! \% R# ]* ^ xchg dx, es:[41h*4]
. c0 M B3 J1 e- E1 m/ [9 E! b1 u7 g xchg bx, es:[41h*4+2]
5 U/ q- i8 K8 B& f/ q3 \+ V cmp ax, 0f386h
8 f5 U* X8 ^2 M( V, \ jz SoftICE_detected
. s0 P2 ~; k8 ?: ?
! C- y$ H! q' k6 @9 jint41handler2 PROC
a' ], x: S! m( s. v4 Y1 R iret5 e( I7 b3 G0 [8 X% D* |: `
int41handler2 ENDP& o! C/ N3 m* O3 [
/ B& _% U: C; R, g) e- e* y8 b6 o2 n
_________________________________________________________________________
% ~2 P% p. w# ~
3 N( K) |0 y6 o$ J) _) N0 k/ R, h: C$ w. `& o& F# d
Method 06
8 }2 z6 ]% S8 t3 E8 T2 Z=========
/ t; M) B7 Q9 H- p( W* s# h
3 E4 B/ T7 H: E% |( L9 Z+ e
0 O0 c. X7 z1 P1 ?* x2nd method similar to the preceding one but more difficult to detect:- b* b! M+ M3 A9 L; a
, c9 c( p& [5 E4 E) V& _
. c; M- A5 L, H
int41handler PROC
8 S* Y) u) J9 x; v% P mov cl,al
+ R0 U% p5 K; k7 w iret
f- Y! U9 N& h, `* ^" sint41handler ENDP
! u) Y/ e ?5 W: H6 k% n- g
9 V+ `, A$ {' {9 |7 L: [/ V4 p2 h1 q0 E% t8 F! S# p
xor ax,ax0 c$ Y/ K' g1 f! }+ A
mov es,ax
$ x# X V7 p' Y. Z; [& C0 Z, P mov bx, cs; {, F& F3 B. u& c
lea dx, int41handler# T8 C; V3 q6 Q/ f# z4 x( M2 Y
xchg dx, es:[41h*4]1 Q' ^! W, w% F* b/ H" G2 H( _
xchg bx, es:[41h*4+2]
" [2 O5 p2 ~4 H3 p+ O4 D in al, 40h$ g L% G4 E5 T, j$ ]% P [. S
xor cx,cx
' s, W! K5 g+ Y& v int 41h
$ Q) B) z9 K% y" y( P2 K; R' i xchg dx, es:[41h*4]
9 h7 T2 R) W; R" S$ H! y2 T/ P2 | xchg bx, es:[41h*4+2]- ?- z: o; K* }7 v, S: {* S4 u# n4 `
cmp cl,al
* n% J4 s( E. \9 i4 F: a1 d9 W jnz SoftICE_detected
# C; C* O- m" z! _8 N# O* Q( Z
6 D) N* K, x, D_________________________________________________________________________6 G3 d+ k. T e6 c ]; g
" G( W8 B* \1 @7 |5 N7 L- C, {Method 07
$ h, q* N$ a9 r7 b x, m=========; Q. ~. L% i# s% Y0 F# r
# ~8 m3 O8 c/ h2 p! T+ K( |, G$ r) _2 p9 ^
Method of detection of the WinICE handler in the int68h (V86)! T3 g/ ^( k& |5 {$ ]( o. X
& d4 O5 F& T; g/ a
mov ah,43h! G4 ^ V: A4 A. F9 V. \; R
int 68h
4 ~* T4 S+ N0 \) I9 r) ` cmp ax,0F386h' @0 b# [/ g0 V% f. u% b" N D& ]- Z
jz SoftICE_Detected
, R P6 V- E9 D0 K+ M& w6 e" i K) `% `- |/ r; n' Z& F k; p
4 u0 W" \/ r' ^* Y/ |5 m0 p8 K! e
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. o% w$ }6 e5 n( H. U3 u
app like this:! V- g# U0 r" U- H L
6 `' ~8 W! S, G6 W3 o- m- I5 m( G BPX exec_int if ax==68
0 e$ j: J( P/ l: n (function called is located at byte ptr [ebp+1Dh] and client eip is
5 i5 X0 u& V- l& N; W* \- U located at [ebp+48h] for 32Bit apps)3 X7 o, E2 m3 v( i0 B; w0 W
__________________________________________________________________________9 e8 B/ C6 W& X. F2 @
8 e& T8 h% M1 _
1 R5 ?/ F# F0 L6 Y+ ^: zMethod 08
7 c! o) i' C% l$ t1 E5 R=========
* Y* P9 Y; N- Q8 ^' Z0 V9 v3 U7 T8 |3 D4 q0 Z* |# d# k5 e
It is not a method of detection of SoftICE but a possibility to crash the
$ P) _4 a5 O1 ?: J' i8 e- P; ^$ fsystem by intercepting int 01h and int 03h and redirecting them to another3 s& A5 v% p. E% x
routine.1 S8 Y* d* |% V/ L" B& \
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
$ _2 @" n ?/ g' O: g2 b lto the new routine to execute (hangs computer...)
' @+ L8 d4 s5 ~6 f- B
- b; a, P7 c9 Q' f mov ah, 25h
. u% o! \. U3 o) L! e3 h5 o mov al, Int_Number (01h or 03h)
$ ]5 M" v" I7 @5 W; Z mov dx, offset New_Int_Routine
- k3 s" v2 `1 T int 21h
9 o* \- y/ O7 \. i1 ~! a7 \0 L/ a$ G/ _; A* k' G# }+ e
__________________________________________________________________________
' Z- \; F, B# z9 w& j$ V @
8 F- O3 B9 ^7 Z! |: h. |Method 09# l6 A& H5 d% Q7 o0 z5 b
=========. B' |# L5 B9 H2 m w- |/ o& |; m
; }2 F! Q- _7 P, @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 X, {$ s6 u: I9 q7 `9 |( T7 z* e
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ F1 U+ h8 t2 z! v# K# H' g( IThe Get_DDB service is used to determine whether or not a VxD is installed0 J K6 j4 t/ }* [
for the specified device and returns a Device Description Block (in ecx) for0 L* l5 U, |) L( d5 L9 h
that device if it is installed.* t, } f! U( z. t, J: r7 F4 _6 p& z
- U3 T8 R. y! l/ `
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID+ w0 n; @+ G4 R3 z
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 Z8 I: m! N% d
VMMCall Get_DDB4 v8 X7 Z) c% I6 q5 w& g7 ?# F: l. `8 I
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* p/ v3 E% A+ {* {7 |/ |7 P' E% p; e( [! J
Note as well that you can easily detect this method with SoftICE:
4 @6 s. i* ^6 _8 x4 N bpx Get_DDB if ax==0202 || ax==7a5fh0 g3 `8 S* A, F5 |
; |6 D$ j5 Y+ K5 L1 X1 k" {* P: W" j
__________________________________________________________________________
# z; Y9 z2 m0 d( e; J4 o$ L
# F; J- Y; z K4 k6 U1 V8 rMethod 10
8 w- K( B5 H/ S3 }+ i6 |% ^* U=========2 H% e# G. I2 g4 a/ Y2 _
. s5 T/ \; N. U1 @1 D \=>Disable or clear breakpoints before using this feature. DO NOT trace with0 q9 c& l: O3 t
SoftICE while the option is enable!!
3 K( J0 W5 {% {& t0 U8 m: z5 L" T, R8 ?# d: s+ ?
This trick is very efficient:' e( M) s" n7 X0 k# J/ g n& I/ _
by checking the Debug Registers, you can detect if SoftICE is loaded$ h8 k0 Z. h$ j* W& A( _
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 p6 G* [9 C" z6 n
there are some memory breakpoints set (dr0 to dr3) simply by reading their& I. Y/ D0 o8 @* C1 l0 e0 X: y
value (in ring0 only). Values can be manipulated and or changed as well4 p+ \1 T$ q/ |) R% P W4 G
(clearing BPMs for instance)
7 `# f% i7 J( z: q& v; M" M1 C; N. E3 {8 z2 I
__________________________________________________________________________: Z2 O7 ` ^6 l5 r* G! r
3 G) _. P$ A6 e4 e8 `Method 115 \- f+ {0 H" R) o9 Z
=========
2 y$ n" r- i) e# w8 ?: _6 O
0 Z# C- D! k2 `This method is most known as 'MeltICE' because it has been freely distributed
+ {% g$ |0 C( N; P" s# Yvia www.winfiles.com. However it was first used by NuMega people to allow
# a3 I1 b8 C! L( n/ |Symbol Loader to check if SoftICE was active or not (the code is located
% D9 y& R/ G0 _+ p6 sinside nmtrans.dll).
2 A1 _0 E+ N: b3 h- i ?0 v* ~6 `8 K/ \" T$ M) [3 G7 }2 k
The way it works is very simple:: g; g5 I& U9 }9 V6 @3 C2 d$ ?
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 m% \- a& t( N1 a3 N* n7 n: f2 jWinNT) with the CreateFileA API.
0 T* \0 L% i) t g A9 Q, g$ ^: H, h) u& N v
Here is a sample (checking for 'SICE'):
. V6 T0 O; J1 k7 x1 X- Q( ^
$ `4 ]+ x" O2 G- GBOOL IsSoftIce95Loaded(); E8 s7 { q+ x5 I X
{
5 L0 X" J: c) r4 Y! ?6 ` HANDLE hFile;
1 t; i/ v0 L1 d: q hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
# m% E% q1 C: q" K, p9 }' k FILE_SHARE_READ | FILE_SHARE_WRITE,8 E6 z: ]6 W; @7 Y
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
9 k. S8 Q5 s6 D7 L9 B- H4 B7 T if( hFile != INVALID_HANDLE_VALUE )
7 n3 n9 W! h( E$ F0 s {0 q7 h* o( ~6 n- p% G! C- H
CloseHandle(hFile);
& U) i$ a" I$ q' L$ | return TRUE;
8 N% _+ S7 q+ K5 j }
5 b2 S1 V7 c2 l# l return FALSE;! |" R# ^1 X# r% ~' R* y) m" n7 {
}/ ~- x9 H1 @. }5 h
9 t! R8 \. c7 f( K' ?! |8 V6 U
Although this trick calls the CreateFileA function, don't even expect to be% ~; ^. C- U$ q
able to intercept it by installing a IFS hook: it will not work, no way!
' m6 k( e5 {* { j: n! ZIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
; \0 u Q6 Y) W0 ~5 U/ zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 T( `2 W5 p' A* P/ B4 O% Fand then browse the DDB list until it find the VxD and its DDB_Control_Proc1 }9 J2 F7 i; ^, m+ d
field.
5 L4 ~# v" I v# R( SIn fact, its purpose is not to load/unload VxDs but only to send a
8 b) D7 q9 f: e0 I/ \W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE) p @+ F0 n4 W* P, m: [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try2 U6 v; r6 _" [$ b
to load/unload a non-dynamically loadable driver such as SoftICE ;-)./ ]' m6 m7 _2 l
If the VxD is loaded, it will always clear eax and the Carry flag to allow
( T2 }7 {) r6 A0 B- dits handle to be opened and then, will be detected." q$ K$ Q! h; \% f% R
You can check that simply by hooking Winice.exe control proc entry point
; h5 t E( P) `while running MeltICE.
" G" I0 V# y {5 b# K
* H- l2 t' i' f1 Z7 R; i
2 V. r W. Z- `* Q: h& i 00401067: push 00402025 ; \\.\SICE
4 N7 d1 c$ {. D$ B; N3 ^ 0040106C: call CreateFileA" v' }" X5 a' u% B. k0 t( ]
00401071: cmp eax,-0012 |0 T0 `4 g/ K+ J: ?
00401074: je 00401091
$ w. j; N. J8 k6 I8 C/ o8 C/ d
; \& h# ?4 c9 k! P4 ^8 G4 _3 }6 p! R2 `1 C" L8 p2 B h. f5 B
There could be hundreds of BPX you could use to detect this trick.
# ^- H0 D3 ?$ ~ ~" Y& `-The most classical one is:8 L: ?3 C9 x7 K q
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
) x: j1 ]( Y( g' s# S0 W2 M *(esp->4+4)=='NTIC'
$ W( N+ S5 j$ a4 w3 z
' Q+ a$ U: j; Z' Q" L-The most exotic ones (could be very slooooow :-(
/ S3 o+ `; ~8 \ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' i" f' z/ V( F5 o$ m ;will break 3 times :-(9 v& @7 [9 z: ~# R; W
7 s. e: Z, v2 {9 F
-or (a bit) faster: ' I* @& n2 I, [9 P
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'); [+ e1 A9 ?8 h3 e7 J
7 o2 i( ~ v5 }% p Y6 R BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' " Q& b. Y. s* c4 \; }
;will break 3 times :-(7 ~/ t: C, D; U* `$ T' k
0 G$ x |, M! y9 L, I$ P: N-Much faster:
3 a) `/ ^6 w3 N1 A, e G5 [ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 m) Z# {1 D+ D4 g8 ~9 z
+ x+ h1 l0 v+ V9 y: V: I' {! _6 N
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 d5 h/ |, q/ s/ L0 K8 _2 u
function to do the same job:
. U; t% b3 h' f" R# C% }5 v0 {' H
( J( ?* h" U8 }! j push 00 ; OF_READ# q0 x4 l u% D1 m2 }
mov eax,[00656634] ; '\\.\SICE',0+ d- K$ q: g j5 e7 J& ^
push eax
; A I$ G$ V" Q1 e call KERNEL32!_lopen
' _8 c7 @# m/ c inc eax
9 A9 J5 p+ d3 K: r( Y2 c6 I, l jnz 00650589 ; detected
% E/ M. q5 [8 N* u' F' J push 00 ; OF_READ
3 x* c1 J5 F# U) J- j mov eax,[00656638] ; '\\.\SICE'
3 o( L+ c g* A, e( ]7 x push eax
) O# p0 x2 e4 A+ e call KERNEL32!_lopen+ N& C" z+ ^, c. L2 t8 r/ k: i- ]
inc eax
! M% @6 m) X8 w( _2 P0 V/ f jz 006505ae ; not detected R' E/ N7 _' K1 J4 I: t" I& x& Y' V
- l0 S: |/ J5 t& V2 j
( ^, ^7 k! ~/ k6 U. G0 D* ^% |__________________________________________________________________________1 Z, l# Y" t* `4 q# W
2 Y/ z" L& R: B; G/ u. ?" R
Method 12) y, D/ n% R0 E+ o+ s
=========% ~3 l8 a8 b& \
, Z0 n' L) ?5 B9 p) t; [
This trick is similar to int41h/4fh Debugger installation check (code 05
* L7 I2 i6 e$ ^& |7 M! V& 06) but very limited because it's only available for Win95/98 (not NT)
9 f2 \3 Q7 z; y2 O: A: i5 Tas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
7 \) ~- r2 J$ I/ D: c
0 o( W' p, q# g" O& f push 0000004fh ; function 4fh
7 ]0 d; M9 p: }6 v8 d% n# N1 H push 002a002ah ; high word specifies which VxD (VWIN32)
. R$ }/ e8 Y2 N5 W4 q, m! i! z; ? ; low word specifies which service
3 q8 U3 k" ~# n2 x) Y3 l7 t) C (VWIN32_Int41Dispatch)
* _7 o6 }% ?9 Z$ t" u: Y. u6 C% ] call Kernel32!ORD_001 ; VxdCall0 |% F0 i- e% z
cmp ax, 0f386h ; magic number returned by system debuggers4 ]7 V8 j" M* M2 t, a" U: j
jz SoftICE_detected
# y; l% t: ?- y T! F2 }4 P$ H- {5 P% {) o& T) N
Here again, several ways to detect it:
- z: y$ R1 Y; H5 [5 s' w
; `; Z$ \6 \8 k8 i# v BPINT 41 if ax==4f
$ h; K1 V, o1 p& n/ L
% G4 b& A" G* W3 t- J" y4 c3 T BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: _) S3 W+ }, g, {) Y1 O
+ \% C5 d9 K0 m( [$ H4 p6 p" [ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A. z& T+ V4 ]$ v: F; @; f
2 P& H2 d) A0 x* `6 p6 t8 Q BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, a4 H* o6 {3 h; [! @0 H( C. H. }# k; G0 r& `0 [4 n! E
__________________________________________________________________________4 k$ ^# O# u% ?# L- E& ~
( H% d; }$ M( oMethod 13
& s3 x8 ]% Y& P& \=========
/ n% m5 j& {0 l. v/ y- P+ c6 M. q1 {2 U5 X# D9 m
Not a real method of detection, but a good way to know if SoftICE is7 K" [, K; L% ?; }/ K8 I! A
installed on a computer and to locate its installation directory.. \8 N3 M9 C% ^ N" `
It is used by few softs which access the following registry keys (usually #2) :- V/ @% v3 S6 p p' ^' ]
1 I' @ B. R4 Z5 u$ Y* h% I! p-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ {0 Q) y9 F( a4 g3 g7 L2 A! s\Uninstall\SoftICE
# R6 v0 a ]3 I, o0 m& a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% V2 _$ M) ~$ F8 L" ^/ |
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ r# h( K L& Q* i+ ~1 r
\App Paths\Loader32.Exe
( w8 ~ p3 h) q
& ~' J$ ]# r3 m, B' I8 O
! u; U& f4 I" n, w9 a) VNote that some nasty apps could then erase all files from SoftICE directory
6 y8 L5 ]2 N* F, P( o Y(I faced that once :-(' B" M( G0 g2 [% ~
1 _) k" @% J4 b* @. w2 {Useful breakpoint to detect it:
$ u, h& N/ a$ L! Z9 p5 ?
- D- D* W5 U" c7 W6 g BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
' D9 ] T# @; H2 ]: ^8 H1 j- v6 T2 o
5 W0 r8 A1 s8 R- ?+ z; J__________________________________________________________________________
' X4 Q$ r0 @8 C8 j+ ^6 { w
0 J$ s p- H' j/ d/ G# B9 h8 [0 q: N( x3 C
Method 14 7 N. O+ K" F2 |/ v7 ]
=========
1 q% Q1 X" E4 n7 r, }5 ^- D* g& P
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) q/ k7 F/ ^2 j$ p
is to determines whether a debugger is running on your system (ring0 only).
. i) r$ N! A% U7 {
4 v2 g' g% R$ | VMMCall Test_Debug_Installed+ x' z7 F$ A+ T/ u. W6 M0 g; U2 W
je not_installed
& Y: J4 v1 F4 i# h2 d; I" T! D5 A( Q; q
This service just checks a flag.# i: }8 c. B1 }' e
</PRE></TD></TR></TBODY></TABLE> |