<TABLE width=500>
7 m! I. W4 F0 z" ^$ c' ]6 E- r' @<TBODY>! i1 Y! O7 B& |7 i2 [6 `) D5 V
<TR>' h* r+ M) t! W3 U
<TD><PRE>Method 01
5 U2 Q: X% ^# G=========
B2 w- Q+ c; W" v2 u# j( M2 S b) c4 k/ s& V- X
This method of detection of SoftICE (as well as the following one) is4 w9 L) |$ k" i' B. m- ?
used by the majority of packers/encryptors found on Internet.. v% ?8 {; Z$ @# H# a
It seeks the signature of BoundsChecker in SoftICE! f" ^4 G( i4 C a9 p
$ C2 X1 ^0 t5 ?2 H. I
mov ebp, 04243484Bh ; 'BCHK'* ~ q% t. }; L; i$ X2 g- ~
mov ax, 04h0 _% z9 y8 r0 [. g5 d4 ^
int 3 * L; r$ O% U) J% U& [/ J7 z
cmp al,4
# ?1 P: |2 ~* ~& p jnz SoftICE_Detected4 d+ h& B! V* H9 N0 [0 X
6 |& `2 h' N( M# e
___________________________________________________________________________
+ X8 o/ e, f- y: m5 j0 ?) i0 |2 J1 T( N) F. M" I7 d
Method 02
- r! D: t. ]% F' S( S6 I2 [=========
& C" e1 M# _1 w* J$ j+ r
- i5 N6 B5 m0 o9 U7 qStill a method very much used (perhaps the most frequent one). It is used! c" Y4 M5 X3 L: Q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. R) c/ X" e( J# Por execute SoftICE commands...
- n T9 ~: q' K6 f/ LIt is also used to crash SoftICE and to force it to execute any commands
! o9 v P3 U* b0 S$ c(HBOOT...) :-(( / y+ j$ r5 Z7 C2 e! R @. M
. p4 I9 w$ `! f' ]
Here is a quick description:5 Y c; U% K+ ^& o5 H
-AX = 0910h (Display string in SIce windows)1 w8 \2 ~& r2 x: p6 t# o
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)7 ]7 n! d9 a* O8 s s0 i
-AX = 0912h (Get breakpoint infos)
8 i, U" M/ G4 |8 l7 W6 K2 v-AX = 0913h (Set Sice breakpoints)9 i9 u$ n7 D+ s" X- f$ n$ z
-AX = 0914h (Remove SIce breakoints)
; F4 _6 B. M' `5 I1 ?, s j3 ]# b7 c
+ ?$ {0 Y' r+ r' y/ G$ u/ IEach time you'll meet this trick, you'll see:1 {$ a8 y H1 n5 P. ]$ W: R+ W
-SI = 4647h
8 B2 D# P& U6 W, L/ Z8 X-DI = 4A4Dh
5 G) r: S1 X% @; B f4 o; kWhich are the 'magic values' used by SoftIce.
& b6 P3 C, t7 f. [. CFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.' N( S# W" i! p/ j
. R: b: X2 g. [8 `
Here is one example from the file "Haspinst.exe" which is the dongle HASP
6 Q6 ]. U$ C: Z7 L+ u4 e+ @) tEnvelope utility use to protect DOS applications:
/ f% N; ~% Y0 v/ I; S J2 t/ ]8 k e) J1 J- Q
+ o8 i( k2 g% r& `
4C19:0095 MOV AX,0911 ; execute command. ~( a0 N! b& T+ K+ Z
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).5 I! i# v" [, Z7 ]& {( I3 k) ?
4C19:009A MOV SI,4647 ; 1st magic value.
( |- R- U3 x% H6 k/ F4C19:009D MOV DI,4A4D ; 2nd magic value., }" n+ v, t, |# a$ z
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
7 K0 y: E5 V/ O% P# J4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, B) U! D: S, }; ^ D p6 Q4C19:00A4 INC CX' Y" w8 |# j0 e. d7 O7 z D
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute( H0 h7 b+ |, Q7 U( ~- Y
4C19:00A8 JB 0095 ; 6 different commands.
! s/ D' g& M) \1 P0 @9 L5 u; e4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ h+ e% F" j4 n; P2 f- Y
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
+ ^$ h: a+ w& B* R
1 z/ y @9 n) I1 l; QThe program will execute 6 different SIce commands located at ds:dx, which
& X. C: A# q1 N" i6 sare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; T! e6 C$ `- |
1 Z/ z5 }$ B# n8 c6 \# y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( Z$ u9 \" O: [' _7 [. a! |___________________________________________________________________________0 c; w! V) M7 u) [( v& r% u0 j/ G( y
; b& x1 Z7 J, Y5 |8 a# _
+ m/ s* g2 K; x( d6 }1 \+ n3 HMethod 03$ n: C# [# F3 D% _ x0 ^
=========
2 ^7 ?4 @# r5 [1 h6 T5 S
- X: d w5 z; [; I# B) |, h. JLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 d8 z; N, `, f) o5 H
(API Get entry point)+ ~# i. p8 n8 o$ @
* v p' m$ W7 {
4 K( U- k3 L& F% F xor di,di
" ^3 F# S2 D3 w mov es,di
/ X, S0 z2 ]; t/ J: i# v mov ax, 1684h
0 |: P; X6 A9 J: K& y/ G R8 N. V mov bx, 0202h ; VxD ID of winice
" X1 }' }+ t+ G( T9 _% | int 2Fh
. S; g9 z& G. T mov ax, es ; ES:DI -> VxD API entry point
8 }% i( G5 C$ g& g) s0 }* ~ add ax, di
9 L) q! E$ O0 s- l5 Q test ax,ax: H5 d, O2 L7 u, N. w8 g" h. V
jnz SoftICE_Detected# f- U6 m' u/ @! N: ]4 b+ |
: z% I+ p4 H8 j4 v+ ]
___________________________________________________________________________# l% a& G+ ~; W3 H8 T
2 [- ^4 g7 Y* d/ A h4 ^# A
Method 046 w3 c# s% V `& Z' u! S
=========$ d7 @& e# A: J( t( X( g4 {$ ]
& e9 g. B% J5 C% ^. uMethod identical to the preceding one except that it seeks the ID of SoftICE
" y! G6 N* _0 x; _8 X' @; C( EGFX VxD.: P q+ ~3 T# K; o. A2 y6 T. F
) ` e9 T" k) q. O' U
xor di,di7 H2 q. T) f9 Y. k, W! O# W
mov es,di" U+ } E! ?3 L: z! b7 B
mov ax, 1684h
3 s @' t+ z- p mov bx, 7a5Fh ; VxD ID of SIWVID
3 F* {; |) O+ T( u1 R int 2fh
, o; i7 |5 L a7 S4 `" P5 f. {! a5 p5 \ mov ax, es ; ES:DI -> VxD API entry point% d, B1 k8 y/ ^9 ~0 t
add ax, di. X3 A5 {. {7 N+ J E! ~
test ax,ax0 F" Q: M* B4 d1 ?# [3 N4 D) Y
jnz SoftICE_Detected2 s M8 s: L6 u) d1 H3 Y
+ c) S5 h. p3 G
__________________________________________________________________________" v U+ \2 {6 W0 b. J6 o: ] j
6 q# K# h! q! `- I7 S/ ?2 U' J1 J) J: _7 N! {: B% I: k
Method 05( X0 h. r; M4 y
=========
9 l) L+ H ?7 ]8 j; U, {. m" o* t: @- R) D* k3 r
Method seeking the 'magic number' 0F386h returned (in ax) by all system( T! F$ Y' M6 `1 n" V
debugger. It calls the int 41h, function 4Fh.# X7 Z, N$ L$ J; w! B
There are several alternatives.
( i6 h6 t+ {" `$ G8 ?7 J7 l0 `* b# z' D+ h0 L
The following one is the simplest:$ U6 d5 b# y8 r; R* l( B7 y
+ M9 |8 R9 _% C
mov ax,4fh0 s0 J+ ?5 b' w) o
int 41h
' b5 n4 s7 Y3 o% f1 n" H cmp ax, 0F3865 x, g1 Y( X6 T& w5 a9 \
jz SoftICE_detected5 S4 w! V9 }' d& O* R0 p
2 e& o( [/ z' _$ I" @" p# y4 _1 x; {/ V& G/ y* Y
Next method as well as the following one are 2 examples from Stone's
3 a( Y6 F, b( m J"stn-wid.zip" (www.cracking.net):; l1 r5 Q2 ]1 ~2 Z; S: a5 J) j- V) M
n9 q; B( U9 K8 D2 w y
mov bx, cs
3 ]: H: {6 J' i- a! k6 m8 x+ h lea dx, int41handler2
. w$ |* I: V C xchg dx, es:[41h*4]6 k7 A% d7 ^9 O- Z
xchg bx, es:[41h*4+2]8 i6 h6 y4 H) _( N5 E
mov ax,4fh
% f. M& }& S) P0 A, W int 41h
0 \# n3 Z8 \4 M `4 T5 {, d xchg dx, es:[41h*4]
' [4 }9 q w! k5 r5 p3 j xchg bx, es:[41h*4+2]
: e1 g' P2 p# a: x4 n" ^+ } cmp ax, 0f386h
# f+ Z. h3 ^# g) A9 f. t+ l9 }$ I" f( A9 s; R jz SoftICE_detected
( L" {1 j: G. X' |2 R% S7 c" V
! r9 _6 i5 t% dint41handler2 PROC
' _* _: o# Q% t& M# C iret( ?6 O+ k: A5 v t; s
int41handler2 ENDP
( A& _7 |1 S. C U0 { [! k2 S7 R# y, A; S; w! t" x
9 R P/ }5 }% ]6 e6 v9 E1 y2 L
_________________________________________________________________________
; d9 k) m# r! m) j3 d Y, v
! h& \+ x4 M7 E9 r7 G7 p$ l8 e; q* j. O% Z; e" @2 a
Method 06- M; ]; u8 j9 P4 G' c$ E; d
=========1 o% j- c3 C4 A& A- X! [% p6 Z
$ P5 ^0 @% J/ n! B, Y. j
C3 v% L. C8 y' L# ]) U
2nd method similar to the preceding one but more difficult to detect:
. O8 c0 k/ _4 Y0 Q( q% }& Z( c) ^: Z3 [# t( x% i
$ r+ I5 a; F+ e3 K- aint41handler PROC
% F0 N$ m5 o; K: } mov cl,al- B: S$ o8 x$ ~ x/ e4 z
iret
# o0 V ]1 l9 B4 r1 f7 _' Y' `int41handler ENDP
- s& Q# M, S( r B9 F+ J- z6 \! p" m! W, }+ `4 x
" C5 U* P' t# U8 b+ J' `) S# W' M xor ax,ax2 f- j3 x7 W3 P% J/ g8 |- q; a$ c
mov es,ax% u3 g. }7 o: H. f, E
mov bx, cs: L0 T A; V4 y5 d& a+ d
lea dx, int41handler
8 m1 W$ j! F1 ? xchg dx, es:[41h*4]! N) k) ^, a0 j9 o4 T5 \* Q! r8 L
xchg bx, es:[41h*4+2]8 K% L( q+ q7 D. j5 R9 A! u
in al, 40h4 }) u* T0 D0 ]! A
xor cx,cx4 \2 y- \5 A/ J }1 e7 g
int 41h
# a' k$ \- G' x$ {1 a) B xchg dx, es:[41h*4]
6 x7 b* u# f B xchg bx, es:[41h*4+2]
6 }2 n5 a! P) X. ]0 a cmp cl,al- B0 v1 B& a7 h5 h
jnz SoftICE_detected; q- d- H* n; ^$ O+ {$ I- p B# a8 Q
: A7 t% i8 |! n) ~0 Q8 h
_________________________________________________________________________
) f4 Y% g8 n9 b8 o
9 m' J6 l+ }5 f% P& UMethod 07
7 p! I: F3 `! w5 n+ a$ [' H=========
& Z9 [3 r2 k' A& C2 r; L% f9 W# s! j2 Z4 U+ N8 W" J
Method of detection of the WinICE handler in the int68h (V86)
7 h, u* x! Z$ O$ T7 H( B- l- a+ L" U c! k0 J" X7 D* f
mov ah,43h/ e- H& ?8 S% d8 }4 B9 |; ~5 A
int 68h
' C9 v9 `4 I8 z1 g. B4 w cmp ax,0F386h
& J. \# w4 b# C& F! K5 V jz SoftICE_Detected
3 t5 a# C" ~1 B7 e
/ h/ H' Y' o7 V% I$ B- B! G# B
7 U6 I; J3 X( a1 t=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit* n( ?, M- v/ a& P! P, n: k/ A% X
app like this:2 r ~6 o1 \1 g
& Z9 ^) u1 v- `+ M" m. B# z
BPX exec_int if ax==68
; u3 b8 `1 \5 b- l8 t# B (function called is located at byte ptr [ebp+1Dh] and client eip is
1 F( F3 C8 g5 X1 V" ^ located at [ebp+48h] for 32Bit apps)
: {& C; Q0 K7 x7 H/ \8 F6 j- I__________________________________________________________________________7 E9 B6 p9 X4 S/ B" ^/ j
4 J* F% G( x! b+ g8 W6 a6 {0 i
/ q! c7 A: U) K* TMethod 089 E- o; N; l0 C# [$ a1 G" R
=========
; R* o2 [( {4 y+ B0 R* h* p
9 b, e3 X* z3 i+ Z+ }It is not a method of detection of SoftICE but a possibility to crash the
, d# e5 U% [; zsystem by intercepting int 01h and int 03h and redirecting them to another
' c' g0 ~4 w0 t; V7 z& Xroutine.( {' M7 [. l3 t/ C( @2 A
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 D/ V; b, H% S2 Wto the new routine to execute (hangs computer...)
. R4 I( z% |8 o) J
2 x6 J+ j. h% b7 `+ Z( l mov ah, 25h
3 ?7 t/ J# r8 m5 X; ` mov al, Int_Number (01h or 03h)
9 \* v% n2 X- d ], Z: `: _1 C mov dx, offset New_Int_Routine
, _2 {6 o6 J7 o0 P$ I; _2 Q int 21h
' w/ z4 B, X7 l7 B
) G' e% B* j' P+ P; A__________________________________________________________________________: O) j1 |* M1 P0 j& N1 ~# M
5 j! B/ V `, F# p: B, d% f. PMethod 098 W7 ?" u% |5 B) x
=========
9 B; N5 U9 ~4 X" F! Q% R: J3 l" \) @
6 E) u$ y, i0 @6 aThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ x- g. z# G3 z- Operformed in ring0 (VxD or a ring3 app using the VxdCall).$ F5 H; F2 _' _/ Q$ w
The Get_DDB service is used to determine whether or not a VxD is installed
& I) B9 ] B! i* {& Kfor the specified device and returns a Device Description Block (in ecx) for* f. ]* y: p( T* A2 T( R7 L
that device if it is installed.: L7 ~: a2 r: G# x' H$ b% w
2 L1 R( J* u5 W+ v8 \2 D
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# G/ W) v4 r/ ?7 @8 d mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
! Z& u# R, `& O, ~ VMMCall Get_DDB
9 T' T( u+ c5 A A2 d mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, i' |) @8 p6 h6 o( y$ W$ O
- I+ M/ G$ N. x9 H/ ZNote as well that you can easily detect this method with SoftICE:9 `7 F* c4 }$ N
bpx Get_DDB if ax==0202 || ax==7a5fh9 M! O0 ^2 O; |+ f/ |' A1 L' k
3 |3 `# q/ e% S/ B1 T& T, \1 \
__________________________________________________________________________$ B1 R# r4 J* `# R& Q4 a7 a
( Z S8 ~6 i. E8 y" |
Method 108 H1 J, L( W0 o) n# p% t. Z: K
=========6 B# b8 Y8 H( K+ Y# W$ {
) m! E" W) D+ f* R=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 I( O6 f6 q" h! S& z M8 V SoftICE while the option is enable!!4 V5 V5 F. ]: `% w% M
: S0 L+ ?; Z# K( U; D$ f2 oThis trick is very efficient:+ W2 E7 b3 f, H, s9 w
by checking the Debug Registers, you can detect if SoftICE is loaded
5 F A; ~" x* K5 s; D& l(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! w' \# l1 O# a2 {
there are some memory breakpoints set (dr0 to dr3) simply by reading their
" k) N6 M3 x$ y' Hvalue (in ring0 only). Values can be manipulated and or changed as well' Z7 N; t0 l* L: r: U7 D
(clearing BPMs for instance)# J, b2 I! @% D3 |+ w3 y6 p8 C8 ~
1 N/ ^2 R; G" {# ^( h' {! C7 B__________________________________________________________________________
' f0 V% g# L8 K3 l0 f! d# l& p9 p. J' ^. \ q0 j' G6 _& P
Method 115 \# ^" R3 f6 A3 K
=========7 T1 u# q/ Z* ?( J0 p, \
6 H# R+ q3 { t: T9 BThis method is most known as 'MeltICE' because it has been freely distributed
% m+ ?6 y; r& X" o" i) mvia www.winfiles.com. However it was first used by NuMega people to allow/ P6 _+ A% W7 B% E5 X
Symbol Loader to check if SoftICE was active or not (the code is located" { d/ H- r8 ?9 \& Q5 i
inside nmtrans.dll).
9 U! F) V7 [. j; M+ X) R) [6 v; N! X
The way it works is very simple:/ ~$ \7 L* G* _# Q# b/ }: ?
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 D& C% k$ I b
WinNT) with the CreateFileA API.
0 M( i! s \9 j" P8 C
: i7 [: N1 t6 OHere is a sample (checking for 'SICE'):4 L( M/ H5 w# l5 n2 ~* l
# h% I) _+ z' A' d% J
BOOL IsSoftIce95Loaded()
" t1 \9 t7 o( j" t& H8 t4 m{$ J' d7 x/ g2 b1 o
HANDLE hFile;
0 Q* g! W+ d; u7 n- z' j" V hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 s( k# G8 B+ b. j FILE_SHARE_READ | FILE_SHARE_WRITE,, g, H. \9 h- ]! z& k, B8 }. {" \
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# G3 u( v5 W/ D' Y) E2 M, K8 |2 L3 k
if( hFile != INVALID_HANDLE_VALUE )
2 g, ~( _- x' f# V/ K: A! \, k+ n {
1 X. X$ Y* s7 X8 u X CloseHandle(hFile);
! X& z4 M6 G# d$ _4 M' m6 z return TRUE;, D! n2 S3 k0 j1 a2 {% }/ g+ x9 B
}6 @" v/ V: E# g+ a5 J
return FALSE;
, d- V- L% h0 a7 d2 Q( S}6 ~0 e O- N. T0 ]: F- g. b
5 N1 @! q8 O1 |Although this trick calls the CreateFileA function, don't even expect to be
5 o; [7 l2 L4 p' P7 \able to intercept it by installing a IFS hook: it will not work, no way!
$ E1 k' c' T7 L8 z) D+ C9 D& hIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
( p9 q) n4 a$ q* J5 Cservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
0 w0 n, ~) U7 Dand then browse the DDB list until it find the VxD and its DDB_Control_Proc( J2 ~, u, G6 E" P: N$ v
field.
0 K; F+ G+ K. I& K zIn fact, its purpose is not to load/unload VxDs but only to send a # A! i7 E, l( k8 w5 D3 W
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ w5 ]8 I! V- s! I" V" rto the VxD Control_Dispatch proc (how the hell a shareware soft could try, E1 A8 g- J) P/ `2 J8 h W3 s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
( ~- _( u/ X: ^- I, h2 Z: }If the VxD is loaded, it will always clear eax and the Carry flag to allow
~4 W$ u5 w7 {0 Qits handle to be opened and then, will be detected.
2 p$ V$ f1 R5 U, I, f0 k1 cYou can check that simply by hooking Winice.exe control proc entry point& v$ e+ h6 k8 |' |$ u
while running MeltICE.( M" f% O2 S$ K) q* m: h
1 m2 w- z/ w! H' z# \
; \/ h+ l! C# k$ t& F 00401067: push 00402025 ; \\.\SICE
# A# t! ^7 S9 u1 ^3 T; W 0040106C: call CreateFileA$ @/ @% a$ D2 A% N6 @) Q) X: ?! _
00401071: cmp eax,-001; d2 L6 H1 G" H. q, Q( m2 |1 U
00401074: je 00401091
( X4 @7 N0 B2 C: \; O$ h8 j: I1 q" v, c8 c+ V7 |2 K+ G
. m. C) W8 X0 ~, F- W8 {
There could be hundreds of BPX you could use to detect this trick.2 Q& ~( M3 i( L2 \% z! |7 D
-The most classical one is:
7 ]0 j+ y1 n. v7 o U4 K: ^0 |% X BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||6 ?; P7 r4 T( ]: C7 a! Y
*(esp->4+4)=='NTIC'
$ Q; a: Z0 G- Q* O" Q. ?2 g5 ] Q$ ?! m9 z' b3 w
-The most exotic ones (could be very slooooow :-(
2 v7 s- v% ~+ P/ s0 K$ ] BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') / n0 N$ Q, U% k6 W
;will break 3 times :-(0 v0 M7 S4 a2 d. G5 @
3 L! u3 q! C8 K3 m7 d A" n-or (a bit) faster: / A1 q2 n0 V3 z: E
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')! e5 t4 p0 c3 E# }
& o% [; j% X9 d8 |% q- G% ?
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 J9 b2 d' v. G" G) {0 l
;will break 3 times :-(- {9 U% _+ ?) S `/ z
: I: O q6 a; h* t$ l/ H& H# D# @
-Much faster:
; ~3 A, G8 ]7 O# Q* `! G BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 [% q5 J4 e2 ^+ T8 C- S+ f! Q% L
" T1 e8 F3 @) F% F% ?, r% gNote also that some programs (like AZPR3.00) use de old 16-bit _lopen: @% F1 r) ?1 I+ ^! d9 q% Q
function to do the same job:
2 X, I' l- n. \1 i* f5 I) f( l) h% j0 l' v6 ~
push 00 ; OF_READ
2 z4 k+ r/ i7 j. q mov eax,[00656634] ; '\\.\SICE',0
- U0 |& G+ X0 B" ]. N4 f1 [/ o9 n/ e push eax. j/ {& m1 W3 n% ` H/ T
call KERNEL32!_lopen
5 K9 K. Y1 x+ V; s inc eax
) c# V' |& `3 N+ g9 K2 f jnz 00650589 ; detected
( S0 I/ C% l& u& c2 n! k& b0 U4 z& l! y push 00 ; OF_READ
% @9 V0 h# k" [) _/ Y7 O3 x: } mov eax,[00656638] ; '\\.\SICE'- H" F, N( L, c4 C8 y4 O$ S
push eax( a9 w+ |, W" P- [9 i
call KERNEL32!_lopen X! _9 h, O$ v+ i
inc eax
2 M2 L+ V# D- Z w6 f5 C& K% u jz 006505ae ; not detected2 U+ ]% Y, O; ]- r3 {
% E, B3 |7 b3 R' F! _ K
4 R( Z: B$ @2 L/ }) T0 G* z) U__________________________________________________________________________
" i) t2 a1 H! N2 d- H3 U/ A2 y- e( f# m6 S
Method 12
2 H$ m& m: u. ~0 Z" }8 v=========
+ M8 g/ u4 M; B! h+ y: ^( c0 R7 X0 q& n. r2 c: x7 S
This trick is similar to int41h/4fh Debugger installation check (code 05
3 |$ u t. M6 B: m, Z, A& 06) but very limited because it's only available for Win95/98 (not NT)9 y. x. V8 p, h7 r6 z, _. V
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 W1 b6 a3 b; p3 N$ [7 ? J0 Q$ A
# D$ ^$ S! Y9 v$ i% \ push 0000004fh ; function 4fh; O' g6 i+ l9 x7 ~: y
push 002a002ah ; high word specifies which VxD (VWIN32)6 Y& ^7 I' W7 u. m$ I
; low word specifies which service
3 m& B% Y+ {6 M" Y1 F7 p e (VWIN32_Int41Dispatch)$ U/ t# j4 j V: Q2 D) ~$ Q n
call Kernel32!ORD_001 ; VxdCall& i( N1 p8 c7 ?" E* R5 o3 s- h
cmp ax, 0f386h ; magic number returned by system debuggers
4 i( G& K: A, G' C jz SoftICE_detected
" ?. D" O' I3 {- }) R$ K. C2 R2 S) L3 Y
Here again, several ways to detect it:
; y' s* f! U F
) h& I; u* V/ Z3 c: e BPINT 41 if ax==4f" u1 d5 J4 a- ]1 y1 q" d4 F8 ^) _
& X/ ?" y- ~! p9 i+ ] BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* K5 H4 _! S0 j R/ F# J$ D/ A5 G
4 i. W x' f* o% G, X$ D; s BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
* C7 d: v1 f, C0 H; R) s! Z* R6 t5 ]& p6 f! X
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
* u7 m8 t' ?; Z( Q; E+ c+ f
8 |. g0 |6 V+ U. ^9 s h$ c__________________________________________________________________________
. G; `5 W7 X, R8 C. [* l+ }/ x7 o* ~' q: M: h: n* S
Method 13, r2 M* |! Q' T/ B
=========6 t8 f1 j& o. ]3 Q1 U& W4 c
6 l- @/ g+ |8 r+ s$ f$ @/ A
Not a real method of detection, but a good way to know if SoftICE is
- f' }( _( ?# t& R K, Q8 b# yinstalled on a computer and to locate its installation directory.& h/ A' |- D7 x* w
It is used by few softs which access the following registry keys (usually #2) :+ I4 ^/ B5 _: ~$ E2 {8 w
6 H4 V. X" p1 m- i2 B
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, u. \- J! J' V: [( A\Uninstall\SoftICE
- M1 K) n- z f, o; k5 Y g-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; P2 m7 U/ a6 e" w9 V- u$ s
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# K [7 g1 x R, A$ q! U\App Paths\Loader32.Exe- w, q& X& [! ?. ~$ e9 Z% h
" B* G7 f7 t. m, ~1 p I; n
6 ^, f9 T) Y% P0 Y& \: N+ E; DNote that some nasty apps could then erase all files from SoftICE directory
* a; J8 i6 V, ]3 [(I faced that once :-(1 j* j9 N/ g* r( n( n% X6 j
- {. ~ G* B; D% `' W
Useful breakpoint to detect it:
. P" I6 ]- v8 @5 X% @0 i" r8 J M- Q/ T6 q$ I1 w
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'! H: V; s% Q& d; X( g0 @
8 N3 v' z) X* v; k/ n7 h) w0 k- d3 r
__________________________________________________________________________8 C% X1 L$ I0 {; J L) G
8 I4 G5 f# B9 @9 @( }
8 S+ y, M" V1 ]! k4 z
Method 14 * i, d% N H) k
=========+ R+ ?: N( M3 T% A* C
3 s& M! i6 X% w! O/ _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ S6 d) o- `0 e: A" {' m4 p. v; x6 E
is to determines whether a debugger is running on your system (ring0 only)./ S4 ?$ B; h8 D3 g O, Q
: P& }2 \" X+ ^/ b6 R( j- A
VMMCall Test_Debug_Installed) _7 n; O4 z1 b) q2 @! Y
je not_installed
) D9 w) C3 C0 m9 T: M
" Y3 ~$ B6 Y" \2 r0 n8 k" v8 G% LThis service just checks a flag.' r) [) X" M! {: K0 x
</PRE></TD></TR></TBODY></TABLE> |