<TABLE width=500>
; w4 D5 v) u2 w. r4 X, }<TBODY>
2 R: t% K+ e+ H) _0 J7 r; ]; r- j<TR>
% A$ }. q$ g9 t<TD><PRE>Method 01
6 L8 H/ E# ~% o c! R=========; f2 Y0 ~( D* S6 d/ u: C7 m4 K
: |" C! L! Z. I X' P& wThis method of detection of SoftICE (as well as the following one) is, e8 O3 z" q# h, ~7 |. P
used by the majority of packers/encryptors found on Internet.: O) M& [8 F- S( U
It seeks the signature of BoundsChecker in SoftICE7 A- h: E$ f( h' E9 D
' [& {. u6 ]! l) e# Y
mov ebp, 04243484Bh ; 'BCHK'
$ B1 k* r* N1 l6 Z* ]* |+ S! G mov ax, 04h8 v0 A ]1 J% _- S
int 3 s! j4 p' O' _
cmp al,4) Z. t) G9 Q% _
jnz SoftICE_Detected
' g2 Q* F- u+ \4 P% g* a6 e
" d1 s/ K4 n+ Q' V4 I- a( \___________________________________________________________________________0 t( {; f, y7 Y, d! L
$ s/ L6 D) b& @7 r
Method 02
( |) e1 m, a: l/ ^& Z; v=========) R7 G( m# c, t0 }* o
* T2 q$ ^* l/ p# o i
Still a method very much used (perhaps the most frequent one). It is used% w! K; O3 m( F9 A& U0 O! r, J7 {8 W
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
2 x6 ]& m+ Z4 A6 Z2 Z- Uor execute SoftICE commands...7 o/ y; G' N* [
It is also used to crash SoftICE and to force it to execute any commands
* E9 U w3 I& x" ]. j, y, a) b(HBOOT...) :-((
# W7 t5 J6 [" R! c5 s7 K: y- J+ X1 P* J: R; w4 |
Here is a quick description:
( `0 C3 m. [+ s/ @& Y+ g* I* R-AX = 0910h (Display string in SIce windows)
" k \8 p0 g8 F7 a-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' x/ U6 K* u. P0 G-AX = 0912h (Get breakpoint infos)4 H3 {: F# _0 `; \
-AX = 0913h (Set Sice breakpoints)7 u* J5 ?* j* F/ _" ~8 p
-AX = 0914h (Remove SIce breakoints)9 T+ O( t+ e/ L+ ]
+ S+ o9 d( o% }8 g7 o
Each time you'll meet this trick, you'll see:
9 K6 H, o* N% Y0 _9 O) _-SI = 4647h
" Z2 d: C- L/ O3 a6 N. Y( q-DI = 4A4Dh, T3 M# H! D! K# Q+ x( W S; V
Which are the 'magic values' used by SoftIce.( M0 G+ f2 g( A: y3 y- e$ b
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! y7 `; S2 d- N' D; [6 a' _% p1 t+ w' _4 [
Here is one example from the file "Haspinst.exe" which is the dongle HASP/ R% ~6 w3 F- V4 ?9 `$ ?9 }
Envelope utility use to protect DOS applications:
' A) U* B$ k; x# y& j
5 I! O2 [. L' c6 T) h& P, |2 ` {+ q" m% z w0 o. E; R' {
4C19:0095 MOV AX,0911 ; execute command.7 S% e8 j2 k; x* i! m; t2 r9 n
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
8 j& X# ?. m. c2 g8 U" v$ j4C19:009A MOV SI,4647 ; 1st magic value./ R* ^# P* T. t# N1 F
4C19:009D MOV DI,4A4D ; 2nd magic value.
- |0 M _$ ?- M5 R4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
! _4 m. B; T; J. s/ j4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% P9 |0 W1 T7 P3 n
4C19:00A4 INC CX
+ O: q6 n& z( l) c! R* ?4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
3 U( b# q2 s. ?0 A0 p: l0 t+ I: H; V4C19:00A8 JB 0095 ; 6 different commands.
3 `# W1 n/ c4 ^- C4C19:00AA JMP 0002 ; Bad_Guy jmp back.
. h3 Y' @- v6 M: f. n: w' B9 Z4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( W6 C3 p B, \# p
) Z: T+ y7 n/ V* ]1 r AThe program will execute 6 different SIce commands located at ds:dx, which
3 K3 a$ z& T/ Z% Z8 gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 l+ [1 m( W$ ^& H, V4 {/ u/ K4 ^' w, R) `; B+ ^, o" X! d5 _
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 v* ]( b7 C$ u$ v
___________________________________________________________________________
; z% f9 a! @- ~/ o( v3 x6 N! q3 W1 y
6 g g6 P( R1 }2 @Method 03
" D D0 ~2 O+ w+ L1 x" v3 J2 e=========
( G- b, R* x9 j7 ?
- @ @+ j" P) t" x% G# k! YLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' @& O6 a/ {- `7 `(API Get entry point)
- w) ~6 i2 {. D- Q& D2 j/ T/ H
: q r7 J% g- w( l% p1 J' W+ d7 M' P$ C+ p
xor di,di9 A: a- D$ k9 m) w: _
mov es,di
( Z3 v7 C r0 ?0 g7 w mov ax, 1684h & e0 ~ T) e# Y2 |7 g
mov bx, 0202h ; VxD ID of winice
$ }' L! u- i2 P) C4 j% O8 h int 2Fh0 Z5 a, B/ P# p/ i
mov ax, es ; ES:DI -> VxD API entry point) l" @7 w$ q& |7 C/ B
add ax, di7 f4 n. _; a u6 ?
test ax,ax
2 O1 s7 }- g5 i. [& D jnz SoftICE_Detected, ]1 U, [% r3 m. `- w
- n8 r. f, j' X5 c( _
___________________________________________________________________________3 U* o6 [; }' H3 n4 X2 z G
' T" @1 z2 V9 q
Method 047 T" M* \: m, [. q9 m8 N2 o4 b
=========
" I7 Y7 D- T9 }5 W5 i6 R- e6 N5 W% D) Q
Method identical to the preceding one except that it seeks the ID of SoftICE& |& |" w+ m6 Z& l+ f1 P
GFX VxD.
1 A* U! G* h5 U2 {1 z( }1 s7 j) }" x
xor di,di; o6 D% q$ M1 M6 O% |% b/ G' T
mov es,di
6 S& |/ c1 i# L7 Z8 R; H/ V" k# c( x mov ax, 1684h
: S. n/ J1 R1 R7 y( G/ a9 M mov bx, 7a5Fh ; VxD ID of SIWVID
" I, c$ a) M, a int 2fh
% ~$ ?6 k2 T2 P% z0 A; a' ? mov ax, es ; ES:DI -> VxD API entry point+ k9 j0 J/ l; E
add ax, di% ?: u$ p' N! e/ A8 ^2 d k
test ax,ax
f& E5 E+ L5 R; _9 S: a' U2 F jnz SoftICE_Detected; C5 F) q8 J0 P6 c0 N6 Q
. A- Z$ c- o9 o0 H5 o! Y. k
__________________________________________________________________________
- a; ~3 H8 l4 O$ h* u4 ?) h
! P1 K; P: Y# d% e0 ^% @; ?, a
/ M2 r0 `" n2 UMethod 05
- y% p: N9 E' y3 X; P=========' \8 e4 S/ u$ |2 m9 f
4 }5 d5 u2 t' p) G7 P% Y) G( i U8 J2 Q
Method seeking the 'magic number' 0F386h returned (in ax) by all system }( w! e: H1 N- p4 a+ U# T I
debugger. It calls the int 41h, function 4Fh.
7 p. i' ~* `; T7 e5 FThere are several alternatives.
) g, l9 x( D8 I# f. l$ q- i3 L* L8 F$ r" N' h9 S
The following one is the simplest:% e; E" _* J, {4 x* ^8 E
' L5 J/ I0 S. n# g" P
mov ax,4fh
$ z$ F/ x: R1 x' ~) w0 R) B, H* D int 41h
3 t+ {) L2 Z$ P% _. A% ?$ @ D cmp ax, 0F386
# v4 }6 L$ K6 ]9 g; M' M5 f3 q jz SoftICE_detected! H/ z# }4 z, r: n
/ f+ \1 T2 T4 k( R0 U$ w
3 S4 U1 D7 Z9 y( P. {Next method as well as the following one are 2 examples from Stone's # ?4 g1 v: `0 d( H
"stn-wid.zip" (www.cracking.net):
- V9 B! i' G/ O1 h0 L" T7 h+ u
1 n) i; i& \: e6 X2 _/ V7 C mov bx, cs/ W% d0 q: L+ G+ x# q+ r
lea dx, int41handler2
/ D- p( ^% u+ d- ~ xchg dx, es:[41h*4]
5 Z7 g! |) g2 ^+ F9 U xchg bx, es:[41h*4+2]
/ ?$ g/ U: N! L4 o* h mov ax,4fh2 M* `% K/ t9 F- R$ q" d: D& H
int 41h( d. l8 d5 S$ C! t. o
xchg dx, es:[41h*4]7 J+ ~9 m6 n) y: o e
xchg bx, es:[41h*4+2]8 ?7 y' E' g& @
cmp ax, 0f386h
, H. A8 p) W# a, D jz SoftICE_detected5 I5 Y3 ]# s( p$ Y w! X* t' G
- h4 N8 P" |1 `' g6 }- A2 \int41handler2 PROC
' s m% ^: _& O% Q iret
! i2 k/ ?6 Y& r2 K+ Oint41handler2 ENDP
! i: W: S& N' ?7 N8 g& J3 R: L# B- |& {7 i5 i
9 {: w9 i: |3 L; X_________________________________________________________________________" ]' g* x' N) H/ C8 N' b- B' N0 {
3 q) o* |; }, c6 K- }) r4 _* t( s! b+ e
- E4 L( y" {1 l& h7 UMethod 06
, c p4 v4 r8 u8 m=========$ c) d/ M- M& `5 ?8 E& @0 S
! I2 [& `, }$ V, _3 Z+ ?) @, L8 n8 Y1 C
2nd method similar to the preceding one but more difficult to detect:9 T1 l- K! J6 r6 {
. t u, G' h2 N0 v: ~' O# e2 |
* f: I, r0 n @" |7 \; Hint41handler PROC
% p c" q: B' j5 W# a mov cl,al( |1 B# \- q" }' z
iret
# R( B5 z8 r* }( {int41handler ENDP
) _ V! Q' p5 ~2 i4 C5 J7 V0 r2 `" N) l9 n- Z
! L8 o) n0 `( `4 N% e! X) P
xor ax,ax
3 T/ w9 c/ f: K mov es,ax
- E% N6 ]% O p mov bx, cs
! A4 T( j+ P( s7 ^/ W$ Z7 C" Z lea dx, int41handler9 _/ N1 E% q% f5 M
xchg dx, es:[41h*4]
+ |* h+ X1 B B) }9 j8 w* Z# p xchg bx, es:[41h*4+2]! F; {" D5 q9 p. m
in al, 40h
0 a8 _! t; F) _) a xor cx,cx) Y) e0 n% S/ ]$ ?0 g5 ~
int 41h7 F0 X9 y) x0 `4 C, e# C
xchg dx, es:[41h*4]7 _9 {1 Z; \, {* ?$ h2 f6 z
xchg bx, es:[41h*4+2]
9 c" a3 x6 R( d& p) H cmp cl,al
& \9 [1 K6 X$ G jnz SoftICE_detected
z4 U9 S: q' M$ d6 D8 ]; ~
1 e9 f. l9 e- L6 c3 S_________________________________________________________________________9 c1 v) @, v5 N. a) W U* l% F1 W1 T* D
( I. u( Y/ ~. f1 p
Method 07
V1 U, S+ _4 P' @6 X3 q4 A=========
* r+ X% q# D; z' Z6 C6 D- z$ k! j. ^1 `* t9 s4 o+ I. I' B; h
Method of detection of the WinICE handler in the int68h (V86)- O r; \1 g! R+ @" P, R a
" K# g; t0 X* g3 C. j; T4 U mov ah,43h
% ?5 U c) i0 s3 s6 d5 R int 68h1 E6 H% c4 G) ?' K6 b1 v# S" p4 T- r9 ]
cmp ax,0F386h2 g" c, P8 y& u% N+ R
jz SoftICE_Detected7 Q, U4 G8 S5 T; Y& g% S' o0 M
) `& T. O' _2 r8 w O2 T2 x
6 i Z% \8 O4 I7 J- G
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 O' R( |$ W3 ^& ~
app like this:
K) b" W! w" u
8 W' g& m4 H; @5 A BPX exec_int if ax==68+ w# ?1 G( x4 t; l( o
(function called is located at byte ptr [ebp+1Dh] and client eip is0 H5 t* n2 ~5 d. s
located at [ebp+48h] for 32Bit apps)( V |& Y2 p1 |9 L0 ~2 E$ @
__________________________________________________________________________( Z1 E. r5 a1 |- R, K. X
: t/ u$ D7 M C' |& L% J
" |: p/ a/ m b' N0 {: _Method 089 [% T5 K$ D$ q+ p! E% ~4 q
=========
5 W$ N8 u3 x5 J& P/ g) y' \8 a& v6 }$ g$ p. K$ e1 t8 j
It is not a method of detection of SoftICE but a possibility to crash the& \* g- m4 b$ G( O& l. W
system by intercepting int 01h and int 03h and redirecting them to another
" ?6 i4 M. V0 X1 X. B+ u K' Q/ ?routine.
" C+ [6 H4 m4 i' bIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ X/ H7 X! ?1 E8 A# e! ], \
to the new routine to execute (hangs computer...)7 A$ y* h5 Z0 }& k$ v6 G: h" g1 K
) }$ }& w! F- ` @ mov ah, 25h
7 v5 E* t: I. J mov al, Int_Number (01h or 03h)& P* ^* m8 T5 R
mov dx, offset New_Int_Routine
! |$ Q4 Y3 T8 q# x int 21h
' V3 \ g8 o, [5 c% D) q8 R
% C n( i2 R8 `3 D: R__________________________________________________________________________: C6 x+ i4 B/ V
7 ?9 y% m' Z) Q9 X
Method 09% X. k9 O1 [0 x. N& W7 T9 U9 \, j; |: u
=========% [2 v2 w2 O1 `. L
! C: g L5 r# u' [9 z* |( x: uThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ H! I+ y4 R) L% s. N6 W. g! tperformed in ring0 (VxD or a ring3 app using the VxdCall).* E' l5 U# w' _3 C1 _! R
The Get_DDB service is used to determine whether or not a VxD is installed
) `7 t( M+ t. g/ o; c' g/ h. ~6 ffor the specified device and returns a Device Description Block (in ecx) for
# Y$ s9 m6 s9 \# ^" qthat device if it is installed.
0 H2 W! z' f. G6 s4 R0 Y2 g0 V3 m! F& J3 b
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, u7 C5 f& \$ D) L) ?# G
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 b3 c5 b# `, L+ j9 {9 q- k; N6 u
VMMCall Get_DDB
) f# h" @$ {2 d9 ^ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ n8 Q9 B6 N) ~+ o7 E$ x+ W3 y" d; D7 l# ~! c' `1 m; Z b1 P
Note as well that you can easily detect this method with SoftICE:9 ~! H( u7 U% h! l
bpx Get_DDB if ax==0202 || ax==7a5fh
% E, c* Q3 Q$ E' |/ ^; N4 a y) L5 c# O3 \" F
__________________________________________________________________________3 _* Q4 L& Z Y
( G( ~/ N# U' O6 v$ ?) q& e
Method 10
$ S$ e/ S4 J+ q8 ?* t=========
8 s0 h4 o3 \& k7 ?$ `7 f) N, \$ ?' J5 j' L9 ^+ s$ W
=>Disable or clear breakpoints before using this feature. DO NOT trace with7 R& `! l# C m+ P4 s8 H
SoftICE while the option is enable!!
! `* L; ~8 S. S$ J% u; `$ g
9 K w$ Q$ |6 a4 M8 m5 eThis trick is very efficient:5 }9 r& y* e! i; d% i
by checking the Debug Registers, you can detect if SoftICE is loaded. u9 n8 ]8 b6 S
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) a3 {* Q# G& x1 \2 ?3 y- A
there are some memory breakpoints set (dr0 to dr3) simply by reading their) V+ v4 ]/ H9 Z) J+ i# c
value (in ring0 only). Values can be manipulated and or changed as well! r' e' B4 y [
(clearing BPMs for instance)
* `% I) ~$ v# O$ B- K# I3 D
: A4 u1 j4 q' J__________________________________________________________________________
5 b) P+ E/ p* N
m& y; B8 O8 \6 V. EMethod 11
0 W5 V% `8 L) w=========
+ a9 R3 X& B# e% f5 v
$ z9 y& M/ G) g+ U6 t2 P! Y: ]This method is most known as 'MeltICE' because it has been freely distributed
' M( y. G' N% L4 ?) j, W6 |via www.winfiles.com. However it was first used by NuMega people to allow5 e/ j4 g$ w- s: N
Symbol Loader to check if SoftICE was active or not (the code is located
8 G+ f2 s# l# x. z! r) w' qinside nmtrans.dll).; n- ?# G" B8 G+ D3 P# i% C; p
3 s z) T( n; D4 C) H- t/ j- G4 e0 gThe way it works is very simple:
5 s6 z& W- r% y9 K5 iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 ]: N$ s3 X0 L6 C# H
WinNT) with the CreateFileA API.( m" O. n& W% u% b7 Q
& c* ~$ W* j+ m2 o/ e
Here is a sample (checking for 'SICE'):9 h7 S# b* o) Y) Y6 y2 f0 ]
" n$ B. q3 Q% m7 |' Q9 N
BOOL IsSoftIce95Loaded()
' f5 I: J; }! L! @$ v{- f, P+ q- W$ Z: |
HANDLE hFile; 0 U' Z5 o) ]' C/ U
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 I1 f+ M: P0 _; J1 h9 [7 P8 f FILE_SHARE_READ | FILE_SHARE_WRITE,* C# ~! f" `; |( p' O" f6 v
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 o+ u# A. R1 r8 y1 _' I& }( h9 \2 k
if( hFile != INVALID_HANDLE_VALUE )
- m p0 m: Y$ o: { {- V/ K; @$ I" ^6 Z2 D" i7 O2 H
CloseHandle(hFile);
# @* G) x6 d0 {# Z1 T return TRUE;- M, r& E9 ^& |7 D- B& Z. {
}
( }: g& y* a4 r9 x! k' n3 I( f1 ? return FALSE;- j& a3 m9 E: v$ m* R4 q2 ~( j7 t
}. T. f$ _5 j! X/ F" c2 {
2 h; V4 J% F# }/ t
Although this trick calls the CreateFileA function, don't even expect to be# E( s; p9 o Y9 `, ^& j) q- t
able to intercept it by installing a IFS hook: it will not work, no way!
. F! Q& o" f5 u. lIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 H6 ^& E7 D! g5 z3 Z" `1 K3 cservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& F9 c/ T$ v3 X' `' U" |and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ e7 J- i: q) t9 h
field.
# a4 O" E# P9 v, M8 s# g9 DIn fact, its purpose is not to load/unload VxDs but only to send a
% f; l: X" c- m" KW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 p/ B7 \* s4 D) N1 r' jto the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 ^2 A; a" p( K/ Nto load/unload a non-dynamically loadable driver such as SoftICE ;-).
) {6 C& R: J# f" Q, FIf the VxD is loaded, it will always clear eax and the Carry flag to allow1 v* e V' A( [# V& O
its handle to be opened and then, will be detected.
2 j% M- Q$ R& g% E% ^7 [You can check that simply by hooking Winice.exe control proc entry point$ c q' r/ g* f8 z+ j, r. J
while running MeltICE.7 D! `' i+ ]; z q
" `, ~7 G% F) R' V# r
4 h; J# x7 F: L1 g7 M2 c 00401067: push 00402025 ; \\.\SICE3 B, W6 b# c( W& Z0 P! a
0040106C: call CreateFileA
& @8 p. S7 _0 U$ y 00401071: cmp eax,-001. P1 |4 t4 v. w
00401074: je 00401091; n, {9 l9 w. r- F' p6 d
% A& |4 O1 t$ z. q# i: J- O( h) I( B) D$ S6 P9 }6 T1 \
There could be hundreds of BPX you could use to detect this trick.
1 ~8 Z, V, D- n1 _-The most classical one is:: j6 D. l) d# z& R0 J% Y
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
6 H' F* c7 @+ ]2 Q* |2 S *(esp->4+4)=='NTIC'7 Y" I7 b" Z) M1 K* Y7 M3 p
. C( i: Z" x3 X
-The most exotic ones (could be very slooooow :-(3 {. }5 t5 N$ J# W7 D" X4 A
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
5 x8 ~ Y: R! i# e ;will break 3 times :-(
/ |0 k: |) Q$ u( i$ w3 j9 Q- X7 z( G5 _! z+ z+ ]% ^( l9 L
-or (a bit) faster:
0 g* [, F6 [9 X; P BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 m) `% S3 H( Q/ G
4 r# x' b; k+ f; @
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' # z+ l* G% Y5 }. L, B1 _
;will break 3 times :-(0 j$ [8 {5 `9 V& D) `- ]9 e
6 x9 n4 W( G6 r! h" V" l
-Much faster:2 C* I1 h4 s$ p7 J2 R
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'3 H1 g' q0 A+ O' g
8 _, m; B# Y5 e( f
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen, i, ~# N. S( Z; c6 o w
function to do the same job:
/ g. A$ [. M( k
% W' ~' X3 B7 `5 ~ push 00 ; OF_READ. K8 }/ H, w4 x7 |
mov eax,[00656634] ; '\\.\SICE',0
. B1 h, A4 h0 I. {6 _8 y' \1 P- e push eax% c$ T4 E% _% S1 J% u: p
call KERNEL32!_lopen
( M8 Y) g! L% g2 M! x inc eax6 c/ ~/ D+ E1 E
jnz 00650589 ; detected; W9 n: T& s5 {- {$ H: O2 d
push 00 ; OF_READ
% d j- ^3 e% ?! f mov eax,[00656638] ; '\\.\SICE'
4 g+ A& }1 b- F) y \4 v push eax* N+ g1 ?: w$ Q" T( a1 b
call KERNEL32!_lopen
! R& }/ ^. T$ P2 m9 R5 h3 O inc eax3 k1 X; S+ `3 Y6 C
jz 006505ae ; not detected5 @, W, h5 O+ B. u0 [
* w9 J" g3 E3 }
2 V0 z6 T0 p1 z$ W6 m& Z__________________________________________________________________________8 m/ q: u% s Z7 Y- `/ y$ K9 @
' X: M4 U1 ]# d4 f# J1 M0 d
Method 12
% }( R# ^4 H3 b: x& Y! t8 Z) M=========
3 y$ j$ w- c- c3 N9 R) x% M6 e( N, ~& r: {9 ~' Y
This trick is similar to int41h/4fh Debugger installation check (code 05
2 V# `8 l7 c; ~1 d! d* J& 06) but very limited because it's only available for Win95/98 (not NT)
$ Y8 w! ?/ p; H# tas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 a, o, N5 }, v
( s3 Q5 L8 m0 j. U% h+ }
push 0000004fh ; function 4fh
5 K5 k6 I- d: X push 002a002ah ; high word specifies which VxD (VWIN32), {1 j! g8 V( K6 P0 p7 t6 j
; low word specifies which service B, N; L2 P0 _4 ~4 r0 T$ P
(VWIN32_Int41Dispatch)
, S% v l9 l! n) u- e( v% B* g" O call Kernel32!ORD_001 ; VxdCall
- S: @# a$ s$ f cmp ax, 0f386h ; magic number returned by system debuggers- K4 ~' @. e+ N% r9 Z
jz SoftICE_detected2 d2 k" a | V, Q6 U
, l. ?$ \0 E0 j l
Here again, several ways to detect it:
3 J% h. Q6 U$ M9 s
* a/ c- T) F4 Z* c+ M: p8 T! w BPINT 41 if ax==4f
1 h2 h9 q$ M O% g% @9 P5 y
! _) i- d2 k$ ]- D9 m; d- N BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one# l. ]; E9 ~- m2 I3 [+ N
* ]6 R+ _4 i4 |4 `$ |7 I BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
7 T8 S4 f- v. u3 k; J4 ~7 T1 O$ d2 Z0 P; H6 T* r2 U& z
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
; x4 U9 G0 n0 J3 V4 R
8 y& u+ D& @; X# F8 Q__________________________________________________________________________
9 q& c/ T8 m8 N7 W: y9 e% Z1 _/ u/ z Z2 d
Method 13
5 n( p8 m2 u2 s) `$ Z/ M=========* f/ N6 ~3 w& ~+ B" `
# G+ C r" Z- d! BNot a real method of detection, but a good way to know if SoftICE is
, u/ J0 m6 L7 H* M' w. A$ d" Q2 i, linstalled on a computer and to locate its installation directory.8 ^; X/ \( M4 v. d9 l
It is used by few softs which access the following registry keys (usually #2) :
! S. E( b! p. a- s/ V7 s, u* n- I+ p+ k) @$ q; N7 B# i0 u
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 f. a8 s: J0 j' c0 `" }\Uninstall\SoftICE
% p- J0 d+ U# c0 O-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 O1 C2 ^: L/ \+ V3 [: v% V! j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 x, {4 p3 ^5 J
\App Paths\Loader32.Exe2 z: A" t* J7 }$ p2 ]7 j
) |1 ~, H% H4 q1 v- z9 V- ^9 K+ g: ^" H. c6 C7 G; s
Note that some nasty apps could then erase all files from SoftICE directory) n8 J7 b4 s1 t# P( x: s
(I faced that once :-(
/ @$ K4 n7 o$ O0 d; A% `- Y4 }8 |' x2 o9 P' ~* I0 d! H
Useful breakpoint to detect it:* ~( P. o& V8 z# j& f
6 V% T4 o# J, J! [; k8 t
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( H8 J! C# J8 R
1 o) u! @/ t1 ~( |__________________________________________________________________________" d# I1 u( A' E. \, i; o
) |% h& F( @' Q1 H& i$ S- u' o! x b) m" H2 C3 N
Method 14 ' N2 g0 A3 U" t2 F- R! P& I
=========3 T& q5 x/ X( X/ n( {
. Z' N6 N1 E V' T$ |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 r8 P+ ~- h6 V4 U2 b( I) U
is to determines whether a debugger is running on your system (ring0 only).$ b0 t& o7 ]! P8 ]
7 N8 d) X+ N U) p! _
VMMCall Test_Debug_Installed
" V4 f' B @4 i4 ?/ E je not_installed
_* g& B8 u" m2 {1 B; v% u( q1 D9 y
This service just checks a flag.
: J2 K- G* g0 ~) T4 @& k</PRE></TD></TR></TBODY></TABLE> |