<TABLE width=500>
# q. K% Z6 T6 b( i6 A7 K. \9 {: F: ~<TBODY>: W1 m. M9 _! |" u; z" Y# ]
<TR>/ A x; d4 j" `6 ]! \! K [7 p4 A
<TD><PRE>Method 01
$ s: g2 a* G6 x4 ]: N/ A1 Z: O=========
7 k7 s, w9 V' ]$ k7 |1 j
& @9 Z# c: T' ~& |- CThis method of detection of SoftICE (as well as the following one) is
& q' u/ F7 T9 x8 { dused by the majority of packers/encryptors found on Internet.
. g6 C7 k( C3 o% p2 j- d" |& LIt seeks the signature of BoundsChecker in SoftICE. a4 P- M$ d4 P6 |
& f" j2 z5 S% l0 w% G0 t
mov ebp, 04243484Bh ; 'BCHK'
( M7 t# }5 Z( C6 x! M6 V! x( l* u mov ax, 04h% p( o& o0 j+ }
int 3
, l; T- w; _) l9 [ cmp al,42 T9 x! a4 Z) r* G6 G+ C
jnz SoftICE_Detected
8 q* t2 e) J, D" b9 m u8 G: X
) L! V0 Q6 l& }% @% U: q6 `1 J___________________________________________________________________________
+ Q& I5 o7 `, `& B' ]: d3 C+ w. p0 o' H; a
Method 02& J b: d' ]& e" `
=========3 i9 A/ B% C) j% I$ U
& M0 ]' k: q2 [) ~7 ^' EStill a method very much used (perhaps the most frequent one). It is used
' z" r6 ^; z1 p5 yto get SoftICE 'Back Door commands' which gives infos on Breakpoints,) m& B! F* ]- t2 _: G T
or execute SoftICE commands...
K" \+ Z( u! `0 R0 LIt is also used to crash SoftICE and to force it to execute any commands
! G7 t/ c7 a* @# w4 V0 P5 c(HBOOT...) :-(( ( G+ J$ ]2 n( B3 E8 n, ~
6 e) X( Z: ^- ]% q8 x7 s
Here is a quick description:
7 e" C% m. u1 d6 y) g1 t, t-AX = 0910h (Display string in SIce windows)& a3 J& s" U" H# \$ P. m0 P
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
! J: d% p8 j8 u) a6 w-AX = 0912h (Get breakpoint infos)2 H: A+ s' U- n* G, M3 i
-AX = 0913h (Set Sice breakpoints)
; [* P( {* {0 |6 ~+ S$ V4 z* l-AX = 0914h (Remove SIce breakoints)
1 x, [! E; W8 o. Z0 @/ `: S4 r. i# @
Each time you'll meet this trick, you'll see:
1 E2 M! e! M7 w% P; o# o% E-SI = 4647h
8 u) z# X4 V ^: j+ g-DI = 4A4Dh( ]5 D& r% F3 N: P3 _1 T
Which are the 'magic values' used by SoftIce.
$ l) n- n K$ K0 @9 FFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( x w# v5 S$ O; t8 Z4 z$ _& P" p+ J: G- m; D3 C
Here is one example from the file "Haspinst.exe" which is the dongle HASP
1 V/ w1 A" j0 A5 @9 o AEnvelope utility use to protect DOS applications:
, R X3 p( n7 K6 K8 l. c, J
9 `- s6 {) x+ J! Q. W% n: \5 @ t5 _3 S2 L, n2 Q
4C19:0095 MOV AX,0911 ; execute command./ h% g- k" d' L
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." S5 N1 k# Z0 Q; d9 c5 R% D
4C19:009A MOV SI,4647 ; 1st magic value.
) x$ `% |( _: B, i7 Q9 |4C19:009D MOV DI,4A4D ; 2nd magic value.
# w, `' ^: N9 J8 P4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)7 L$ o! L ]) N0 Q! G
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute# E: S4 E% E2 U1 @* x2 Y7 A0 d
4C19:00A4 INC CX* W/ L% _. n5 Y" \- ]0 ^
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute3 d; A% {" y2 U* |3 ?5 _) S" Q
4C19:00A8 JB 0095 ; 6 different commands.) K+ `! U% M. A* A) b5 J+ s1 U$ N/ U
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, }/ k2 r7 I' R7 J0 e8 s6 i4 y4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& q& v6 |; `% g. ~# Y1 b5 ~* g# p# `; S: n8 P5 G/ E
The program will execute 6 different SIce commands located at ds:dx, which+ P4 n6 G+ }) a# C1 d% Q1 D8 u
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 h* m0 t7 q6 o3 f; m! W
6 C, V9 c/ F+ r3 \8 B3 Y! T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ D: {1 h. T6 q# s' O% W2 y( d___________________________________________________________________________
* s/ E% n& \8 b( V, U! Q: a6 O( E' d
. ]+ w/ b( l) [4 c+ V. F8 C$ p
Method 03( g$ k- Y/ _. h. h
=========
, s" z; d8 N8 l: y1 z5 g
$ O# P: A& i* a! A1 qLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h# a4 w5 Q2 g0 q
(API Get entry point)7 D N) [& B8 @* D1 T& G
/ _# \, w; Q" x) i& b* i( ]
4 x6 l, D K3 n( ~! B1 ]) W; ~
xor di,di) l. E( w- T6 c" X/ `: @" x% `
mov es,di6 Z! a6 V" A# e+ }+ H
mov ax, 1684h
7 |( B2 K& t* Q mov bx, 0202h ; VxD ID of winice" T, l+ \0 N P8 F( E. X
int 2Fh! Z6 \2 x q* J& N, o" \; R _
mov ax, es ; ES:DI -> VxD API entry point
! g ^" G& L! Y7 n add ax, di
6 d$ F! m. `: H& n9 u test ax,ax
) n# ?& G4 D' U! c; J5 T/ g jnz SoftICE_Detected
& ?& X0 x# `1 s" d7 m9 @' A' Y. x3 ^, A- ?( e( u
___________________________________________________________________________
4 b, U: J6 _+ Q' }- w. k* o
7 ]# J6 v8 F A8 cMethod 04
& K! \' H) o6 {$ ]4 o=========6 W9 |) {+ ?; m9 G5 K5 k
/ e; d/ C! {4 J% f, c
Method identical to the preceding one except that it seeks the ID of SoftICE' m# l N0 G; L5 K3 f x
GFX VxD.
e, U5 e9 ~7 L! b; ]6 O+ D, m
b ~& O# _4 H! D }+ J xor di,di! b# ^ _# G1 U/ L2 d! u
mov es,di' B: _9 D( l/ t( \3 H G
mov ax, 1684h
, S2 p+ S) \+ `1 m* Q mov bx, 7a5Fh ; VxD ID of SIWVID9 ^$ R0 H9 T. H. I+ j
int 2fh8 i. T+ l/ i5 d" M$ j
mov ax, es ; ES:DI -> VxD API entry point; x2 @$ e3 T; M# e4 v. j: F
add ax, di
7 P- M0 A- n9 E4 E' n test ax,ax
. _8 S- ^$ ~+ | O+ f8 s" s jnz SoftICE_Detected! u$ A* a5 H$ w) n
3 _6 R/ K' F7 Y: T' _5 F0 G
__________________________________________________________________________+ B, X6 }1 C) \) M, H0 K; C
2 V! r7 t# _( N; u" P
' V" M+ t/ Z6 w; _" ], b$ T3 ]
Method 05% E# c/ e# K& o5 w) t
=========5 y0 `$ P7 P) s* k# q/ C
6 z, q* v3 _/ E* O, D% h6 d
Method seeking the 'magic number' 0F386h returned (in ax) by all system- L& `6 p& \% p& |% F
debugger. It calls the int 41h, function 4Fh.
2 S6 V/ V5 d! u! i7 [, H5 LThere are several alternatives. # Z# V6 \; I) B3 ]0 H
5 `3 u! \) B1 o, g
The following one is the simplest:. K5 `6 W# b& i3 }9 y& q" w9 K
" S6 K4 w9 [, u3 O& v6 H9 K0 V
mov ax,4fh
7 a7 i. m( F* s4 w* t$ m int 41h! H/ L& w5 q8 `
cmp ax, 0F386
9 |' ]9 ?$ Y/ @8 E3 h5 H jz SoftICE_detected
' q; o6 f' P8 I* D! I2 \2 R
: F2 Y/ h) a% z" p1 b8 |4 [8 Q2 U/ E1 V- w7 n8 @
Next method as well as the following one are 2 examples from Stone's 6 b, q) Z" c b. \* [
"stn-wid.zip" (www.cracking.net):
8 o7 h3 Q$ B2 W. [6 ^* f: r6 A( J2 H/ L# T3 [
mov bx, cs
( [! q8 w( X1 }. Y lea dx, int41handler2
- X5 y0 r: R$ P2 F% }4 X xchg dx, es:[41h*4]
/ h& u* W2 A s! j+ q xchg bx, es:[41h*4+2]) C+ x" l/ W. y! i6 L
mov ax,4fh5 i" u2 ~( w# |. B) G' L
int 41h& n; G- f5 o! h- p) X: P* W; {
xchg dx, es:[41h*4]
2 X. p% {- D8 U6 B xchg bx, es:[41h*4+2]$ Y& [* Q A/ W/ C6 a$ j
cmp ax, 0f386h
; U7 r: G/ u8 j. F/ K" O" f5 d) G2 B jz SoftICE_detected
& C5 c0 J2 |3 X6 n$ r3 C) _% a9 s: G9 k$ |# c5 B
int41handler2 PROC
, o8 f# _7 k9 C4 ]" x9 c) C8 g iret
6 k, L3 h* a' b5 S5 p; z# K3 lint41handler2 ENDP/ J/ c. D: L) O* F) s
+ N' K2 E, J3 ]: n' u
3 e( a1 s9 D6 B6 u% R0 O q_________________________________________________________________________
4 K7 E. F% ?& R0 o$ c4 L
# p& M- T; `; y, k9 m; l+ L( J& j6 M, k, Q, q( t% v% m* n* J
Method 06: c6 z) T( Q5 z1 h& [; K' o' d1 K
=========: O3 T- m( K: v7 y
2 l# ~4 x5 c7 v5 h# _
; z3 A# c! L2 R; Z, r1 E1 _2nd method similar to the preceding one but more difficult to detect:( Z3 l1 e, c1 r4 r B: N
! F( V1 C- | B- x0 Z' y
+ G6 K! v+ M4 {+ eint41handler PROC
# K5 J: N2 r1 [$ L mov cl,al
) n G: z t+ B( w! B iret2 _( `9 Q W' @6 J
int41handler ENDP
! W: t/ e( x- ?( Q3 |
' C- _$ Z5 J' K$ H2 o6 Q$ m1 P% h5 |: G7 R# X, }, [% i
xor ax,ax
7 X3 q7 W m: {2 t8 I3 V mov es,ax7 N s& o2 o9 Z! e
mov bx, cs2 B s5 z6 R) d' o0 ~" b& Z* f
lea dx, int41handler( J& g A% R- _' {# Y7 [/ V/ Z3 N/ R
xchg dx, es:[41h*4]
. \1 U) e/ X9 i xchg bx, es:[41h*4+2]
3 x- K7 j* U0 g* } in al, 40h x1 \' a6 a% _! t
xor cx,cx0 G) x/ a, C9 l* A& V3 v
int 41h" U+ m5 c; @/ U. X9 K' P
xchg dx, es:[41h*4]4 V1 d$ ^2 ] B! N! X$ Y: O( a* N
xchg bx, es:[41h*4+2]9 U) \2 R8 v$ H$ R
cmp cl,al
: P7 k1 }. P' b. r; ~, U, s jnz SoftICE_detected/ o" r4 e7 F A1 p
, G+ g4 o- @# q2 Q3 i1 F$ V
_________________________________________________________________________+ H3 n, G, @2 v' h2 o9 V) X: z- T
+ z u# [5 | J1 J: D) P5 q2 @
Method 076 m# h* L+ {! S& }# Z# T9 |8 o
=========
$ _2 B8 i4 P2 s' G/ z- w3 Y. E1 A0 j5 H* h. { t# d% }
Method of detection of the WinICE handler in the int68h (V86)
4 W4 j( ` v/ U
+ e7 D( L; h, M$ ^. s/ y mov ah,43h
: ]. N! ]) `. m int 68h% `1 z% d6 U* w2 Y
cmp ax,0F386h
& e0 m. d) Q) O' x# J9 a( G3 G jz SoftICE_Detected$ j& B6 j2 E( t3 `- G
2 ?: }" k: S2 R
* ` g+ M' F7 o3 { u/ s7 Q=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit0 G* [# |- k/ m& f3 i5 Z
app like this:( a# c* s/ J q' e. d
# \# g% u, M7 I BPX exec_int if ax==68, x, Q: B7 N& M7 Y/ S! `8 f, q8 E
(function called is located at byte ptr [ebp+1Dh] and client eip is
$ {+ [% R j4 Q7 k located at [ebp+48h] for 32Bit apps)+ U% ?1 F& _ }6 {
__________________________________________________________________________
& N& A! i2 K0 U( R+ _: c: h" A: k. M' m
9 F1 o# \2 g$ c4 e
Method 083 q# r: M6 y* x& r: l
=========
" ?' Q! f( F: G3 {$ p$ _2 B& m
' j6 e' }: `6 E/ Z% uIt is not a method of detection of SoftICE but a possibility to crash the6 b3 B: M. @+ P' B( U3 d- k5 d
system by intercepting int 01h and int 03h and redirecting them to another
! r' Z. _" {! u: k" }4 Oroutine.3 [" O5 S/ P. H* ?' |
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* u' L; R5 V# D
to the new routine to execute (hangs computer...)
/ L; @ q8 m$ L% \7 s" A7 m6 m1 X% ]9 w6 }3 q
mov ah, 25h2 D# |* R- t4 B! X7 B, q# V. F
mov al, Int_Number (01h or 03h)) Z: I& y4 r7 [& q
mov dx, offset New_Int_Routine
* y/ u4 e/ [$ p5 m int 21h: Q+ [) Y+ q i+ j i Y8 t1 ^5 @
; a0 F; {! {% _' e6 i__________________________________________________________________________
* a- s% e) |+ h1 X" K A- L* C* c) {) t) z" p" C! K+ V& q
Method 09
' Q2 S# J- q9 F# l9 n=========+ p, v( |. L: ^7 E% A' L- i
9 L) N* ^& Y3 D- d5 m4 @9 \0 H
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ ^2 \2 D6 ~" q6 ?6 X
performed in ring0 (VxD or a ring3 app using the VxdCall).* x( s" q! b% k
The Get_DDB service is used to determine whether or not a VxD is installed/ z/ [ z; f6 L6 ]# Y& B
for the specified device and returns a Device Description Block (in ecx) for
& `0 M" O6 Z# d8 P/ ]4 b6 S. `( Fthat device if it is installed.
6 f2 {+ S4 }3 S" ?, d; b3 z% D6 }) ~9 e; M1 W
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- ~' k# T3 o/ ?8 F- y, ^ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 f6 J' p/ w9 c/ [8 e VMMCall Get_DDB
: O' ^+ o T0 E( r; Z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed/ M: _* r. N+ b7 U
1 E D3 h+ x( \7 H0 n/ P' ~
Note as well that you can easily detect this method with SoftICE:+ ?! g6 ?9 g7 j& n
bpx Get_DDB if ax==0202 || ax==7a5fh: y6 q7 Y9 ]9 n/ @, `
% F# _+ Z# H9 R0 L: \$ z, H/ K
__________________________________________________________________________' a+ u6 M1 I7 I; x! w
0 T( ^' @# y% p) h0 HMethod 10
* o l1 {, e* k8 N- O8 C- Y U( V" V========= e+ j! S4 l6 `5 f
- T. n$ n9 f8 `# A1 E/ w/ V- j2 J
=>Disable or clear breakpoints before using this feature. DO NOT trace with
% W+ C& \8 f* ?% J+ M' q SoftICE while the option is enable!!" Q% g# ` V _: H5 _8 d; R
* N' S B9 n+ B& s8 Q6 t7 O9 g/ x& y4 f
This trick is very efficient:8 `* H6 _4 }3 C8 Y
by checking the Debug Registers, you can detect if SoftICE is loaded
3 C3 r2 e) B7 x0 W# e( J6 M. L j(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* \1 R4 Y3 o- c, e* y8 Vthere are some memory breakpoints set (dr0 to dr3) simply by reading their
- T; N) W; v' U0 p4 jvalue (in ring0 only). Values can be manipulated and or changed as well
7 \4 U3 `: F& U& J. B(clearing BPMs for instance)
4 V3 n+ s# S/ Q: u( ~0 o
/ U' Z# [* q E7 Z5 d1 k3 W__________________________________________________________________________
% y' W3 ~4 P( D7 \& o! r" N6 ^5 j6 f2 @
Method 11
7 E+ Q* H2 S$ L& `! ~=========
5 M7 E( y" x, l4 g7 P$ V5 g2 V. P9 v! o
This method is most known as 'MeltICE' because it has been freely distributed
5 m; c$ B! N4 E& F1 K# G% Nvia www.winfiles.com. However it was first used by NuMega people to allow
& ?7 v) [" W) Q: }( S/ {Symbol Loader to check if SoftICE was active or not (the code is located# V7 ` R1 R4 H- Z: ^$ u8 D: a
inside nmtrans.dll).4 i' O: [3 Y2 r! w& d. O+ }! p* @
6 D% X6 |+ g$ \
The way it works is very simple:3 ]. D4 o- a! ^/ b C
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 M+ ?" R0 {) v7 M- _! t
WinNT) with the CreateFileA API.' t( g( E" Z6 L
: l5 }5 c) r8 g& u: I, _
Here is a sample (checking for 'SICE'):5 G# i# {& D; }) K: D+ x
) M$ |& g* m# O0 w, ?8 C; o
BOOL IsSoftIce95Loaded()
! Y* f: q" _* V8 f- w{
2 M) K- s! a; F1 H# H) p+ P HANDLE hFile; 8 o3 g# f( z! N7 }7 H9 V2 u3 @
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! q6 K: t! l, d& ~ FILE_SHARE_READ | FILE_SHARE_WRITE,
# H$ ]/ q( }8 F, F0 g* n. v NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- c% c( \: N! `+ e; A3 J
if( hFile != INVALID_HANDLE_VALUE )
" M$ `4 E- D" w3 _# d; Q7 c" C {
, P9 k: G, r. F7 B0 l CloseHandle(hFile);
- t8 }, V( h0 i return TRUE;
8 B b' A- q9 I% r }3 G1 l; r4 g _: P3 Q# p: }
return FALSE;
, G& M% n/ a# V}
' }) b- a+ Y3 ^$ M0 {. U0 ?$ W. m
8 n* l b e2 F& PAlthough this trick calls the CreateFileA function, don't even expect to be
* B2 ?9 j1 S) q% c& `able to intercept it by installing a IFS hook: it will not work, no way!
# I* a \ r% s% i k4 O7 r8 HIn fact, after the call to CreateFileA it will get through VWIN32 0x001F, C0 R% \: U* ^- r4 n2 l+ [- N
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function): a2 ~2 I5 G- } q. F
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% P4 j$ m* ?' K0 M4 h+ T; A {field.
4 y& j7 N6 m* A4 @# P* n" }; j2 pIn fact, its purpose is not to load/unload VxDs but only to send a
# [; `% ^2 H& t) ]4 RW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
! t( {, W- D3 ]3 ^# T) s" i' ]to the VxD Control_Dispatch proc (how the hell a shareware soft could try) `# S2 E6 u, }1 I( B' p2 I
to load/unload a non-dynamically loadable driver such as SoftICE ;-).& u9 w+ A; {: m
If the VxD is loaded, it will always clear eax and the Carry flag to allow
( |5 ]" z% W6 B1 [9 _its handle to be opened and then, will be detected. y& \1 g, B6 M, D* v% I6 J9 L
You can check that simply by hooking Winice.exe control proc entry point
2 a+ B1 ^- Y6 I+ D, K8 X, S2 B1 x: vwhile running MeltICE.8 B! U* ?+ N0 C* d/ R9 l+ q
) j9 p M/ F% @# X- _6 S
2 e5 H8 ^- w$ A" `) V 00401067: push 00402025 ; \\.\SICE
$ [, d5 y3 U" K. ? 0040106C: call CreateFileA# M/ _2 G* p* N$ F- ?
00401071: cmp eax,-001
* d% K9 j. Q$ e. F6 `7 X/ a& d' c 00401074: je 00401091
7 o) m3 ]: c$ x1 R9 O! k2 P3 d3 h7 b. n3 s+ e! u$ N% g
& a/ ~8 Z0 |7 {/ lThere could be hundreds of BPX you could use to detect this trick.6 H" T" K0 c& I
-The most classical one is:- H* g6 T" I6 m" G7 z8 t8 l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
. p9 f- x8 t1 Z- F( y *(esp->4+4)=='NTIC'
' _& w1 x: \; q4 \
; F2 w) s* R: o0 _3 m) K+ j-The most exotic ones (could be very slooooow :-(2 D$ K9 A4 G: z7 z( k- X% ~6 L
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( D* S5 U! G0 P; a" g ;will break 3 times :-(2 ]' h8 ~( E. c, e( G Q
/ u2 ^( u/ G2 ~ X" n& E-or (a bit) faster: - r) O% i- J5 Q( k: |
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' j/ S# _: j9 O0 T) h
. ~; J' M2 S+ z9 K BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' i& X0 |! Z, ]) l. K/ n+ \
;will break 3 times :-(4 ~' V8 n4 x( U2 p
/ n3 N: t3 W1 k& ?9 i% k-Much faster:2 M) o6 |7 ?3 X4 s1 C, R
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
1 R& r- A! n1 }. G4 U8 i7 L# z$ ~" U+ N' G$ L1 M
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen7 h, H, E: A. a; I3 R4 Z
function to do the same job:$ K. I8 S" ]+ f7 ?8 z+ {, J7 M/ `2 G% O9 O
4 L# }2 O1 H: ~3 k3 _ push 00 ; OF_READ i& l# U" Z1 K/ M
mov eax,[00656634] ; '\\.\SICE',0
; R: M1 H# }+ X3 m push eax
# p2 |8 D6 e/ g/ V call KERNEL32!_lopen1 ~2 w) w R1 e$ }- J% Q
inc eax
2 @% G) f2 d: a7 e jnz 00650589 ; detected% ]- T( `8 C! @1 [9 S
push 00 ; OF_READ
( N# o* a) [0 k mov eax,[00656638] ; '\\.\SICE'$ r4 `" H8 n: g+ k2 G l. r& T, r8 J
push eax
Q7 ^0 H) U1 k. [ call KERNEL32!_lopen* t& h% `1 E% r. u& a5 i, v
inc eax
6 N) |3 J3 z+ q" v% p jz 006505ae ; not detected7 h% C) Q2 O. X7 O; K! D @/ _
2 {5 X$ B! A1 c3 D' j- x+ T; T3 E
' u+ E3 d$ w- o& A' n/ A6 u
__________________________________________________________________________
/ N$ T7 l* q+ w$ v( s) {
7 X# Y- v2 `0 p1 UMethod 125 e4 D" g |* k2 h( r
=========0 f$ D& c s, C8 R
% l j$ V: }4 W% m5 J- i. K3 x
This trick is similar to int41h/4fh Debugger installation check (code 05
& e7 n& y: c; d3 M# W! k1 c& 06) but very limited because it's only available for Win95/98 (not NT)3 W1 l) y$ M L' G3 P
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 s, ?; w! e& A0 d+ s' r
" k1 }5 B+ i$ u, b# D/ R+ V: k; v push 0000004fh ; function 4fh1 ]2 m: {4 J; q" I1 b
push 002a002ah ; high word specifies which VxD (VWIN32)# x- V4 H; l/ M6 j- f
; low word specifies which service
P8 Y2 r& I T" m, T (VWIN32_Int41Dispatch)
K6 x& t! A: g* w5 C$ L call Kernel32!ORD_001 ; VxdCall
% m; ^& M- t( T1 s( B8 ]1 I4 n2 N cmp ax, 0f386h ; magic number returned by system debuggers
, R0 u3 y+ J/ E jz SoftICE_detected
, q" x: l' o" f6 Q3 \0 e, c7 X
; r' \7 }* g/ D/ y% U# |# ^. IHere again, several ways to detect it:* Q3 h, \7 k6 d+ k
D5 L% ~8 j9 X: c" \* s6 O! i BPINT 41 if ax==4f
1 }& h; Y7 J |3 W3 ^" Z
& y& C0 U) A5 G5 j% M1 n BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one% O$ H0 W9 b7 e& y2 h0 z
* g* D* Z% J5 g% @
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# h0 p# j! V, b8 j# a
7 N- x+ @# z+ b8 P. L" R& }8 W BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
' c( v2 P) U1 H6 M5 ]* z$ I; r% O( Y$ ?
__________________________________________________________________________" E/ T# J: r: z' |# A! \
% k# Y5 f7 m# ]( iMethod 13
- ~& i8 c1 d' V; w+ N1 ?=========+ |& q+ t- Q! h% d+ X( ]/ M! J
3 e( k% G7 s6 u3 s5 I. b( z! P) t* m9 Z
Not a real method of detection, but a good way to know if SoftICE is
N; V3 `1 h7 Tinstalled on a computer and to locate its installation directory.: e- ]) q6 L2 Y. L4 j
It is used by few softs which access the following registry keys (usually #2) :
8 g$ X/ p$ o0 C2 q- P& j% n
. _/ L& r4 X |, x-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# m# i w ?" T4 M0 Z
\Uninstall\SoftICE1 S5 @& ~5 L" B
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE6 X' e O8 T% B* u
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ p0 w2 `: x/ v3 m# @7 ~/ p\App Paths\Loader32.Exe
+ _: Z! Y0 l; A3 f. J9 f! M. V
2 o" P. [) a0 O
( c* o( Y0 \1 e) Q9 m, R- `Note that some nasty apps could then erase all files from SoftICE directory
7 Y9 E5 O# G# b, A(I faced that once :-(" s+ A0 m W3 @; b% J
2 q/ k; f* ~# c& N7 dUseful breakpoint to detect it:
+ |- W& p3 A$ k( i0 {- L& C" u( U3 f6 {0 ? d$ l. @- c) X, i
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 r9 ^$ H& K6 G& i& T8 F! Z' Z
& @' }' z4 w1 k6 {__________________________________________________________________________
% u% Z' K8 k2 e" R/ W7 m2 R' g! }- @/ H1 n. C5 @
. l% x; I! Y2 [$ F7 HMethod 14
# L1 i% ?1 @5 ?# G2 {; |; o3 P2 g- U=========& z8 q( Z# g3 I) Z+ T3 O. p% j7 y
$ R. ]6 [ `, A2 T+ Z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; }6 l. i b K, P
is to determines whether a debugger is running on your system (ring0 only).
4 U {1 X3 n# m; r T, {, J! T( n+ _
VMMCall Test_Debug_Installed
" W$ O8 C0 W, {( D% e je not_installed6 I2 a6 c5 O" a& u5 m0 B; ^( x8 p$ f; H
# w. o& D2 G ^9 \7 b4 r; W
This service just checks a flag.
3 A' Q5 x3 }+ p6 O0 H0 F/ r, g</PRE></TD></TR></TBODY></TABLE> |