<TABLE width=500>. g6 T4 T5 ~- D" D V
<TBODY>
& h( j: V1 a6 Y4 m# n<TR>
1 |7 U9 G; Y5 a) s( o5 r% {" t W<TD><PRE>Method 01
, U& [1 e5 s. e=========8 I* e Q7 H, T# `1 w; Z; [
9 t4 n+ g$ k' {/ X) P o+ Z5 f
This method of detection of SoftICE (as well as the following one) is+ \6 F- E! u$ M( D# F$ b! O
used by the majority of packers/encryptors found on Internet.
, J# K( S% @' g& w( d9 A) O rIt seeks the signature of BoundsChecker in SoftICE% M z3 y3 w0 `) U6 s" ~5 p
9 V* A/ t9 B6 k, Q2 X | mov ebp, 04243484Bh ; 'BCHK'
8 Y& V7 b; R8 A mov ax, 04h
$ x- r0 i% z1 Q int 3 $ V1 y1 ^4 ~: {$ ~* P
cmp al,4
n/ o$ v T# G jnz SoftICE_Detected5 U" t+ d6 Z8 @8 ]" l! E8 ^& x
( y0 F4 \4 {& Y% {' m( V }+ E___________________________________________________________________________
% e3 n2 S% v9 z" L
4 L) v2 f2 g- |* b+ N" [9 G* vMethod 02& Y. p3 A8 @6 t! _0 H1 J2 Q4 j( }
=========0 F& ~" m9 [& {% J- `
* u( C6 F5 a: |* J& H7 T; m5 B
Still a method very much used (perhaps the most frequent one). It is used/ ~& Z' J/ ]/ U' w. Y4 O! ]7 ^5 x
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ T' q5 Y2 x( o% ]$ n( zor execute SoftICE commands...- Q2 P' t( v$ B4 I
It is also used to crash SoftICE and to force it to execute any commands5 `. i: h- v& B1 l: d
(HBOOT...) :-((
' N% \, U' X/ l; ^9 q
7 V7 P! e8 {8 q6 q# sHere is a quick description:
3 a- r) ~1 v. j- c/ P2 i3 x-AX = 0910h (Display string in SIce windows)
/ y2 F4 I7 z6 P& d-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
9 ?% d* Q) D Q* u0 V2 m, |. \5 n+ \6 a$ ]-AX = 0912h (Get breakpoint infos)
& s0 ^ u1 F, e4 A-AX = 0913h (Set Sice breakpoints)& W( L7 H! M8 ~; b/ D
-AX = 0914h (Remove SIce breakoints)/ A, }$ y9 B1 x* P i
! S8 L( y7 j+ m/ e; F1 ^- a6 qEach time you'll meet this trick, you'll see:, y; L7 U) U8 w0 a! h1 D q7 T8 K. i
-SI = 4647h* B9 d9 ?; F+ m" \6 O) m5 D+ I, O) O* A+ F
-DI = 4A4Dh7 b0 T' D% c: z; J
Which are the 'magic values' used by SoftIce.% I; Z& z% [& T* @7 T3 W; C
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ D" d5 |- v* b3 q$ o
8 X8 M! I+ T4 o: }+ S
Here is one example from the file "Haspinst.exe" which is the dongle HASP0 y2 @, y" |& h3 x
Envelope utility use to protect DOS applications:
1 ^ d* {4 g: ~
7 B$ p% Y6 \. c6 u/ n) W! g! a7 ~; m: A! z( Q
4C19:0095 MOV AX,0911 ; execute command.
& U \1 `) @8 s/ ^/ M9 B8 I4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 C7 \7 M, z' F( l' `9 }" G4C19:009A MOV SI,4647 ; 1st magic value., X% v9 G' @7 s5 H/ \) e, g9 k
4C19:009D MOV DI,4A4D ; 2nd magic value.
9 P4 @) M* Y4 Z1 u; \1 ~/ `9 U/ ]4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)9 o' h) U' ?6 D* K0 l/ M) h
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
" I0 Q7 e7 H2 t( ?. D4C19:00A4 INC CX' L$ i# E/ n$ y7 N5 A0 U* h
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* D2 |' \0 U& m- m* b4C19:00A8 JB 0095 ; 6 different commands.4 h+ o7 `% h8 Y7 k+ V* n) v
4C19:00AA JMP 0002 ; Bad_Guy jmp back.. l0 o' M- u% o, K* \9 q
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
8 p, I2 k& ?; a2 X, ~9 V0 h O: t @. {- }+ c
The program will execute 6 different SIce commands located at ds:dx, which) e' v. s" s7 R% }% O1 s* u/ K
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! `/ l" V' M% [1 x/ b0 {
. `& j' Q4 d& S# E: A* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) t3 _: ]8 G; B+ I. z% Q___________________________________________________________________________3 [" Z: V1 j9 N* L2 }& l7 [5 n
2 Y7 p M( r: j6 e- x+ X! c3 t. ~( H
Method 032 k u- F( [8 R- r1 n
=========6 P5 d# Z' Q* \' T! p, A7 _
; N" R6 _: t& c; g
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! U, J& m- a S" M& z# n(API Get entry point)& B2 w; Z5 X4 t* q K
5 A, B2 D; Q- G3 A3 `
! F1 g+ b8 M& v- Z' k2 E xor di,di
; d7 d0 S! R+ @$ Y1 R mov es,di7 E0 a0 z( E- s( ?# r H B. A
mov ax, 1684h
" c8 a+ j3 e' e7 F: X# @6 { mov bx, 0202h ; VxD ID of winice5 ^9 N+ F6 l$ c; V
int 2Fh8 S' k5 c. u2 N
mov ax, es ; ES:DI -> VxD API entry point# e: g% `5 _" @. Y+ U+ q, |. M
add ax, di% V) c: z8 y8 b
test ax,ax3 o, x; [5 S' A, m
jnz SoftICE_Detected
9 L( j. {: K0 [1 f" o& z3 G2 C0 ~5 j0 Z' s# ?: D9 K; H5 E; ]: ~
___________________________________________________________________________7 ^+ F5 v6 D6 G" X9 f% a
o: x+ K0 A" w, `0 t. q
Method 04, n# o6 P3 x* \5 x1 b
=========. T9 ?$ G" s% n; r8 S2 |' [
) B; k( _8 V7 t) x; _
Method identical to the preceding one except that it seeks the ID of SoftICE; M; z6 n* ?& z! ~& }9 k5 Y1 e
GFX VxD.
4 b1 }) f' `9 [- S# Q p4 `5 E' p1 C$ Q9 N, k: A+ a+ V
xor di,di7 `4 r0 q5 G0 v' D, ~& S
mov es,di. ]' V- {: V |2 {9 d \( e9 g
mov ax, 1684h ; G/ n7 U* R5 t
mov bx, 7a5Fh ; VxD ID of SIWVID' j/ x9 U! r2 A
int 2fh
2 r- O ?8 A% n* `8 x mov ax, es ; ES:DI -> VxD API entry point6 U0 m9 v2 w( C `' `2 |/ [- x9 }
add ax, di- `: \0 `( z4 D- r. d% d' Q6 e$ ]
test ax,ax. Q% J3 |9 } A- N1 R! H) N
jnz SoftICE_Detected
& S6 W% q4 w4 S5 q* G3 I# c5 Q5 [& E* Q/ }8 v
__________________________________________________________________________3 ^% p9 D/ T: E% I- \0 p' O
. I9 w+ K7 @" w( X9 e8 u$ `
( a# {- ~9 N: A7 P; |Method 05! y6 T6 w7 c8 a! K8 X9 }
=========, z' i+ N/ x3 [% D9 E4 ~/ F7 S
2 @6 Z8 V. O+ }: X( T$ w( }
Method seeking the 'magic number' 0F386h returned (in ax) by all system
/ h5 B. |+ \% r! mdebugger. It calls the int 41h, function 4Fh.
( D3 n! _, X; f1 M' I z1 ?0 eThere are several alternatives. ' u# _+ `/ G, c& _
; z; C# V4 C3 Y; G) [/ PThe following one is the simplest:
3 c, a0 l3 w# [: C" s- {4 C9 w, b- n7 y9 f
mov ax,4fh% i1 n* [: d* l, E0 [+ ^8 x
int 41h
$ G1 ?* j( K2 [- l% j1 D cmp ax, 0F386! h9 c5 r" D( r/ A% u1 x4 x
jz SoftICE_detected* e" r' F: t! J2 q! P6 Q( n
) A" i5 }' I) k) i( B
4 b0 D. t. F4 h/ ~! Q- {Next method as well as the following one are 2 examples from Stone's + K L/ m! |9 g- N
"stn-wid.zip" (www.cracking.net):
9 l0 h( U$ z1 ?0 d C: P) Y3 j) n* M% `3 @, X
mov bx, cs
+ d; b2 e# H. J3 v: q lea dx, int41handler2
7 r s- E2 ?# }3 | xchg dx, es:[41h*4]) h; D0 I/ P- K3 M8 ~
xchg bx, es:[41h*4+2]
# s+ k ~6 p! C1 s mov ax,4fh- {& m. m, V5 X3 J" p6 B# x
int 41h
$ M; Q; i1 q! C: u9 \$ Y. D xchg dx, es:[41h*4]
: C8 t* Q) N' E [6 |6 M- z; m xchg bx, es:[41h*4+2]6 f, K" i9 e$ {: r, Y7 }" r
cmp ax, 0f386h, D$ E. } [" n7 o2 M8 z: i6 e5 o
jz SoftICE_detected/ @* \0 I% I7 q& N; g
) g0 R7 b3 o, T2 ]2 \8 F( y4 T% v5 k
int41handler2 PROC
' _( Q' m$ k* a" o# H iret! ` W3 o2 y6 _6 V2 X% s3 z- Q
int41handler2 ENDP, g8 x" z/ A2 ?
% G4 u2 k9 q! Q8 G+ Y0 [- J5 j& x D m& m4 _$ _
_________________________________________________________________________6 I' s0 S8 t3 \" I4 v! m
6 Z! A9 E$ j% s: h9 ~* |) y
r9 X/ g+ u* O& o/ j% v" ^% cMethod 06
8 A! M5 Z/ q3 }6 {7 Q0 H=========1 N2 ~& R" a( W: u) H
9 N. \1 W2 u1 e! O5 O$ v
% h8 D0 ?) y" u/ v/ C& b0 g, V
2nd method similar to the preceding one but more difficult to detect:/ S. [6 v s) B# f# x% U. b
1 R% |& Q2 k; l# c v3 X) ?
# {) Q! R. Z0 |7 S% _- ~int41handler PROC
" i4 P& _) v, }5 \3 z! Q' J; b mov cl,al' ~ l2 P$ _$ u& h* X1 B
iret* h. @- |6 b" ?9 D3 [
int41handler ENDP" Q4 A) ^" V: B6 H) S
; _# Q" ], |- B3 |' E3 I8 h
6 c* \6 n/ O x6 X4 G xor ax,ax5 { \+ N0 D, E( d
mov es,ax5 d3 P; d/ V; v) o, Y! Q
mov bx, cs' T* E4 L1 [1 J& t# q! Q+ i' k
lea dx, int41handler
9 O" Y+ _3 ]# K5 y, a5 `: Q xchg dx, es:[41h*4]
4 x3 K( q: D- U6 X xchg bx, es:[41h*4+2]4 g9 m% R( R! L! R) E6 p
in al, 40h& Y1 L" v" f/ j% B7 u9 V& s; p
xor cx,cx: Q+ q5 u _; u, t- D1 }1 d
int 41h
3 p1 J$ i! T5 d6 O xchg dx, es:[41h*4]4 D2 L. I# Z8 X( F. I8 I
xchg bx, es:[41h*4+2]
4 Q% ~* Q$ e6 P M! [" D) \& a( T cmp cl,al, V' T2 l3 V# S, P) w& U/ H
jnz SoftICE_detected# ]$ p# n8 F5 a% x E! ~
W6 L+ b C- V+ `) O# K
_________________________________________________________________________
" @/ u, R+ S8 m: ^" P& c1 |7 y( b- O
Method 07
' `! W6 F# |8 G( \' K! D' S9 P=========
$ c5 v% y$ q! V. q- l3 l2 \" z' x d7 W5 B2 J" I4 c- J
Method of detection of the WinICE handler in the int68h (V86)
6 F9 b, Q* k$ e6 }) r# h7 C
; _( }6 @- l' t0 o" N& h mov ah,43h l' ?$ p4 @0 i% k1 X, J$ w; E @+ w
int 68h8 E4 H9 }% a4 r* }' B% i6 D
cmp ax,0F386h
( @: ?1 f# r2 y8 @5 J$ V jz SoftICE_Detected
! Z, s! q; d) j# s: K% M. U3 w: T& O7 a4 v7 z6 j
7 q7 s0 w8 f0 e=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 T: K% i. P8 w2 d7 r app like this:
# L6 c2 X" m) O7 j
4 p$ l0 ]! w" ~) K, n! W* P6 @ BPX exec_int if ax==68, b; k1 X, m, m" b5 v% e: j
(function called is located at byte ptr [ebp+1Dh] and client eip is* p9 P4 b& [$ ~. w, r
located at [ebp+48h] for 32Bit apps)
; q c4 q4 Z5 G) \__________________________________________________________________________1 T6 A, [3 L/ [' z* V& j' H' s. @
6 s+ j; m n4 r# i V% ^
" e3 p. Z0 i4 B, eMethod 08
: T( p2 U( U- H=========
( I! H% l D& t. x* _7 [$ v
5 J* }3 @# |* i5 T% HIt is not a method of detection of SoftICE but a possibility to crash the
' X2 r( t8 e0 G2 Z) t7 o- csystem by intercepting int 01h and int 03h and redirecting them to another5 ^- }2 M) F; ?# C1 g+ W
routine.& s6 f2 S5 ~: v( x
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points2 Y: @; P Q' e( t
to the new routine to execute (hangs computer...)- Z( Q2 {) b, P. H% z. p4 [
' F6 @7 W, n+ D6 j mov ah, 25h9 m# Q; B1 @, Z" _( S! S$ x! N$ w
mov al, Int_Number (01h or 03h)
X* o& U0 U! m0 T/ k0 d" ]& d( ] mov dx, offset New_Int_Routine
- g$ m' X F3 }5 R int 21h
9 Z+ }, D6 A" z+ V. i' Q4 Z, C! z: I1 G5 N; c {
__________________________________________________________________________; u1 I+ [, ~) l2 Y2 ~ @
- P! a7 o. e9 h9 w* i" l
Method 09
# x& z: j3 R* D* j% b7 E=========
: I+ n7 K4 @. ~% B4 |: {
; r4 d$ Y) `7 Y6 A/ D* w$ A9 ~. dThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) }: {: P1 J2 I* A5 l" [2 gperformed in ring0 (VxD or a ring3 app using the VxdCall).
4 x' v) u/ ?0 n: u) P9 O7 W2 vThe Get_DDB service is used to determine whether or not a VxD is installed) F# j% |4 k$ ^1 D. o9 J0 |
for the specified device and returns a Device Description Block (in ecx) for; F4 U4 m" v4 d t; v
that device if it is installed.
{9 i' x- }( E$ F4 U! R, n( u% D, J
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
3 Q& h" p- E/ Q, G mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 f4 y! E5 q& i4 ]
VMMCall Get_DDB
; `7 y! x! A& q: q+ k( h, k5 y mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: e- J- ~/ ?3 c+ H, @
( [8 D1 g+ w/ _ q, i: v! B Q+ u. x
Note as well that you can easily detect this method with SoftICE:2 c# n1 ?. J4 s% o; H; M
bpx Get_DDB if ax==0202 || ax==7a5fh
, M$ J6 s3 C$ T3 O. k+ K( g5 Y+ A# w
__________________________________________________________________________- S W2 d5 d5 ]
% V+ b3 Y; F; q0 V, \
Method 100 x; j) n" Y4 {, K( {# e
=========
: V: j/ ^9 D7 x* }; n2 `
p; i# b9 X8 M5 y. i=>Disable or clear breakpoints before using this feature. DO NOT trace with
3 m( N0 r; l4 d' v! _3 n1 `# z SoftICE while the option is enable!!' t. q: Q/ ~# z: U
/ A% U# r5 X6 t8 B4 ^% fThis trick is very efficient:
3 M! d2 G! D$ m8 @4 V; I5 e5 J/ t Eby checking the Debug Registers, you can detect if SoftICE is loaded
# H, v* n# M9 Z# v. F(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! V! ]" g, @! c% X
there are some memory breakpoints set (dr0 to dr3) simply by reading their
J8 x2 X5 S& wvalue (in ring0 only). Values can be manipulated and or changed as well
% c3 F, s7 [8 H" T+ w- `* u- [ O(clearing BPMs for instance)
9 A6 C7 U, ~& a* x1 H( f! l5 h1 g: k4 D
__________________________________________________________________________* ^: O& R; D5 ~/ e8 Q9 h& Z$ y
% `7 |6 v3 `; L( A% f7 z4 QMethod 11! E/ l W. y, D% _9 a g. ^( v2 {5 x; K
=========9 R) ?4 h S$ _
" u& f" S/ R1 WThis method is most known as 'MeltICE' because it has been freely distributed
9 ^ I/ \, C' `7 u0 F/ E+ X2 Nvia www.winfiles.com. However it was first used by NuMega people to allow2 O5 k" n! ~6 C5 j. B. X% c( R
Symbol Loader to check if SoftICE was active or not (the code is located- w0 {* L) k [# F9 D$ }7 G
inside nmtrans.dll).
* E: y- B! @2 m, Z+ L) G& i
# H2 U) c4 n8 S _" R AThe way it works is very simple:
' G1 ~% b$ M; B& h0 TIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: j# I9 P: l( _# W2 j" H- cWinNT) with the CreateFileA API.2 Z9 I5 f) x2 T8 p
3 j( i/ k% {( h8 Y) O% ?0 k
Here is a sample (checking for 'SICE'):6 x" `- z. l- j: |: ?# q
2 g: m! V- u* J* S) O" w% V
BOOL IsSoftIce95Loaded()3 V! E( `- Y! x+ ~" Q
{3 x d1 [9 ?# c9 W$ ^
HANDLE hFile; 4 F! ?; ~$ [5 O! R# Y# s& _
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,8 C& g& ^! t. f7 B2 V% P
FILE_SHARE_READ | FILE_SHARE_WRITE,
' a1 S& q1 ^; g0 i' K4 d NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" H* E) {4 k3 n U if( hFile != INVALID_HANDLE_VALUE )
P1 J* C( ^9 a5 G" U! F5 R {
5 B) A) V4 f, N& y CloseHandle(hFile);. \& [$ h( d) w1 u5 K
return TRUE;2 T* q) `( Z- ^4 E8 f+ R/ T+ ?9 x6 s
}
3 t0 U0 e4 ]8 B- t5 w return FALSE;5 l) j) R+ C$ H0 Q
}9 N+ h* b [0 A. W
+ U3 y0 J/ Q' A0 i1 S; y7 G4 BAlthough this trick calls the CreateFileA function, don't even expect to be
: ]8 E% x z( J- Rable to intercept it by installing a IFS hook: it will not work, no way!
8 l$ ]( F% Q) m, e) b; D7 r' pIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 W% v( f$ S. s5 Zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 B% d3 o5 R: ]and then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ [) \ n+ p* _/ q O9 v! xfield.2 w- T3 _' q: `% t
In fact, its purpose is not to load/unload VxDs but only to send a
& S* K' t) Q- Q$ A; `$ ^6 XW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* n# p, E7 N" r4 l* u2 vto the VxD Control_Dispatch proc (how the hell a shareware soft could try
: q3 X* r4 G( }! }& bto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& Z4 j @6 q/ N1 Q8 ^If the VxD is loaded, it will always clear eax and the Carry flag to allow$ C! _+ u8 {' `/ q
its handle to be opened and then, will be detected.* C2 \& p: r0 b% S4 r h! Z. g7 N
You can check that simply by hooking Winice.exe control proc entry point Z. e' C9 K. |) L$ D9 x3 l
while running MeltICE.
; v: Z o( u2 Z) w" N- p1 M
1 u8 s- W- O+ j4 z# a E J: J9 H% ^2 F' {' \2 ~9 ^
00401067: push 00402025 ; \\.\SICE9 _4 q5 [' }9 K5 Q! U
0040106C: call CreateFileA* T7 Z4 |/ T1 u; e
00401071: cmp eax,-001
& v; k8 _( i4 p* d4 s 00401074: je 00401091
! o s3 {9 C: _" O
0 f( f" B5 b0 v0 Y1 X; O3 W' O5 Y7 ?1 D& L% q+ o1 A# |
There could be hundreds of BPX you could use to detect this trick.
5 {7 j. l5 Z \; X4 F1 G8 U) }) ^. w-The most classical one is:
$ A2 Z! M8 }2 f5 ?! F BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||+ x* W; t& ]: Y0 V" Z# o! Z
*(esp->4+4)=='NTIC'
" `1 E/ @3 a7 M* z) D C9 \$ Y- C& y% Q% F3 t& D- I' N5 p2 h
-The most exotic ones (could be very slooooow :-(
6 x4 r% {5 r4 g1 ? R; e BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: Y, {7 b7 [$ ] J( F' M8 a/ u ;will break 3 times :-(1 v1 i+ [1 k0 [
) t9 |, F, ~9 r8 b( e-or (a bit) faster: 2 O. A- D6 B8 _* y$ L/ P
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 g+ T {) a8 x+ c. B
9 Q0 T" F7 t) v4 n
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
$ x0 h. p- y/ K+ T ;will break 3 times :-(
" e( n* K% Q( n0 R% W. x8 [: f! g( z/ i7 x l+ P' k4 f
-Much faster:
9 C* w% n! c; s0 h; n9 _ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 J* T4 z, T9 e+ ?7 A
. [: B( G6 H1 r5 wNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 k# \' N2 X T$ \( ~4 o0 Kfunction to do the same job:; }' S" D' E9 B2 O
; u) y; t! S. \( X
push 00 ; OF_READ/ z4 h' Q' X& x! y' v
mov eax,[00656634] ; '\\.\SICE',0
& |7 m, V3 n) y) V, U9 X push eax/ i4 M+ |, l, F$ ]0 }; ]
call KERNEL32!_lopen+ p3 i' ~5 A3 [1 D8 w5 [' t0 x
inc eax' L Y( H- |3 Z( w' z2 K8 x& `: o; h
jnz 00650589 ; detected
$ d: D* ?! n. H* J push 00 ; OF_READ0 D" X4 @' X( A) C. X" g( H/ t% F# g
mov eax,[00656638] ; '\\.\SICE'! M4 ^, R4 U+ @/ t5 Y
push eax
: ^+ ^# @( ^. T# V/ E, h call KERNEL32!_lopen7 M& Y* r1 `& }* ^# s7 M/ t
inc eax
( a5 ~) R* t3 u. ?* T! Z4 q9 q& i jz 006505ae ; not detected) c1 U2 m: L# A2 E& G- k
+ B6 e1 F+ j/ u. X, ^& z8 o3 ~5 ~4 i
5 F$ |! C( C$ Z# I% ?3 f% b6 j @
__________________________________________________________________________6 r6 o5 y" p" A4 ^- z+ v
( h \8 { Y$ s3 X/ `: n# K
Method 121 i* P' u: }1 x" t: U9 o
=========+ h* ?( G! d; J! b
# @* s0 n% C; x y
This trick is similar to int41h/4fh Debugger installation check (code 05
9 f8 n+ E" r3 s/ J6 m& 06) but very limited because it's only available for Win95/98 (not NT)$ h7 Z$ Z5 Y/ D
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 O0 O1 P8 _8 Z9 [9 {+ Z5 P( `
2 u3 r$ C/ `5 B push 0000004fh ; function 4fh- ]; C) z4 [5 c9 n; j p
push 002a002ah ; high word specifies which VxD (VWIN32)6 F8 M3 o5 _; W, H3 F6 b
; low word specifies which service8 Q) L) d7 r5 z& u& [
(VWIN32_Int41Dispatch)6 g! y5 |7 Q! `7 G1 r8 B, X
call Kernel32!ORD_001 ; VxdCall) K3 y& K Y) d8 V7 }0 @
cmp ax, 0f386h ; magic number returned by system debuggers
4 ?/ H" I* e2 k jz SoftICE_detected; x9 M7 B4 F3 }& i) |
1 _0 B7 d& o% V! U8 W
Here again, several ways to detect it:
4 @1 A, h7 M8 G% {7 b3 r4 `+ l; a. d- |$ i0 e, n9 F2 L1 s
BPINT 41 if ax==4f
8 Z' B& k) X) J. c h! i# X3 r/ g% K( w+ Q( `
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ h& I d4 B0 w, N' B# ]
) I, @4 U% c1 b i$ q( f; | BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A3 p3 |/ s8 h# Q- j$ r8 p7 @
$ \( x! I) P- m1 O BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 D \6 k! B4 `* e5 |% O; k
/ ~( Q( h8 F* ?$ V7 k/ ^__________________________________________________________________________
. ?; _+ o+ k% L" O" [1 J3 C1 U5 N" U6 K3 H7 Y
Method 13
; @1 d0 q8 O8 z: h+ w=========" o; @+ N$ |/ g5 \
+ q1 f) w& r5 q# E' H! ]
Not a real method of detection, but a good way to know if SoftICE is9 b$ `9 X6 K( `, _7 [
installed on a computer and to locate its installation directory.
2 N% z. y$ [. vIt is used by few softs which access the following registry keys (usually #2) :
, K+ W6 j, j) P0 N& M
* ?+ t$ Z2 V9 u8 G-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 r$ t3 z' u" K( b* c( k
\Uninstall\SoftICE
/ ?, L/ w( V1 Q u& Z-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE c; _$ k8 T1 }' a& S
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# Z. K# m9 n, C! V9 C\App Paths\Loader32.Exe
! U; L6 a" y4 R
& y- z* z$ _: }& N2 y0 b: O
2 N7 H, C1 T3 M. L: MNote that some nasty apps could then erase all files from SoftICE directory
- ]) T; s# f9 q' n, v(I faced that once :-(; O) a! \' a2 n0 g9 Q7 e! S
; D! H3 m4 A6 B# g _, T) QUseful breakpoint to detect it:
' J$ G; Y" ?4 l. M7 C! ]! a) a( C# h' N) ?* z
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
! C" Q0 C; b4 f1 w# c/ D! w q- B5 W) D1 O) Q
__________________________________________________________________________% J& \ V6 \/ E/ N
$ P( p. y5 F# f% n ~, D
( l" V8 Z: n V8 VMethod 14 ; n3 f* C5 z9 p1 ]3 L) S
=========
# A" c. V6 J% Q3 U5 M5 f1 _1 L! I; Z& F# }1 d* U! d
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# F* }% M7 W- D$ x
is to determines whether a debugger is running on your system (ring0 only).( @! h1 V' C t/ J/ j# k1 j% Q
9 } q0 P% H( U* P+ _6 E VMMCall Test_Debug_Installed
, q/ K7 q( L. p9 E5 B& [ je not_installed" E. i' F+ u) f& C/ F, ?! [! o
n- g9 x" U- R9 v* V
This service just checks a flag.
; n: o+ [ r) _4 Q</PRE></TD></TR></TBODY></TABLE> |