<TABLE width=500>8 J+ ^6 |+ H* S" K
<TBODY># ^9 r. d9 Y9 v9 B
<TR>8 ~9 d% I0 z- w' k8 D# K
<TD><PRE>Method 01
J O- E% l+ M. X4 l H=========
5 i: l% y$ B" ^0 B& }) a' G( A# V# B6 p6 R4 U
This method of detection of SoftICE (as well as the following one) is% S( R1 c" V, h. A7 j5 v3 F
used by the majority of packers/encryptors found on Internet.
* ], M. b' ~% A# d3 S# R4 m* KIt seeks the signature of BoundsChecker in SoftICE
' K* ~ d- }) l* x+ l
" ^% I+ _: f% d8 g6 n. l mov ebp, 04243484Bh ; 'BCHK'9 ?, G' {+ V$ M/ ~8 n9 a
mov ax, 04h# Q) A, A( S* P( X% |6 Q
int 3 ! I# v+ u' I- Y p6 K" M1 I
cmp al,4, p3 R. p: N" G! I% ]2 b4 G
jnz SoftICE_Detected* `& D; v+ {# w" `" u1 w. p
7 |" A0 p" `$ q1 w6 A* l___________________________________________________________________________
) K! l0 Z) m/ p) _( b1 A D0 j4 x5 |2 m H/ J+ Q- Y1 R3 g
Method 02
6 t8 U. Q1 l1 v, B=========
v9 u* B- g: _ J& `
* Y: c2 R. [' aStill a method very much used (perhaps the most frequent one). It is used: C* O& H* }& H4 X
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,. I5 e; V$ G1 o0 {$ { W1 W
or execute SoftICE commands...) T) L. L# E4 Y' l2 n
It is also used to crash SoftICE and to force it to execute any commands8 \) k3 V; d0 w% `+ P# S
(HBOOT...) :-((
" g0 p1 O/ Y h5 F! Q! f4 V( k* E& F6 Q' F0 p3 p
Here is a quick description:
; U7 P$ N, Z# w4 V3 n1 r. @-AX = 0910h (Display string in SIce windows)5 t! T# Q' A- y$ v( a( T) t
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)1 ]. T, ?' R9 I# |
-AX = 0912h (Get breakpoint infos)9 a$ \: a8 ^; C6 g
-AX = 0913h (Set Sice breakpoints)0 J/ n. s A' o! n) |$ \' {
-AX = 0914h (Remove SIce breakoints) S/ h3 }( r' E
" c; m I, w; a+ E, S
Each time you'll meet this trick, you'll see:
9 F/ o. V- N# X, B-SI = 4647h
1 g" T. Y+ F, n. v4 H: p4 L-DI = 4A4Dh% [6 o3 m0 e6 z4 B! O
Which are the 'magic values' used by SoftIce.! S1 Z' _1 a5 C* w5 b2 T6 J3 ^% n
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 S4 ?' r) o$ y1 M8 g, ~, G
: D; a F& ]' t$ Y, `5 I5 d0 y. ~
Here is one example from the file "Haspinst.exe" which is the dongle HASP
: `0 j: p8 o. @' q% z' iEnvelope utility use to protect DOS applications:
, u) @, h5 I4 \7 s, F8 Y6 a g8 x1 K" g" z7 Y% W0 K, w# Z' e
" r# o- {7 z+ `4C19:0095 MOV AX,0911 ; execute command.0 q; y* C. K. H) y; O7 p4 V0 M
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).+ ]4 ]! W: B# g0 s3 ]
4C19:009A MOV SI,4647 ; 1st magic value.
' p W, T' O( j; N5 m& d J. @4 ]/ P4C19:009D MOV DI,4A4D ; 2nd magic value.
4 Z0 L1 _3 F2 v) q ^) i4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 o" ]( p9 f& H U$ f% S$ `/ S4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 A3 F* e- Y& \
4C19:00A4 INC CX
! H# j/ D0 w6 {6 p& b# `4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
|8 z+ x) T$ B2 D8 r4C19:00A8 JB 0095 ; 6 different commands., o* a2 l& J7 [ C6 A
4C19:00AA JMP 0002 ; Bad_Guy jmp back., {0 ]5 E& Z% B) p) d- B4 R
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ g7 C' w# j$ m* C& x5 I; Q6 B3 u: g, `
The program will execute 6 different SIce commands located at ds:dx, which a! b, j9 q3 Y. U5 i* {* f
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 O l; \9 J/ c$ B/ u, m1 c z8 B2 k
7 l; P* e/ u4 g1 j* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) {6 R6 z6 \, ~7 P6 c& G6 @! A# z- {: r___________________________________________________________________________! }8 G. U. \9 L$ _7 c& {
4 x/ I, L1 \0 F% B
* @3 f0 I. l# ~ ?Method 036 n) h* B( S& P3 k, ^. p
=========
2 l. a+ R: b$ g! _1 N
7 p7 ~! ]" `# r# m C& p. \" YLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h i# ]- q# ~8 ^$ Q
(API Get entry point)# |0 @; S9 q6 K
* l% G! F' a# u9 a
7 Y6 O+ Q: g; }; L5 t# Z xor di,di6 X. f v) p7 I+ N0 c7 L$ W. U8 b
mov es,di( D, d5 X3 d: z& N- S
mov ax, 1684h " w/ \. G, ?$ U9 [8 R4 p5 D- g; i
mov bx, 0202h ; VxD ID of winice
, d" l/ N# @3 P# _. a. ~6 R* h int 2Fh2 a- v k. {0 j7 n
mov ax, es ; ES:DI -> VxD API entry point. M- [9 C) |+ \. Y, m
add ax, di" s0 C6 V4 ]: Z( ]' w+ s! L$ s
test ax,ax
( {0 w% m- i, L9 k" d. x' F5 F) e jnz SoftICE_Detected$ n, X" C9 Y# b3 t
6 } U8 r$ c/ C9 U7 }3 I
___________________________________________________________________________, k9 b0 z6 h5 Q( X) V( m) ~
/ {# {* B# F5 U# ~ ]9 {8 U5 G) u' h
Method 04' F6 x2 b+ Q% Z; J0 E7 L
=========# i3 F) M9 F* U, s$ c* {
' N$ u2 ?7 k k) g: ^1 `
Method identical to the preceding one except that it seeks the ID of SoftICE
9 k: f; H& |+ R' k j3 IGFX VxD.% o7 G7 ?3 \ t* O1 Y7 w [
9 Z c0 j* W3 E: y
xor di,di
$ q/ N8 n- p) S, O3 E: Y9 N$ F mov es,di
5 l$ I* c6 j- E. Z5 [$ j( f4 u* S mov ax, 1684h d6 v9 i3 S( v# u4 Q
mov bx, 7a5Fh ; VxD ID of SIWVID1 V2 P. M, t4 t. Q
int 2fh
; p; }4 @* \9 a mov ax, es ; ES:DI -> VxD API entry point
]2 m- t+ g, B7 T1 s l& X/ U- e add ax, di
* `5 W' n! E2 j6 ~( d9 g" b( a test ax,ax
7 F' q; m6 w$ X jnz SoftICE_Detected8 l. X4 h" ~5 {$ B3 B/ Y
6 r2 D7 y7 J* _4 S$ y__________________________________________________________________________; C/ [9 P2 ^$ }1 x/ \/ Q
. a4 R6 f: R) g9 s& x% K1 Z
0 |2 m2 o1 o' w
Method 05# p% H% }) s6 ]4 B4 J2 P
=========
" C) r/ b ^9 ?: o2 d- R: `$ f, ^
7 f7 K% X, @3 \2 U7 H5 F$ w+ T5 K1 YMethod seeking the 'magic number' 0F386h returned (in ax) by all system
) o' a7 C& L+ ?6 o/ o2 P- A: gdebugger. It calls the int 41h, function 4Fh./ g. Q& k. p/ G% N, x
There are several alternatives. 0 P9 V. C2 c- T9 A+ u, h5 O9 [
( p A0 s5 ~$ d/ F
The following one is the simplest:( N; e! L; D: @1 e" V7 W
9 N3 J8 d5 M/ k* ~' U$ O mov ax,4fh
7 h- ~, F9 V8 j7 A int 41h$ L! b7 E( C7 z
cmp ax, 0F386
0 q* V3 f* B4 c( L jz SoftICE_detected
1 Q2 h( Y- y' m& `: E: T
; [, T! h g/ ^9 R. S4 s/ {( q" H+ K+ ^8 v4 F' ]! j( n$ p! x
Next method as well as the following one are 2 examples from Stone's
9 [" O. l4 ^% b G"stn-wid.zip" (www.cracking.net):
- w* [! E. {2 k" R8 O: x
0 S! r+ R- M) P+ m mov bx, cs1 Z, z3 H: o1 i9 @: P
lea dx, int41handler2
. @; M: X- P: O8 I: B+ t. I; p7 M xchg dx, es:[41h*4]
! @: M+ @' d) U* P3 Y+ z- H xchg bx, es:[41h*4+2]$ n/ g* a8 f2 N) u: {1 A; T1 @
mov ax,4fh
7 ^4 q$ d" Y+ ^* m6 K int 41h
5 [. w, q9 a* a; R! g* H# B xchg dx, es:[41h*4]' O% d* h" D4 K3 y8 m
xchg bx, es:[41h*4+2]
/ {* ?+ R f& p$ e, j( D9 ~" C' G2 f$ P& p9 y cmp ax, 0f386h
1 g# n0 o4 @# u) X. \+ m jz SoftICE_detected/ q' E3 j# R& D: |7 v; @
- J' v' U* v; ?int41handler2 PROC& K% [& r+ H6 { R7 L
iret( Y8 Z$ p2 T: S+ R2 t0 g, t
int41handler2 ENDP
) f' l2 u! s, Y9 H( x
, B3 }% Y5 g8 p3 B' i
# n: _( Z- Q9 C, o_________________________________________________________________________
* \1 X5 l4 V6 ~" A; r* q* d! m# |, ~$ p
9 Y, H, n& L4 m& W* EMethod 064 n" J8 q% [; _; ^
=========
. l+ Z% T! Y! w$ G
$ g5 V/ l2 \2 Q! C5 \9 K$ W4 [' X# Z' q8 S8 x1 Y% Z9 s
2nd method similar to the preceding one but more difficult to detect:
1 v: U) U" d, k6 K5 z
- a! G2 H% ^6 C7 F: G6 {, L5 h) x l1 s; m
int41handler PROC
2 p+ ?. p( r3 s; q, b8 _, j$ Y mov cl,al
0 V8 J5 y( K1 Q/ Z5 V# i9 c- H iret
% o( W7 I" i/ y' t1 D' r- q6 Zint41handler ENDP' S4 \4 a8 n' |2 x
2 V' L: D# A5 Q* N, S Y/ j5 N
! n0 _+ p3 W) ` l( s' K' W xor ax,ax
# c: N* c6 K% l$ L; _ mov es,ax3 {% Z0 P" G) o% F* [, Q& Y6 \' b, N; y
mov bx, cs
4 V$ d1 c2 c3 r8 ]% ~" x v! o lea dx, int41handler
5 t% Z4 o+ T }- ]$ V: k( d" c xchg dx, es:[41h*4]
; @3 i3 f4 D# g$ o xchg bx, es:[41h*4+2]
2 W% k( C( q' j, _8 e# { in al, 40h
P) [2 [2 ^+ R xor cx,cx
, I/ y" G2 c. w; [/ e$ S/ Z int 41h
' o8 |6 v, }" q; A1 Z* R) K xchg dx, es:[41h*4]- p3 k$ e W9 J" M6 b4 a+ t a" m
xchg bx, es:[41h*4+2]
& U8 H# o b I# Z cmp cl,al$ k ?2 y, P- o8 [6 [
jnz SoftICE_detected- {# n8 i: H* Z0 ]! H
0 W$ [0 v! N2 u' R5 r9 Q$ @_________________________________________________________________________
, d9 s( |: Y% Q* V. R
) f, b4 Z- m" q/ |Method 07
" o" v! }2 D7 h! P6 k* J9 _=========1 v9 X ?! B& Q
4 D0 J0 F7 Y1 RMethod of detection of the WinICE handler in the int68h (V86)
& O( A+ u* s2 l _, T* G$ D' f
( m. C3 W7 v! r5 U% P mov ah,43h
9 M+ Q( u# L6 I* G( R% R int 68h) h7 [0 K9 F! a. E7 s9 h6 J
cmp ax,0F386h
/ A. \4 N# ]9 }7 f jz SoftICE_Detected
& V. v# K9 i% G0 n+ i1 Y2 A( i, |0 }5 o
9 |' L+ d8 n: V9 r8 P
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: I5 h* y; {; n3 }5 D" L
app like this:
: c( l2 P6 { q* P* o8 ~) l- p; D; j7 F) r& a
BPX exec_int if ax==68" A. \6 r6 L8 Z' @
(function called is located at byte ptr [ebp+1Dh] and client eip is* f) y+ B. Q, ^9 u3 d/ v& z" i4 y
located at [ebp+48h] for 32Bit apps)4 w, B8 p4 i$ T" [& J
__________________________________________________________________________4 G* B; }. d% K f9 N
/ h0 \; `5 d) Z6 Q2 x
c- N2 F. d* \
Method 08& W3 p! g, s0 J; G% }9 L& Q3 z* |
=========
6 p7 I) D$ {' k- g. s+ b) [
! c1 q! k7 O% E8 ~9 |, xIt is not a method of detection of SoftICE but a possibility to crash the. _1 D! O" }, W8 |2 k. P2 S
system by intercepting int 01h and int 03h and redirecting them to another) O K' f5 @: K/ L
routine.) T. y7 V( C. x+ ^, f7 C3 M
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& z: k* F: M. W/ T/ z- E6 S5 Yto the new routine to execute (hangs computer...)2 x7 W8 V0 A& ]. B
& {; c8 X( W+ Z; f9 P* H5 ?6 q# Y mov ah, 25h
8 {5 u3 ]$ {( Q mov al, Int_Number (01h or 03h)+ M3 @! X0 r* A+ @$ S
mov dx, offset New_Int_Routine! P6 ^; W6 _4 s, x1 X
int 21h
% A6 S7 y3 G/ ~( [! F3 p
& S r6 u& |! M& f+ f' z__________________________________________________________________________
. ?6 c6 n" v: j6 j; w
' w6 p% W/ x! W- L3 |Method 09
3 w# q+ F5 b5 _; F/ O2 r3 \( H=========
3 ` S7 i/ o& R+ Z- ?7 T
+ N5 x4 G1 {" G+ @% t3 cThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, v1 B7 e; ?" w
performed in ring0 (VxD or a ring3 app using the VxdCall).# |+ b8 u! ^6 n! R u" M* t
The Get_DDB service is used to determine whether or not a VxD is installed* C2 D9 d ~% \6 d e; {$ j
for the specified device and returns a Device Description Block (in ecx) for* f# W* a' c/ m& ?
that device if it is installed.9 e, u$ N4 ~! ?' P- O
?1 E& g* N; K mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ b1 b7 `4 ~. u u6 w4 q" a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- w8 W, K6 f2 _6 J% t$ g6 V VMMCall Get_DDB
* B3 ?/ O+ y% `; k mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; F9 @5 _: k8 m( M2 J3 }
; Q8 Z c& {) C1 F! TNote as well that you can easily detect this method with SoftICE:# B p+ c0 L3 y# Q6 Q9 h/ ?
bpx Get_DDB if ax==0202 || ax==7a5fh
' I- W u# I. I3 d- V
- M% N0 w+ {* R2 M2 @__________________________________________________________________________
+ K( t( O& R. q6 R3 h1 c& U+ a2 m) d7 n
Method 10
* y( R$ A" v. X& A$ o: z. u" Q=========
5 F- Y) u6 _2 I* Z; `3 ?5 n9 H0 Z
% y" [0 n1 F; J/ |: T=>Disable or clear breakpoints before using this feature. DO NOT trace with: f8 O/ d% ^! b B% R1 g5 S1 n
SoftICE while the option is enable!! L$ `: S B: Q; s
4 s" j: g/ o7 K$ T1 _This trick is very efficient:* D4 j8 D4 f( k: o% n
by checking the Debug Registers, you can detect if SoftICE is loaded
" m% t! U; N) ]9 h1 f3 h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, T- T# W# |- C& a' vthere are some memory breakpoints set (dr0 to dr3) simply by reading their3 x% L5 Z: D2 L2 S8 O
value (in ring0 only). Values can be manipulated and or changed as well' `. j" _0 A% n5 \& h8 O. W, E% r
(clearing BPMs for instance)
/ c# k- N; J d+ w/ H% m- Z! h! a3 l3 d' J1 e3 A
__________________________________________________________________________
, z3 E" h% X% p$ @) e, A0 F3 Q+ p0 J. f
Method 11/ y1 i8 `) ?9 `. `/ Q9 z% T
=========' H H/ V9 d4 s1 k) a- I5 R
D, Q$ r) l* x% S5 PThis method is most known as 'MeltICE' because it has been freely distributed
! s9 w. D+ n/ }1 H$ h* gvia www.winfiles.com. However it was first used by NuMega people to allow% } D6 d) z% V/ g( L
Symbol Loader to check if SoftICE was active or not (the code is located
# c: L+ j; U! Zinside nmtrans.dll).- e# `! c1 D# T! i( {
2 e2 v* y' [. W# a' G6 }: O4 ] G& ?3 QThe way it works is very simple:- b" |$ q' w8 b2 Y; Z1 }$ y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- F$ g) C- _/ p; k7 L! iWinNT) with the CreateFileA API.3 l. m* V E2 m, N" |% U
) t. f! [+ Z& u7 JHere is a sample (checking for 'SICE'):; ^: l4 F0 e" r0 E2 c. X
9 s, N1 k) m3 B7 n1 a5 d1 `4 ?
BOOL IsSoftIce95Loaded()
6 F; r( ~+ ]( J0 v, ?9 T7 T{* F4 p, X& m! O4 L4 m/ s
HANDLE hFile; " M3 b: V9 V5 Y2 h& V
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- A/ j1 E2 D1 Y
FILE_SHARE_READ | FILE_SHARE_WRITE,
% n# V8 W% b' ^, ?% i/ ~7 N NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 P& S v$ n% g. D0 D
if( hFile != INVALID_HANDLE_VALUE )
+ C; m- B# n- F+ Y' u j3 Z7 n4 | {
; `0 j! Q. M ~ CloseHandle(hFile);9 C* S5 o- d( K0 B
return TRUE;/ l! m' d' f9 \. ?1 @, y
}
8 o- U: v6 x! \* d. U% }/ _% S( B return FALSE;% [6 O! S( B& s$ c6 w! t; l" c
}
. r1 L7 d$ S8 }1 \. }" |/ `: F8 ?) b, u$ b% M
Although this trick calls the CreateFileA function, don't even expect to be
/ M3 U. v" `; B5 f9 aable to intercept it by installing a IFS hook: it will not work, no way!' J, ^( E8 l" @& V" J
In fact, after the call to CreateFileA it will get through VWIN32 0x001F! z% j5 f( M) z* ]! T' z1 `
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( J6 A8 I6 S1 c2 Eand then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 H+ n: X& P: m* j1 a5 efield.
6 Z# B/ z0 l7 c8 b+ e" jIn fact, its purpose is not to load/unload VxDs but only to send a ) I1 y" N5 [, F9 B- F
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
6 {. k q& O1 k6 a9 n' q9 Xto the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 i7 Q" ^" h! j' g3 k& n3 ato load/unload a non-dynamically loadable driver such as SoftICE ;-).
. b9 ]; _+ R5 N9 X8 u( T/ ?If the VxD is loaded, it will always clear eax and the Carry flag to allow
' r/ `9 m% b- k. S' M, dits handle to be opened and then, will be detected.4 q T7 o Z( j/ M% K0 u- m- Z
You can check that simply by hooking Winice.exe control proc entry point6 b$ M5 A9 J7 c% `. m/ c
while running MeltICE.
3 A- | \( e- g+ ]+ S) P* s" [/ \; ~ Z
' B L) D/ i3 m& U" w
00401067: push 00402025 ; \\.\SICE
, ]: h. a( t! V( G 0040106C: call CreateFileA- w! y0 H3 e# {! x$ s3 C5 C% c
00401071: cmp eax,-001
$ M Z: m! @5 D2 A 00401074: je 004010916 e' o8 e. Y& F% N; G
, A4 V" `) a' z4 X3 D
0 D9 G8 c$ l7 |& e1 [+ W9 }" xThere could be hundreds of BPX you could use to detect this trick.
7 V# T" D) K& `9 ]0 e3 b-The most classical one is:
( z: Z& i9 k" m- M BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 [0 Y: E2 ]- E1 A: d *(esp->4+4)=='NTIC'
9 A9 S6 a" |. {: Q) r( C3 v8 b' i& ?8 u |+ H- {
-The most exotic ones (could be very slooooow :-(
% _5 X; y; r, i4 n9 T# m# N R3 } BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( I% v+ a1 ]. [: a
;will break 3 times :-(
! w4 n+ ?; Y% e6 h6 ?8 N( D- @1 H8 K. L3 R _+ X6 x& d+ z
-or (a bit) faster:
1 o* l- Y& W( B$ P5 f. L6 ] BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! G- [3 M1 j3 ^* u; ^/ ~% K4 }
$ J- A- K7 q) ~2 |* v, X BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. [2 c% P) z) i* I( h: D& \ ;will break 3 times :-() G& y: S+ U' P' R, m
+ g/ y) V1 x( U5 E( f- `
-Much faster:
3 @( D, [7 K$ T7 w3 g BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* w, R" S" T, S; U) W& X
: U! H! G' @5 y1 L1 ]! XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
; Q8 g4 \* H" q0 c3 o( Z0 pfunction to do the same job:% z2 X/ e& P( J; ^5 n" W" O
) Z% b) n1 W$ H/ [1 t
push 00 ; OF_READ
6 B4 y9 J' A% X& r1 y mov eax,[00656634] ; '\\.\SICE',0
7 S9 V3 z8 Y- r8 [ push eax; o0 u: |; g( x
call KERNEL32!_lopen
5 x/ B. }, C$ n2 J# v inc eax- G. y$ R! f' G% o x6 |/ i
jnz 00650589 ; detected4 s9 h+ u. ~; K. y6 P" w
push 00 ; OF_READ
9 g8 y9 }& v( O9 D1 B' z( o9 F mov eax,[00656638] ; '\\.\SICE') n; h1 y! C3 ^( Q) E
push eax# L. R( \. P, d& M0 R0 x
call KERNEL32!_lopen
) b. i# z. @( _) p' b9 Q inc eax& l# D! p! B* d4 @. G: Q/ R! G
jz 006505ae ; not detected
# ]! A+ X' J+ @3 _/ H q
! K% E* W( p$ y1 q" ]
7 _% V6 I! G1 A+ L; `( ~" a__________________________________________________________________________5 H ~- |" c B4 o! K
V3 y1 K' }2 F
Method 12: E* \- J- Y0 L5 C2 E, v
=========: s: A; e6 M2 \+ P8 L6 Q7 U* n
1 g2 e5 v! t0 l# l9 j' n7 Z) m, H
This trick is similar to int41h/4fh Debugger installation check (code 055 _& b% k' H) i" A n
& 06) but very limited because it's only available for Win95/98 (not NT)
Y3 }2 W" H1 u& |/ las it uses the VxDCall backdoor. This detection was found in Bleem Demo.
9 |9 c5 S! f1 I/ E7 A* Q
8 @, B( ^) ^: ^2 L4 ` push 0000004fh ; function 4fh Q6 m; ?) v5 F: P2 D; t2 f7 ~
push 002a002ah ; high word specifies which VxD (VWIN32)
6 d U9 f4 N) j, B ; low word specifies which service' b- `% q0 V' Q2 |4 w' `1 h
(VWIN32_Int41Dispatch) F- Y! ^4 ^" j
call Kernel32!ORD_001 ; VxdCall
- [5 Q* @4 R! h. j1 {) a+ r& D/ M; _ cmp ax, 0f386h ; magic number returned by system debuggers ?2 i8 O/ t2 v8 k
jz SoftICE_detected
* U! w" D+ l3 h1 X
3 w1 [ a5 I- K# B& K! o# R+ |Here again, several ways to detect it: F: ~0 u G8 ]3 J9 T" D: J
# [+ Y& m7 k+ M% |' B BPINT 41 if ax==4f& h2 q+ t6 Y; f5 @ ~% z
' f, B* g% p7 I' l) ^ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one$ q; I* {7 ^) [ W5 K$ d
, u9 e8 b( _! Q- Y7 ?/ |1 R& q
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 A, J' X$ @9 M8 @0 y s# V( @- c0 }4 K! k" M( W C+ Q
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!4 S7 j m( ?6 H7 f
- ]0 ^( U. B! {: O) O, n
__________________________________________________________________________5 A6 s$ G! f+ g; l6 W! U
% t- f0 W! j3 ^: d1 }" w% N/ X }
Method 134 E: h4 y, Y+ A& f6 s% [
=========
" d$ z X& f6 Z4 r7 H; [' b7 K: U( O; M6 c5 ~+ d2 k1 z
Not a real method of detection, but a good way to know if SoftICE is l# `! ~; i* c
installed on a computer and to locate its installation directory.1 B6 @0 W" O! Y: k" q* t" F! c
It is used by few softs which access the following registry keys (usually #2) :4 U$ P' @# C& |
6 Q4 H5 s& G/ e# ` S* e-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 x( H+ {' ?2 f/ e- X Z
\Uninstall\SoftICE) d: c7 ?* J, t! t( }, ~
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 G n$ @$ ^) s3 R
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* ?' R# ?2 j p1 m7 @ i\App Paths\Loader32.Exe
: L" _, o0 c" V# r8 I
3 u$ Y, w$ P, |2 S0 D' Q
A: G2 D' o5 CNote that some nasty apps could then erase all files from SoftICE directory9 V+ L. e: L( _; x
(I faced that once :-(8 p5 V! B. p' [9 b! x& k
' O; ^6 \+ s6 V+ }' @Useful breakpoint to detect it:
; Q3 u: \$ G/ R/ L& J% c# @) R/ b% s
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( c2 k- g# Q/ I+ L) i/ D+ U* i4 r
! E( x( D; e: u4 u
__________________________________________________________________________
. }, [# w5 k* |8 Z: G- s. O1 ^ A1 ^
9 m1 b. q4 }6 S
Method 14 ! A* w5 T6 Z) Z) K# B" i
=========1 j$ y, C& g& k" Q- K/ f- @. L
1 |1 |3 O1 a6 Y2 a8 I7 p
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& z% g- n; {% tis to determines whether a debugger is running on your system (ring0 only).3 o6 K! D0 V. i5 ]
, P( h% g" ]* ]# i! I R8 N' z VMMCall Test_Debug_Installed
8 m4 s" X7 a3 a' ~% o3 M" _ je not_installed
2 p/ J y; `7 ~+ H" i' M" F6 J
* }" z3 J+ e2 Q- P2 M$ u+ h3 qThis service just checks a flag.4 K3 J; l' G" ^1 [4 E/ U
</PRE></TD></TR></TBODY></TABLE> |