<TABLE width=500>
1 l6 r, U* n9 m v7 G, }<TBODY>
- |# _8 R! j9 g! r2 I- @<TR>
( W i- z0 c- m9 h6 }<TD><PRE>Method 01
" q3 v5 K I+ j5 {+ V$ c=========
" J* D7 S. L" O3 a0 z5 F6 T% n6 f4 W) S+ `0 g
This method of detection of SoftICE (as well as the following one) is4 P9 q0 x3 a0 C: T
used by the majority of packers/encryptors found on Internet.9 y, [% o" G+ Q+ [. v7 o
It seeks the signature of BoundsChecker in SoftICE9 S' R/ @# ?( ]+ ]9 ] i$ ]" ?# K
# S2 `( d' t9 d6 Y7 r, i, H5 k2 o mov ebp, 04243484Bh ; 'BCHK'' `7 [# U2 i* s, G! s& h- L
mov ax, 04h
( A2 z* @$ `9 ?% S0 G# G6 C int 3 * Z c' F6 o' k0 l, ^% N
cmp al,4, T& J1 l4 q. v5 z) F; n) u
jnz SoftICE_Detected
9 r7 c1 ~7 d0 \; c# P% M
, x9 s$ m) y2 Y6 u0 k. W& G& t___________________________________________________________________________0 f( _( J+ H; j! u& q
3 C6 m O5 Q0 G/ b
Method 02
0 P: h$ k/ a4 L% O5 [=========
" M: R5 G$ w8 u$ {8 l& s) H. u1 u! Z+ @% A( b
Still a method very much used (perhaps the most frequent one). It is used
+ q7 c4 l% h2 s& D, |% [" _8 ^, Q# @: pto get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ y ?$ j* @' F
or execute SoftICE commands...0 p# q1 Y6 s. s5 [
It is also used to crash SoftICE and to force it to execute any commands
" M) z, @6 A2 w! _* t: R7 j! X(HBOOT...) :-(( ' f: g7 k+ \9 z0 {. ?
. j3 P7 F" H1 tHere is a quick description:
$ G% a: d1 g( h$ f-AX = 0910h (Display string in SIce windows)# _& X8 D) Y# L* ~3 f& i
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
- W& L1 B. C" P4 m9 _" u/ c( Q" a-AX = 0912h (Get breakpoint infos)
" s1 w2 Z; x- @* n; @: ]( `& i4 y-AX = 0913h (Set Sice breakpoints)/ i1 A- D9 m! o1 N# \" [! `! `
-AX = 0914h (Remove SIce breakoints)0 u I, U% Y7 o7 z8 a( c h
+ Q, s* }% p1 IEach time you'll meet this trick, you'll see:0 v; W6 c& e/ x. n& P1 p0 j
-SI = 4647h% x$ i, j" Q, J; f( q8 _3 m
-DI = 4A4Dh0 E1 w$ F! K) T2 O! j
Which are the 'magic values' used by SoftIce.4 N9 N W$ ^- K8 S- Q, E0 u9 h
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
L/ l1 K2 G7 p5 m& ~2 N. Z6 J4 ]+ Z2 C4 Z
Here is one example from the file "Haspinst.exe" which is the dongle HASP
, s7 c' A' y5 f' h# ~Envelope utility use to protect DOS applications:
1 i) j# y, i6 W" N$ H9 H, v* g7 u; B7 V# H: ]9 r8 D0 K; U
( U* ~) [6 ?1 h+ z
4C19:0095 MOV AX,0911 ; execute command.: _: G& P e8 z7 f/ H V
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).4 f5 o. Z9 d# W% Q* l0 @" x6 e
4C19:009A MOV SI,4647 ; 1st magic value.
9 i+ Q( P5 K( ?: }2 Q4C19:009D MOV DI,4A4D ; 2nd magic value.
0 y2 ` x4 Z$ q$ B* @1 ^) n7 { a4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* n8 s( z6 j+ n
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 t2 n- Q" a8 T2 I
4C19:00A4 INC CX
. B8 ]4 o8 O* R, c, ]4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
! h" M/ Y! m. R7 r' n Y# R; z4C19:00A8 JB 0095 ; 6 different commands.
& I. y- E# O1 d6 ~9 [4C19:00AA JMP 0002 ; Bad_Guy jmp back.
7 o- L3 r& m0 @3 q4C19:00AD MOV BX,SP ; Good_Guy go ahead :), C* M D( }+ t. O) n
1 K4 i$ [* p; r7 `% d# v
The program will execute 6 different SIce commands located at ds:dx, which
& `2 N! _( L* dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 V) H e2 B) Z6 X% g
6 R% J1 ~* ]# j* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 R: Y9 ~* K# }$ J" E/ w$ V___________________________________________________________________________
4 P2 @- K6 C& x( A- ~5 E2 d7 x
8 q/ q' S; ^& B4 ?* [( c8 m( x# `3 h |: s4 G- ?
Method 03
* y# a: t5 B4 |) Y$ S=========8 [4 J, Q% ]) G( h3 D
7 N. r; k D) F7 m) ~1 O
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- u( \1 I, x5 t(API Get entry point)
5 l. A1 X$ o' j* \9 ?1 x # S1 W8 g/ ]) p) u, A
5 y5 B Q% i) z0 }$ P4 _
xor di,di L0 l4 g5 a9 X) F# r% o8 s
mov es,di& p# c5 n1 f* A: q- q5 \& H* m
mov ax, 1684h
7 q9 n7 q S" Q0 q' F$ I mov bx, 0202h ; VxD ID of winice8 N. _) G; R7 s% c6 ]; \1 g6 F/ b
int 2Fh
* C% s/ m* N% t; Z3 W3 v) M mov ax, es ; ES:DI -> VxD API entry point1 M3 n" t) y2 o% A+ n5 o" N
add ax, di
5 W) L7 F1 v$ Q test ax,ax r# V# J! z- }, {) V8 K
jnz SoftICE_Detected% y; \/ p6 R0 T- w+ C) E4 `
$ x' c( [5 Y& N9 O- h& m: j4 ^___________________________________________________________________________
. D% z0 ~4 p4 h2 x) C) u. i+ k B( B9 h7 M5 S/ s$ |
Method 04
$ ?( W3 I/ d( y0 @; @% h=========
3 F. S7 ]* D+ c) O, Q5 F, G" G o/ _2 z5 o" {- f# M! M( m2 @
Method identical to the preceding one except that it seeks the ID of SoftICE1 m: Y$ Q' A6 a# W
GFX VxD.) z, O1 H1 V1 p0 K4 U' O4 H
: O7 S* Y0 V* i j1 f
xor di,di
/ _* h6 A4 n7 f# R9 R mov es,di3 f* v+ Y1 g6 G, S$ n2 u% i
mov ax, 1684h ( g+ R& g6 a. k2 j& P6 [* {0 k4 o
mov bx, 7a5Fh ; VxD ID of SIWVID
1 C# q( V- K! p, z int 2fh
- A c7 \, `* V mov ax, es ; ES:DI -> VxD API entry point! X0 b* K, T0 Y' I" z& t
add ax, di7 l- ~0 R1 x$ X! r: K
test ax,ax
9 f, c! Q6 i. E& _) N$ S1 u jnz SoftICE_Detected
1 V* C K8 i# A: Q/ c
t! v/ l& q2 M8 C& ?: a& F/ |4 r__________________________________________________________________________4 Q! B. O6 ~% U& O" M7 N
; X1 r- V! p; N4 Z6 J! o
% Z" d5 B7 U3 B9 B* x4 aMethod 05
: c9 X1 {, m9 e1 w=========; d9 y- C8 f9 f) U6 \/ P9 q) k! V
$ k8 ?0 k/ o. @Method seeking the 'magic number' 0F386h returned (in ax) by all system
: q/ D* C; x) \debugger. It calls the int 41h, function 4Fh.
. m. }( `+ C# |0 G/ K' N/ GThere are several alternatives.
# V/ ^0 k/ o' {& s3 @0 t
# f* b7 h& ]9 {% j' q' CThe following one is the simplest:. J) ?0 [9 L! ^0 ]4 p
' x- N, A: }+ F0 m Z
mov ax,4fh
) w7 U1 y! I, B$ [ int 41h' @7 @1 C7 Q; t( k% E3 A. b
cmp ax, 0F3862 J s5 c u0 M1 r- e
jz SoftICE_detected
+ E8 Q8 p* t& ~- M# X) k+ I+ @8 s8 T+ s7 ~' U- P
. J% j! i9 O0 g0 O& q- ]# g
Next method as well as the following one are 2 examples from Stone's
4 T- Q% Q$ _" b' z$ p% H"stn-wid.zip" (www.cracking.net):
" O: r; B3 _! D$ i" y0 F$ ?) G, ]( l2 @7 I$ M
mov bx, cs" J1 f, B e3 ^+ z
lea dx, int41handler2. y' ~. [/ h9 f- M/ R$ x* U! x
xchg dx, es:[41h*4]8 F7 V* f, Z2 P* c5 G- d
xchg bx, es:[41h*4+2]1 N+ D' G) R; a) i) K
mov ax,4fh
0 k0 A, N" E- P6 j0 v$ y/ T int 41h8 A# b4 o4 h, X. C/ y$ C' Q
xchg dx, es:[41h*4]
3 [5 J5 ^7 Y4 N v$ U xchg bx, es:[41h*4+2]3 Y) h9 h. k& S8 A9 r, N+ E: Q
cmp ax, 0f386h
" M1 ^7 ^$ l! P% x Q* x" i jz SoftICE_detected9 _$ L( K+ i# d( R
! o+ l% c/ s7 } y* g1 y- e5 _, w. q
int41handler2 PROC
& K4 g% j9 O" i iret0 h Q" w1 z( j2 s
int41handler2 ENDP$ g. p( C! O+ b* x2 ?
; X/ V* g2 g" |2 X1 v7 @4 ?6 R* A$ E* c1 `8 o* ?( ?) X
_________________________________________________________________________/ [0 d* F9 m. |# W9 u: {
0 `2 G% e7 y: W6 z7 W+ U5 x+ F' K9 f
3 a0 }6 w8 R: BMethod 06
8 I- ]# N7 E# I- {( ~$ f=========
9 R. u- \9 F" V0 c4 [' m
" p3 o/ F8 ^ A1 Q+ t; c; @: W0 s9 i% q9 o2 F2 ?
2nd method similar to the preceding one but more difficult to detect:4 U6 N" M" h& x0 ~8 M* y8 \
: B7 a$ }! N2 J
+ Q) U( y# J2 q2 n Y# [+ ~int41handler PROC
1 r" x" V( Z0 e% Z) P mov cl,al" a9 s" H# G8 g) e
iret! T& b- \0 z& t5 v. ^
int41handler ENDP
% R( ] {& U- n! [+ |" o( Q( I0 g& f0 n! g `) v
3 d# }2 {' i ?
xor ax,ax
' l/ g8 a* L( c2 E9 V/ x mov es,ax* J$ f- ?" ^ _5 A5 P) B
mov bx, cs8 [' i @! b' o$ K/ t+ a' m
lea dx, int41handler: h) z) [0 T% c1 d: @& h. u
xchg dx, es:[41h*4]! v# z* w' l1 v
xchg bx, es:[41h*4+2]
" Q+ }2 h8 A& @/ C5 s in al, 40h8 @( j3 d j5 g$ f8 d% o" p/ R M
xor cx,cx
: Q: b- z! X! F E4 G/ B7 X: ]- N8 b int 41h
# N0 R# p9 W6 Q- p# s7 J2 n, r6 K ? xchg dx, es:[41h*4]7 v2 u+ c" ]- M& ~* R
xchg bx, es:[41h*4+2]6 b& R6 o& e0 {5 o4 s4 O* C" Z
cmp cl,al
8 [- y4 W' w9 F. ~ jnz SoftICE_detected
# k/ R! S' _# _8 ?2 j/ M! ^
5 o, K9 m; |- w1 V3 j_________________________________________________________________________
: B1 T/ u$ x9 z0 L$ Y) A: o. T1 M+ {. [5 q6 T/ [" j
Method 07
$ {9 V2 S. k* @$ K8 @=========1 L3 d/ |* J6 u' i, |; u6 P
3 f: l$ h+ \! G& e ], lMethod of detection of the WinICE handler in the int68h (V86)
7 E o8 |; d) g! J; ^- Z7 D% L5 a) Y0 ~. c! v+ F: C
mov ah,43h4 M. x# m: Q+ p# b$ y
int 68h
3 W' p: R' g( t cmp ax,0F386h% l h! A! O6 ^6 c8 Y! \2 X
jz SoftICE_Detected: o% w- m( S# q2 i* s
& W& e% S7 g! H. `3 A0 o" N
3 o6 ]% I0 r7 v8 W, q=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ u% c. p$ W! ]; b" h0 c6 g2 a0 p
app like this:, M2 }" A4 C2 [
* u( B; ]5 r% e" M( O
BPX exec_int if ax==68( g9 p( a5 G4 ] K$ \' \8 L6 ?& @
(function called is located at byte ptr [ebp+1Dh] and client eip is
1 Y" \! m, a' Z) n n4 T, `1 r* g located at [ebp+48h] for 32Bit apps)) x) w' Q0 Q' P/ ?
__________________________________________________________________________
2 `% m. v4 J8 e; K2 s3 M* s& y8 g( T8 H/ s6 |% r: M
" B* d. V; h2 a! \7 F: y# `8 d6 H
Method 08
, ]( P$ K5 I3 P$ [=========0 J$ t6 Z$ H$ X7 w
9 S3 `& Z* L( X9 t
It is not a method of detection of SoftICE but a possibility to crash the
( Z! u$ ~) R5 D- W- jsystem by intercepting int 01h and int 03h and redirecting them to another/ q: P/ R: p# ^3 T( m
routine.
' G( s$ a1 o# _- |, o0 x/ EIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 `0 R# e( m5 ~$ X+ E# P) Uto the new routine to execute (hangs computer...)" z% T* z" q" V
9 e) s: M L/ d) |4 S( Z mov ah, 25h: ]$ K$ @9 e% Q: \* P- s5 O
mov al, Int_Number (01h or 03h)
- o3 e& @5 ? Y2 ?2 k mov dx, offset New_Int_Routine8 ^8 ]3 B9 O& Z2 k7 h C
int 21h
& X X4 w% [: h% a% K
8 T% Z% h) k: @' ?3 v+ o__________________________________________________________________________, t: V9 t8 V; w2 N6 _& M2 Q! u* C
3 n4 e. P9 f+ X( [, e' A
Method 09
/ |& ]" F, k; Q# D1 h' S3 R# x=========# h) b- H t0 d( `7 O
+ W' [" G5 V9 s7 O2 mThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) F/ ^5 M0 B* k7 z- O4 P8 Z
performed in ring0 (VxD or a ring3 app using the VxdCall)./ o1 v+ e& T& j1 L( \
The Get_DDB service is used to determine whether or not a VxD is installed
. w- p- } B; y) Tfor the specified device and returns a Device Description Block (in ecx) for7 A( Y: g) v2 [9 q; A
that device if it is installed./ s$ C1 p0 k) f: |
3 m% y( Z. ?* x: v, f mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ X; ~5 K( w; v; q* |$ [# b mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 ^/ s! R: L, r( }$ E6 P n2 u- a VMMCall Get_DDB
* c) X8 f3 K. e6 }$ L4 c mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& w* k# E" i8 N" a% F) @
0 f! @% P- T6 ]* l$ s* ?
Note as well that you can easily detect this method with SoftICE:
# F t! t* k. g' P' U/ m! T1 R bpx Get_DDB if ax==0202 || ax==7a5fh$ g% c0 b1 y* A# F1 W- |( m
" x2 @, P( ^7 V7 T! x
__________________________________________________________________________
- V% _: s! `) c' w& c9 U! x, s1 [' _5 Z2 A+ ^7 h' K$ k6 o8 }
Method 10
4 ]1 n) ]; x( H. K z, [=========+ }) ?7 A7 k. C# B! {; i
2 u8 \8 f a9 D2 ^; J; ]4 ]
=>Disable or clear breakpoints before using this feature. DO NOT trace with
; t& H* G* d8 ], K* } SoftICE while the option is enable!!
% ~, L, Y4 `2 G5 Q% J- \# d- n& \7 i5 N
This trick is very efficient:
5 V6 M9 Q- b( A5 G. qby checking the Debug Registers, you can detect if SoftICE is loaded# m" i, t# `! L) ~# Z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- p+ y9 H% D; Q/ r8 s9 W
there are some memory breakpoints set (dr0 to dr3) simply by reading their
7 r2 \$ D( i2 m' c6 b# b. fvalue (in ring0 only). Values can be manipulated and or changed as well- m3 U. B( F1 A/ Q) A; R
(clearing BPMs for instance)$ q' B& `/ s4 C4 j' z' S
: Z2 M, T; i/ C4 k4 T& z3 |& @__________________________________________________________________________; S; `0 o+ s8 s% ]9 ?- B1 g0 G+ v5 O
5 b/ u+ \: ~' L# g! DMethod 11
$ L; v7 X5 A Q1 `=========0 m8 {& O# y& t* |2 D
+ R. y; D7 H& o) p# I- ~+ UThis method is most known as 'MeltICE' because it has been freely distributed' x4 S3 A% X2 g8 Q# ~3 v
via www.winfiles.com. However it was first used by NuMega people to allow
1 K/ i, U7 G5 Q2 o% @- K9 u: xSymbol Loader to check if SoftICE was active or not (the code is located* d: R# L1 U0 e+ ? N
inside nmtrans.dll).
4 X9 Y( _' _3 m) o C1 Y0 |" [$ _6 a. B1 [
The way it works is very simple:+ f- H# k5 K5 [1 B/ g. j$ e8 Z
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" Y0 a. b' Y$ P# S7 r' T' P. L
WinNT) with the CreateFileA API.3 O3 M, ]9 C8 E$ f' F# ^/ q. t) q
. \/ n- l- q$ K( m) U0 K# V7 UHere is a sample (checking for 'SICE'):
/ X) c c0 |9 [+ v% M
4 H0 k9 `! [' H2 m6 `# LBOOL IsSoftIce95Loaded()
- J n: M* z: D* Y+ _{4 V7 {5 b/ t$ F; |6 Y9 o
HANDLE hFile; 8 t4 l0 ?9 \) R3 U" i" r' Z% O
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ _4 L( o$ j, n* ~( B7 q: O
FILE_SHARE_READ | FILE_SHARE_WRITE,
4 j1 M# ?6 ?, z. y$ s9 y NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 g4 ~+ @- Z0 x! _$ A9 U
if( hFile != INVALID_HANDLE_VALUE )
4 m |+ z; O! }* \ {3 ]2 i3 Z. `: v; Y; p. Q
CloseHandle(hFile);
: d+ J, r- H& q1 |6 P' X return TRUE;
) \/ `! t# b! U! A: |1 H5 B }
; `6 p& f9 F; d9 M return FALSE;0 w) T: b- }( H6 z0 H+ v# P
}6 l# |+ J7 h0 c/ j1 Y7 {/ @3 ]
( F: \, z. c# s, I2 P$ H
Although this trick calls the CreateFileA function, don't even expect to be3 b3 Y( |( C) Z! ?
able to intercept it by installing a IFS hook: it will not work, no way!
0 k8 ~! F4 W* a. M5 xIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 V! z( n3 @- N5 N8 C7 Rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( v( Z; R I Y% S
and then browse the DDB list until it find the VxD and its DDB_Control_Proc, ?. d7 _# b# _7 X. e" _
field.
. _ w7 q6 l; @4 Z+ LIn fact, its purpose is not to load/unload VxDs but only to send a 1 f; f% V. e; X& B
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) b+ _! T; e! Q) m8 n
to the VxD Control_Dispatch proc (how the hell a shareware soft could try: [4 R; Y2 M6 x# O8 }2 L: N( q
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ T, i, _% }8 z. O$ Z2 e' k. R& nIf the VxD is loaded, it will always clear eax and the Carry flag to allow
+ S" ^$ _( y: M4 j5 xits handle to be opened and then, will be detected.0 X0 P; y9 V8 \5 {; [8 ~
You can check that simply by hooking Winice.exe control proc entry point
5 h3 ^# p# h+ Awhile running MeltICE.' x; X, M; Y+ c
4 r- O* ~7 V; q v& e
+ v1 x) K2 \2 k 00401067: push 00402025 ; \\.\SICE" i& j3 g5 l$ e; c* m8 X
0040106C: call CreateFileA
6 F% d q3 m8 H; ?4 Q- c* T: f 00401071: cmp eax,-001* X% `; S3 `8 W2 u0 _; `
00401074: je 004010916 T1 K+ `" `6 M% Y% h
- X% Q# }' J9 ~, ^, X4 d- l
" c! S/ T4 l, ?4 D7 ^3 V1 q7 iThere could be hundreds of BPX you could use to detect this trick.
, |+ D' _# J9 ~1 p-The most classical one is:
# H: j* K) T# [ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
5 {4 b* o( {* ^: H1 v- ^ *(esp->4+4)=='NTIC' g5 ~3 B2 }/ Y! L# i+ A% L" C
) r0 }1 b* H7 i: g8 ~-The most exotic ones (could be very slooooow :-( }, u) f; K& S+ y7 _% G6 A
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" e2 B% p) e8 E) R1 v ;will break 3 times :-() P+ q3 Y) I5 ~9 l' L
# O3 K* y% _$ { B/ c- s7 W+ @5 w6 B-or (a bit) faster: ; {' F' r: E; ^6 ]2 @
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" d- R# X# ?0 F Z) c1 v4 L- r
; f! C0 O; O: I$ b. E. D
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 3 {" ^$ {* @: z# q9 N1 X
;will break 3 times :-(
l o2 V& j( r
) p( U/ m1 ]4 k% i7 J2 ~4 x-Much faster:& T& V9 l! X4 Q- y, q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 x! u8 ~+ z2 u2 R1 y8 G1 }1 w
1 c* X) q7 c6 o# K3 I6 w* I
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
. x7 Y7 K. ^# J, b6 U( Mfunction to do the same job:
' V0 y j! h0 u/ f$ G1 p
6 S% I1 u1 o+ Y+ P) x& h8 y push 00 ; OF_READ
8 Z9 t) C2 r4 _9 m0 E mov eax,[00656634] ; '\\.\SICE',0 P% d! |# y! Q+ x6 [: u) l
push eax
( _2 P6 I4 j E( Q7 e3 O! a call KERNEL32!_lopen
9 Y8 f+ P, ?2 W4 p inc eax
' G% V* A+ F$ K. V+ P; C; ^4 s8 H4 T jnz 00650589 ; detected
+ y& q4 V4 Q; a. U j push 00 ; OF_READ
; u; s4 q$ ]( k& ~- J mov eax,[00656638] ; '\\.\SICE'
" U5 h8 G& l- f; P1 _4 @" e$ J push eax! Z5 u+ X* Y6 t0 j5 v, `
call KERNEL32!_lopen
7 M+ S3 x, f0 m l. Y& ?- H9 ]& V inc eax
1 w% Q3 R. `3 c' w* { jz 006505ae ; not detected
, k8 p& l2 D9 m- L
T0 a2 ^0 x8 z+ C. [/ C0 @, f
, n' q3 j% j' x__________________________________________________________________________4 q. h1 x$ `2 L1 T5 ~% C$ O
3 x% m. _' g$ Z5 {Method 12# C w/ ~) f; w! D' p& O
=========
: ^9 C1 c8 D9 b5 H
) [" ~0 ?7 L, a3 YThis trick is similar to int41h/4fh Debugger installation check (code 05
4 H" I. z6 J. {7 S. C- A+ E& 06) but very limited because it's only available for Win95/98 (not NT)
6 M: e0 X6 m( uas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 v6 R. z; [' @
" q7 i8 K2 b q& m push 0000004fh ; function 4fh" N; V, a# S! @7 D* H
push 002a002ah ; high word specifies which VxD (VWIN32)0 J5 M- o, L6 R7 A( r& a. }) G
; low word specifies which service
. U" W6 g# M" a; c# H (VWIN32_Int41Dispatch)
' Q6 ~: o: J( n0 ~* C- X call Kernel32!ORD_001 ; VxdCall
3 D# n! J2 ~6 l+ u! Q e! r4 u& K cmp ax, 0f386h ; magic number returned by system debuggers
8 S: H7 V+ {5 @4 |, c jz SoftICE_detected
! v; K' m1 n! g6 G. Z9 H0 w8 y+ O# W) t/ [# ?7 ^
Here again, several ways to detect it:
, ?7 x0 R( i9 w, a8 f8 H+ r
2 a# M1 Z, H- t, R7 k8 M& a; n BPINT 41 if ax==4f
8 d: [9 [4 v4 G" J9 O% H+ p7 E5 Y( l; r5 f2 c b
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one9 ~3 t0 i9 p8 `8 G- I
! }$ P, {. P V. Q; H5 V X- w* w
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: ~# p% C' m5 Q! x2 g F5 G" A- D" _+ C8 J# [3 F9 F
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 P' N% D! K8 q' J/ B$ Z) I; e. J3 _* g- T9 L8 d4 T" n6 V1 _
__________________________________________________________________________' H4 }0 D) [* P0 h5 v4 o/ M5 Z$ \
3 C% S& q! J/ V
Method 130 A% `9 Z+ d4 r" h/ o' i
=========
1 H+ A: H/ `2 a# ?
# t E& r! f- F+ i% QNot a real method of detection, but a good way to know if SoftICE is
1 J' e# F0 l5 n" n* minstalled on a computer and to locate its installation directory.
# h) d# V- ]3 J1 d! K3 s5 tIt is used by few softs which access the following registry keys (usually #2) :
/ Y Z& k% n, c% x
& N# Z# G7 j* M6 X-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 U% T1 |1 ~, |) n; x( H
\Uninstall\SoftICE% z" b1 N" N# O( e$ c: k
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* W- d' a& f: X: c7 Q/ O7 C-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 b3 @; B) Q4 \, L, V7 k5 Z9 g; D\App Paths\Loader32.Exe8 h3 {/ k# V% s9 v# N- f
- H0 h( G! j5 s
) Y7 \3 S5 N% p7 F* ]7 l* b8 w9 fNote that some nasty apps could then erase all files from SoftICE directory& _3 I# X) L* x
(I faced that once :-(
" n C3 p' K( s
( L/ P6 O# _3 b* `- EUseful breakpoint to detect it:
2 V' R9 A' {) d* v& ?7 d# h' H& L* S* a- C" U
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE': l$ F7 r1 f- E
9 _! ?2 f" b! K( U c4 D* [3 }__________________________________________________________________________3 D! I) q5 G! _: A! A c
5 |+ M ]7 G. B6 w: L" B5 L5 T2 F/ U) @
Method 14 8 @$ J, t% p5 h
=========9 U/ ^% t' J1 V& X) R7 \6 f" v
0 I, Y6 t* d' h T- G, @
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& K; l' q$ H: n/ Q
is to determines whether a debugger is running on your system (ring0 only)." l7 x* |- g6 Z* e
1 v7 y, C Z5 ~3 q
VMMCall Test_Debug_Installed
1 J( F+ m5 `4 r/ t7 p9 a, `" ` je not_installed
5 x: S7 A# q9 N! N4 M
& Z# R2 @/ L. _" F" N* ^, pThis service just checks a flag.. O- v1 X$ O; i: h9 }% K
</PRE></TD></TR></TBODY></TABLE> |