<TABLE width=500>0 Y% X6 K/ r' q# j8 `7 E# W
<TBODY>
/ N# T v/ y* N3 C$ m; h<TR>9 Z/ H. j6 M z4 v
<TD><PRE>Method 01 ( Z$ m- \, X8 Q' X
=========' j- g5 V$ x- a
5 A8 v3 e9 C$ p( f$ [ iThis method of detection of SoftICE (as well as the following one) is' z' g; U. ]# c' a$ d: T7 z
used by the majority of packers/encryptors found on Internet.
0 A2 U3 |" ^7 A, r0 }It seeks the signature of BoundsChecker in SoftICE
' Y% `) g5 G; ^( O" G% k7 F& N! S' j( I
mov ebp, 04243484Bh ; 'BCHK'3 I" ~; F# N6 y3 S
mov ax, 04h4 p' c1 r R* _2 C
int 3
; v) T% q$ j+ l9 G# r4 [# C cmp al,4
: @% {3 P% p' L jnz SoftICE_Detected
7 a' g) i, @; f6 Y
, a( P% e2 V7 Q! v7 _& {6 I& Q3 ____________________________________________________________________________& A p* q5 Z8 `
7 ]' |) p! n; ~+ N# Z' p/ q$ IMethod 02
" b: d" K) X9 U* }- Q n& @=========# I5 x& ~% S# `) O
* R/ y+ `4 d8 f! N! u# k* O7 FStill a method very much used (perhaps the most frequent one). It is used
& e w G7 G0 n+ z* W2 r ?to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
1 U# C! i: O- c) \or execute SoftICE commands...
2 D! w E' b) {1 g3 g# K- `It is also used to crash SoftICE and to force it to execute any commands
3 t4 P6 s: ~! s8 \( j7 g; Q3 c3 E( Z(HBOOT...) :-((
3 J0 @* p1 p9 `6 Q' u% v' q; X3 ]& T/ `/ r
Here is a quick description:
0 j% J1 ~; W( H! s-AX = 0910h (Display string in SIce windows)
y; I& H9 Y7 ~4 j& T-AX = 0911h (Execute SIce commands -command is displayed is ds:dx), F* n5 w2 @' B. X
-AX = 0912h (Get breakpoint infos)( C) ~' l$ l8 Z" h
-AX = 0913h (Set Sice breakpoints)1 g# Y" [4 V; F# [
-AX = 0914h (Remove SIce breakoints)
+ H- L1 N; b3 F& F9 o
( ?' W9 j7 R9 }6 e& J! @Each time you'll meet this trick, you'll see:7 ] g7 _9 ?) Z) v9 ?
-SI = 4647h8 m* F1 j, W$ g$ f3 H
-DI = 4A4Dh
" I8 {3 i: Q* V. |5 D! e2 ~$ OWhich are the 'magic values' used by SoftIce.
: A* ]# W5 u+ b6 k; n& }$ A8 \7 tFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.* k, g! ?+ r" O7 h
5 E* [+ H8 J) G; K7 {9 w W9 d
Here is one example from the file "Haspinst.exe" which is the dongle HASP
# f) A0 [' }9 E7 [/ UEnvelope utility use to protect DOS applications:) u4 {$ ^' z: \2 S
8 X& M5 _1 O; p9 ` t& U: t! r* S' \$ g' N9 B
4C19:0095 MOV AX,0911 ; execute command.
! y) ?2 u- W( s4 W+ a* [, g4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
6 a/ T4 o9 e- v: W X, n4C19:009A MOV SI,4647 ; 1st magic value.) ~* H0 p0 O; U4 z' h
4C19:009D MOV DI,4A4D ; 2nd magic value.' H: ~! |5 `9 ?+ c6 D9 Z. l; |1 n. s
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: G8 z, s$ V, J, y; O, t! a3 u/ V4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute0 |* |3 _2 ^* Q% S
4C19:00A4 INC CX1 P" h- |! v3 L% w# {# k% f2 h' L
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute9 M# b. I4 { X$ M1 {
4C19:00A8 JB 0095 ; 6 different commands.
3 d5 u- C/ q# {9 C) O4C19:00AA JMP 0002 ; Bad_Guy jmp back.
9 ^1 A: G \ L# s# U' V0 b4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ u) C9 K. p' ]2 i! G) k
9 J9 g# m x9 wThe program will execute 6 different SIce commands located at ds:dx, which) m+ H q% N: q# ^2 O; U
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 I# a5 V4 n# M( r( c
S1 e- {) {" M, N* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- m$ u: s0 z8 M1 R
___________________________________________________________________________
6 F7 \2 l0 ?) P; e# a! h
& N6 H+ N' ~. d2 q
3 |: a9 U( I) _Method 037 N! O; e1 Q% d- ?! @/ d
=========
7 G0 |; Z F! e8 s" ?. _, S6 ]# S4 d; F
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 z( ^" }/ ~( ~3 c/ S0 h' L
(API Get entry point)
7 D) X' F6 U, g8 ^: E" m) h4 B2 t6 X 3 g& u$ P( @1 ~; x' [6 Q7 _# p
6 g `, E3 C. b3 G! j3 @4 j) T
xor di,di
4 P0 u. J: v2 e* q+ C% i mov es,di
: R* l+ B) R ?8 b8 x4 N# O/ | mov ax, 1684h
9 W) H8 S) z" N4 [" J- J mov bx, 0202h ; VxD ID of winice' Q6 [: L" N, n& j0 n8 x7 G
int 2Fh/ m3 k5 {2 @1 C: G
mov ax, es ; ES:DI -> VxD API entry point7 Z* D7 h3 x2 N) i
add ax, di
& \8 n3 q8 Y7 C7 Z test ax,ax
, ~; J) a, s8 } jnz SoftICE_Detected# Q$ s. y4 w$ p$ q$ U
4 q6 q Q/ ~, _5 p$ B9 c
___________________________________________________________________________$ N: r4 m# o! X( z
& H" y8 v7 }( a# d! k0 ^Method 04" h4 j: q3 _! |' ~6 F
=========0 R7 i' y5 R# m
0 P1 Y: A! Y% I# V+ w. {Method identical to the preceding one except that it seeks the ID of SoftICE5 C$ P9 y5 A3 J7 l
GFX VxD.
/ z+ m! a, e5 O0 z z5 E. W
8 A( e3 W9 }# U4 Z% X$ k8 s. M+ f0 d xor di,di' |; F3 y" L6 e# D7 x
mov es,di0 R2 S3 k! `( Z/ r
mov ax, 1684h ' E; B7 W/ p1 R" w& o9 ~" V
mov bx, 7a5Fh ; VxD ID of SIWVID b4 d) m. ^ w% Z
int 2fh
: H7 U. K* n' S7 |# R+ X5 _9 M. { mov ax, es ; ES:DI -> VxD API entry point; q1 r7 r# ~* z2 Y0 H
add ax, di
! `1 {: k A8 a, Z test ax,ax
5 P' `* f1 w2 a6 x, A X2 l3 n, k jnz SoftICE_Detected
# ^3 q' Z: Q4 h3 h4 ?9 j! `
& K/ ?9 ~3 t& g+ ]8 r; w4 P [5 ~__________________________________________________________________________
/ K; E6 |) k3 Z* n1 V! u5 ?7 `2 \# _5 k' T ?3 c3 d6 R" \$ _+ |+ G+ ^
2 _# Y! T1 J! U2 a
Method 05
$ E& O% {4 ?. i4 g. R$ R=========
c6 P: f$ z' ~" \" l4 |* U1 O3 i) L) ~! r0 ~4 ~
Method seeking the 'magic number' 0F386h returned (in ax) by all system! P9 r+ A9 L5 N, Z9 H
debugger. It calls the int 41h, function 4Fh.
& P3 c) c- g1 Z3 t0 zThere are several alternatives.
$ P4 i9 H0 M* [+ h8 `: a5 c
# W: N( Q( J" OThe following one is the simplest:6 @; r: `- a, k7 c$ O
+ C7 ^, h) r7 c* v0 [
mov ax,4fh8 T, w5 a6 \* Z' C
int 41h) p- U, ~6 Y. y9 O1 q* N- y
cmp ax, 0F386* m( n, B4 f5 s3 z- j: v3 V6 a4 q
jz SoftICE_detected
& |2 N! V3 Z' p+ p" | G( ~: H3 K- N& Z/ z; f
: }5 S: {3 G" I3 y! TNext method as well as the following one are 2 examples from Stone's
9 d/ v7 c/ s. n s+ _"stn-wid.zip" (www.cracking.net):
( h8 X6 ]- g4 {) l4 J- {
$ ?! p0 l' X5 t" ^6 t mov bx, cs
5 I7 }: m; r& U0 z$ P lea dx, int41handler2
' B" Z. D$ ?. z4 O/ F xchg dx, es:[41h*4]' B- J1 ]! k! ]% D
xchg bx, es:[41h*4+2]" y" X& C. u+ I( J4 C; J/ u
mov ax,4fh: h( H9 n& U0 b) x: y1 A, r. Q
int 41h
1 L; |/ N/ _/ I7 g7 n* z xchg dx, es:[41h*4]# u( Z2 U! `! D" c9 l( [# n: }1 t
xchg bx, es:[41h*4+2]
% q- b4 M2 \6 f) }2 O cmp ax, 0f386h# d1 c5 L: F7 E6 r9 z1 W
jz SoftICE_detected7 r+ @. r0 u) D: W
' W0 Q) H- v) S7 I3 F+ v0 U
int41handler2 PROC
0 w |4 y' k, H1 r( ~ @ iret2 A8 t" {2 d0 Z1 F- }
int41handler2 ENDP
: ^0 V# G' S T4 ^
; N6 J0 S5 G E/ Y4 c0 T6 Q" G" |/ C7 Q; w/ Q B9 s
_________________________________________________________________________
" d; @' ]& e3 h: H4 q/ G5 P* V2 W6 @$ ?
' ]" ~: v4 B& L& c2 d+ ~
Method 06
4 W8 ^3 ?, B' M$ C# D! T8 ~6 z: H' y=========4 N D6 D) K- \: [
" U. J% a% V4 r) {8 K
. ?7 ~! j& L W) l/ l0 Q% h
2nd method similar to the preceding one but more difficult to detect:- \6 i5 _8 t0 ]2 m; v, _5 q
, s8 a0 O0 A, Q3 P) n
& {6 f4 P- V. ~int41handler PROC' @; u- M1 v" S
mov cl,al9 y0 J$ M1 O! t1 n3 ^: B2 ~7 V3 g$ q
iret, I8 N: S) F/ N
int41handler ENDP$ M1 d3 y: @% x- ^) P
{( |6 g. ^& }; y' p& A$ C
& a& G: x$ {) \4 q: D xor ax,ax: K$ H P7 n3 [. M! H" X
mov es,ax: a( X0 V* P( |, ^' c# F% a
mov bx, cs* K" w' M6 }& |$ `/ K4 {3 z& O8 K
lea dx, int41handler" h9 c7 t0 o, t8 B# A' Y
xchg dx, es:[41h*4]
. b/ W' c/ j' l8 O) X xchg bx, es:[41h*4+2]
* E" P1 C0 m) k in al, 40h
* Y: G w, |& J" {3 e$ V+ e* W xor cx,cx3 h" U1 k% q/ z) T
int 41h) ^% f8 s+ ~! o
xchg dx, es:[41h*4]
7 p2 d* F# R( C xchg bx, es:[41h*4+2]/ `( p' B- S5 L4 S- L
cmp cl,al5 h" t* T2 T8 D4 X$ m
jnz SoftICE_detected
( R5 Q( T' h# G
3 M+ |; b+ v/ Z, i_________________________________________________________________________3 r) I' N1 ~1 p/ u: n9 r
6 K1 N- h" ^6 f/ g9 |
Method 07 N5 Q) r* u$ t, o4 E
=========
( M+ g+ x* v) f! C7 }8 `2 ~2 H2 o" `+ G" t% Y& U
Method of detection of the WinICE handler in the int68h (V86)( u! X1 w3 Z! s, \" G5 \; h
3 _8 t- h. l/ C: H* D# N
mov ah,43h( i5 `! B4 g1 o* q# n
int 68h
$ K5 @* ?+ ~) }4 ] cmp ax,0F386h
& P3 s% H6 H; x( ?" d jz SoftICE_Detected0 V6 n# ~8 _+ b( [5 |
6 k2 H: m) h& j I3 g2 F# o: [1 H3 n3 Y* `% w. x
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% L F' X u, P2 Y! W2 f* K i. U app like this:' `8 [; d# Z0 ?! `; p# F" p9 s
7 d/ a! h. A, g+ N; W BPX exec_int if ax==68
+ T" ?' }/ x9 ]: M! V3 Y* V (function called is located at byte ptr [ebp+1Dh] and client eip is7 l1 v% T7 |( W5 S! h
located at [ebp+48h] for 32Bit apps)
7 \4 f: ~- P3 }6 T; {__________________________________________________________________________- G8 t/ l* J& H- ]% Q& }
( e3 r4 Y6 j$ q, h( l/ h
; t' W( K( K& k' `8 w) v& z9 jMethod 08
8 O" A m9 F. ~2 p=========7 O& x8 W1 K2 d9 g" E6 c1 r5 i
2 h5 I. v5 r1 ~! ~5 R, a1 M
It is not a method of detection of SoftICE but a possibility to crash the, L) I1 u0 R6 U
system by intercepting int 01h and int 03h and redirecting them to another7 s+ P0 b5 w9 h7 |
routine.1 l# G5 Y/ Y( \+ |5 m* g7 j
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* p2 L3 Q4 n( c: ]/ \# H! ?3 {
to the new routine to execute (hangs computer...)+ T0 o0 r+ l5 H z: C( h
7 O8 G. W; j# l; j/ g% X mov ah, 25h- k. S: T0 w3 p0 c. t6 h; [
mov al, Int_Number (01h or 03h)9 ~' o% N! g' q# m- Z: r
mov dx, offset New_Int_Routine
; ~8 _* i R, N; U int 21h
d, Q" v% D; E7 K
) a0 N5 C1 K/ m. B__________________________________________________________________________
) L9 f; s t4 E9 d/ R- R- d: O* O% ~% U/ q9 m$ W% e
Method 09
+ f" V3 Y( \# l* {/ e) B. c=========' A% n* J! m, d9 Z3 Y! e
7 m5 w- u" `- j) ~2 O9 B
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- c c- A e- _! V! E
performed in ring0 (VxD or a ring3 app using the VxdCall).! l: o m2 \# i9 a& q2 Q* `# A8 c) Q
The Get_DDB service is used to determine whether or not a VxD is installed( C( s. o6 c1 Z8 T, Z
for the specified device and returns a Device Description Block (in ecx) for+ m$ i3 S7 E. | D$ Z- c$ z: e
that device if it is installed.3 N+ N6 I0 \3 ]; P
/ ^1 _6 k7 i7 v: p5 n$ U* e mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 Q) [7 N4 t5 k0 u# a3 I
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)* A) C- `* _8 k
VMMCall Get_DDB& O0 u; o' I3 I8 ^, S
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
2 Q- O. I3 i: W* |
: [! K4 m4 C$ @& ^3 MNote as well that you can easily detect this method with SoftICE:
& H; @+ b% R' [6 W bpx Get_DDB if ax==0202 || ax==7a5fh
6 p% K3 b, @; n& Q* \; n4 ^' c$ D1 w6 ^/ j6 }6 G- ~ G" ~4 W* R% b
__________________________________________________________________________
" p) x+ }3 E% C( f1 v" @3 l" s' O# Z. n3 X" e1 g! _8 H
Method 10
8 z5 Z5 D) R4 s0 x/ S=========
2 S- G+ J( D: j0 e0 @! H' F4 a3 N
0 R! G$ \2 T# [; n6 T% l=>Disable or clear breakpoints before using this feature. DO NOT trace with
( r# s. \2 |) I' x9 R# d6 N% v SoftICE while the option is enable!!
$ T+ }( [4 L5 m8 w4 f
3 U- j7 O* U- FThis trick is very efficient:5 G0 B' g+ q1 j1 q3 `4 I
by checking the Debug Registers, you can detect if SoftICE is loaded
% w( I2 H, q- X3 |8 Z8 @% x(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if% n- h- H( M' Y( J
there are some memory breakpoints set (dr0 to dr3) simply by reading their5 Q" C# D! B4 t- Y
value (in ring0 only). Values can be manipulated and or changed as well
8 B) t! z7 I6 x/ B! k& {8 Y(clearing BPMs for instance)
! M( P6 l$ z$ v# A
2 K8 `" O$ G5 s# a__________________________________________________________________________4 B% a8 @% [! d* \
8 k0 R5 o( ]) ?7 T3 n* e/ W) _
Method 11: D6 ]) E w8 C
=========) w0 |, _: W' p. Q+ O' w# k: X5 K
7 r! L X/ L3 {" k& }4 FThis method is most known as 'MeltICE' because it has been freely distributed
) w: \4 d* A3 p* [$ Rvia www.winfiles.com. However it was first used by NuMega people to allow
. E) h& r( E( [1 `; KSymbol Loader to check if SoftICE was active or not (the code is located
- C& r; I8 Z5 t- W1 B& b ~inside nmtrans.dll).
|9 j6 _% V/ q: u$ K! B2 f* k
h( @. X; R+ o+ z" hThe way it works is very simple:2 l. R; C% \* e$ Z4 A, b7 f& M
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; n5 [7 U+ S! z% W1 E. IWinNT) with the CreateFileA API.+ |( {0 n; X4 u) o
. U$ b+ V; J' s- F! r$ \& c1 r/ ^1 R& \
Here is a sample (checking for 'SICE'):
3 k4 i9 n; R1 d7 m
0 N$ z% R+ u% t! t* P7 GBOOL IsSoftIce95Loaded()- V' ^- {' N1 u/ l/ p, [
{0 S# {4 ?% P+ i5 O1 d
HANDLE hFile; / j% r# u1 l% v0 I
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
# }) b/ n, u5 x6 w1 a4 o FILE_SHARE_READ | FILE_SHARE_WRITE,4 v' {% S( ^4 x8 z$ ]' l6 w- N2 L7 u9 ~
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);: n1 q7 K# B% ~* L+ ~# ?5 i& w2 k: {
if( hFile != INVALID_HANDLE_VALUE )
- e. c6 I! r2 t( \# c {% Q% w) k7 T$ x- L- z
CloseHandle(hFile);# x) k8 X; q0 d& E) f
return TRUE;1 |5 |% U a, N9 `
}
& V6 h+ A: ^2 `+ \- k6 o return FALSE;
% E) p9 f5 w# r# {7 m( Z}1 E, o9 |6 O9 v% V2 s% `" r6 n4 T
2 n- i' e2 y. x. b; z$ S) P
Although this trick calls the CreateFileA function, don't even expect to be) Y! x, S" A9 _6 s
able to intercept it by installing a IFS hook: it will not work, no way!
- v7 l6 a, ?# q/ S) {, \- F6 f, @In fact, after the call to CreateFileA it will get through VWIN32 0x001F# z+ e" j8 e: f( ?
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 |2 V2 s! `& S0 h4 o% A# eand then browse the DDB list until it find the VxD and its DDB_Control_Proc% P1 g7 ]* ]: p+ I3 d4 r
field." n7 Y9 K& C f7 [
In fact, its purpose is not to load/unload VxDs but only to send a
4 t( k. B/ h: _. NW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 U' ^) Q3 H0 K
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 ?5 P. E# m; I) Z) s; E
to load/unload a non-dynamically loadable driver such as SoftICE ;-).% T( Z1 u" h7 R, I
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ s; W# I- ^. P0 t# E& S2 ?
its handle to be opened and then, will be detected.
! d9 K) p r0 z3 ^5 n; CYou can check that simply by hooking Winice.exe control proc entry point4 a2 t- y% A) J' T; e( K2 }" v
while running MeltICE.
# x( N0 W7 v6 G3 v3 w: W l) I8 q! W. h3 P. g" n' x
[1 Z$ [6 ~! B W
00401067: push 00402025 ; \\.\SICE( o7 y$ `1 I2 S& y5 [
0040106C: call CreateFileA& d0 t0 ]# P5 D: u( b6 w# v8 Q
00401071: cmp eax,-001' @( s, d- Y& [+ G, N
00401074: je 00401091; T6 ^1 S S! M7 m. `: v! F" i1 k% p
9 i1 B7 t+ w% f% }; o3 t
* R9 @& U' t0 O l1 X# c; OThere could be hundreds of BPX you could use to detect this trick.
: h- `$ Z ]! x/ ^-The most classical one is:
0 l: S, s2 C4 n$ d$ h BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
7 o, Z3 R# _' p1 B' h( y$ P1 \ *(esp->4+4)=='NTIC'
: A* A4 R2 E& q
^* p+ @2 f7 t- u- S/ F-The most exotic ones (could be very slooooow :-(5 J0 {7 x |2 U+ ^' ]6 _) a
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 G+ ?: b. u$ H5 ], d* {
;will break 3 times :-(1 h$ d* E L. h( m7 e1 }7 k
# s6 A4 `. _+ v; o9 J-or (a bit) faster:
! j5 Z7 k2 l$ b, ~* f BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 o' { M; B* v8 c+ x
* b2 q5 T* O9 C* B BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( q A( y4 a# Y3 P: K) @: {% t ;will break 3 times :-( [0 c3 I) ?3 U" J# D* I
* V. t" `& J- _' k: ^' z
-Much faster:" J6 v' \4 \/ {* }! R
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! z+ g6 d, Q9 t* p2 H# g
& T- r! L0 a* c+ k2 y1 r( y/ T
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen! ?; r9 A( P" v4 v- Q4 C2 u
function to do the same job:
# r" |2 |, Z& x7 n5 O$ `- K4 Z; u" P9 W% \
push 00 ; OF_READ
* d% I1 ~7 r1 [7 o mov eax,[00656634] ; '\\.\SICE',0
) u$ c7 v! ]( D3 j( ` ~ push eax3 Y) a0 Z0 c" n- `1 |6 K% s1 z
call KERNEL32!_lopen% F) R" d* p n2 q3 k ~9 Q
inc eax1 e" z" M; t! B' Z0 y, s* D
jnz 00650589 ; detected- \% j, N" N; A2 K3 L' h
push 00 ; OF_READ1 r) P3 }+ u. i* Z0 A
mov eax,[00656638] ; '\\.\SICE'
# i" }& K/ t5 I" p; R* r" H3 O* `( u push eax
# l& F1 O3 ?' @* ] call KERNEL32!_lopen, V3 N& G0 H0 `% e( k8 B
inc eax
4 n! J% W, C; N9 h4 q/ I jz 006505ae ; not detected
, Z/ M; K8 G6 {6 _+ E
; W5 C, x+ J# \( z! |
1 D; z I! o0 u0 G__________________________________________________________________________* b( W$ E% S8 I: j% a
A8 a- ^9 v( D* Y- `6 e' aMethod 12
+ P7 l0 u1 Y) d& ]% X8 W=========. c v. d; m( O
; a' c$ V* o; G2 NThis trick is similar to int41h/4fh Debugger installation check (code 054 |% c) g9 l1 e: [
& 06) but very limited because it's only available for Win95/98 (not NT)7 F2 n6 t# o+ r- P! w% h7 V5 F- F
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.. n6 j% s$ A5 Y6 \/ ^8 X5 F
* u; z; S1 F+ N* C' ^; v+ F push 0000004fh ; function 4fh6 O5 B/ l$ C( U" g2 k
push 002a002ah ; high word specifies which VxD (VWIN32)" b6 p/ F) M% m
; low word specifies which service
; S0 T& m; o; ], D8 D* y (VWIN32_Int41Dispatch)2 e1 G2 z) I* m( N1 G8 F
call Kernel32!ORD_001 ; VxdCall8 C" a. u% |+ C. ~5 t
cmp ax, 0f386h ; magic number returned by system debuggers. w0 r5 I/ Q/ x9 ^- p7 K
jz SoftICE_detected
4 h& x' w5 [6 A& s! M
; J- J2 H( M3 c N! r: I" CHere again, several ways to detect it:2 Y; r2 w, ]. e* I: Z
, q- [$ A1 k( l6 _' A
BPINT 41 if ax==4f; o1 G2 F3 B5 l! C7 ?6 ?
" a9 K9 W, K/ \6 s; a: k: s BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 Q) h# _8 Z1 B7 _7 j) ~1 b
3 G* I8 [$ v* u8 } BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A% d1 l2 v6 X' r [$ s' l' _* Z. y
a' b! P7 L* v7 O% ?% m
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! C: `* n. E7 }$ G- T3 H7 j! I
7 d$ p7 [+ b D8 E! D' U& a
__________________________________________________________________________
, {- e$ H& x; E: ?! V8 ]5 x
9 o, {1 p2 [ s9 mMethod 13
8 C6 J e% X: I# p/ z! D6 _1 Q=========- C) i, d! v8 C3 l6 |. M& q' U
9 ^1 k1 p' x1 O0 t, p7 t% Y7 bNot a real method of detection, but a good way to know if SoftICE is' v* L! j8 a$ Q. S& P) l( j3 E$ ~
installed on a computer and to locate its installation directory.$ D' k! x, q% H2 k
It is used by few softs which access the following registry keys (usually #2) :
0 v, p* V, P5 _) e& ^; I+ O0 K, X# Z- T# F
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# Y; ^( S8 h1 ?+ y" @; C0 s1 l% ]( ]$ {\Uninstall\SoftICE" L) p8 R; ] J7 t* M
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# i7 b# U; d# w) @# F* J-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! A0 {9 t% F3 Y
\App Paths\Loader32.Exe* n+ j' k2 k% ^9 Z+ W7 s
. p/ k- b5 k5 V& W
6 w( n4 K% C% r- Y7 j! yNote that some nasty apps could then erase all files from SoftICE directory
4 f$ @- ^; G% e7 b+ f(I faced that once :-(8 n' A, ^8 P& M, X6 `4 P
6 {* c# {& V6 T) UUseful breakpoint to detect it:
- t& u& C1 b0 e# v2 h& k% Y b
# |) ^( T5 T0 h# }' } BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# w7 f! x- _2 ~; i
9 R' J/ x' I( O__________________________________________________________________________
7 m- b3 y/ L2 ~
" {" p" V* z; y1 Z) e- K6 r7 L% V, Y1 O* u( J: \
Method 14 $ k3 g& R, ]8 M8 r: r
=========
+ A& r& F0 g8 J* W/ I, u, K6 e0 W! o; ~ A$ M
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
/ y& U! R5 T0 i7 M6 V8 c: J2 z nis to determines whether a debugger is running on your system (ring0 only).
$ V" _+ u P- _( D0 C2 K* s. r, _# n
VMMCall Test_Debug_Installed
* k' ?2 g5 M* Q% g( }1 ~ je not_installed
, p u2 C: P4 y6 ^, ]5 i6 }
- H: R5 U, b3 f E: LThis service just checks a flag.8 Q7 s% O! Q$ ~5 b$ q3 [3 m, D( l: i
</PRE></TD></TR></TBODY></TABLE> |