<TABLE width=500>4 h' a0 C3 _% [6 [
<TBODY>9 J) ]7 c. d- a; ?( f
<TR># J( T# w: l7 F( {% k
<TD><PRE>Method 01 " h! j5 c: n/ N# X
=========5 ?1 o" ]4 ~9 C, {7 N1 I
) A* [& t$ e. ]
This method of detection of SoftICE (as well as the following one) is( L8 j- s- S6 Z$ f3 A8 l% E* z8 M
used by the majority of packers/encryptors found on Internet.) a6 m6 u+ |5 v) ?2 T) l
It seeks the signature of BoundsChecker in SoftICE
j( w; a, r: n2 w0 d
1 Y* U4 ~# J( l" Y mov ebp, 04243484Bh ; 'BCHK'# N1 i- v4 ^* H
mov ax, 04h
0 J+ ~% Y @. s int 3 ' Z$ E- X& E5 U# z/ r
cmp al,4* T- [7 R, ? E+ G0 m
jnz SoftICE_Detected5 m; }) p O7 w3 u6 Q6 Y+ q
; ?! e4 o/ w4 n$ L- z7 p: |: C* I
___________________________________________________________________________' W" U7 G) _, |$ z
; H- z5 D1 o# g5 S1 u* O
Method 02
# u5 |% R9 h8 ~0 ^6 z=========
* v0 t8 P7 J7 j% U; }0 y$ O9 T
2 I& U8 i8 V z; W9 ~0 }Still a method very much used (perhaps the most frequent one). It is used& J/ r2 l3 `5 |" Z* F8 M4 E8 T
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
& k0 x/ X. P$ t8 L" _; Por execute SoftICE commands...1 w. a" O, G$ O3 I$ @$ }, E% F4 J9 L
It is also used to crash SoftICE and to force it to execute any commands
/ F& [- M' v: A' E+ b- m(HBOOT...) :-((
' L6 e8 U; m# H" L& K" m
4 g- i/ P0 E) l% ^2 Q; @Here is a quick description:* ^ \/ m* Y0 C0 ~" t( l
-AX = 0910h (Display string in SIce windows)
( X3 V, ?: c0 G( |9 V. m-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
9 M; U" P1 H C$ g& V-AX = 0912h (Get breakpoint infos)
1 a! ]1 |4 @) J/ _& [-AX = 0913h (Set Sice breakpoints)4 |2 n( B6 H* c3 }! M
-AX = 0914h (Remove SIce breakoints)
j# Y H- U U; q+ ^' j$ I7 E" W/ ?; h8 i7 C
Each time you'll meet this trick, you'll see:/ h( l3 a& |9 d7 ?1 }! o, Z
-SI = 4647h0 y. u3 C( P c8 L/ v
-DI = 4A4Dh- x2 ?* {% W. r- S* t) `4 J
Which are the 'magic values' used by SoftIce.
, P; M! w- g& A$ lFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 v' S9 f0 d- O' E
# m/ t- i" P& D. B
Here is one example from the file "Haspinst.exe" which is the dongle HASP% L8 k" t) k9 J( a% [& V6 o' V
Envelope utility use to protect DOS applications:
* n' m: j0 S1 s1 e" P8 f- e/ P4 L9 j! Z/ J3 a
: @2 {3 V. `) n) o# y4C19:0095 MOV AX,0911 ; execute command.6 I6 C* G3 k1 V
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 i; x" W" h Q, c" j# S0 N9 P4C19:009A MOV SI,4647 ; 1st magic value.
5 _4 L' n2 b' A, `+ V6 A4C19:009D MOV DI,4A4D ; 2nd magic value.% O5 T" i0 Z! ~8 i2 }# \: j2 r- g
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 L4 l1 F1 D3 j4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! q0 ~2 D: X5 A8 b" ?: c
4C19:00A4 INC CX. V _+ _7 g7 r2 L8 M' Q6 O
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; Z5 T( I3 Z6 ^7 h4C19:00A8 JB 0095 ; 6 different commands.+ Y. C1 Z0 M- I6 n2 C
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* E x. y v2 k/ [$ {4C19:00AD MOV BX,SP ; Good_Guy go ahead :)6 p; h* a* k$ v; Y: _8 e
& W& C( i) J2 C6 B# U/ F+ l
The program will execute 6 different SIce commands located at ds:dx, which6 f. t" L c/ j" N
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 _% x8 b: q8 H
9 T, y9 k, e% l7 O; _1 b& h
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( k/ L7 H7 D5 W9 W
___________________________________________________________________________
% n; x; |* i$ O5 _ A9 m: Y; R
, y% L, n2 Q4 Y, k3 O% g2 `( Q7 g1 i1 h( F: s4 n
Method 03
$ Z7 A# A; z) Z$ \, P=========
! e0 c5 C& [$ l. r! m$ G) I, v# U# O3 e$ I6 [; f
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! g! M {* T7 u t3 J9 O$ M(API Get entry point)
& a. l# R/ ?1 g- N! H( [0 i - X0 H/ Q: Q! \
( z A( \* B) F. J# ^
xor di,di* P1 r( i, I! [4 x
mov es,di
$ M+ h3 Z8 x ^: s$ i mov ax, 1684h
6 X# A; g$ W5 t: R mov bx, 0202h ; VxD ID of winice
" n" @* _4 { _ G4 i( U int 2Fh6 Q8 q) r6 e/ F( |1 L
mov ax, es ; ES:DI -> VxD API entry point# d2 l& S* @: {( e
add ax, di
. {$ S7 S) H7 c test ax,ax
3 X: j) x9 m; `; O! `3 G6 E/ C) ^ jnz SoftICE_Detected- |4 Q' B8 f- L" E T4 l
; Q% l+ w- z4 g# P$ |___________________________________________________________________________
( I" b; d: {4 y) T6 i
7 C* M; }; l( z9 FMethod 04
/ S1 W$ G3 m; I4 L/ N7 Q7 O# m=========
k" b9 f7 M- j# f9 ~2 s) E8 L5 U
Method identical to the preceding one except that it seeks the ID of SoftICE
6 S: [2 y8 K+ B% ]7 z( `GFX VxD.
# c# b9 H. J# m. F! L) X8 C& Q& U& ^
xor di,di
( N& O8 o9 ~* u mov es,di
) q: P; F8 q- f' n: I3 a& n mov ax, 1684h + Y$ Y/ H3 ]. q7 b( I# |& z" B
mov bx, 7a5Fh ; VxD ID of SIWVID
3 v% V) h- F9 q% I2 y) Z int 2fh$ ~6 S$ }4 y3 n& G `
mov ax, es ; ES:DI -> VxD API entry point$ p' K: C3 G3 t G
add ax, di8 Q8 H2 X, n# e0 l
test ax,ax
& Y# B/ o- h& t, G# k jnz SoftICE_Detected
+ O2 O4 f5 B d% K" T3 V( |, {
2 l) V3 l! @+ i. R5 x5 F9 B__________________________________________________________________________
& r' Y$ u/ n5 Q# s2 I2 \& h4 ?% r2 R; m2 q! m o9 J3 \1 E
9 B3 G" B- P. ? f3 `Method 05$ G: G, g9 N1 Y" }6 Y4 o3 J8 w
=========
* r% b5 T6 z9 A6 p) b# ]/ w. ~' M& u; W' s
Method seeking the 'magic number' 0F386h returned (in ax) by all system; G8 w2 ^3 c/ b" l- S
debugger. It calls the int 41h, function 4Fh.6 C0 A2 N m' L9 m% `; {( `
There are several alternatives. 5 v6 r2 r& F$ j6 R
8 q" U5 j7 [0 J9 [/ UThe following one is the simplest:
/ k" B' w, P; o0 V; Y2 Z+ B6 b
1 k/ z( g& W- \2 f4 T mov ax,4fh/ `! U5 t5 W8 F$ d/ f* h9 }
int 41h0 L! p4 P, P* L
cmp ax, 0F3868 t- r' T A5 C( H
jz SoftICE_detected6 _2 y7 S" i$ A" X+ B
6 `0 j' y! ]" h/ f6 D7 v+ }: [4 S
8 y. Z$ C/ N z% W+ |* P) \
Next method as well as the following one are 2 examples from Stone's 2 [2 j |0 M9 C3 T. G
"stn-wid.zip" (www.cracking.net):# G& ^- n! ?! Z/ {1 D* ~& @# J
' V% V) R1 Z. m5 C$ C mov bx, cs; `' n4 R- e5 E$ V7 F
lea dx, int41handler2
0 }. x+ o% p1 v9 N6 C/ V. n xchg dx, es:[41h*4]. ]# |" @1 l. C6 i
xchg bx, es:[41h*4+2]
# K! ~, T' k2 p* {4 B) W- L! Q# ] mov ax,4fh @9 j) V7 v2 {0 M
int 41h) F, c. r( K" ~ p7 K
xchg dx, es:[41h*4]3 n4 h( o% j, X! y1 p! [& p
xchg bx, es:[41h*4+2]7 N) J' t4 m( [! v- \. @
cmp ax, 0f386h% j( u, z" X, S- y9 u0 |4 @- A
jz SoftICE_detected$ I; {+ L/ B) E
4 r( J* g5 T& l5 q8 `
int41handler2 PROC
7 ?0 a/ q6 z4 b& }, u iret; u$ _ ^2 @! v# H( F3 V6 ^
int41handler2 ENDP5 N8 ~ E& }: X# m" j
" x# \/ M% j" v; J! ]
f; X" U0 b6 ]0 B_________________________________________________________________________5 ^2 w: Y0 V$ f
% T! l" R% A7 c; e1 o* Z' {
* Z* k" V/ j; R4 `Method 06: F$ I4 u, i, y" O: [$ J
=========
7 N6 q+ s- W8 N# U
0 ?: k, `/ d& I# w
& F7 X! L. \4 j# d& E2nd method similar to the preceding one but more difficult to detect:7 b8 D) \+ ^; D$ {5 `) d+ D0 ~
4 I# e& T4 v& B4 I2 v m! j( V1 H: \# u
int41handler PROC' M) Q5 f1 p0 H! p
mov cl,al1 x" k2 A [) W+ L @% x
iret
. S1 u, b7 x2 l5 F/ I: l4 @int41handler ENDP- l' L% }: t, \8 P6 c
9 u7 F4 b0 F& Z+ k
, N3 \% {" B4 O, S1 ^0 v! q. ] xor ax,ax; }9 d% W& v- h& I0 v
mov es,ax
, R" a* y" V/ D3 ?% H mov bx, cs
1 m5 i6 U, Y0 Y" F lea dx, int41handler: \+ R. A/ H+ r2 B6 Q: u
xchg dx, es:[41h*4]7 f* w. J8 l; B" P5 n% x4 o
xchg bx, es:[41h*4+2]& t4 w/ k' {" \% c3 r) }8 \ f
in al, 40h
' h! y0 e9 w" ` xor cx,cx
1 I! Q+ Y) c0 l. x int 41h8 _+ n0 ]$ `" H% o
xchg dx, es:[41h*4]
$ B2 }6 C: S# }& G, T xchg bx, es:[41h*4+2]
" t6 T# G0 m' {9 X1 D& v cmp cl,al
$ `; Y" p, p0 o jnz SoftICE_detected
/ C8 r1 l1 ]9 y: O7 {/ c8 p3 D4 p9 a0 z! a' v2 c0 F
_________________________________________________________________________) I, P3 C* p% u+ M' {% c& I! |$ {4 U
/ p' _3 N2 c* G' r4 WMethod 07( K2 r3 \8 j6 s3 K6 ^& |( ~
=========0 Z! d& _& J4 q
7 h9 d+ T& y! Q& M( O) ^! w" J/ K
Method of detection of the WinICE handler in the int68h (V86): p: ]1 W6 \9 U7 n" Q
" K2 f2 F! y4 \2 c! h* L( V3 i0 p
mov ah,43h1 e, Y. v$ d$ ]. m$ e) I) ]
int 68h9 [: G! @8 n$ W( E+ N. p8 L/ K
cmp ax,0F386h
4 Z. a2 ^0 P; H8 k+ f jz SoftICE_Detected
! G- [- ~! }( M; c) i, x9 E, t/ [& M
% N+ }7 W( y/ }3 Q) g# v
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: |7 p& i5 _; p3 W% B app like this:
; Q& O0 V5 K4 E: U) ~- J q, h( q8 y' W5 q
BPX exec_int if ax==689 e) \. A4 t; r" |+ B# f
(function called is located at byte ptr [ebp+1Dh] and client eip is! O1 f' O7 G% k9 f. o
located at [ebp+48h] for 32Bit apps)
# v$ W" Z. g! C$ Y0 K__________________________________________________________________________
% _( z! E* A' O( ^
# e( `& [! k* b% R" l% v1 ?/ F2 D+ K @' g7 A, E8 h# d% @
Method 08
" V! f+ d7 v6 J% f) H3 c4 |========= R' X7 j5 v: R/ x9 G- H+ o ]/ J
) A8 a" F& ]2 K4 g A9 q
It is not a method of detection of SoftICE but a possibility to crash the+ @( T4 C- U& k; T4 _9 Q- E) r
system by intercepting int 01h and int 03h and redirecting them to another" V0 p' v) _' R9 K0 g; r! R3 V* E
routine.0 ]) O4 G6 Y |5 J( K9 j: s
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points& v; _: b) W7 R( o
to the new routine to execute (hangs computer...)2 ]% U% g6 c2 k9 X! A
. b: q- h, G+ O( R$ d1 b- ^
mov ah, 25h0 `3 V' Q; j% ^0 k( p: P1 o
mov al, Int_Number (01h or 03h)% j' w' m$ k: ?3 |
mov dx, offset New_Int_Routine0 q2 |, ~* W) z B4 {# p
int 21h! F2 \% a8 R1 u+ y5 C
2 t( g( N- R2 W3 ~__________________________________________________________________________
, R. s, d) z) {( \& |+ m
" _0 e& \# \( c* V: iMethod 09( B% o K% F! [- C+ ^5 a& {! M# H9 X
=========
1 p( Q/ B. I( U! N
k5 y5 W5 Y* r6 ]8 H+ z; U* F! f' n# lThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only M7 @* `" ]# g7 m, ~3 u1 \: V
performed in ring0 (VxD or a ring3 app using the VxdCall).
- V9 R8 i7 f7 O$ g4 YThe Get_DDB service is used to determine whether or not a VxD is installed
! M) X( S7 R7 A/ n4 V/ w7 Bfor the specified device and returns a Device Description Block (in ecx) for
: ?# u9 M' ?& @5 |1 Fthat device if it is installed." U9 o2 Z) z4 y6 [& V$ P, T5 ~
5 `3 a! V9 r$ g/ }# c, y* X) D3 f0 d5 A mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! Q# b6 Y) K6 r( e mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)" ^9 L* D7 C7 M+ \; T; k- o( V; r
VMMCall Get_DDB9 L# \" V! S- J; _4 g
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) C' e' `0 L+ ?8 p7 b9 _1 l
3 Q. J7 R9 K* @- CNote as well that you can easily detect this method with SoftICE:; i6 x) D! e7 c6 p9 T% E+ ^8 Z3 U' r
bpx Get_DDB if ax==0202 || ax==7a5fh. N! F* T4 s! h+ _, F
4 u9 P/ d4 ~$ Q6 N; X* z
__________________________________________________________________________
) |+ E t' l2 Y" s( @. y) F9 Q$ l! `+ g5 y+ P
Method 10, ?3 X; |+ X3 e# C
=========$ f4 l* K. _$ _, k& @% f
" \$ G& H# y1 q: Y# b; L/ ^/ j) N=>Disable or clear breakpoints before using this feature. DO NOT trace with7 S3 m3 s2 b- Q
SoftICE while the option is enable!!8 j2 h) H7 t7 ^. e' n$ O7 W
& Q7 w$ q: y i3 ~# \8 k) F* t
This trick is very efficient: F5 I% o {& e, P: B+ \2 ~
by checking the Debug Registers, you can detect if SoftICE is loaded
0 ?% z0 C5 A" q5 |, N: \$ }(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
7 i& S, I+ u$ w Dthere are some memory breakpoints set (dr0 to dr3) simply by reading their
* ?3 t9 Y8 u+ M! E6 A3 Cvalue (in ring0 only). Values can be manipulated and or changed as well N ?, \0 L o5 f( u
(clearing BPMs for instance)
8 R7 @: W5 f5 z' ?& K/ J5 x: X3 N) w
__________________________________________________________________________
9 M( l% k3 V; Z) _) v
/ r7 g# q: a8 tMethod 11
) Q5 R- O3 C$ E) n1 S6 p=========
* t. N" t9 o. e; ^7 X i: f; H, x' a% ^: K2 ?' g% a
This method is most known as 'MeltICE' because it has been freely distributed
( j+ X, x0 y" [0 I! \& s$ p0 _via www.winfiles.com. However it was first used by NuMega people to allow9 Y6 |% Z1 ?% ^4 I$ e
Symbol Loader to check if SoftICE was active or not (the code is located
$ J s: f' A7 k% Y& r# Xinside nmtrans.dll).2 ]0 v1 a% _2 E# F5 S2 E K
z) k- R) Y U" {, G3 [
The way it works is very simple:! @1 x7 J% i$ N% h) {6 N
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% O4 I0 `( |4 F& H6 ?
WinNT) with the CreateFileA API.+ u) t8 N1 ?8 V# q3 u
& Z2 T" h$ s4 p5 x# BHere is a sample (checking for 'SICE'):0 @+ x1 @$ _1 V H6 N% ^# l/ `
4 t A8 I9 A. X* N# k% W# B( z8 t
BOOL IsSoftIce95Loaded()" g8 ^5 l/ H6 [" Z5 |3 k' B* N! ]* {
{
1 x8 m3 y$ m0 R: C1 n: e HANDLE hFile;
9 ^% K! c8 V: [$ L S hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" J9 K L v( E& {; \5 d0 D9 p) c* p1 N FILE_SHARE_READ | FILE_SHARE_WRITE,. h4 W, f% t& I5 B% ]5 l
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ j, a5 u+ e, z( O0 w
if( hFile != INVALID_HANDLE_VALUE )
$ t' n P. c7 r5 m9 ? {! q: H5 B& s2 I
CloseHandle(hFile);. J' z4 ]3 K* u& @4 }
return TRUE;$ d* J0 A; F) b) }
}
* l" d9 R1 _$ p- k, Q2 }% [ H return FALSE;
1 G" o: z' K; ]}
" X; X' @" F: x3 Y; k( Q' c
0 l6 Z+ `5 B' F( [0 `5 aAlthough this trick calls the CreateFileA function, don't even expect to be8 \3 J t+ J) g# S/ D
able to intercept it by installing a IFS hook: it will not work, no way!
- n* ~" Y0 }, B+ s2 m& eIn fact, after the call to CreateFileA it will get through VWIN32 0x001F+ K, c( x8 P4 q8 \1 E
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) I% Z0 Q8 z' p5 i! V) o
and then browse the DDB list until it find the VxD and its DDB_Control_Proc; _* }8 h8 s. ]5 F: G1 H
field.4 x. B1 {' a6 L% r% V
In fact, its purpose is not to load/unload VxDs but only to send a
9 j5 m+ _% H' a- ^ _W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 N' j8 M5 D2 d! qto the VxD Control_Dispatch proc (how the hell a shareware soft could try7 o: f, W5 S4 M4 v8 Z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 ]$ e) x+ o3 [* IIf the VxD is loaded, it will always clear eax and the Carry flag to allow& a( l4 e* p3 |9 o
its handle to be opened and then, will be detected.
9 s' T+ W/ x* D( H* q$ S2 FYou can check that simply by hooking Winice.exe control proc entry point8 Z1 L; ]& T6 f- m3 ?% j+ l% z
while running MeltICE.
0 h8 R' X4 d; R# p: ]* t; b% r9 _* g) e
6 S. M+ b4 d9 J) r 00401067: push 00402025 ; \\.\SICE
5 i3 @, ^0 c3 d. M B2 c; Q 0040106C: call CreateFileA
' X) h0 F- c }2 A, y; ^ 00401071: cmp eax,-001
k* m+ V [5 J" J& ?0 Y+ n- q+ ~ 00401074: je 00401091
3 d1 w2 v! ~ I8 c, l) M) B* l0 F& r; M& M% h) }2 ^5 A
' j; ~. n! y: X5 _) E% }There could be hundreds of BPX you could use to detect this trick.8 z* E' G% A$ h2 J* h
-The most classical one is:
1 H- O4 O2 e; G- z BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* A9 |) j& [1 ^
*(esp->4+4)=='NTIC'/ A/ A3 J, g8 t6 \& u
$ n3 Q2 `& y" t5 i
-The most exotic ones (could be very slooooow :-(
( L( w" P- f4 H& y5 ]. ^# z! l$ j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
3 s; t1 j1 U9 E8 m5 V ;will break 3 times :-(" @5 [8 H4 z4 J# M" M. P
2 @$ T6 g/ k+ T7 W: z; q; n
-or (a bit) faster: 9 p) Y8 p' b" a# X
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): l8 q; t: q) m( i T, I
& W1 R, m3 | e) `
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 h8 O; i' Z0 J6 k+ f+ ]) {
;will break 3 times :-(' {, S2 Q/ ?) e7 h
& l# o: Q4 x) |. n% N-Much faster:
# x7 c% ?/ _1 y; w, Q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
& k( Y5 E# S# T1 A9 a9 R4 e; Z+ o) u( N* `5 p$ d
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ E8 Z& ~' d; j, m; O! Pfunction to do the same job:
; [* L- `/ m3 l2 F$ K/ ]* W
$ |6 ]5 k/ |; G: `% }0 z push 00 ; OF_READ
, L1 U" C' f7 m' o0 e mov eax,[00656634] ; '\\.\SICE',0- G) r# |/ Q, o @* I
push eax
6 E: d8 \* C& A5 y8 m call KERNEL32!_lopen
; l! v6 n; w% ]) r- k. M inc eax
$ p" i" H% n6 p3 \( \2 h8 Q jnz 00650589 ; detected3 ~7 {" k: p4 i6 F, M: H# w
push 00 ; OF_READ L9 O2 u- t9 s- U9 q9 y% H
mov eax,[00656638] ; '\\.\SICE'
% J/ N/ F; x, S1 C$ a" q( d push eax
: \* o2 y3 W1 Y% \8 C! s2 V& Y call KERNEL32!_lopen3 X8 E- J$ Y7 {) x2 J4 D1 e
inc eax
' u- ^& L' l0 ]) { jz 006505ae ; not detected
: K3 @ N7 @3 l# G9 R4 o
& w3 t/ s$ ]* E9 N# C6 K& T4 j
& s' }3 k: [) ?* m__________________________________________________________________________& x; [$ K; T; ~. @( U! G
2 ?3 l$ o& @; ~( ^3 w0 A- Q" YMethod 12 F9 ^% ^1 k) _" A$ ?$ P: V
=========3 n: @( r! p- I8 G
/ s/ e6 K9 u# gThis trick is similar to int41h/4fh Debugger installation check (code 05" G* N( w2 |0 r/ k$ M$ T/ n
& 06) but very limited because it's only available for Win95/98 (not NT)
* K3 M& O7 f" ?/ x* r. nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 |0 ?0 O8 K- W. {2 W
, ~8 t8 n0 l3 {( t push 0000004fh ; function 4fh
* S" y2 O4 _. ~2 m3 Q4 B* t push 002a002ah ; high word specifies which VxD (VWIN32)
6 r5 j# I- W% l( \' y* i+ Q+ D ; low word specifies which service% n T0 k- u$ n1 C
(VWIN32_Int41Dispatch)
; T: A6 {' a0 B# D( G- {4 i call Kernel32!ORD_001 ; VxdCall, @$ w0 O- A2 ]/ {2 M. H/ O" _, y
cmp ax, 0f386h ; magic number returned by system debuggers: Y" a8 q6 t% F3 u) Q) r
jz SoftICE_detected- ]: Q( t1 W9 s7 T5 H' Z
$ P% y6 R* ] ~4 F& I2 G
Here again, several ways to detect it:1 I3 u( ~ `) `3 J5 U; Q/ f7 w
6 M$ L) ?0 ^) `$ ]3 F1 \9 W' f
BPINT 41 if ax==4f. C! Q n0 y$ v. r
" ?2 q& [' M: r X
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one& u0 t `! g6 m5 }: e6 f& ^
; V2 _2 y+ N j; w# Z) ~- N0 Q
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A+ O$ B4 r# p3 W, @3 s4 J1 v
# ~+ ?7 l7 j7 s0 h; N0 I; t BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
( a1 }5 o8 q/ H! h+ r2 Q! ~7 l5 R+ L4 {- d5 C2 ?
__________________________________________________________________________- f' x O5 w$ [8 v0 z4 I. ^ g5 ?
! @2 w* X9 ^& F. ]9 y+ m
Method 13
& L6 L0 x8 W9 c=========! C4 j' m3 D6 J% E2 y
+ X6 v3 P) {7 m; ^% v
Not a real method of detection, but a good way to know if SoftICE is" m; h$ m4 q7 F6 H3 L2 m5 L4 J
installed on a computer and to locate its installation directory., q! V! x- d' {" W) B- S1 S
It is used by few softs which access the following registry keys (usually #2) :" P, z9 {1 X$ R( N$ Q
9 f; o/ Z% D# i p( [
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 I9 i1 Y1 e4 }! Z
\Uninstall\SoftICE
/ w- Q- Z1 }8 B+ ~; f-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 D8 x% d7 S# p1 T+ }- d" I-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: M/ Z5 e) `0 b- ~8 m
\App Paths\Loader32.Exe
4 M' A% t* k3 B1 @) x! ?7 h
% ]* u6 ~( P2 _5 N+ k( S& K- g( L9 X7 T" u& \3 Q0 H& f& q$ J
Note that some nasty apps could then erase all files from SoftICE directory) a1 }! i+ B' ~1 ?6 ~
(I faced that once :-(: {+ p) }' p2 u( k! V/ f& |0 h; S
) R' Z, U* Z' v* ^Useful breakpoint to detect it:/ L" a& j- O# T( C: [/ |9 E
0 t' }/ @2 y/ E, X0 k BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'9 [# V$ R2 X' p
9 K/ Z, b1 C h3 L3 `% C0 h1 Z__________________________________________________________________________
5 S! x: `* i7 D0 N+ P2 m( s% Y. r+ M; q1 S
/ p7 g) c6 d8 |4 @ v, p$ E
Method 14
5 U$ n {5 M' ?: Y& [# W0 C/ c) h# b=========, w c' s* b7 q" _
1 j3 K$ L. O- `# N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 a# k8 \, z0 m Y! g* m; ]
is to determines whether a debugger is running on your system (ring0 only).
1 r' ?) j1 i3 F+ ]7 k
3 B- M- i1 P' \6 g O: H; R VMMCall Test_Debug_Installed" U# B( a+ D7 \+ d# j A! \
je not_installed
. e' A1 R# G& w/ P# T4 E- U. v& h! Q& x9 D1 S% ~6 t
This service just checks a flag.
. N2 a9 `- e3 W1 W' G7 S* t* p</PRE></TD></TR></TBODY></TABLE> |