<TABLE width=500>
( L& ~9 z; N2 d7 R5 b<TBODY>
. y; g0 m+ o K. E<TR>
8 D9 r, b9 ?* j6 K" E! Z* v<TD><PRE>Method 01 + {; M# _) i. e& G; X* E$ E
=========3 E- Y- }4 S! }$ {: r. Q) K
9 L+ `2 |* @/ J( U6 XThis method of detection of SoftICE (as well as the following one) is! g* B2 w% m6 f% O
used by the majority of packers/encryptors found on Internet.% p4 O4 b2 b( S1 n: S; J; h
It seeks the signature of BoundsChecker in SoftICE
0 @ O% T0 p4 ^$ p; M" l% |1 G3 @+ p8 j. M, j
mov ebp, 04243484Bh ; 'BCHK'% z3 h6 L; K* {) }+ r9 d2 T1 s
mov ax, 04h* @! n/ @ x3 M2 J% m0 T
int 3 ; u: c& @# _3 I/ d- l
cmp al,41 L% Q7 o6 R0 f% R
jnz SoftICE_Detected
3 ]1 M; M( u1 m% N' b7 ?+ Q" c( p2 R3 s- A* d4 C; i0 `, ?) ]0 G) Q' t
___________________________________________________________________________
. T8 G* }2 |) w7 h( m# k9 `4 N: l1 ` v( x$ V
Method 02
$ N' [ ? ?3 v6 R8 k=========$ h$ F1 B; t+ r/ O
" j H- g8 V8 }; B: uStill a method very much used (perhaps the most frequent one). It is used# I" A6 U5 r+ k1 f
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 k, d( w, o6 R; ?* P8 d
or execute SoftICE commands...3 \' u; N. B* f2 r) b# a/ e8 F
It is also used to crash SoftICE and to force it to execute any commands: E- u2 U6 L& A) t) q# \
(HBOOT...) :-((
1 R9 e# r! X, u: E2 j/ Q5 q3 i6 v
; v$ F6 S: `$ Y9 y. dHere is a quick description:6 S! m) J) J* f, \1 |
-AX = 0910h (Display string in SIce windows)( E: v' N& M0 O' P: h: W/ l* M9 d" _
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' L" l% d- }( o u
-AX = 0912h (Get breakpoint infos)
3 G: B& K4 M9 W$ ]8 m-AX = 0913h (Set Sice breakpoints); L! L9 H1 O- U0 ? y# T3 a+ ?+ t
-AX = 0914h (Remove SIce breakoints)
+ _+ q i6 j. q! V& ^* }- ?$ W; B" ?- P" @' K* m: t' a
Each time you'll meet this trick, you'll see:
( K% g/ Q+ c1 |& Z! g; q-SI = 4647h
9 P" ^3 c, }( F: J-DI = 4A4Dh
5 n! b. H& ?4 f) m" S1 rWhich are the 'magic values' used by SoftIce.
/ j$ L9 z0 w; @0 H5 YFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.& N/ {, ^8 m8 ]$ j0 W
: N5 ]! [) b# U; q, U: | o
Here is one example from the file "Haspinst.exe" which is the dongle HASP# A- E) V4 o! a7 b- Y0 W8 C
Envelope utility use to protect DOS applications:- ]& f# U# m n( e' u$ w
* |$ M" Q" j* b, Y
* O8 f% W$ w, L4C19:0095 MOV AX,0911 ; execute command.
$ Y) b T; y! R$ B6 H* ~8 L8 X4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
, X' |, ?2 f, p& {+ f4 ]4C19:009A MOV SI,4647 ; 1st magic value.; U9 Z* D2 U9 z3 r
4C19:009D MOV DI,4A4D ; 2nd magic value.
8 B* N, N' v. y2 |3 f4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)" F9 E) |# j( _
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
6 }# P9 E. \1 b4 }" c! N' H* S4C19:00A4 INC CX7 y1 }% |0 A3 g; h8 S
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
6 e8 n, K7 c" \2 S3 [4C19:00A8 JB 0095 ; 6 different commands." O1 B7 M7 a2 m: U
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
- W1 u- {5 o# D2 v: ~4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# y* b; T. `' o4 F% R
+ g) r! Y# V$ w! |( T. QThe program will execute 6 different SIce commands located at ds:dx, which
. E F/ ? ^( A8 P5 n qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
+ Z d+ X8 e( @
/ M) ]- T: Z" q# N4 e* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 R: T: U2 B- ]( a' B j___________________________________________________________________________6 H$ E: h: h( a( e$ O
6 @( @0 O9 N* N( k
7 L" S5 }2 k" ]% a; ^8 j; K7 pMethod 03
3 L5 |) g+ F. O5 e; v: b=========
/ }; a* h" ]- y! z {* _2 r1 z1 _
2 N3 @! I% w$ h! D. S( FLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h$ S6 J$ D" p* Z' H% W3 M) ~$ w
(API Get entry point)
0 a6 m. |3 L: n( M& y
; ]+ V4 q1 Q5 T7 ~' Z: Y
6 L2 L; W- u* ]' X+ f xor di,di
8 M8 D; w1 A2 n$ Y- y* b mov es,di
( q: l9 r( p7 h0 S' Z4 k" @ mov ax, 1684h
+ v3 e. l, G0 K5 ]' P8 `$ Z mov bx, 0202h ; VxD ID of winice/ O4 P3 W9 ]5 U
int 2Fh3 z8 f4 j) `9 P; |: o' Y! R& U
mov ax, es ; ES:DI -> VxD API entry point
8 E% t$ o% b% l. t$ W6 S; P add ax, di
6 z8 {. g. K+ z# B' n) s) e test ax,ax9 k4 _ P. T9 a* m1 G1 v5 I
jnz SoftICE_Detected
) w: D/ U+ D4 R l1 T+ C9 l2 _3 W+ f& j
___________________________________________________________________________3 L$ Z; u h. u' c
p: g0 d& D8 `! [+ jMethod 04
7 L8 V3 q2 f( {+ N=========
! _3 P2 y% l7 O- n! X
: ]& b, X: s/ c# T% \: `5 z$ xMethod identical to the preceding one except that it seeks the ID of SoftICE' K3 p9 [' O9 z
GFX VxD.! B% ^$ Z P" x9 u) r$ A( e$ W
3 [" c$ ]$ g) L xor di,di6 Y( A3 t7 J8 P8 d) x9 J
mov es,di5 M3 N* ] \1 s
mov ax, 1684h . p2 R$ _) K6 s: P! _
mov bx, 7a5Fh ; VxD ID of SIWVID0 g+ S6 \/ M9 K. _
int 2fh
! o4 y/ v. V$ Y3 o mov ax, es ; ES:DI -> VxD API entry point
: p2 B# `$ \* R, x' a3 F add ax, di# V& ]3 Y- d3 E& q2 ^; d! t4 M
test ax,ax
( r6 {9 w2 R P, O1 S K- Q jnz SoftICE_Detected" S# }% D5 A6 Y! ~
4 h+ x0 Y# r, |8 K__________________________________________________________________________6 K4 `/ Q. A9 k7 L# |
% d$ h h) L! a* s3 n5 x
" A! b( m" o# t# b& m# G6 CMethod 050 P/ e. ]0 C u7 M& @0 d. T6 S( Z
=========8 t' O9 X# w+ O; Q$ e
U- i) N# X D: |$ K5 W; i) P
Method seeking the 'magic number' 0F386h returned (in ax) by all system6 Y0 m! ~$ v/ d! {9 X4 B4 i+ ^
debugger. It calls the int 41h, function 4Fh.
* c. E4 D- e. A. @, m3 u! TThere are several alternatives. ) Z1 X9 t" L! p& Z ^
3 p1 o: ]* \; x; g: V+ U2 dThe following one is the simplest:
0 Q# _% m$ E- u3 a+ _3 }9 S2 S1 f% n8 u
mov ax,4fh V3 {1 U& E) h& x
int 41h. n T J7 F' U2 x* S
cmp ax, 0F3860 M' h: ?% J; \7 U
jz SoftICE_detected
/ G" i B( R( p- A8 p) U3 J& A3 P3 {1 s: ?# t8 o
3 S8 x8 Z( e' A0 N8 ?! }2 KNext method as well as the following one are 2 examples from Stone's
1 m7 C8 ]+ a, w. ~" F"stn-wid.zip" (www.cracking.net):
4 N6 A! f7 q H- ]/ S4 ]3 }1 k4 y2 }9 |4 B
mov bx, cs
7 ^ K' R. k' h8 Q8 R' ~ lea dx, int41handler2
8 ?! D$ i6 I9 t+ {2 u xchg dx, es:[41h*4]+ S( u4 [+ `7 Q( z- j: ~ d9 w
xchg bx, es:[41h*4+2]6 {5 g9 S% f/ d+ V- j) h4 G5 a
mov ax,4fh* i, e/ S; _% j; s; n1 F2 a
int 41h x& ]1 k+ V0 i0 G+ ]( I
xchg dx, es:[41h*4] V' V" O2 o, K6 ?0 k1 S
xchg bx, es:[41h*4+2]0 Q0 R0 |+ r7 ~/ I/ M8 ~4 u
cmp ax, 0f386h
& D7 M" Z5 n3 V, H4 F jz SoftICE_detected
* F3 O( p& [ S0 S m( z# o- c6 ~( u$ B
int41handler2 PROC
1 ?5 A! E" p; X$ Z& j iret- Z6 G1 s1 k9 h0 E8 r' l: ^
int41handler2 ENDP
% {# J8 ]3 m6 p# E' J; ]; |
# Y4 ~( ?# s, e: b2 L1 C7 @; _& L' Y" {5 e/ k7 k7 H
_________________________________________________________________________ m' G; B) Y* q- w0 g+ }5 ]9 n
8 Z. o. F1 r- ~' B' n3 j5 y
: j5 Q; ~# l9 SMethod 06; \- E8 x7 J+ q" y8 T- V% H
=========
' q) A! e2 K/ R" A! P$ |. l# j o% E: A
( [; c" i C+ L& p. `% y2nd method similar to the preceding one but more difficult to detect:
) `0 U2 Y0 Q9 C4 w8 X0 U/ w# e: L9 q6 z) `( y" o
- U5 @! y% |5 o2 T2 K6 g
int41handler PROC
/ N5 L/ d3 W2 B; `7 x/ k mov cl,al
. ^% H( H% a" j5 M iret- d1 }, W) J# V
int41handler ENDP1 ^9 }- N. X8 R" K$ Z% ^% F
s2 T# m+ f+ ]* O
( L% A3 R6 [0 j8 S. q xor ax,ax
2 e' b5 B0 _8 {3 H* x7 ^ mov es,ax
5 u% ?/ g- t4 { D Q4 m: a9 Y mov bx, cs
$ n0 J0 w ^; J$ v lea dx, int41handler
7 U; [; f# v Q3 X" Z- | xchg dx, es:[41h*4]3 c/ m6 l6 C) ?# b3 o2 a7 ~
xchg bx, es:[41h*4+2]
/ |( @/ v! W) V- W3 k in al, 40h
5 W8 g7 z" t$ V' W; a. K% J/ J. T xor cx,cx6 L' M. h1 R3 {' p: j; O
int 41h
, o& y9 H# V& t xchg dx, es:[41h*4]; x: s9 V. P% M2 g+ |. E# {
xchg bx, es:[41h*4+2]
: O2 Y9 E1 {) r; H cmp cl,al
/ Z' W' i1 Q8 Y0 m( {/ \ jnz SoftICE_detected
5 D+ ? ^! @+ V2 E0 F/ ~- O L5 ]- x: l' j, C' ?. ]
_________________________________________________________________________
+ F3 \/ J _9 H4 d6 W& [5 g. t @* t/ V$ `) a1 ^6 G0 e
Method 07
& M# y7 j2 Q- I7 \. J" U! s=========
% u. ^8 w7 G m* f' {% r# n
4 ^6 G- l, r# N; GMethod of detection of the WinICE handler in the int68h (V86), l* O5 J1 d& H6 N
, o/ O0 d& c- w
mov ah,43h
: d- i6 I1 j& q int 68h
5 L2 y2 v6 b/ Y) e5 I* @, f" N cmp ax,0F386h0 L4 S m$ N, x# T7 Q
jz SoftICE_Detected l$ x6 c& T0 d0 X4 y3 {- M
; o; ]7 _5 l: C3 T- u( J
7 Q+ _) @. _! }: o=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: E4 g* i( _* E% ? app like this:
6 _7 {# F) G( c6 @/ T' ]
M0 |. p: w! `9 d$ L4 }3 o8 j BPX exec_int if ax==68) ^# Y+ @" y3 J" I" M( Q& ?
(function called is located at byte ptr [ebp+1Dh] and client eip is
. q( I* M b4 W. a' u( f2 ^7 X4 Y/ N located at [ebp+48h] for 32Bit apps)
9 N/ h* ]. a3 Z( U% E. N__________________________________________________________________________6 {! Z) n- D: G" X( u" K
3 g7 |# K2 Z; A" i2 y1 V
- U. Z: v2 l; J$ r- ^, @Method 08
* ]( o- x' z! ?' w: v: q- f5 B=========9 H3 H: }1 s6 s! j, r# X
# a) P0 d" o- L: XIt is not a method of detection of SoftICE but a possibility to crash the
) ~3 H/ K( Y% X, R% q5 Y+ msystem by intercepting int 01h and int 03h and redirecting them to another
( D6 G8 b' C5 q/ g- I0 h6 wroutine.
7 ^3 O! M; V7 U) TIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 W9 L3 F: w7 qto the new routine to execute (hangs computer...)8 X. J1 F( w: R# I
4 e K: O" q- B4 g. S! C6 V% V2 u mov ah, 25h! a! R, g" W8 Z8 e# z
mov al, Int_Number (01h or 03h)
% i$ P; @% V2 V, R mov dx, offset New_Int_Routine: `, j9 b% ]& |2 r; b
int 21h
; C: {; r6 H$ t" I# t
' B) W/ J6 t6 x& E# N& [9 P__________________________________________________________________________/ P, }2 N# {, B' C8 G2 p7 G
3 ^3 M- j. n& V3 j% x$ lMethod 09
) E6 N P. W0 r7 m) h=========
4 l6 A/ |$ W! }& g3 v4 L; a" ^9 `5 s$ E
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ u% S g, d' g+ b
performed in ring0 (VxD or a ring3 app using the VxdCall).7 l& v+ ?5 N* i' L) R+ ~
The Get_DDB service is used to determine whether or not a VxD is installed
: h- X" Z2 M3 \( @" C6 Ofor the specified device and returns a Device Description Block (in ecx) for. |& k1 @) D% c: i; p1 w
that device if it is installed." V/ f9 Q' ]6 m" v7 A2 c
2 A2 F) J+ |2 Q7 @9 |
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID7 [6 ~( `1 X5 V# L) R) U
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
6 I7 A H: g% L! J- v" M; _ VMMCall Get_DDB
. Q9 [. d' [: y+ t$ u& R mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 ~1 }: u- |8 E( q6 K- f% G+ }! Q& ? e! B
Note as well that you can easily detect this method with SoftICE:% s4 {, H' c/ u7 i: f
bpx Get_DDB if ax==0202 || ax==7a5fh% i" ? c1 T% p3 g1 J2 L/ Y7 z* M3 m
3 g& f4 S1 h4 R0 m2 h/ \& B% w3 a__________________________________________________________________________
( Q, K7 U7 y: N `; T5 M
5 Y7 _7 J1 h, V, iMethod 10
4 T( f8 E& L7 N* f=========$ U) ^$ A" y. L. G- S3 A
4 s; T/ V" F/ k5 l, c=>Disable or clear breakpoints before using this feature. DO NOT trace with+ V( _0 G; k( w& _) D
SoftICE while the option is enable!!0 C# c5 U9 t4 {" M& i
1 x4 f* q& l0 ]" }& x; _/ nThis trick is very efficient:
* M- ~; T/ T5 ?by checking the Debug Registers, you can detect if SoftICE is loaded
Q3 w6 C5 r D u& P(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
5 Q& e' J4 d3 U f$ h; @1 Tthere are some memory breakpoints set (dr0 to dr3) simply by reading their! v/ N" {1 Q% B, o+ ~$ a
value (in ring0 only). Values can be manipulated and or changed as well
1 s1 t @8 a6 H* U8 m. f8 `( l- _(clearing BPMs for instance)0 H4 h; G" {) e9 F, `. [3 u
! I [9 u% q: G4 x
__________________________________________________________________________
U# u, a) T4 P0 Z2 m. g R7 _9 W4 c% Q+ p# R0 r* I q+ u
Method 11# o+ \2 t& R. y& s
=========
2 l$ u& U( ?' W2 {+ ^* M1 [ O c2 {$ b% R( ?$ r
This method is most known as 'MeltICE' because it has been freely distributed
9 H- R' }$ O! Svia www.winfiles.com. However it was first used by NuMega people to allow
0 c. Q% D4 V! B6 K' m1 tSymbol Loader to check if SoftICE was active or not (the code is located
; a6 c: ~" Q' x0 @inside nmtrans.dll).# Q( u3 g2 }/ q9 t. A, a; c. x0 K
% O6 K. e0 Q7 o. T6 EThe way it works is very simple:
7 \2 I2 |, h/ z0 NIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ P6 v4 w) o5 C Q
WinNT) with the CreateFileA API.- E/ [5 B Q1 v: K/ i/ g9 j0 i
( C% |9 F' I+ D, Z% H( _Here is a sample (checking for 'SICE'):. e, M. z( X0 f4 ?+ U* t8 L
3 Z1 y8 W* b- C+ ]; r
BOOL IsSoftIce95Loaded()
2 A; u( Z' q6 O' D, P. F7 j{: G9 Y* S- i/ N( Z9 a/ C
HANDLE hFile;
# _3 i% S7 p3 O) S hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, Y- ^$ N$ P3 A FILE_SHARE_READ | FILE_SHARE_WRITE,! C+ B/ K7 S! Z7 x' P
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: k _7 ]( h3 b1 N if( hFile != INVALID_HANDLE_VALUE )6 L! O# W! J( D4 q) s
{/ _& l( f6 R Z# n' A" b2 B$ i* N
CloseHandle(hFile);
2 X9 E: J1 \8 Y$ r5 `2 H! E- D return TRUE;
2 @% Z A: T5 S }
7 u1 v! D' G4 O' |% w" K( r0 C& i return FALSE;. F! Y' y n( w7 D
}2 b) B- g0 A% H3 z% B
) @& i5 U4 P0 ~" ~- j
Although this trick calls the CreateFileA function, don't even expect to be4 ~3 w+ @3 H( D1 O L' U
able to intercept it by installing a IFS hook: it will not work, no way!5 y; ]: A1 G) d: w% U$ y0 Y% w" i
In fact, after the call to CreateFileA it will get through VWIN32 0x001F( m R% c8 N$ {+ P( Z2 H( P
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* w/ ^7 g' U# T2 `4 wand then browse the DDB list until it find the VxD and its DDB_Control_Proc
- R7 d. }: \' p/ k2 S" T3 Gfield.3 ~/ N* b, @! S3 ?- A. I$ Y" X
In fact, its purpose is not to load/unload VxDs but only to send a " E/ N* _- x# ?; `3 h A2 @1 X0 H
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 X* G" Y A# M1 Jto the VxD Control_Dispatch proc (how the hell a shareware soft could try
- h' [, J, {2 b( }8 R3 n; F4 hto load/unload a non-dynamically loadable driver such as SoftICE ;-).
- G! `6 M0 @5 C4 h" `! ]2 DIf the VxD is loaded, it will always clear eax and the Carry flag to allow( t6 q; Y9 C+ y6 F/ S* E; C
its handle to be opened and then, will be detected.8 @3 U& z9 L& O! t4 Q
You can check that simply by hooking Winice.exe control proc entry point
, X6 e$ e/ l6 e5 v! Y1 @7 O# Vwhile running MeltICE.
3 z4 s. l3 `; r6 B* R4 n3 H! K3 U
, r- |$ k- v* {8 n8 Z t4 E0 }: n' |3 T( @
00401067: push 00402025 ; \\.\SICE
0 e L. T2 s$ O1 G: o# ~) q% n 0040106C: call CreateFileA' j, W8 P. R1 J) L
00401071: cmp eax,-001
7 u6 P: z% Z5 { 00401074: je 00401091
" S, X! Y9 B" q% I5 p: T
9 b9 B6 T# _3 C' A# u0 j$ W. p+ {; t! {
There could be hundreds of BPX you could use to detect this trick.' p1 h5 F8 P S0 c$ [! {$ u+ H7 C) o) \
-The most classical one is:1 I/ ?0 z `" A/ |
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||% Q' |) [1 a: C9 c1 W
*(esp->4+4)=='NTIC'+ X) O) G0 O* V8 F# W) Y" z0 _
. T9 \( P" r9 t3 t. V9 S-The most exotic ones (could be very slooooow :-(5 `8 v5 L$ t# z8 _! ^/ L% k
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
& z6 `; z5 ]5 r E- e ;will break 3 times :-(
! U' ~/ V( c2 w. k& y7 R. V
+ `. L, d) x; }-or (a bit) faster: / z( a% [# s( T% T
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ }5 V& E6 a/ C* O8 k4 r# @! G$ t7 {$ S% @/ C
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
: M7 G9 u! L4 x2 t( d) h ;will break 3 times :-(7 q. j/ [* Z) F0 g
) g3 N3 W9 a9 X4 Y3 Q( G9 d-Much faster:
! M7 {( ]3 d* L# h- P3 \: o- W* B/ l BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'" k) H) n; k9 G; x* W
% I" Q) d% {% [Note also that some programs (like AZPR3.00) use de old 16-bit _lopen& L8 b7 X+ N# W& c7 v, O
function to do the same job:
. W1 L8 }+ \% V6 C4 k, L2 c- X) r
8 e9 K' M( w5 L% C0 S push 00 ; OF_READ( Z! s* U T7 }: ]
mov eax,[00656634] ; '\\.\SICE',0
; B, C8 ^& L5 `$ g8 a push eax+ H% b2 H% R5 d5 J; Q
call KERNEL32!_lopen
. t9 p. t" c; c inc eax
; p4 ~' ?9 E* Q) N/ U jnz 00650589 ; detected- \3 \ P$ a, g; l. D
push 00 ; OF_READ5 T* a3 q: E0 e% n7 T0 F+ s
mov eax,[00656638] ; '\\.\SICE'! L+ \: X( ^* w8 A. S& t+ K
push eax3 s y( z# g# }+ Y0 X
call KERNEL32!_lopen) x# J* j% o. ?$ Z1 ^) g* W5 |
inc eax
1 B' d. R G) ?9 e0 `& Q jz 006505ae ; not detected
: ?: S( j. O! B* w) A7 J, D% F8 D8 ^ n5 c
/ _, k& o0 s7 s" G+ U, I+ @% h
__________________________________________________________________________8 {5 s. A+ C7 y M2 F
) f4 I# X+ k; W0 s. o5 c& f! jMethod 12
$ y" i5 ^7 w( w0 i& b=========3 F$ R6 w* p! e; q
, r* O, i% Z2 l5 rThis trick is similar to int41h/4fh Debugger installation check (code 05
: a5 M7 z, A3 H* v+ K5 o& 06) but very limited because it's only available for Win95/98 (not NT)
# X+ E1 C5 s1 i/ H1 `as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ ?+ A* R6 k9 k& ]5 z5 i
. Z: y# t2 d& c& v push 0000004fh ; function 4fh
: N2 ?8 P' B3 x push 002a002ah ; high word specifies which VxD (VWIN32)
?1 x* [# q: p% V' n ; low word specifies which service( d5 R7 p2 @( F# z) `, p! |* [
(VWIN32_Int41Dispatch)5 x6 G/ h0 `1 b% a
call Kernel32!ORD_001 ; VxdCall, R; J$ _$ x2 x h* R
cmp ax, 0f386h ; magic number returned by system debuggers4 l- {. {; K+ J) K: ?2 ~; i. l6 k- w3 L
jz SoftICE_detected
) k+ a. e" K+ {- Z$ ^& O$ W/ {
4 N/ q0 c* W' {$ w" z) }6 u9 Q% lHere again, several ways to detect it:( M+ z0 t, x, M+ x* W6 q8 |, W
5 Q+ i s6 V% M BPINT 41 if ax==4f
}+ f, ^% V, H! s% o
3 X- H# a4 a" { BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
' e1 S$ [, o, O: T7 m6 H# T4 ~
. p; ^; M* v! c1 L1 o$ i2 p# b; W BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. n" e. W% D% h# y: d* | R$ z1 J2 q
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!" E$ F- X4 t" O& ?, d$ w( K3 n
- Z1 r# y" ]- A: }' H0 |, ]
__________________________________________________________________________
# c# w& \. ]( q9 t$ `( k0 S" t0 H3 }4 s2 X8 b2 C' _# w" b
Method 13' R: _( s4 y. l( L: ^9 ]
=========
( L; t. e2 {% K1 [9 Y* X. P
+ _9 G8 M L- Z6 t4 N- K' ~ }Not a real method of detection, but a good way to know if SoftICE is8 B4 n/ x2 O' r% ^- U, d
installed on a computer and to locate its installation directory.' g. }& s$ m% G4 [4 Z' K. m: L' J
It is used by few softs which access the following registry keys (usually #2) :* \ b* w4 d( n& h; f& s
# b8 }7 M7 I; Q% Y0 g( w-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 C/ H4 h) X7 y, P. j* q\Uninstall\SoftICE
# e! q# L% D, B [-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! s% z$ y" Y2 e0 {3 m; G5 s$ v# [( p-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, _& p5 Q9 J* y. Y9 f) u k\App Paths\Loader32.Exe# P- k: g7 l7 L6 c
9 R+ _# g) d2 H) |1 C$ m9 J( m
j4 b+ e- U) u' R% W- G1 X
Note that some nasty apps could then erase all files from SoftICE directory3 N' z) V U. k! c
(I faced that once :-(
9 _3 ^1 i5 n' K# R+ ^7 y ^/ g( U+ _1 i+ f1 @" b; y# G
Useful breakpoint to detect it:1 X! |0 l* \8 L
Z4 ]& r& ^7 Q' @! w
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'5 n5 A0 i# h0 n$ M2 D! M
4 K7 q6 T, Q$ g3 [
__________________________________________________________________________
1 Q" E4 e: l1 ~( d/ H; x* S9 V) |
4 O q6 G) ]* _4 z" H' t U9 z, B; d
Method 14
/ u J o; v0 z; N4 ]* ]=========5 T5 ]. [+ n# D1 V7 V* Y
3 _" g( O/ x" f* Y' w
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose( w0 L6 G5 z) l2 Q: T2 K# o
is to determines whether a debugger is running on your system (ring0 only)./ ?3 I6 I _; g h$ D
( O+ M# u, m B% C
VMMCall Test_Debug_Installed. k: E& v3 s5 e( ~9 J
je not_installed6 B3 O1 J8 C7 _! I/ d7 F
4 M* X) ~3 Q. aThis service just checks a flag.$ R- O3 f6 g" y
</PRE></TD></TR></TBODY></TABLE> |