<TABLE width=500>
2 ^0 i3 X8 Y( u& s<TBODY>. P! e7 N) J* t: ^* I6 m+ S* J
<TR>& g6 [3 B; I0 ?5 u+ s& G5 @
<TD><PRE>Method 01
2 K1 N1 Y5 K" N5 F# p4 n I3 y=========& o9 Z0 C3 V/ v/ x" p# I X
: G( q, m. T/ l
This method of detection of SoftICE (as well as the following one) is; t& D2 S* R6 d) @6 v7 v
used by the majority of packers/encryptors found on Internet.9 I! S/ \7 \0 d9 x6 B2 Z
It seeks the signature of BoundsChecker in SoftICE0 h- }3 d% W7 _% o2 M
/ a1 M: r! {( B. Z7 `& T mov ebp, 04243484Bh ; 'BCHK'9 s5 z7 r7 J7 i5 \4 A" m9 e1 T
mov ax, 04h
" A. Z% e9 U: \# d1 L, E2 V int 3
" E% @; S0 H' y- c+ q cmp al,4; r V+ E& g4 ]! Q6 l
jnz SoftICE_Detected
$ L( b* c3 x4 _: d% Q% d" m% G; H+ c
___________________________________________________________________________' D4 K3 M- g& c; E3 R: M
9 C1 S* L3 i" G$ t* ~Method 02
+ X2 X: h: o1 y( k$ o, _=========
& }% S4 X+ A, F8 v& A9 k- h
5 |* K* B0 B9 n) B% l, x# k8 h% X* hStill a method very much used (perhaps the most frequent one). It is used: j7 W7 u2 B5 P" H: b$ }9 _
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
z1 y% e6 s" r2 q5 @$ cor execute SoftICE commands...
_1 M: U2 Y+ @+ vIt is also used to crash SoftICE and to force it to execute any commands0 \5 j1 `4 J; @' i0 k$ b3 q9 w
(HBOOT...) :-(( - N' V* ]1 n( }6 s) G0 f. ^- A
8 B/ A% V8 o6 I; B7 VHere is a quick description: d0 k$ F3 ~: O4 B7 T4 E5 o
-AX = 0910h (Display string in SIce windows)
- T' J2 O0 {: R' \-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- }- |7 _5 ^; v F. I
-AX = 0912h (Get breakpoint infos)
0 N2 H! h, Q3 j* j/ a$ ^+ Q-AX = 0913h (Set Sice breakpoints)8 x. h0 q+ }1 B! i3 \
-AX = 0914h (Remove SIce breakoints)
( f! w2 T2 A* z; C3 P
, f# B g9 B) F1 L' j% IEach time you'll meet this trick, you'll see:
( Y# {1 f- Z2 c$ v+ q9 b" b: B( {-SI = 4647h
* s9 A2 Y4 l" f4 `-DI = 4A4Dh. c$ v. n8 _# N# c1 s$ r
Which are the 'magic values' used by SoftIce.+ D+ S* k/ b9 t# `2 }4 F# i3 N$ _& j
For more informations, see "Ralf Brown Interrupt list" chapter int 03h., m# r; Q# r3 B% |- u* f8 ?
* F; a: [ q! O: @9 ZHere is one example from the file "Haspinst.exe" which is the dongle HASP1 x8 n* C) q4 y! G9 \, u9 F
Envelope utility use to protect DOS applications:
+ s$ R+ x; j' L3 K8 O6 n+ |. {% m" |6 u
, f9 C7 w2 V+ n/ v& V4C19:0095 MOV AX,0911 ; execute command.9 F: }9 c6 Z& K- n5 U9 X
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
+ ~1 g8 z1 D6 R, C+ U4C19:009A MOV SI,4647 ; 1st magic value./ d9 ^. i7 D* j$ O3 A
4C19:009D MOV DI,4A4D ; 2nd magic value.
/ ^; m3 _4 m: X& l4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)8 g ?6 A5 e2 b! e7 g" Q1 J
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute* n4 k1 C. B ~/ {- v
4C19:00A4 INC CX8 K7 r* U, ~& G, {( |, I* H
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 q9 v k% m3 j s1 ]4C19:00A8 JB 0095 ; 6 different commands.
& t( z& f5 w8 H4 ~; {5 m* r2 U3 N2 ^4C19:00AA JMP 0002 ; Bad_Guy jmp back.) O4 }2 @: I% A) ^5 r0 u' P$ x
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 ]+ C* q L4 ^# Q) [
' S6 I# v1 I. {5 Q7 U% ?0 a; HThe program will execute 6 different SIce commands located at ds:dx, which
; B, S* m+ x8 K6 }: Oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ N' U6 l9 k1 U1 \6 I9 E- k' J( O% W2 Q: o: ?7 `! X1 ?! T# J' a
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" d0 i0 c5 H# q8 R& r0 N2 A___________________________________________________________________________0 D+ K5 [ Z2 _% }9 f
& D- @7 B7 P9 c9 Q3 g) \) ^" g! K! L
Method 031 q; I# }# i( |; H8 C% H) j
=========7 i5 {( G8 K6 x# _# y& p
: W5 R' d: T/ J. g( o, r/ R t
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 O- v8 K* g2 G
(API Get entry point); [" s4 d$ T: Y
. L& D; M$ o9 j. b: S8 J$ j( }) Z
( J) `! z; S5 v x* h t0 \4 i2 i xor di,di/ I$ q; h. Y q4 O1 j2 _9 z) m
mov es,di* _( r& a% @5 `- C1 R5 ? ^
mov ax, 1684h
" R7 M" B0 q0 K3 x9 Z9 h mov bx, 0202h ; VxD ID of winice
" h; {( m6 [ \& a6 q* B int 2Fh; C( }! N" j1 ?3 o
mov ax, es ; ES:DI -> VxD API entry point( [% X, T/ C! q. x3 H5 M
add ax, di
- Q/ [* u4 F/ G5 u test ax,ax+ W9 x* W- I: S5 Y
jnz SoftICE_Detected
y: ~. O1 s. K- Z* D- J* P+ K% [
___________________________________________________________________________
% M7 A3 ]+ S: X0 R4 I+ x1 m9 I
: _6 u2 {* J: X q2 hMethod 04+ O9 l+ o1 b9 l o; j
=========
3 L$ n% g1 ~2 [; \
; h* A3 q' l+ b- g/ q EMethod identical to the preceding one except that it seeks the ID of SoftICE
! b8 D B' \7 p1 t6 k/ \1 g. U# SGFX VxD.% ~8 q0 D( R9 q4 l* k
6 f$ w* \# `2 X! k xor di,di' x. S5 H# n* i* q& ? T3 E
mov es,di0 M( O5 `' ^. t' |" M
mov ax, 1684h
( T$ o" Q7 N, a) ]5 l' A1 o2 z mov bx, 7a5Fh ; VxD ID of SIWVID J% z* x8 h$ `! ?
int 2fh* h! l7 P9 e: a) Y; Q* i
mov ax, es ; ES:DI -> VxD API entry point
7 f- W! n& _4 C add ax, di
" U7 ^7 F6 P2 U, `6 B( ?$ @. w test ax,ax
1 {$ _) p' ~! W, V4 X jnz SoftICE_Detected1 c; r' r6 v) g. g; u' H$ i. |
* Y' Y8 j6 s) R8 q" E+ b
__________________________________________________________________________" g/ D" B( ?% i- y
+ V2 `5 S7 i# `5 N1 O; A x# O+ }- T2 z" \* b! d/ f
Method 05( E9 G1 w6 ]2 C5 ~# _% y. U1 L% O$ p
=========/ M. ~: i8 U, w+ l! t7 Z6 _
$ A4 B- ^& i9 X8 e0 c7 \! @Method seeking the 'magic number' 0F386h returned (in ax) by all system
4 R+ I' J4 i3 M- ], [3 rdebugger. It calls the int 41h, function 4Fh.
0 }' O- E/ Q# R# }There are several alternatives. ; R$ x0 q. `, Z3 w
+ S& C2 s) G+ g1 DThe following one is the simplest:
# U, g$ \7 M- t! {( J+ }/ u2 J- l% h2 k% {
mov ax,4fh7 c; p2 U* B, }$ G
int 41h( r$ X* b: `4 ?0 w) C) T
cmp ax, 0F386+ w9 F% ] l. Q# F, n1 o
jz SoftICE_detected N( _) I0 r8 I( P' Y" I* f0 V
- n8 V; o4 |* R+ a$ D
+ d7 a/ z$ n7 H0 iNext method as well as the following one are 2 examples from Stone's
$ }7 \( n# Z Y0 o8 S0 V"stn-wid.zip" (www.cracking.net):
& a" Q. f& o+ x* O* U! Y
7 G9 `$ O* h/ |, a4 ] mov bx, cs* i+ }0 t+ T; U# V% L5 i( _
lea dx, int41handler20 u7 Z9 E# o2 r: l# s( g
xchg dx, es:[41h*4]( k$ {6 _$ I E; }
xchg bx, es:[41h*4+2]
3 \, U7 Q K! E mov ax,4fh( S5 i$ W& M+ h
int 41h* D$ b- q7 E* U
xchg dx, es:[41h*4]
+ o* {" p, w2 M1 `+ f xchg bx, es:[41h*4+2]
. z# w' I# ^) f0 ^ cmp ax, 0f386h
% D( m3 ?- }5 B( |1 c0 x jz SoftICE_detected
6 C. [$ F: d" ]6 E+ S0 j9 D. j- ]) X/ E$ E/ _5 F$ s+ E
int41handler2 PROC
7 |5 J# ^# D2 Y. b iret+ H4 C1 J* q/ T: Z( \$ y7 i
int41handler2 ENDP
4 C( i; q# A6 @6 F9 {
' H! g5 j4 ~7 F! L* v
4 S. M; Q$ P, ^% b4 r; n/ C_________________________________________________________________________
1 P6 n% ?9 X3 i; z9 |6 l# j. u; I6 f) _, L
9 v5 U* K; F. j, k7 `Method 06 r8 Y: c2 C" C7 F- ?, c
=========
[4 ^8 D1 i' a8 Q) W
$ K: f. C" O4 S$ K+ E
& p( g& Z6 E0 K% V& w/ B0 p ]2nd method similar to the preceding one but more difficult to detect:! F. @2 p3 Y1 R& x! |- G3 J7 g: y
m, A- k- g; n% B; q- i* p4 }0 y
. A' s& V$ a1 {) i6 v+ X) rint41handler PROC4 F( |4 G: f! K5 v& N
mov cl,al2 @. X3 H9 y* z0 N
iret( Z& _1 Y5 R5 V- u. F5 I" T7 G
int41handler ENDP
$ [" p# m! X1 s* [* V
0 K# h# I' ~2 q v# W9 o# ~- \: J/ f7 A; m) C
xor ax,ax6 `4 X/ Q- j2 t% d5 r* X
mov es,ax: y$ K$ [; ^# @. x0 n, y
mov bx, cs
1 X: x6 |2 w3 g$ ~) e2 o* Z lea dx, int41handler
m2 ^1 ~/ b+ l; R3 e T xchg dx, es:[41h*4]
" O) B. ]9 w4 u% o# x$ Q xchg bx, es:[41h*4+2]
0 K. i1 N; A2 A! a8 Z) r in al, 40h5 {6 v! Q5 [, h0 c0 e3 Z
xor cx,cx
; H4 ~7 |/ \! d% Q int 41h$ X& @6 L; P7 H: v3 W
xchg dx, es:[41h*4]0 C/ c N. L, x4 i
xchg bx, es:[41h*4+2]
0 ~+ Q. w, ?# C/ ^$ u cmp cl,al
2 o/ ]9 w. w/ l0 J* \+ O jnz SoftICE_detected
5 z7 q* W+ F6 r% j6 G9 K& x: d
8 z) b/ V$ |( ]+ J6 S& F_________________________________________________________________________. n/ O9 ^. L/ d. k# t. s
9 t, ]- o) x/ ^) e( ^5 _
Method 073 H. ?3 X' V/ K' y4 J% T& `6 B
=========+ B& [& ^6 ~( d& H- e2 ^& h
# e- f$ g' P: ~- K- S3 U
Method of detection of the WinICE handler in the int68h (V86)( U* B+ K& A) Y9 V& o
- J( r" d% y$ }: ` mov ah,43h
# s7 `. [( F& M* |# R7 f$ E7 a int 68h) D( P4 H( x9 L/ r2 D( F; \7 _
cmp ax,0F386h% {3 t3 ]' {* i
jz SoftICE_Detected
; d& r6 p. g5 E. z* [' d& b* F0 ]7 {
2 t, @$ z3 W5 O& [, W$ P9 b7 p
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
1 w- m. ^8 U* |4 K app like this:
' @+ e" m' B3 D5 P0 t( a5 ]! }( K3 ~' J, V
BPX exec_int if ax==68 L, K9 E3 o3 I& G* }
(function called is located at byte ptr [ebp+1Dh] and client eip is
' V7 c$ D+ g! R0 }0 V located at [ebp+48h] for 32Bit apps)
: N* Z3 X+ v8 K__________________________________________________________________________) T- t/ d6 v1 A* Y# Q
0 c- y6 Q. ^) r" o
; L) }( e/ Z% GMethod 08' D9 ?7 H3 J( J: I9 L+ ~1 X# \
=========
! h1 b( m! Q% ~. n9 r) _3 C# o( Y# r- G8 j' N
It is not a method of detection of SoftICE but a possibility to crash the( b$ z4 w# `' {1 s! x/ M. ]
system by intercepting int 01h and int 03h and redirecting them to another6 e' h+ i7 G. l5 \
routine.
# N. w. s! H+ b2 |* ~It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 F. j3 ~9 T- m) y, h
to the new routine to execute (hangs computer...)- D0 Z) [2 |, H- J% B4 S; f4 |4 F
) s7 \; \. k1 J4 K3 k& D8 c mov ah, 25h4 z$ O- m' a9 A6 e" p3 X; y1 ~
mov al, Int_Number (01h or 03h)& f2 W/ }( s' Y& l& G: Y1 t; J
mov dx, offset New_Int_Routine
' K+ n) Q6 e6 v7 | ? int 21h
0 d8 {: @2 u! n; s7 `
9 B. N* ^) R" N. y0 h6 Y__________________________________________________________________________( w1 {4 H( ?9 s$ P& {
! \) S e( `% t6 P+ \ k- l( B1 _Method 095 y4 Y) Y# I& |" @+ n+ o" i
=========
6 @7 k3 o' E# h% `3 y9 H! ~% p) ]4 i8 k3 c5 s7 W/ c
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only2 L6 Q' u/ }+ F
performed in ring0 (VxD or a ring3 app using the VxdCall).7 b/ M9 K) x5 E2 s4 R6 S6 X
The Get_DDB service is used to determine whether or not a VxD is installed% Z" h( o/ k8 \( Q7 o( L
for the specified device and returns a Device Description Block (in ecx) for. N) p. i# C# F- o( F+ S
that device if it is installed.
, B4 Q, m5 w. \; t
1 K# {" ^! x6 k& N7 s) B mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: N: f. v2 Z R( e6 _ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 ~9 G% f+ {! a- l VMMCall Get_DDB
6 p, Q K% _: E mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
# L/ s8 h, R3 _- e+ M
8 Q+ d3 A* g" p/ l% kNote as well that you can easily detect this method with SoftICE:. m9 i+ U3 D4 k q3 ?* a5 ~
bpx Get_DDB if ax==0202 || ax==7a5fh0 g1 _2 }8 I2 q
- t) L3 L& Q. }2 S! W4 _1 h1 |
__________________________________________________________________________
. C9 F3 r0 z' T' Q' ^- K/ R4 e
& a3 l! X4 M& f2 ?- @0 K: L( HMethod 10; K) v+ Q- v$ q2 M
=========* g$ a3 |& }* I4 Z
# [! l) | `6 v7 h7 [
=>Disable or clear breakpoints before using this feature. DO NOT trace with
3 o& T, U, p. Y SoftICE while the option is enable!!4 G# M0 s0 L/ }0 F2 K4 O
4 R" v5 D8 t" r2 K& A
This trick is very efficient:
) G" I+ e! y; \2 q; D! b$ Yby checking the Debug Registers, you can detect if SoftICE is loaded
7 b8 t; z- P7 ?1 U(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# E; b& u/ M- @there are some memory breakpoints set (dr0 to dr3) simply by reading their
6 f# J1 _5 ^8 pvalue (in ring0 only). Values can be manipulated and or changed as well! H0 O1 d* M( i- P* J" M4 S( r9 }3 B$ s
(clearing BPMs for instance), B" F1 B1 i$ O6 f4 y9 ~; T* G
9 t( A, H; n( E6 s* \* t__________________________________________________________________________
2 e; l1 Y2 L1 I4 N
* U9 y: \( F+ s* P2 ]Method 11# D8 `: r* i) Y2 m
=========
& l: @7 O: T9 Q! r7 t2 r. ^! }( f) ]
This method is most known as 'MeltICE' because it has been freely distributed; ]& j' U% W x5 i- z$ v
via www.winfiles.com. However it was first used by NuMega people to allow! V4 q3 e7 {: ~: Y
Symbol Loader to check if SoftICE was active or not (the code is located' z& d% g$ k% M" S
inside nmtrans.dll).
# ^, {/ o B0 M N8 [- o4 R' w C4 ], I* k% Z! U7 X
The way it works is very simple:
! W9 Y$ Q; S% O2 ~5 CIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) k* Y* a% y7 I0 F& ~ K
WinNT) with the CreateFileA API.
9 D! R) N' r6 Y, N L. t
, {1 l) [. P; @Here is a sample (checking for 'SICE'):
# ?- ?5 ~# g* `1 p! ]8 m
# @2 W6 V$ I" L4 o( [+ }% XBOOL IsSoftIce95Loaded()
- k; l! q; o2 I{' V4 n, y- z5 _* C
HANDLE hFile;
9 E3 K3 N! i H) K6 A }& _# E+ j hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, w$ ~% g3 w. U4 S
FILE_SHARE_READ | FILE_SHARE_WRITE,1 w& {3 ^) |$ U: ]4 A% o7 E
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);. n3 P' I; H2 l1 Y. j. J6 a. c
if( hFile != INVALID_HANDLE_VALUE ), x( g% f6 I& k* ^- n+ |
{+ s; g# H6 V& b; q- Y, d8 ^
CloseHandle(hFile);- Y% H" u8 ~( C9 k
return TRUE;2 u7 ~0 o5 w" e8 p7 S5 V2 ]0 O
}. I$ O- f P( H0 p* M) R
return FALSE;
6 J" C8 O) Z# E}
7 D$ g# L3 G6 m, Y2 m& l! G& A# g2 n; w' b
Although this trick calls the CreateFileA function, don't even expect to be2 G7 I. V+ ^# z3 \
able to intercept it by installing a IFS hook: it will not work, no way!
& c4 O/ ^" p) ^In fact, after the call to CreateFileA it will get through VWIN32 0x001F7 q9 s6 X4 T4 x* c
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' F$ h* L5 I9 S' V) k) _ dand then browse the DDB list until it find the VxD and its DDB_Control_Proc
' }0 z7 e! ^( qfield.! c2 g: G; A3 F
In fact, its purpose is not to load/unload VxDs but only to send a
) m$ j o4 r: \/ }! YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). B3 B h* f6 e. a6 R& n9 C. {; d: _
to the VxD Control_Dispatch proc (how the hell a shareware soft could try& q* m2 p- z+ E7 J) E
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
" Z" s- c. u3 R9 M. KIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ m9 [9 M+ Q6 v# S1 iits handle to be opened and then, will be detected.4 B7 H1 T8 W \/ k! [* q
You can check that simply by hooking Winice.exe control proc entry point/ }/ }, k- P2 l; ?) r
while running MeltICE.
8 E4 X. H% v; P7 I2 T1 A1 L- O" P( T; _+ }1 j: D; _3 d- F
3 k6 b/ _. t+ v, e! W* T 00401067: push 00402025 ; \\.\SICE
5 x& {) ?- m2 D 0040106C: call CreateFileA/ D5 r. U+ Z+ @/ g
00401071: cmp eax,-001
+ ~* o: i" G3 n% B 00401074: je 004010913 E7 I. r7 d" i; ^/ J+ D
) U& c" p# t7 N# Y" b0 g7 R4 _7 D& W/ h3 X8 q |4 J8 P- k
There could be hundreds of BPX you could use to detect this trick./ b1 w: n/ U! V: {' s$ J
-The most classical one is:. a* k- G2 e, F
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- ?% z$ f% U' V# b: Z: R9 x- u *(esp->4+4)=='NTIC'+ ^' b% z# U6 c5 X, X8 O
X! R( F/ T4 g$ b" }; |-The most exotic ones (could be very slooooow :-(& M' F# L% ` q! l
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 \+ H4 v5 D0 F( w
;will break 3 times :-(
; J8 h4 `- x! q; r9 _8 Z3 Y% G- P$ A6 R6 y. a" z
-or (a bit) faster: * v9 {1 n2 E# P
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
L' h. [8 l2 E( g7 p7 N K
* G5 d% @" x! @; n BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ ^, [, r$ M' ~8 u# w8 A ;will break 3 times :-(
* N ?8 Z' O) |
) Y6 w& D8 s6 M-Much faster:7 z8 y7 j8 z- @* Q) K; @! m6 T
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
3 O4 I8 s! ? Z; {0 z. b0 P# l6 _1 S- N) D8 v* s
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen/ y( x) H4 l$ Y0 ]/ r
function to do the same job:
& E$ R5 F0 e0 ^7 D$ u4 w% Q7 ~$ I% P( I4 }. x% D6 |0 f. V8 H
push 00 ; OF_READ4 {! a' B$ h; _, J, T/ P* Z! h: [
mov eax,[00656634] ; '\\.\SICE',0
% r$ D3 h8 l. h5 {0 t push eax. {3 N4 k" j" s& \
call KERNEL32!_lopen
7 O% @4 q. [6 u- v0 Z inc eax/ w/ @5 \( J/ X3 ]
jnz 00650589 ; detected
5 W9 H) U! C% _; X. ^ push 00 ; OF_READ
( @. L9 g& e8 M' A# S1 N mov eax,[00656638] ; '\\.\SICE'
( l3 E6 _) ?( w# |! _ push eax
3 \, T! Q: n* b. j/ ?7 u# l$ Q, g call KERNEL32!_lopen
- P* t; f, F6 D! ?( y inc eax
( U' E' g1 w1 R- E jz 006505ae ; not detected! Q8 e0 d+ g, N5 S8 c
% @( s9 j2 f/ c) t0 J/ f' ?# r: z- R. T4 B. K5 S- N
__________________________________________________________________________/ C2 F) a8 [6 g
8 n& J: U( V; Z' A/ ^, iMethod 12
9 f' L6 A" O* x1 y6 G6 ^8 S% {6 L=========+ z( }+ i+ _! L8 `6 k' [! i
/ ~/ H" s! Z1 `# U0 C2 N5 u
This trick is similar to int41h/4fh Debugger installation check (code 05
' b! M" n2 N0 F5 g6 z& 06) but very limited because it's only available for Win95/98 (not NT)
& R2 e# ?- W! ^; |$ f9 o# das it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, J9 \/ N1 I3 h# T) P, U, o+ ~/ |% ?& r. @; E/ w' O a2 j
push 0000004fh ; function 4fh( ~9 V; L! Z( q3 @7 x# a& I0 y6 k
push 002a002ah ; high word specifies which VxD (VWIN32)
) @* A. Y8 N' y4 w ; low word specifies which service9 u* I: A; i( K; h5 [, I Z( `
(VWIN32_Int41Dispatch)
6 n A2 T, |) w) A2 r call Kernel32!ORD_001 ; VxdCall
+ ^3 m, B; b+ d8 g cmp ax, 0f386h ; magic number returned by system debuggers
7 Y; v/ m9 T0 K7 N* W% M* Z- T. O/ e( {, T jz SoftICE_detected
# M, D2 O$ T( T$ y; _+ L- l
Q+ e$ A8 S' `Here again, several ways to detect it:
2 @- N$ `) G s; W& l/ v3 f6 q: L) v6 h) S( j+ K- e: s: j7 {/ _+ r
BPINT 41 if ax==4f, o3 `3 F4 |5 E% I: ?! W
0 B; ^, r+ s. g7 V+ | BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ ]$ [ j, s, ?( r
& C! x1 T/ L3 h6 v* b& t7 g BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
+ K' E& W+ D$ \) j U+ M: c6 a5 g# D& p6 O
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!& g8 R/ M1 z* O: n8 l( r/ y
* x8 K& V1 n. H$ t1 {" N
__________________________________________________________________________$ R0 k9 a- s4 d) z" b [
+ g- @2 L3 Z* k1 `
Method 13 [7 V* N! n8 |5 d: _4 v% \
=========
8 V# A1 }1 z1 o% q
$ h8 ~3 }8 b9 Z# NNot a real method of detection, but a good way to know if SoftICE is4 f6 T9 D7 z# ~& y& |1 o: r
installed on a computer and to locate its installation directory.6 I7 R5 ?1 S2 j6 d" m$ _- R4 i
It is used by few softs which access the following registry keys (usually #2) :' L4 g. A5 Y: h' w
* ?' M4 z- Z* O) _6 B1 C-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, [% } m+ D ~; S+ i) e1 I0 J, U\Uninstall\SoftICE
* \* W' S0 x6 b4 j$ t. j-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE( `, g! Y$ f- Q& B' Z- x
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 n: R8 [$ f) h, y( i
\App Paths\Loader32.Exe
1 ?5 T; q2 f- ^9 h! h( ?2 N
/ \7 r; E Q3 c" X6 O: ~$ b. y
7 @$ F; k3 m2 c' A0 E% j1 NNote that some nasty apps could then erase all files from SoftICE directory
) Q, Z* h5 J5 o( E- t o(I faced that once :-(% Z7 ^4 b$ ?3 v. v$ S: k# Q
& F1 \& m' q: n3 Y( g9 N
Useful breakpoint to detect it:! u2 {8 R$ M& U2 M5 U- c, O! a+ U! o
u. m; \0 a4 ^- P: y$ p" v BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 n6 H2 w) L3 W, U; x+ W
5 d. U: c4 [$ v+ k6 x0 L8 E__________________________________________________________________________
/ @' X; w; c2 X' u* u
( z' K" b* T" y6 u6 T# Q2 r
9 f4 ~( H f$ P8 C9 ]3 g! cMethod 14 ; J8 u3 R% E& y9 ~% `) n
=========
) Z& Q: [) l5 J& `$ V
* F$ N6 k2 M" H& k. P# KA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- \. E) M! x1 }is to determines whether a debugger is running on your system (ring0 only)., ], {6 M8 i( Y, b3 T9 C
7 q+ u5 e$ R7 Y0 k0 x; A' ` VMMCall Test_Debug_Installed2 B5 G2 J# R8 Y, R
je not_installed
- v, m* s% j Y/ V) ~1 p& U3 k4 u( s
This service just checks a flag.
0 G4 s+ A% V+ z. d</PRE></TD></TR></TBODY></TABLE> |