<TABLE width=500>9 t' w) `6 f8 x% Y4 j V
<TBODY>
0 F6 Z! s+ E ?! m3 u<TR>
, }. p$ Q' S2 ?4 Y' }<TD><PRE>Method 01 . Y7 N) o: z" |. Q
=========% E9 Q8 O' J% k% e3 K3 x+ {. Z
- b2 q' F/ b! `
This method of detection of SoftICE (as well as the following one) is
4 o% B9 A+ X% P: H. bused by the majority of packers/encryptors found on Internet.
. y( N) E, ]6 r( t' X' wIt seeks the signature of BoundsChecker in SoftICE
! R4 G0 k6 X* N: E' X7 {3 m
. l# g. m9 Z; B3 y mov ebp, 04243484Bh ; 'BCHK'
& r9 P/ ]- Z* J; i mov ax, 04h
) `& E3 e' m; D int 3
1 L6 ~9 I) ^+ J) N4 s4 a2 [9 Y' f3 ` cmp al,40 G$ A _5 y* p( Z( U# ]
jnz SoftICE_Detected! H0 |% I k, _( }1 P* f% N1 D# B. \
" d4 \( p* u; h+ G0 R
___________________________________________________________________________* k# B# A* L9 |% s. A8 ]
, L+ O1 d V+ [; W3 t( JMethod 02) B+ e1 f5 Q6 w+ T
=========
1 S! d3 O8 z$ [. p, ^, M( B
2 V; `- j3 z6 Q6 ]Still a method very much used (perhaps the most frequent one). It is used0 X* @$ ^. b0 F2 \& ?
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 v& @: w. {* Q% {8 f* _2 G) nor execute SoftICE commands...
* w8 T0 e- l, `% ]2 [It is also used to crash SoftICE and to force it to execute any commands
V4 \; W. A8 W3 d% `, I8 I4 d6 b(HBOOT...) :-((
# m& m2 P* p: ~1 n) y8 f d
8 f& V5 D0 {4 WHere is a quick description:
2 a D0 l2 A! p8 q/ ?7 ]( T3 D1 W-AX = 0910h (Display string in SIce windows)
5 ~( I% [3 o! h8 O) S-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 _1 S) d4 T3 ^) R2 A+ k
-AX = 0912h (Get breakpoint infos)1 R8 f8 y/ C* o$ J- h
-AX = 0913h (Set Sice breakpoints)% z( u ~2 m4 _' W/ u' z
-AX = 0914h (Remove SIce breakoints)
7 A! Y" M( Q a, J2 i; l8 U8 u
_% Q1 M$ @. P; ]( _( MEach time you'll meet this trick, you'll see:
9 |, f" u' x2 s* ]-SI = 4647h
5 T! k. b8 H L7 k+ c/ P' `. q1 g. }-DI = 4A4Dh \7 a% J* J% }5 _" c
Which are the 'magic values' used by SoftIce.8 N! d* Q3 o# M" x. i& I- q. B Q
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* Z/ g! X7 c$ [2 u- \/ \, ]# X V3 i; `+ k0 h) @& Q
Here is one example from the file "Haspinst.exe" which is the dongle HASP
; ]" {& {; A' I; w+ T. }0 D# \Envelope utility use to protect DOS applications:
. e9 v8 |( Y8 U( o# q2 {% }* k4 ~) P/ Z9 @
7 a4 N- c# {# h& |( Y/ m! O" G- }4C19:0095 MOV AX,0911 ; execute command.
1 h2 _5 [+ `* ?1 q0 t. q( U4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
( z: D( x# l& g' i. S4C19:009A MOV SI,4647 ; 1st magic value.! e- }5 A% {) i1 z" n# Z
4C19:009D MOV DI,4A4D ; 2nd magic value.9 v( b/ p" P( E j5 Q! j
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* ^7 V' \: C9 k2 p0 \
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. ^ Z, `+ B4 R/ _
4C19:00A4 INC CX
5 I* j0 {& h& y. n% `4C19:00A5 CMP CX,06 ; Repeat 6 times to execute! K; s* V: T/ u' O p
4C19:00A8 JB 0095 ; 6 different commands.
- C5 G8 z" a, ^0 e4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 x! _: G6 `# w: D
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* K2 X1 q* { L9 s+ H. V& u( `- o; R1 j
The program will execute 6 different SIce commands located at ds:dx, which
$ e) ^4 r R- C, ~5 m! U% {7 r5 gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; ~- s A/ a( e' Q3 v3 W
" X# A9 E$ G4 N( G8 ]. ?
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 d' I, E! Y. s+ _1 S5 e
___________________________________________________________________________
: U4 H }* u3 r6 s" L( b I
C, u0 g7 e" z) l0 \
$ ?: m& ~3 P& n" a8 F; O& B6 mMethod 03" F m {& f$ ~$ U x Y
=========# W4 S: z$ ~- E7 F
/ q& K c1 q( h ], g MLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. h; D/ ` Y8 I" O& {( {4 A8 w' x(API Get entry point)
' N) t9 \2 w1 O9 ^! a% p , K% B C" W5 \- w
2 a9 i1 \$ R! o
xor di,di' Z9 v c/ g9 @- D
mov es,di
, L$ G. g L) `6 f mov ax, 1684h 6 }: K, ^# C) n! R B* e" i; B2 p
mov bx, 0202h ; VxD ID of winice ~+ V- P ^. K4 n4 B
int 2Fh1 R5 M2 p3 x/ L. i2 W
mov ax, es ; ES:DI -> VxD API entry point
4 P( ^0 u' {% T5 [' q" ^9 I8 E add ax, di
8 v* {2 A. ^ `3 g0 E) x test ax,ax
5 E. N( N1 `3 f- [( a jnz SoftICE_Detected# m6 _+ g4 q4 y) k. H; L9 a
5 s6 x! Q3 [# }' e. {
___________________________________________________________________________, t; W6 U! T& j2 f
G5 K2 \$ x) _; q! c# q9 XMethod 04# H# u. ~% F# i6 r3 h3 o. N, h
=========
5 i7 {/ j+ {4 J) k* V# {6 X4 [
& M0 C: U* ? @# T. T, aMethod identical to the preceding one except that it seeks the ID of SoftICE0 H: k2 w. D6 a; C5 Y; L2 K. k- v
GFX VxD.
) k v& Y4 U$ g9 U& C( E e0 z# A5 D% s( E8 v& g, q; z
xor di,di
; d& \2 ?. |. {$ A% G3 ] mov es,di4 U! p. }9 \' y2 x) b' G7 h
mov ax, 1684h
6 U1 Y* {( N6 e) v9 [" G mov bx, 7a5Fh ; VxD ID of SIWVID) S. y" |* L/ h' T8 L, ]
int 2fh8 O, y9 k' i* b; D8 y7 w0 n& J1 O3 ]
mov ax, es ; ES:DI -> VxD API entry point
! z, y; G: L/ O- A( M2 I: a add ax, di9 c- B3 u* n5 e( R% b. Y8 y( y
test ax,ax
2 G5 w2 y( z9 v jnz SoftICE_Detected
; p0 l3 t9 I) z) T
' E6 o2 O. a$ g; ]0 Z__________________________________________________________________________! Y- o$ K: J/ y) X& R2 u% D
7 q+ W& x2 h X' q. g* ]
- d5 ~- w5 n m" wMethod 05
+ K* q- G4 n5 @# y=========
# Z. W1 f- r2 R5 u' U8 f( Y" [: O' L
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 V9 [4 F3 o$ j2 l- v/ |. c6 h5 X Vdebugger. It calls the int 41h, function 4Fh.
0 U- m# n+ S& \* D6 ?% RThere are several alternatives. 7 |) _* i" n" v8 s- J
% c. e0 f% S0 h" l) Z0 _. \' A
The following one is the simplest:* S7 `% h% ?6 @1 Q* U$ c( G/ l# O
# L+ ?- u7 o1 M1 C- \2 [
mov ax,4fh* V7 r# q* ?2 G
int 41h( O( r9 k: N$ A e) o
cmp ax, 0F3860 p8 V. x8 M3 p
jz SoftICE_detected
4 x3 V9 p. o9 j( C, @6 w, B( n
2 h5 J0 G+ d) t5 `# v2 `% y
" @$ _3 D8 L) S; J- `, [Next method as well as the following one are 2 examples from Stone's
4 P% n7 \7 l4 S7 l' I Q) q5 f"stn-wid.zip" (www.cracking.net):( f0 @0 S! Z% D8 l( S
5 u" h2 w4 o' N6 q* e- N
mov bx, cs
9 I; G" L) ~- a" C: u+ L3 m lea dx, int41handler26 s: G/ C4 B( Y4 [: ?+ Y% B! Q
xchg dx, es:[41h*4]( {/ C- `- E. b. Z
xchg bx, es:[41h*4+2]
5 E" b; H4 L" C& Y7 n; ]+ ` mov ax,4fh+ C' y, c8 l1 C! ?( N1 |: m- {$ Y+ j$ `# R
int 41h
6 h8 j' i9 {' P$ m8 i xchg dx, es:[41h*4]6 A- i3 b; V6 e/ \6 i4 L* F; x
xchg bx, es:[41h*4+2]
5 ] M* ~: m6 `0 ?; J cmp ax, 0f386h9 o$ v* H) n: Q7 } |2 @. m
jz SoftICE_detected0 ~. q) T, [! M4 L$ D! h% e3 M
; T- J3 Q i3 i5 K4 d2 ]# w5 n
int41handler2 PROC
9 {9 j6 O1 }& Q( p. `2 B iret
. Z. X6 e, @: T7 Hint41handler2 ENDP+ K, w: v& M: y* v/ }8 _" {! q! Y3 W
" g9 v: `/ z4 F% S4 F0 Q+ E7 [2 }: y, b1 G7 D1 V
_________________________________________________________________________3 q7 M; \/ u8 h7 A
) a1 T5 z4 m8 O% l$ d& `: \! l
7 i( k6 C" F- W, u: o. b3 N: {: P5 ]Method 060 l, d- F. M8 Z) |
=========
1 V% u0 I3 F/ E) h1 {1 V6 N) [) v3 I% m; [. }) w& k
$ c" @4 v6 I3 D2nd method similar to the preceding one but more difficult to detect:
% |2 l }1 `/ J; O
8 ?/ v4 b: c3 [5 Y# v
3 D4 ^, M# T2 p; |/ wint41handler PROC
E4 V5 T( I: d0 F1 @ mov cl,al
1 w& s. A" f+ Z& ~ iret
z6 I" W2 X# U! Uint41handler ENDP0 F/ w; u; V* k4 K; Z# h
$ r8 d8 z: u4 W: @+ l- n- m. I! U" ^
' h; A2 J4 }) q/ `& k* P0 Y
xor ax,ax
- N( I" T3 I2 g' z mov es,ax
& t; }! M# ~! `( p mov bx, cs! a& c* A1 M" K+ i) p/ `1 q8 u
lea dx, int41handler
4 o. }8 f, K6 x% O xchg dx, es:[41h*4]
# d; _# k- J0 b5 B6 L) D xchg bx, es:[41h*4+2] C0 K" k& k" h8 [& i
in al, 40h( y [! B3 f, |0 b9 R
xor cx,cx
5 Q7 c, R0 }! L9 Z1 n int 41h
9 B" A, }' P) d* z9 z f Q xchg dx, es:[41h*4]+ f \' w( {6 G/ X
xchg bx, es:[41h*4+2]
( ?+ N6 d2 e# G0 c& t4 Z" T6 q cmp cl,al
7 i% _" N+ q: A$ E* W m jnz SoftICE_detected
9 w! }1 g! x0 n; O
0 G7 e; g, m+ N_________________________________________________________________________
+ `# Y6 @) K1 H. H
2 ^0 D# M$ B- P$ [5 K% pMethod 07
, }: n5 |/ k% X4 T+ v+ a; Y& |. M=========
) D" S0 M+ |6 P7 @% E2 q5 j: H
Method of detection of the WinICE handler in the int68h (V86)6 n9 H3 P9 ?& s3 R+ r+ P
- W" q5 V) i9 R# E+ d8 B mov ah,43h
- x1 w) w8 C' R' d! Q int 68h
' q5 U% M' D5 t7 F) F, H1 m cmp ax,0F386h
5 [ H0 p: Z, R jz SoftICE_Detected3 i3 W0 P$ Z; c: p* T2 O B9 r
* S1 t6 L0 U, Z8 ?; q# f f
Z, ]5 E0 Z4 i8 d=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
; D7 _& ?) Y6 l3 l) Y3 `- f: r app like this:5 ^% M+ t* R7 N6 ?5 @% r# n' d' G. a
' ]8 T6 \! n4 a6 z' ?
BPX exec_int if ax==68
2 \5 w8 _; y& E0 s" b/ J (function called is located at byte ptr [ebp+1Dh] and client eip is b7 X& g& r4 S* Z% N
located at [ebp+48h] for 32Bit apps)/ a, H- ^; B& B& `+ ?. I2 S$ ^/ \
__________________________________________________________________________" Z, u4 O& p3 ?% y6 T, a1 J! z
& C0 y! \& \2 h
3 s) e0 B+ W5 I) t" vMethod 08
* A C2 C o1 r( U% m=========1 C4 t! ~ W- @* Y1 [; o
* `' n& [7 W: e4 qIt is not a method of detection of SoftICE but a possibility to crash the
% d; [" o$ f+ _0 A0 i vsystem by intercepting int 01h and int 03h and redirecting them to another0 ^4 x, s# _8 i" I3 {: @5 i
routine.( h8 J4 x" }/ k& p- q3 h4 _
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 u. ^2 q2 v% V# }to the new routine to execute (hangs computer...)0 A7 ]6 q3 J5 y0 E$ H/ H
5 o( a6 `/ Z7 O% }! T& _: e mov ah, 25h9 w- P, j4 A$ C) @( M
mov al, Int_Number (01h or 03h); Z. g0 @- h7 p9 ]
mov dx, offset New_Int_Routine
% N8 {5 O. w5 v6 A int 21h
+ L5 n* s9 y9 b7 G) R4 m- [% t# I
__________________________________________________________________________
4 } w! T1 P* z
6 Q# k6 l' `% S9 oMethod 09
+ ~: H& _$ x8 s% e1 @=========1 {" G# x" S$ Z' R; z; D
1 i V7 V% `/ h' a1 KThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) Q+ z7 Z3 ^7 [6 ]
performed in ring0 (VxD or a ring3 app using the VxdCall).) a6 p' l& V/ F
The Get_DDB service is used to determine whether or not a VxD is installed
+ A/ y; j V% X1 }) [ m; v, }for the specified device and returns a Device Description Block (in ecx) for
- P0 u [! n6 I% E% ^9 J. qthat device if it is installed.7 m: l, I2 \. G+ Y, n
$ i; y6 G4 T- |/ y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
+ [0 f8 `9 q: j" A( U" V mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)" H% S+ L9 r7 K0 x7 ]$ t; g
VMMCall Get_DDB
- n& C8 w r% Y1 O5 v! D mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed3 Y$ f& I- i2 i2 H" W& `- @. d
- {5 h! ^9 p3 v( A5 r! b2 LNote as well that you can easily detect this method with SoftICE:( e$ r9 n R' \) J" F! ~
bpx Get_DDB if ax==0202 || ax==7a5fh2 b/ t4 q5 ]1 C7 z. N, G, Z
2 m2 R; X% ?" E3 m4 d; j__________________________________________________________________________$ r2 o) O8 g. N/ V) Q$ A, B
8 }" g7 a P$ N% a/ CMethod 10+ ]' ~' D0 v. F9 X
=========
0 g5 u! W; X' |+ z2 m j) x. s/ t2 R6 U* X$ g/ Y
=>Disable or clear breakpoints before using this feature. DO NOT trace with( ], F9 F; C' M: c( W( O7 d
SoftICE while the option is enable!!
2 u* o5 Z8 t9 x* I F3 h/ K" n+ O2 Y0 L5 V
This trick is very efficient:3 G W4 e& l7 Q8 Y ~- K q
by checking the Debug Registers, you can detect if SoftICE is loaded
6 u0 R9 a0 E8 w; i+ e# ^ |(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
8 }- x( n4 j+ Y+ h. \" O3 z5 athere are some memory breakpoints set (dr0 to dr3) simply by reading their
& F5 ?7 ]7 }, c& d) u/ y- L, [# tvalue (in ring0 only). Values can be manipulated and or changed as well
% C" k6 w# x1 D0 s0 r* K(clearing BPMs for instance)
5 R0 d# O7 G# x+ _% l, l& d
7 x: o/ U& P! [. o- L; a__________________________________________________________________________! {! V% ?# I3 M
" X0 n( [. `0 f8 a( Z
Method 11
0 g9 k. Y( j. y6 O+ z5 D; v=========/ l0 g' t- a! p0 ^
* |7 M- w2 k# I( U+ {This method is most known as 'MeltICE' because it has been freely distributed& w* K7 G( n3 E+ Y( ~& ^0 [9 I5 L: e
via www.winfiles.com. However it was first used by NuMega people to allow
& h# b+ f4 F% t( v( cSymbol Loader to check if SoftICE was active or not (the code is located
' P8 h- [0 n3 qinside nmtrans.dll).
% M4 |% v2 E1 K. x3 p% { L; a% H6 w0 v" S# a. B' r% `
The way it works is very simple:
8 ?5 A/ p" i9 Y4 jIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
2 s2 c# l' O) H! a) IWinNT) with the CreateFileA API." g5 _$ b9 \% @8 F( W
x1 C/ o# u/ \, d" ~
Here is a sample (checking for 'SICE'):
u$ `0 v0 H! E
, _9 P' M$ X6 C: Z z" tBOOL IsSoftIce95Loaded()
% o( X4 {! d5 S2 T{
' f% t' m( q# K$ Z6 T7 b HANDLE hFile; 0 t" W6 d# q$ o$ I. h/ f6 ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
/ Q- K; A, I9 \- J; _ FILE_SHARE_READ | FILE_SHARE_WRITE,
! u& n3 _+ y' j3 e: k: z NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
8 B- Q0 G. h s: E. l, Z: W if( hFile != INVALID_HANDLE_VALUE )
/ U( u( w' c$ @* U6 A) L- D {) }1 z, _' D5 A. s- P+ [
CloseHandle(hFile);! _8 O' M! O! B; k
return TRUE;& H$ _8 Z" z# Q; m& B6 y
}
+ e1 E# U! K5 B' R return FALSE;3 V, N ^6 N- R2 [: p
}
4 \( S) z3 O7 J: e, g& S0 W' `# Y' t# G
Although this trick calls the CreateFileA function, don't even expect to be
) R6 Y9 Q) q5 b' Z& u! ^/ table to intercept it by installing a IFS hook: it will not work, no way!9 J; b5 m% |, @* K" i4 ]& r) V1 j
In fact, after the call to CreateFileA it will get through VWIN32 0x001F+ I* E1 a- F% {+ m3 |8 ]
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function), ^2 [0 y: i- U8 y
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ O, K/ F5 K' o' l0 x6 `; `& K( I
field.
9 K' V/ |; `, q* E* ^In fact, its purpose is not to load/unload VxDs but only to send a 5 P3 I7 e4 v& H8 R
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ J& ?( O' C& }( _1 A& o
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 @4 K) K* N9 N* tto load/unload a non-dynamically loadable driver such as SoftICE ;-).
* |6 T) n4 o8 X8 |If the VxD is loaded, it will always clear eax and the Carry flag to allow# Z- g3 n5 w% {
its handle to be opened and then, will be detected.
7 `- D2 A3 `/ B4 CYou can check that simply by hooking Winice.exe control proc entry point) r+ D2 a y& |, E, I$ P/ ]2 y
while running MeltICE.
% k# Z, o& ^4 `+ G5 v/ w! D. `3 e' m; P0 `- N6 `
8 P9 B" a- \/ _5 P- E 00401067: push 00402025 ; \\.\SICE: {" l& ^& ?1 _) ?1 r! H
0040106C: call CreateFileA
& j2 ^; W$ Z4 }* a6 i$ a' x 00401071: cmp eax,-001
% x5 J. W6 g* U8 L/ q4 ^- d4 p 00401074: je 00401091- Z, M. |$ u% C: l
# s2 j9 Q: x. H
" E( F! B4 Z. A. f$ u
There could be hundreds of BPX you could use to detect this trick.& o- b: a( j* C0 o& ^6 M
-The most classical one is:( K; ?4 a/ [0 t6 U7 i
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
6 N- b8 F% k8 j) y9 J6 c *(esp->4+4)=='NTIC'' }, N; a, r" y3 y! w
7 t4 T/ ^% N9 I9 m( L+ Y-The most exotic ones (could be very slooooow :-(
! m7 N: Z7 C4 M+ k BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
) V# s+ K, t6 m% f( R5 } ;will break 3 times :-(9 f/ R, h8 J1 u# n
5 @% ^" o9 o8 e( V$ t! w
-or (a bit) faster:
* V: k! n3 g1 }5 N# C' d' Q BPINT 30 if (*edi=='SICE' || *edi=='SIWV'), P5 R' G6 q9 E) j6 T
5 @2 y, t7 W/ o* {+ n
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) Z" c' l6 H+ L8 K/ F: ^* G. l ;will break 3 times :-(1 I% B. B$ h8 j2 f8 d; u2 A6 U* m
& p% G% X# P* ]% t. ~-Much faster:
9 s; Z2 D* Y/ Y, i: M4 Z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
/ |1 O) ~9 [0 b8 T$ q9 g2 Y0 U9 r3 |) p! F3 {. K
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen4 I0 e4 i# i9 e3 a0 a8 W% l
function to do the same job:; w7 S3 U: {8 J" l& F! t
" G2 q1 R7 j( w) D6 W, j3 S
push 00 ; OF_READ
% {; F- C. ]1 L# k5 I1 Z mov eax,[00656634] ; '\\.\SICE',0
& J" v# I4 d4 ^' U6 y; Y push eax
) u6 G# t+ i( h* V8 C call KERNEL32!_lopen% X+ L, |: D0 z6 |" ^
inc eax
( y/ p% m# n. X: h1 W2 B jnz 00650589 ; detected, j5 ?1 o3 A, E0 q+ G5 `. R" Z
push 00 ; OF_READ% r( }8 k7 M( n5 R: N; t- |8 M7 q' }
mov eax,[00656638] ; '\\.\SICE'
; H& `+ n* W* p! m push eax
- l2 V8 c6 b; [$ a( P( K* Y, ? call KERNEL32!_lopen) G% h' y" K. ^+ ^
inc eax; l- H; g. Z9 ]7 \0 {
jz 006505ae ; not detected
. a; a. o' V* z8 Z* L! O5 G0 E
V0 {$ u9 Y- r5 j6 V# ?
! l3 g. q5 r: o: U__________________________________________________________________________% M3 U" x8 n9 u* f$ J1 C
6 y, \ Q$ }) A+ Q
Method 12
5 K, D% R# M9 R5 e1 m* D=========( n9 V* z, Z9 b; Z2 `, q! a
7 W" B' m+ T2 j w5 ^This trick is similar to int41h/4fh Debugger installation check (code 05: Y: K, |4 N' ~: \
& 06) but very limited because it's only available for Win95/98 (not NT)! a3 S' ^, x" T6 }+ X, r8 L
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
9 f7 a8 q4 E0 h( A, [# z7 d1 v3 i6 E X4 O
push 0000004fh ; function 4fh
1 c. M( S0 R8 j& b push 002a002ah ; high word specifies which VxD (VWIN32)6 J0 ^7 f! e: s0 q) _, R
; low word specifies which service
" T0 r1 f0 a, w1 d' H& c! F (VWIN32_Int41Dispatch)0 f: m. r& G% }
call Kernel32!ORD_001 ; VxdCall
/ x/ T6 s6 F% X4 w }; M) x) { cmp ax, 0f386h ; magic number returned by system debuggers4 A* J+ u* C0 t7 y8 ]8 j
jz SoftICE_detected
; X' b( |& d$ i7 B! V% I2 _8 t9 L/ G8 V3 c0 n4 Q8 W! Q
Here again, several ways to detect it:: Z6 R; S$ u) [6 ~% z! N1 W* J
' G2 F; K- D7 X- x$ H+ ~
BPINT 41 if ax==4f
0 c9 p! K0 A( `( n& y" ^- Q/ z
+ O, w/ e* W3 @4 K BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one& H% a4 w& m1 }
' S' d6 A" S7 A$ E7 S# | BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 `, g& Q* J' ^ ]: H$ F6 x
9 y; |8 @& n9 X' g! } BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
5 k* c4 s" n) m( _# [+ v2 C5 d& N5 D7 }
! N+ t Q- C' H8 @ d! Y__________________________________________________________________________
( s/ ^9 z3 }+ g0 l- }) E
6 y. ?- o# z& ?: |# IMethod 13
: n# u4 g5 z9 s5 Q0 P=========" O. d) U9 H3 f5 _! U* r
$ q0 E) ?; E' N A3 l
Not a real method of detection, but a good way to know if SoftICE is
: N% ?: h% ?+ d+ |0 `8 V% [! t8 Oinstalled on a computer and to locate its installation directory.
0 H/ |" F( Y4 r; wIt is used by few softs which access the following registry keys (usually #2) :
$ ]) h+ a) o, s* y8 ^2 g! A
2 b) R. T) m7 U5 @" O+ x: R-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% a! Q5 T$ l) A# c\Uninstall\SoftICE
8 T" Y1 |: r6 n3 y M2 }0 h-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; ~. ?3 p3 r: K( x7 H& o
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) |6 y5 p1 l1 o# q W\App Paths\Loader32.Exe* X6 X* K9 M, ~3 O! z2 f8 \
8 @5 @0 A; L6 [( K S: i. b$ m8 U% q# f# J" A" D `# C( {! I
Note that some nasty apps could then erase all files from SoftICE directory7 o- `* f- I+ v0 w& I7 k% u1 y
(I faced that once :-(4 [) L7 F5 k4 w& A5 y1 L2 F
% n5 }2 |4 w' @+ v; G+ w1 C
Useful breakpoint to detect it:
5 W$ ~( j+ m; C" d1 a: z
3 l q8 c6 @2 s9 O y0 x BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'5 J5 n& w. {+ N$ m6 |
( O8 K, z5 T1 l% s% L__________________________________________________________________________' z3 M p0 t2 A9 i6 I1 G9 j: D
, V) C* d3 r7 [: `
# o+ h8 i5 F+ j" X( \ _- I& A5 nMethod 14
8 H) k j6 i0 w5 Z1 w3 f=========
6 d* d9 a; Z, z5 {( b. R- ?% l
& s- d4 V9 K3 S9 IA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose }1 s( h) {% ?3 x
is to determines whether a debugger is running on your system (ring0 only).
9 f% Z1 b+ u1 l1 }4 ^6 P8 V' W1 j% w( I5 k' q; D) L. t7 d" e
VMMCall Test_Debug_Installed
6 B O3 `6 ~, I0 L; A4 ^8 W5 k je not_installed# W" L7 A5 f* r# `3 R. A
# n" O& s, ?* @
This service just checks a flag.+ H* U% n9 H" c. Z
</PRE></TD></TR></TBODY></TABLE> |