<TABLE width=500>/ `( n3 Z" z% q1 W$ v7 x) O
<TBODY>
$ j% W5 y: G; b& s6 u( P<TR>
+ w. D+ b. e& s6 E7 ?, q6 p# o<TD><PRE>Method 01 % x" t& \! Q/ Y, B/ ^3 E9 M
=========
6 \; ]: T* p: b0 l
m3 M7 v" l7 H) y- \, LThis method of detection of SoftICE (as well as the following one) is) C* f- K4 |, _- x/ ~1 v
used by the majority of packers/encryptors found on Internet.6 R0 T- N/ A8 U# Q5 S" E
It seeks the signature of BoundsChecker in SoftICE7 z, F8 j1 u" H- O* [0 r0 a5 r
3 n7 Q2 L) S/ H6 @' @& O mov ebp, 04243484Bh ; 'BCHK'3 b. Y) n% z9 t$ M2 y* x3 I
mov ax, 04h
7 L' D2 ?& ^# n. K Y; M int 3
6 @/ _8 {+ R2 e. |- A) n: r cmp al,4
8 l7 g! ?: L, i9 Z. i7 a/ v3 [ jnz SoftICE_Detected
* Q8 }0 o! a* X
; \2 n6 m* f. I8 r2 e___________________________________________________________________________
& R3 ]- l; B, [% d: k2 W* z/ ^0 r, _7 }& `4 r" c
Method 02
' m& F. Q) K+ {& p4 k! N=========* ~) s1 ^3 ?( u% }& H( F, P
2 B: l0 F! F; T6 L5 S# ^1 u5 ^1 iStill a method very much used (perhaps the most frequent one). It is used
! G, a+ Z0 j7 |9 d3 ?4 [; hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ F, V6 l/ ~5 D+ b% \9 o
or execute SoftICE commands...% Q3 j, h' T3 t( S) v. |' ^
It is also used to crash SoftICE and to force it to execute any commands+ W" `1 G! v! I# V- U. ?
(HBOOT...) :-(( 7 E) }8 x7 h* ]" O2 M' F
" V: [2 W5 S" V4 y% [. {Here is a quick description:, j1 g R$ `# C& @. s
-AX = 0910h (Display string in SIce windows) w: H# N2 t" m. X) B" J
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
7 N! B$ E0 P9 B. r- X D$ Y-AX = 0912h (Get breakpoint infos)
8 B3 Z. Y. \1 {. v! r# _6 ?5 `* G-AX = 0913h (Set Sice breakpoints)" K* h4 _- T) t6 F# ~. \4 M1 d7 e
-AX = 0914h (Remove SIce breakoints)
* G/ s, v* Q) z" H" p. f! x% z( K! q. O' {5 F
Each time you'll meet this trick, you'll see:/ Q0 G) m1 ?8 Z- Z2 P
-SI = 4647h; P: ~, I0 j; p, \
-DI = 4A4Dh
7 h+ f: P( Q' t3 j) `' MWhich are the 'magic values' used by SoftIce.
* P8 z' q2 l# S7 TFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, W- K+ m% O3 [; r( T5 j# D. O I$ Z5 ?
Here is one example from the file "Haspinst.exe" which is the dongle HASP8 }! m) X& t' ]* ? |
Envelope utility use to protect DOS applications:
) ^: {' W& i" e5 y, h
/ ^2 N: B9 v8 B/ ?) A5 |8 k. O" \" x; K! a* Y- k/ n
4C19:0095 MOV AX,0911 ; execute command.. e/ j9 r5 |: Z) i
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).& z3 U1 w! j$ u" C' R) c+ @$ L, K
4C19:009A MOV SI,4647 ; 1st magic value." b* A" s" ~/ S/ H3 X' W
4C19:009D MOV DI,4A4D ; 2nd magic value.
3 m# ]1 m; \. Y( \; A4 P& ` D4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
! g) G9 T' |8 D8 [ E4 j1 i4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, Q8 ~, {" a6 B* g' I+ x/ i4C19:00A4 INC CX
, t7 N0 J1 j0 n i0 d u2 [; I; `4C19:00A5 CMP CX,06 ; Repeat 6 times to execute1 r9 n/ _3 x; o9 {% v! w8 ]! z
4C19:00A8 JB 0095 ; 6 different commands.
# {1 D2 I, D$ \+ g5 N4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 K W, K2 @" _( v; I% k# G* H {) Z
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
! t9 S5 J) x4 B9 a2 Z
5 g3 c4 B$ |* d& l: U( D7 A3 JThe program will execute 6 different SIce commands located at ds:dx, which! e, \- I+ M, D5 L+ V$ E
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.) S+ [$ e" Q5 K9 V3 `
8 p( R, u5 |4 m. h* O1 M* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
7 I) S. y: T+ |9 x, c: {# t___________________________________________________________________________* x3 B& S1 R/ E: N; e/ } F3 G0 M$ `
, J2 s1 Q- B0 Z: h# C
- r0 I) ^0 I6 M2 n. y
Method 03
$ O: j: F% e$ V- f=========
/ ]8 d+ ?3 ~' Z; r) `1 [' v8 c; k3 E0 [2 L# W* `4 R4 Q7 D3 e
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
$ |. E. ]2 s5 h: x7 g(API Get entry point)
. T& W# U5 P5 b6 @ H7 Z : m, g- y# `" U8 [
5 P2 _) p. V8 r+ g$ v* a5 w2 O+ C* k xor di,di
* Z5 q( h: i% }# A) D mov es,di# u; `# A! r* k
mov ax, 1684h 5 k- T. W( R( m6 \4 m K% D0 Q; b
mov bx, 0202h ; VxD ID of winice: ?( r5 _: B: x6 x, p
int 2Fh
2 O. N% M- E1 m mov ax, es ; ES:DI -> VxD API entry point
; c) f6 C5 {& F) K& F m add ax, di' P, e7 d0 o# \5 _# d8 J4 U
test ax,ax
) l& u3 I+ n9 |* h% |/ a0 B, O jnz SoftICE_Detected
; r- X% H: A$ _! n6 q- Q3 f* _; E \
___________________________________________________________________________( @( n n) W: T; O. L
0 F- r/ P+ g' ^4 K
Method 04
8 K: P' d- [- }6 z=========
9 `. j- T% g9 X g2 t
5 m4 u# Y5 |9 h8 n4 q5 t5 EMethod identical to the preceding one except that it seeks the ID of SoftICE
6 R; Z d4 q9 z) ^, F% XGFX VxD.0 D( ^4 }2 u) Z) e4 x% h! s
" `1 K* Y0 c$ T, w
xor di,di( W2 y$ {; w5 ?$ g/ g
mov es,di u; W( U' z2 B; i( I
mov ax, 1684h
3 p& \& g9 Y- C9 |+ o+ {" E mov bx, 7a5Fh ; VxD ID of SIWVID+ s3 h- E6 J5 O$ y* N2 Q
int 2fh7 B7 B7 y0 m2 Q
mov ax, es ; ES:DI -> VxD API entry point
- x5 K, W* R5 a& q* `1 y( a add ax, di
/ ^# J4 y; ?" P test ax,ax* R' z0 D' K( [4 S- f6 x! I
jnz SoftICE_Detected: H# ?/ s0 N+ A' r! Q* k2 P) M
6 m* }- A# M- }! y4 s__________________________________________________________________________
: _( F3 u) }) c
0 A# ?3 F$ n$ l% h& l6 @' r
3 v' o: z e5 z. h( b* s- |Method 050 q2 P3 e0 `# H3 y2 u
=========( ?" ]% ?' K, s2 O5 f& R' ^
2 F; ^' u3 I5 ~) f: G
Method seeking the 'magic number' 0F386h returned (in ax) by all system
0 S3 k) e- K+ \6 @* cdebugger. It calls the int 41h, function 4Fh.& s `; q8 ^# K( g/ `* S
There are several alternatives.
6 p# h5 y" k- \0 ~' _' t+ T, U, g+ m8 t' |; N
The following one is the simplest:
, U! T ^" Z5 e# y$ E' l" m- |4 k6 q- e6 V
mov ax,4fh" X; J( Y% }4 E- Y! @) k0 @" A4 N% \
int 41h
7 a; Y$ i+ T! X$ r cmp ax, 0F386
, G% j$ }. D7 y# } jz SoftICE_detected- J, g' W8 i. V* L
4 V+ h: r5 v3 j* }
, y, L% _ [- [0 K8 l5 KNext method as well as the following one are 2 examples from Stone's 5 i/ o" `! a. x! l/ y5 O
"stn-wid.zip" (www.cracking.net):
2 T4 z, a# N! F' E: p0 |5 v- F. H7 |0 C" e, R
mov bx, cs
; i: O" Q# C4 _6 _ lea dx, int41handler2
7 w! w4 j1 q" H# Y( N3 u! q xchg dx, es:[41h*4] s7 h* {/ E3 s Y! g
xchg bx, es:[41h*4+2]
# W" e# C: D3 U! s mov ax,4fh
; I3 z& f" J) G( q6 M/ D% N int 41h
9 F8 @4 B/ U4 r xchg dx, es:[41h*4]
4 ?- W: S+ P9 Y! E* h3 g xchg bx, es:[41h*4+2] u* x" r* Q4 p6 l8 U
cmp ax, 0f386h
J W" g6 f% ~8 m! S. s3 k jz SoftICE_detected4 `( R: C H3 I w' E" X2 n/ ]; U
1 P, y# Z7 C$ k0 w, Y: X9 qint41handler2 PROC+ x7 R" u8 ~ F o7 e
iret
. I0 J4 U( h$ w, q9 I0 u' }6 a2 T' I: a1 Hint41handler2 ENDP1 P9 r \. S% B; S, P, L
5 K8 b8 z6 y/ O, a2 W. |/ C+ t3 D7 L9 @; j$ J' e" V6 {
_________________________________________________________________________$ n4 |" k% o) Q, I+ G! S4 K5 G
7 h/ w8 [1 s3 g, W7 M9 ?+ }. g9 @: d& Q1 U8 i' K6 |$ y. ~
Method 06: a# U/ [* ]8 m+ s
=========+ l. ^. d. y- B3 N' w
- ?. \* J0 p7 ^* T+ I. G: p( k! k
2nd method similar to the preceding one but more difficult to detect:
+ ]3 _; J6 x n7 n) U! x8 X) u2 t$ C9 }3 ]8 A
- K3 _# l( {1 F/ d3 [6 vint41handler PROC
9 O/ @( h; D) r mov cl,al
3 M3 a8 d5 A# p% N! U5 z iret1 b1 j# Y* |. y- g) W; V
int41handler ENDP
# y' \& d0 w) T
4 E0 e' r4 F( h+ \8 |# R4 r" T3 H% P# d/ ^
xor ax,ax
' s3 C( L5 P* l! t mov es,ax
8 H# f' ^ a; E mov bx, cs
7 N& P8 W e8 U: R4 ~ lea dx, int41handler
0 m( I5 p& W3 a7 P xchg dx, es:[41h*4]$ M, M8 {1 m2 g& T8 s- j
xchg bx, es:[41h*4+2]
: m# w" \' }' u5 k. q: s in al, 40h
K0 \ E0 ]" u( p6 p' }/ V xor cx,cx
7 N7 q" d+ K* t* Y! j( _) q1 Q int 41h
F9 U9 D- `; m X k1 \. l xchg dx, es:[41h*4]
2 B8 J0 }; s" {" C5 \ xchg bx, es:[41h*4+2]
, Z$ D+ m& B/ m1 Q1 N+ Y4 C cmp cl,al( ~& t' J; n% W) e
jnz SoftICE_detected, I( K: Q, a' }7 q* K
: q6 Y' [8 H# `% M j3 t
_________________________________________________________________________% ?- V, ]4 A' _5 G7 x1 y3 a* h
+ ]% J' J4 A8 |! N2 W
Method 07
" e3 W9 C( z: k: j/ }=========7 @! H( @1 Y+ M. l
; p5 }! A+ W/ @ y2 ]# P b
Method of detection of the WinICE handler in the int68h (V86)
, H! s/ l# a& `4 R/ x) ~, [3 t9 ^/ H; @& I- W' e7 M
mov ah,43h
- K4 p! X' z% c4 M int 68h+ F1 C+ n' q0 G K) T
cmp ax,0F386h2 |7 U$ \* d _& q7 A" d+ A
jz SoftICE_Detected
7 f0 n R1 x; ~9 N) ]. {- E' f+ }, o" k4 S+ {" p% g
}( l4 a9 m5 M. ~, R5 ^! \% Y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ Q( f% b! x( L
app like this:
! b! n0 [, j$ `- F7 M8 K, j- i0 J% o' N( V% C5 T% _
BPX exec_int if ax==687 m, ?3 F' k8 u7 A2 }
(function called is located at byte ptr [ebp+1Dh] and client eip is3 T5 ?- w3 V& \+ p& c2 \: m
located at [ebp+48h] for 32Bit apps)
X. Y, q- R# l2 n" `& @__________________________________________________________________________9 I. E# a6 ^2 p8 A$ e& D3 W
, v' `! E% a X' y* _; o# ~ t* q6 N/ G% K- L
Method 08
7 b0 G+ E9 q4 w7 b=========% e/ m6 d4 q0 h
3 X" n' b# G( x `It is not a method of detection of SoftICE but a possibility to crash the0 \6 H, v) g% F9 F0 S) r
system by intercepting int 01h and int 03h and redirecting them to another
- _( r; b# Q& jroutine.
' v$ s6 c2 `9 B+ M0 Z2 ~3 f' qIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- _6 b e' v8 A" n/ y0 X* h
to the new routine to execute (hangs computer...)+ K2 i! h* s7 s/ `+ N- f# k
: {* w. D# q4 p" J' ]! A: h
mov ah, 25h
, I) j" V8 T7 B1 R1 A mov al, Int_Number (01h or 03h)
2 C3 [2 X1 v* T mov dx, offset New_Int_Routine( H# M9 X4 {$ l1 J
int 21h
, I+ D3 B# u6 b/ F$ h0 h7 ^" T: {
" B- Z/ y; Z( n# Y. ?__________________________________________________________________________8 b* y Q2 W/ p, v5 a2 f1 h; a
" G4 `6 {1 B" D# b5 l7 d2 v6 F
Method 09
' D; X4 }9 B2 q( [& N8 K' S=========
* V; c" y1 A5 x- k1 m2 G0 _: w5 w3 _
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 ]% M; x! i! Zperformed in ring0 (VxD or a ring3 app using the VxdCall).$ v/ w! _5 J' p' t O3 V1 [
The Get_DDB service is used to determine whether or not a VxD is installed, L* J; ?% N) T8 S( z: {! y6 `1 V9 Y
for the specified device and returns a Device Description Block (in ecx) for
4 s1 e6 A9 P! s2 v7 l2 L# Vthat device if it is installed.7 |3 ?% h- ]5 k
7 \7 _5 x4 L# @+ J" { mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 w5 W7 ^! O6 {3 ]4 Z1 W/ a
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# T l0 ^1 P% w; @" w VMMCall Get_DDB
& p7 q4 Z, y# i9 R- d mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
6 ]9 N/ S- t9 Y
8 V3 ^8 q# @+ [Note as well that you can easily detect this method with SoftICE:
e$ F, w5 Q3 t1 s8 ?- A bpx Get_DDB if ax==0202 || ax==7a5fh
4 b$ \+ f8 ~- \1 S# B
& {& _4 o6 k7 D__________________________________________________________________________& Q+ U, g# y6 h$ R" a9 `% @- V8 N3 G
|4 i2 L# g( N. O# \+ _5 a- q
Method 10
9 C* ?9 @) o7 j, L=========& A# t$ T. V" L- n# m. L
5 u/ W1 G' O; x$ V% p0 k* S=>Disable or clear breakpoints before using this feature. DO NOT trace with6 v% t$ N1 x4 b! k4 L7 g) T
SoftICE while the option is enable!!/ R6 _ j/ O0 J$ t) D( H. Q
6 N7 B9 a o7 F, tThis trick is very efficient:" C1 F& d& A3 v0 m* f' n; x- _& g
by checking the Debug Registers, you can detect if SoftICE is loaded' U( T1 @ s# Z* C/ N( r* n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' H- `+ r8 l! W. rthere are some memory breakpoints set (dr0 to dr3) simply by reading their
. w4 {6 ~1 R3 z I8 A6 ^# A$ dvalue (in ring0 only). Values can be manipulated and or changed as well
0 S8 a* j+ i3 l0 V% ^(clearing BPMs for instance)
; X r9 }/ A" x2 A; R
1 M' I" @. [) i% U$ X0 v; p__________________________________________________________________________
$ e `. A$ |& R d8 @2 D- Y5 z) m+ f, _- O* E* K
Method 11
8 g) Y( C N" w+ }' h! ?=========4 ~# s: E6 `% f5 t; F
, H' k: w; _) Y6 ~5 X! O5 _This method is most known as 'MeltICE' because it has been freely distributed( g H) Z& u& D
via www.winfiles.com. However it was first used by NuMega people to allow
! I2 ~1 ]( K" X ^8 z2 wSymbol Loader to check if SoftICE was active or not (the code is located5 h; s6 Y7 G6 b. q" T* O) O
inside nmtrans.dll).3 c. }7 G1 I+ _: d" L% H
& H- r3 H7 c2 k6 _% YThe way it works is very simple:
* U; `1 n% i% y" `( @( U" M+ zIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 ^- _. u& O" t; J# EWinNT) with the CreateFileA API.
- ?- d: t+ i& B/ P" i% u- C
/ c: R! J5 P& C3 y4 g+ FHere is a sample (checking for 'SICE'):
3 _$ P7 f/ ^9 X" l: |6 H8 _7 N8 ?3 G |- i% C# C, Q- q
BOOL IsSoftIce95Loaded()
: d J3 Y& D# l{
/ }6 t6 y! j7 Y' S9 e9 \' o9 V9 j( J HANDLE hFile;
2 x c/ s/ i, Z4 u9 W+ L- Z9 X- ^ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, K. Z* Y! G8 h* e+ \& x+ ~, k
FILE_SHARE_READ | FILE_SHARE_WRITE,
' D+ {. f7 ~( d4 j NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ u# @9 X' j1 Z, U; q
if( hFile != INVALID_HANDLE_VALUE )
6 X! R6 Y8 l1 g- \ {
1 @* U: Q% X6 N; h" Y CloseHandle(hFile);5 y5 E+ y4 M o. T6 d
return TRUE;* m% Y3 k$ Q+ ?& A2 n2 E1 c! {6 R( d) L
}5 @! Q3 Z" n. s2 c/ x6 Z$ b! f: l
return FALSE;; [' D9 x4 ?0 e) d% P$ A2 O6 N
}
& C/ u5 o: m6 B' v9 e2 {9 N2 a! H$ x/ Q: P3 N
Although this trick calls the CreateFileA function, don't even expect to be5 E5 U, }) ]4 p* P" I0 D8 {, D& M
able to intercept it by installing a IFS hook: it will not work, no way!7 k( w. |' ?2 x. V8 G
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
* v" O8 f, p1 eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 f; q \4 O {+ t4 ^
and then browse the DDB list until it find the VxD and its DDB_Control_Proc& z5 b. h2 p" q6 ?
field.
2 s, J; C" {; b8 @! [( C% _' pIn fact, its purpose is not to load/unload VxDs but only to send a ! m: |% _( [% j7 ^% V/ t B
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
- v4 V3 i1 M$ K0 X1 bto the VxD Control_Dispatch proc (how the hell a shareware soft could try
- h7 U2 v: k- @" ~/ V+ g! h3 nto load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ m% a* X$ v; |5 z+ z% w9 AIf the VxD is loaded, it will always clear eax and the Carry flag to allow" ?3 f3 L* [9 S2 m
its handle to be opened and then, will be detected.
- p8 G) R5 k5 }' q: AYou can check that simply by hooking Winice.exe control proc entry point
' k2 e ?; x {* b; Cwhile running MeltICE.
$ D/ k( L: N& R7 I7 d
3 y/ x) u- K% A' u5 F/ S Y* F7 F" @! F1 A
00401067: push 00402025 ; \\.\SICE
) m5 R) e* Q) Y6 m 0040106C: call CreateFileA
# y8 B( B% |2 K- u! q* `4 f 00401071: cmp eax,-001 Q7 f4 u4 {9 j, F3 K& a
00401074: je 00401091, A6 B# }% X6 K" W
, [+ r K/ G1 h# `) e8 d- Z
u# {2 l" {# d0 m3 ^There could be hundreds of BPX you could use to detect this trick.7 @8 z9 U' C! p% \1 ?
-The most classical one is:
, ]$ o/ f6 a0 Y0 O! ?$ S$ H BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
% A, O( |/ I5 f. J1 v' d *(esp->4+4)=='NTIC'# ~1 p* C' C2 a! l5 U. E
' d, ?$ Z8 I6 {1 [/ M3 _
-The most exotic ones (could be very slooooow :-(
. g# D; W; C. y% Z BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 k6 Q f0 h6 y1 P( `
;will break 3 times :-(2 i( `' S7 F: G+ E3 k( v
% m5 c- m) A8 C6 P, u
-or (a bit) faster:
) H# A" a; U! T+ k1 X BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 y5 d6 J8 ` f, H7 M8 d3 z
\/ @, S. s. E8 D+ _
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
5 K' h& l) c/ R( B ;will break 3 times :-(
7 a. I+ W0 y$ k% @# O+ {+ O/ h' p8 r8 X( z; o6 `/ D
-Much faster:
" b. w W* b' N" O BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
S& U0 j! d) ?' {* |% n" H! o* P2 d& p- w' f& k! s( V
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
, w$ x* |! \8 ] S$ sfunction to do the same job:: J3 B$ b' l: p L3 _2 A/ `3 T/ t
: Q( |0 s# D8 N# c push 00 ; OF_READ
" p9 {; \: H1 x& K mov eax,[00656634] ; '\\.\SICE',0
2 Y k9 Z% ] x- J4 P* l( f push eax# x+ \ g$ s2 O/ F7 Z9 s* X' N
call KERNEL32!_lopen
% N# W2 ]; E1 x inc eax5 ~- x4 v8 a1 q; Y. m3 e$ v, w
jnz 00650589 ; detected1 g3 V) A7 R: @ X
push 00 ; OF_READ+ B# w2 C$ X: ]; J @! ?$ A
mov eax,[00656638] ; '\\.\SICE'$ l, {9 b b9 ^& n
push eax, z# X* n0 [2 E+ G# n, m: l1 V+ S
call KERNEL32!_lopen
. u- j% ~' \) U$ b! p( ^6 M inc eax4 _+ m! h. Q2 y5 z# M
jz 006505ae ; not detected
" g/ s' d7 ~" t" U( k4 r
8 ^# K7 }+ ` o1 N \. s2 w5 z$ y( l
2 D( _; ~# B/ p& K Z; ^__________________________________________________________________________
- |) K {% y1 V+ t9 p" |
, T, t% Z! G7 v) [- aMethod 12
" o* p8 X2 e! i9 s4 `=========. b T! M9 j# j* c
; T4 W9 Q2 p! x0 {0 F0 k# s& B
This trick is similar to int41h/4fh Debugger installation check (code 05! P- x q6 C+ o' N9 h! v
& 06) but very limited because it's only available for Win95/98 (not NT)
; m# r4 Z; J6 [6 e/ [as it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 g) ?- x6 g: n9 z: i x0 i
. U* {) k2 T/ |* T' H& o
push 0000004fh ; function 4fh
, V6 j2 X3 q- r) `8 g5 g4 i5 B push 002a002ah ; high word specifies which VxD (VWIN32)8 k+ G& r/ @! B; `9 Z: V: R3 \
; low word specifies which service+ z# V6 t7 Y# h' t
(VWIN32_Int41Dispatch)" k# O% h+ n& x/ o4 Z5 g
call Kernel32!ORD_001 ; VxdCall
. q/ r, p! f0 t- t t cmp ax, 0f386h ; magic number returned by system debuggers" ?+ A6 ~4 r0 C8 K( A/ b2 [
jz SoftICE_detected1 J# j% I4 \" ]/ c* o
8 d2 Z. E# C/ OHere again, several ways to detect it:
3 V* @! C% H3 v- z
8 I! j f, F) U7 W BPINT 41 if ax==4f
c& E* N* u7 `" V5 J) _
1 u6 ^- x' t0 j9 R+ c BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ L" z! u! d" K
0 w% F |5 Z* z+ z4 U
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A x4 \( f, T6 }9 v# B k& [
, O& o8 s2 F J. K6 L
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!7 ~1 v4 r2 t2 A8 c6 K0 M8 J; f
& G" P7 I/ f- d' N2 \; V a__________________________________________________________________________0 K( b7 A8 `) u" c% u9 `
$ o7 t* y0 K/ V9 i( C7 VMethod 13! z$ |( ~7 ^: p( i: A, b$ a+ |+ b
=========1 M4 L: u$ ~: y2 j# L8 m' x
$ q6 Z& V j; C/ {% q; R1 V& xNot a real method of detection, but a good way to know if SoftICE is- P a7 k+ C9 o
installed on a computer and to locate its installation directory.3 ?- M; r+ v' K& o; b" `
It is used by few softs which access the following registry keys (usually #2) :
- D4 m$ q3 y6 U4 J$ g3 k
% P! |+ L+ h1 x-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 k% v( r$ N: q' K\Uninstall\SoftICE
; ~0 `% }; o5 T. |" P; w-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ X3 B1 m2 z; M-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. E8 x* Q/ Y9 F9 e\App Paths\Loader32.Exe0 e7 m2 `9 w% [3 R# q9 K
. Y4 k) H b) I! u" x! h0 N, {7 {& b. d! B
Note that some nasty apps could then erase all files from SoftICE directory: N# G) b7 j( L- R- ^- F, R
(I faced that once :-(
, i9 u$ V% F5 `4 C, U( [3 U* H$ U0 l( X. f
Useful breakpoint to detect it:
! ^0 M& S8 b* h& P$ x" _$ b! ]3 K3 a, b* w% q
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 b" T$ d( \3 w
) _( e3 W" `1 L3 ~8 b" w
__________________________________________________________________________
0 W x* e* e: B, ^3 Q& a5 ? g' v: q% t2 n+ H# _. C0 n. ?' f
, p$ s: {! }9 Z) i% R" J& n& r
Method 14
: `7 Y" z* [2 m& }" i7 C5 v=========) f# S x. n3 Z1 h% l
* P9 X) H2 }% n4 L
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' a% e& a/ ?4 @+ Yis to determines whether a debugger is running on your system (ring0 only).
- k" A. R& q0 S, z% o8 _, v$ [- \$ t& ^. E$ o
VMMCall Test_Debug_Installed
5 j9 X, ~& M7 f! } je not_installed( p; a/ `/ R! ^+ {+ S
' Q: I' E, C5 u3 u
This service just checks a flag.
8 h6 E9 L8 ]. U' U1 t0 }</PRE></TD></TR></TBODY></TABLE> |