<TABLE width=500>
) \2 `+ V- d5 s0 M" |<TBODY>; C$ H- c; j( g$ M
<TR>
' O4 S* ]7 r' G3 x<TD><PRE>Method 01 2 e$ i$ |* i0 w) J" z% }
=========' {# e# Y( A- d( z3 N. i
) K* I1 j1 u( G
This method of detection of SoftICE (as well as the following one) is' R) P' N" v& ~ m0 |8 ?3 n
used by the majority of packers/encryptors found on Internet.2 E/ U/ s3 Z. y5 z @
It seeks the signature of BoundsChecker in SoftICE) b8 N1 T6 D a* n B- g
' z. e; C; U! K! i6 i& b& Q: Q! S
mov ebp, 04243484Bh ; 'BCHK', T# C: ^: w) }3 Z# W+ m
mov ax, 04h
/ p4 H. K6 `, f: } int 3 7 [! P' g; }# Y0 v
cmp al,4
' l( v9 l' _( K r' H jnz SoftICE_Detected5 u6 D" `+ ^+ T8 |+ k# @: B
" V0 F# l& Y: T% q* n& [( @% c5 S
___________________________________________________________________________
9 v4 N" ~/ y4 T7 J+ V/ h
, a4 p+ g. C# J2 v8 }3 x% rMethod 02
# T+ z9 @ R @& Q=========
. l; J6 n5 h q( p7 `# @5 x! s q# Z! U- P( [ B, G2 }
Still a method very much used (perhaps the most frequent one). It is used
# o( k6 C6 S v qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,% u- O) R5 v a0 H; X+ x$ E2 D
or execute SoftICE commands...
& Y0 w5 \. D' d& u+ y# yIt is also used to crash SoftICE and to force it to execute any commands8 ]3 A5 Q" i+ @( I5 e
(HBOOT...) :-((
; Y" i. }" H2 U9 l5 v# y/ k6 b( ?( U' i, h
Here is a quick description:
2 {% f+ N2 [7 g6 Z4 U( y8 o3 V3 q+ t-AX = 0910h (Display string in SIce windows)
3 T! y& S( W6 \! K* m) P-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
- L/ |) h& v# S9 Q-AX = 0912h (Get breakpoint infos)
0 D4 I! l/ k) c-AX = 0913h (Set Sice breakpoints)
4 \6 C2 ^* ?; z9 h3 q# r/ H$ I-AX = 0914h (Remove SIce breakoints), J n2 e. R1 N+ \' \7 E. y
- N3 p7 R% x+ x/ G8 REach time you'll meet this trick, you'll see:# `1 {6 y% ~0 i- W: Q3 a" Y
-SI = 4647h ^ p- I" |$ l( j/ X& E; V
-DI = 4A4Dh% P( O6 i7 x+ t, j2 S( j' c" F
Which are the 'magic values' used by SoftIce.
. }8 F0 M4 ~0 p, M7 h( b! pFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 k" F6 A/ `/ ] ?5 m" \7 {
6 Y% O/ p4 P# T5 y
Here is one example from the file "Haspinst.exe" which is the dongle HASP
7 r l) F, k8 s0 S; o4 \( _Envelope utility use to protect DOS applications:
; R3 Z; m; \9 {/ K# G9 [! V" A; Z$ a8 e0 c
0 W3 \" B k: p4 f% B- g5 [, f
4C19:0095 MOV AX,0911 ; execute command.0 P3 g% Y* i+ Z/ d
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).1 ^' f+ f" T4 K5 l
4C19:009A MOV SI,4647 ; 1st magic value.3 a7 @% t2 M$ T$ {" }+ z9 ]; v( i
4C19:009D MOV DI,4A4D ; 2nd magic value.1 Y$ y; D+ R: f# y4 P
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
x8 Q/ O0 q: U5 v8 C, D4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
' R8 Y( I& ]. D% C& X) G4C19:00A4 INC CX
' K6 I, X+ e: ]- U: L9 _4C19:00A5 CMP CX,06 ; Repeat 6 times to execute8 f" c9 H6 @8 H1 T, `$ e
4C19:00A8 JB 0095 ; 6 different commands.; L" c p2 t; t# I& K
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 @4 c! B# y5 Y2 o4C19:00AD MOV BX,SP ; Good_Guy go ahead :)0 [+ v, G: K5 ]. G' ]+ V, y
4 T* e; Z: m% @$ C7 s, i7 N
The program will execute 6 different SIce commands located at ds:dx, which% ~# D; _6 d( X0 g. t0 h* L
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( s6 N9 F2 j4 n3 N# p. I
- _# A, j: W: v. S# N* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 H2 V$ f3 i& O1 m___________________________________________________________________________4 l/ d" F3 V' N. { f# ?
: P" `: ]5 N9 ~- R5 L4 t" p1 ^4 \
+ u" ~- C& ~ {7 e' K8 n' l5 ZMethod 03. U; O( Y% r2 d1 Y
=========
' W+ F8 G$ K7 x- B0 b, ?- |* s1 F
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h: C4 h; b9 a& f" T& a7 ^
(API Get entry point)( W/ N' Z" ^: x- F
, p5 d/ q6 X0 r/ n! M( S
" B5 \* o8 [2 a
xor di,di* ]' d# `# O! e$ l7 q8 I3 e
mov es,di# x/ |5 J% u9 v% l
mov ax, 1684h / E/ G: z n0 F3 i: K: v, V
mov bx, 0202h ; VxD ID of winice
9 y% l& A5 m7 J7 R) F* s8 t5 M9 i int 2Fh
3 g" E. ?; C4 L; Q: R; k; v mov ax, es ; ES:DI -> VxD API entry point
) i" C* n& ~* n$ V add ax, di
0 u! D9 X& d$ o7 U- A+ p test ax,ax
, N: @- `1 x% v, \$ u X8 \ jnz SoftICE_Detected3 Y4 m( K7 L# W! Q
' l( U- ~1 g+ L' l6 M' e
___________________________________________________________________________2 X. _& e% P5 w
9 X+ u) c. u' u' _0 C! R$ x" q: [Method 04; {" f- q$ A7 A# ]! |4 c7 {$ T
=========: s' ~3 D# e6 q2 q! t( G9 _! A8 f
S' @! h7 r8 `' q
Method identical to the preceding one except that it seeks the ID of SoftICE
! L+ J$ c1 L' _6 vGFX VxD.
: g! e; q+ o) _7 M$ l; B; K3 j! U% P3 z* {
xor di,di
! V E" {0 ^' t% Y' e$ l mov es,di
7 {8 Q" e1 |8 l i5 u1 f3 T mov ax, 1684h 8 d; y- p: \% t G& d! s( s
mov bx, 7a5Fh ; VxD ID of SIWVID2 O& f; Q2 L, `7 r
int 2fh' _! m" t% H7 O& x& @) S- a: x
mov ax, es ; ES:DI -> VxD API entry point
. `. l7 K, c% f' w) g# I; O add ax, di
+ D) A; c3 \- P! f test ax,ax
* ]7 z. k7 J0 D& L5 ]9 r jnz SoftICE_Detected
3 q' O2 Y% f# x" r. [9 i) E$ @2 C# H2 `+ n. {
__________________________________________________________________________1 ^4 h; U# }- a8 u; D- k$ V& z2 c
( W [# D6 Q% `5 {: J6 t6 ~5 j6 z
7 F. O! U8 d( b) ~/ |Method 051 w0 R3 {+ C/ V$ s0 t
=========
: ?2 G! E& C6 r7 n
8 N# |5 L% W3 q, U4 r* s# XMethod seeking the 'magic number' 0F386h returned (in ax) by all system' q6 b, T- I; C- }+ u J! `: R0 L+ l
debugger. It calls the int 41h, function 4Fh.7 X, {& E8 n9 a" Y
There are several alternatives. 8 z, z3 X, K9 J( u+ o
! ?" }9 F7 o7 u8 z% T! pThe following one is the simplest:3 ^7 c) B+ N: }1 H
3 z- }: ]6 h* H: S
mov ax,4fh
3 G2 d2 e% \' G% {! E) [+ g6 n. \ int 41h( R0 _/ t6 F! Z! m
cmp ax, 0F3869 G# W2 t# ]/ d) m/ v% i9 |. u! {# b @, [
jz SoftICE_detected
( u7 l- h1 [- h1 A* @5 [4 X8 r
^2 ^& i% a6 s/ g$ \( ?2 Y9 O. C0 d
Next method as well as the following one are 2 examples from Stone's " X/ ]4 O3 K# l+ R8 d: y/ D
"stn-wid.zip" (www.cracking.net):
% G$ D/ x2 Q! \! c: F: i1 S
( @. M2 y4 N5 t+ ?/ R2 ~7 v mov bx, cs
: S1 i1 y$ b) ? s. c+ n' k lea dx, int41handler26 l p* S! c* b9 v$ D% \
xchg dx, es:[41h*4]- ?" I3 C6 G1 E+ m2 h6 ?
xchg bx, es:[41h*4+2]
7 ^6 v- P0 k6 } mov ax,4fh
9 \) X8 H/ r: s' a0 O int 41h
6 h" p/ w; W. B R9 k; A, _' }- u xchg dx, es:[41h*4]+ w! i" Z; Q8 i4 l
xchg bx, es:[41h*4+2]
+ t2 s; g E" Q2 h. T/ q, i; V/ z cmp ax, 0f386h
) E& g: E0 `5 K$ i! ~* {; j; Q) u jz SoftICE_detected
0 |" n2 g `1 r. _" s! m" n. {5 X5 r& X& }
int41handler2 PROC* v% J6 R' Z+ j! Z& J
iret6 J1 U9 {- Y$ t
int41handler2 ENDP
3 r' c8 t6 d& G5 ~$ M$ Z
+ i6 g" z* f* d8 a- m4 w0 D3 s7 v
_________________________________________________________________________3 C: {, v! U4 `! p4 P( B5 }
, x; h, n' u7 w" l0 ` [. b" K
* ^! e) R, }% k G D
Method 06
- w* M8 E4 P0 G/ [0 ?9 s=========6 E: V" l0 G/ Z' p8 d' M7 E
# q$ ?+ c3 _/ w+ R, y8 \
2 i# i+ m3 D$ r3 @, e2nd method similar to the preceding one but more difficult to detect:, \2 ~! _. R' `; O# d
/ u4 k$ s: P2 `. h- F
6 r, @/ u# y1 y7 s1 ^$ B2 c/ lint41handler PROC4 X7 S; l* `2 \& c+ n4 `3 R8 N
mov cl,al9 F5 Z' E% Z; l6 D2 T
iret
0 F( R2 g2 U! P7 G+ aint41handler ENDP& e9 A0 Q# K+ F
5 H/ w( h9 j* P$ A0 g( ~( j2 R" S
5 j$ I: Q3 J+ y3 A2 b xor ax,ax
- d1 Z2 F7 p8 `1 Z, e5 V$ M mov es,ax7 O, M* r' u3 [+ A$ f1 T/ W
mov bx, cs/ m) b, |* Z* V" U1 I
lea dx, int41handler3 d* @: r2 p% t! i
xchg dx, es:[41h*4]
( F: @/ }9 c7 v8 c) {0 r; R3 ` xchg bx, es:[41h*4+2]
/ s7 `9 q4 Z) I8 X$ ]. b# V) y% c# S/ d in al, 40h3 V) E5 R! v- i) e
xor cx,cx
0 A; l3 X$ |; e int 41h
' U, C3 W/ S& {1 } xchg dx, es:[41h*4]
) X g' m) `" ~" }" a; v xchg bx, es:[41h*4+2]# A' a/ N. l$ u6 o
cmp cl,al: }7 S- n5 k( g, a: B$ x; n( P
jnz SoftICE_detected8 n* U; A: g8 o: b9 N; r. B
; a* g% L! e( X2 q! w9 C_________________________________________________________________________1 C6 p q! V: `- d
; F8 O2 t! q( E% q' N* `, n
Method 07
0 \8 P9 I/ w1 I* x* [=========, |! s! ~$ i& q- s% k
6 E4 f$ z. J1 kMethod of detection of the WinICE handler in the int68h (V86)
3 Z, ~$ E" o! b; ?- h% a' O; l9 ^* s: B8 H1 J9 z
mov ah,43h( B! c+ e7 g5 q1 ]8 S% w. _0 k% H9 q
int 68h
/ x/ `1 i6 S) R8 I r cmp ax,0F386h+ a+ W! V) J0 x+ g
jz SoftICE_Detected
, X" q; \7 a3 \: S# l! I% K; u, n( A8 T& ~. Q4 J
* c9 w# ~7 D: j: h" Z' d4 a- |. h=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
X# B. y4 Z0 _1 a' Z6 H1 S app like this:% | w5 w$ t! |! N3 ]- ]4 S3 I
* d" q+ U0 a. V6 K% @; @ BPX exec_int if ax==68
1 z( {7 V( P5 e4 ?& {$ v7 _5 y (function called is located at byte ptr [ebp+1Dh] and client eip is5 y/ v9 W) d/ y
located at [ebp+48h] for 32Bit apps)6 m% z E0 f& M2 T; K
__________________________________________________________________________
' r+ `8 M; l% `; r$ \, q0 a: i4 P* v. \) q
W, c6 L% a1 r0 x# {! O' U/ {Method 08, {1 ~1 ~ Y" ~
=========
1 c7 }0 E8 I0 m
* O7 \0 n/ O" QIt is not a method of detection of SoftICE but a possibility to crash the
; r1 ?' I9 H- }1 m* tsystem by intercepting int 01h and int 03h and redirecting them to another3 G' o* U" \3 ` l6 ?. ^2 R
routine.
' W4 x% a* t& @6 G6 r; R* ?It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 ~9 |5 N4 K. o- p$ ]
to the new routine to execute (hangs computer...)
& m& S- w0 m. X+ V; M V0 ?' a7 l; B( b8 B$ X) n9 g
mov ah, 25h& H* I9 z: ]. N( u$ H
mov al, Int_Number (01h or 03h)( T% k( J$ B0 a- K+ J
mov dx, offset New_Int_Routine4 n) V- K) i# ]$ E; R0 K* T5 t
int 21h
$ ^. P& A0 ?: B! ?8 e+ T4 E9 y1 _4 O/ C
__________________________________________________________________________% \- v' h/ o1 ^2 }' U
# N! }9 A# S7 C- ^4 O
Method 09
* ^2 J& t; {$ ]8 B2 V, d=========
5 l) a- Y/ k6 n* V
, T5 y# x& n2 @This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only3 y. b8 j4 r# X& e: n
performed in ring0 (VxD or a ring3 app using the VxdCall).5 c. n A$ ]8 H. I0 X* Q
The Get_DDB service is used to determine whether or not a VxD is installed
! \2 x- b% p$ [% F F2 Q. hfor the specified device and returns a Device Description Block (in ecx) for) ~/ d1 q; Q* L5 s( N/ O
that device if it is installed.1 F/ @* G4 w, L
8 k# |, T& u( c9 D# s mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ t5 K( c3 j/ q4 h s. h mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# `" D8 s* Q- @% R/ P8 I
VMMCall Get_DDB
; k7 T' s! t$ k8 P+ P' j mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed/ A0 g: q, Z2 a- X
% e. s* g% E, S- ~, |7 w
Note as well that you can easily detect this method with SoftICE:
$ b! ]/ M0 u+ m9 a0 b bpx Get_DDB if ax==0202 || ax==7a5fh
& v6 V" e( E2 _- W8 t n: R6 s
5 Y' S' t, g: ~& d% q, [* \__________________________________________________________________________3 y' D' X; l4 C7 f; C. f/ ]
% S" z" f& Y O$ X$ E; _
Method 10
& X( Y' F f, S! W4 w=========
N6 \( S: m. w( p, u
v* K# ~7 l) T6 L4 L5 v=>Disable or clear breakpoints before using this feature. DO NOT trace with
: N1 S) k( u0 P) z4 C" }. u SoftICE while the option is enable!!
3 b7 R( g; p/ p ?" ?" {( H9 y+ B: \* b9 q! Z5 a
This trick is very efficient:2 a7 U y# A$ f0 f' @3 f6 x* m+ m
by checking the Debug Registers, you can detect if SoftICE is loaded
: Q5 d1 f( ^ Z+ k) c(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 x- s7 U+ v8 L9 uthere are some memory breakpoints set (dr0 to dr3) simply by reading their1 j- s' H- o/ v: n; @
value (in ring0 only). Values can be manipulated and or changed as well* M( ^% s B) R) C5 b
(clearing BPMs for instance)
# W7 C4 k: Z/ E+ F5 t1 b" X- q; L4 D" b; c, f( I' Q& F
__________________________________________________________________________9 R( }4 E; ~# b" D; g8 X
l) P) ^9 ?9 G% }Method 11! K* l Z$ ]" r. A
=========- }- J4 u4 w1 H9 T5 @7 R w
- l! S! {# S; z8 o3 W
This method is most known as 'MeltICE' because it has been freely distributed6 f) h) s! c- \8 y
via www.winfiles.com. However it was first used by NuMega people to allow( I: V) r7 {& g% ?5 X' E
Symbol Loader to check if SoftICE was active or not (the code is located
' J6 _' ^( T. P Q+ Oinside nmtrans.dll).
9 F% G9 m$ P' s2 x; U: Y# D6 X* V8 p7 L a( n0 o, a* Y: V
The way it works is very simple:
( d9 W& h7 o* d' r |It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 Z# h2 {$ d4 C3 \" R9 m- q3 MWinNT) with the CreateFileA API.- \4 A o: E0 {6 P
. e1 C" ]$ O. q8 f: S" o3 z/ Z5 `
Here is a sample (checking for 'SICE'):2 D8 T- \# E, ~7 i0 u
3 @9 b2 X8 Z0 f0 E; B5 R" o R+ TBOOL IsSoftIce95Loaded()# R+ T5 e' B2 H' {! w2 Z. [- m+ U
{
; K" j2 V8 p3 y2 I4 A* j4 W% } HANDLE hFile;
. H/ Z" Y' s: J& |# p( H. ~ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
W1 I- }4 z- ^$ p FILE_SHARE_READ | FILE_SHARE_WRITE,
4 { S& s* l0 o& C9 H+ e NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* X9 J) r8 s- J1 i4 } if( hFile != INVALID_HANDLE_VALUE )
+ N d" x' V9 Z {
" L8 ]6 A: C8 d2 G# @ CloseHandle(hFile);+ S/ }9 K" B. Q: O2 f/ m r7 r
return TRUE;0 b# J6 T+ y% S" [; T$ u8 L7 D
}
) D8 X+ I5 F( b' ` return FALSE;
4 f( j5 d9 _5 _( x- B% c+ c4 Y}' Y" C% O8 {+ C4 m/ M# t# C: \" [
. P# k4 W/ E- p- d4 U; O
Although this trick calls the CreateFileA function, don't even expect to be. R3 I3 r+ j+ a D- D' f6 y& t
able to intercept it by installing a IFS hook: it will not work, no way!4 c8 N G7 i; T7 b7 K' ?- c
In fact, after the call to CreateFileA it will get through VWIN32 0x001F! ]2 D. \, `' k+ i
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 `* v6 ]$ |0 v' S0 D4 p
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
! Q) A2 }8 i: E8 @field.
( a3 w; t. K9 e$ ?8 ]In fact, its purpose is not to load/unload VxDs but only to send a
5 T# h& J3 i3 n# sW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 V2 Q9 z; v* ^3 v& Y9 F( jto the VxD Control_Dispatch proc (how the hell a shareware soft could try2 B& Q" T4 i4 L0 L
to load/unload a non-dynamically loadable driver such as SoftICE ;-).- w) O1 A& U9 C$ h
If the VxD is loaded, it will always clear eax and the Carry flag to allow2 W) n% f% ~; B4 o, r& P' b
its handle to be opened and then, will be detected.
7 U2 y- ]: w6 G& T7 `! XYou can check that simply by hooking Winice.exe control proc entry point4 Y+ M. U6 y$ A; n# I: T" ^
while running MeltICE.
' q8 x# m7 L$ }% k; }. S* H$ y: }5 u6 K. n$ ^% {* ~
6 @4 ^8 }4 m7 z- S
00401067: push 00402025 ; \\.\SICE
/ X' K8 o" z. e7 O 0040106C: call CreateFileA
$ h6 J( S7 n$ n! ~" ` r3 H 00401071: cmp eax,-001
8 e; [& j! X" s+ ^3 f' Z; i* | 00401074: je 00401091! }* Y! m' J# ^2 H) ^. f7 V) Q
. Y4 u9 x8 b4 d8 H. G" s$ j0 L
* c0 [- l+ Z$ C9 S/ W' pThere could be hundreds of BPX you could use to detect this trick.' F. U6 ?9 A2 R( r! J8 ^5 Z6 s v/ i
-The most classical one is:
& [3 G$ a3 X% } I$ v6 H BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
7 N, X2 L3 u3 g+ M- D5 v9 G2 l, Z *(esp->4+4)=='NTIC'6 v$ u- m* F' F. T$ {; { c/ I
& e0 O4 A' F) Z' P9 P
-The most exotic ones (could be very slooooow :-(
2 y8 J; o% [5 T4 g: m BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
0 d! k7 L2 O% a* j ;will break 3 times :-(8 m& u6 f8 X9 J! d
' x/ S" R, \- F-or (a bit) faster:
9 p; q1 Q4 u4 W$ ~+ R7 _+ E, `* v BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, f! \, c8 M/ [ J& n* V2 Y
2 X& A4 T; a4 H4 b BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( R+ Z* G' t% j. v# o( W4 h ;will break 3 times :-(
- Y( s) C3 C! X
- |7 [- V/ i! P-Much faster:
. O" {* F( }! I# Z' ?3 B. ~& F" U BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'& j+ z6 x$ t8 X3 n% f& C
& r6 {/ C' C4 N3 y3 I8 r4 [
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 K0 n5 w- ]; A, h2 Y' r2 }function to do the same job:& f" o( |6 M# ] h2 ^% r7 |
/ ]% p H( @/ k, p% e; V1 M
push 00 ; OF_READ
6 C# c) {4 C0 P7 q9 w% n mov eax,[00656634] ; '\\.\SICE',0* x! z4 N' A) G. f0 a. }
push eax
% C8 I8 Q' Z& H D call KERNEL32!_lopen5 X: B8 A9 x+ n0 s7 c
inc eax
3 T- c+ j s6 K, e# B3 X- ] jnz 00650589 ; detected6 N0 N* N# Y; `3 U9 `
push 00 ; OF_READ; @9 n1 ` ]8 m" ~
mov eax,[00656638] ; '\\.\SICE'* j5 B! ^5 R6 j/ y$ ]
push eax& l# f- f$ h/ B/ E# H+ g; j b
call KERNEL32!_lopen& {: Y( C- b1 S8 B4 B2 B
inc eax
9 |2 [8 j9 r$ D6 v: b* M0 o jz 006505ae ; not detected
( y8 z$ B S: h# X7 i4 i% H- J6 g n, \* ]0 y( J: J: S+ C
) o) s. E% O6 S__________________________________________________________________________# y+ w9 ^/ G) m2 W
# w0 R, R6 D" U; ?; v1 I' d. _
Method 12( y9 J3 I. v9 u7 W( n! b" A0 M2 J
=========0 r6 A6 Q" S* Z' H* e) ?
4 p$ ~* I$ |9 f/ |7 o9 C" K* V
This trick is similar to int41h/4fh Debugger installation check (code 05
1 B5 N% o5 j5 x$ [7 Q/ G4 Z& 06) but very limited because it's only available for Win95/98 (not NT)6 ]1 ?; \) J! c% Y' I6 L8 P. M
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
! g2 }; C% y& s5 X4 H' f: e# E3 [
8 x! A- W1 T0 C+ A$ v9 ]+ @1 x& D push 0000004fh ; function 4fh$ A0 @4 K. R9 H7 Y1 ^0 u1 [* q
push 002a002ah ; high word specifies which VxD (VWIN32)/ S- k. {: K2 ]1 e
; low word specifies which service
\& n! p# x' u8 T) U/ q( H& [ (VWIN32_Int41Dispatch)" Y5 f5 e! K) ^# r9 C! ^
call Kernel32!ORD_001 ; VxdCall
$ N* {; g7 b& Q7 I5 P cmp ax, 0f386h ; magic number returned by system debuggers
6 b3 j$ j1 M& \6 b: F jz SoftICE_detected9 Q, h, A# D6 ~3 @' _+ p
( S+ Z9 ^7 s: s& b/ O2 Z( Z" p, `
Here again, several ways to detect it:; U( s/ o& O7 L4 \
8 p! o2 d) }6 U
BPINT 41 if ax==4f0 U. |( F8 X; n7 `' y% d: f8 k7 s
6 T) v) g5 l4 Q5 j/ [% T BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 r& u7 ?* L9 q' j7 Y8 \
0 u3 ~$ p9 p3 k7 I! w Z& h+ w5 a BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. A3 x p* B. a2 q& z
8 ~: Y# m7 R- v/ q$ V BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- l1 x% O$ [- y; [; r; k
, M* j7 l# G3 z0 S7 K__________________________________________________________________________/ g- a, a% t( T( T' z. S
. O5 W5 _9 }9 f; |* q$ N1 L) k3 k# d: x
Method 134 u) l: K8 w* H5 j f: r
=========
8 a+ t; ?9 v$ O( q& j
- m8 O. a7 A% u, e" iNot a real method of detection, but a good way to know if SoftICE is
( r* Z7 M1 b w" |installed on a computer and to locate its installation directory.4 T! J4 C" l% N8 _6 G
It is used by few softs which access the following registry keys (usually #2) :
; x9 f. J3 E9 U' J4 N
! l7 |% V) _4 @+ d/ l3 t. a7 W-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 o) B$ t! C5 x- | d1 p
\Uninstall\SoftICE! q n& X' n* I1 I& Q- @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" g# y/ l }0 z7 j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" P0 f4 x C$ I' _, {0 W\App Paths\Loader32.Exe8 C( ?4 q% A$ G0 M/ d+ `7 k
& ^1 p9 f0 I4 m* c/ P, K3 D8 ~
9 K7 Y3 r( l5 ^, y0 xNote that some nasty apps could then erase all files from SoftICE directory
6 ^/ C* J$ h: S7 U4 T(I faced that once :-(0 K1 n; W3 y$ j1 I
! d* Q; c* e8 b3 ~7 s
Useful breakpoint to detect it: @' B9 V! r% G
& J& \. L8 h! i5 @, ?% A BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
a9 n, Z* r) H0 J6 p$ S& l& X4 o4 I; c3 X$ O% G4 X7 }: u
__________________________________________________________________________
: N; e$ V7 A R: v1 u
) {+ T. p2 p. b! S! c/ [- _; R. N A. W2 L9 t: p& z; ]' \
Method 14
+ |# D) F+ z5 j=========
8 x2 a6 c- L7 L0 Q9 R
. I: G' M; I4 V6 [, z% DA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# g) c$ B( Q- R
is to determines whether a debugger is running on your system (ring0 only).
1 s+ `" y4 S( ~' k: L" a8 G3 a+ c6 W; p$ \' V
VMMCall Test_Debug_Installed
, Z9 s8 V3 |7 a% S: t/ w& [( k- H je not_installed
9 U! q; N1 g: g2 H3 D
* J/ H' R" J9 N: ]+ i( IThis service just checks a flag.( |# g+ m9 t5 c, p
</PRE></TD></TR></TBODY></TABLE> |