<TABLE width=500>
# g' H3 ?# X: R1 |+ \<TBODY>: j/ o" o* p% b: m/ g5 X4 X, v
<TR>
3 j$ C! M! s* L0 u$ N0 O<TD><PRE>Method 01 $ v" _8 ^. k6 a! z- `: ~( I
=========
& G( w0 {8 \5 _- [! T4 I/ \' d
, T F4 G/ U6 y, e7 @# {/ u: `This method of detection of SoftICE (as well as the following one) is8 a; V6 M' A8 Y) @$ @
used by the majority of packers/encryptors found on Internet.
% d# {; g6 `0 m0 b5 jIt seeks the signature of BoundsChecker in SoftICE
8 n4 |( e$ j4 L4 c1 D9 B0 U, j- @
5 W6 g8 K$ v5 L- f4 k# I' E% ` mov ebp, 04243484Bh ; 'BCHK'9 ~+ D5 \- E6 B0 Y {* e
mov ax, 04h
. F# V$ D4 o- ]. N int 3
' o$ W7 a! ?% {% X% Z2 w5 C cmp al,4; T6 a9 Q0 Y& [' R* s7 ~
jnz SoftICE_Detected
; J* P+ S ^ O- x3 {# v* h5 A% ?. T4 v6 |
___________________________________________________________________________
9 Q, I* J, o# T8 q7 L% b2 B% A: P8 p& ?9 [/ `" w5 f
Method 02' W' R0 Y i. S0 l
=========0 m% J4 }+ x2 C9 }: N- l" E- K
1 B$ _6 U4 X. d* f" C' V/ W8 m7 R. v
Still a method very much used (perhaps the most frequent one). It is used o% d F, e/ _7 [. b8 Z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
]; m- b- F" v. p/ @, ^or execute SoftICE commands... h# E9 H/ D: q# z# O5 k/ Y7 \
It is also used to crash SoftICE and to force it to execute any commands
j$ q0 u. N1 \$ E! B# |(HBOOT...) :-(( - K/ g7 z7 Z+ b# |% f
* W' _4 `4 S' q: F1 ]# X) L% C% `
Here is a quick description:7 M3 o1 P7 H6 O; Q$ \) i" n. |
-AX = 0910h (Display string in SIce windows) i6 s& v2 s. L/ Y6 T; b- B, b/ c; ]
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' g: ?5 @$ [- s" C- p0 C: _
-AX = 0912h (Get breakpoint infos)
0 x9 J8 D) ~% R! {) j-AX = 0913h (Set Sice breakpoints)
7 M+ R# E9 [4 U2 r, o# p# m! v1 l-AX = 0914h (Remove SIce breakoints), |+ q7 A7 Q7 q' o0 F
* t" J/ Q4 t/ T' i, C! C: uEach time you'll meet this trick, you'll see:
+ n- q+ C. A/ }# k. P-SI = 4647h
% {: E+ K2 X+ ^# R( m( c-DI = 4A4Dh
7 F, k( h# R5 i) n7 ZWhich are the 'magic values' used by SoftIce.6 B% [+ ^) m: r. G! b5 V- c
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: x H* L9 F' ]( N g) o* F
( [+ }& w& @1 d: l$ GHere is one example from the file "Haspinst.exe" which is the dongle HASP' R8 Z3 e3 x# i" X3 \! @7 ^
Envelope utility use to protect DOS applications:( f$ E7 P- F5 o: u3 M/ c, k- D5 k
0 B6 n1 y3 n8 J( m3 X& y
: k# U5 K6 K1 y* c3 Y$ i' ^
4C19:0095 MOV AX,0911 ; execute command.7 w# e0 R+ Z |: u! i
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
4 y8 H5 [& G$ c* {- F+ l4C19:009A MOV SI,4647 ; 1st magic value.
5 d7 |5 t1 i6 d4C19:009D MOV DI,4A4D ; 2nd magic value.
. J# I2 O8 q0 M$ Y3 H4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)+ t/ s5 t ]. p: F) `
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
' {) k) f% n- w4C19:00A4 INC CX6 R0 e# R# B# L; U
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute5 l5 D; S% ^9 y9 u5 ^. C! x$ g) N
4C19:00A8 JB 0095 ; 6 different commands.% H6 ]2 G9 i) Z7 q" [
4C19:00AA JMP 0002 ; Bad_Guy jmp back.! v7 `3 b( r; ]: M& H
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* X5 w4 j) b: A) S1 h: I" f6 s6 n9 V0 J& x" w* ^3 Q
The program will execute 6 different SIce commands located at ds:dx, which
: ]1 V& r$ S2 j) ]2 ^' C3 Sare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# d! q7 W9 i5 P: J; r% R! K8 q) k' M& S! H! M
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
2 i8 \/ }8 L# @! H# [___________________________________________________________________________
# X/ a9 i+ F; r! e
8 `1 q& n/ W' `% @: n) Q' x6 @9 ]5 u# H6 X& a$ r0 M
Method 031 f3 B: Y5 U! K8 L% L" p
=========
! k4 X- F$ _" R* I S5 X' V7 n* `9 ] a* l7 l! n
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ i, t5 S" H2 D$ r
(API Get entry point)8 h* J1 M+ [' O5 L# y4 z7 E# l5 F) b9 R
4 c! y2 Q$ k0 H. q+ k; v9 _; y6 V+ ~7 m9 q! l
xor di,di
1 }: R7 s' J2 w# N mov es,di
$ M. \, k- V7 a9 S5 o. U3 ^; _ mov ax, 1684h : E0 i9 T" x+ V
mov bx, 0202h ; VxD ID of winice4 }8 f } B& E6 D
int 2Fh
" ]& @) r6 Z4 E4 r$ G9 @ mov ax, es ; ES:DI -> VxD API entry point4 v+ m( [4 }1 E; P6 Y" A
add ax, di
+ B9 Z0 f& R) H* r1 _ test ax,ax1 D- [: M3 P( e
jnz SoftICE_Detected8 l, ~/ B/ F& ?/ J7 @( o6 ]
( C7 _' d$ h: \7 ?* J+ S, v___________________________________________________________________________
% H% W( T- B6 |6 |% e2 v8 |0 d y2 Q, b4 ~, j8 @2 o
Method 04
9 C; o" c9 t& D* b0 `: e* Q/ Q=========
, L5 y' a6 O+ @, G& ?9 l% ^; s" X+ A7 \
Method identical to the preceding one except that it seeks the ID of SoftICE
7 p3 b+ Y( H& [8 x6 d1 {" n+ `GFX VxD.
% j* Q' ]: @" J( M
S7 y4 T, ^1 x1 G5 o xor di,di
; k- G4 }4 s9 q& i4 S6 { mov es,di- A) N* G0 T, m" p- O( u, Z# r
mov ax, 1684h ; Z0 _+ l5 X3 s8 L. j; ?
mov bx, 7a5Fh ; VxD ID of SIWVID! d# C$ {8 w, f! J$ j
int 2fh
1 ]8 ?% J# f. n. B4 T/ X mov ax, es ; ES:DI -> VxD API entry point
& c3 k9 |' E. M add ax, di$ y5 z. z' w- B5 d' k2 D1 V
test ax,ax
! W! l) t; q9 [& ]8 ` jnz SoftICE_Detected
, X E: f$ L* p' \, @( r" X9 z% m/ X5 e) r* w- Z
__________________________________________________________________________# _3 H3 ^! f- S9 ?" L
, ^4 ^' a+ ]) }* J$ U5 o
8 r& C5 z, J5 T* a4 O6 X3 X" gMethod 054 I7 q5 f5 ~1 }/ T. d+ c
=========7 m) b9 R8 z3 _6 s0 N5 t
- p7 Q: C& ~" e& Y2 ?Method seeking the 'magic number' 0F386h returned (in ax) by all system5 o+ k. y( c3 b: j3 f! |
debugger. It calls the int 41h, function 4Fh.
+ M% }& X0 \2 {# v5 oThere are several alternatives.
: e* W- i. R; x1 o; i5 e" w- j7 o6 n% S
The following one is the simplest:% t2 W* R: Z- o# h4 A0 T6 l5 w
+ P1 q% V t5 S6 @6 s. }, I
mov ax,4fh" b7 W0 s# \' b
int 41h
/ W4 d2 `/ W( p) |/ U* ] cmp ax, 0F3860 z4 L1 F# Q+ j8 z7 Z( E' _* b
jz SoftICE_detected5 L) K" N0 [) e2 s7 N
* O+ j w5 Q8 a. E" D* @
6 g: v+ C& @% \+ Y/ H" N( QNext method as well as the following one are 2 examples from Stone's 2 s9 U# t, Q) I( [
"stn-wid.zip" (www.cracking.net):
; k" T, f5 C6 @1 p1 u. h* o7 E+ ?3 |( ?( i& m! [6 u
mov bx, cs
! V0 h& u0 B4 z3 O lea dx, int41handler2# w) ^) x9 D( r5 Z4 R) L, p6 K
xchg dx, es:[41h*4]
6 J4 b. a8 t2 ]% t4 c+ [0 I& P0 J xchg bx, es:[41h*4+2]
2 a- R$ b5 p+ r% v mov ax,4fh
& p4 N) D- {& k1 |( K int 41h
( M3 T, n# ?' z8 Y5 F xchg dx, es:[41h*4]
0 j# v, O: J% S X( n xchg bx, es:[41h*4+2]1 V1 M$ Q6 h8 U* I. J7 o
cmp ax, 0f386h
, k. b: O: p/ ~- g+ ^ jz SoftICE_detected
# F6 O- d' \6 _6 E, w0 X; j; }$ l; `, w) V! V% O4 c1 Q
int41handler2 PROC, z' d! L+ w7 J9 W! {- p6 e0 [
iret; j' u9 } J: ^
int41handler2 ENDP
7 s) f# a4 _/ o: R- q5 X3 E2 [9 X/ v7 e6 H7 m/ ~& r
: d/ I' B0 W& w& a_________________________________________________________________________; ]( X8 Z% d5 g& Y, t9 Q
8 X, e6 ]0 @* l2 S; \3 Y8 l1 X7 m# i% X0 B/ J
Method 06% f+ n' R5 y: |/ Y' H6 H- m
=========
5 |( v7 M# E! F; o* S
+ h1 z8 Z u9 F* d
0 i+ S* @- L: t4 V. g7 o5 ~; x2 L2nd method similar to the preceding one but more difficult to detect:
, q3 |% f8 Y5 M. L" ~" Z- Z0 R' H2 r3 n" J
& @5 ], K. w$ }* Xint41handler PROC1 d k0 i$ B+ d- Z: x* j: E
mov cl,al/ H: R _) V2 y" t' L! G
iret
/ P t* E. O% c- mint41handler ENDP: z( y6 i' x. N1 ^5 j. { S
3 A6 L) k' t5 o2 V( B5 Y* o0 C& p
- Q# a* x" @3 c( V7 i3 D9 P xor ax,ax
5 \8 O' y2 y" t4 W! [ mov es,ax& [; e: f& @6 E* C' D( Z' H# ^3 B
mov bx, cs
- V$ [$ k0 T8 f M( o9 h lea dx, int41handler8 q3 x& u7 m1 D( B# U
xchg dx, es:[41h*4]
% v( @' d1 N# d p, l, T5 i0 c xchg bx, es:[41h*4+2]
' K z/ m) P7 j in al, 40h
/ u6 F& j5 G, L+ X xor cx,cx( c+ X4 q' v& L( a8 x1 s' F
int 41h
: `' A6 \7 ` C6 } xchg dx, es:[41h*4]
' n) w4 @, n" ^& n xchg bx, es:[41h*4+2]5 i9 k. p3 F' d) x8 p
cmp cl,al* }* C/ {& v3 I% Z# l5 x: J% R
jnz SoftICE_detected& T S2 m, b: v9 T) @ \) V
1 R4 x2 g) |+ x9 s- g0 |8 z) j
_________________________________________________________________________
# @3 k Z' P' g& R7 ]+ _! k
( m8 j$ T$ N H0 q; z0 _Method 07. j7 v0 V1 m( w( e3 v
=========& v' \+ m* I/ Y' a) U
6 a4 w$ E# G2 K+ Z4 V* kMethod of detection of the WinICE handler in the int68h (V86)
6 m- J/ M" Y' K
6 {; l0 j5 \" O, K- ~* A mov ah,43h
, Y- A6 ]; R3 L$ E int 68h* z+ k) E9 E1 I1 m" E5 ]+ F( _9 ~6 v! p
cmp ax,0F386h0 Q3 T1 b) o2 z+ o3 E- H& E
jz SoftICE_Detected. C$ f- Y7 d; c. W; g
9 J6 u9 [) n; _" u. ^8 h q
k+ s$ O2 H* _5 h4 ~: Y( f" }=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. Y9 L+ {7 L3 |6 T& d9 ?6 N app like this:
+ I0 w& ~: l$ Q7 B3 ?$ t
1 y& g3 c" \2 ^8 p BPX exec_int if ax==689 v2 ^. K- b/ S/ O, [3 M/ T4 R
(function called is located at byte ptr [ebp+1Dh] and client eip is
; j$ d0 B" e2 G- c1 k) ~4 w1 p) r located at [ebp+48h] for 32Bit apps)
! W' \1 N. t9 C5 M3 K__________________________________________________________________________- }6 @4 ^+ W: A: Q
/ @# W- E5 c- y# C+ E( h
5 P, Y' |4 [! @8 x e% ?3 f
Method 08
# ^) J8 p" B9 B; `=========
Y+ _" ?! D- N' x
, ?9 k4 e4 w/ PIt is not a method of detection of SoftICE but a possibility to crash the7 ]6 [: |* L0 T6 q7 G$ K
system by intercepting int 01h and int 03h and redirecting them to another( q) Q" t1 A% i, X( n
routine.- }! l% G8 c2 V8 U% Z1 z+ v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points& R4 Z/ b2 r. q3 A
to the new routine to execute (hangs computer...), E) v& |" e- J* E
' N8 L) D! ~- { r+ U/ F
mov ah, 25h
' X, _7 _4 m3 N, j9 }' L9 V# Y/ i7 k mov al, Int_Number (01h or 03h)* c- w0 p+ Q' h6 y/ }
mov dx, offset New_Int_Routine
. D5 y$ ]3 p# U- ] int 21h' F$ U% |$ N' B$ H. F/ {
. Y0 d0 E3 O& m( V; p__________________________________________________________________________
! ^6 q6 D! `/ f1 }8 c! v9 F/ j) R5 z7 C: Q
Method 09
- N# w% A* N/ ~ K=========- v, }& W# L4 F' K( l) a0 p8 O
# z& X! g2 B! q. t3 N
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 U( j' L1 v& g. A2 j: h3 B/ sperformed in ring0 (VxD or a ring3 app using the VxdCall).6 x$ g% n5 r. G3 e9 `
The Get_DDB service is used to determine whether or not a VxD is installed1 K8 f! T7 b# G% M1 w, j- Z
for the specified device and returns a Device Description Block (in ecx) for) L0 [! g0 c9 _5 P- G( ?. m
that device if it is installed.
; d1 O! }) U! q$ f4 X2 q# X9 s& n; |9 |. Y- |0 f
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# o! k+ P% g7 a; g. a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 v1 k5 a' I" [" b s
VMMCall Get_DDB! H) P5 n4 D% \9 `
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; t( r6 o1 T/ }5 u) c/ P6 `
6 K2 c. `9 A3 d% G+ B- F
Note as well that you can easily detect this method with SoftICE:
, O, v Q) G; _4 L. j bpx Get_DDB if ax==0202 || ax==7a5fh* ~# D% ~0 Q% y, R) k& N1 f
7 S. e; u3 ~* U
__________________________________________________________________________+ r% i: ?' \1 X' R
; i% F4 o1 L5 Z! S9 B
Method 10+ I: S2 `6 W. ?' d, m
=========* k$ N, P. [4 T9 M
" [: X; J) J& z6 F7 C' E=>Disable or clear breakpoints before using this feature. DO NOT trace with8 d( A& v1 P0 i3 g1 A
SoftICE while the option is enable!!% _3 j _* p! W! R3 b+ u
7 G3 p9 d! E* Y5 d( mThis trick is very efficient:
* L/ A) F, i. G3 Q8 O! ?by checking the Debug Registers, you can detect if SoftICE is loaded: J( L) ?; ?+ b( D
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if# E# y" ^* X( n/ C% }
there are some memory breakpoints set (dr0 to dr3) simply by reading their5 }" e2 s' X3 T# T0 N/ m" B
value (in ring0 only). Values can be manipulated and or changed as well, V; S, l! O3 v1 J z
(clearing BPMs for instance)) D8 M" t" h, L& g* ~
0 S% l4 c2 t$ @__________________________________________________________________________6 t# c: y0 k+ M+ s4 m
$ n6 V" i+ K& N2 O! AMethod 11& G4 k& j/ g9 ]: F x. p
=========) v" [1 s9 Y% a( N7 N, b
; R* u4 x b. A/ g* [This method is most known as 'MeltICE' because it has been freely distributed
D7 k) j' b+ b5 t d' j. Z+ Hvia www.winfiles.com. However it was first used by NuMega people to allow. c0 t- G4 Y, g9 p- T, V; E% w$ c
Symbol Loader to check if SoftICE was active or not (the code is located
/ B- h, ~* F& J# S4 t* X9 f* \inside nmtrans.dll).1 S* j, \7 | Y' e
4 k4 X4 U8 }! q' w, a9 g" N0 jThe way it works is very simple:
6 Q1 M o5 c6 P) z3 _5 Z9 x+ p' [It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 C0 t9 X- G' }* u+ x! U1 r7 v
WinNT) with the CreateFileA API.
9 B6 d% h+ `) }* @& M, n1 d% m) x( M
/ o1 w& T. d I. S* IHere is a sample (checking for 'SICE'):1 n0 U h3 ?& K1 L
4 z3 e6 W# E8 ~. wBOOL IsSoftIce95Loaded()* D5 U: y& ]$ | u
{8 N4 S P! q8 `' r9 j9 T! A
HANDLE hFile;
! E) J( L9 }) O; y- O; t hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" A& C h% [8 V: K FILE_SHARE_READ | FILE_SHARE_WRITE,. Z+ h/ p7 y. G* W, V: q8 j3 j
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
6 w' w- y) Z6 h4 V' a if( hFile != INVALID_HANDLE_VALUE )
' m1 b! h ^0 x* p( _, R {3 U9 [1 i' Y% f ]" s; B3 P1 }
CloseHandle(hFile);
# w" r2 S. `( `+ o p return TRUE;
" G( h# |, i- o2 H) _ }1 Y0 P! D9 p+ j. C; B0 ~& {
return FALSE;0 O+ u- @3 C0 h8 R3 V, n
}
* L2 \" J3 j) C# \0 m ^( [, Q0 M' `" }% O y
Although this trick calls the CreateFileA function, don't even expect to be" \& Q2 h/ P X
able to intercept it by installing a IFS hook: it will not work, no way!
! _3 v0 t* m& y7 { {" kIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 S- ~5 K6 {, t1 Pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
; c8 {) r$ ]0 P8 z* S( u- aand then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 c( Q! w8 k7 y) kfield.
: f1 T0 ]3 P" c5 g" V- ~In fact, its purpose is not to load/unload VxDs but only to send a
/ F, U* A2 u4 Z: A* q' wW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 H. n; a: o' s; d8 m9 h. E0 g. c
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 h) R* B2 Z! l' Z0 n) v1 [
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* p9 X% i; E( n+ X
If the VxD is loaded, it will always clear eax and the Carry flag to allow, c7 [$ t0 ~0 k8 V' d
its handle to be opened and then, will be detected.
3 G0 R8 y6 {$ b) HYou can check that simply by hooking Winice.exe control proc entry point$ S2 }& X3 P! I+ [# Y) O
while running MeltICE.
% k" Q$ x( ?/ S2 b. X/ I. e( K3 J
: I0 R* |' n9 G. Q$ T% f
00401067: push 00402025 ; \\.\SICE( k: a! n+ O# J' y( r/ k3 u
0040106C: call CreateFileA3 ^3 \7 S3 \- n$ b
00401071: cmp eax,-001- [9 i4 A0 |; o6 j
00401074: je 004010919 E$ q9 Y, d9 ~4 l( g0 x0 S
8 K; u7 i) x0 \6 Q E4 x, b9 s
9 f" F5 X7 d( H ?; [$ }# MThere could be hundreds of BPX you could use to detect this trick.% m0 y) G$ e7 }- a" E( R+ T. Q
-The most classical one is:
. n. l( D, P" _4 X& k) O9 E5 ^ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||6 d; a: u+ S; D5 K2 u+ B0 l! p& c9 m
*(esp->4+4)=='NTIC'! v5 c8 t8 e/ a: U1 T% A( Q G- g
; I, p2 |" [7 o. g: i: A J# J
-The most exotic ones (could be very slooooow :-(8 r8 z# m% h8 \
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" T5 @6 ]) ^* x! c+ p! E( Z6 d% h I4 M ;will break 3 times :-(
- e( Z8 V( ~2 v+ H+ ~' d: I8 Q9 F/ S3 c6 o4 K$ a
-or (a bit) faster: 6 F. Y1 {1 m7 N$ Y
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 j1 N" [! T# X5 d: F( l. K6 i0 w( m
1 T- k/ }6 n5 F6 q3 v6 U5 y BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
2 W' j% L0 k' p+ y6 Z2 Y ;will break 3 times :-(
/ Y3 P. i- Q) E3 d+ r' n$ @) T. A3 ?* x4 w( K0 g* V7 d1 F# S
-Much faster:" X9 M; b$ z5 s5 |: M9 n
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 p- W c3 n$ B
+ M2 c$ K- ]( B% S9 [
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: A# S& W/ g* ^, \function to do the same job:
2 j5 ~) ?( n' r: F8 Z, _
+ ]1 ~. ~( W% h' O push 00 ; OF_READ7 v& ?/ a; ?. V' F! z
mov eax,[00656634] ; '\\.\SICE',0
. E- V% B. A; Q7 Y4 Q( z5 Q push eax% l% [8 r c U, ^/ \# ?
call KERNEL32!_lopen8 G: Q& s2 O3 _
inc eax
8 C7 S' F/ `' E jnz 00650589 ; detected
- m. E! _6 Q b- f1 s; P6 H8 l push 00 ; OF_READ
4 J1 r. \' t9 a0 t4 T, o' R mov eax,[00656638] ; '\\.\SICE'
% p4 B4 T; d+ t. @3 i2 h4 T; ^ push eax) M- q7 Y/ f* ?, h% P
call KERNEL32!_lopen
5 P, N" ?: S, P6 e7 D+ X. u) z inc eax
; X$ Q( r, a1 S. P jz 006505ae ; not detected6 J# V# s- y6 o5 Q4 E# x2 k! z
6 D M+ }8 w6 _" ?! ?% Q! Q/ `- ?6 Y& Z4 N7 ^ v
__________________________________________________________________________
! }) k2 n# r5 }6 q; R
6 W! l3 k: J9 L$ n2 m% h" M1 AMethod 12
3 v4 u0 j) w: h9 F5 H- `, u=========
5 g7 c8 Q* ~6 k0 I Q i+ [& V! J. }# V* D0 U* Y0 Q% J/ @
This trick is similar to int41h/4fh Debugger installation check (code 05' p: `! Z# D M
& 06) but very limited because it's only available for Win95/98 (not NT)
: I1 k$ S# k: m7 has it uses the VxDCall backdoor. This detection was found in Bleem Demo.: _( i: W) f+ v
) G) f0 ?( i1 {6 v push 0000004fh ; function 4fh; j J* f$ K7 n3 N
push 002a002ah ; high word specifies which VxD (VWIN32)6 _8 k9 A5 ^5 H8 u
; low word specifies which service
' [( F% {0 V+ i5 f4 p (VWIN32_Int41Dispatch)
0 p% {) H. t7 W9 w( l call Kernel32!ORD_001 ; VxdCall
( t, F- D1 \+ X+ m cmp ax, 0f386h ; magic number returned by system debuggers
7 S( Y! c+ X1 @ jz SoftICE_detected
8 i# G ]' P& H4 {
8 |4 ^; s0 ^1 i; C" rHere again, several ways to detect it:& b6 p }' I! X$ E* ?+ u
8 H& M7 I: l% \% V8 _9 _! {% E
BPINT 41 if ax==4f% q* x5 m! z8 ~" K) u' B
7 @3 V/ }9 k& f! s! y, O4 ^( O
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
. l$ s) C7 X8 I& b- z9 O' Y ~. {1 L* _; M/ A# I( G
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A, c1 ^: [" g" |2 P+ ^2 y2 r
% x6 C: L) C7 h' Q3 d: ]+ Z
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 W# R+ h! }2 {" n
$ I3 |) f. o& {& g9 J v__________________________________________________________________________* u- }# T/ t5 _& `
3 N6 T) W$ G+ L1 r
Method 135 |* X* {# }( a" s
=========; `& i2 m3 q' n% o
2 \/ W1 A2 R9 p4 M" J! Q- @% I
Not a real method of detection, but a good way to know if SoftICE is" B) }9 q( R" R& B# G
installed on a computer and to locate its installation directory.% _2 R, |5 V E7 a) ?0 z6 f
It is used by few softs which access the following registry keys (usually #2) :
- i. a$ T% R6 T! j& \+ A% E, w2 v' a' a8 d+ W! I- s
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& f2 }% E0 ~2 ?& J\Uninstall\SoftICE
: M. m9 Q. c( f! @7 X-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# t, w( W9 y* l
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 D5 E$ P. {5 ], z9 {8 I" h
\App Paths\Loader32.Exe. v/ ]5 q# s' f
* V) [" M2 u2 h e
; v6 A+ O( D$ z4 ?Note that some nasty apps could then erase all files from SoftICE directory
/ i# G. T" \0 c+ O(I faced that once :-(
9 e2 H I, s! X/ |
# A" W7 u' }2 E: y( g+ iUseful breakpoint to detect it:
+ {4 ]: Z3 B1 q( }' l6 V8 ~+ |+ c
) `8 a, F& `& o c+ ?7 ^* H$ A BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'4 u. r# c/ y9 J C! [/ Y1 n. S
* S7 V; y$ o) f! X__________________________________________________________________________
4 b' J" n/ s( B) V# E5 ~% s4 I( l/ o1 ~
! l# ^3 E* s) ]
Method 14
0 r z5 U. p6 X C& d=========2 h3 p" K# ^! H' l9 j1 ^, @
2 q8 k$ D) P5 L
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
9 h Y5 l |. g+ ~6 [is to determines whether a debugger is running on your system (ring0 only).9 Y @' w% Q: s, I
3 q! s( H0 w& q T$ O6 l. ^- Q VMMCall Test_Debug_Installed
8 j# O/ [3 w& ~: ` n0 Y je not_installed
) q2 l& P6 V5 k( J- \) e/ H; Y* C# y# v7 N& _
This service just checks a flag.
0 e6 L8 e6 l/ [</PRE></TD></TR></TBODY></TABLE> |