<TABLE width=500>
3 m" M5 U; N+ d8 Y3 e4 ]$ c2 Y9 e<TBODY>
6 z( i# a- B B2 x& T<TR>
1 v. W' c- G4 Q' x<TD><PRE>Method 01 / h+ Q, y! X# x* l6 j# ~
=========
/ }$ S8 i( F7 ?
* r8 D2 Z* x! M* Z3 aThis method of detection of SoftICE (as well as the following one) is
. y& q% n5 m8 [! v9 Hused by the majority of packers/encryptors found on Internet.. |, Y. Z( K$ n) S* H
It seeks the signature of BoundsChecker in SoftICE( T$ n% A$ _1 k+ Q; ?
0 ~0 @4 @( z8 Z+ l' u' e
mov ebp, 04243484Bh ; 'BCHK'5 [8 v7 Y5 M1 X# y
mov ax, 04h
1 B& Y8 ]7 H9 |0 c9 A+ `8 z int 3 ! n9 ]+ O: ~5 e
cmp al,4
# C, ^- o' W9 z; S( V% h jnz SoftICE_Detected
0 @3 h9 w) U" j, m& b' u6 b& F- L" L
___________________________________________________________________________
0 w! w$ ~1 s1 L# ]1 W
, `6 V4 `9 K" w: k5 |2 D9 @Method 02
8 j1 M1 D6 E2 n( F$ v. ` B" k=========
9 U% [/ m( s& B+ t1 Q1 O' ~' ? X1 [0 T$ @8 ]1 N9 U6 u
Still a method very much used (perhaps the most frequent one). It is used6 ]' h @& x; A- D2 R6 \5 ?; N
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,& E4 a/ G) Z+ x2 n9 d$ ~
or execute SoftICE commands...7 z% O6 w; U4 o d
It is also used to crash SoftICE and to force it to execute any commands) I3 k: u, |+ E7 y* O- ~
(HBOOT...) :-(( 2 ~$ t9 \' s* |9 j2 M
5 }9 d1 J7 \+ m8 Z8 o& Y7 [3 QHere is a quick description:5 t( w7 o, |" w* R9 K4 D
-AX = 0910h (Display string in SIce windows)" {- u& O W. z, v3 o9 o
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
: e$ Y1 b5 `7 a% L-AX = 0912h (Get breakpoint infos)- b6 P6 b# }4 V$ h% F
-AX = 0913h (Set Sice breakpoints)
- T# n. J' J2 {1 M) Q) |-AX = 0914h (Remove SIce breakoints). }2 K+ X6 k D. w
/ c" H* y3 D n B
Each time you'll meet this trick, you'll see:
. {8 R6 t3 J5 ?' o/ |-SI = 4647h/ x D) q. k6 J
-DI = 4A4Dh
" h3 N/ N1 \% O: E3 y; h; DWhich are the 'magic values' used by SoftIce.# G i2 q5 `$ }+ j
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.* p* ~$ N6 V) K8 R3 z. O1 u
7 o' Q( K# v/ V5 D7 N( GHere is one example from the file "Haspinst.exe" which is the dongle HASP7 `- o' ^8 S1 v4 D1 N& y9 ]
Envelope utility use to protect DOS applications:4 j3 d+ V, [2 Y6 G) C
& { E+ F( m/ L& T1 z) U G( c
; h& W1 ^" x/ l5 f o" z- Z5 t# Y
4C19:0095 MOV AX,0911 ; execute command.& s* Y& w4 O% o" e6 x. }' h
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) x4 s0 q7 z+ t4 q8 P' {
4C19:009A MOV SI,4647 ; 1st magic value.& z1 R I+ s G* k9 Y5 ?! v
4C19:009D MOV DI,4A4D ; 2nd magic value.! k$ m; s4 b: \+ M' c
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)- F1 w4 [/ d5 ^1 w# P
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
( n/ N# X+ J' M$ C( Z; U0 F1 X4C19:00A4 INC CX5 ^" Q, L. n; `
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
7 ]$ R5 Q* `- c; X8 x+ C& ^4C19:00A8 JB 0095 ; 6 different commands.
0 e% t8 t1 n( b; W4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, U$ d3 Q" c7 j5 ^4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. x9 `' n& v$ ~) [% Z m6 |" x) b" T u5 S& F, P
The program will execute 6 different SIce commands located at ds:dx, which
- h0 V2 L& \- yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 q8 S: f/ H/ O
- |' R! ]: u4 l# P+ x9 q4 E( K
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.# T: H+ M% O/ C
___________________________________________________________________________
2 g+ y) B! B5 B0 {% a
0 H4 Y7 `+ k' n; Y% c# _) k" C* g$ v, A2 d+ C/ W; F! Q/ L
Method 03+ v8 d4 l6 o1 U/ P
=========3 Y* q! C e& L6 W7 p' B
; C8 |/ E- w2 @7 J1 X) x) _
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 W5 v, k% @) Z: h+ G* w8 L7 B(API Get entry point)
" n* g5 @- e* B8 k
* w, D! s. L( n4 V2 _
5 s% `3 K( g2 p" f; p2 X xor di,di7 |- N- I* v" e! I) M8 m
mov es,di9 X+ G; n O6 L) _/ K7 M) V/ P: w
mov ax, 1684h 9 r7 C# u& n5 n: W
mov bx, 0202h ; VxD ID of winice
1 q, z; n+ u7 h& l) l* [4 c9 }; @ int 2Fh; t( q& H& e2 k( g# c
mov ax, es ; ES:DI -> VxD API entry point; Y. ]0 g- G1 E
add ax, di
7 D' v& W# e% ]+ y3 s test ax,ax9 _" A2 R. S; t' o. ]$ F. c$ T9 a1 t
jnz SoftICE_Detected
/ d, ^4 ^; {! \# \, ?/ g% b j" Z/ B/ Y! B: W- l, z( K& l
___________________________________________________________________________
2 Q' z! p+ X( `1 r1 B( M/ L; C; Y8 e# Q* w
Method 04
/ ^, `* }* ^1 ^3 L' J" S2 V=========( z0 i# b) ?1 Z
+ k# j9 v6 _1 {1 M. a' b: q
Method identical to the preceding one except that it seeks the ID of SoftICE; K+ M/ a( E5 a- e
GFX VxD.
7 a5 X. ~6 z' [( }: Z( [) c [ M" w0 p# g1 z
xor di,di
4 m: F. ]- @# `# H/ @ mov es,di
0 B& a$ S" O3 b5 w3 A7 S& c mov ax, 1684h 1 }6 w+ U" s( {" V6 U/ ^8 ~( x
mov bx, 7a5Fh ; VxD ID of SIWVID" `) P! L+ h1 e) Z! w( S
int 2fh
7 b6 d$ L7 V) {# n5 X$ q1 h mov ax, es ; ES:DI -> VxD API entry point
/ P# V* d: J# ]& }2 I/ Z" d. ^ add ax, di: u' ^0 P" ~' h+ }( L. c+ m
test ax,ax
1 u! l2 d1 S/ B9 n* g/ M6 C3 _ jnz SoftICE_Detected0 g3 @9 N+ V( T* T h
6 I5 Z7 h: w$ F- @3 q! ?$ F__________________________________________________________________________4 _0 A) K) M9 c6 ~
: Y/ B) _1 F" ?9 b
7 l8 ~( z& u4 @% i# }9 n# bMethod 05
4 M# ]' F) \1 Z% L% S9 c# i& e=========
+ F r3 |1 y1 n8 z9 _8 ~5 f5 x
, t4 e! M7 o9 X; J0 z X/ kMethod seeking the 'magic number' 0F386h returned (in ax) by all system7 r d" i' }8 c4 n& i+ V
debugger. It calls the int 41h, function 4Fh.4 ?$ k. i2 c, D, _) g! ^& H
There are several alternatives.
! ^: n% f2 Q" W; d4 u5 p& p }
' C5 X) K1 z) ?7 K9 zThe following one is the simplest:, Z. e3 Y1 N" ?$ n! M+ w t; O
# ?- j, s2 L T; S9 F mov ax,4fh4 c1 e- [! ~ K- S% U0 x
int 41h c# M2 k0 j g0 O
cmp ax, 0F3863 H. `( o% j6 i; D+ c9 Q
jz SoftICE_detected
! f! r0 b- [6 z, d8 l. q
* t4 i6 A" s8 o: y8 x# A9 o6 z3 u8 C/ J! ~6 g
Next method as well as the following one are 2 examples from Stone's $ E: }, `- |( p! u1 Y$ l
"stn-wid.zip" (www.cracking.net):! o; S/ n- q+ e+ r5 T
* [$ [7 S. N; e! Y4 F; Q7 R
mov bx, cs; W+ D, F+ r& z2 L6 g# V' u$ _
lea dx, int41handler2
$ u5 T# x, |2 b xchg dx, es:[41h*4]
3 ^: }" Z/ s9 {' i xchg bx, es:[41h*4+2]
" h* Q5 P$ G* @( W mov ax,4fh
) i. g/ c) i- E$ c, Q int 41h" N; r9 x' m* \+ }. l; t) R) ^; G9 f
xchg dx, es:[41h*4]% I+ \* {( f9 J
xchg bx, es:[41h*4+2]
' d1 x- n$ u# s! p" p# j7 J cmp ax, 0f386h
2 N& w9 |5 D' d, V( n jz SoftICE_detected
4 M9 @4 Z' s# z y9 N0 h( | ^, G. E% B$ }3 E" C5 g" Q
int41handler2 PROC
9 g' h! \4 O- S* F# K) r; f% _ iret! s; Z2 _: Y: Q2 E
int41handler2 ENDP
" H% H8 Z' s& @7 b9 ~% y, v/ D
4 w/ F k7 |4 S& d' m4 Z, m- m
_________________________________________________________________________
h% G7 {) R$ q% j
; _ c' L E$ S5 ~5 l4 a8 R5 N! o* u
0 j* L& x+ [4 J4 o$ x& d# ^Method 06
/ P& \7 }; c0 @- c5 o q: G0 c=========$ r5 s% f/ Z5 I5 @3 ]# @9 [
8 C' p" P- i) ~' S
( g& R0 g. f" S' B% @4 N
2nd method similar to the preceding one but more difficult to detect:
9 B) T0 ^- v' r( J) I
$ Y5 r" p. R C$ P: \% g2 e! D% v! T; F, d
int41handler PROC
# f7 t$ k/ z" J9 _8 S1 `/ [ mov cl,al4 D& u5 x( s9 `" Q/ R/ ~
iret: Z1 v6 N1 q$ \8 R& e
int41handler ENDP) t3 |( Q' y( {( U
2 W5 j; w' _7 ~- s& T$ j; `
( u* n- H9 }; `" `: G/ f* ? xor ax,ax, J3 C3 I. y1 e1 M' K5 C' P3 ]; y
mov es,ax
* N' R6 k r/ C mov bx, cs
" E; y' s7 P" \9 w8 O& y lea dx, int41handler: B* k& d3 M u$ @2 ?
xchg dx, es:[41h*4]2 p* C0 B9 D. m! M; L2 f. U* K+ [
xchg bx, es:[41h*4+2]
m- q) r1 Y" H$ p) W+ S; S+ ` in al, 40h5 p, T8 x" g. J2 {3 O
xor cx,cx% }! c% _8 \$ R6 j/ P" s7 y
int 41h0 r3 ^' V1 S, j! z2 p# q' _8 B6 v R
xchg dx, es:[41h*4]
p$ F4 E3 H- Y8 U: r; v! c xchg bx, es:[41h*4+2]
+ {& s5 s" ~, s9 a5 K: K3 l8 h, \% C cmp cl,al
- X0 S( V8 g+ b2 O% Z jnz SoftICE_detected
7 h8 W* ~- ?2 b; [3 W- F
; ]# K4 c5 {9 {' O. o) A$ @6 t1 b_________________________________________________________________________) L4 ?$ o' v+ A4 y; i% u
. S, v, I o- m5 KMethod 07
5 q5 ?/ }8 G4 D K& x! [/ u=========! y# b3 D# a5 y) U& U& p
. |% o8 d8 ?% I$ s. l) |Method of detection of the WinICE handler in the int68h (V86)+ W- h: m! _) [
7 }0 A! ]( S) L+ F% {+ u
mov ah,43h
7 b2 ?9 b2 b* j2 f R int 68h8 @$ @% }3 V2 l# g! \9 K
cmp ax,0F386h
' C: T) N. O! W; ]8 E4 S jz SoftICE_Detected7 e! y( U3 Z% ?4 F' p& n
* Z: K* H0 U, P2 ]+ Q( w# F
9 B0 r- O9 i3 c' J" u q, r=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 c, B5 K! P. G: ` app like this:
2 g. v9 n# E) H+ x2 Z. H- V2 g- w+ L" r; C* W S- x
BPX exec_int if ax==68
1 c! p, G3 ^4 n% k/ q, j- j (function called is located at byte ptr [ebp+1Dh] and client eip is
7 g9 f- N4 O1 y% M1 p located at [ebp+48h] for 32Bit apps)
/ Q0 k1 O6 x5 ?. L__________________________________________________________________________, D2 b- n1 W* z
/ o/ L$ u4 v5 J0 N, L* d' `
- E1 g" S' u# Z* a" c9 ]8 kMethod 08
4 }' O% ~. a9 a5 [=========
* l S$ u- d0 C* I* p+ {+ T: ^, g- J) Y0 `: o: i% R
It is not a method of detection of SoftICE but a possibility to crash the, P; k+ F0 s0 {7 r9 M- i/ F7 J/ p
system by intercepting int 01h and int 03h and redirecting them to another2 x* y+ |' q9 i4 }( n) { F
routine.
/ w2 ]) L( j3 N& ^$ `! Y, T9 AIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 \7 U' T% O- {" A" t. j h: Jto the new routine to execute (hangs computer...)3 f6 \. A& W# X4 h
# b" G+ L' d. k3 C3 a7 j; s; o
mov ah, 25h
4 ^0 S+ a7 e& q6 {( J( w mov al, Int_Number (01h or 03h)
# l+ ^+ b& A b) d% ~( u* a5 s mov dx, offset New_Int_Routine
* E S! ?( R/ D( m0 E int 21h
! `& U. ^. Y& s
; A: M4 F' i& J5 Q: }__________________________________________________________________________
9 _; U. c" }& x K/ O& |; w$ A# N- r2 D2 @$ c* ~
Method 09, w3 O! e8 g& J
=========
l2 } J6 o3 H! s# q+ A
P2 R- H) y2 C. UThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only; l& _) t( H& @* D, N
performed in ring0 (VxD or a ring3 app using the VxdCall).
& }! c0 q Z" RThe Get_DDB service is used to determine whether or not a VxD is installed; @/ E' \7 ?8 c. A
for the specified device and returns a Device Description Block (in ecx) for9 z: q; J U/ ?& Z7 |
that device if it is installed.- I' V$ x, \: U
; S5 f' X% B3 q
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID# i! L+ i8 U. e( r7 W
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 r6 j7 O3 F. l& n" F VMMCall Get_DDB8 r8 X) G: E- G5 J" n/ p6 k
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
' q9 O8 [* u6 n1 W5 L ]0 R1 L9 w. b: `0 b2 u- ^* J2 w
Note as well that you can easily detect this method with SoftICE:
! D8 C# p5 }3 |6 v6 w0 q, Y/ z bpx Get_DDB if ax==0202 || ax==7a5fh' b- b h8 `7 Y+ X7 L
$ l9 E6 k; K& o1 ]% H& a__________________________________________________________________________
1 T* }# a# t N2 r5 b' A; I5 X8 T7 s9 I8 Z3 W
Method 10
' @3 _* Y* n! T3 `0 X) |=========
- s- d# P" {6 g, Q7 F) x% e; A! e0 j8 k4 f
=>Disable or clear breakpoints before using this feature. DO NOT trace with7 Z1 D0 D6 j6 Y& _0 E r
SoftICE while the option is enable!!
- B L6 t. B$ w% {0 X
# ]6 k8 T$ g5 d; x+ ?This trick is very efficient:
( l8 n* l' |: X. L2 f( ?by checking the Debug Registers, you can detect if SoftICE is loaded
" l/ e/ o/ Z, o! P: [(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 T8 F& W" J: g+ Z9 x* u) x
there are some memory breakpoints set (dr0 to dr3) simply by reading their
! N! d5 H" S u5 p' ~9 _$ J: b: ?value (in ring0 only). Values can be manipulated and or changed as well& a S% u7 t; U9 U$ H
(clearing BPMs for instance)
6 Q& ]3 L/ f& C/ |& p$ n; }7 Z
& T# p' s( h+ Z" u; ?$ L0 s" M__________________________________________________________________________0 O# w1 L8 ~( i8 e, O4 x
' l6 `3 Y' m5 O) r' _- {
Method 11: j( G! ]' l6 V# }
=========
- _3 |$ |3 q+ X( D2 l }/ w6 X& E: N, w7 D! z4 Z
This method is most known as 'MeltICE' because it has been freely distributed% ~" v. X/ j P7 S
via www.winfiles.com. However it was first used by NuMega people to allow8 |% E9 p5 p* e, n0 L
Symbol Loader to check if SoftICE was active or not (the code is located
- D9 T/ _0 \- B/ I" k& y4 |inside nmtrans.dll).& E# I' e# c) m; N
( I: @% ], J5 Q7 b
The way it works is very simple:
- s' I/ u* d7 _" mIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; n2 u! ~6 Q$ jWinNT) with the CreateFileA API.
, X& B, [4 }$ i! j( E |
# }8 u9 r+ d* N' A) v0 l9 a$ hHere is a sample (checking for 'SICE'):* B" B- i: ~9 f$ f9 Y% @$ L
2 l+ h- U- d8 O c/ _) ~
BOOL IsSoftIce95Loaded(). q# V7 `# @, ~, ~* s5 g1 ]
{# R+ i0 l+ b( H0 Q; y* f/ Y
HANDLE hFile;
( r4 X% J, b) G; f% `" @# W hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,3 Q9 y5 c* \ t% W! Z# E
FILE_SHARE_READ | FILE_SHARE_WRITE,
A, ~8 A V: r: t: U7 \7 \, `( w9 ] NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: C4 ~+ c1 N4 v/ \" ] B! k, e if( hFile != INVALID_HANDLE_VALUE )' H) ?/ E$ O+ v1 O$ ]
{# [3 c' Y5 h" _8 E: h
CloseHandle(hFile);
0 }) U% W5 ^4 @" T) F# d return TRUE;
9 x# i9 B) }: s; q/ p; }2 ^ }
* E8 _5 E2 o7 ^1 o return FALSE;
8 j& [" X8 `: C/ ~) B0 S}5 l1 H& j1 G5 I# u0 L- C( p8 h
) x$ q3 D2 i; U2 q
Although this trick calls the CreateFileA function, don't even expect to be* {3 P. A3 E7 a+ ]+ |0 E
able to intercept it by installing a IFS hook: it will not work, no way!
7 E, N. U: \5 ]; p; AIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
; }+ c1 I& Z0 s- M+ M0 B) e% zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
/ z5 l: h' w8 ?: Q8 y) ]( t/ }and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 f- [0 u) ] M7 a% gfield.
; S/ V4 ~1 b* X2 s* qIn fact, its purpose is not to load/unload VxDs but only to send a
0 F8 {) i3 v7 ]# FW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ e/ H/ V. z" X% T9 Bto the VxD Control_Dispatch proc (how the hell a shareware soft could try X% t+ [. g$ K D
to load/unload a non-dynamically loadable driver such as SoftICE ;-).. \( o; ^" F$ t, z, a
If the VxD is loaded, it will always clear eax and the Carry flag to allow1 v. Y) Y, h" J. ?) r5 W
its handle to be opened and then, will be detected.1 }" ` X: X- l8 ~9 ^& s
You can check that simply by hooking Winice.exe control proc entry point4 |6 @* _$ y/ f$ C' c1 |0 \
while running MeltICE.
9 P7 h; x3 Y- L% {9 u
% H& o) S, y! q( ]! D' ^+ O
( u G, U( h3 B( i% @ ^- y. F 00401067: push 00402025 ; \\.\SICE
) e9 M8 {( {; A# n" X 0040106C: call CreateFileA7 \6 }4 V1 Q$ N D( g
00401071: cmp eax,-001: [- {, ~: Y" t; P0 p) G; Y
00401074: je 00401091
* G: r& O" l" h ]: |; p |% c. C" r
( [6 s" B9 |) Z8 H
There could be hundreds of BPX you could use to detect this trick.( u$ a1 q7 z0 n% D! m8 h) x5 w2 I
-The most classical one is: K0 `, Y- u9 N6 z& h# z
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
6 z1 }3 @8 i+ R5 ]7 K' } *(esp->4+4)=='NTIC'3 S+ F0 O/ J. n6 M
5 e9 e$ }: V# z2 J- U
-The most exotic ones (could be very slooooow :-(
: {* |& }5 q$ d, d2 }& Q8 ^ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') , y' w \$ A" b
;will break 3 times :-(: y+ Y9 _! s3 u
7 S+ _+ Z F) ~6 n; ~
-or (a bit) faster:
, M- j! |0 i" x4 K" y BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* w) u$ c6 ]. I) j7 V# d R8 {4 q
+ J6 u/ E) k, t1 u# P BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
/ q' f) ~! Q4 ~$ I ;will break 3 times :-(
4 z. C' ]" U+ b; ~! R# p: o+ K( K! V! n* P8 N6 A2 a6 v) I
-Much faster:
/ K8 K% X) }6 S1 h. ~ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' B" f. k1 w1 b3 h J
! J* B* [# c. T3 J6 w& u( CNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
; ?$ \ k' K! Q% y( i6 sfunction to do the same job:
$ A1 F: l8 Q, Y0 A+ m) C
: J, r) m8 ^# @) ], y push 00 ; OF_READ
$ {( n8 g1 ^, X5 e7 K2 O! v! S# c mov eax,[00656634] ; '\\.\SICE',04 L) j4 p1 u2 m8 N
push eax
/ q8 x! p7 x# g1 H- ] call KERNEL32!_lopen/ o3 ]$ V6 c/ ?2 }
inc eax: G, P$ u: m6 X2 }3 S9 b' T$ k
jnz 00650589 ; detected2 O0 z5 U0 P2 ?7 F, [- V+ a
push 00 ; OF_READ
/ F8 O0 h C" b( z8 m9 D+ w mov eax,[00656638] ; '\\.\SICE'
& Q0 x7 f5 Z1 q7 m8 p! U$ _# w- `+ r push eax
, ~2 L, ^7 @ |7 W( b call KERNEL32!_lopen
; ]8 t4 v. D; B7 f inc eax
$ } x7 Y; z( x* H jz 006505ae ; not detected
2 R; D8 _* j$ @9 g6 ?
# t$ W1 x6 A8 D4 ~1 a3 ?2 @7 w
, W) K/ M$ T5 @& G9 x4 F; s- w__________________________________________________________________________) ?5 e' p7 y. _; H
+ `, O- y% ~; W" U3 G- E
Method 12
7 `) h; s7 {# A& I1 t& z" @; U=========
! q3 f' D( j8 o6 C6 ]; h" X) |$ N' l8 ^) S6 {( Z( F% R1 J
This trick is similar to int41h/4fh Debugger installation check (code 05
+ k0 Z1 W6 n0 P3 G& 06) but very limited because it's only available for Win95/98 (not NT)
! I( s( b0 g% }4 u8 d6 Ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.
( ]5 \0 }- N$ W* l& X2 }# x
8 O" |& q+ |8 Z' B( n7 w push 0000004fh ; function 4fh0 j0 L7 |- V. ~! X
push 002a002ah ; high word specifies which VxD (VWIN32)$ d* ~$ \4 b2 U. i! a
; low word specifies which service
k! }; V0 A7 S y0 } (VWIN32_Int41Dispatch)
8 U6 ^4 o9 l$ s9 ]" L* m$ N5 P call Kernel32!ORD_001 ; VxdCall; D! c: G4 ^4 W& J9 c
cmp ax, 0f386h ; magic number returned by system debuggers
" g1 C; ]$ b6 h" C0 O jz SoftICE_detected
( K' W* t% h1 z+ w' G- O0 W
e$ Y9 a0 @( i A: xHere again, several ways to detect it:
5 F; F' E8 P' G. }6 T( g5 H
; Y) o1 @' C) \ BPINT 41 if ax==4f
( Y9 N; r5 r6 N
& |' l! E+ u5 S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
0 A! N! @. v5 I6 i, u/ E5 A" p. y; |% Q0 z
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
9 l Q. t; x6 e% }4 o, q! d# Y# a2 E; H
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 F$ G. w2 d+ u+ e6 w
7 {( N0 G) A' @1 H) s__________________________________________________________________________
: R( E7 \; N, P8 q4 U7 H+ ]# \7 Y& V6 _
Method 13
# V* B* j" \ E1 ]" q- T% r) m4 ^, A1 F=========) f6 f6 j4 P& m ?
- I: V# Q! @8 j
Not a real method of detection, but a good way to know if SoftICE is
; V3 f; ~& y4 @0 J. p8 Y1 binstalled on a computer and to locate its installation directory.6 o. Q+ F% x, m9 }5 r
It is used by few softs which access the following registry keys (usually #2) :
4 K. j6 W l1 ?; |
% f W) t1 f& [! \; q* t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 d6 v+ b& H; `" h: B3 L
\Uninstall\SoftICE; [. [* E% g2 a1 M: a. P* G
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- M2 ~, r' `; M" y/ h
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# y# v3 Q3 m* g" W6 k# f\App Paths\Loader32.Exe1 \- i/ w1 w" ]; a. q' ^4 Y, l( q
$ A- O `0 w3 T4 g$ i9 u: \+ Q6 d6 N( ?7 v+ V
Note that some nasty apps could then erase all files from SoftICE directory' `( z g- J' k3 T6 K% j2 F
(I faced that once :-(* ^, ~& k x1 p5 ?( W* y, Z
& g- |' f" F$ w) R5 F9 T* U6 [3 J2 d
Useful breakpoint to detect it:
+ u; ?$ c5 }1 d/ V7 N- l3 I [) `# D+ _9 s! }7 D2 J
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
) u6 m5 i) K. R* ^5 Z# B5 R9 k( O+ _" q- D3 D
__________________________________________________________________________
5 X6 X! F8 X3 j, ]% ~5 X( x1 o$ {, t9 i& m9 F
6 M9 _ Z% S" g* p* S3 v
Method 14
) | r, o. r9 `% {=========
" Y! E) S& [% O. O- i) f4 A/ ~
' x; d+ d: I4 l/ ]7 I vA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) [/ ~" n$ A' m4 j
is to determines whether a debugger is running on your system (ring0 only).( N1 U2 P, P+ R5 _0 i+ A. \
1 K- ?9 Z$ }6 X0 w
VMMCall Test_Debug_Installed3 Y3 e# J5 K2 x4 D2 o2 e9 V6 e1 f
je not_installed& A! E! Z3 u$ _/ ~
K6 P1 X5 |$ {/ q2 q! Z8 d1 xThis service just checks a flag.7 o: U: ]7 j& X9 h1 l7 ]
</PRE></TD></TR></TBODY></TABLE> |