<TABLE width=500>, H( R# {1 G$ A3 N" i% t
<TBODY>
. J" F6 f, K8 o/ ~* Q<TR>
2 q( ?1 w3 w6 }# V. ?<TD><PRE>Method 01
3 x8 P1 ^6 q2 M: y. W: S=========
5 e# m- `3 u" ?7 N1 _
# p' ^* n+ G) k" X/ |2 ^8 g) L4 yThis method of detection of SoftICE (as well as the following one) is
6 ^, v* o( X: S" u9 f3 ^used by the majority of packers/encryptors found on Internet.
5 I' f5 ~/ l0 g$ y4 M! y0 QIt seeks the signature of BoundsChecker in SoftICE
5 F& G/ ?9 B q: a+ k( |
4 n4 ?7 J9 v4 f0 ]3 B5 E mov ebp, 04243484Bh ; 'BCHK'9 T, l$ c% }6 o2 @7 P, V1 Z
mov ax, 04h
# A* s- F$ t1 B" i0 B+ X int 3
1 n5 q2 e6 x- h, Q1 B' [9 b cmp al,4
( P: w) s# I; B jnz SoftICE_Detected8 r% t/ M: T- I. S+ j
9 Z( |+ U# M h' u1 b4 R4 Y6 A$ o
___________________________________________________________________________
6 q1 |4 S$ w$ m* i' u* y# y
0 A7 j& u5 Q+ u0 P- zMethod 02
: _/ @$ k. U9 D* q% D; P8 c=========* d4 C: N& h6 I" |" Y
; u" i. T; P' M( F; }
Still a method very much used (perhaps the most frequent one). It is used) u r0 L- i4 `& B8 r# [
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,; j9 g% m' g# y% u( C
or execute SoftICE commands...0 }1 n* {2 J0 v Y
It is also used to crash SoftICE and to force it to execute any commands9 I# I$ a: h% a9 {8 ^1 E& g. G
(HBOOT...) :-(( ; ~# w1 E' | `" X4 X) X+ S- D4 }
( W' `6 {5 q) h. v5 U/ U w
Here is a quick description:
) y) K" v5 `* ~: N-AX = 0910h (Display string in SIce windows)
" q5 Q8 }4 l0 w' u5 S# _-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 i' C( i) g+ {) B7 M" ]: s: n
-AX = 0912h (Get breakpoint infos)
' {% \' o( b2 j s-AX = 0913h (Set Sice breakpoints)
& V4 k2 T) u/ U1 h. K3 R P-AX = 0914h (Remove SIce breakoints)
8 W0 b: J8 ^$ R" x8 K% n7 R- e) u. @" T7 ]
Each time you'll meet this trick, you'll see:; a+ ^7 |+ ~+ \8 N
-SI = 4647h$ ^9 X8 G$ V: L% ]4 n. a
-DI = 4A4Dh+ j; b- R4 v J( R6 Y8 W2 n: Z
Which are the 'magic values' used by SoftIce.
3 D5 b4 K# k ^% t+ S7 W+ J9 dFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 M( ?8 Y* S! H2 v/ _, Z
% r( g8 [) |4 ~6 D, p2 V1 x+ }Here is one example from the file "Haspinst.exe" which is the dongle HASP/ a+ N2 ?& B3 _; k; |0 y) o/ E
Envelope utility use to protect DOS applications:8 n3 ~$ e1 ^: S1 [9 t: \% k3 S) o
. L7 C* G: y) n5 Q$ ?* u+ x3 }4 y! K' H% I0 Z' w# x1 w/ }# c' j
4C19:0095 MOV AX,0911 ; execute command.
& j! V6 ^( J" Q$ h: L4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
6 D; q; q0 d. B2 a8 T! C" i4C19:009A MOV SI,4647 ; 1st magic value.: ~+ F k7 u7 }3 }1 |. D# W
4C19:009D MOV DI,4A4D ; 2nd magic value.9 L8 ~8 v" p! O3 R7 b4 `
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ N2 A% e) \ x9 f* m4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; U8 Y& q% a F/ L3 L9 S
4C19:00A4 INC CX3 f" V+ q1 `: q% X
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- C3 q0 x T2 i ]
4C19:00A8 JB 0095 ; 6 different commands.# m9 d: C, [5 V: y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.) X1 o* m i I) M) t3 |: y
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 N; T, @- \$ z4 c3 G1 `; H
4 ~5 i3 q/ G' P, ^/ j+ _* dThe program will execute 6 different SIce commands located at ds:dx, which. C/ }# g# i9 J
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 U" v& b4 W% S, [* }. m$ {# |2 |9 p7 F; Z$ }$ [4 B2 q- K ]
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., @- \- p$ V# z$ j x. [
___________________________________________________________________________
- {1 G9 F9 A3 ^* B4 C, ]1 e J, J
6 r1 q) N' J+ ]
% A( ]! f5 E( G- {5 n# dMethod 03
4 }5 } g0 ~: l% O6 J; O) z& p" A7 Q6 l=========
# z5 T0 e$ m5 P2 C& {) d. v7 H! m2 j; h+ R/ S& P# G! B& p
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 g5 X6 w) S0 h: s$ t% v
(API Get entry point)1 ~ \3 N, l& P2 ~& k" r& B# K
8 A! ?) @+ _" ^
3 v5 n5 v3 P6 r
xor di,di' j4 m! m1 C& C6 ]6 Z
mov es,di
( J4 P$ x' I9 a% G b% G& V+ E mov ax, 1684h
& Y) W$ Z5 z' U' S3 a$ _- [' q4 q5 N mov bx, 0202h ; VxD ID of winice
5 E( D, D: y: C; x/ e$ n0 F! n int 2Fh
9 D& D/ b/ g, r% ?' l2 E) s7 }$ { mov ax, es ; ES:DI -> VxD API entry point
0 J7 B6 ^* U5 @+ K add ax, di
7 \$ r( E7 a$ V3 O, m; Q8 l test ax,ax
1 C/ F- r. O" j jnz SoftICE_Detected N: S* R4 b3 i- M S1 X
6 Q5 U$ X2 k5 T J
___________________________________________________________________________
' ?% G5 }' h6 F$ ?% s3 D9 I" x, T& n6 A& Y
Method 04
7 f+ b T2 g+ t7 a6 t7 |% T=========
$ G& V& s# |5 e. E- p& t8 ?; Q, C* L- \/ {
Method identical to the preceding one except that it seeks the ID of SoftICE
% M' i5 z3 Z* _; G7 Z6 q. RGFX VxD.
+ {9 h9 U% T; ^3 u- g0 S9 h W. A8 `! u; a: V- o: x+ W
xor di,di
4 C% t+ X0 u. P! w% A mov es,di# t: c$ c. s; o% G
mov ax, 1684h + d% F! _* Q% m8 v3 v9 ~
mov bx, 7a5Fh ; VxD ID of SIWVID$ [, l8 R/ T) p5 Z
int 2fh3 H4 }3 t, c$ e. E$ D* D
mov ax, es ; ES:DI -> VxD API entry point
9 x# e9 l/ D6 `! _+ T add ax, di
! Q3 G5 o/ Y3 ]/ [ test ax,ax
9 |2 s0 \; A% u$ ~6 ]* H jnz SoftICE_Detected0 Z& G2 t0 g( h1 c8 [
' s, |+ z" |( m
__________________________________________________________________________5 j! z. a0 M U9 q# V5 B" [; @$ j
. O$ T( a* s, ^) P. s$ i6 K
* w/ _$ S$ q( p6 ZMethod 05
5 b7 V1 t; o5 B6 j4 A8 V& e$ x=========5 e# {+ f+ ~5 ~9 P% G# J, B: T
1 ]% x' I* N, \& g1 {2 W- B9 q
Method seeking the 'magic number' 0F386h returned (in ax) by all system
) G. a: \# K1 ^: Z+ E/ Zdebugger. It calls the int 41h, function 4Fh.
; V5 {6 ?9 @/ k* \' SThere are several alternatives.
; o4 M* F. V% u: Z7 w3 o8 g2 h4 u1 r( {+ g3 ~2 W: d' [
The following one is the simplest:
9 ~; O8 u; k% N6 X
6 {! k: \, q8 y+ H mov ax,4fh. Q3 w: P/ z6 l) |$ J
int 41h
B1 n" O; q# X5 O2 k! x cmp ax, 0F3865 H2 T3 M" Z+ B9 f O
jz SoftICE_detected
* \7 H1 |% u+ z$ v3 Q2 J# b, n
- }% A- B8 M, D+ C$ y
3 t; m8 A" k: F! l+ H# jNext method as well as the following one are 2 examples from Stone's 9 {. C c# \2 ~% E7 X/ x) E- o3 r
"stn-wid.zip" (www.cracking.net):& l1 H- ~5 Q2 e9 q. I. Y
, B6 p: f$ c7 C0 d9 J/ ? j! q) v' u
mov bx, cs
2 @- A6 g: I! R" e lea dx, int41handler2% s( m& w2 }+ T; \; S1 F
xchg dx, es:[41h*4]
4 h& H9 m# I# y' I+ }$ w* C xchg bx, es:[41h*4+2]2 s/ J& w4 P! g9 ^" |
mov ax,4fh
( x& k5 Z& ~ I% V2 t4 z8 { int 41h" u2 k9 A3 r1 C% F
xchg dx, es:[41h*4]# C5 E' o0 f9 n, y! o; d+ m) z0 J
xchg bx, es:[41h*4+2]
o- S9 Z; b4 u/ M @, Q cmp ax, 0f386h
y& Q, E2 v }$ t' N jz SoftICE_detected6 r' B7 {* B$ U# H5 J/ K: `
4 ~' Z: h' H5 m" N% e6 m
int41handler2 PROC5 }7 x3 V2 B: z$ c+ p G
iret( F% P& S# k* [+ n/ g
int41handler2 ENDP
7 i7 l% Q. t. S# Q0 n5 u+ N$ }8 g) W! x; S0 S0 D+ G
2 l, i) S f; }1 e_________________________________________________________________________6 i0 S/ g1 H7 ^4 T; E
3 ~5 N! `: F6 G- v! ]8 o+ S
6 I5 f- s1 s# T H# d8 H; wMethod 06' M, I2 _0 I% o* [9 ^! s
=========! I+ I% m) h0 B% v4 } E4 Q: C
7 k6 G' {2 A# Q6 @) d
6 M9 ] b4 } U2nd method similar to the preceding one but more difficult to detect:
8 E" g- F# G$ U/ X; e2 x
0 K& k" P$ `, @# a/ c9 d* n) v; w4 ^+ |
int41handler PROC
+ z$ N0 P' G; m# {1 B- v+ X mov cl,al/ e& J2 e( [" I3 n
iret' f! G1 B0 R- F3 e a, E, y
int41handler ENDP6 R; h1 ~8 a! c: g U
0 C; L% u1 ^, K# C: _9 G
& z8 T2 s8 e3 r- Y/ N! Y
xor ax,ax' g2 n+ C% T9 P/ Q% j
mov es,ax/ `4 [8 G# T7 N) [( ~8 l! M
mov bx, cs1 \' g7 R+ V( q6 T- C2 f
lea dx, int41handler
* R3 \2 ^& N. O' N xchg dx, es:[41h*4]
; D Y( Y; c) @% q' g8 E* F% B xchg bx, es:[41h*4+2]
( z& z0 F1 n8 G1 g7 P in al, 40h$ z# ~$ ^' U- {! F1 I
xor cx,cx
& g; z1 l2 t3 L. ^1 c int 41h+ p1 w: t6 ~5 I/ q" m4 h9 ]* e
xchg dx, es:[41h*4]
1 J4 X c4 x0 q, t' c xchg bx, es:[41h*4+2]
% _+ A9 m2 W7 I& j9 P# Q cmp cl,al
/ F+ V$ t, \% J8 p+ k6 w, E jnz SoftICE_detected% H) A" u7 d7 L9 ]
; n6 q. i) }7 U. `) D& N; n
_________________________________________________________________________
9 Z! A2 P% f' D# x3 Z+ n
7 h8 t" @2 M" G/ _0 U9 sMethod 07* I. B8 s8 g% L9 \$ v3 Y, c* J
=========" N$ t* k- u: x1 t7 a% a
3 d2 o5 X8 `, _Method of detection of the WinICE handler in the int68h (V86)
( w1 Z* J! s# i, {! F3 k* m
* K" N2 `9 b" N0 i3 G mov ah,43h
9 i4 v2 X+ ]) X. O+ c int 68h
/ Y$ m5 c. }5 m cmp ax,0F386h
% r& N. |' f7 }( @ C jz SoftICE_Detected8 d) z1 l# `) d8 L/ f) A
( w; k/ Z! N p4 P0 Q
/ I& k1 P* Y: r5 z! `
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 T% s) G# e$ p j9 J app like this: F/ _: M9 t: Y& B+ V% p
( l; w1 h" ?' x: V' |7 A
BPX exec_int if ax==68
9 c6 F; A4 H- r2 ^# N" @. { (function called is located at byte ptr [ebp+1Dh] and client eip is9 d7 W/ K7 w+ r! w
located at [ebp+48h] for 32Bit apps)
/ g3 e7 Y& o' \ X) x' Z i0 R__________________________________________________________________________
! y( B( r: a$ I" F
% |$ |* a/ h2 J$ Q1 b
/ w( g" z: \$ |3 W1 F- {Method 083 g% o6 t$ t4 u. N6 J
=========2 r# w/ h" B1 J, x
6 }$ _" s6 q8 C$ M/ ]& m
It is not a method of detection of SoftICE but a possibility to crash the
& x2 S' L& N _system by intercepting int 01h and int 03h and redirecting them to another* c: e. ~+ G0 o% G% o7 w) m
routine.3 T3 N/ x# u2 O: k# u9 o: F7 }3 ?
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% n! g! e# G. c, W/ `% ^to the new routine to execute (hangs computer...), l: h. J3 K% ~; Q. u% v
4 `; z+ l; R# g3 o3 Y4 M
mov ah, 25h
) e. ?% V( b/ g* l" q# ` mov al, Int_Number (01h or 03h)
$ H1 Y: |$ w& g$ u4 g* x7 u mov dx, offset New_Int_Routine3 m# d7 _ u# j
int 21h1 T1 W' i4 W* C Z, n; |# s' ]
* o7 F: z; U8 [! X0 }' c
__________________________________________________________________________
( a% X; W2 [" S; W3 y
# Y6 A0 |; h- _1 v t \Method 09
. t" ^* c! H- P6 Q$ Z' @5 ]=========) L( H" e( ~/ N$ w7 N
1 e( S; d+ C2 v* U2 p8 z5 vThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only% x* S0 Z; u5 t
performed in ring0 (VxD or a ring3 app using the VxdCall).- x' w3 w9 k8 d, ~8 m$ x
The Get_DDB service is used to determine whether or not a VxD is installed
0 o3 _8 w& G. C+ [0 _, V, \for the specified device and returns a Device Description Block (in ecx) for2 ?: U8 i1 A5 |8 w9 b* ~
that device if it is installed.- z# {' B2 s$ B" |7 u; V* h
5 Y$ R4 I5 i0 w mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( F7 }1 [3 B. i) [( g! [ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# n7 t' V( e& I* o7 y$ y- r1 w
VMMCall Get_DDB7 i& O/ }) j. Z$ h
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 ^5 r; \1 M# f& J0 [; ^
+ _& |0 w+ T, F& |2 hNote as well that you can easily detect this method with SoftICE:
8 e/ G4 _2 `+ N# o bpx Get_DDB if ax==0202 || ax==7a5fh7 P8 s9 |/ o- v6 X/ S; x6 d
& x. ^7 l% f* e
__________________________________________________________________________
4 X1 o5 d! x3 c5 b) m3 i( G% T @7 ~1 f
! h' H3 k r& V6 \- dMethod 10/ G) ]6 ^# R: Q6 W0 }4 l/ ~
=========; {$ d, J+ M, E- p( N
' ~: X i/ F. k8 x1 h& H
=>Disable or clear breakpoints before using this feature. DO NOT trace with
& T: r* E1 v2 c3 v/ I! P SoftICE while the option is enable!!
1 A4 P) V; d. t, \ }% B$ J( O3 A+ l, A
This trick is very efficient: J% f/ h/ c9 ~$ W# j% x% W6 ]: A
by checking the Debug Registers, you can detect if SoftICE is loaded
7 w- [( ]$ _& L4 I(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: ?0 l! U) y8 Uthere are some memory breakpoints set (dr0 to dr3) simply by reading their3 w( h) i Y5 B2 F6 ]( n3 s- Q/ p* K
value (in ring0 only). Values can be manipulated and or changed as well
, ?1 \/ Z5 L4 b" v' k* @(clearing BPMs for instance); ]7 V! T! E9 w7 Y' t
. b6 X5 ~, v' K. J1 {9 N) c+ [( N__________________________________________________________________________+ g2 b! J5 ?6 W: K& c, z$ w
2 s& x* ^- ]1 v) f6 B% }5 }& I& qMethod 11: Z2 b% X1 T5 J& Y; J
=========3 ^2 b1 V) G7 X( ?3 X
2 l9 Y/ i! K) ?4 bThis method is most known as 'MeltICE' because it has been freely distributed
( A+ H* u. p) Jvia www.winfiles.com. However it was first used by NuMega people to allow
) x5 s2 ^5 f5 I; S& b3 LSymbol Loader to check if SoftICE was active or not (the code is located
+ z- m B5 b: e: M/ A! N( P$ x& Hinside nmtrans.dll).. L/ K% Y7 W4 C
z$ H4 D4 R! k ~# c- Z& Y TThe way it works is very simple:
5 n( k g `$ V4 f* YIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
4 k' a8 v2 c. G' sWinNT) with the CreateFileA API.; O! ?3 {9 R; S3 Y( ]7 B7 X
; I/ [; f, G( |6 R' _8 T2 _* q
Here is a sample (checking for 'SICE'):- q/ K/ T+ \1 c: k: m" Y% i; M0 {- b
& q7 m) [% |7 A; Q
BOOL IsSoftIce95Loaded()
7 V( z7 G8 s( d; y{
& e7 @. V2 }' G6 _3 G6 z/ J HANDLE hFile; ( m' N2 E ?) r; q- F* C
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" d' ?& r+ Z- ]: P FILE_SHARE_READ | FILE_SHARE_WRITE,0 X3 X/ c9 c2 b W/ C
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' a7 z* L' b+ P7 E1 b
if( hFile != INVALID_HANDLE_VALUE )
0 A1 l6 f# K8 i D( R7 e& V+ W% [) r {
0 l8 ^5 W" j/ Y/ T$ z% B( x CloseHandle(hFile);
/ d: \8 d/ g3 t: v return TRUE;
* A, U% o5 e- v& J. R0 { }6 S7 n" D6 e u8 f# w' @
return FALSE;
' N1 T/ I; o( N( a+ p}8 R9 v* ?- t1 U; l! [9 R
& U! e/ x0 h7 T, F: z
Although this trick calls the CreateFileA function, don't even expect to be
H4 ]* R8 h2 {able to intercept it by installing a IFS hook: it will not work, no way!
$ l3 s' I% h2 H. uIn fact, after the call to CreateFileA it will get through VWIN32 0x001F2 q* W) q5 @7 I' r3 D7 v+ H
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' x% U( l' Q9 l+ f" b% H" C5 @
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; f) g U( k* bfield.& M, y* Y; _! h$ a, J) F# R9 n
In fact, its purpose is not to load/unload VxDs but only to send a
& U2 @7 Y; b( a; P7 eW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 h5 f# U9 b. x3 E! A
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 k/ k1 P' W+ K, Q) sto load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ v! G3 d. K, Q; n" pIf the VxD is loaded, it will always clear eax and the Carry flag to allow {) d% N1 c: `$ Y% L
its handle to be opened and then, will be detected.
9 ~' u' U. X, `: BYou can check that simply by hooking Winice.exe control proc entry point
D* I. M) W2 U, }' {) {while running MeltICE.* D- \- } o% |- l, M6 t
* V/ w9 g( d0 `" w# Q& E/ ^
1 P4 U: {" X% ^" e9 s) s# p, d 00401067: push 00402025 ; \\.\SICE
6 H/ ^" P% v; D 0040106C: call CreateFileA2 }1 C- q2 m7 J% L+ r) B0 \
00401071: cmp eax,-001
' {% {8 E Z& [" U 00401074: je 00401091+ d# ^9 [9 h# |7 Z5 X; y/ o5 ]" l
9 P% m% \8 q' d# S
/ L8 t3 ?' _; l; J3 d, z S% B( f
There could be hundreds of BPX you could use to detect this trick.8 Q& C+ d9 [3 H. I; @0 p3 U
-The most classical one is:
: T7 U! W; _9 }; F p: P5 L BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||# f) x5 `% w8 O5 ?
*(esp->4+4)=='NTIC'# @( x3 {2 O4 P; U( x, u c
* a) d5 T) E2 _4 t
-The most exotic ones (could be very slooooow :-(
( G' h% }' e( B# n. F, |: r BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 P. `9 d" }. \$ |7 a
;will break 3 times :-(
( u0 o/ F3 _, s; Z5 x
( b. w$ _( a- ?- \) a f7 t; h8 g-or (a bit) faster: & ~. E0 N) `& ?) o% ^& l
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- v# _0 w, @" ?* _
$ Z% b# {2 U4 v0 m5 K7 [" G BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) j- J' `6 v, V9 ?9 O ;will break 3 times :-(6 Z7 h4 P) W; f2 I
. L; G$ l* A1 T3 \% ?9 D; E
-Much faster:. R. D. B; F+ s e3 _3 f
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', \, n/ o/ I( a
* J3 B9 W( R5 n; w' A% V1 t' Y# Y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen) k* |2 n, A5 v: s
function to do the same job:
& {1 m7 e- X9 V/ g5 ^
6 e( |' @3 W/ i1 D2 B5 } push 00 ; OF_READ
, L g5 l" `7 b) M5 Y6 a, P mov eax,[00656634] ; '\\.\SICE',0
/ |# q) a& N1 ^ push eax+ l) ~0 f) V4 k% o
call KERNEL32!_lopen
: t/ g* {( e; r& T. {: A8 R inc eax- _; }$ ]) U8 k E0 N# }, t
jnz 00650589 ; detected3 E. o( F8 z5 @3 v X! e0 w
push 00 ; OF_READ# Q6 z9 r9 `1 F% C
mov eax,[00656638] ; '\\.\SICE'
, W4 f q1 k: _) a4 O push eax
5 R; |; m" [ H7 ^" I5 n; R$ a call KERNEL32!_lopen3 L/ G5 M! e6 @) V
inc eax
$ U, E1 Q- ^& h3 K2 P3 J+ G jz 006505ae ; not detected) E7 ~4 |( l9 `5 V* k: R
! ]0 Z! s8 k6 e4 d! o/ p
( n6 y' x9 {/ x/ T+ L. ?6 D__________________________________________________________________________
$ m( k" B' R+ n6 g8 ?3 E! b* a8 N. q/ b0 Y/ I. e' u
Method 12
" R1 E6 a3 C& o: m# v9 ~=========
' t3 |! I! A, `$ \, {* M4 M" d x0 C1 g0 ?5 f" @7 C
This trick is similar to int41h/4fh Debugger installation check (code 05
1 @% P }' {( {% a& 06) but very limited because it's only available for Win95/98 (not NT)! g( t, j/ L) u9 |# O
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 U+ I) z( C: h- A$ f
- W7 Q0 Q0 B9 X1 J; s3 S8 [ push 0000004fh ; function 4fh! _. W) L+ ?, [% _) F, E& f$ d
push 002a002ah ; high word specifies which VxD (VWIN32)
J2 r; s% L9 ` @3 Q8 P ; low word specifies which service& |/ [$ O F t0 _$ l% x
(VWIN32_Int41Dispatch)
( I/ v0 G$ V# C t, L0 H call Kernel32!ORD_001 ; VxdCall6 ^5 I; ^0 K9 e2 j
cmp ax, 0f386h ; magic number returned by system debuggers* E4 m8 B0 I$ Y2 i7 G" p* ^
jz SoftICE_detected
9 r( k- P( ^( S! L9 p
* U9 A) s9 \5 O5 vHere again, several ways to detect it:
8 ]: D ~9 ^8 q4 d" {& U5 I6 b8 s% U! c, n" J9 o, R7 X! k% ?
BPINT 41 if ax==4f+ H) F& v7 }8 p' P, N
& m* {* }- U: c5 Y4 m6 B
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
! L- G8 R, q! C3 x7 t1 E
0 x% M7 D, j4 E9 R: _ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A" ]+ u4 K* `4 O
8 n; ` i8 Q6 k# k* o K# V
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!3 r* Q0 s6 f% n% a2 _2 z4 L" \+ w! q
1 F0 @, f0 n4 @. U& n__________________________________________________________________________
7 P: \" X' ^" p4 H$ l- m y6 z3 M1 ~7 n, l! b. S! Z
Method 13( m! Z' }, q9 u2 Y+ u5 A4 Q5 o4 F: g
=========& {1 |+ T4 P$ x
. _9 r$ ~% k( Y; |* m yNot a real method of detection, but a good way to know if SoftICE is
4 c- x1 N, }8 l6 binstalled on a computer and to locate its installation directory.
' s/ u: q3 i1 j2 _1 r/ pIt is used by few softs which access the following registry keys (usually #2) :
3 G$ G! b7 {3 W( L+ L
+ d% m% D+ N$ N: J-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' _9 x1 f! z! B3 y* Z
\Uninstall\SoftICE
; M( R7 E0 X1 T( U3 G1 [- F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: U# U, ?+ ]# B) ^4 |8 }( B-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, E8 [' g3 u5 w+ z! O: W& V M& Q f
\App Paths\Loader32.Exe
! l- j8 @' x. r
6 L$ O7 ^" s& U) O' }
& X* G% z6 @2 h* CNote that some nasty apps could then erase all files from SoftICE directory
+ A/ E- k5 z& z' ?(I faced that once :-(
+ N' u1 x, K2 p6 s7 M( Y! L- e/ T# U, I! u6 k, X0 j6 W, c5 a8 z1 l8 U
Useful breakpoint to detect it:5 f, j* F9 T; a% b; _+ y: Q) z
& b! R* N' L: p1 V% u BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 g; N2 }9 n, S* W0 S' Z% e& z5 C* D+ h
__________________________________________________________________________. T+ j; V" E- A* l3 \
4 b5 c2 e& P8 u( i' Y2 B7 D7 o8 C% ?% ~3 p: {) ?' y6 `
Method 14
2 R+ d7 U. L! I# a" T=========; h) G# n/ B) e
/ y9 i; s2 c8 B( W8 s
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" _: B3 t" @# Y1 u( x' _. R
is to determines whether a debugger is running on your system (ring0 only).( c$ O: m. |# i8 l3 _* Q% H/ i0 q* o3 B
( h7 y- L" S4 j& d4 ? B6 N# K* V VMMCall Test_Debug_Installed
8 j/ W) r( }' E* `( D$ _6 v, K, g je not_installed
6 q, U Y b* W& K3 b( L
6 E2 F7 s: y. xThis service just checks a flag.- a7 ^2 `! f* \
</PRE></TD></TR></TBODY></TABLE> |