<TABLE width=500>" v- M5 l' a: D9 C. E
<TBODY>$ N6 g* ]5 H+ k2 y3 n1 ^0 U0 c
<TR>
( F1 |' e4 ]- P. B/ p3 p<TD><PRE>Method 01 . r( {- o. c& z5 B% c, m
=========8 u# U2 m* O8 N2 g S, P3 o
- n6 A1 A+ X5 U7 M- @6 {$ AThis method of detection of SoftICE (as well as the following one) is, u+ r% w7 N& K
used by the majority of packers/encryptors found on Internet.
O8 J% Y6 Q D' YIt seeks the signature of BoundsChecker in SoftICE
+ d2 Q% h& u5 Q/ v) K% r' p, b
4 x5 o# [* D' b% q3 B7 A mov ebp, 04243484Bh ; 'BCHK'. {4 I3 v& U2 k- }! s' K* J' j
mov ax, 04h* a3 y8 B7 A7 R) x- V# ]% V
int 3
4 D }1 F5 N; z: Y/ J( i cmp al,4
! w2 [6 N) J+ M# a* S jnz SoftICE_Detected; k8 {# K( j( O s
" ~0 C0 g/ P* [___________________________________________________________________________
( X$ f8 E1 C% x3 R9 d' l. F0 Y( `+ c) t/ D) T {- \4 D* N* s
Method 02
- R* H# B% t; E9 y/ j# m* E0 j2 m=========
9 N: [9 q+ ~' e& }: w
# p: q7 i4 }' ~% s( KStill a method very much used (perhaps the most frequent one). It is used
" ]: @1 L' ]; O8 h2 e+ ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,' }1 R' r, l/ i* e& a/ t6 _
or execute SoftICE commands...
9 B. X5 u- E! g. }4 {% NIt is also used to crash SoftICE and to force it to execute any commands" e. B6 ^: T' @% O: U! S# T+ Y8 h
(HBOOT...) :-((
4 E U1 I0 E# N8 L5 e& K2 `
& v8 ~, U# F; G) b z& F; THere is a quick description:% l" o- v: F6 A) v2 y
-AX = 0910h (Display string in SIce windows)% H6 H# f3 h1 n0 J1 z) I; S) j4 k
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' u4 p# j; [0 z' a5 A
-AX = 0912h (Get breakpoint infos)$ E8 s7 W. e h" I7 W
-AX = 0913h (Set Sice breakpoints): m0 r0 [) S& @9 I0 d; W! u
-AX = 0914h (Remove SIce breakoints)
! B" B3 J+ |/ L# b, ^" h" ^
' {/ h* \ b$ C4 @5 x: @/ n, DEach time you'll meet this trick, you'll see:
0 Y. p5 E8 C8 f7 _-SI = 4647h
9 G- H- _7 F# R-DI = 4A4Dh
8 s$ t6 g2 w0 ~6 j9 b \6 Y/ K ~" S5 PWhich are the 'magic values' used by SoftIce.$ V3 Y6 ^7 r2 t8 X) B/ Y3 D
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.. W" P- v; {5 w7 f
5 B" O" J, Z0 {5 d/ R- pHere is one example from the file "Haspinst.exe" which is the dongle HASP7 ?& A* s' H& P/ C& L3 h2 A: H" j
Envelope utility use to protect DOS applications:
+ l/ c$ S/ |9 \8 a% D2 T6 V
& K+ |% B5 v$ A, ?% u
+ a1 n& W' Y% ~! e8 ?4C19:0095 MOV AX,0911 ; execute command.
?' _3 @' g, s4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).( ~5 g9 D: h; i1 F2 Z; s6 D% l& }
4C19:009A MOV SI,4647 ; 1st magic value.- j/ I" [# Z: d) B6 c
4C19:009D MOV DI,4A4D ; 2nd magic value.# ]6 \. j Q3 N4 g; U
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* P% f3 w8 [7 N
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
9 L0 |2 \/ z& G- N4C19:00A4 INC CX
* ]; A! w' T4 j/ j4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 C! ]! T8 o( O7 }, L3 s( t2 ]4C19:00A8 JB 0095 ; 6 different commands.
6 j/ L$ W+ d( d8 y. T! ]+ Q" l4C19:00AA JMP 0002 ; Bad_Guy jmp back.
5 S/ I9 K! R& E6 H4 O& C( b4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( E. a P4 s" }7 |% i
. Y6 I; I; B4 A4 K; @The program will execute 6 different SIce commands located at ds:dx, which
+ q5 i, J' n5 ` [1 K$ a8 vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' {2 F! q: X8 ]2 T0 D& l3 V0 I& b! z' a0 X! T
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
2 l2 g! _% L+ z; z0 k___________________________________________________________________________$ \! J$ M5 e6 B! ^5 K! j
; k8 l* S2 q- h1 \& X7 f" p: V! y+ c. p4 c
Method 031 Y6 h# v2 p: y! J% c8 G
=========# J! b I& v; W
+ @, y$ M( e* K U; `
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 x9 s5 J( {8 j! N
(API Get entry point)
0 \- ~# H/ A$ E4 C
8 r+ v- Q! E; e7 s5 R3 O7 `5 i5 P7 f3 M% {+ `( w2 A% B$ `
xor di,di
5 {. e6 v" A) E% V5 K/ Y1 |$ w mov es,di* y4 |. o$ m6 ^# S
mov ax, 1684h
' d; o' E) F) B4 @- [ mov bx, 0202h ; VxD ID of winice
7 y( ?( a& R* M; Q2 K- I; r3 B int 2Fh
! _) `" b+ u& j; x m5 _ mov ax, es ; ES:DI -> VxD API entry point) q7 ?3 c m9 I$ _3 h8 i+ U( J, n
add ax, di
# K& S" ?" D# ~' ]/ W4 ` test ax,ax, O" t4 j, Y+ \2 O9 ?; v7 W
jnz SoftICE_Detected
: `* i' ?6 t3 e9 p, K
+ Q l+ V* o9 w" n% J___________________________________________________________________________
" Z$ `6 A0 j8 B3 h! m; F- Q+ P( v* T% L/ }
Method 04
; a1 u. |1 O( C8 T=========
$ S+ h/ [' W3 G3 T2 u# ~( j( |
+ {7 M2 @' |& l7 u2 i2 GMethod identical to the preceding one except that it seeks the ID of SoftICE* c7 O% W$ f6 ^6 @
GFX VxD.
8 W O0 w) ^- {" f! L1 P9 \. C6 b! A# K& X
xor di,di: ^' _+ `+ P: r/ ]- U- ^" f [
mov es,di: H9 c D9 V& h% ~
mov ax, 1684h , l. x' I1 z: O w7 @5 U
mov bx, 7a5Fh ; VxD ID of SIWVID3 g: l5 c; l- v( {( G B+ z! r0 E% p
int 2fh' ]* i) b) x( W+ c0 H/ d4 R6 R
mov ax, es ; ES:DI -> VxD API entry point
2 ?- ]7 N5 |# W* {# v4 K* [- l | add ax, di: C2 {' J" ^5 R' P6 f" P
test ax,ax
7 _7 _% `5 n( T/ N4 G4 u) ? jnz SoftICE_Detected6 p; B) B. N# x' H
& B9 o, k) ~' A1 p) v- U/ q2 u__________________________________________________________________________/ l# c+ E3 z% l6 X _ p7 `
" y k* ^% M" x/ d. d
& Q4 ]" N" n$ l3 CMethod 05" c. p* K( o, M3 @, I1 p, G/ X& N7 s
=========
* }0 T9 u V$ t# _4 ]
0 S+ Y! \5 ^4 ], bMethod seeking the 'magic number' 0F386h returned (in ax) by all system
, }* q7 y7 C% G- s. Ldebugger. It calls the int 41h, function 4Fh.- l; ^4 U' U* ~7 x+ K
There are several alternatives. 5 o0 h, i K+ B; V0 ?
% Y2 c+ G) f( M( w3 g
The following one is the simplest:) I# _* X5 d; W9 g1 g
9 V% E) z$ T9 F6 T1 d mov ax,4fh
7 b+ Z; \( T2 r6 H$ D- ]6 \( o int 41h/ T2 x+ l( K4 t9 o
cmp ax, 0F386
- H* z1 [0 Y9 X% W# p$ w jz SoftICE_detected
* ]+ L6 u: W" W9 C' J+ ?7 z0 A( B: C* l/ n7 T1 s8 V$ m* d
7 z% ?( v$ ~& nNext method as well as the following one are 2 examples from Stone's
7 Q5 F4 i# ?! j1 t. @"stn-wid.zip" (www.cracking.net):: k$ r6 N, T9 `7 K1 k$ @2 y
1 b o- U0 E! g; M mov bx, cs
% M, U" }8 R3 C9 V8 h# Z7 | lea dx, int41handler2
4 g5 w/ S% C4 ^0 e xchg dx, es:[41h*4]2 S9 ]" `+ h. O- S5 m& H
xchg bx, es:[41h*4+2]
4 t7 a- _# r' w0 X& V mov ax,4fh' Y* a7 T" ~6 }' {. ]; g, n
int 41h6 [% {7 K0 D' ^& Z' O
xchg dx, es:[41h*4]4 D/ u' H# t4 K1 ~ |0 [ P; a l
xchg bx, es:[41h*4+2]
% @& `: `( E, ?1 W! ^ cmp ax, 0f386h" k8 U8 b2 ~: k: G$ K# v4 w; s
jz SoftICE_detected
2 E) D1 u+ }# A$ s" e; U) I* @. d/ W% x/ H
int41handler2 PROC
8 `. x! _. M. M" T iret
) h2 Y7 l7 f+ w0 C% f; Yint41handler2 ENDP
! J+ U0 V2 N' H& P3 f5 a# w& a
+ N4 [; J6 n3 W/ y7 x- m3 z( n
6 G0 H0 ?5 i. @( J_________________________________________________________________________; ?6 f" w8 |3 `" p t7 |
+ b- t0 l' O6 V6 T& I. O) I" B: k* v+ \( x
Method 064 s& z( t1 b4 g5 m. H
=========
7 s4 c) `: H* A: X3 w8 N
: ?9 V/ K4 s1 m1 b; i! d$ `" u s7 I j4 ^, Y, s6 ]
2nd method similar to the preceding one but more difficult to detect:
7 u. \/ M1 D& r5 u4 S; M0 q: Y4 ?% C7 q( g
9 [% ~8 {/ D6 W; M; d: }: F8 N& P# z
int41handler PROC
+ J- D! A+ O3 S( A3 | mov cl,al" O; W- H) n6 z' L
iret
5 i( s+ [$ \1 \* h0 T" dint41handler ENDP) B* x, q2 b" I4 Z" R7 y2 K
& f2 Y( C- q4 K$ |2 Q
/ `8 ~5 Z% a4 c1 t% A+ U+ I
xor ax,ax
4 i+ W3 p |3 X' @+ I+ A mov es,ax
/ U6 z" k Z, r9 [ mov bx, cs2 g$ j2 I. ~: I$ t$ K" I$ l
lea dx, int41handler1 ]7 e5 @8 [. f' {
xchg dx, es:[41h*4]$ a2 \7 u& t; W3 P- F- |! u
xchg bx, es:[41h*4+2]
1 a. v: c, c- M k9 u, y; h in al, 40h
: n+ \ }" o, L- [ xor cx,cx
5 D# U& M/ g) w1 @9 _& i int 41h
/ F: {9 z5 F& \$ L4 \4 x9 E xchg dx, es:[41h*4]& a9 h6 j+ L' Y$ x2 ?8 b: L
xchg bx, es:[41h*4+2]2 P6 j, w, q/ ]* D
cmp cl,al. I8 E) b; y, h+ h
jnz SoftICE_detected: \- c& e8 I" K8 y
, }# `, a" p$ u_________________________________________________________________________) y9 u9 J0 K( A3 T2 P' x4 _
9 H, ?* G0 F; I8 A* C) a, _
Method 07 J3 C0 |2 `* R- j, t( t2 ^
=========. g! M% a* l$ t ]: z3 b) \8 W l, R8 P
/ ]$ ^* o$ }; g+ V+ g1 U
Method of detection of the WinICE handler in the int68h (V86)
, L6 [; d5 r& w- ]- G$ j1 p+ H1 b _7 ]" g" V) d: |
mov ah,43h! l N! Y/ e" p' d0 }5 {
int 68h6 @1 U7 Z9 V8 L4 a
cmp ax,0F386h
% Z& x S" y, d2 p9 { jz SoftICE_Detected+ c' s Y0 _' @4 w. ?/ E
4 J5 T. `5 L/ A
, U. r [3 T& g) k+ @5 V
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% M- A0 B9 E" M8 t# q4 b3 N
app like this:% @6 P+ x% Z5 o4 c; s9 }/ n1 }
/ s. S0 R6 Q4 P7 x% n
BPX exec_int if ax==685 D6 O7 V7 B& y
(function called is located at byte ptr [ebp+1Dh] and client eip is/ K9 \$ E/ E( k: p4 H
located at [ebp+48h] for 32Bit apps)- G: U1 C. D( M E
__________________________________________________________________________5 ^- J, s7 }5 s, c; {
4 z- {! [6 P: E" B/ U6 L) {( k
V @$ t% V8 D3 j) O' LMethod 08
- y3 i5 s) {/ Y! ^=========
' K8 I; F* \) _$ J4 C: \" g( ^4 Q
8 D/ W5 y$ N% S1 Y% P% vIt is not a method of detection of SoftICE but a possibility to crash the4 v. R8 N# F( E; b0 B
system by intercepting int 01h and int 03h and redirecting them to another
, r: v. f: E) |7 Lroutine.0 P2 F! p0 j- a1 S
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 R' g4 N; E9 v6 P8 ?
to the new routine to execute (hangs computer...): i7 h6 t; j5 H1 Q( \- }
- r& S; }) l$ ]% r* ^ mov ah, 25h( N7 g3 ~ Q0 B5 c$ A; U
mov al, Int_Number (01h or 03h)
' N2 t! w* l7 E+ P. q mov dx, offset New_Int_Routine
$ ]/ i. q2 [& K" |" b u2 e int 21h
* G: c9 L1 P3 M/ V4 \
7 \1 u$ T+ j X+ M7 e' ?__________________________________________________________________________' W( X( V, ^/ u1 n8 Y
9 ]- m# K+ \! Y. \6 B3 r) v* LMethod 09
& T; I- s' A! S0 q$ i; k7 v7 t" H=========
R1 _9 \" O5 t6 j* P0 A6 z" i8 j9 l( J
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' F" n% `$ |+ S: a
performed in ring0 (VxD or a ring3 app using the VxdCall).
6 K R: [& d# k# LThe Get_DDB service is used to determine whether or not a VxD is installed
# Y; e6 w1 x7 i6 Ofor the specified device and returns a Device Description Block (in ecx) for
$ e/ J: c1 ]; _# @4 P) kthat device if it is installed.
" @. I8 F- {6 ~7 a
0 ]* ^: d# X. [( T mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, C/ ?# v+ [& E) Y( f mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" V7 E0 N9 {) K, q VMMCall Get_DDB
! ?0 \. T; Q+ x( j+ v1 M mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& Q+ v; P' {9 z
# M, s, b. ^8 f8 v9 u5 G3 ^- {* x
Note as well that you can easily detect this method with SoftICE:* Q$ r! a) | e; R
bpx Get_DDB if ax==0202 || ax==7a5fh7 w, q9 N. \# X! E
0 g9 j! L" }9 @% c__________________________________________________________________________7 O$ y! A2 K u
' S0 I/ |6 q2 `$ E0 Z/ T$ H- |9 B
Method 10
( I3 S" y% i4 @# v, ]# X=========. ]+ g* d! `* N3 g' A- v
. I( y- \$ |* p=>Disable or clear breakpoints before using this feature. DO NOT trace with
: K5 `- m. X; T- V% g: a SoftICE while the option is enable!!
4 _- V( q0 y* B8 H
5 ?0 ~ F6 m' `# Y! C. qThis trick is very efficient:) n0 i5 x. y, [8 k! B; g3 O" P. h
by checking the Debug Registers, you can detect if SoftICE is loaded( J5 R9 q# i2 a: J9 z2 w$ @- b
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- ^! o8 o$ ~/ Z
there are some memory breakpoints set (dr0 to dr3) simply by reading their+ A( a- m4 l t: p% z' t5 y
value (in ring0 only). Values can be manipulated and or changed as well$ B' |; {! w, r
(clearing BPMs for instance)( R4 q1 s" f ]; N; h
, a! K( ?( f" e% E- ]0 B5 r. E
__________________________________________________________________________% b0 g. @4 n6 g& }- R' b
( ]/ ~6 T* @% Z# t# a) {, g2 p! N$ YMethod 119 T/ x0 g1 d. i, }& ^; Y0 `
=========
& X$ K' |* K! ?( n$ m5 q, T# G2 v- m3 V$ v1 k4 {+ s
This method is most known as 'MeltICE' because it has been freely distributed
6 o5 B7 ]* w9 ovia www.winfiles.com. However it was first used by NuMega people to allow, K; z" w4 }' ^/ X) n, i! D
Symbol Loader to check if SoftICE was active or not (the code is located
+ f3 E* i$ W$ I/ Q# }* iinside nmtrans.dll).
0 U7 z& z+ f0 `- e3 I2 u8 J# |4 [
8 k9 e- o/ R9 c/ J/ _# gThe way it works is very simple:
" y8 q" A/ {( VIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! Q/ M2 s8 i+ Y" E! SWinNT) with the CreateFileA API.
8 J* B. f# N3 l& @; w8 \6 V9 L/ |- C5 T& W
Here is a sample (checking for 'SICE'): l- _: k0 f8 T; |7 w# o
6 c2 ^+ o# g3 G; E( n3 Q8 XBOOL IsSoftIce95Loaded()
6 N7 [2 E2 O5 y1 j& @{: U7 z1 ]; k# S$ [' i0 {4 D
HANDLE hFile; 1 a3 ^7 V5 T. r0 }: U
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' H" g7 J& {! s) F* Y FILE_SHARE_READ | FILE_SHARE_WRITE,
4 O) g! M( Z' }. }0 t# p NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# N+ r# ]$ ]. X- J Y, w' Q
if( hFile != INVALID_HANDLE_VALUE )
; {4 H" D \$ c+ ~' H- p' R {
; C, u9 g0 `7 }+ f, p7 T CloseHandle(hFile);
6 }& q% O" X2 \9 z( }( g4 J8 _) S8 h return TRUE;2 W3 Z4 H. l& m& x: g
}7 a0 F. Q: m) O9 x
return FALSE;: c6 c$ j& T; h+ I; |4 }6 R7 J: [
}
" f$ C V; m; S" m% Y2 i& {; p
& A7 l% q% Z( K3 jAlthough this trick calls the CreateFileA function, don't even expect to be2 ^2 k/ x8 _; |; G8 _, q4 g: ?
able to intercept it by installing a IFS hook: it will not work, no way!& S4 P/ f+ U, {# B
In fact, after the call to CreateFileA it will get through VWIN32 0x001F) x* D& s% L5 e; z
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
6 e, j; U; U; f/ u" xand then browse the DDB list until it find the VxD and its DDB_Control_Proc9 s" i, O+ K. Y4 I
field.8 A* ~, p: c' O( l
In fact, its purpose is not to load/unload VxDs but only to send a
. U- p3 F" o' O& ]W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 _. M8 l( U) @; x- Y/ o
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
+ `4 [' k/ i& s d& Kto load/unload a non-dynamically loadable driver such as SoftICE ;-).1 [7 i! `" B; o2 a. Q# l# y
If the VxD is loaded, it will always clear eax and the Carry flag to allow
5 q$ A& M. \6 I0 K& t6 L% F3 bits handle to be opened and then, will be detected.
9 U# C8 T1 }- z, S8 sYou can check that simply by hooking Winice.exe control proc entry point
) N2 |) D6 D7 L$ D7 Q- c' W2 Xwhile running MeltICE.) q2 @4 J9 b+ B0 M
. z1 @" p' T1 ^1 u& L- e9 A. V+ F
5 Q" e+ X+ }/ D 00401067: push 00402025 ; \\.\SICE
0 ~ X& u0 ~1 c8 I. F8 k4 O9 ^/ v 0040106C: call CreateFileA8 G; D( R0 A' D) P& K
00401071: cmp eax,-001
9 L# V% p, W, C" S1 O8 `! ~ 00401074: je 00401091$ j# ?7 G! f' \4 \$ e
/ L3 C6 T& p' C$ ?5 T
7 u4 H, w$ k4 U6 W" o% ]8 @4 ^0 DThere could be hundreds of BPX you could use to detect this trick.
& F! i) p b2 [9 W7 G-The most classical one is:
- ^, x: {( }7 e- q2 ^6 t BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||% c- b3 ]) s6 ]# S2 d# F
*(esp->4+4)=='NTIC'
; }/ x0 Q% `% o+ P: [7 A7 T v t5 j. J9 A6 F4 J& u9 J
-The most exotic ones (could be very slooooow :-(# a! V# w; `6 ^# B
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 E/ v4 i; M5 s" F2 z
;will break 3 times :-(
9 ]/ T0 k1 j' Y% e4 c3 V
( H5 d, F l5 H, R-or (a bit) faster: 4 Z$ ~& }0 F" p) _7 |. U* i! O
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ z" k H' S+ C# m
6 _4 B: _- k7 e' x' ?$ k! A# M' p BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ _6 e9 h0 t1 g+ V# [+ j/ H ;will break 3 times :-(9 N; q9 R- L; B3 z
X* I0 K2 L) n' U: }/ z-Much faster:
9 J7 u1 O4 _% M$ e BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' b" `8 o* f- m- l: n
y. Q" B+ N- A z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 g% d* {% N& r2 _ x& Tfunction to do the same job:
* L% q' ~6 j. C/ ]1 B8 a* L% V9 ?8 J1 s
push 00 ; OF_READ1 e f* C6 t( q
mov eax,[00656634] ; '\\.\SICE',0
& O1 T% O* M4 G% |8 Z j* v" { push eax7 z$ c% T! ~& Q9 R# R
call KERNEL32!_lopen
' l, c' h: T1 O2 o! k& H* b" h z inc eax; m2 S$ b& C: G* j- a
jnz 00650589 ; detected
" m) c/ o4 p6 O8 ^+ s0 z push 00 ; OF_READ1 F# D4 G; H; n) r% W0 z6 e
mov eax,[00656638] ; '\\.\SICE'
% s8 d" M/ u" A; A G push eax
4 P6 E5 X8 `4 ^% ?5 G4 s call KERNEL32!_lopen; `. u0 N9 \" }( ~0 w- D t
inc eax3 q6 e4 i; E; N1 \3 T
jz 006505ae ; not detected
: | V8 M8 c. E: O- c/ @. a- T' W& T6 @8 ~6 F0 q
% a0 F1 I$ R v, a) N
__________________________________________________________________________
" W- z' r: W e4 D/ {! s: R) n
# X: \: I3 f( J9 g# z9 T" HMethod 12
2 d' Y6 N2 c- J( G! C1 W: B Z=========
( T8 `6 B- N0 G* _6 I1 z
9 p9 P y# w4 O7 k: s0 kThis trick is similar to int41h/4fh Debugger installation check (code 055 `0 b1 n6 W* q! h! Y& z" G) c
& 06) but very limited because it's only available for Win95/98 (not NT)
6 \- z3 [1 i* m7 l3 o8 e) n; u( mas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 {. P4 C; u: f& E; ^
, o( R% Q6 Q" d. D push 0000004fh ; function 4fh
* p- _6 c e0 t8 f' L/ |! p push 002a002ah ; high word specifies which VxD (VWIN32)1 p" j. f9 s; u. V3 U& X" R) Q' t
; low word specifies which service3 U! x, M$ |! U) V4 M
(VWIN32_Int41Dispatch)
6 Q `. ]- O- S; O8 Q+ M5 ? call Kernel32!ORD_001 ; VxdCall
5 J" @) S. G1 L' S/ U3 t cmp ax, 0f386h ; magic number returned by system debuggers; A. p5 D, C* W0 r% Z5 k' _
jz SoftICE_detected
5 U7 S% d$ `6 p! @1 r# ~
9 [ N, _: M# t! g9 X+ w; d' N$ Z! S1 `Here again, several ways to detect it:
- k& K; `8 ^- n4 P' C
, T n3 s$ i. `1 [8 Y: P. Q4 \ BPINT 41 if ax==4f
' ], o7 f: W$ X+ \% z! k/ @' N& N8 C3 f% ^& a7 {! l
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 |$ y/ V+ T5 m+ I9 R+ R' y
) r1 O7 H* U4 V( ~# ?+ N BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 d3 y$ i) g- a% R
, K: U$ y+ o; f X+ }/ m BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!3 c. Y" E) T4 @/ F: h! E/ ~
: M2 d! E4 e9 G6 N; b
__________________________________________________________________________
h% b8 o4 E$ `) l& m! D2 G! _% L% V& A9 E2 t, }3 J
Method 133 Q" N3 p/ h8 @' H# ~3 L7 l; J" ]
=========- N! k" t4 o+ @" \2 U* U7 p# p' k4 k
: O* t6 z% T: k( gNot a real method of detection, but a good way to know if SoftICE is
D9 O1 E% p/ A" U4 n8 pinstalled on a computer and to locate its installation directory.
+ T9 W4 h C# k! v2 {5 ~8 aIt is used by few softs which access the following registry keys (usually #2) :' M/ n, ^ U$ O8 E- S
+ k9 M1 i- q) ]; }-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' N' W( w$ I3 x k- k\Uninstall\SoftICE
( A( X ]0 b5 q7 {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ w2 Z1 e' B" F' Z+ ~4 U-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; G, K& V9 R x0 _8 Z
\App Paths\Loader32.Exe
/ J$ f* l0 j- T5 Q: d [. P+ P& t. \+ k3 m/ u
! s/ h% R/ U% r& ~Note that some nasty apps could then erase all files from SoftICE directory
2 z4 t4 G! O/ _/ j' z6 H(I faced that once :-(9 ]/ q" n( [$ f: y! Y
9 c) U" P. g4 w. W0 e. E0 O
Useful breakpoint to detect it:
' {! T+ K% q9 g6 O5 Y C
0 ]4 h) S7 V: B: Q5 l+ S BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ O, x, z2 H/ ?8 K( A) @+ K
( K% ?, w3 d2 x$ m8 I K* t) F0 p
__________________________________________________________________________
3 Y$ E9 ~5 z6 c1 Y" l l/ K$ M6 K8 _' H; S6 m* J2 b
" q/ y# @3 @) Q% m% hMethod 14
; q8 p2 o" G h! [ i' R9 G=========
& {+ t/ }" e" u4 f
1 W' Y4 d* r- S# F+ _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
+ v" b& p- I: |0 g" d5 i; H7 Gis to determines whether a debugger is running on your system (ring0 only).
5 K& f& \; J3 @- u1 j- h5 s$ Q$ a y3 D S# u, `6 i( x( W G8 c
VMMCall Test_Debug_Installed; u' I t+ m m" m, B$ Q
je not_installed( a' n% Y5 m' J7 O
5 ~4 k3 r% c0 e8 ]This service just checks a flag.
4 |" J( A2 E' B$ t6 G</PRE></TD></TR></TBODY></TABLE> |