<TABLE width=500>
: |2 Z Z$ n# ~4 x: F6 |<TBODY># V# W5 X( _* G
<TR>
Z" t5 h0 C4 \& {' x& c% F3 t0 Q<TD><PRE>Method 01 0 M6 R# K. d% I+ x1 b
=========1 [. g0 B' u! ]+ n, |5 p. b" m
( I. ?& d7 n$ i- g" J0 a- u
This method of detection of SoftICE (as well as the following one) is
6 } m# ]7 G+ P: _used by the majority of packers/encryptors found on Internet.
# M/ W( b/ w1 [# KIt seeks the signature of BoundsChecker in SoftICE
( \4 Y! m- I/ X, a# s1 w
& X) Z+ z: |/ T0 E5 [3 X mov ebp, 04243484Bh ; 'BCHK'5 X6 H# |# `% i$ W. b6 D; B+ X
mov ax, 04h% L2 j# q6 s {, n x1 m% g! x4 V# v
int 3 0 m4 z3 Q- b) O, u% y% j# j7 M
cmp al,4
( T+ Z3 d: C! N: k5 ] jnz SoftICE_Detected
5 n! k E! P- L6 {5 J$ n5 D% w( j- e* ~* B4 v* C# P% Q
___________________________________________________________________________
9 C, K9 e- V8 x1 i
0 |& p& r8 F1 R7 O2 V% LMethod 02& J) D. b. q9 R. _7 F
=========7 U4 \; { f$ n; X* v6 Z: Z" P" f
# @/ A5 H/ H1 h: Q" [# h1 \& t2 _Still a method very much used (perhaps the most frequent one). It is used9 v8 _, U7 m2 x$ p0 j5 n! @
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,( a- ~* {8 { j; w
or execute SoftICE commands...; K- i6 A8 k" t4 T
It is also used to crash SoftICE and to force it to execute any commands% L- ]$ _0 I) n" F% C
(HBOOT...) :-((
5 F% M( x! e" W {" }4 q0 \' w' s
Here is a quick description:6 B8 @' |/ g, T7 d1 l
-AX = 0910h (Display string in SIce windows)
T5 u3 }- C) x-AX = 0911h (Execute SIce commands -command is displayed is ds:dx); ~! v0 f9 P. I9 s. q
-AX = 0912h (Get breakpoint infos)2 `2 t B9 [- h1 c- n
-AX = 0913h (Set Sice breakpoints)6 Q7 ^+ q0 G3 A7 F0 s# _9 X
-AX = 0914h (Remove SIce breakoints)
3 K9 S: D; ]. y, K- R) ^3 u: C4 n5 @9 H* e) T* O! x& |' _
Each time you'll meet this trick, you'll see:
/ h+ @. I8 @4 {7 Q& P$ t/ g-SI = 4647h% a. [$ ]4 K5 |$ _
-DI = 4A4Dh
0 Y' `( S7 U/ H3 [Which are the 'magic values' used by SoftIce.
5 M, |9 s! e4 Z4 u XFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
L4 r' U f) l9 C3 N) w1 j) D6 q" F4 y, S1 ?4 |/ h+ }
Here is one example from the file "Haspinst.exe" which is the dongle HASP
H0 q. D. ~( r9 Z( I+ lEnvelope utility use to protect DOS applications:
2 P. W. B" ^! C6 f) C
, ]- C7 \9 Y$ a+ G( p* \+ s; @
4 I4 e7 X# L* I, s, d, g/ Y8 d4C19:0095 MOV AX,0911 ; execute command.
/ ~% I6 V0 q g7 c5 o4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) x M6 J7 q4 l! x! o) u
4C19:009A MOV SI,4647 ; 1st magic value.
# x9 q( F, D0 T& ?4C19:009D MOV DI,4A4D ; 2nd magic value.
. W: W- u! x Y6 Z3 a9 R- V1 P4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)/ O5 w" W9 e, y# Q$ p9 z7 b
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute" Z; v- ~6 W6 Z3 j# f) K
4C19:00A4 INC CX
% _' G' K f+ V% ?9 N C4C19:00A5 CMP CX,06 ; Repeat 6 times to execute( r! A/ e' M- e
4C19:00A8 JB 0095 ; 6 different commands.* j3 x: O$ S' Y( R& s9 F& M
4C19:00AA JMP 0002 ; Bad_Guy jmp back.' R3 a0 Z, w6 A8 s$ C' h' o, t" P& s
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- J; m9 D. _# U P
4 H* w6 j4 N7 ]8 M" ^( HThe program will execute 6 different SIce commands located at ds:dx, which4 d3 ]2 l& A1 k& k
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.) P( l8 E, f- B
! y ]; b- ?7 U/ C9 L* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded." x2 T* Q# e: y2 \3 O5 V: E
___________________________________________________________________________
, R3 H7 W. T! C4 K/ W
: O& Z/ F# R9 n8 ?4 f D0 G, b" }4 `0 O- c# \* U/ Y
Method 032 u/ {# I; P" S0 M) K; Q
=========
( A8 e) ~7 c: Z" a) H
" ~# J' K8 C' w9 C+ _Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! v5 Z3 t1 s4 P+ c7 o9 u
(API Get entry point)
d* r: p" | q& y$ Q* V9 M ) d( z" J8 o, @! |3 h5 U. [: G
& i5 g: q7 Y, L* s5 E xor di,di/ T( i/ x% f! n* Z, f9 L/ Y) A
mov es,di, G) O \) n1 ?! K( L2 |
mov ax, 1684h
' J1 d1 d) j# K mov bx, 0202h ; VxD ID of winice
4 L5 Z' p3 y! F* @1 ? int 2Fh; M0 |9 T! f& P6 p# g( Y8 D
mov ax, es ; ES:DI -> VxD API entry point+ I6 v7 l9 g K' k* j" n7 V
add ax, di
( ^; |, L5 Z* _* t. }4 G4 c test ax,ax$ @' i) M ^6 H7 ?/ z( h% [8 a
jnz SoftICE_Detected, l. d) w) V1 o$ E$ S
) J% |2 {% N2 d/ x! Y* K7 E1 t# Y___________________________________________________________________________& {5 J3 y. g' }/ I
2 W/ z$ T: J$ c4 n2 P/ n6 _+ w9 ?Method 046 d+ M5 m+ e) a7 u8 z2 T4 @
=========' f+ ^3 P, K+ T+ s
9 {4 b; T, P4 a! l3 f1 _9 r D
Method identical to the preceding one except that it seeks the ID of SoftICE
: z4 j a" G& @7 Z6 I4 u8 b/ cGFX VxD.4 M. ]" P( \; @, C4 G
- @' R- W' b: f1 [, D0 _( S xor di,di
. Q8 V; }/ ]0 h$ } mov es,di
/ R, t/ d) Z4 W2 Q* y6 u' _6 w mov ax, 1684h & m% M7 H9 A! v& h6 ~$ V
mov bx, 7a5Fh ; VxD ID of SIWVID
8 o. ?' e) H: g$ r" m& L int 2fh
3 t$ Q0 I+ B5 I9 W# h9 ` mov ax, es ; ES:DI -> VxD API entry point
2 X( m2 H; L" M add ax, di9 W+ `! @) ]. n1 b# G' p
test ax,ax
) Y' b+ Q, P0 M& U, m' ` jnz SoftICE_Detected1 a \% O8 h) Q. y
. ^$ b- ?# C# C" a. M& t
__________________________________________________________________________3 d; F8 n5 ^/ c% O% x
$ v, |, ?7 G# X& x0 {+ h/ Y, L7 T
" ]9 B- M; B3 rMethod 05' v. v7 V6 I% S, u3 ]; g
=========2 s. r3 q3 J/ S) L' E4 D
/ V9 C" e' k6 wMethod seeking the 'magic number' 0F386h returned (in ax) by all system
0 v* e! {0 c3 @3 G4 Y( Q2 ldebugger. It calls the int 41h, function 4Fh.4 ]2 r+ e/ J' n6 k' T; P* s
There are several alternatives.
# [! y- ]& A T2 ^
/ p e/ J- @4 o; C+ dThe following one is the simplest:+ l3 b0 s, H$ N6 S9 B0 k5 o
/ q( _# ^6 n+ f- F0 f
mov ax,4fh) u6 h4 T1 A, z) \" B& S
int 41h {$ K. R* [; C' H" A
cmp ax, 0F386+ _6 w: ~. a$ j
jz SoftICE_detected
4 `! I/ w, y* { w" A$ D, w
& G( e k% R9 B5 a! s! Q2 }( e: H/ E) j \4 Z
Next method as well as the following one are 2 examples from Stone's
# x* u- X& k( k& X- k- s0 E# [" O"stn-wid.zip" (www.cracking.net):% \! Z) u$ `: {9 j6 J
8 J) O# B5 `( [" [9 n. j
mov bx, cs. S0 d& R" r) [
lea dx, int41handler2
1 v# i* A5 b4 D2 c9 O xchg dx, es:[41h*4]9 _7 Y: g1 J* m8 r" y
xchg bx, es:[41h*4+2]
! l( C- b4 `* ~ ?$ Z; N! V mov ax,4fh8 h3 R6 a) E) B; P8 M
int 41h
4 P* q" X1 J% G" ?6 `7 q1 V3 ]) E1 C xchg dx, es:[41h*4]
- R6 r: T1 b u! s xchg bx, es:[41h*4+2]. d. V$ `; |; ^
cmp ax, 0f386h5 x2 j( h! T' X
jz SoftICE_detected' f1 z8 Y" ] T5 C4 l
) t. Q+ u; U. R: l5 D7 u
int41handler2 PROC+ x2 t' B( Q" Q2 l/ v6 c0 O3 t
iret( U7 B$ W7 J. E" ]- |. d: N3 X# m
int41handler2 ENDP, H5 P' u' T$ N- ^, i
8 d0 U- S# C2 `/ H7 O* |2 C* ?" s2 b. ] ?; R \
_________________________________________________________________________( u/ M; k; h W8 J* Q6 _
5 }2 B0 u6 W( ?4 S! \) h! t6 f
* f/ P+ {, c; \" i3 C& [1 _% H% c8 g
Method 06
7 H* f( v) I' e* ^6 [% T8 |$ C# g=========
. a L# k; w4 U. O' [% u2 d6 e# B: ~+ h( F' E
: _5 A8 o b$ y4 G# X# i
2nd method similar to the preceding one but more difficult to detect:
! ]* m. b3 r* }$ ~6 y
x$ Q% \1 x, B& W( l$ P1 Z& B0 v
int41handler PROC A2 D, N& J; G9 v- [- W' \
mov cl,al
! X3 X/ S5 b" P0 l! l iret9 K5 E4 M& c; h
int41handler ENDP
5 }# x- W* M# S! ~ i" U( e2 u d. l: l" u- n# D! m+ s8 ~
A' K5 U; B9 F* T# o: S xor ax,ax
j. ^: t7 [& W/ P& a mov es,ax2 b9 l; `4 v3 X) A' I
mov bx, cs. u+ D8 r4 J1 U# F$ h: ^
lea dx, int41handler* n$ I7 u% m; A+ g
xchg dx, es:[41h*4]6 O% W! C0 P8 _& [; s& V& ?
xchg bx, es:[41h*4+2]
; I, B, a0 ?" c in al, 40h
/ g( U$ _% i3 V+ V3 J, \ xor cx,cx
& Z$ L$ n* J% C3 N! L! l2 e int 41h
7 V' o: _/ j* M, K( J5 z! x xchg dx, es:[41h*4]# l) r1 u" {% \3 B' c
xchg bx, es:[41h*4+2]
- u* W* Q% E2 _( Z% J+ A! c cmp cl,al
/ T; \% x1 K K8 o jnz SoftICE_detected3 U0 `* V; O. Q* a; l. _3 L6 F
9 w# `% t0 G2 u, }; I' q- M_________________________________________________________________________
7 ?. ^2 [! M& H! Q$ S9 {
% d! ]" ^7 q# H" t& |Method 07
$ P7 k( d$ ^# L7 w: [$ Z( w=========9 ]6 n$ y3 j; D9 [- D [
0 }/ b. H, o& v7 d4 _) D2 z6 Y
Method of detection of the WinICE handler in the int68h (V86)* V* p! `1 s" N1 z. K: z; W
. j" Z+ M! }% J& E mov ah,43h
2 b/ @' I+ f& A% W( R int 68h/ n, N/ l% K' k% g; ~3 Y) `# O
cmp ax,0F386h
5 g5 Q2 F: q. {6 @7 t/ N! m jz SoftICE_Detected
8 M, v; `8 \8 [4 f4 \& n8 G: U2 Y# }; l, |( {
: l8 n7 j5 y$ h& R* b9 J8 O: M=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ z) `5 o3 V" I7 r* o
app like this:8 |: H$ j+ `! T9 U9 E
& Y% ]' i7 P2 e$ A/ Z/ T) T BPX exec_int if ax==681 }0 P. p# p+ L7 c
(function called is located at byte ptr [ebp+1Dh] and client eip is
# L, X5 B" {" ~& [: l located at [ebp+48h] for 32Bit apps)
/ A! D# W) @. m6 q' V! N% r. K__________________________________________________________________________
3 A* w7 e- H a% Y
6 e) I! k6 l2 ^0 ^) w0 w% z# A% J G3 C, \6 g
Method 08
2 N2 d! {2 O4 k0 T+ ^1 M6 ^=========
; Z' }1 V1 S) A+ J" P1 }6 Y$ j2 D% C' z' Y' z q- i) p% [
It is not a method of detection of SoftICE but a possibility to crash the
3 l1 R( h7 x g; C2 Bsystem by intercepting int 01h and int 03h and redirecting them to another
8 X3 K- h7 @6 _4 {2 s0 _routine.
, V: s8 U7 {% @# H$ a- u5 {It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points% s% o. W4 E8 n4 X o6 L
to the new routine to execute (hangs computer...)
+ p I$ V" ~/ H# h- b8 v
) m1 L4 c) N' P0 W mov ah, 25h( D6 O: A [* c5 j3 O2 \' x
mov al, Int_Number (01h or 03h)
' L$ e! R- A# z6 w2 d mov dx, offset New_Int_Routine
2 B, T! C) s$ O5 p: J int 21h
3 y" n" q; z2 E% e
. Z6 E, P! S4 l, F3 @9 r__________________________________________________________________________# D0 j4 J; P" g+ `4 W7 G5 x
9 e2 C: e$ `' n. u% b" h% a7 G
Method 09$ J- e. \+ \, [3 E
=========& a( b* a9 S1 h% z7 E7 y/ n, M4 C
# v' h) q" T0 M
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; F8 M0 N4 y5 _& E# Gperformed in ring0 (VxD or a ring3 app using the VxdCall).
9 J! b G0 X9 }. ~6 LThe Get_DDB service is used to determine whether or not a VxD is installed1 i7 O7 I! M0 ] ^" y
for the specified device and returns a Device Description Block (in ecx) for- p% y# k: G) p( R% v
that device if it is installed.
2 S1 y( L- t# Y' Q' E/ n* r: M$ C9 H4 k& A
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID7 A2 w; k- p) G* c3 W) }( O
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-), H D# ~( ], t& g; j2 o$ q
VMMCall Get_DDB0 Y n" ^4 |/ c6 e) h( G! h
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
1 I8 M+ N* J4 o# W2 G5 V
& q6 t5 f8 ]$ N2 r' U% oNote as well that you can easily detect this method with SoftICE:- \8 z2 ?6 |# A6 }, j# d8 M
bpx Get_DDB if ax==0202 || ax==7a5fh
# B" g } R3 F6 j! x, d4 r% Y% P8 ~' X2 |
7 {) M2 g% i+ A__________________________________________________________________________- D3 ~8 l3 M- V. _2 q# m/ u
" K" I) U. c( J$ {$ y7 kMethod 10! ?; W8 ?7 {7 X" r
=========. E& r8 f6 G6 w& `- y
2 q' U5 W$ v* N" o7 o=>Disable or clear breakpoints before using this feature. DO NOT trace with6 B4 F8 z5 O" V- k- s
SoftICE while the option is enable!!
9 S& |2 i# y! o, u, a( c2 i c5 N- k }4 X, c7 p
This trick is very efficient:
0 U. f2 B( p1 J4 Tby checking the Debug Registers, you can detect if SoftICE is loaded
4 Y4 w7 W1 d# x, |8 s. u/ P(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& i5 q, g& X& A6 c L0 p {) v( ythere are some memory breakpoints set (dr0 to dr3) simply by reading their) R/ `( o q& G% x0 i" L" ~% A% N
value (in ring0 only). Values can be manipulated and or changed as well
3 @# T7 B& K$ l/ a6 @: s(clearing BPMs for instance)
, ^' b# E/ C) c. i1 F. W# c- W6 m5 X1 @% a. y& C
__________________________________________________________________________
0 d# B r; o" n2 N" u, i7 e2 d: o. v# J
Method 11
) d# |' c9 A/ B$ H=========
: l7 W, u. {4 T0 D* s) N" t5 f r* g9 A( k& B: g
This method is most known as 'MeltICE' because it has been freely distributed
4 M( H. ~, q7 s4 Q4 A7 ivia www.winfiles.com. However it was first used by NuMega people to allow
~3 f0 g/ n, J: ?+ |( XSymbol Loader to check if SoftICE was active or not (the code is located
* b O% b. i l# I- qinside nmtrans.dll).$ [9 Z9 H7 Z5 K2 I: i1 L
' G; z3 ^& `0 P B+ H1 |The way it works is very simple:' Q) h9 H" @, x/ f* U- H2 U N/ a1 [
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ m. K) t2 U! f8 @WinNT) with the CreateFileA API.
4 C" \. f& N7 B) x( T6 Q
& F0 e* R5 W7 y7 j2 uHere is a sample (checking for 'SICE'):1 X, R- L! X: j6 k+ i5 [2 [
$ I4 W" [8 s3 U7 z3 Q9 p+ f7 i
BOOL IsSoftIce95Loaded()8 E: A( o& D2 C; d2 H
{
+ T" |( Y; S2 \3 _6 K HANDLE hFile; ( c& m; m; k3 t* g7 \( } _
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 c F$ l1 `6 ^0 t FILE_SHARE_READ | FILE_SHARE_WRITE,5 | h) r( v' F- D" _7 M) ^6 w
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% a; F5 V" a" T$ @ if( hFile != INVALID_HANDLE_VALUE )
5 V, `- ?9 C0 C4 {0 o$ { {9 y7 ^: o' t0 w) l# b9 s
CloseHandle(hFile);
/ q7 d5 a4 Y* p9 U& H2 u" N: w return TRUE;
9 I" ]& @' n' Y& D! s- r }
% f- L- n4 m- i9 ]( z+ z8 H return FALSE;8 s- Q% d9 t: t2 I
}
1 Y& r% @! x9 M# r5 K5 S/ f0 ]5 O: n$ _+ m Q$ T3 q- s
Although this trick calls the CreateFileA function, don't even expect to be4 W* ~& O- j/ U, ~. {; e' s
able to intercept it by installing a IFS hook: it will not work, no way!
5 i$ C* q }& @9 {" M6 r1 XIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
: k' X( _5 ]: y+ m) Tservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
6 U% J0 p; W/ Q5 w! Q, D9 sand then browse the DDB list until it find the VxD and its DDB_Control_Proc4 V* c0 [7 o' h
field.
) H" _2 h5 A2 i7 jIn fact, its purpose is not to load/unload VxDs but only to send a
1 U# G: \/ O8 ~W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
& b$ C! K; F' o, e# ?6 s- Gto the VxD Control_Dispatch proc (how the hell a shareware soft could try
, Z$ u( g0 }# l# O' [to load/unload a non-dynamically loadable driver such as SoftICE ;-).& O5 H% K1 n3 {
If the VxD is loaded, it will always clear eax and the Carry flag to allow/ B# z( s( z6 y
its handle to be opened and then, will be detected.
) l# ]; E. n8 F# W5 d* OYou can check that simply by hooking Winice.exe control proc entry point
: l) x+ q8 ^% @5 s# F- Xwhile running MeltICE.
5 }+ B8 ?6 ^- z9 M7 G( ~2 T4 S9 z* Y! h
4 V" o5 q/ M1 [" P, ?$ H
00401067: push 00402025 ; \\.\SICE! \ a2 k! B9 C* w
0040106C: call CreateFileA9 p) o0 a+ L6 J) Z$ B# I5 U
00401071: cmp eax,-001$ L1 j+ r- ]. x& V* m' @7 q2 A- K
00401074: je 00401091
0 s9 ~3 t- J# R! {* E5 s7 O
. k! l D3 X7 G# y# `8 y+ \: k' H. e
There could be hundreds of BPX you could use to detect this trick.
! J: T* a7 v/ n' G-The most classical one is:4 X% k$ U6 v! `
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 }% b$ ~* v3 A& C$ p4 {
*(esp->4+4)=='NTIC'
6 {( [) V1 I: Y2 A: ]3 u- [" t! _( `6 a% C2 w
-The most exotic ones (could be very slooooow :-(* M) \- ^. i- s! L
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 o* m, G% {" _! l- q7 C) s( I+ k# E
;will break 3 times :-(
1 Z6 z0 e0 Z! z o X* `" e
8 Y% x2 x+ p/ G* m1 w- ^-or (a bit) faster: 2 ?9 h6 P8 P$ z! [2 X- i
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')) _: s$ H. `2 y% K2 u$ J2 |7 O) T' |3 R
# X) Q" `( |5 m7 G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
$ J: Z" R% I# _( x; g6 c+ [ ;will break 3 times :-(
5 R) W! Y% t3 b
( p c( ~ i4 v q, P-Much faster:3 Z! o, x+ z. ^' N
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'$ D* x) n5 U5 h6 L* n
% Q( R7 v; L6 W) P* ?: YNote also that some programs (like AZPR3.00) use de old 16-bit _lopen- t" L8 G3 a3 k4 z8 g0 C
function to do the same job:
8 k- k! Y3 V, u9 m
c+ N. I+ x1 U, s2 b, A push 00 ; OF_READ
/ l7 t$ \! |' H" S mov eax,[00656634] ; '\\.\SICE',0
4 X9 |* M6 T# s5 @' m4 K push eax5 h g2 {7 ^& d, }" O+ P
call KERNEL32!_lopen# E, r. Q$ D! |0 h
inc eax
9 t F# g3 u- F* ?/ N# J; m, j jnz 00650589 ; detected f' c" u( p/ T! v/ q% k5 }8 ?
push 00 ; OF_READ6 y" B+ ]( R! s$ P7 X
mov eax,[00656638] ; '\\.\SICE'2 J) I6 Q; u% n6 c0 l
push eax
( A J' ^6 {( ]! g( r! p call KERNEL32!_lopen$ g* s9 v0 x! z& \5 Q
inc eax
8 g0 l- t8 X% R2 w jz 006505ae ; not detected3 U+ k1 i9 w" `, v! n9 J5 e* n
: i; [- U7 M6 Z* s( ~/ S& E
7 M, B: p4 R8 U% O- O__________________________________________________________________________
4 } H6 U1 H- Q8 J
. { s* F l5 c% t0 j+ R8 I- WMethod 12$ O/ M) N, R8 S
=========, H5 R% D+ d1 b3 W! m3 l
& Y4 I9 Y* F+ s; s- ~+ f1 o0 l, LThis trick is similar to int41h/4fh Debugger installation check (code 05: n( ~ k6 M3 S9 [8 m- M) @+ i- M0 j7 ^
& 06) but very limited because it's only available for Win95/98 (not NT)
1 x: x' x: C h5 T- t* B4 s) Nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 `, }5 p/ K1 M- O. @- T
7 d" N% z) V: p! W0 L+ h push 0000004fh ; function 4fh8 X2 R! H Q& ~% N
push 002a002ah ; high word specifies which VxD (VWIN32)
7 }" J1 _+ c5 {+ a ; low word specifies which service
/ v0 n% d/ V9 B1 o2 K( a j/ ?+ W5 V (VWIN32_Int41Dispatch)
9 a1 s- [+ x% t1 B, M call Kernel32!ORD_001 ; VxdCall( Q* G2 J# t k0 e$ F D& V2 J
cmp ax, 0f386h ; magic number returned by system debuggers# u" e; h D0 ?6 J) ]
jz SoftICE_detected
5 o, P' P6 H; J; l) X/ V7 x# m _4 r; n+ M! x. e2 h3 C
Here again, several ways to detect it:! s) b4 _2 E7 q( `# T
% b, h9 u9 r& W* K" h# m BPINT 41 if ax==4f
' h& ?! w7 `; c2 T4 I9 ?/ ]5 _5 t! q
2 r6 K ~% ]8 [/ w/ p: g- _ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) q* k9 ^2 i/ T) W) f7 X/ i
0 d- l: y' g& |6 P BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) ~& z# r) @: Z# u/ N
# B. m2 o3 O3 E& Z- X6 Q% i BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!/ v' h% c+ ]( t' o# d
8 \/ F- G9 G$ p' S8 p5 \__________________________________________________________________________, [3 y0 n# k+ l1 |% a' g: g) W" b
& K9 z8 o. E' P+ _3 ?' d1 T: h9 T
Method 13
$ V8 }7 X, m- l; a2 b8 C) x=========
* x# P6 a5 f6 O0 Q, ?9 o- W/ }% f$ s) d. R$ ]& h' z$ a- N
Not a real method of detection, but a good way to know if SoftICE is4 e. k, |3 c- J8 t- h$ D' M, `- t
installed on a computer and to locate its installation directory.
6 ?3 B8 d' y( R/ { Y8 c# M4 H, e) kIt is used by few softs which access the following registry keys (usually #2) :
. o( s/ L+ z4 z! e6 n$ G$ L* c
5 a# n+ `. H# H-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 |! o( c" c' S$ ?) K
\Uninstall\SoftICE# b$ u9 Q7 Q. [( L8 [' }) h7 H
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: |. d a1 R' ?$ _-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# i/ `1 U$ S4 q, p: R4 a2 p; m2 j
\App Paths\Loader32.Exe! Q' x6 F& x3 n
, c( d. G; q4 D6 x- N
f1 |, i) I, X# WNote that some nasty apps could then erase all files from SoftICE directory
7 x, f; m" P+ i9 W$ k2 k' @(I faced that once :-(! U9 b) _0 |7 X) x1 R) F
& L7 h+ ]8 t/ fUseful breakpoint to detect it:
I3 W$ p: M1 o; M g' o2 Q; ^( N+ }+ J
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'& X% I _ Z1 r0 _* u( V9 R7 J" _
M* D7 W' _+ s, ]. w4 s& |$ \+ t) n__________________________________________________________________________
. W. S+ {, I( C. T
7 Z; E. L& A: x9 f+ m4 a
3 g! K/ U* Y2 \. J2 R1 i {Method 14 & U+ i5 }& n2 `
=========. R$ j! Z. z, {7 g/ C3 C- A# E
/ G" Z! B( y# s# R( F+ I; I
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
" s- @% l; c) d5 `7 V- Bis to determines whether a debugger is running on your system (ring0 only).
- k6 \" g, j7 E5 d E
# r. M7 ]6 _" ^; y$ A0 Q' u VMMCall Test_Debug_Installed
. V" |- A; W% G, o je not_installed
- n6 h# O% a$ G, A. Z% V q! \! T7 k1 l1 |+ ^
This service just checks a flag.
* R) N. t3 ]+ i9 a8 d& `</PRE></TD></TR></TBODY></TABLE> |