<TABLE width=500>
# S! f! J5 Z# }7 m8 u# T7 O<TBODY>9 ?# _1 R1 E( |" R. R' G% C7 F$ c
<TR>7 }9 f J* e. q* ~
<TD><PRE>Method 01
. E" s# o. S. `1 W% n( J, p=========
" y \ h& X+ q9 v& i; r8 }, M* K4 D1 e9 r
This method of detection of SoftICE (as well as the following one) is R0 j) W/ `( J9 A# B
used by the majority of packers/encryptors found on Internet.
, B/ T! u9 n) vIt seeks the signature of BoundsChecker in SoftICE
5 U1 H9 [* |3 O) g: _! v8 y1 \. V! K' W) \7 i) E! V
mov ebp, 04243484Bh ; 'BCHK'
+ L: ]2 C8 P' f6 q5 \5 m& {0 k% o mov ax, 04h: g/ Q$ U; L* p8 |6 a# _4 S
int 3
" b R. D- ] _! W! h2 f cmp al,4- I( C) }$ l; ~% h f$ `
jnz SoftICE_Detected
# \# F' a2 o+ X+ s# ^5 f- c9 f
: t% E7 R, W y7 P# @! v# {6 P___________________________________________________________________________. s( J& G! Z* o2 f! y1 }3 v7 K, T+ \
' K5 @7 a! Q( L8 }
Method 02: j0 o9 f+ E+ k; A
=========! M6 }/ d( b( `5 a% |8 j7 {
7 n6 c+ X7 Y& w6 \ {9 fStill a method very much used (perhaps the most frequent one). It is used0 G: Y8 ?7 Y2 T* D* l
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,& m9 P/ o8 N( B( k
or execute SoftICE commands...6 T; C% n& k5 j& k
It is also used to crash SoftICE and to force it to execute any commands
, u M w- q, a/ o) n* c$ n: [(HBOOT...) :-((
1 }8 S% }! \6 ^# f" M. d1 N
5 K. F4 B9 x5 V& A( R( K) nHere is a quick description:$ k5 d7 c1 \; F
-AX = 0910h (Display string in SIce windows)# ~) B& Q \9 H5 X3 e
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)" ]/ h3 r+ v3 r4 J
-AX = 0912h (Get breakpoint infos)3 l8 K! b, i; L
-AX = 0913h (Set Sice breakpoints), ]3 r8 [& p$ I3 U/ L3 W
-AX = 0914h (Remove SIce breakoints)0 N& b3 k9 n0 {) A1 q" Z+ ~( @
2 h% D$ }0 t# A/ OEach time you'll meet this trick, you'll see:
; t, m: l Y/ [- e: r( j+ O-SI = 4647h
/ L4 }0 A# `/ y Y Y" n-DI = 4A4Dh# ^; G. o4 S1 y0 Y; g; R
Which are the 'magic values' used by SoftIce.# h# C6 T. C) }2 I Q% L
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.) R/ L3 ?$ _7 q+ Q4 R) |& k
* U6 k9 T/ W9 R. O4 U# u
Here is one example from the file "Haspinst.exe" which is the dongle HASP \) H7 v! U G7 m% x
Envelope utility use to protect DOS applications:9 N" D' s' M( }4 \9 N
1 c) ^5 D; s8 ^# w8 i
+ E# H+ u6 t6 }4 o' o/ W! T
4C19:0095 MOV AX,0911 ; execute command./ y% ], x; U& `% [# I: O9 |$ b
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., b+ x- U& ^ D) y" @
4C19:009A MOV SI,4647 ; 1st magic value.5 f# @' p" q% m1 v- o3 k" G
4C19:009D MOV DI,4A4D ; 2nd magic value.* O( ^6 p% @& X* d/ g
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
' E$ l% q3 w: }; I6 [( l, ]4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
2 [4 m7 ?( E& G- Q) n& B+ m4C19:00A4 INC CX
6 X; s+ f* t- V4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 I2 y/ |' y0 f; _1 K2 y0 A4C19:00A8 JB 0095 ; 6 different commands.
% b* B/ f# u8 Q: t/ x/ i3 `0 M' Z0 q4C19:00AA JMP 0002 ; Bad_Guy jmp back.
) T2 M, Y' H: S! L# r+ R/ J' F4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
0 [" b1 @, w; w1 s$ D- g
# i3 ]% l( b( e$ C/ gThe program will execute 6 different SIce commands located at ds:dx, which
( V' p5 e* g$ l: w! f' \+ ~are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 n" k; S& z/ W) O* ~+ w
a0 d! d) b1 @( H6 Z2 A) ~" K8 G( y( F* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
p. r! [: l6 j+ ]0 H* h& v___________________________________________________________________________) g" e& L* D& |' I8 s' y
7 U) `4 c. }& n( g
3 t9 t6 y) T& q
Method 038 g2 Y0 j1 d( @* D0 j
=========
: ?& a, I C! j$ U0 d; t7 p
$ {7 y w) j6 M" F3 B) n' g# oLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 {& i1 b8 T7 `: P( F(API Get entry point)) g+ w8 m5 `" a& e% f5 K
& P0 R9 C- W7 d0 K- A4 l
0 W* B# }$ c: K) X$ x
xor di,di
+ E: X. }, N# V! o- ]5 B8 c mov es,di2 W9 a, a2 b7 Z
mov ax, 1684h
, T4 A: R; {6 J6 o mov bx, 0202h ; VxD ID of winice* z" ^. o, E+ H: e; l! o
int 2Fh$ [' n, {. ?7 L% @( J
mov ax, es ; ES:DI -> VxD API entry point
6 r1 O: t; r. n8 `8 E add ax, di$ U# j$ `4 L6 \& D$ B7 m
test ax,ax0 i9 C5 t0 v1 q' U1 _4 g. H+ j% G) J
jnz SoftICE_Detected( z* C4 ?) E* V1 s1 y! }8 _# T
; t! o! M# a2 ]___________________________________________________________________________
8 c5 ~+ }$ U) ~, `: K
R. t( g3 u0 q9 N6 P: EMethod 044 Y+ w# G4 S0 M
=========! n) w. c; Q. @+ d- h+ o
! |$ D# @3 i% A \$ @Method identical to the preceding one except that it seeks the ID of SoftICE! w' g7 }' R( P- @4 v+ D2 I: ~
GFX VxD." F7 @8 |7 ]+ d% p& f3 E
1 g7 B* V4 }/ d xor di,di& k4 i& U3 l8 T" j
mov es,di
2 o6 Q8 ~; y4 T0 a* ]5 y4 {& m" } mov ax, 1684h
. ~/ X0 z$ m L# t mov bx, 7a5Fh ; VxD ID of SIWVID5 a: f! N# Z8 I9 o+ E) H
int 2fh
- q' T/ {0 o: e W$ a mov ax, es ; ES:DI -> VxD API entry point
( r+ s: T7 d9 g! r+ f/ v6 n% z7 J add ax, di4 N( w4 D4 G, V, u+ N
test ax,ax) _. O( T) W0 V9 Z+ \- L5 B
jnz SoftICE_Detected
: r2 g) h* ?$ v0 }; V; z, s# v' B5 y' I" s
__________________________________________________________________________
: V [# y( l1 e, I: `: q+ n1 U! q8 p% q
- b" ]" `) s L* N& r4 A. }' ^* iMethod 05
: n/ e8 y7 V( i$ }5 J* q+ G=========
6 ]2 @5 [5 { o( d9 x
, n. _" c, {1 J) |+ xMethod seeking the 'magic number' 0F386h returned (in ax) by all system% b( a, p: x7 t& S
debugger. It calls the int 41h, function 4Fh.: t# u' @5 |! Y) j7 ^
There are several alternatives.
+ u; x% U9 F. R/ k# v. f/ u" d; b! T6 S2 ~
The following one is the simplest:
8 v2 c' A! f7 S0 `& R- |* l: V* v2 }2 o* ?9 ], N
mov ax,4fh( x8 r, V3 ?; q1 T* }1 i
int 41h
2 c! v2 }+ T6 M& }+ Q( x$ \ cmp ax, 0F3861 E' g. [$ G6 L: n" S
jz SoftICE_detected" f% \. l5 V0 p. I# J
0 U! u5 A9 b4 R2 U) V
4 x" z% ^6 g8 Y- h; dNext method as well as the following one are 2 examples from Stone's , g% o, u3 T% }6 V' X8 P; y0 l
"stn-wid.zip" (www.cracking.net):, p- u6 B3 G w8 R
. H$ Y9 c& h2 M! E0 W2 v
mov bx, cs: l/ A2 `& g/ j& a
lea dx, int41handler2# D; e' w- D& G8 \' f5 ?% s( Y! s# M
xchg dx, es:[41h*4]
+ A' _8 Q% ]# I( b Z2 _# I xchg bx, es:[41h*4+2]
; y, I0 a% q2 o; t1 ? mov ax,4fh7 p% {% w5 c$ T$ ^) g+ ?
int 41h+ J' ]8 ]: j1 i5 c$ ^) n
xchg dx, es:[41h*4]
3 I9 x0 Y; ~4 J8 T xchg bx, es:[41h*4+2]
8 q7 ?. T% s4 ~" G6 i. a2 E cmp ax, 0f386h
! l- ]; x; m; Y9 V! }% _% j7 s jz SoftICE_detected
3 Q' d6 W1 H/ B, F+ `0 {# s4 v+ ~4 W( [" P; O Z: Z- p0 @
int41handler2 PROC
" P+ p3 ~% ` {. ] iret7 D( W4 H; Y2 F7 a) S" s, f
int41handler2 ENDP
1 t( ?5 @( y5 d* _
3 J z1 R4 ?* B5 Z7 Q* C4 B$ a
/ u" y7 D$ J; ?- G8 d_________________________________________________________________________
1 c$ b8 J U& m9 p! L5 X
9 }1 ~0 z! g7 }2 y5 K9 e* t, F4 W7 I
6 ?3 \( W* T! gMethod 06
$ I# n5 G% ?: y3 r. Q) g2 m5 |, r/ b=========
% w! B9 H5 s3 m2 b( c5 b+ D& D5 }8 E3 C
. C$ e. L3 ^0 M. M3 D) M& o
2nd method similar to the preceding one but more difficult to detect:( e5 L8 a: N. _# k9 Z2 m- y
1 G& `9 O0 A! Y- u0 c7 F" ]
+ x/ U, y% K% g I1 L5 Dint41handler PROC+ {+ z6 Z( J6 q; O) j7 e3 ^
mov cl,al
, Q9 u% R$ L: d" `' U* @* o iret
. \# b9 k* R; I( T z" w0 v. [' Zint41handler ENDP6 k5 u2 ~$ X6 |9 k
3 L% K- m g+ F2 d1 o! V5 d. W. P8 t5 o, h- c! ]) z
xor ax,ax
) q% |5 c, N7 Q mov es,ax
2 F+ j, e5 a5 Y' V; H mov bx, cs
0 G% R" C3 F; n ] lea dx, int41handler
' k ^0 T/ _2 v q' W xchg dx, es:[41h*4]
$ Q) K8 W7 Q( C+ Z' R. f9 J9 [; Y xchg bx, es:[41h*4+2]
9 }6 j( S6 l' a y7 S E in al, 40h
) E& z! C9 e' P1 g& A* [* } xor cx,cx
. }7 f- U, i$ n int 41h- \7 k* \7 u) x3 \
xchg dx, es:[41h*4]
& O& m6 y& _5 ^1 w xchg bx, es:[41h*4+2]/ L! G) E2 \+ q6 j' _# T
cmp cl,al
9 Z- o) c" z9 x; {. N8 z jnz SoftICE_detected/ h# m" [" [0 R2 S- e D
; a* a3 a8 z2 m% u* i' j8 ?_________________________________________________________________________- K3 m4 l, p5 @( z) Z' O( z5 k
2 {& h' `5 X3 t2 p4 V, p% @# \
Method 07
9 L5 a# y2 E, \' M; G2 D& V0 a5 I8 r=========
0 h& U6 P- k3 f
9 J3 B- u! q/ g+ T2 \0 W h+ Z @Method of detection of the WinICE handler in the int68h (V86)
R8 S. v$ R/ i1 u
( B! z4 s+ s7 V" {9 o9 i mov ah,43h
! [3 j; ^* e( N int 68h
6 E( R& }* H% {) M# f$ k cmp ax,0F386h
9 V$ l7 w- g9 \% J3 ^& \ jz SoftICE_Detected* ~+ ]; D! i7 t, y; P2 }; Q
# P( g* Z! C) Z- b- M6 i3 b/ ]6 w* Y3 P9 Y0 U# W
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
) l5 l9 F& s+ \4 b9 Z app like this:2 M9 \" j" Q; z' i1 \
" b, Q2 X( G9 h
BPX exec_int if ax==68" K/ m/ T0 Z0 W9 x6 y7 n- q
(function called is located at byte ptr [ebp+1Dh] and client eip is- A- H2 f& }1 M5 [+ [0 b
located at [ebp+48h] for 32Bit apps)
* F- d2 N) v* b& |0 Y, Z' q__________________________________________________________________________
T7 i5 J# L8 c2 s- M
v4 `. T+ Y0 | F* w7 V. A
2 t/ b2 V: @# g1 LMethod 081 Q! G2 z9 r+ B, G. [1 A# E
=========) k' t7 m* |# H, g
4 l: b) H l9 J% `1 TIt is not a method of detection of SoftICE but a possibility to crash the3 m) t/ Y& w8 L$ D
system by intercepting int 01h and int 03h and redirecting them to another
6 L6 u" S u. k9 x3 E; ]6 nroutine.
0 p8 m5 p/ z) a* nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 \6 v4 C& B0 J q* U& G- ^8 [to the new routine to execute (hangs computer...)1 W. u. T$ I# s( Z
5 E$ P% K! {+ ^9 B: U7 H# H4 g! T
mov ah, 25h
V k4 L- K- A ]8 w9 Y- } mov al, Int_Number (01h or 03h)1 m3 d5 E4 r4 F+ y# A! O
mov dx, offset New_Int_Routine2 x, p; F& t8 m2 c2 B S
int 21h
& U' p( }: N3 Y: ?
* L4 ^, }" r6 J5 ?; e) X( T__________________________________________________________________________
3 r' R# f$ I4 D) h t t; d: }$ e P b9 K
Method 09
7 Q7 [0 b' r @; V/ S4 v=========
0 ^ P5 b1 M2 f: h b$ A/ I5 U9 V
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 q/ h' q8 s9 [/ nperformed in ring0 (VxD or a ring3 app using the VxdCall).
- C9 R4 _( m, F! `The Get_DDB service is used to determine whether or not a VxD is installed
( M0 g( E7 o$ a! Kfor the specified device and returns a Device Description Block (in ecx) for
1 Y$ n# B! M9 d5 Z3 Z9 Zthat device if it is installed.
+ t" @% v0 X4 U, q8 s5 S
9 x7 x& o& }. {3 l) h U! m/ A mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
5 P+ i( y* j: J; z) S& d* R" i mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# _1 W# v+ ` Y, d7 B2 D VMMCall Get_DDB1 A( o: c, b1 |% x( B
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' F6 x0 \7 t7 r; Y1 C; J
% J; F0 T% x: O
Note as well that you can easily detect this method with SoftICE:- a, D8 Q( n( _. Z
bpx Get_DDB if ax==0202 || ax==7a5fh; ~+ l# R( ]8 v
, ]: S5 n' I3 e, X( v- `) U' ?# S+ b/ d
__________________________________________________________________________
8 K) e4 u) K/ L$ |+ G- j
+ l/ P3 _& N; p# t* ?Method 107 ~" [5 @. H4 t7 |8 p: Q1 \' T
=========
$ f6 H; H: X8 v8 x5 @) N7 Y2 E; e2 l& Z
=>Disable or clear breakpoints before using this feature. DO NOT trace with
( k' R# Z, Y+ i7 m e1 g SoftICE while the option is enable!!& G* P! w* b) f% s9 U+ C
& Y( |5 d3 j2 H) d' l
This trick is very efficient:3 r9 \- t8 T4 t" T& D& `/ K5 ~8 L
by checking the Debug Registers, you can detect if SoftICE is loaded
, y: o# O) l# y/ t# O(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! x+ f3 E# p. @$ ~& |
there are some memory breakpoints set (dr0 to dr3) simply by reading their
" G6 \& ~. `, [- I1 L8 w* I4 bvalue (in ring0 only). Values can be manipulated and or changed as well
/ Q( Y) H' j* ?(clearing BPMs for instance) i7 z6 E0 n/ i P) M- @# O
4 l3 s; I1 h0 a3 ^: |4 P p__________________________________________________________________________. a' C' I |7 g! w3 u6 y
& A' i, x3 c! ~8 V+ u6 h+ r
Method 11
0 ~, h3 D# S' {1 x; Q% Q: @, J=========
6 d. \! F4 n9 G- q2 u$ J( j) n7 b7 P p% \ u2 V* K* s. g
This method is most known as 'MeltICE' because it has been freely distributed- \7 D0 ^/ n8 [4 J5 C: d: b/ q
via www.winfiles.com. However it was first used by NuMega people to allow3 \' N$ ?$ r& d1 [' D0 O8 E: ]( ~
Symbol Loader to check if SoftICE was active or not (the code is located
# F$ e, P; `9 h. \7 Y7 rinside nmtrans.dll).- t0 R; y+ }( M$ i& X( V' k
4 S- g8 @/ v2 A
The way it works is very simple:& {- B. [& n2 B/ x& \) ], T+ `
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- m# ?7 v) \( V' O4 k' @; h# X* K
WinNT) with the CreateFileA API.( V4 L0 `& z* r; _; o
* M5 r: Z y* i' i8 N/ K) C
Here is a sample (checking for 'SICE'):( ]" y g5 v8 j, @" i( u
$ m W# z' f4 F) OBOOL IsSoftIce95Loaded()
- ]. p# ~( H2 T2 s H2 m! u{
0 P( v1 p7 m$ ` HANDLE hFile; 0 `6 r v1 L7 i$ g% Q
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* q2 z7 u0 J7 _& {( T
FILE_SHARE_READ | FILE_SHARE_WRITE,& { C& A2 W5 d! v
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; q; e% C7 H+ t% j' F2 H
if( hFile != INVALID_HANDLE_VALUE )1 I+ y. _8 G/ i) [- V% d: V* n
{& v& O2 k3 T% C; E
CloseHandle(hFile);3 e6 u' k, w M& W% G4 b" @1 g
return TRUE;
8 k3 n5 ~" T# W5 [! G5 S5 o) e* s2 g }
]! j$ G$ V0 p0 W1 N return FALSE;
/ V1 F% z T, P$ ?# m$ ^/ d}! s1 h# n0 `( [1 L
/ M2 z9 z. f- V! t D; n# P" E) cAlthough this trick calls the CreateFileA function, don't even expect to be' z0 a/ u4 [5 j# q- k/ Z
able to intercept it by installing a IFS hook: it will not work, no way!% g* q7 `/ K0 x5 z
In fact, after the call to CreateFileA it will get through VWIN32 0x001F" d( r5 `6 r9 I. e9 R" [) R' ]
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- p) t) j3 [- {: Land then browse the DDB list until it find the VxD and its DDB_Control_Proc$ O5 B) E& }9 [9 G2 F
field.5 {/ {$ `2 o% c* b* k- U0 @
In fact, its purpose is not to load/unload VxDs but only to send a
( ?$ d+ j. E7 g/ c& [W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 f6 ]& Z2 D. s5 |
to the VxD Control_Dispatch proc (how the hell a shareware soft could try% r+ O# j8 |7 m: I* d9 {2 Q7 M/ @
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
3 [" D, A) }, o6 q# ]5 bIf the VxD is loaded, it will always clear eax and the Carry flag to allow3 P6 p- W s! ^9 |9 @# g7 ?% Z
its handle to be opened and then, will be detected.
6 W1 M' e, `7 g, o8 a* z$ i$ SYou can check that simply by hooking Winice.exe control proc entry point, {' b3 q m1 D8 B3 s; x
while running MeltICE.
. r8 S$ d, a9 E* b3 K1 f9 ?/ j; Y. q. f* J
: o. R9 j) B D& a4 U, m. n 00401067: push 00402025 ; \\.\SICE$ y4 }8 v, g2 S
0040106C: call CreateFileA5 c: l: }' \8 j" g3 \
00401071: cmp eax,-001; i7 y' W3 ^( D$ l$ B, d4 H
00401074: je 004010912 A0 e( U F. q3 t5 a
4 y. d4 s1 N' g4 e! ^$ J) n5 {
; V) Z! {2 K6 a3 ~7 ~3 w+ w& j% ?There could be hundreds of BPX you could use to detect this trick.
2 h# a7 R/ C/ s& e4 p% h) v-The most classical one is:
6 m. x6 q+ @. ~. M, L6 G, w BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||( `3 L# C% R' @& q
*(esp->4+4)=='NTIC' _1 W1 K' `$ S3 Z8 U {
, l- m% F/ u$ p-The most exotic ones (could be very slooooow :-(
$ S. k/ X. i( |- C* a BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( n( M% J) w6 x$ T
;will break 3 times :-(4 y0 }% u4 E" q
3 l& U3 C/ D# `) c
-or (a bit) faster: 6 S) p% s% z4 s5 {
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
: g a0 ]/ t! i+ G/ ]* K5 C% U9 s+ D) a7 M0 O( |( [8 H
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
6 e! O* T) L; z* E4 { ;will break 3 times :-(; d6 ?4 s# a: h" x7 l# {# F
! m: t" c* ?4 _5 G0 q; X) p-Much faster:8 v" k# W2 V% s
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 E+ j0 X) r H( v' p) K
* A% m' q" `, Y+ J7 \6 YNote also that some programs (like AZPR3.00) use de old 16-bit _lopen0 z! a( @; H4 J# k2 m! w/ ?
function to do the same job:
. E* o; n, z8 u' g r3 A9 X( o- B7 I) E
push 00 ; OF_READ
" }/ f1 g4 B- W5 C1 R* i+ j- X mov eax,[00656634] ; '\\.\SICE',08 U" h9 R; e1 F( B7 `2 ]0 k9 `
push eax( R, w$ R2 o( V+ u- R- ]6 o
call KERNEL32!_lopen
. q5 |' g- A" Y/ a inc eax
, f) b4 a2 ^. k3 N4 v/ `4 J# |6 k- j! R jnz 00650589 ; detected
5 g* r5 n2 l% b push 00 ; OF_READ# Z7 p8 ?1 _" H8 V2 \' e
mov eax,[00656638] ; '\\.\SICE', c. y0 c2 c, g. k1 h% u: B
push eax
- b9 l- b" l! Z3 N- Q call KERNEL32!_lopen
* J; Z, C, U7 }/ g1 t inc eax9 Y0 G) d. X: m6 T9 j
jz 006505ae ; not detected
3 H; U. c. k ^7 _- n9 d3 p$ m9 ^$ G
) e& h) Z' J+ h8 C. \" x1 M* |8 @
__________________________________________________________________________
/ W1 ] T7 _# r; B3 J" H. s4 ?
0 c ^# N2 i1 n( g6 OMethod 12$ `( Y# E r* Q6 @1 V7 M
=========
+ b, L9 o: z4 p7 [& }% x% [8 x
' ]" u' _# e. }0 K; B4 h4 M. B" UThis trick is similar to int41h/4fh Debugger installation check (code 05$ O: E+ k" }+ v. B0 x5 `
& 06) but very limited because it's only available for Win95/98 (not NT)
3 G3 G# U! `* p1 ]/ `. j# n/ Ias it uses the VxDCall backdoor. This detection was found in Bleem Demo.& g/ I+ k) z9 q; ~$ c+ P' D3 s
7 t9 C9 W5 |1 s) `& t' X, r+ G
push 0000004fh ; function 4fh/ H6 G" n1 h6 ~1 J
push 002a002ah ; high word specifies which VxD (VWIN32)0 [! F+ L" U' X3 ?
; low word specifies which service
% ~+ O0 f1 J- z7 U7 a (VWIN32_Int41Dispatch)4 s2 {5 c' @( `. R O7 F6 ]! W
call Kernel32!ORD_001 ; VxdCall
1 j7 C; t; _' ^, w cmp ax, 0f386h ; magic number returned by system debuggers
, N/ P' b: e( {1 ?* w+ o' |1 o jz SoftICE_detected+ m% s4 E" X/ _. d5 p
9 N+ ]7 k; }5 o2 o* {4 {- k
Here again, several ways to detect it:! s" @+ W4 B; B+ I. T9 x
% \& ~8 e& ?; d4 h6 K* R* l+ S+ N
BPINT 41 if ax==4f
0 K% ?# Z2 G4 T( N
' u+ C6 h' l2 t- @# [' ] BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 s! ?& l3 s- I% M" Q# r! m
6 n5 h* H) _7 d. o% S' | BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
& R; v/ y/ ~/ k7 g/ M) r, Z2 w+ q
6 O s2 w. Q _- w BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow! X7 |# k/ R I- a/ F" X
4 Q+ d7 W0 i$ Y: o
__________________________________________________________________________/ @5 Q4 ]& H: T! x1 O0 b
; c! [9 n. g6 |+ }; BMethod 13, b \/ `' w& ?- C
=========
+ H0 B' q7 `, ^% L, A8 L. a4 @2 ~; O) x- t* {
Not a real method of detection, but a good way to know if SoftICE is
n6 F! W" e3 E1 i( p4 Linstalled on a computer and to locate its installation directory.0 _; q* p. Y4 U
It is used by few softs which access the following registry keys (usually #2) :
r1 p$ c' \0 i$ L$ Y- Z B* N, B- b \ {7 | U
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ x' g3 n, \2 I4 q6 `& s\Uninstall\SoftICE
4 [$ c8 g" c- P5 i-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- J$ a, Q! H2 O: j+ s1 o-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& L8 i0 k+ ~3 h- F4 q" n. Q
\App Paths\Loader32.Exe
1 a6 ~6 \$ M- k1 h( C# {5 s. B& c6 q9 B! f2 K+ Q3 G; z7 j
7 ~: s2 @4 P3 d2 X4 s2 ?! pNote that some nasty apps could then erase all files from SoftICE directory/ g& Y; ]2 Q: U) s
(I faced that once :-(
2 M/ \7 {. l3 d( N% D$ Y) ~2 _3 B& ~5 b
Useful breakpoint to detect it:
; K5 m; T3 s& W' J9 A
8 [. i% e) t' Z, g- q+ c BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
L* D# |6 B; z) K$ v3 G" R% [, B" V$ \/ |% Y# |# S# {
__________________________________________________________________________* }/ d! G8 h7 r# m; E8 k& q. R
7 Y7 h ]( z" O3 v& e, h: Q4 E8 i' E/ }
Method 14
" }/ O( i1 N5 n' z2 L=========% q+ C2 }' H0 p. S* O% ~9 j
: T$ H% w I9 {! ?+ D! SA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 |" V' e( J8 }
is to determines whether a debugger is running on your system (ring0 only).
; V5 {* y/ F8 J1 o6 Q2 ?. n8 K
" a2 d% |- H" v* V" q. Q$ q VMMCall Test_Debug_Installed, [6 _4 K0 d, Y, p
je not_installed
A7 V1 _ F0 k1 r5 N8 x: N( [& m- d- @! }+ k @7 F8 ?4 ]7 M0 i
This service just checks a flag.
' U c3 i1 i. z</PRE></TD></TR></TBODY></TABLE> |