<TABLE width=500>4 \7 R/ {$ i9 u; O& ]
<TBODY>
6 w3 ?$ ]/ s! G<TR>' G( G) u) M+ Q! B9 i) g; K: T3 B8 A
<TD><PRE>Method 01 & G% @' r* K0 ?# l" y
=========
7 q% ^1 x* S0 ^0 @
8 s. Z+ I- O0 l+ P* z* }# ~4 AThis method of detection of SoftICE (as well as the following one) is' U- |1 J! N* w) [, G0 S' C* e5 b
used by the majority of packers/encryptors found on Internet.6 E# o% U9 B* n! r, n9 g
It seeks the signature of BoundsChecker in SoftICE" \; b1 @3 X1 d2 J2 w7 N
3 P& S7 @% z4 o mov ebp, 04243484Bh ; 'BCHK'/ l/ E: E8 ^+ e. t+ M% q- O7 d4 y
mov ax, 04h( d6 h. X ^4 f- y- C A: Y
int 3
4 ~, \2 h0 z8 q' F: n cmp al,4
" P& ~- {+ k T! Z; H" O jnz SoftICE_Detected! e; o' o' X% F% a
6 J1 k5 N* F: n& Q1 f$ Z$ p___________________________________________________________________________9 z" b( j9 N# s5 l' y I. @. O0 S
$ h+ S. \1 h9 h8 Y* Z. RMethod 024 Z* b# }( N: H) z- o/ ^
=========: H9 Q7 \. p3 Q' V; O T
: a9 _* ?2 Z: R' @8 R
Still a method very much used (perhaps the most frequent one). It is used0 h6 c) x! j" b. V9 D
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ }% a4 P" H% d2 O4 N! S2 w
or execute SoftICE commands...
) L* P, {, I0 O& }; O# ]1 pIt is also used to crash SoftICE and to force it to execute any commands
4 t- C5 t. r4 Q9 K9 i( ^! f# O0 O(HBOOT...) :-(( 8 h( e' D! ` y; q1 L9 ]
4 L; y: F' o2 d$ ~% |, q' fHere is a quick description:- {: g3 |* J: w2 x* q! S% d
-AX = 0910h (Display string in SIce windows)
) g: {/ N' h! r0 f% v-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( I$ l/ ^/ Z4 x' @9 @
-AX = 0912h (Get breakpoint infos)
& y% n; I8 r! G1 M b$ I/ V-AX = 0913h (Set Sice breakpoints)+ }! w6 E) ~$ Y+ S2 S7 X
-AX = 0914h (Remove SIce breakoints)
+ ~/ u$ h. b9 |! X
, `, c! f! i v! G6 kEach time you'll meet this trick, you'll see:
4 J8 ]% b- L) ], n# ]% x-SI = 4647h( D# o d ^/ p2 [8 V+ n
-DI = 4A4Dh; W& T: f( j. }) g* K2 C1 [
Which are the 'magic values' used by SoftIce.
3 t" M: k& {5 l7 p+ @For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ p2 e/ z: U. l+ D# p
$ N$ j! p: P1 C) zHere is one example from the file "Haspinst.exe" which is the dongle HASP
1 i' _, X9 l: R- H oEnvelope utility use to protect DOS applications:& I7 E2 F# G' N( m2 r" n8 j
1 r: t5 C2 v) O8 |1 B# K0 U t1 t* c+ ^
4C19:0095 MOV AX,0911 ; execute command.6 x$ I8 q+ Y" N8 `$ S6 n- y! r
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)./ u+ O; \1 c7 g. Y. ^/ z
4C19:009A MOV SI,4647 ; 1st magic value.$ I7 }# H+ l$ h: z
4C19:009D MOV DI,4A4D ; 2nd magic value.
: ]% l/ r; {2 Y* g: v4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
) w& |" L4 k5 j; G% Y2 E% v4 V4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- }/ d- d6 [/ J7 l# d% }1 \, e4C19:00A4 INC CX( q# e3 M0 I5 _8 W+ H
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute* k7 @0 j8 g$ ^7 z' _. Q$ |* `* |- N
4C19:00A8 JB 0095 ; 6 different commands.9 H: W& C0 S" P& |1 C$ Q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
0 e+ [/ B8 n3 S. e5 m4C19:00AD MOV BX,SP ; Good_Guy go ahead :)6 A$ \6 l r8 j" [$ a" t7 `9 k4 a% n
2 _2 u! K2 Y0 c
The program will execute 6 different SIce commands located at ds:dx, which
' ?% V& _3 o7 aare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 I5 O0 K1 Y0 [7 C$ d2 ]9 N
* S ~0 W7 }6 g6 V) d; Y1 G
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
. [2 a4 v# ]1 z+ R___________________________________________________________________________
) H1 d- B* k, B+ y2 g0 x
$ \1 t7 y7 l |$ n$ I9 ]% K; F
8 \- d F6 N1 U8 I C1 UMethod 03
7 J' Y$ ~ r# J) K3 Z1 |$ s6 L=========
( e" Y7 \$ k0 T' X% E- m/ ?- ]) X
: M; u% s. d& k/ t" s8 _$ KLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! U0 q% ]+ e6 s1 F/ h# X' h M/ ]/ i
(API Get entry point)
2 d3 K# |" ]8 \ h c# l- T
4 \) s0 S( h8 |' ~7 i' k9 f5 a8 z, W+ T
xor di,di$ \' Z& Y6 E7 a* \, X3 n& Y/ K1 K
mov es,di" c5 D. S* l( b
mov ax, 1684h
* \' N9 {: t! A$ u+ C1 K* p mov bx, 0202h ; VxD ID of winice: s' h! @4 \1 o3 i' X4 q" e
int 2Fh. ? Q% ]# q- }; o
mov ax, es ; ES:DI -> VxD API entry point/ N6 a% m2 `( [8 t' ?
add ax, di
: \, b7 s2 L; P, c, V test ax,ax
5 ?1 P+ k0 O8 X+ h0 H. W jnz SoftICE_Detected
; D% p; H7 _! R& L8 R& N H) y H3 g. G. ?
___________________________________________________________________________
8 q; S* y" }. ~, i2 Y3 T$ g, {* J3 K/ _' C' L
Method 04
& q; V- V6 l: X8 Y* j5 {) I=========
! B# t4 P+ ~) r- \% F; T6 U4 K- j
; T+ y: P7 I- p3 C# \( yMethod identical to the preceding one except that it seeks the ID of SoftICE
7 G: X( _ M$ |GFX VxD.
2 ~7 _8 |* ]1 |! z' V- L4 ~; {/ @" r j6 _+ G; }8 g3 F; F9 h5 S7 {
xor di,di
" Y% u9 v/ H3 M6 c# P mov es,di# ~* {/ m8 I% K! T/ W
mov ax, 1684h
+ v& B2 s5 p7 f+ n1 @ mov bx, 7a5Fh ; VxD ID of SIWVID7 X; N! E6 h4 e1 [8 N8 M# J$ Z
int 2fh
' ] u9 `3 c, k3 I mov ax, es ; ES:DI -> VxD API entry point
- e( x7 Z6 O& T2 d, H1 O add ax, di% b4 S9 Y" z; q9 w) M& v) K
test ax,ax
1 G- E) s$ |4 ^, g7 B3 l' X jnz SoftICE_Detected
0 ^1 ]- p2 N8 m1 y4 o! A6 A8 _# Y
8 T) k: i, R- \( a, [3 \__________________________________________________________________________
& r% m+ V3 J' H, t6 z+ B9 H& C* T' j" r/ ?
- J" ]- m4 H5 S6 ~1 c; ?" a
Method 05" b" A' V5 ^. k6 x$ _
=========
1 ~, D) L7 Y, @+ u4 m" m( ]! L/ J# f# }: W3 E) N
Method seeking the 'magic number' 0F386h returned (in ax) by all system
3 a( a0 e" [ z+ A+ Udebugger. It calls the int 41h, function 4Fh.4 P. \) p6 j6 k7 ~6 l( U' ?: v# B6 A
There are several alternatives. 8 J9 ^$ Z# ?' R0 {1 P9 c
: v2 c: h' V( G, K3 q/ W9 o/ L
The following one is the simplest:$ c. S8 ~* U5 [6 `3 W1 X6 a8 L
. h; }* ]% L0 l. A: p4 I) R mov ax,4fh( x# Z7 W I1 p9 M( d: v
int 41h
& |3 `9 N3 o5 ^+ x1 p6 ]9 Z cmp ax, 0F386
0 _0 x$ s1 n) q7 o; F, M5 R; z jz SoftICE_detected& c Q1 r% n, U$ T5 j. W
: }! k) w4 r- M' ?- k: F/ D
5 `5 E% M6 q# YNext method as well as the following one are 2 examples from Stone's - _) Q2 K/ }/ ^. ?# E: U
"stn-wid.zip" (www.cracking.net):
( Q. q9 R q0 Q' A9 n
' G3 h' W# w0 f! A) D. F. i mov bx, cs9 ?3 [$ M$ Y. S& i) u
lea dx, int41handler2
# ~/ S- q0 [- ^7 @3 u' X xchg dx, es:[41h*4]
e3 R5 U7 l( ?. l# W# n6 n2 E xchg bx, es:[41h*4+2]
# O) t6 Y$ R2 a, b8 A7 V mov ax,4fh; Z: ~1 U+ ~2 b+ N+ x% ?2 M& l
int 41h
/ x& f E& ?) `% L# ~3 r xchg dx, es:[41h*4]
: [6 S9 j4 m5 \9 ~% h7 i+ R xchg bx, es:[41h*4+2]
7 ]( |" R1 M: \- z+ o% y cmp ax, 0f386h5 D% {+ d1 ~, n/ h1 q
jz SoftICE_detected
9 u( ?% f# j$ w! x9 Y% y u( Z- U" y+ l8 w
int41handler2 PROC+ X0 |/ ~: o1 b( K
iret
) o. g7 S! [. D0 M6 l3 s& d1 |5 lint41handler2 ENDP* M" m; q; o. V
% z% m e# L1 k' `; O
% f1 U( H E. r n E) u6 Z' \4 i6 l_________________________________________________________________________: y. v# D7 |% G
3 h. V3 `# W! s' j" R% x6 l8 h, H
0 h3 h- e- e9 o+ Y2 b9 n: ?Method 06
/ x* @* @/ n" }* x3 Q( Q# V=========) {$ m1 Y- L3 ^# t9 I" z
" C3 w# W' P& z7 q- O' P4 }/ V! x0 v1 K2 o7 ` l
2nd method similar to the preceding one but more difficult to detect:* Y q9 P3 s3 D+ t& s) D5 m6 p
8 s5 a3 @( R7 o$ A: s' z1 m* l
8 s5 R# `& Y0 c8 Kint41handler PROC
9 z/ F5 q0 f7 J7 I4 |' q" i mov cl,al# Z9 ^9 z+ r7 u" W7 h
iret
: q3 Y4 T7 c( r6 s$ {8 L @9 _8 e) tint41handler ENDP
+ Q& v+ g% }8 d9 [
7 K0 p, m7 Y- ^- w% `) p* h# k- b, L/ ]% v( L7 u% i' z
xor ax,ax
, {5 l# e9 z% N9 X mov es,ax I; f; p! Q3 N4 Q! j D: m, _8 O
mov bx, cs
4 r# G4 D* `" I lea dx, int41handler2 ?4 L9 s( |/ T6 u
xchg dx, es:[41h*4]
1 M6 c6 q% Q7 d0 G7 P6 h xchg bx, es:[41h*4+2]8 J7 X2 G: n) z7 p! U r
in al, 40h5 _: o: [" a8 \ J+ c! X# ?
xor cx,cx
, K- j2 q0 d2 v0 W int 41h, e9 [$ [/ Z4 I0 Z; S* L6 v
xchg dx, es:[41h*4]$ ~2 \0 H' h: j& [
xchg bx, es:[41h*4+2]
- q( ^" p! e/ p( p cmp cl,al
* i- C1 Y0 z, ~5 I jnz SoftICE_detected U$ B0 c. a3 n! I5 m+ p
- G. h- P, o/ U
_________________________________________________________________________
\8 x) }5 Y# \% ^
- r6 r; }, Q4 g" C) `& r( Y/ CMethod 07
/ ?1 s& u8 C; I& \=========
7 C8 a0 y) m- }
7 m0 r3 w9 T" ^2 F" h/ p' fMethod of detection of the WinICE handler in the int68h (V86)
! W$ r( S) q$ T' o+ P# S* b2 k% d; A7 f9 i* z+ M8 @* V
mov ah,43h
! f/ }9 Q0 J* ]' E8 h: `5 b+ q int 68h X/ D8 m1 h+ P+ X7 D' k- b
cmp ax,0F386h: e% i+ i" u Z( w; R. U' d' O& K9 D
jz SoftICE_Detected' W5 j# g: a. J7 A% c- h
0 D, q2 c0 U$ f& s2 I6 M
5 F3 U: r; Z2 p=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 ]) R4 Q/ T: w/ _ {9 U
app like this:
" d: _ J& X, ^7 d6 H9 S/ @- W" K5 v' x6 q' g: o; v
BPX exec_int if ax==68
7 w* [ u; `) z2 D" S9 J) M; @+ }: N" t (function called is located at byte ptr [ebp+1Dh] and client eip is! b/ A/ M' G7 H) [+ Y( `
located at [ebp+48h] for 32Bit apps)* w3 c% i# f+ }" x6 `+ X" z' _
__________________________________________________________________________
2 W& c' i. G* n) C% }0 z+ ]) `9 Y. C4 U
9 X/ Q- o" w- w% ^; A
Method 08# j- m7 M {) j2 u' H8 C9 Y" @0 x
=========
( R8 P; s6 j( R0 Q7 i8 p' ]; G: P% a$ ?0 i
It is not a method of detection of SoftICE but a possibility to crash the
/ I" p' X2 M+ J* g; G# [% A: s. Wsystem by intercepting int 01h and int 03h and redirecting them to another Q" }8 {0 x$ Y, ~& A
routine.- Y+ ]5 D6 ?7 z$ a
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 `9 I G& Z' `0 J: ^0 ato the new routine to execute (hangs computer...)
1 c; l3 \- h" r" j# \/ W8 h
% m$ J3 U( L2 Q" H! w% A mov ah, 25h; R1 e# L$ u% v8 q- ~
mov al, Int_Number (01h or 03h) f* T' D/ E9 p" t1 n
mov dx, offset New_Int_Routine
7 l3 I2 L- g/ H, U- O/ L* B int 21h7 j+ h' W l P# `9 O3 G1 }% t" |
5 N* b. I/ J+ T0 K! a! F3 E Y__________________________________________________________________________) D# s0 i& {$ q) j# |
/ t, }' e8 j- x' S
Method 096 i+ f+ t; O" B' w
=========5 [: Z. p$ Q1 A* B( X
8 }2 z+ y1 G; ^3 l8 f) `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 R" A8 f6 C' [* B# x! H- Zperformed in ring0 (VxD or a ring3 app using the VxdCall).
( K& p. Y3 L# c; Z$ ~ M& [The Get_DDB service is used to determine whether or not a VxD is installed' ?& y4 a% s& }- V& t9 O& m; X
for the specified device and returns a Device Description Block (in ecx) for
$ G5 Z: Q5 q5 i% L* X3 dthat device if it is installed.
+ w. Z2 f0 f; r: v6 @0 ?0 m4 t( }6 E& A) T5 N" Q
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
Q$ R3 `3 I9 g9 d8 V" d mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 M2 d1 L. u6 C8 B0 W VMMCall Get_DDB3 }. H! f4 D( R* H+ A) `& P
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed# ?/ z1 E$ b/ U, l9 R, H4 N
% E7 c6 Z ^# C3 y- \6 P% Y& K
Note as well that you can easily detect this method with SoftICE:. e: P+ D K) _5 {" I- Y
bpx Get_DDB if ax==0202 || ax==7a5fh
/ \7 _+ e2 ~' d" P: r& Y- ~
1 }/ y, g7 y" `( M' {# Q9 g__________________________________________________________________________ }: ^1 x6 V3 T. _
# y% t9 S) u9 ^+ G: o; u& _; k% @Method 10$ Z9 x1 m2 L+ r5 y) q9 S6 O. i. h( Z
=========
# c" f8 P6 @/ V' p8 o/ }, C
5 z8 g0 E( i6 I( Q=>Disable or clear breakpoints before using this feature. DO NOT trace with* y6 \, _+ V# d
SoftICE while the option is enable!!
0 C3 z3 i8 i% T* Y" y
8 v3 K( ]# s. x: ?This trick is very efficient:
, }0 F* E* w- x+ R3 Cby checking the Debug Registers, you can detect if SoftICE is loaded
O1 |$ p6 L" l(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& Z9 g- @) J" S! Rthere are some memory breakpoints set (dr0 to dr3) simply by reading their! D' F7 v# ~6 F
value (in ring0 only). Values can be manipulated and or changed as well
9 ?& q. I5 J4 y% F(clearing BPMs for instance)
8 J& Y! C: M; e% A" a: H/ c
& s+ v$ A* r1 d# Z4 \# K__________________________________________________________________________1 T+ v; d) w8 R7 w; W) m
0 d/ q# ^: B1 U" r; F7 kMethod 11, I; b5 ^ z( G
=========; k6 }4 H4 Z1 j0 h
: q( }+ u0 N1 s. O+ h5 U2 fThis method is most known as 'MeltICE' because it has been freely distributed% o# ]6 O0 B, G. g
via www.winfiles.com. However it was first used by NuMega people to allow/ I/ S0 N0 Z1 H) K7 f0 j
Symbol Loader to check if SoftICE was active or not (the code is located+ C& y5 D* p$ O- [
inside nmtrans.dll).
4 w/ |: y' a) m3 `9 V4 l- |; e
6 Z2 A4 T, d% N+ {- U3 eThe way it works is very simple:' F* U8 m! F& f
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ U' k, u/ k' U2 y
WinNT) with the CreateFileA API.% P8 q. M p( Y
% K1 C' @! c% i/ [% V
Here is a sample (checking for 'SICE'):
/ Z) q1 }9 b, l( F1 L* Z* W9 R1 X# v V: L
BOOL IsSoftIce95Loaded()0 E7 \1 Z% n; j- m1 U% e
{' B9 d) T7 d3 a# e# A
HANDLE hFile;
1 J# B* ^) z8 t hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 S4 B( S: ^! x+ F n+ k FILE_SHARE_READ | FILE_SHARE_WRITE,. |; r2 W. M/ {* F4 s+ W' g0 _
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( B$ w9 s1 Y9 J( k1 `" o, `' o" ~* Q {
if( hFile != INVALID_HANDLE_VALUE )$ P% n1 C6 t$ a* G& x( Y8 s
{# F9 p6 _6 t7 r1 P' E
CloseHandle(hFile);0 Y1 z. ?7 B+ l! {
return TRUE;5 J' C0 J/ i, c0 x% o2 g+ k
}
( k. k( t/ R, l* m return FALSE;
; n4 K3 _9 @/ |/ r! p# J9 Y}
@$ R* \3 P) [1 {
; A3 @* h0 i' ?+ k- [7 {, ]Although this trick calls the CreateFileA function, don't even expect to be A5 p( ~' @6 [7 w3 B' p+ s
able to intercept it by installing a IFS hook: it will not work, no way!& U) F7 U! ^, n1 {+ A& f; V
In fact, after the call to CreateFileA it will get through VWIN32 0x001F% F( \- o5 k, O$ Q8 O" A9 ?" ^0 r# Q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: l: [% e% g, @# L; O- A' f! yand then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 H0 T" E: v' d) |4 R- Pfield.$ M8 ^9 N4 e, G* C
In fact, its purpose is not to load/unload VxDs but only to send a 8 O: i. F5 k9 H) L2 J/ t
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" J q/ ]9 h9 N3 A' L2 l; v b
to the VxD Control_Dispatch proc (how the hell a shareware soft could try( L- @3 I2 ]) q1 l+ Y0 s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
) S& q1 N# ^* p0 G, YIf the VxD is loaded, it will always clear eax and the Carry flag to allow
! j8 h" ~+ D6 t+ P6 fits handle to be opened and then, will be detected.
U8 a: G2 s. t! c& o' t) x( d0 XYou can check that simply by hooking Winice.exe control proc entry point$ N- @* b/ D( o+ \3 S
while running MeltICE. Z) n3 L V7 w
0 I+ K5 c, x4 @* T0 W& C7 N }
0 `4 v$ t/ L* C! g& J5 H
00401067: push 00402025 ; \\.\SICE
) c1 j% e/ ^; i) c5 J% X K 0040106C: call CreateFileA
, D& H# J' o- \ 00401071: cmp eax,-001
% c3 u( v$ W2 G* n" G0 Y 00401074: je 00401091
6 V/ ^( c( S" x) x& }9 V( |2 X+ [ k& [1 c
3 U% M r4 b# r t# ?3 ~" g" _There could be hundreds of BPX you could use to detect this trick.0 r/ l! ?* V" V# p* ~
-The most classical one is:
0 k( P( N$ B- K6 {: j5 @% |$ Y# l BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||% ]& s- T$ x6 P, `; y- }
*(esp->4+4)=='NTIC'
7 B! m+ x$ u1 l/ a% q3 |/ m3 z* ~% H+ a. I
-The most exotic ones (could be very slooooow :-(
/ @5 H; I: L* o) f% T BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
W- K+ q' w/ _6 M ;will break 3 times :-() x% q4 J! V/ [' D$ w
) O3 y9 L7 r8 A$ v-or (a bit) faster: % S# b/ y- \ f9 K- m
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% D" P) ?. H1 [8 F% r) I8 O
0 F' m, i6 @! F2 y% C" m
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : p+ v8 q7 {/ `& d1 T' R
;will break 3 times :-(
2 c0 S. ~5 |$ i- r# c) ^+ s5 V) h. a' n" X% f- K( ~
-Much faster:
% O+ U, e2 X* j5 s$ w BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 Q0 T7 m* }% J1 O$ v; U1 }4 o
7 N8 P0 J5 ]4 [$ R1 tNote also that some programs (like AZPR3.00) use de old 16-bit _lopen( n& ], S- Q$ ~$ l) z
function to do the same job:
1 A- B4 P+ T" {# b! W4 |. x+ i4 k2 U+ y4 J
push 00 ; OF_READ& m" v$ j* R( O5 F5 q$ L( t
mov eax,[00656634] ; '\\.\SICE',0
( l* \+ M; E [ V. {; u push eax
4 V: s# f O: _5 n call KERNEL32!_lopen
) i- t7 a1 J! L* d* X inc eax
6 C6 _# x0 n6 b- e' P9 B9 N4 Z0 E jnz 00650589 ; detected
& a; G8 Y1 R% J0 s- {$ ~ push 00 ; OF_READ& \) \, u$ P/ ?" g7 q; q7 b8 d
mov eax,[00656638] ; '\\.\SICE'
& ~/ m! |% H' u7 R push eax
1 ^9 b/ h& \: ? call KERNEL32!_lopen! K% x" F9 e2 c
inc eax5 e# b/ \# w) K5 {6 m
jz 006505ae ; not detected; L$ \8 K- o4 V3 t; c- @
* a) Z1 G: D3 F5 Y2 J) d
9 J& J( G5 n8 `8 c, r__________________________________________________________________________
$ h7 W% H2 ]" c* `
* P5 T9 d/ l$ e2 n3 ZMethod 123 f I- @0 U0 Y1 g: X( T
=========' K8 n$ p6 c, ^8 r: H
2 u3 N9 t0 R( h0 o8 C: x! qThis trick is similar to int41h/4fh Debugger installation check (code 05/ `5 L: ?+ f" W- J7 Z
& 06) but very limited because it's only available for Win95/98 (not NT)5 z4 L. |: \ {9 R* F: C" V
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 ?2 i% Q' ~+ |
- n: y- J1 ]0 F5 c3 ^6 s! C2 y- o
push 0000004fh ; function 4fh5 C" u; ]" J9 G! j4 c2 \' V
push 002a002ah ; high word specifies which VxD (VWIN32)
4 h. v* U+ S' R& a ; low word specifies which service k L$ ~- k$ Z. g' V1 q
(VWIN32_Int41Dispatch)
& M! V6 _/ u2 ?+ z" G3 @ call Kernel32!ORD_001 ; VxdCall! D' i. F# B5 A- p
cmp ax, 0f386h ; magic number returned by system debuggers
' j! @; t) K8 X# \% ?$ M, O/ t jz SoftICE_detected
|8 P3 b* r3 W* J- @3 D: d; Z! ?: P* J* {) D$ F
Here again, several ways to detect it:
' W% R, V/ B4 u5 d' |0 l9 u* x( b7 s- {- |) e# G( F, {
BPINT 41 if ax==4f' I$ Y. M% E0 Q6 x: n* l& ~: z2 ^
, w( ?: ~" D4 ^& w+ L
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
9 Z1 k+ `; U& ^
7 Z- C# Z$ U* S8 x2 N BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A1 Y3 n7 q4 @# d! O3 \! F
3 w. ~. e/ E Q
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow! G; \ ~2 T; ]! ^) }' t0 S
2 [* p7 @8 V q& K4 _/ ?9 o& }
__________________________________________________________________________
! M+ q% v A; o+ B* O1 ~& E) G2 y' K) u/ O1 {. F$ H
Method 134 s4 b% Y4 o3 `' ^7 s! E( c
=========+ X8 E6 \% I8 t6 G
. b$ h2 _1 h8 j# @9 ^2 dNot a real method of detection, but a good way to know if SoftICE is5 @6 \ f, A) r# a3 @% l
installed on a computer and to locate its installation directory.& o2 n* O+ ?2 y7 D p
It is used by few softs which access the following registry keys (usually #2) :
6 ~2 |& z/ F1 k/ `
/ s% e6 l8 ?; h" K' t1 A {' Z/ s-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: q5 Z1 ?5 x& ^2 N; |+ Z1 V3 O) E\Uninstall\SoftICE
/ b4 C3 v3 w$ f: z-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" l2 y- v" F' y2 W' G5 Z- o/ o& A2 p+ v
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% q' ^4 p+ j$ j! T\App Paths\Loader32.Exe8 j6 q, ~( }/ B( d5 f/ \4 }2 p
. _3 |; Y9 ] E9 s/ b2 o; j! I$ d2 L% ?( K ?/ h
Note that some nasty apps could then erase all files from SoftICE directory
, c: N2 \* a6 B! F(I faced that once :-(9 |9 j, U( t4 N- C1 ~
J, i' y( k1 d" L0 l" J: ~; aUseful breakpoint to detect it:
: L! |* |+ D% o9 M1 D* j9 C
# [, N0 ?( s+ B& q1 Z BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'" I; `0 \ j; x5 J3 V! {" j
# R% v' Z6 q: V1 u
__________________________________________________________________________5 u9 l% g' m% @) U0 z
: V/ J) K' W3 |$ N& ^2 _+ h% M; v
/ y( b: i9 U" J# eMethod 14 6 Y, f4 ?5 l7 z9 k/ a% Z7 {
=========5 y1 G9 u8 n0 y9 g S3 ]( o
* G) V# g. s" T, ]/ I4 _
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 c; _1 {" n7 T, F( ]' i& n
is to determines whether a debugger is running on your system (ring0 only).* j- a& L# g$ x/ U1 I' y7 |/ |
- I% W) Z# P2 x* z& N4 m8 U+ w: @
VMMCall Test_Debug_Installed
8 N; s Y, Z) q0 I* z: j$ E9 _& ` je not_installed
& H7 W8 v1 q# A& L
: P: |; E/ q4 V" a" c5 U5 [* RThis service just checks a flag.
6 H; T* ]. n3 i: [6 {</PRE></TD></TR></TBODY></TABLE> |