<TABLE width=500>1 x9 C& C7 J3 U, @
<TBODY>4 {$ j1 q+ z$ ]
<TR>
6 z1 d) |/ O. I3 a; |. t" x0 ]<TD><PRE>Method 01
0 p4 M: f+ |0 u- F1 Y6 q- n========= [% W% E a8 r+ d1 B
9 Q% y: e* Q# ?, @5 `* m" I T! iThis method of detection of SoftICE (as well as the following one) is0 S: p3 U- s9 `
used by the majority of packers/encryptors found on Internet.
0 I) [0 k: T! J: KIt seeks the signature of BoundsChecker in SoftICE
- o: @% q* l4 Y4 N9 Q6 j- |
( s$ \6 U- I7 l! R- K mov ebp, 04243484Bh ; 'BCHK'
2 J# d' g6 g) _ F: Y% H2 U mov ax, 04h4 h/ b8 ?- k C8 r) A) X
int 3 . j8 R2 w0 l% c" J# ^5 X- C6 f, e: m
cmp al,47 D% C1 y+ r$ U3 P3 e
jnz SoftICE_Detected1 q. s1 Z; _- J: W1 p
, O* Z* e- l, y- y, H A' F
___________________________________________________________________________
3 [+ W, j( ]( V
& s8 \, P& u/ x8 [# u$ \Method 02; s* b+ C$ t. N# `, u7 o8 g- Z
=========( r: G7 C" A+ g- y- P$ X
8 m; e' I. P% j* |. O
Still a method very much used (perhaps the most frequent one). It is used
+ X7 \! o9 o) \. H v' X+ v, qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ u: ^. k* C/ \* t5 @4 mor execute SoftICE commands...3 o5 ~: U' l, `3 K
It is also used to crash SoftICE and to force it to execute any commands
; \, J$ z! Q& q3 _* G" E(HBOOT...) :-(( , L- N: } `1 j/ i2 C! ?" q7 V
' ~3 K. ]" S9 ]% t/ d; U! S# P6 @
Here is a quick description:
5 e( u0 _4 v! m# j( |-AX = 0910h (Display string in SIce windows)9 f2 x. L" s3 ]/ }3 T9 |
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
J9 g+ }( f& f! d: k5 z$ [, H-AX = 0912h (Get breakpoint infos)( a5 T- t1 H1 h6 t
-AX = 0913h (Set Sice breakpoints)
8 m, n1 n2 L: U, r-AX = 0914h (Remove SIce breakoints)
1 C1 t/ T3 ^8 e$ `5 W% D* i1 h3 E5 t6 N; Y) x1 c$ I
Each time you'll meet this trick, you'll see:
( D o% W( _6 R5 p-SI = 4647h" a! Y. f8 V: N8 q5 }
-DI = 4A4Dh
3 u1 l) @6 S3 oWhich are the 'magic values' used by SoftIce.( E* \+ S& D6 U9 l( ~
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ o! y7 H8 d# m1 h+ m( |% V) N1 Q, y1 G1 y" w3 L
Here is one example from the file "Haspinst.exe" which is the dongle HASP
2 h: o' Z9 w; }Envelope utility use to protect DOS applications:8 [; Y8 h- A q8 p* \/ U6 i! i9 x% d
0 w* a9 G# ]3 Q) L: ^# d- u! f
B6 G3 V6 z; g& n' ]
4C19:0095 MOV AX,0911 ; execute command.9 p2 l, |2 P) \( S3 F3 s' K
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; k- ^* m# M; C8 k4 l4C19:009A MOV SI,4647 ; 1st magic value.
9 ^5 ~3 D% {8 s! ?5 p0 E9 y4C19:009D MOV DI,4A4D ; 2nd magic value.0 O; G) X+ P; `. e; i" w$ i
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)# s8 Q4 p8 T( y2 V; y+ i
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 w4 w# O; u) i# Z
4C19:00A4 INC CX
5 f' k6 Y5 x; M( M1 H4C19:00A5 CMP CX,06 ; Repeat 6 times to execute# V$ B# K$ Q4 R+ J
4C19:00A8 JB 0095 ; 6 different commands.- T w# y! j& ~. P* `) X0 s/ H
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& M: h4 h- x! Z; J3 H4C19:00AD MOV BX,SP ; Good_Guy go ahead :) ?8 m' D; j8 |. h# T
E, G6 {5 Z% c& X) vThe program will execute 6 different SIce commands located at ds:dx, which4 J* s6 P( l4 N) g
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.6 V* M, v- m: q4 Z
6 ~( _! V* r7 ^9 l
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
' `. v2 v( Q! B3 T. r9 A___________________________________________________________________________8 a1 m* r4 J, F/ [, c
0 P; c2 q# {. k9 U. ^+ \
1 I' f; ^1 G* }, X: J' N0 VMethod 03
+ s ]) x& H r# a. C=========
8 ]. F6 G0 d/ X% M# G ~* u! N
! h+ |( ^& u% ^Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! j l' b }7 o+ t( ]1 I
(API Get entry point)
9 z( j2 @" C6 [" X) k3 h" U E x 0 y7 i( R, h0 F( w5 J
0 u9 d( m* N t& k" g; C xor di,di, j# H8 ~ n9 X" |; @
mov es,di
2 a, q" P: ]- K9 L( ]2 r' ]5 z# I1 g3 J mov ax, 1684h 7 @/ J+ l5 D3 v/ Q
mov bx, 0202h ; VxD ID of winice
- |# t) ?/ c t$ ] int 2Fh
( {6 C3 y! o4 `, F7 I mov ax, es ; ES:DI -> VxD API entry point: J i4 L9 v: D6 Q/ }
add ax, di
1 W: U$ a7 |& g$ i test ax,ax& w# s0 B1 Y& J: A/ e
jnz SoftICE_Detected
+ k4 y/ F. m9 O" q% N$ M2 t
! e ~2 b7 X* E! k___________________________________________________________________________6 {, i N) C& P
/ N1 ~- Z/ K; F$ B8 A4 f
Method 04
( d/ G; u# A/ a. \4 M8 H5 o& b=========" D+ z u& S# y5 E4 o
$ ^3 h2 O3 ^' ^' Q0 e XMethod identical to the preceding one except that it seeks the ID of SoftICE
* o, D) U$ g" f( V% XGFX VxD.5 _! Z- i' a! h3 y3 J
+ w8 }/ l& v2 ?- u. `% y xor di,di: _( C$ A% @8 K3 C1 Y
mov es,di
8 E; S2 r% Y2 c- }- }3 n4 U mov ax, 1684h 5 E3 P# J; e* i5 b" O; D
mov bx, 7a5Fh ; VxD ID of SIWVID- V5 x9 ]' P3 v4 z/ _
int 2fh$ o# b" g2 _7 W1 Q7 ?( k
mov ax, es ; ES:DI -> VxD API entry point# Q- e% b! Y+ f6 m0 v
add ax, di. v1 N! N3 Q( ]$ a
test ax,ax
6 n5 o' B' L* g' `$ q, S jnz SoftICE_Detected8 g' e2 @# W3 I1 d& k
, C8 S$ e* L) k7 N. X- G, S__________________________________________________________________________
4 n. s+ \% a, [2 o- p) f. C2 T
8 L- O% F+ ^: ] ], W5 }* _% J
. X, @! V& t' d% N8 }( r8 uMethod 05
4 s [- q) @! i$ k) J2 ?% V=========
$ C" M, G) Y1 q3 @3 ^1 S# p1 B, G9 a& q' \& m' C6 i
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 A1 |6 C1 m9 x5 Hdebugger. It calls the int 41h, function 4Fh.
) u" x: x2 c# _. W5 O* C9 g& X$ V* GThere are several alternatives.
8 i, e) x* u$ U) y
! o" e6 N7 I- nThe following one is the simplest:
" Z5 G+ l" V/ l7 g# f# ^2 J& B/ P6 [2 e- M: N
mov ax,4fh) J2 q5 Y9 I" ^# A# ^
int 41h
" i7 V. H7 X9 V cmp ax, 0F386+ H% ?, r6 `7 f' k$ E. z0 t+ O
jz SoftICE_detected9 [! Y' l9 J' z- Y9 Y3 G
- J% M( r: e j/ v
1 e7 U! N+ X7 T. d! `" N( GNext method as well as the following one are 2 examples from Stone's
3 Z) n) ] s7 i* j! s3 q- y6 O"stn-wid.zip" (www.cracking.net):
6 y* e/ ^' ]+ @4 V, j- D M! [7 O
mov bx, cs
, c: V( R# K8 t- a lea dx, int41handler2
7 r. |/ M' c# @* k xchg dx, es:[41h*4]- [" ?5 F6 F }# s# @- a, K' a( I
xchg bx, es:[41h*4+2]
# }3 Y( T0 r+ `7 a0 e mov ax,4fh
3 h1 _3 A u" L, [- `3 e: Z int 41h$ K% c. J, k+ _- z5 `
xchg dx, es:[41h*4]6 x0 N+ ^8 u! k: X
xchg bx, es:[41h*4+2]
0 G) ?/ ^) e4 u' P/ f# }# n. ? cmp ax, 0f386h
+ w: {3 r, P4 Y; N- B jz SoftICE_detected
! p1 @! `% ~0 b* b# U
) C2 h$ z* c6 V& C, [% lint41handler2 PROC
! S1 s! Q* b. j/ `) x1 ~: D iret
& |9 t1 q- O; E6 m$ W o. d- g8 ~int41handler2 ENDP
8 ]1 `9 t# L# C3 @1 p$ x$ L
7 X4 T" @8 S1 z7 E4 V0 |" Y# l0 l& L: w$ y; h$ ?/ V2 L
_________________________________________________________________________
, V6 ]3 l5 p: x! T1 T" y2 M) Y6 W m" f+ S. ^- u2 O
a7 x' d5 Z7 sMethod 06
9 e3 ^/ b: h( k7 S. S. g=========* |3 \( I5 B( E
5 W, [" ]6 [+ {6 J! x8 ^# y q/ a; ^( N
2nd method similar to the preceding one but more difficult to detect:
5 I, Q$ L5 [( L5 u6 i4 N# h
+ ?# n& E" C* O& c2 [: r4 d7 L; Y& b" }' @7 ?9 x* P3 L
int41handler PROC
1 X8 L" V" o" a A mov cl,al
2 F! ^% Q% J5 Y3 I; q# c) w4 O iret
( R( b0 _& T/ l( j4 Fint41handler ENDP
9 { ?! ?3 n% `; R
, D* O6 G5 S9 q) m9 F, ~, V
( M o5 ^: r1 [$ u) S- L% f# M0 v xor ax,ax
; O! ?( O; q: ?* y8 A/ g mov es,ax
' J6 j. v i6 w mov bx, cs. [5 k* w9 V/ l
lea dx, int41handler
0 R& o, r' W- L/ [ xchg dx, es:[41h*4]! d/ l% C! n/ r
xchg bx, es:[41h*4+2]
: v H) J% {( Q2 @- [ in al, 40h2 H. \; r: y& j+ |* ^: s4 n
xor cx,cx
0 T5 k) o7 R: @; w int 41h
8 O# w8 q# o- B$ o* e) ` xchg dx, es:[41h*4]5 e) i) F2 O+ U# v8 d
xchg bx, es:[41h*4+2]* {1 @: E& c1 V) v; r
cmp cl,al1 k8 W4 h% r9 g" h1 z
jnz SoftICE_detected) a {8 y- m( Z0 G
4 I; N! H6 R; w5 M$ n) w8 T. v1 R1 x_________________________________________________________________________
; H! q# K- Z* {, z5 }* ?+ y! g# T' u: p# G5 M
Method 07
( C0 L8 J {; v6 ]! W=========" F' F7 u& Y' G
8 h4 ] M1 H" K% Q1 b$ o
Method of detection of the WinICE handler in the int68h (V86)! d+ @7 U0 L' ?" d. w8 j
2 J; a/ `# z1 B mov ah,43h( k9 ]5 y+ A. A# `# [ U: q& Z" l$ S
int 68h
0 x/ O1 `8 f8 }) x cmp ax,0F386h+ h1 L) X1 b' X% f) A P" y
jz SoftICE_Detected
: {) [2 J( i9 J3 E9 ~" ^; B# h9 r1 \% \% g& Y
0 n5 Q+ ^! l& ^$ C8 z
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( I$ \( J4 t5 p7 B3 H: ~* c app like this:4 _- m3 a! ?" k3 l# N% g! f
; L$ K; Q* r+ N/ w' v2 z
BPX exec_int if ax==687 J; D1 i/ l9 Q0 r# S
(function called is located at byte ptr [ebp+1Dh] and client eip is) }( S7 a" y( x
located at [ebp+48h] for 32Bit apps)' K; y2 B5 Y1 X c6 y+ U/ Y2 `
__________________________________________________________________________0 b' v, w* S; C* ? O* K5 N5 K/ v; O
/ O2 t+ t( c( I* `5 R; h( [' l
5 H7 j+ f4 f4 F+ ~! yMethod 08# l# G/ y( [; z; q3 r
========= l0 R6 {* r: y2 w8 y
' d9 H. y( G3 @It is not a method of detection of SoftICE but a possibility to crash the
; K+ M% {0 q% j6 N5 J, Tsystem by intercepting int 01h and int 03h and redirecting them to another
/ ?5 t+ R# j. R9 Y4 Y: Kroutine.
8 [0 D7 d4 v) K& ~# B/ lIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points& q' m" f, |1 P: H
to the new routine to execute (hangs computer...)6 ~- Q) T0 T0 m4 x4 Y/ c$ q
' E. w) Q6 N8 g8 o) B( ]
mov ah, 25h# m8 C( P/ W" T
mov al, Int_Number (01h or 03h)
, T6 b. T9 Y$ c5 d mov dx, offset New_Int_Routine7 C6 @; P/ G2 r& ?% J
int 21h. o7 e/ ?6 F7 B
1 Q: T- S4 o: _+ j
__________________________________________________________________________/ N6 c3 ~: k0 l) ~
- ?4 F+ m/ L# j* ?" Q l
Method 09 j8 I! g. h! ~+ s
=========
+ S; t* {0 K/ R" T) A5 Q4 a7 E2 W$ W# {! q% I- n8 I! T2 ^
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ |: x2 p5 C9 Z, @# P& M4 v3 C
performed in ring0 (VxD or a ring3 app using the VxdCall).: ~8 W2 G K( q! R
The Get_DDB service is used to determine whether or not a VxD is installed
2 e1 s0 ~- s4 c* \2 t: Pfor the specified device and returns a Device Description Block (in ecx) for4 r; x( Z& ^2 G+ o _9 b
that device if it is installed.
; H0 T s$ j- p9 M
4 g4 h2 ]' I+ Y& O mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ }. D* }( E) w' Q+ S
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
6 J3 ~2 D: D7 Z. m VMMCall Get_DDB
/ l& I: \7 ?3 o% r$ N mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; F9 f/ l0 W& [* E) E" B# v
( |. o3 }- e+ T, V$ k; s
Note as well that you can easily detect this method with SoftICE:
" o7 l; N3 O- u( c+ y& U: b bpx Get_DDB if ax==0202 || ax==7a5fh$ o1 ?& s) f" M: {5 c
2 E) Q' G/ t/ B- R) W7 E9 t
__________________________________________________________________________
/ R, U; |+ u) Q& z1 H
$ `8 R$ r q( ^, XMethod 10
2 @: s2 e1 d5 Z, u d5 z! P=========( d- f' i: x' ]4 X
9 {4 u+ s' }+ H X7 ]( _( `( t" s=>Disable or clear breakpoints before using this feature. DO NOT trace with/ o4 _ a2 [/ W z t' j6 @& F
SoftICE while the option is enable!!* r0 g S9 R @7 j
0 Q/ A, w" M9 ~2 R5 c7 pThis trick is very efficient:
3 @ S7 O+ M/ bby checking the Debug Registers, you can detect if SoftICE is loaded/ ]) ]( W+ S1 |. N Q0 F/ x/ u, g
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" J. R& d% I) R+ k1 wthere are some memory breakpoints set (dr0 to dr3) simply by reading their
0 N/ O% j5 J3 F6 ]value (in ring0 only). Values can be manipulated and or changed as well( l! z$ Z& [6 W5 f
(clearing BPMs for instance); \. Y2 o+ Z$ |2 s+ d
; \( f8 V) Q+ Q4 W2 ?
__________________________________________________________________________ m6 o* v$ r3 v( h Q3 ~
1 a; u- {( C( R6 bMethod 11
5 Q+ J9 c8 K- z% t' c! N=========( _3 ]$ }8 [( w. i1 j# C( ?
V. c$ B1 U+ c2 c: c2 c; E$ ?
This method is most known as 'MeltICE' because it has been freely distributed" s5 {- G$ v5 l9 S( c0 n$ V' W
via www.winfiles.com. However it was first used by NuMega people to allow
. ]( s! P$ ?6 @% M. u1 v8 Y4 z8 `! LSymbol Loader to check if SoftICE was active or not (the code is located( P8 d! `& _/ V5 r/ ~$ q% ~2 m
inside nmtrans.dll).
& M1 o7 y, j7 N5 r8 l% }
2 q* i7 X5 a6 ?) d2 uThe way it works is very simple:: P, O5 z- t& J2 d o7 j
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- V6 y; q* h% l7 W" O- L& _
WinNT) with the CreateFileA API.
# K; R: a5 w6 Z6 e6 ?
/ S; f8 [4 m; BHere is a sample (checking for 'SICE'):
8 V0 G0 [2 t- g/ H+ h2 a
) [3 d& ^3 m) Y CBOOL IsSoftIce95Loaded()1 V, w' c3 w0 w. v* G8 u
{
% r8 U; {6 d# y HANDLE hFile; 9 t' w0 T0 `( p8 }& B5 y
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 p# t/ S5 W+ J# `- t+ y5 P4 ? FILE_SHARE_READ | FILE_SHARE_WRITE,
& \+ U+ _/ Y8 Z% [! K" M NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 A3 g) Z; l9 D; J
if( hFile != INVALID_HANDLE_VALUE )
* d+ K9 P3 ]) b {+ L) i' T6 k$ S2 r3 {
CloseHandle(hFile); i& A* H( J% `8 Z# Z+ |" a% I p
return TRUE;
% p; _' ?3 S% V2 ` }
! A7 f9 `- v% ^4 d return FALSE;
8 ], n% R2 S; O' @7 E& O+ e: |4 C}
% B9 ?- U- }( ~2 x
. d2 \2 R0 H2 M: bAlthough this trick calls the CreateFileA function, don't even expect to be
% N- i- s, m" s! Z3 ]9 gable to intercept it by installing a IFS hook: it will not work, no way!. l7 t% Q& q. N4 s w! x+ k
In fact, after the call to CreateFileA it will get through VWIN32 0x001F0 S! Z2 E2 H6 Y, G; K+ S
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ ? [1 _! P6 k! x5 j0 t6 Oand then browse the DDB list until it find the VxD and its DDB_Control_Proc- ^$ T; a U4 A' s0 F# r# `; K
field.
1 \2 X+ X0 Y; U# XIn fact, its purpose is not to load/unload VxDs but only to send a , B. f6 M% y) c
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): V: i( c2 J0 H* g/ I. z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try6 p! g, m. F; @# c, N B, s' I" t
to load/unload a non-dynamically loadable driver such as SoftICE ;-).9 s* \ _" g5 T- W+ x
If the VxD is loaded, it will always clear eax and the Carry flag to allow
) d5 Z* ]" y8 I4 s1 [( s, S1 ?3 }its handle to be opened and then, will be detected.8 j7 |& F6 T6 [' h( u1 T
You can check that simply by hooking Winice.exe control proc entry point
# Z5 X1 I, N6 R9 ]8 {2 Y! N- Lwhile running MeltICE.
n, h! ~% S4 b. |' W3 ~2 t9 W6 g/ O! x, ]
3 X" t8 E* O0 U# |9 F. f5 z) D
00401067: push 00402025 ; \\.\SICE
7 S: Y6 o" V V7 V' G( g9 k 0040106C: call CreateFileA8 z# [2 A, M7 @5 F: p( [, U, X
00401071: cmp eax,-001
8 F ~6 r* }. f* H8 p( k( ^) O' e6 S 00401074: je 004010912 ~/ M/ d7 v* @; Z P8 {) j
& h# K7 i* x- }8 H# N) ^& G
+ ~: B; q6 Z/ I& rThere could be hundreds of BPX you could use to detect this trick.8 o+ K& B1 k0 X: F
-The most classical one is:
0 R" x* Q# g5 l! }. N BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' || k4 I1 w% L% ~
*(esp->4+4)=='NTIC'
3 W0 A, }) p# W, q# @! l g5 m" d8 o
- w0 t. |* O; N# S! W-The most exotic ones (could be very slooooow :-(' ^& |3 ^- Z+ A, ]$ J
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ! r5 B/ H- f% y8 f4 Z4 o1 ~5 ?8 |
;will break 3 times :-(
. H7 O' k+ V( N/ Z8 ?# |6 c7 o) X
-or (a bit) faster:
& C: f" T- V; B, N1 w' H BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ q( z6 N3 b- I. \, g# f
, Q7 R3 ]" ?2 H0 g! q1 m1 x% h& @
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' , F- v/ B- L+ [( e' Z
;will break 3 times :-(0 x0 w* x1 h) x3 R: X& \# u
! B; F5 q' ~$ t$ h, \# I
-Much faster:
; P/ R/ B' i, m7 D% A1 B1 f BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 j# o$ k W' ^7 |* b$ A
% d j' j1 s0 BNote also that some programs (like AZPR3.00) use de old 16-bit _lopen6 t2 A# F7 W0 k. K9 p; i
function to do the same job:
4 L2 B' ^; p7 M3 Y2 A9 u" q% I% r K; u+ O9 j+ x& G9 p
push 00 ; OF_READ" g6 v3 H" a8 L1 \# e) t! x
mov eax,[00656634] ; '\\.\SICE',0, K$ D) u" |1 R4 o5 w
push eax
( u1 s! M8 e6 x. ~& [* A8 R call KERNEL32!_lopen
& Q) m' ^1 D( N. N2 z inc eax
! {9 e2 m. R/ R jnz 00650589 ; detected7 p3 N$ V9 u J2 V3 a
push 00 ; OF_READ, s3 M. C: p; H* L" k. t
mov eax,[00656638] ; '\\.\SICE'& A0 e, _9 m) R3 |
push eax
4 h% `1 Q' c$ L( D call KERNEL32!_lopen# H; F8 L$ L, o& Z* e
inc eax) `4 X) a2 c4 p, I
jz 006505ae ; not detected
. Y8 k7 R! H- p# r9 a/ {, f! m G- O' S& C" p
" {0 g+ `4 N% E# J9 p+ f
__________________________________________________________________________
! u& O2 t3 Z6 ~$ k% y. j
9 d. G. r/ P" p& y8 H9 kMethod 12 U; E% l* D1 M! X: q! W
=========% t) M/ R# k, v* F) X7 u S
; ^4 o- s. a6 T- e) U9 z
This trick is similar to int41h/4fh Debugger installation check (code 05" u5 S' o3 p. p; q" e6 T5 \1 t" k
& 06) but very limited because it's only available for Win95/98 (not NT)$ {- W8 |8 @! e) U
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, Z7 S- ?- a2 f' B/ Y$ V, W8 m3 {7 N6 g$ v8 @
push 0000004fh ; function 4fh
6 {' _+ h% n* d% b- l4 k; X, i push 002a002ah ; high word specifies which VxD (VWIN32)
9 M" |4 C& V7 r% X& Y ; low word specifies which service$ \: Z: d9 s3 a9 v- F- O o) _
(VWIN32_Int41Dispatch)) p. w+ w3 c1 ]8 V" [
call Kernel32!ORD_001 ; VxdCall& E2 P$ ?( ?5 R9 N: N& s( G6 `1 c. Q
cmp ax, 0f386h ; magic number returned by system debuggers
2 z( U9 W% T/ D( J! u% l2 t jz SoftICE_detected$ B/ Z D& i7 q- [( v
! U9 Q" m8 u6 z3 b' T! D# ZHere again, several ways to detect it:
* V( x$ y) h, y8 J! v4 V0 V1 ^
4 `. m2 a% l Q9 b BPINT 41 if ax==4f
* n6 ]0 ^# A( Y; Z# I
3 L8 M9 x) x9 l- r BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: U9 u) }8 ]7 m% R' i
- v' H, J) D6 S4 t/ [0 ^* s6 M
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
( e+ {2 P+ @* @: M1 o" l O- Z
! y# G0 @& U4 |' z% a2 Q, V BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. _/ N9 Z5 b+ X H2 w
2 ~' o2 ?! F E' s7 Q M0 \: V6 ]
__________________________________________________________________________$ b5 @% E( K. u: S
2 H1 [& `$ [$ HMethod 138 v! m" ?: b* n
=========; z6 y" K9 [; P r# |( o, i
8 n& N ]5 S; A, t, ?) \Not a real method of detection, but a good way to know if SoftICE is
2 N! K' K3 B0 Z/ Q- D3 j* k9 k* dinstalled on a computer and to locate its installation directory.( H3 x: {. B' D! K
It is used by few softs which access the following registry keys (usually #2) :
9 p5 g8 X! L5 g% ^/ r/ u
, x7 Q! d4 i# s. ^" c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( R7 s0 p2 ^8 `' G6 H
\Uninstall\SoftICE
3 x* m( J \$ O-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
% k$ c3 ^1 I" L" F* h-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, D m2 S" J5 G/ U
\App Paths\Loader32.Exe* M) _/ E+ i9 }, \& z/ S
' L# [2 r" H9 f/ }, I, L( L
5 w' G, j1 R8 R `4 y- fNote that some nasty apps could then erase all files from SoftICE directory5 k ~; W, s! F0 g6 J% ~
(I faced that once :-(* s+ D3 G5 f5 K1 S7 G
5 V" p7 C3 m6 T3 C1 t
Useful breakpoint to detect it:
$ p# Y" f% L2 T3 U9 h" ?4 A! E' D
! D4 A/ T* F1 L0 }% |% b+ I7 k& R BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'$ z6 l- Z6 F/ C( ~, _' k
& w( M! U( a W- Q__________________________________________________________________________
- Z* B' u: D2 z' a
' A% N0 V2 s) M# B/ f; d: }7 K' p; ?9 e: t2 u7 y) e6 v" x
Method 14
1 I) O7 w) w( H/ @0 X: s=========
& D: x- ]0 S w+ X. z
# I( p, G7 |. D( ?. k" q }A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' G/ s% E- T* J# eis to determines whether a debugger is running on your system (ring0 only).- v2 Z, m( H( c
4 j" q: T/ m$ ^; }: [7 k VMMCall Test_Debug_Installed
8 ^$ a- v4 m$ E) @, X9 ~9 b je not_installed8 i: `5 u k+ _
. n5 A& I- G {$ u" LThis service just checks a flag.
+ `% k% d" Z. A+ g3 G% l4 I</PRE></TD></TR></TBODY></TABLE> |