<TABLE width=500>
6 r+ U4 c3 z% [5 I) r+ M; {<TBODY>
& ?0 [- x& U3 s: C7 d<TR>
# r" `) }7 b9 A( d t<TD><PRE>Method 01 : v z5 O6 \% h" B
=========
7 d, g- l( K/ n4 W, |2 W
( E6 \1 G2 R, I4 b4 KThis method of detection of SoftICE (as well as the following one) is
9 P H8 r- S0 f6 A2 H4 Qused by the majority of packers/encryptors found on Internet.
" D; ?! K: p" z! k) i Y5 RIt seeks the signature of BoundsChecker in SoftICE+ |, o) ?- A, B) O/ [: N
* _! J3 `2 O. m mov ebp, 04243484Bh ; 'BCHK'
0 W0 ]& o( V' n& e3 x mov ax, 04h1 d7 u% @) w- D7 T6 Q+ V H6 r% t) F
int 3 * |# b2 X* U& @1 ~. W
cmp al,4
2 C4 t" Z: J, G1 @ jnz SoftICE_Detected' e* S4 V* O2 W, i+ G4 H
1 x: h! Y! Z' u" l
___________________________________________________________________________
3 \5 a- Q9 k+ S4 M* ?; Y
4 N& J5 D, v+ o( @; ?3 YMethod 02
3 r7 g. V+ v- d, Q=========* ~' v8 h& F% ?4 X4 d% J4 {& Q
$ X+ E5 a5 [( g" w' eStill a method very much used (perhaps the most frequent one). It is used
' p& X" e! m& ~+ V7 G5 V6 Qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 f/ i0 c- A& v0 Y+ l5 G
or execute SoftICE commands...
& L J ^& M4 p8 n5 aIt is also used to crash SoftICE and to force it to execute any commands
& G+ O3 D1 K; a( P0 z f(HBOOT...) :-((
& B8 W" a( |% d: g, P5 [4 J$ {- R
Here is a quick description:; m+ U$ d$ S: l3 h9 ]. ]( s
-AX = 0910h (Display string in SIce windows)
t q& W5 r4 e% y1 t-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- M6 P8 ?! ^, ~; I% p' G2 W
-AX = 0912h (Get breakpoint infos); c! y/ F( j! ?3 L, k
-AX = 0913h (Set Sice breakpoints)
/ r& U# g" u3 c( ]# Q# t. _-AX = 0914h (Remove SIce breakoints)' Y7 i/ h* x$ j+ q! }: v, W z( w
! s! d4 J1 J H4 j, ^Each time you'll meet this trick, you'll see:
' \; z$ _/ C' s6 _) P2 _-SI = 4647h4 H8 x$ C: t$ }+ j- x- u
-DI = 4A4Dh7 a6 E& g/ p$ S0 ]; F" B# _
Which are the 'magic values' used by SoftIce.
, u' k6 u& C- w) fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.% |4 c4 A& T5 R, d4 w- W) d
) t$ J: ~, }3 i/ v9 SHere is one example from the file "Haspinst.exe" which is the dongle HASP; ]% s- h5 g8 A5 p; @& Z b, J. h8 A% W
Envelope utility use to protect DOS applications:
# Q& N! @! V& p
9 G7 ^4 ?% Q3 ]! a
# V$ _6 w: |/ X" v N# C+ [6 C4C19:0095 MOV AX,0911 ; execute command.& I+ q' X- h! S/ r& h' d
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).8 z8 D$ v% [* S) {0 z
4C19:009A MOV SI,4647 ; 1st magic value.( _0 t) ]$ f5 E7 [
4C19:009D MOV DI,4A4D ; 2nd magic value.
% X) K- ]& Z/ z7 @4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; P0 b0 _) {% c' B+ j4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
7 u. }1 E1 n% B4C19:00A4 INC CX" Y7 m2 A! D6 u+ F O, Y
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 {/ @2 ?; E, y) ]$ d5 d4C19:00A8 JB 0095 ; 6 different commands.
5 p# l0 V5 q$ h/ N |. z& W4C19:00AA JMP 0002 ; Bad_Guy jmp back.
( c( c5 K4 D6 o7 K) ^4C19:00AD MOV BX,SP ; Good_Guy go ahead :)4 z; {2 ]* n& Y$ _+ l3 m
. U5 s) r( y7 h) c ~6 e. a
The program will execute 6 different SIce commands located at ds:dx, which7 X9 a8 Q; v9 b3 C
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT., ^# K- }8 T* m, r6 {+ Y" u1 I
% {% t, t+ \# n6 c |/ W1 b1 Z. X8 ~* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 b& k @# ?1 Q$ [8 ^9 F
___________________________________________________________________________
% A* H* ]- A7 L6 H# ?9 j8 B! V- y* N" h: K
& I# T7 B2 Y/ q* B# f8 @. z( m
Method 03* ? Y. T6 f& G# U
=========
. z4 Q, h" G3 w0 h2 C8 d7 B J( n+ K5 i7 g) t- H/ R$ S/ S* N
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! p% z4 U/ J+ x7 e# f$ A6 `# q% ?
(API Get entry point), J; C; Q7 q5 B
+ |; z3 o( L2 i, r* V$ Q
% G: m2 Y" s ^2 u8 T6 r
xor di,di
/ |2 D7 Q& v1 d1 W8 K mov es,di
8 B, Q1 R( k' K' q& F% F2 S0 l mov ax, 1684h 4 O; n1 ]7 F( y0 z0 _/ O, K7 u
mov bx, 0202h ; VxD ID of winice
0 I) V4 x; H3 z9 {& t int 2Fh0 A1 P( Q8 w( `6 M: K2 Z1 F
mov ax, es ; ES:DI -> VxD API entry point
" o3 h' O- G d add ax, di0 m+ b1 P3 T- N( y9 U. A5 {9 ]6 k% u
test ax,ax
1 K& p! e2 a" c3 X! u/ v" y; p jnz SoftICE_Detected! ~# i/ c6 ~6 V( I! B5 w& M! ~
* v( c3 W$ ~3 o* n___________________________________________________________________________
3 Z1 g" ^$ K1 w9 i9 S
! l+ V1 T% D( G7 ^& p0 VMethod 04- F9 j( {1 G% A3 p* R# x
=========
# [) r- k3 Q3 _2 s" q0 f
" s0 C0 T( X# e% s6 Q l+ A3 EMethod identical to the preceding one except that it seeks the ID of SoftICE/ d6 K8 s" b3 I( W0 K& u' t
GFX VxD.7 q5 B2 h( u U( }$ \4 X( D+ l. g' A
$ |7 \5 L. i' U) ^9 t xor di,di
% e# m8 X3 o" h# d mov es,di9 X0 n! O& R7 Y4 z. J1 }
mov ax, 1684h
6 ?: {/ c! r7 d; S mov bx, 7a5Fh ; VxD ID of SIWVID5 o. B4 ^+ t0 |- `1 J
int 2fh
. k2 U; _8 `/ c/ F. g mov ax, es ; ES:DI -> VxD API entry point
* M' j/ F2 M3 k: O/ V add ax, di
! z; o" r/ _' e% r: n- @. S test ax,ax+ F3 t* s) V/ W$ E# T2 O9 W
jnz SoftICE_Detected
- E4 @: I8 W4 n7 {* Q# m _' n, x& {, p' _: y0 m0 d
__________________________________________________________________________
6 S( U. @3 c7 T1 } S' a6 p: s* y& N5 p1 X1 A6 Y
$ a4 D0 n1 S0 B/ d
Method 05; A6 f; _ J" i# Y, C
=========& Q# g( G6 B F' d7 f5 x0 Y
; p1 U9 k; z! @4 z5 F$ ZMethod seeking the 'magic number' 0F386h returned (in ax) by all system
- j6 Y8 `1 ?0 V% e Pdebugger. It calls the int 41h, function 4Fh.
3 i( I2 I7 N; {6 K& i+ E2 LThere are several alternatives. $ J, M! }. Z4 Y4 h3 X
/ O& Q# A5 z- K
The following one is the simplest:
' s# }9 P. L6 U" B; v2 C8 B/ Q9 }9 w: c% p$ q( a
mov ax,4fh
9 A7 g" I# l$ \4 P% m2 A# n* E int 41h6 p& Z. d2 V3 E) `
cmp ax, 0F386$ ^ G* i3 Q% t" a
jz SoftICE_detected
P& O5 m) V! I( c
# w- B# D2 f4 ?. C
" t" P# m n: W/ INext method as well as the following one are 2 examples from Stone's
. V7 b! X9 p) _1 x+ s"stn-wid.zip" (www.cracking.net):
8 U& a6 `" A4 J0 y7 n! |' \6 v H. ?0 i9 M
mov bx, cs
7 {2 s" g5 A4 N+ `1 _$ ? lea dx, int41handler2
3 g$ r q- l1 r" G4 S: Z- S( W xchg dx, es:[41h*4]! ^* l( K2 p$ n2 Z: R* j
xchg bx, es:[41h*4+2]% N+ `' n: p2 |3 Q, x
mov ax,4fh
1 x) T- E, Y( f; A* I int 41h: M8 y" ^' v* a- o* a
xchg dx, es:[41h*4]
6 ]) b" `$ y/ X+ U% K& ?7 d' L( N xchg bx, es:[41h*4+2]+ k( n. v# T' Z# X5 h6 [
cmp ax, 0f386h) K# g3 k0 c, K+ j1 u
jz SoftICE_detected
( a% B' r S5 \ J: [1 Q. x+ z) i9 B. Y$ C# k6 I
int41handler2 PROC
5 D- m# U" _ J7 I) _. Q3 l- h iret
9 _3 S# h/ N& K* {int41handler2 ENDP# [$ N0 u+ M6 G
+ _* A; m, v8 h. o3 E- s
6 J2 k; P+ a/ q- F
_________________________________________________________________________# _- h7 D& q3 g7 L0 r: ~8 m
' P' s/ o7 W2 ^- x( E: b9 t. |# v- Y" b6 k7 v: ] K9 u3 t7 C, n
Method 067 v6 h4 Y# o/ R& o
=========/ s+ `2 f- a* j* T
# E: V1 ^) K+ k1 p
: M( A) l( [# \# {) C, c- S7 ]5 C2nd method similar to the preceding one but more difficult to detect:
: |6 }' Z" i; n& ~/ ~. g+ v/ D8 K+ ^; m0 f
+ F2 K) r6 {) z5 @7 }% x* Q6 O g) ?int41handler PROC
3 X7 [) W6 ]& C9 @" y, X, q4 V mov cl,al
3 X# z) e3 }+ k2 F, I7 Q1 b5 _ iret
3 T* k, C e9 e% C& S: N' Dint41handler ENDP, y( Y, W7 m7 O$ \
1 D. Z0 I: i2 }8 o. N: r# q
- X2 V# ^# | u1 Q: {* e. z7 K
xor ax,ax
/ y& c/ H0 v* G2 {6 [) D mov es,ax% Y1 {% \8 f5 ~
mov bx, cs- o( Q% B- w1 G6 M0 j7 |
lea dx, int41handler7 }% K+ w0 p& ?' @+ p, c
xchg dx, es:[41h*4]
# b$ j6 L8 c6 q. U xchg bx, es:[41h*4+2]" `9 k2 Q1 e6 \+ V. u. C* k
in al, 40h! W) q" x w# x) B! ]5 ]
xor cx,cx0 y/ o5 f3 i8 n$ t
int 41h2 K$ u( e! @4 u& V+ O
xchg dx, es:[41h*4]
0 _/ R0 |9 }- }$ Y, ^* I xchg bx, es:[41h*4+2]: ]& u# r2 M I1 c
cmp cl,al6 J+ z1 x& |2 g$ J- ^2 ~7 G
jnz SoftICE_detected
& t2 d+ S' o6 Z; C1 u* x* J' `2 g: B. s. G& q
_________________________________________________________________________$ z3 q% j- e& h; ^* B: w' Z. T3 V
3 \0 P* H% Q! I# I+ i
Method 07# g- H) t0 |( q1 P
=========# q# O7 F0 ^0 d: Z; @
9 N% y4 {$ V( [1 Y) ^$ ]! {. SMethod of detection of the WinICE handler in the int68h (V86). U9 Z4 B9 g) x* Y5 Q# ~& F5 S
: M$ }& d: @1 h. G: P
mov ah,43h
$ n: O2 W& c8 B" i8 z& J int 68h. m0 v8 s8 e9 D) y9 F
cmp ax,0F386h
0 ~* S2 M' b, X( a& H% H4 F" v4 b jz SoftICE_Detected
- w9 }- D% m6 Q" j& T1 O1 o$ J" W8 U* j0 z6 P( ^3 t7 i3 K
* H' T" Q$ x% K! d
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
_1 y0 b' O! q9 ~9 I2 K app like this:
$ _# s9 I# Y0 [8 J) x# r+ L
; r8 Y1 ?' \' k' k' l& J BPX exec_int if ax==68
7 L, [# r; m+ J' I6 | (function called is located at byte ptr [ebp+1Dh] and client eip is
4 D+ U# K! }" H: y* n3 l. ] located at [ebp+48h] for 32Bit apps)
1 y7 b, K8 t+ F* T# g$ @/ Y__________________________________________________________________________) i! {% x: S& |- L. b; {/ C
! f' N; [9 P) Q4 w" y4 v4 M" Q D8 o! P8 `6 N
Method 08
" d3 q! B; `" B* q# X( N=========9 q3 D& ]- l+ W, F1 O
1 j2 g6 L; S5 F4 } P
It is not a method of detection of SoftICE but a possibility to crash the
0 q* f( S8 S# N2 osystem by intercepting int 01h and int 03h and redirecting them to another
+ v( b8 g$ X8 [( F7 D6 iroutine.
0 m# m1 e) Z7 b2 u+ m9 \! c% u! SIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" L! _. ~" Z [/ h% [
to the new routine to execute (hangs computer...)" h3 o! T, e" y. b/ i V
0 D' T8 \! T$ Z
mov ah, 25h
9 P+ E) B, R( \7 x1 L mov al, Int_Number (01h or 03h)
z3 I2 T( t+ w) @ mov dx, offset New_Int_Routine
4 O: n, k3 S0 N) M* K int 21h1 R* u) b6 c, Q p: K
( f# t6 v6 v+ I" T" D__________________________________________________________________________
/ E, M, O/ N* d# g& S2 j5 O* E3 h4 o+ ]1 ?. s) x; k) I
Method 09
}! }: U5 W/ S: ?* D=========
* v$ \; G8 u2 U, p
. X9 B: U, o& }& Q9 [- l8 iThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% `% V; `/ }2 M- X# ]! L: Y5 c9 P3 \performed in ring0 (VxD or a ring3 app using the VxdCall).
0 S O, q0 y9 e+ M; ?9 W7 q( `: u; rThe Get_DDB service is used to determine whether or not a VxD is installed7 X4 y* I6 R) h
for the specified device and returns a Device Description Block (in ecx) for
z( g* `2 E$ h% t+ X" nthat device if it is installed.. O) ^, e# }5 {4 N" v2 g5 z: L
" a* k$ j% }3 L6 a) [* H7 ~1 p
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( [" ]7 |: ]! u mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-); O: v# H" Y) u
VMMCall Get_DDB
. a) x+ V# d1 l* c( l mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
% B5 ?: J# E2 V/ X+ S( y* t c. w) t& h/ L& Q0 z
Note as well that you can easily detect this method with SoftICE:
1 r, _/ h4 A8 C3 e @8 C. F# x, s bpx Get_DDB if ax==0202 || ax==7a5fh/ ~8 R6 F t# @' Q
5 n6 P* l k% H& @# l- \& A0 \% J
__________________________________________________________________________/ p6 L& U, {" w: f
+ G+ q- f4 G' i, I- X& g: B
Method 10
/ x! L9 f, L7 B) h$ u+ O=========& F4 H6 B( c: u0 q& j9 f( ^
6 H' i9 q+ `$ r% A, s: ]4 n9 [
=>Disable or clear breakpoints before using this feature. DO NOT trace with: x+ j1 }$ V; l z+ T% ^5 Q# e
SoftICE while the option is enable!!
$ K3 M" _8 B% Y B" j5 P8 U; {
; }$ Q" _. ]1 J; z. O6 IThis trick is very efficient:
! P- a: @: S# d+ Eby checking the Debug Registers, you can detect if SoftICE is loaded4 C% N9 Z$ Q% A7 S
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; s/ c+ p4 Y+ N% m
there are some memory breakpoints set (dr0 to dr3) simply by reading their' s8 s* |7 Q! F3 v
value (in ring0 only). Values can be manipulated and or changed as well
: E! U. J7 E# ?; ^3 b0 U: u3 r(clearing BPMs for instance)! J' L2 A$ a8 V$ L6 x/ F- k
! i, d7 @+ p- ^" x/ \' x5 [& v5 Q
__________________________________________________________________________0 U0 B! F2 l8 f7 d8 F
_) v7 J9 Z4 q9 X2 }$ K, f
Method 11
- k% k6 G' c$ k% V, r, E=========; b3 U0 N9 m4 {( C' e
3 {! m3 {* m* l7 N! U! k
This method is most known as 'MeltICE' because it has been freely distributed
9 g! x" T! g& ?- J: @, w- [& Wvia www.winfiles.com. However it was first used by NuMega people to allow
8 x2 ~$ v5 R1 r7 d6 y r! }& ^* `' kSymbol Loader to check if SoftICE was active or not (the code is located7 W) w: {9 n/ Q+ V
inside nmtrans.dll).) x: ^& c5 P: Y! M8 ?) X
/ ~0 @3 V1 O* M3 r# g6 ]The way it works is very simple:
6 [ z+ `9 @ B2 N- P5 [It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
W. G3 @% l+ P+ \, n, w7 y TWinNT) with the CreateFileA API.$ T) c. R" R. u9 J8 ?/ @+ w+ h
7 z1 c% ]8 s! Z4 K" K! ]Here is a sample (checking for 'SICE'):
6 I3 m1 V t$ ~4 ^3 F4 N
( x5 T7 U a5 l) x. V+ E0 [0 _8 UBOOL IsSoftIce95Loaded(); L. F c* ?$ ~
{
' m, i1 h- a0 f' J1 b HANDLE hFile; X6 y: v- h; e6 h# J
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; _8 X. v* U9 {1 [4 `, M
FILE_SHARE_READ | FILE_SHARE_WRITE,4 y! {. o6 Q4 t, M# S. H% F
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ n$ h) ]. z% ~: A0 u
if( hFile != INVALID_HANDLE_VALUE )/ V8 O& X3 U2 J" v& v' t9 y
{$ M* y! h3 S2 m) G" }, ]( g$ Q- p
CloseHandle(hFile);; T8 H( R0 V* E W3 Z. \' F
return TRUE;
: Q$ R$ e; S' [9 @& Q( G* ^0 I }
3 B8 p! Q- @% u: `( j, o return FALSE;) u- h* _* M* B; v0 l7 f" T
}& f( r5 p( }6 M4 q( r
) |0 D+ {: ?$ Q2 v, }! J+ c
Although this trick calls the CreateFileA function, don't even expect to be/ b% d1 r7 o, m D8 N: C' i
able to intercept it by installing a IFS hook: it will not work, no way!
$ t; O1 |$ {/ a3 C9 J3 H& @In fact, after the call to CreateFileA it will get through VWIN32 0x001F
+ q3 c% W5 S: I, Fservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 A) ~. ~5 i. l- [and then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ k. g9 D8 }8 e A4 Mfield.+ ]: z5 c5 B* W6 n% w7 q$ Z0 w
In fact, its purpose is not to load/unload VxDs but only to send a
0 y' R) F( {, e; ?1 h/ I7 zW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 X# Q" A6 b& g$ a0 }5 v% I5 |to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 y* g" |, C. E+ V+ l
to load/unload a non-dynamically loadable driver such as SoftICE ;-). O. C3 W; P! X
If the VxD is loaded, it will always clear eax and the Carry flag to allow
6 D* p& H% Z fits handle to be opened and then, will be detected.* k6 U. I9 L, F/ h2 H" W2 T7 X
You can check that simply by hooking Winice.exe control proc entry point
# I# \; q4 `$ n& n( j8 @while running MeltICE.% P) ~, Y; R$ d4 s
) _! g' ]# _ ~5 V2 B$ d q5 @, c
2 A% _; o: H+ X/ s& ~: } 00401067: push 00402025 ; \\.\SICE
0 n4 W; g3 b5 k 0040106C: call CreateFileA
' ?$ r( e# t R) ?( l7 ` 00401071: cmp eax,-0017 d1 p# T P, z. M! N7 E
00401074: je 00401091
/ U0 j8 E) X* @9 w( |1 Z/ o+ o0 Y6 a' |8 |
) ?% Z. [3 F9 G) GThere could be hundreds of BPX you could use to detect this trick.
9 e/ S9 C! U+ p-The most classical one is:5 n2 [% N- n; W9 F9 e" o3 f# F; K/ \5 t
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 T2 `% n4 z3 n. W: O. i' m% P
*(esp->4+4)=='NTIC'$ G9 C/ r8 |. Q
8 ?/ }5 ^/ j, h# Z3 F# `4 w4 N-The most exotic ones (could be very slooooow :-(
4 K8 ?! m2 k7 B$ ~# H0 }9 ] BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) y8 I2 d U( B0 E* R! J
;will break 3 times :-(
$ {$ U5 m1 f1 t6 q3 e" T
4 n$ B9 j( Q) S7 x3 ^-or (a bit) faster: # S5 l& p; `4 B3 V( d) u- k' K
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 c7 K7 Z5 l8 G
2 q3 U* e! ?* J- {7 I7 I/ q5 | BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 q7 n% H9 V6 i+ T7 ^% K) t5 u
;will break 3 times :-(
0 d# w! `6 H. r1 Y( `# i2 H2 c ]* B
-Much faster:7 ]5 @0 D* E; S+ x2 x
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
% z- x! L3 A! l$ {# I7 V9 p7 T7 N# p/ {. U! Y6 i# M: e
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen, K/ R2 g7 `+ R7 V8 s- y- p, c0 D
function to do the same job:% S0 G. S) a U, @: s. g. j# v% m
+ L7 U5 V6 p E6 r0 m5 F3 g push 00 ; OF_READ
/ d4 G$ s" ], d4 y( c mov eax,[00656634] ; '\\.\SICE',0 |+ u& N- I# d& b8 g3 s! Y7 s, r
push eax O. b5 | ~# X
call KERNEL32!_lopen6 u$ D/ R% C/ { M' [
inc eax, [4 }# c% C1 q1 Y3 T1 \! ^1 O$ \
jnz 00650589 ; detected1 H; _2 W( R3 { |5 R' I2 z
push 00 ; OF_READ) v9 p! O1 c* {! i& A' [5 J
mov eax,[00656638] ; '\\.\SICE'
. T! l* Q4 F. v; o+ {! r6 }+ a: { push eax [0 J5 P0 v# _7 |, v# m- c
call KERNEL32!_lopen
2 e9 d/ j' K4 ]; g. Q inc eax
) c" ]9 k+ U) E9 l jz 006505ae ; not detected9 f" ^: q, B- I( }3 X( O! _5 P; U" ^
, |4 Q% t6 p' c0 I
8 z; R/ @1 Z$ t7 ]1 ^: s__________________________________________________________________________
* Q" |) v" i+ l) P. M# O2 {$ R8 \6 U% h' s7 A" U% R, q
Method 12
/ g* G! j$ x! q! @( B$ M* C' x=========
1 _! F, O3 }1 M+ D' Y( T
3 Z8 w. J+ J0 R& d" h# y8 k) ZThis trick is similar to int41h/4fh Debugger installation check (code 05( `% _, z# i B: g9 |5 W; p, o
& 06) but very limited because it's only available for Win95/98 (not NT)
j# O8 {7 { J U5 `as it uses the VxDCall backdoor. This detection was found in Bleem Demo., {3 l' m! D6 a! P+ f/ E& t! K
6 Z) D1 h, E$ ]+ i, ]4 Y7 Q* T
push 0000004fh ; function 4fh' B9 j7 L6 ^! h9 }' u7 q z
push 002a002ah ; high word specifies which VxD (VWIN32)0 { K/ h* X$ Y$ c9 k# o
; low word specifies which service9 h6 C5 V% Y" K$ i# l( m
(VWIN32_Int41Dispatch)
6 {' C9 W3 v( @( u$ |, i call Kernel32!ORD_001 ; VxdCall, h+ a g8 P4 v3 V* Q
cmp ax, 0f386h ; magic number returned by system debuggers
. g% I! d: L# a% m- u jz SoftICE_detected: {: a/ H3 C0 w, H5 b, u* N
* e# z, ~ ?- s# n* r8 b$ \! t' ~Here again, several ways to detect it:
5 o1 K- ^; F M' D/ ] T1 Y6 H3 \' l: `1 h
BPINT 41 if ax==4f
. _6 i$ r1 G. x0 {$ o
' e; l7 y2 R3 I/ w& l0 V2 Z( H BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: z" z% x {! [: \4 d. X; N! t
" W2 J1 A' j Q4 ?
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A7 Y0 X; K6 u9 S; t8 Z+ Y8 q, N
+ L/ F0 ~' E) k2 }+ s! ~( F+ O
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!8 X4 q( s; x1 z2 ^# K
1 g$ y; V _! n6 T& J__________________________________________________________________________: {: C7 h) K, L9 @/ Y% `
2 S( e# D& o: c {/ A: G% Y
Method 13 m$ c$ D& C+ x: z. O8 [
=========
: I0 j( V" _" p- g4 V3 o7 Z( [# C' `
8 m# U Q" t7 B, L( MNot a real method of detection, but a good way to know if SoftICE is7 ^6 f0 @, @4 }3 h3 y5 C
installed on a computer and to locate its installation directory.
8 m2 m/ V$ C/ H" G1 X5 [- MIt is used by few softs which access the following registry keys (usually #2) :
8 h3 F9 Y; Q: l( {
( m& S5 o% V' l9 ]-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 I# c; C3 _. e+ y
\Uninstall\SoftICE1 z5 V1 a% X5 @- |) { k" c
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, [( w6 U( c5 v& v7 Q A g3 h
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ {7 [ J# M7 T: g, j1 i7 a\App Paths\Loader32.Exe, T( J8 ^/ ~' V$ m* \
+ u- G- n* F- y s5 {% l7 N! E, c3 K2 e" o5 a L4 m
Note that some nasty apps could then erase all files from SoftICE directory
9 x0 y- U8 E$ I9 J) w$ }& H u(I faced that once :-(% I5 H; ^+ c# {6 I
9 l8 n) R" o4 F1 w' e7 H+ kUseful breakpoint to detect it:
B8 H& `. [- C, c% B7 u* F. y3 c+ \& D
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'. A2 L. W' J# P) Z6 Z& M3 c
2 G* Q% S1 d/ A: m( B' n__________________________________________________________________________* o2 j/ @1 N4 W5 `. h
6 F7 l; O; q. z) A* T0 ^; Y& z2 y
. ^4 R% z1 a" h' l) cMethod 14 / y) A W9 E+ K8 P W0 m1 @& ~
=========- ?- Y0 h' h9 x5 l5 h; {
1 }$ n) t( @7 @
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 w7 R( p& S3 v; z
is to determines whether a debugger is running on your system (ring0 only)./ P1 ]/ S* q2 q
# _0 m# v9 _' s' K% }3 N) T
VMMCall Test_Debug_Installed
) L$ l" A$ ]( f& P l9 g! [ je not_installed! ^! }/ G- u. o2 x9 x
, I( H: G0 R- l2 S& L1 `This service just checks a flag.0 f4 n3 b Y: D' S# V, C! \: a/ B
</PRE></TD></TR></TBODY></TABLE> |