<TABLE width=500>
. z9 Q& M6 G1 H8 A$ o' X<TBODY>
4 ?+ _1 e! D' ~4 z4 r<TR>
, J/ m# d" s! ?5 o9 L<TD><PRE>Method 01
# O( s$ w4 q2 N6 q0 s=========
h) z' j% y7 u( |8 r+ M3 z' B8 r* d( u6 s% f' G X5 l
This method of detection of SoftICE (as well as the following one) is
5 z& [8 t" J3 Y1 }! \used by the majority of packers/encryptors found on Internet.
: R! ~4 q7 A- S$ {% i2 J% V! bIt seeks the signature of BoundsChecker in SoftICE
/ [) u: I* J7 ~. S1 p' k0 e7 L% X
mov ebp, 04243484Bh ; 'BCHK'5 ~, R! {# A& H) @
mov ax, 04h
- B. K2 y3 k. B! k% D" n6 T* ` int 3
3 x! B) V: _& z cmp al,4! O+ P4 m# j$ W! k# U; ]
jnz SoftICE_Detected
9 I6 w' ^/ k# |( c) L
7 C' L6 @1 Z* K! `7 S& a& T___________________________________________________________________________; d- Z, w- ?, w6 |
: a0 ]6 `1 J$ D4 W2 W: |0 z/ m# j4 _# vMethod 02' ?( m! @6 y F; K1 C& s, P
=========
% W# C7 A) N3 f& Z7 n0 G4 K& b
9 H) @9 a; Y( q4 T, ^) hStill a method very much used (perhaps the most frequent one). It is used& A% M6 c# [1 Y7 ?. ]( F. c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
8 A/ d: ^: W1 [3 dor execute SoftICE commands...
" p* c# _! O- G8 G1 }: EIt is also used to crash SoftICE and to force it to execute any commands/ E# s9 L8 O/ _) n% A: l
(HBOOT...) :-((
( H+ F3 J* S: M2 @3 l3 Z
0 K7 W1 @) } E; `Here is a quick description:
8 l; O/ ~) @: X1 S, ^-AX = 0910h (Display string in SIce windows)
M( H- p2 t |7 W3 R0 }* U-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 a7 ^' K4 Z5 A
-AX = 0912h (Get breakpoint infos)
' G) C! _/ m9 A+ b" t. p. w$ O-AX = 0913h (Set Sice breakpoints)
. q5 j1 g6 d0 a2 |! T-AX = 0914h (Remove SIce breakoints)
! U3 E9 K q; h# g4 w1 I" T
( C, S/ \( d( ^) hEach time you'll meet this trick, you'll see:) [: z; g+ ~3 B6 |) e0 s
-SI = 4647h- U. X: a: k8 s: @( }; `2 ?+ c
-DI = 4A4Dh
$ `- W; P$ e4 H7 i0 X) DWhich are the 'magic values' used by SoftIce.
/ w- I/ n. Q, I7 S1 kFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.- f' Q* A. N2 o1 \6 M+ v
% ?' _. a# |- s
Here is one example from the file "Haspinst.exe" which is the dongle HASP6 p8 u# r5 f3 a: P
Envelope utility use to protect DOS applications:
x& S$ S* l# d; V& {+ X; X( K- z( y, D- @; i! U
# l% q3 K* \! |. w: N4C19:0095 MOV AX,0911 ; execute command.
8 @" ^; Z! l7 m. ^% H+ P6 {* e4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).4 B, q$ ^6 K- G) e
4C19:009A MOV SI,4647 ; 1st magic value.
1 S0 q: a6 ~: p9 m1 z* r6 U4C19:009D MOV DI,4A4D ; 2nd magic value.
; k; E$ O- L2 G% R4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; o. Q4 v" z8 B4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ m% W& a [ g0 |5 b3 @& b4 }3 H
4C19:00A4 INC CX# a# Y, N; A: [
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, j- a- F0 n" e' Q2 ?4 z
4C19:00A8 JB 0095 ; 6 different commands.) y! a2 i3 V+ l; t S/ Y) @# Z& d
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
$ S% u+ x* b8 j& `9 Z+ F4C19:00AD MOV BX,SP ; Good_Guy go ahead :)2 l/ l" h: d& ?) W
6 i8 z q; a5 n1 Q: v. i1 aThe program will execute 6 different SIce commands located at ds:dx, which
$ s0 Z* i( V- X. _' iare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 ~$ }) D/ x$ V, B% i" b
( z- Y( d5 ^! t$ F& }+ s0 S6 {- o* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 o5 R4 l' G# N& L6 A___________________________________________________________________________% R' }7 b1 h6 @+ y7 J& o: T
# m, u) v _/ S8 C5 B3 K4 `/ D/ ]# q4 O/ n2 v1 |; y% J6 n' j
Method 03
$ B9 i8 [. X+ B" e) [0 a7 H=========$ d, U0 H& R" t. @2 t
) L0 R. E) j& K' @
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% v3 b& h. k/ ?; j) b(API Get entry point)
/ J4 q* K! A1 W) t* ^: T9 D) n * x8 _2 l) ^9 f4 D( i
1 l4 Q6 @, D, ^" k9 l8 W- R xor di,di
* F. g9 |8 `0 T0 A, P" e mov es,di
. Y( t+ U' H$ v mov ax, 1684h K$ U: i1 X. n& V, O9 t2 W a
mov bx, 0202h ; VxD ID of winice
$ Z# G# `& l$ \1 } int 2Fh
4 ?" c5 A" C+ a% e4 W p mov ax, es ; ES:DI -> VxD API entry point8 C- |2 m l7 g2 P
add ax, di& J5 @0 N, o; C
test ax,ax! v6 R% e/ |, U: p7 w6 H
jnz SoftICE_Detected( @8 Q+ u* X. d$ i) G
/ j2 I1 |; {: n7 X0 `9 G___________________________________________________________________________
: Y0 V( P$ O1 H- M% D3 V
/ v& ~) z7 [5 l3 @; VMethod 04) |" y) x2 H- U! J
=========/ ?5 S n1 `1 l6 j% W$ l7 S
" |/ a2 \/ _7 T4 o7 @' |* b3 j$ t
Method identical to the preceding one except that it seeks the ID of SoftICE: N3 q: s4 o' u" N, l+ X
GFX VxD.& q% m# f) X( v& ]
$ C* R _3 P5 ^( B6 s1 T2 t
xor di,di
( o u* m/ ?$ X$ ?8 A- E mov es,di6 I6 W4 e7 F# K$ W1 ^) H6 D. V! Z
mov ax, 1684h
& R. M# v1 i( M mov bx, 7a5Fh ; VxD ID of SIWVID- _2 _3 m# N/ B' Q
int 2fh
7 i! Z3 D# Q9 M, c' \! V5 v: L mov ax, es ; ES:DI -> VxD API entry point+ X* x# v- \: O+ U
add ax, di3 Z* x! q+ f, a: F% m5 X
test ax,ax& [& ~( l% }: f) C5 C7 x+ l
jnz SoftICE_Detected
2 m# Q5 E( e4 {
. J; F# X$ e6 {4 F9 \# E__________________________________________________________________________
) k1 w5 L$ r0 H$ s
! a" u$ u" T# I4 J. j3 Y0 Z! d( t- T& P
Method 05: J. f4 A5 e! t, J- }# f
=========2 a: x. S2 o7 C2 a6 ?7 B1 E
" C* {) H1 Y" o3 h. Q% L
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ v# F# q5 q: m1 r0 A
debugger. It calls the int 41h, function 4Fh.. ^. f5 X; @- c; S2 B* f/ q
There are several alternatives.
* U3 V! N! n% z1 j' f
9 t% l2 A' F I9 PThe following one is the simplest:; ?; d8 i7 {1 \2 W* _9 l9 [
' u: w+ J! j8 ?
mov ax,4fh
: D2 b4 c U0 {: d, t/ g% {1 S int 41h
* n l! j+ X: ?: P/ E) t cmp ax, 0F386
6 \8 I, f: [* ]6 K7 d% J& r1 | jz SoftICE_detected
& J) q: Z. o. a* ^- K7 |
) a( ~: O0 n$ Q5 H( Q U5 D2 J5 ?) |! w
Next method as well as the following one are 2 examples from Stone's : D) X6 j1 ^- ^ Y
"stn-wid.zip" (www.cracking.net):; D7 x& t9 ~& P% P q2 ?0 ]* U- l
- t) C: y1 S a# E
mov bx, cs
( c2 D* d6 x6 z0 ^$ W lea dx, int41handler2
% G' _* O' y, S) W/ h xchg dx, es:[41h*4]
- D4 i& H. S7 O J- \; ~ Q% L2 d xchg bx, es:[41h*4+2]
/ G. T6 a: [3 \ mov ax,4fh5 [3 p& a3 ], b
int 41h1 N0 u- U0 \* U' _' k$ {; ?
xchg dx, es:[41h*4]
% V' e4 j$ p0 r xchg bx, es:[41h*4+2]4 L* h" U2 n0 X" O* _+ S/ _6 r
cmp ax, 0f386h
/ {% ^7 z" w0 G) I" n/ i. Z' H; P jz SoftICE_detected
0 Q& X7 X# T8 M1 @4 O
6 f3 \: Z! m( hint41handler2 PROC. \! e& X: g0 d: l) V& M
iret
9 S$ s$ n8 }+ r* m5 t( n8 i0 Dint41handler2 ENDP1 u* d) T4 |7 K7 \& t$ k8 J
. V/ C2 Q! | X) U) q( J+ {- R }( ~# E. Y6 f: N
_________________________________________________________________________" O8 q% s" K/ m, p1 ^ o2 h* |) j! t
8 r9 y+ p5 y) f, l2 t# x3 U- t3 W$ A5 @ C' p1 W7 U& f
Method 06
( N$ Z6 A% J0 a=========% M3 u+ r1 X+ \/ X3 Z
- q+ N5 K; M& @# A3 e% g( E7 W' {0 s0 R
2nd method similar to the preceding one but more difficult to detect:
& N2 j# y9 x* w" J, {2 {
. H( `% W" C( Y# n3 w; t n0 T
( b9 w- a) W, H* p9 h nint41handler PROC' z% j- T6 Z3 A( W4 m9 D
mov cl,al
0 E; _4 L& ]3 v# W" w" g iret# Z, X8 b, \3 B! }
int41handler ENDP
: k& ]- a5 E8 g8 h2 l& y" ^4 Y0 W7 P" o. f. }( E
* S! N5 K: \7 C; `4 I
xor ax,ax8 |; C) j% a2 L. q) Q) P# x$ M& i4 M9 A
mov es,ax
$ r: `: D5 i, x Z5 | mov bx, cs; Y9 r1 J# C: {) S2 s! `: p( `3 {
lea dx, int41handler
) l. y& O6 S& q0 }2 O' P# I! o xchg dx, es:[41h*4]5 I; M* D$ x) _
xchg bx, es:[41h*4+2]% g3 v0 L; i) _5 B- B: B) u
in al, 40h2 H- \) M4 H; p; K
xor cx,cx
( x9 N7 m9 \* q! K- n7 _! c9 h int 41h; x- d0 s1 r. o: K
xchg dx, es:[41h*4]9 o9 J5 c( |7 h9 }* } D- j6 _4 V9 ~" q- h
xchg bx, es:[41h*4+2]
* N! @/ v2 E5 \( J$ W1 B" ?# o cmp cl,al7 g8 q) T# Q. Z$ P
jnz SoftICE_detected% K- ]( r8 g1 W V* f( ~
/ V: ^* p/ ]5 ^1 C* R. b+ D_________________________________________________________________________# l4 a; U) b( W' D. ?' i& S7 b( C
3 d: m3 L+ a" a8 ] F9 _3 tMethod 07' a' {: F: M/ Z
=========5 x5 I$ {, k5 Y+ ]' X
7 A2 ^4 b9 y3 |5 gMethod of detection of the WinICE handler in the int68h (V86)
2 z9 e- D; R$ I
u- H4 u4 x. I/ Y! K. I" i mov ah,43h: ?( X5 I2 O3 I' k6 r2 S: u
int 68h
% \' T k2 P% b% `6 ~ cmp ax,0F386h7 h0 |# P0 ^5 G! H
jz SoftICE_Detected
6 k: m/ J' u7 U) P# r* \' J" h' {/ q' H
% h! h3 a/ Z: P+ H h
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 M2 U7 t r: ^: u
app like this:1 d6 I& X( r. s6 _
+ S- l+ N8 L. d% \ BPX exec_int if ax==68/ p- Z: a: v; [: |. u
(function called is located at byte ptr [ebp+1Dh] and client eip is
- V, ^: s7 r# y0 ` located at [ebp+48h] for 32Bit apps)% \. F+ I9 v% o! M& ?$ ~$ R3 \
__________________________________________________________________________
% m2 F! O6 _. X
$ U0 W" v! n( J5 W& n3 m$ ~+ ?. v9 d
Method 08
; K/ m2 @# r9 F=========
1 A; K! A3 W( {2 X E' {+ C2 P) Y# w1 U: n1 p( i a3 \
It is not a method of detection of SoftICE but a possibility to crash the2 A) f" N( r* S6 u$ O
system by intercepting int 01h and int 03h and redirecting them to another
$ E0 R4 r. S8 H% wroutine.6 X) r+ Q* r$ J/ `) p& l8 p
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 g1 {/ v9 x2 Oto the new routine to execute (hangs computer...)1 Y) N* {2 Q8 t! m
: t# H$ T/ ]' d& t& T mov ah, 25h- w2 D* T/ L" S1 `
mov al, Int_Number (01h or 03h)1 j* y% E: q) j' X" c" O: P
mov dx, offset New_Int_Routine) G: I2 h i0 H1 D" B3 b8 w! T) t
int 21h$ ]1 x7 ^+ U0 J6 R; T" j8 m
2 b8 s% {* T$ }5 s$ r__________________________________________________________________________5 B% K" N0 |2 V; j% s# |* H- m* A9 q0 D
1 a6 p& S; U2 I! G
Method 099 }4 Z1 h) d. G& d; C. k( [
=========1 Z' u/ k1 d4 ?/ q+ c* E5 d
5 j! D+ n( Q( Q5 E" O6 i5 ?3 j* JThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only7 U& r& J" r5 j2 t( u
performed in ring0 (VxD or a ring3 app using the VxdCall).3 f9 K- G# O( z0 I; h3 j
The Get_DDB service is used to determine whether or not a VxD is installed! E" D+ Y4 {; @, N
for the specified device and returns a Device Description Block (in ecx) for3 `' {. t0 G- |8 w* q: {# p# J7 C
that device if it is installed.
0 x9 }3 h! A% @8 [ Y% @
, Y2 Y5 Z; z5 o; k* g3 E& G& y* z mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID& \+ j/ ~# O+ M# R
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)" n4 W3 b8 E! y Q$ J
VMMCall Get_DDB8 _% Y6 Y; ?6 T0 Q4 f, P
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed9 j! Z H* y& Y( z
. s/ E: \( g4 K! z% Y ^" _
Note as well that you can easily detect this method with SoftICE:
$ x& b, ?. H( r6 m+ A) a+ d8 y bpx Get_DDB if ax==0202 || ax==7a5fh
. g5 I9 k: ?% c+ b+ J
+ w0 |( j5 H6 v8 w4 y__________________________________________________________________________2 {* d6 @, U! I% x; o4 s r" k+ {
j7 l2 }8 d5 s1 q( BMethod 10
* Z, u X& x( T; r" B# Z=========
4 S; h' C$ v6 s9 T, R: ~& K# r7 @1 a3 x! @& |
=>Disable or clear breakpoints before using this feature. DO NOT trace with
* A$ k1 { J) ?3 u, M SoftICE while the option is enable!!
( |6 A8 Z A2 f; b3 D" M% r( `$ C3 s" ?% Q
This trick is very efficient:
! } H: z0 E( x" a+ N# L8 Hby checking the Debug Registers, you can detect if SoftICE is loaded
9 Z' n" e [+ O: o(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 w5 D+ _% C: ]7 @
there are some memory breakpoints set (dr0 to dr3) simply by reading their
# T+ B2 e3 t; U' r) x; @9 K' mvalue (in ring0 only). Values can be manipulated and or changed as well1 U! N9 z3 M, i- t
(clearing BPMs for instance)% O% b8 [" \( c- j- M1 x1 f% V- e
+ Q9 B; i. ^6 X1 g' r! \/ L
__________________________________________________________________________
; R3 A8 G) v, d
: Q! |6 X9 T; l" G. ~$ wMethod 11
) k" {2 w# l# ]9 |/ z5 P+ a. f=========' Q& L) u7 O8 ^ K
7 n1 ^# U* N& UThis method is most known as 'MeltICE' because it has been freely distributed3 [5 H' X: Z6 {: U6 p( m6 f
via www.winfiles.com. However it was first used by NuMega people to allow* K+ f& B3 w6 y- T$ a1 B
Symbol Loader to check if SoftICE was active or not (the code is located+ b/ s: B/ D) e8 K. M" L, p
inside nmtrans.dll).
% F5 \7 d; z. M* c" Y, N w; D: U0 M! P; k( B/ e2 Z
The way it works is very simple:
9 y. S/ z. g8 O7 w) uIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: `( a$ A) W9 cWinNT) with the CreateFileA API.
3 h$ O, b3 h1 P% b( N) _, q5 y1 }6 F8 Q, R$ t0 K7 \" ^) `- x( i
Here is a sample (checking for 'SICE'):
# Y3 h" c& h) P5 [, J! M L5 v* `1 I) E- b3 X" x4 n0 K
BOOL IsSoftIce95Loaded()
1 @0 Z& ?9 l* Y- a8 J5 i{ \3 x+ d9 d0 V
HANDLE hFile; # [! M2 R+ C6 z2 W) [4 R
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 m% r N) p/ f! ^9 p- P FILE_SHARE_READ | FILE_SHARE_WRITE,
1 z1 v/ H! w) l7 @5 S, } NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! Y6 a& w' z* g8 _5 _ if( hFile != INVALID_HANDLE_VALUE )
8 G$ V8 k: ?5 |2 | {" ]. ^' }. j) g) T; j
CloseHandle(hFile);9 [; G d' n) Y% [
return TRUE;
& c" Z( x6 K" o* g5 ~- T }% {3 ^. T+ B+ M: c, `4 d2 n
return FALSE;9 L6 }& w* v, N( F; I9 g
}' w% i' d0 M% I6 d2 f. H, V% f
5 Q7 c8 D) W8 X7 pAlthough this trick calls the CreateFileA function, don't even expect to be8 r7 L: n: G- {% c: @' I
able to intercept it by installing a IFS hook: it will not work, no way!( G1 m( G& q/ W* H! ~
In fact, after the call to CreateFileA it will get through VWIN32 0x001F& k6 U* @* S5 x' [- D; Z& w s
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
0 t1 U2 D6 a6 w6 h' `" p/ a6 ~3 y" uand then browse the DDB list until it find the VxD and its DDB_Control_Proc7 T7 g3 Q, h/ |
field.
' V2 [; q4 ^! _/ u; q1 M& j) c& F% X7 YIn fact, its purpose is not to load/unload VxDs but only to send a ( d6 e( S' M( X3 B- S7 ~. D u4 q
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& @+ c% G# e$ U0 x8 X5 W
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 i r' R0 T6 Z, Vto load/unload a non-dynamically loadable driver such as SoftICE ;-).) P3 Z2 K4 j6 b
If the VxD is loaded, it will always clear eax and the Carry flag to allow- @1 x" _" j% c/ w
its handle to be opened and then, will be detected.
( b& S0 ~/ J0 T7 I: V! cYou can check that simply by hooking Winice.exe control proc entry point6 _) Z4 N& @0 i/ X |( e, Z! C
while running MeltICE.
, Y4 ^/ I6 n* q4 m1 f- I$ H, q3 b
/ \6 n# B5 D! s' }! X- A9 L. E
2 s# `3 l1 {$ `6 m- U# J) \1 g 00401067: push 00402025 ; \\.\SICE# h! q* l+ g' b7 p
0040106C: call CreateFileA% F( e; c6 d7 s) R; R
00401071: cmp eax,-001
- ? Q* @, I. y7 Q$ _, ?# F 00401074: je 00401091: E; D4 X' Q/ I% {' k% I: \4 f
4 j' F$ H, Q4 c+ R4 S. e/ |* C; A$ c
There could be hundreds of BPX you could use to detect this trick.
1 z$ ^ `1 ?+ p- ]3 R) ?! T: m5 {, c-The most classical one is:
" Z; U, w o. a3 ` BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 W9 |+ | p8 ~6 m: @: @ *(esp->4+4)=='NTIC'& I- Z+ h2 I" I) H
% [$ Q) c9 w' v! D-The most exotic ones (could be very slooooow :-(" \6 @ n9 j% G% ~7 X
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . }# c9 t3 j) C
;will break 3 times :-(1 Q# p1 L5 A" T
+ A" f" ]. \, o* G+ {/ {% ]1 s6 r-or (a bit) faster:
6 v& g- r' f0 ?! f, R5 K BPINT 30 if (*edi=='SICE' || *edi=='SIWV')# H& i7 I6 }+ `
: H1 r! O# X$ t# ^1 C+ t l BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 7 [9 \6 ^- k6 h( ]4 H1 ]
;will break 3 times :-(1 G- E2 w' }2 `7 ]3 z1 N
/ m, V- `* }1 ?: ^-Much faster:/ n. b+ r2 p: T/ V4 A2 M R- u1 C! V. H
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* F; g# L! }: L% O# Q y
5 F* h* x) s( \4 n8 @+ gNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& F3 J2 O/ [( _ m4 Dfunction to do the same job:
. W# Y) u1 S O
) U* B0 M; U |/ e! i$ | push 00 ; OF_READ
D3 E; c3 v8 A p1 S mov eax,[00656634] ; '\\.\SICE',0
6 Z" d) n" q; j; {0 b. }9 I push eax
0 O5 G1 K) w5 g, D& w call KERNEL32!_lopen
$ \7 v7 h6 u# j inc eax0 Y( F) L& K! g5 y# ? w: j
jnz 00650589 ; detected
# ]* x" f4 w8 {/ G0 o) H/ n push 00 ; OF_READ# D& b+ k( C1 t% o
mov eax,[00656638] ; '\\.\SICE'$ V s6 n# L) p2 G) d
push eax2 i5 ?) j: a& c" G+ M# m9 }( U
call KERNEL32!_lopen) S6 h9 D, k' K1 S- k: E, X
inc eax* g" H! M" q& ], K% ?) T/ Z
jz 006505ae ; not detected
+ L- H* E0 i8 o- L l7 [; I$ z \2 v5 i
# {3 k9 v* Y' W! o- K/ ^& ~
__________________________________________________________________________% ?4 q1 Y( m4 R2 M; [6 u
5 n% V5 _' q4 WMethod 12. w. _ ?; y! T
=========
+ m) a$ F- Q) P) s8 G' a, j; P0 ~+ d3 K+ h- t1 I3 H* O2 o0 s
This trick is similar to int41h/4fh Debugger installation check (code 05 \. D% |7 u( Z. c1 _3 s2 j
& 06) but very limited because it's only available for Win95/98 (not NT)+ a" G* Y+ W4 v$ c) W; E
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.- L; i: x1 e4 d% p& I
( P% R6 g4 ?# T push 0000004fh ; function 4fh- d# Z" p) @% d) D* b1 P$ M, `1 {
push 002a002ah ; high word specifies which VxD (VWIN32)& r( Y: ~4 e. I! ]0 [
; low word specifies which service- P Z' f1 E! b) w! [% |( e+ f" ?
(VWIN32_Int41Dispatch)& w3 H8 w! `1 r/ n0 n1 T; R4 M
call Kernel32!ORD_001 ; VxdCall1 k8 P; R7 y9 ^5 d1 q8 M
cmp ax, 0f386h ; magic number returned by system debuggers. X5 }) F+ R5 C; P/ p5 I/ x
jz SoftICE_detected+ Z; h& W0 f0 I0 U: p4 P0 |5 U
. E' J- Z* T9 J5 F" ~6 q2 F
Here again, several ways to detect it:
: E9 R8 v; W% Z! j/ Y' B. F4 u& e7 D, e! m2 Z
BPINT 41 if ax==4f
: K" }! i2 {* ]. B
* O) \$ g1 o, j& u4 r; _6 R BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
: G: e6 {0 c/ U" Z B$ m- w
% Q/ d; y2 `- J% c BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
7 W; ]8 L! N& @1 Z% r
) c' p2 J5 ]+ l+ S6 P6 E BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
3 T& q5 z& I/ [4 s! f
0 W' n* Y/ h6 ]( p5 x__________________________________________________________________________
+ p& C; [8 Y! y S5 o0 A& j5 W8 A8 e6 B" W
Method 13
2 x0 e3 Z' M: G' M# `, `=========: v6 @( z; E1 c0 G: n
$ M T7 l8 I9 f2 [( B
Not a real method of detection, but a good way to know if SoftICE is/ C1 L" C9 E/ c6 R* a- n' [1 Q
installed on a computer and to locate its installation directory." e# [- C7 J0 k) C- Z0 \# T
It is used by few softs which access the following registry keys (usually #2) :9 e, k7 y! _- u3 Y1 R
9 |5 x7 m1 ?$ N% T$ d6 V8 {
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, T# {, M4 n7 E7 }9 b0 K
\Uninstall\SoftICE6 |! S5 `" a) G2 F) _! u4 B8 q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 x+ i8 i- N, B, C9 ?: S8 \
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: A5 B- F5 F+ X: |1 J# w\App Paths\Loader32.Exe
0 D: b/ g! \8 |4 ]8 K4 K* j" g# o. B$ p4 J, V- |6 @* ^
$ d7 S' p @4 M8 t0 W$ o5 R- B
Note that some nasty apps could then erase all files from SoftICE directory+ E* U+ h1 T: b2 S2 a* o. L
(I faced that once :-(
* L5 p( ` Y7 {1 x2 ]4 i+ x
9 ~- G- e" i, A# mUseful breakpoint to detect it:* s- D% q! J [
) Y& `) S" \& O8 t
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
; E4 d ~, ^9 @
' c5 V1 u) r* U; |7 [1 U__________________________________________________________________________# Q; D" V, p' `4 y: m2 `
. z! t- M5 F# d5 |/ Y/ \% o3 c
' r0 V C7 d; x. Y
Method 14
' r2 n, o$ D6 ^=========
+ d3 E J& j; f0 X2 p" O
( C/ q; {2 v/ x( ]A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ ~/ J( T& W9 p0 E- a
is to determines whether a debugger is running on your system (ring0 only).) j# p; l9 v: ^ W
, u7 a; P. B" M' B% N4 m/ C VMMCall Test_Debug_Installed8 E: e' s( R3 g
je not_installed
: g. v% V0 L* B, l" `- I
8 {7 J" g( K" J; R! KThis service just checks a flag.
5 g4 E, z. R+ |, \4 E8 u9 V" l</PRE></TD></TR></TBODY></TABLE> |