<TABLE width=500>9 Y2 }) A3 q- R
<TBODY>
/ e, e' H" Q0 s \4 j3 ^# u3 O<TR>
4 s7 r! g) N7 c" K! Z2 g; v<TD><PRE>Method 01 9 o3 J+ n+ ~' {
=========5 i6 h& o& x- Y
. E2 l) b& ~& X0 A$ O3 U) W9 u# L6 IThis method of detection of SoftICE (as well as the following one) is
) V( J; z! N# B' p+ X& j! ^used by the majority of packers/encryptors found on Internet.& M9 f5 G7 O; G w1 f9 ]( [9 G
It seeks the signature of BoundsChecker in SoftICE
2 B% T( g& C' L0 H$ y8 [: c4 G6 u# [% M B8 M/ ]5 c0 |2 u
mov ebp, 04243484Bh ; 'BCHK'7 p/ e- P5 H0 b+ f
mov ax, 04h
0 U7 k7 `1 ~" Z0 S+ L5 {; s int 3
! S+ j; _' G4 M) K; L5 O T) u cmp al,4
( N: M2 W! ?8 P jnz SoftICE_Detected+ K' q, m" u# W4 `4 \
! a5 u8 |! S! ^) P$ T0 ~8 T___________________________________________________________________________- p* [4 X+ l1 Q: h r
. B9 _) m0 U0 c/ w5 cMethod 022 u; h6 S% N5 n. \+ Y8 ~- G
=========
4 Z* G* d+ g& V9 w4 c$ Q4 q
3 ?+ l# s5 ]9 [Still a method very much used (perhaps the most frequent one). It is used
- y, N0 m0 e/ g# |: x2 Vto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! F* l0 n$ C+ ?2 |or execute SoftICE commands...
. }' ]( g! d& N4 X7 V) RIt is also used to crash SoftICE and to force it to execute any commands
1 }/ k) o; Y6 c(HBOOT...) :-(( : u3 o: C) e3 }! k
- V. W! t; o1 }: l
Here is a quick description:
! M8 b1 J" h/ F8 _5 T% m0 Y-AX = 0910h (Display string in SIce windows)
% {; q6 l ~% Z4 |1 A/ {-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- M2 \ b" g% t- \; d
-AX = 0912h (Get breakpoint infos)4 A. @. u4 A3 c. I* S$ t8 s
-AX = 0913h (Set Sice breakpoints)% E3 J4 I/ j8 k7 n- i( M' l2 A7 l, d
-AX = 0914h (Remove SIce breakoints). [1 ~ i$ o- \6 Y* @$ p
* e$ d+ t: V- u# [3 zEach time you'll meet this trick, you'll see:
2 o& O4 Z4 U4 X: l- l6 r2 o4 ~-SI = 4647h
% F4 r& z/ B0 V-DI = 4A4Dh! R: b, E6 O7 v1 z; I
Which are the 'magic values' used by SoftIce.3 F6 i2 O9 d0 v2 a+ M; A
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 X5 ?- [# `: E; T, d) N8 T6 c
& a: i- ]: f; U+ Y9 M
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! C2 I3 e' i$ d; bEnvelope utility use to protect DOS applications:2 A" C& P2 R7 j: k
) Y4 \7 T. X2 Z' n; w! D
7 v' U7 c D3 ~6 m& e5 f6 l
4C19:0095 MOV AX,0911 ; execute command.
. f3 o. `9 A/ I7 S6 i# q4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 R3 w/ v: h: C. w; {* K4C19:009A MOV SI,4647 ; 1st magic value.
5 H, }# {+ w* M( x, @- g, }4C19:009D MOV DI,4A4D ; 2nd magic value.
. a% L( I6 R! U/ C# d! Z4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ W; x( K/ E. p4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
; v0 _ ?# @" z. Q- V! p4 [ Q4C19:00A4 INC CX
. g* k/ P/ D% @5 J& M/ Z" ]2 R4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
2 P0 _3 D1 m, C7 G4 C% j9 X4C19:00A8 JB 0095 ; 6 different commands." r ?4 E/ ?1 |- Y5 N
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, v5 [, p! x: h/ [, n' e4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" u; \2 e% Z0 e: S8 v9 L5 V% u7 d: e8 D0 C% L0 x8 T: f, H* }
The program will execute 6 different SIce commands located at ds:dx, which6 n0 s7 ~$ `) l, e+ V4 L6 F! S
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ I) ~' o7 j) B
6 e; F+ n3 w& Z7 I! M, n# v$ R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* T) [* q; n; [9 C2 g___________________________________________________________________________
2 g/ w. g0 m, p/ }# O+ m# X7 ]; N( Z- }# \& [2 X- C7 K
2 w2 [5 [8 }4 s
Method 038 o/ l$ m* h! Q. n2 y
=========
; D, D5 R3 `1 `1 q5 m7 L3 u0 e. [# V7 S
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
6 F4 x( N; B+ |" |(API Get entry point)7 {6 D4 J- c; E+ S5 ~
0 r! z" X7 e5 H- l5 `9 w/ H+ H
8 U0 }% G9 @$ W/ m
xor di,di
9 V1 \, d# z& H( w2 Z mov es,di/ g3 z2 S+ u* B# g
mov ax, 1684h
! q/ S6 p y+ B7 f' u mov bx, 0202h ; VxD ID of winice. F/ Y' |+ p- C' y+ P; f
int 2Fh4 Q0 f2 ^ V m( e5 w, `7 C. N+ I
mov ax, es ; ES:DI -> VxD API entry point* @: p+ O. b1 ?6 W3 i8 \0 G
add ax, di
, D4 I7 Y8 O* j- C1 o6 k test ax,ax5 S. e, M: @3 _8 V; `
jnz SoftICE_Detected
3 d! `# \7 {3 _% [1 }$ A0 [
8 P- h# o; w8 R' I___________________________________________________________________________
" P- Z4 N, s8 j9 C( H! E- i" N3 f9 g/ V ~ L4 p
Method 04! X: W' o, @2 m6 E9 Y6 E( w+ o
=========
0 c& v+ Q) R# V+ @0 g' I( e- N
) X- _4 \0 d, n( J5 {* ~Method identical to the preceding one except that it seeks the ID of SoftICE
: @0 U0 U/ d1 {6 ~0 L$ }' C9 C( XGFX VxD.
) o& u9 W* k$ z( [% W: u; P; k4 f& {' w8 f+ G9 m
xor di,di. B! F1 }2 u# G" k
mov es,di d' v6 k0 i2 X7 |8 V# x% V' ^
mov ax, 1684h
J9 M( U, v' z7 o mov bx, 7a5Fh ; VxD ID of SIWVID" R* @; o8 |, F! J( g3 u# X' Y
int 2fh
. ~. \+ f4 Q5 \7 v mov ax, es ; ES:DI -> VxD API entry point" Z( z1 F# n! d8 _0 e" f- j
add ax, di
4 B, _8 ~( K+ C. D3 H test ax,ax
4 l' p/ `" i1 C u1 f1 s! f jnz SoftICE_Detected; ]+ i) ]2 j& B$ g
# a0 L- r* X, Y* n% j: L$ `$ |__________________________________________________________________________
- H: K% g; v, e8 K5 f
7 |+ k$ y% i& r" U: {$ i( X5 p6 W" D4 Y, F. I5 O% f7 X
Method 05, x, I! ]4 D3 i) C; N9 e
=========
) a9 l+ @7 O0 i' _* H
- u; ^4 X, W V8 u d! ?Method seeking the 'magic number' 0F386h returned (in ax) by all system
6 z) G. J( o7 d6 t( ]debugger. It calls the int 41h, function 4Fh.; w! g! i4 A- V, Y) [
There are several alternatives. # {/ s& y+ n. }3 r6 | }/ P
$ |" q% }, J# J4 O6 C' n. C( v" K
The following one is the simplest:7 v2 D* G# I; q
& j8 g8 N2 G: f( R4 q mov ax,4fh5 a: F0 B8 _1 a9 n! t* o
int 41h
& Z f" N: Q8 y9 b4 V, [# d8 z/ v cmp ax, 0F386
# |, ?" D, v: P& q1 `& y jz SoftICE_detected
! e. r' E; g& [& C; n( |% J4 M3 Z: A) p L- ?
( l3 K' [+ I1 e" u0 F/ \Next method as well as the following one are 2 examples from Stone's 8 ~+ m! s: G" Q
"stn-wid.zip" (www.cracking.net):2 y% _: {9 A1 [6 z3 F
2 j! m" _" i6 r& j7 n# E mov bx, cs( d2 w4 h, V' P; A) O1 V) k1 _
lea dx, int41handler2. z! C, q! v; F. L& F6 c7 d/ z7 g! W
xchg dx, es:[41h*4]. ~8 V9 D! R6 I. A/ U
xchg bx, es:[41h*4+2]
7 u8 T! g: n# B2 F4 b u mov ax,4fh
# D( g2 f0 b1 C int 41h
; \7 O' J8 D9 G xchg dx, es:[41h*4], B* E" W' k5 Z) q0 A
xchg bx, es:[41h*4+2]
" P9 t5 K8 I; m. V4 a9 ` cmp ax, 0f386h) h' s% |7 U' ^0 U8 @6 `$ ~7 X& v
jz SoftICE_detected- T8 N0 k7 g$ b. v" Y8 A, r2 k8 m
) R! t* E5 i7 A8 l4 I5 Vint41handler2 PROC
! [# j, {9 c) o1 V4 @ iret
; |7 ^0 [& X: @int41handler2 ENDP! `! `! v2 \3 y2 J8 _: q6 `9 l
4 M$ ^$ {4 k# [
8 q3 P2 e* f* e( [% O" {, j_________________________________________________________________________3 Z3 P+ R: [" \5 u# n# u/ H4 K
l) R* ~5 a+ t* Y: W
& q) h- I6 [) ^: W/ j( L( u3 S: [Method 063 v4 M' M4 j' s' C& W9 w' P
=========
" Y: Z/ ~- o, ~1 I1 \" ~
7 q+ t6 s% ]6 n X& ^$ Z; k! {, I# e( D& u0 }
2nd method similar to the preceding one but more difficult to detect:* [- x7 I4 |$ n- i- b9 d( b. @& a
! ]( s E3 u" J; t4 f8 ] w* Y
5 y& C% Y8 m4 {' Z3 y' @int41handler PROC
]! ~4 e# N4 e9 m mov cl,al0 |+ d. K9 G. p2 U8 R' W/ u( I
iret
; c3 q& x! v. D3 s! D$ y. u w: Wint41handler ENDP
! F8 j J+ m. |
: a+ V: W" J8 W. Y! L$ _$ s
6 {- @. _! F: S5 ] xor ax,ax
$ V3 K" ~/ k# M mov es,ax
. y9 X: I0 Y h( f& n& q' i, h mov bx, cs
1 a, X5 D# C# t! H lea dx, int41handler# M+ y9 _$ A7 ]
xchg dx, es:[41h*4]. F; b; Y2 @) d+ _9 ~( T
xchg bx, es:[41h*4+2]/ P/ f# G* | r: c$ V6 ^
in al, 40h& U' }- @/ r# d
xor cx,cx7 h( R+ A1 K5 ?. u1 X/ L' L
int 41h- [$ D0 R2 D6 S9 r
xchg dx, es:[41h*4]/ _) S# O3 ~7 ]2 q
xchg bx, es:[41h*4+2]9 m% I) r+ ~1 G- P) C3 `
cmp cl,al9 u4 n U" h6 x( ?/ S
jnz SoftICE_detected$ }: K+ S' J! f
, b! r! E1 ~# O3 j- I% S_________________________________________________________________________4 B) Z! x1 H5 ]" e
& \ v+ T# J. E. ^0 s% z1 ZMethod 07
! Q; `0 _& Q+ g, J- D- \. u( t=========
; c) T* ^, u/ C
# V, v* q2 a! b& J. PMethod of detection of the WinICE handler in the int68h (V86)
3 o8 {9 c1 x6 J6 ~# k0 t/ |) n6 j# a7 F& Q( M s
mov ah,43h
R$ n9 h7 o* b/ ? int 68h2 H, A, z# W4 b. i
cmp ax,0F386h: A! t6 H$ O, E' y( O/ p
jz SoftICE_Detected
3 n- A; ]% w, ]7 A! n n( q2 @9 k* T5 J
3 w' _# t- z: k4 {. H! ^4 p* T& y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 n9 u+ a! y6 o8 n l1 {8 @
app like this:
! y0 |0 z4 f+ {2 W! T o5 l
! \; l* F3 }- m+ Z5 K8 [. }7 U BPX exec_int if ax==68
3 v! ~# j3 I' d% X! R (function called is located at byte ptr [ebp+1Dh] and client eip is5 k5 }/ S' o' ]9 Y# \3 z
located at [ebp+48h] for 32Bit apps)
8 Z8 ]! M, e: |! u$ |% z__________________________________________________________________________
. S4 M9 A% i3 n& w% Z& T3 k( K6 [" F# U6 _; d, O* E, {5 E5 n. O
: C9 M5 n5 m' k1 @3 P+ SMethod 08& a% Z2 p: c6 {2 r! n
=========
9 A' i. b G! Y
6 `9 O; u2 o; j8 ]1 vIt is not a method of detection of SoftICE but a possibility to crash the
: Y9 {) d k) Z9 csystem by intercepting int 01h and int 03h and redirecting them to another
+ M/ O) I; c# w& X9 Aroutine.
5 ~) J" ]. t2 g& A5 T0 a1 EIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. J! p6 z! P' @
to the new routine to execute (hangs computer...)% T3 ~$ K0 g7 T4 \
. m0 H/ F8 g+ b% c' A q
mov ah, 25h
! r; W" s+ x; M7 o, M7 Q1 n; D mov al, Int_Number (01h or 03h)8 S3 H) [) V5 b4 m. i
mov dx, offset New_Int_Routine' k5 u% e) M! `7 F5 p
int 21h2 z7 t C. N5 r2 s2 O0 J2 L {" |
5 t; n$ y5 H) c) A__________________________________________________________________________
T0 W* i& e( i! b
6 N% N7 I8 ?- D2 s4 L g/ S8 uMethod 09: e U* z; P; }& t
=========/ C' h$ G' B7 J5 e0 _
" S0 O8 t! z: {! R9 o' N/ {
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ _, t+ N; `' D, i$ C1 x/ }# n- [
performed in ring0 (VxD or a ring3 app using the VxdCall).) T! ?3 v) W4 S3 D( @. E& O
The Get_DDB service is used to determine whether or not a VxD is installed
7 o6 ^- a* z+ a0 s7 Ffor the specified device and returns a Device Description Block (in ecx) for
4 y# X G; R4 a- H4 Q7 _6 c. ethat device if it is installed.
, T0 c/ ~* `% [9 }' l) \
9 q2 B/ d7 x& E; F$ y mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID$ d5 _7 v9 _6 F7 A& [" P& h2 G
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
, b" h5 a1 H; S [ ` VMMCall Get_DDB2 A' w6 p5 t; A7 t( W
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ n$ p0 q0 I0 [% @# i
. G$ ?6 p$ F sNote as well that you can easily detect this method with SoftICE:& [- w: b# U B; ^; X
bpx Get_DDB if ax==0202 || ax==7a5fh
9 @: m, N5 V0 s, X) g6 q! W) _
+ v; A" g. y8 |# o2 c__________________________________________________________________________/ G# X& v8 ]% ?# R% [
3 d) k/ A. d/ kMethod 10
0 z. D; \' L6 k/ Y6 ^=========
' \2 t5 U( N! H2 f6 s
0 W1 D2 G8 Q8 w4 C8 ~=>Disable or clear breakpoints before using this feature. DO NOT trace with6 y& y" |7 X; {) e" @1 g+ N
SoftICE while the option is enable!!
2 _+ N3 [5 D9 R: C# a4 a. ]
+ E4 E- z' o+ g- s) B/ rThis trick is very efficient: t. p5 t4 L+ Y; @2 y. }
by checking the Debug Registers, you can detect if SoftICE is loaded# S3 {) l1 D2 x$ m& V1 I& |) s
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
5 S* [5 u& O5 V! fthere are some memory breakpoints set (dr0 to dr3) simply by reading their
2 u6 I- G* Z$ S# B) @value (in ring0 only). Values can be manipulated and or changed as well
8 f5 M: F1 \2 n(clearing BPMs for instance)
5 c9 N. {/ B) _ a0 C5 v3 U3 R, y1 `4 u0 h8 m& Y* K
__________________________________________________________________________
0 L& M5 t. Z8 i$ d! N# L( z8 r+ f! N4 o+ W: Y3 [
Method 11- I7 }! K2 ~% C) p* {4 Y) v
=========
# a6 q/ N8 r. J1 Y
! ]2 ]+ O% i' y& \7 vThis method is most known as 'MeltICE' because it has been freely distributed- y/ Q. `, s: j
via www.winfiles.com. However it was first used by NuMega people to allow+ Q) q8 w' h/ f8 q
Symbol Loader to check if SoftICE was active or not (the code is located
: J4 X7 u& b8 \7 e4 ^9 h9 ?* x9 O/ Xinside nmtrans.dll).
- h; } }" u; c1 _6 r7 ]% A
0 t* i5 v+ A- l9 n/ YThe way it works is very simple:
: M* V/ [6 \0 G0 s5 U2 ]' DIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- G5 ^) o. o9 F$ X
WinNT) with the CreateFileA API.
+ U9 Z$ y% x& X9 c# f9 m: k- D9 A3 }& D9 y4 p/ I
Here is a sample (checking for 'SICE'):
$ V; V3 k" P% E/ M4 g1 n9 {4 E5 Y# ]* B& z9 ~
BOOL IsSoftIce95Loaded(); P9 J3 H8 o I4 d0 d0 j6 g- X
{& S: F r+ P5 Q3 |
HANDLE hFile;
5 s+ |6 t+ N5 S- h6 Z# N9 q hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. o6 g/ S* f' ^& n0 e FILE_SHARE_READ | FILE_SHARE_WRITE,
! R) E9 u4 V; A9 Q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ T2 J) K7 I. H- V: h if( hFile != INVALID_HANDLE_VALUE )% Y& u4 q4 s- m! m- S& G5 I* e
{
3 S/ P3 E/ J, M2 c1 Q2 L CloseHandle(hFile);% h1 c, I' D% o- A3 S/ F( I2 g
return TRUE;
% v; H5 b1 O `" }3 _9 u" V/ ` }/ C6 A0 d: H# ?* c6 u: E
return FALSE;- H2 o5 M; g: O3 _% T. q3 u
}
/ ~4 Y0 S# y) a9 S
3 a, ?+ j) T4 |' z5 g9 D8 G6 eAlthough this trick calls the CreateFileA function, don't even expect to be. O9 S- Y3 z; A
able to intercept it by installing a IFS hook: it will not work, no way!
2 [6 R, Y. F3 S' E" d% M+ PIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 j% b( o6 ~# O- w4 n2 mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 g) t7 e8 | t( T3 ]6 R/ ?5 b: r
and then browse the DDB list until it find the VxD and its DDB_Control_Proc9 Z1 x/ x% Z3 r2 o
field.
0 b% O j7 c) @ }! _; [: kIn fact, its purpose is not to load/unload VxDs but only to send a
6 b4 I) A) n0 I& g2 R3 }9 _W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# m$ f$ Z% k5 z4 \4 j. ^
to the VxD Control_Dispatch proc (how the hell a shareware soft could try, P5 c* b/ r/ A& W0 I( s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).3 @3 |! ? O6 E) c' a4 y! q
If the VxD is loaded, it will always clear eax and the Carry flag to allow/ h6 A8 j i' [, _
its handle to be opened and then, will be detected.
: y4 M6 T- `3 {: d0 q9 g2 q3 VYou can check that simply by hooking Winice.exe control proc entry point% W3 W# U5 ~* i
while running MeltICE.
- N$ S* A& o7 e* L1 k+ T3 y% D7 L9 ~/ q
" ~7 E! J$ A2 K! W3 B9 Q6 Q 00401067: push 00402025 ; \\.\SICE
' w( G) @* z" P. s. ?0 j 0040106C: call CreateFileA
{$ x' h9 V* J/ u" \! S2 b 00401071: cmp eax,-001+ r; ]* q8 t v! J, W' C
00401074: je 00401091- {; D# v( m( N9 r2 }& Z1 l
( O$ X* F1 s" ]" T$ t# f8 N! F/ y0 A
There could be hundreds of BPX you could use to detect this trick.
# z: R2 a- ?+ Q8 M( m-The most classical one is:$ W0 c/ X0 @% S( g/ T) x: U' g
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 Q' x/ m1 U4 Z+ J9 ^* n *(esp->4+4)=='NTIC' W5 K2 e+ ^- M: c& G) _. a+ Z
% l! N0 O7 [# ?1 h7 E/ J
-The most exotic ones (could be very slooooow :-(! N7 V6 q3 e3 X) z0 T
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') y$ }6 I$ A" `7 O2 X% m6 F% {! H% @
;will break 3 times :-( I3 a1 x1 P2 W& O; x
/ i$ e% r1 F+ T' i6 b9 j, X+ S, @
-or (a bit) faster: 6 L* e5 R; v8 U8 @
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 Y t4 s2 o4 u
6 |4 p) l3 `1 @5 a" ` BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, s% B2 l$ ` w/ R4 B8 ~1 M+ B9 a2 g1 S- j ;will break 3 times :-(
3 q: c6 w* o4 U, H. o2 ~9 F
/ \# `0 P( g/ ?6 |- M) c( u. M. ]- ^, X-Much faster:$ I2 n6 B+ W# E% |% t+ G
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 k5 ]% {- o2 V; Z, r5 u
. Z" }0 Y& r4 ~( JNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 }# h3 }9 L4 Q+ Gfunction to do the same job:5 G9 W6 g3 o3 \
& @5 I8 v! Q' u I R push 00 ; OF_READ
: m. @; v! D, i& B( ^( U mov eax,[00656634] ; '\\.\SICE',0' n! z/ S# {6 Q+ B; i) Q
push eax$ p' B' o* E+ \$ b
call KERNEL32!_lopen3 Q) p, O8 ~1 @) l: V, z! S
inc eax
; v7 v1 ~8 d# S+ |# ?7 E jnz 00650589 ; detected% q# i! G, N3 }# L3 v' W- i
push 00 ; OF_READ# U( |/ T( K! H* f7 J' {* f" F
mov eax,[00656638] ; '\\.\SICE'
# ~7 V1 c& X% X3 R* A push eax
! D. ] _1 P0 d/ g$ p call KERNEL32!_lopen, n/ w8 @# x. y; R( d8 D$ e& X$ ^- t# b
inc eax
/ h1 G) F4 r6 b! C jz 006505ae ; not detected& n( y8 N. r) c5 m, n7 @' i2 i
+ H4 z- Z+ ]* ]5 o6 |: _1 J
' |" L& y* X: Q__________________________________________________________________________
% d5 m0 v' x( l2 n6 ~
& I i! ^, d# t5 J: QMethod 12% T+ @, v5 l$ t- M# n, Q5 q1 d
=========8 B9 U9 X5 p( ^# y$ n
, m7 o$ }, X$ H5 KThis trick is similar to int41h/4fh Debugger installation check (code 055 ~% m0 u% } j
& 06) but very limited because it's only available for Win95/98 (not NT)+ w6 w: N, ]7 _
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 l7 L( d/ S y* R( Q/ f# M( `/ @6 N7 Z0 @, ?
push 0000004fh ; function 4fh
7 e9 l- U% Q6 R- O3 j3 A push 002a002ah ; high word specifies which VxD (VWIN32)7 v# u# u6 E0 j' w2 N: ]9 \( d0 E
; low word specifies which service2 Y% v+ T+ t8 o4 Q$ z
(VWIN32_Int41Dispatch)
/ P3 U$ U% a3 b" ~ call Kernel32!ORD_001 ; VxdCall# J+ A9 N8 g1 e. K$ A* H5 O" L
cmp ax, 0f386h ; magic number returned by system debuggers
' P$ c7 v$ N7 p& s jz SoftICE_detected
% @4 R9 E! C: V& F; F
3 W6 `6 Y4 ~1 r3 [5 z8 pHere again, several ways to detect it:
" F. ]. q% _4 f4 D$ e3 y9 c. A: Q
+ V# Q/ Q/ J$ ?& H8 P+ {1 X BPINT 41 if ax==4f% j( t) l7 ~# x1 E) d! s3 V
% e$ T3 r, U2 N1 G" T/ p+ b2 ^ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, {* B6 Z% u: R, T, F
1 z- m! Q/ `3 h' `, Y! j BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 u" G e1 C& f- O' g# e
7 A/ J) q0 W/ G- N7 R0 A L
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) E6 h+ c; p! [( w8 X& w
* {0 s8 f0 u, J; B, ^! T# S
__________________________________________________________________________7 f2 [, ^9 U7 u$ |
! h" R0 n4 D: ` L M1 d' v& J& E3 N' [Method 13
2 h# n* e5 B- r- O' y=========# h" ^3 M% i$ w' I: Q
- n+ }8 O9 ^" q5 w8 t: P% ]
Not a real method of detection, but a good way to know if SoftICE is; d+ e* B3 h3 \3 B) s
installed on a computer and to locate its installation directory.' c1 I' w/ X: P! V) {
It is used by few softs which access the following registry keys (usually #2) :, g7 g- h- [" Q* P/ c9 ~, ~2 R
; n. G5 u' b% D7 G8 N' Q" ]$ F
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 \0 p$ y p! X( L
\Uninstall\SoftICE: L' K/ f5 ~+ [9 b
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE& T+ C" T( e- i8 B x8 _
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 ?4 j# a! s5 `3 o% c\App Paths\Loader32.Exe5 f! a( V. ^& h1 o. v: h- Y8 u
! N6 Z4 M! B/ r1 o. G
# e4 _- y$ q% {4 J* r$ n6 lNote that some nasty apps could then erase all files from SoftICE directory. O5 L2 U3 v* `' n& V
(I faced that once :-(
* a3 u. a- i% t& |2 t# x' L9 G6 b% d/ i2 D
Useful breakpoint to detect it:' _/ Y |) \: ]4 O) M3 U" m& t e0 c
! ] F% h+ `& M" u2 I- w7 w: U BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
8 ~) Z9 R' K9 ^1 V8 o, W$ [" Z2 Y5 Y, n2 J8 l
__________________________________________________________________________
6 z* Z# r f( C h: G7 p* J0 ]0 W& i4 j
; F# h* g0 L8 _) E
Method 14 3 R& Q7 L9 X* b. I6 \
=========' s& {7 \. w! a% W0 m5 j
( r d+ s0 n# J4 m7 o* D
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 L, z" ^& h- fis to determines whether a debugger is running on your system (ring0 only).
- C7 I( z* d" P8 M% j0 t7 C) b5 U' E- E: u3 }
VMMCall Test_Debug_Installed, w& D1 e, g3 Q2 q% ?
je not_installed- B- o+ y4 \7 @7 s1 h6 e" R
0 O' c- R- E( `
This service just checks a flag.6 s! Z8 G% m7 p4 r7 r, q3 V
</PRE></TD></TR></TBODY></TABLE> |