<TABLE width=500>, S( a( P" ]1 C& M
<TBODY>
; w A: i' A" }3 `! x5 G<TR>; z1 N, b+ s# q2 j% L) |
<TD><PRE>Method 01
0 P" m# G8 ?$ p- C" @=========
$ U& M4 ^, l; G, D. O, P4 O; v9 E$ N+ {! }% N
This method of detection of SoftICE (as well as the following one) is% }: `8 o( L; E* J$ ]
used by the majority of packers/encryptors found on Internet. E% K- A2 I5 e! ` d
It seeks the signature of BoundsChecker in SoftICE
: o6 ?/ L- j3 C# H$ O1 K* S( V$ k Q8 _7 z8 z6 E( }
mov ebp, 04243484Bh ; 'BCHK'9 x/ s. e: ^0 P n; Q
mov ax, 04h
& M- g& C4 T1 L0 P q int 3 & q* u7 y& C' _( ^; T- |: F
cmp al,4
! C3 C: _) O! A, ? jnz SoftICE_Detected( S/ I3 y4 y* ]! k
& _8 X) l( U* q6 c. G2 t* ]$ [8 }
___________________________________________________________________________
4 A" @( F' `8 A
8 x" i6 L9 L% p4 y, G( eMethod 02
W5 {# R3 s5 @- y0 r=========* ~2 a* r9 k8 W! Y# C# k2 T7 H4 _
$ q$ _8 k6 z V& v2 [
Still a method very much used (perhaps the most frequent one). It is used. z5 T# c( O# d2 H" Q+ I) Z/ a6 E
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 f" l( i/ u5 i2 u1 y
or execute SoftICE commands...
3 K$ f+ x4 c; uIt is also used to crash SoftICE and to force it to execute any commands, T) R/ p# I) Z* P! O
(HBOOT...) :-(( , t. F- Z7 L/ i4 d }& M
" n- i1 C9 D: ~, ~. tHere is a quick description:0 R- x& R9 t- c- Y& h: H$ y9 g2 ?0 K- c
-AX = 0910h (Display string in SIce windows)
) {) ?" Q i1 D/ \-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( `, c8 {4 \9 }& W! d% r
-AX = 0912h (Get breakpoint infos)
( v' }/ @* T# K8 x( k+ B-AX = 0913h (Set Sice breakpoints)+ f; Z1 ]; N6 }" j1 m
-AX = 0914h (Remove SIce breakoints)
! Y" P% ~. [8 |7 a$ ~ ^: ]9 D; s2 Z, G6 _) u3 _# P
Each time you'll meet this trick, you'll see:. f2 }- p0 W: W; f( i
-SI = 4647h
1 ^/ c: v8 N$ P7 _-DI = 4A4Dh# S) d" I! x; ?4 o0 r; e
Which are the 'magic values' used by SoftIce.
+ z& f0 `. n3 ~# b, f$ y( KFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.: Q( O( W& r, l8 k2 z! ?. D
1 i3 s- V, I2 z: ~+ w7 yHere is one example from the file "Haspinst.exe" which is the dongle HASP
1 I! m. A" q* N( j8 n# X9 qEnvelope utility use to protect DOS applications:0 B9 t& u. ^, Y6 f
* G; Y! @* i# @( T1 A2 c2 _8 F
+ D2 a, h3 G ]- l4C19:0095 MOV AX,0911 ; execute command.5 E) J# {+ m. R2 h8 l
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., A0 X5 h; s: M5 w- ?6 \
4C19:009A MOV SI,4647 ; 1st magic value.
6 E0 i H2 O6 m5 o& G4C19:009D MOV DI,4A4D ; 2nd magic value.: d3 h, D2 {! i$ i" Z/ [; C
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
! ]) `& J% Q6 }! J4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
; Y1 z& H4 v/ Q& _4C19:00A4 INC CX Q ^ c. f0 L+ b. a
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute! L4 Q9 e. c C: `( u) F2 q. q" h
4C19:00A8 JB 0095 ; 6 different commands.
' `4 S2 _3 B! {7 P4C19:00AA JMP 0002 ; Bad_Guy jmp back.; w- m& o6 t2 G' L
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. u' L8 M, n( l; Q R0 _1 g, F. S1 O" _. q1 ~# _2 x
The program will execute 6 different SIce commands located at ds:dx, which
2 @ N! z, H3 y! C) Dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 l, |% ^9 ~6 b8 Z
* _7 `- X. I1 k+ @4 I
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ C, h5 Q! T, g% y# ?$ v___________________________________________________________________________
/ q+ e& L' V$ ` J* ^/ Y9 u, g! P, g% k
- _; d. E+ O$ D3 u* k. a' gMethod 035 S& s- ~/ @! i2 b2 C/ _& a, ]
=========" k$ Q U8 L7 A {9 ]1 x a* K( O
; i% H& @* [. fLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 f: {8 t( g9 v
(API Get entry point)
& A$ \: z! z7 \0 j1 Q6 p% g5 `
- a/ f! u/ o1 ]) c: Y" C* c& S' ]1 t( r$ t2 ^2 O6 U) m- J
xor di,di
' Q% E4 C9 e7 y. b. ]6 Y: h mov es,di
$ y5 D2 T9 [+ y/ s: t: ?) e! R mov ax, 1684h
% O# z$ [* w6 h! b& X# P mov bx, 0202h ; VxD ID of winice# |6 V& t$ J) {! Y
int 2Fh
, v7 H+ d# c0 J1 K, N. W mov ax, es ; ES:DI -> VxD API entry point4 G& p9 W$ x/ B. g" t. V
add ax, di/ ]/ c# m) P8 E% e$ y
test ax,ax) R4 ~8 H/ Y. {6 Z# `* Y1 \* B
jnz SoftICE_Detected
7 D' [ j) \3 D# S& i7 e6 M5 @: l$ L
___________________________________________________________________________) v8 v Q% `' B$ H8 u: ?4 C
6 v& [; I1 r0 ?. I+ X/ L5 U+ CMethod 04
! f; w* o7 H) u/ p5 I=========
& z$ [( L+ o. w3 O% A+ P. L# E4 r5 {
Method identical to the preceding one except that it seeks the ID of SoftICE
1 @5 p: `1 E2 q* u% w2 r0 t6 S. WGFX VxD.0 u. K9 U* [( @& Q2 N7 F
! y. n2 c1 ~8 z$ f7 s3 n3 f xor di,di
, Q6 N2 g: \$ [3 a3 K% f2 b! ] mov es,di/ }$ e2 C3 U5 ^+ t% E
mov ax, 1684h
4 [5 | b) l: {; h mov bx, 7a5Fh ; VxD ID of SIWVID
. z1 Z* ]0 ]' ?3 E T int 2fh: l& S7 Y& h6 n6 y& q; K
mov ax, es ; ES:DI -> VxD API entry point5 E# ]$ S" X( C X B" E
add ax, di) z' x6 N- n- K6 k, i* n, I; g h
test ax,ax- \% Y u {& o
jnz SoftICE_Detected
( K3 p# _# J: d7 m% j3 c+ I' A" |/ a2 x$ c4 z- i, N* Z) ^, E! A
__________________________________________________________________________
C/ |9 s5 u1 |0 q% Q/ @- W
$ q3 |5 s9 |# o" E& H) R' P. ^/ ]6 h( s! G7 o7 B$ d
Method 05' g3 q0 ]0 F, x1 v7 m
=========0 h- |- g' c4 F- E
2 h. N1 @3 J4 x6 d$ o* xMethod seeking the 'magic number' 0F386h returned (in ax) by all system
2 N+ b* K+ N% R( Bdebugger. It calls the int 41h, function 4Fh.
2 d+ Q; J- D' B* p- t2 z4 DThere are several alternatives.
5 e/ H( v: d6 i9 p+ p* |
+ J* X# O- V7 S+ @$ mThe following one is the simplest:
' G; p3 p+ n9 E* y O/ O) s8 R
- p9 J% P5 X' v( ^8 M/ u mov ax,4fh) Y l% w3 K" z$ K
int 41h
+ P" e# N1 D4 X+ V" s$ J& f9 i cmp ax, 0F386# L5 [4 \9 z6 M( t( E! e
jz SoftICE_detected
0 A# Z: ?: r5 O: C# G0 C o" W9 _9 O9 _
6 l& {; @$ A$ }( \: D
Next method as well as the following one are 2 examples from Stone's ! [# w# E( O2 |: S9 ?* I" M
"stn-wid.zip" (www.cracking.net):! L# j3 b8 M" ?$ T
! k. {$ O: q2 z& y0 Z) e* z mov bx, cs
' O& Z r, u$ q9 ^ M( B! `6 T6 J lea dx, int41handler2
0 ^! E0 C7 |2 n. V# J xchg dx, es:[41h*4]
4 n: k1 _' t6 P7 u xchg bx, es:[41h*4+2]) D4 s- `2 ]$ v! W& J* T$ B/ v5 B
mov ax,4fh
* S2 I2 z$ C- \ int 41h: [' x' c3 v% { ^/ X
xchg dx, es:[41h*4]* C2 L$ }4 x9 h4 y
xchg bx, es:[41h*4+2]
4 j; A6 L5 h: o6 J# w9 x5 N6 M cmp ax, 0f386h; r: _! o5 }3 b0 u8 v' k
jz SoftICE_detected
, u9 C' F( ?0 \! Q9 K k
* ~; ]1 g% Z( h+ U9 Y3 qint41handler2 PROC+ c$ ]! `! R1 b8 K3 ^! m* N
iret
4 s1 z5 e6 h: L1 v/ mint41handler2 ENDP) f I- Y0 x# ^5 f/ m! r
}: @; A/ y5 o/ c* j4 t
9 h+ s% W/ d* u# Y_________________________________________________________________________& N1 c0 o0 V B- g8 A
# I" H" k: M7 y4 L. l
: ?! J9 M' q3 h6 J4 @3 ]4 t. {Method 064 _) q& f/ _: _ Y5 f! A+ U
=========( i" q) d6 J3 }! k4 E
0 r1 j& U7 o3 W O- N$ m$ P" z3 m. }2 g, N
; F$ G# @6 v% b* Z& |- J. c9 N: ~2nd method similar to the preceding one but more difficult to detect:8 L# o* _' q, U# V4 z9 t
$ U& ~5 `, D/ c% Y' d' B; M; j5 ?# T4 w& g
int41handler PROC K+ H& e x: ]7 ~
mov cl,al. y" u7 Q4 K* G/ I
iret
% Q) ?2 h" P# _2 zint41handler ENDP
3 B2 Q; E( u- T4 |& V$ g. P F: P9 |: Z& G
4 Y [ N& W7 }) R5 e& c7 u# C$ v
xor ax,ax
: I% ?5 @9 N, d; T s4 T mov es,ax
; X0 N+ \9 O( y mov bx, cs% u y2 T3 O- i
lea dx, int41handler; t' C$ t7 C8 ~$ r) A/ ?* s% S
xchg dx, es:[41h*4]: O& M3 ]: u" K) y3 j
xchg bx, es:[41h*4+2]& m/ h7 ]) v$ J7 \0 m6 E" ?
in al, 40h
/ b8 b9 \1 O. `; F! ]' e xor cx,cx
3 S9 h- y, G5 E' Z' f int 41h
7 Z: g( }7 T5 ?* j! { xchg dx, es:[41h*4]
* ~9 E& A. B4 H: Q# J. F8 n* S xchg bx, es:[41h*4+2]. V9 P9 ^# _; L3 C3 Q. F# J2 ^; ~
cmp cl,al
* ~9 k6 S: v( i( X jnz SoftICE_detected
( n* ?4 S7 O/ _, `- Z8 r* F% ]$ Z. t, g0 Y
_________________________________________________________________________0 x9 s1 `% r, Q, [0 {9 S# H9 }, q x
# [. n4 f% X' D/ J* x% H
Method 07
) L9 t1 i! D9 s; O=========6 u3 y/ N. Y( f, \# [, n" l- s
3 I/ e1 g* x% g! G7 w' UMethod of detection of the WinICE handler in the int68h (V86)5 |6 Q( j. j; S7 k4 {4 Z
. D8 n7 r% I: w" v3 r
mov ah,43h
) f4 E& O; G6 T; }# T, t I0 G int 68h
1 R* ?. h* c6 V4 ]+ A cmp ax,0F386h9 U1 o, ^$ v; V9 J, o
jz SoftICE_Detected7 x4 w6 e" u8 N; I' M5 ]
. n- l3 u& q! I. N: a3 @. P
' D" s5 f6 i' n! R. v2 @=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit) b1 F/ E! L6 N5 k7 @
app like this:/ o2 I3 d" }2 K# V+ G+ c0 x# ]
) |9 q5 u5 r { H' h- o BPX exec_int if ax==68
/ N3 t w' o$ Z (function called is located at byte ptr [ebp+1Dh] and client eip is2 c) t' R' V' e( |+ D$ J+ Y
located at [ebp+48h] for 32Bit apps)
( p, R/ C3 u8 }2 @3 w$ P, y. x__________________________________________________________________________+ S+ H( z; g' \- {
: H4 R7 N8 u; [9 p; y5 I' _' l _. M* x" d
Method 08
8 p/ u5 m7 y( r( G* @0 {=========/ h2 Y7 L1 K1 H6 q' C4 K) \' o; b
: @9 e& D8 A; I' |* A% NIt is not a method of detection of SoftICE but a possibility to crash the" z% c% ?/ H1 ]; T9 b
system by intercepting int 01h and int 03h and redirecting them to another
* S/ x, W. p- _! O, Oroutine.( c" v" T, W1 i% D$ i
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 o/ ]1 N8 W0 Gto the new routine to execute (hangs computer...)* X6 M" H: \/ X6 w
5 v, \. F; ^, y* }- B1 n
mov ah, 25h
: `6 l7 h. S# q2 F! C5 F& K mov al, Int_Number (01h or 03h), D3 b. K6 A" \) H- @0 `0 Y2 F
mov dx, offset New_Int_Routine
. I% E" U) L. z# I) V2 I* y+ n8 T int 21h6 w3 a; r# K' ?( D4 L
; a; t8 y: L% j7 t$ w' _# g
__________________________________________________________________________
8 P8 }! y; S, C5 m
# ]7 V: f6 V, a$ t1 {Method 09
4 R* _8 F8 i8 S4 u& I8 z5 i" ]=========0 S, r( Z" M/ y) K
+ {- D, A( P" f$ p% Y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
9 t1 Z- E0 c/ ?6 S; [6 ^: lperformed in ring0 (VxD or a ring3 app using the VxdCall).
( \1 ~0 I! o+ ?The Get_DDB service is used to determine whether or not a VxD is installed+ u5 ^' X h0 f/ _) {; E: N
for the specified device and returns a Device Description Block (in ecx) for
1 u$ F& H' J1 Gthat device if it is installed.
( t8 w, A% ~$ D' C# V
+ @8 ~% P1 S2 F: @ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
% N, f8 `( M' Z5 W1 |3 \ e mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* M3 i, K$ g, t VMMCall Get_DDB
7 a8 D( N" W. \9 @5 ~' x mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' a: K; o. F" U
. | G8 x8 I* n
Note as well that you can easily detect this method with SoftICE:# F& U5 g' l; F3 M
bpx Get_DDB if ax==0202 || ax==7a5fh. B' l O* Z/ ?; k @# h
1 @2 W, o8 J- n) e+ j3 q: L2 I
__________________________________________________________________________1 J& I' Y* p: ^( `! \
# T! l& \) `- ?; u6 _
Method 109 L0 \) B+ M+ N O
=========7 x" n- T4 ~6 [! B! |+ d
+ j1 Y" r5 h: I3 L+ A
=>Disable or clear breakpoints before using this feature. DO NOT trace with
* X/ V5 c: i6 j; S5 t! _# L! L SoftICE while the option is enable!!
/ W) T/ ~/ D8 M0 q5 o" D( f3 p3 |: ]6 B$ n* @
This trick is very efficient:
$ f" e/ I. }! N9 fby checking the Debug Registers, you can detect if SoftICE is loaded$ w/ [% Q- P7 e9 e8 j( [7 n X' |* J' a
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 X! b4 Y3 R/ {7 o$ l" _' F/ n( D
there are some memory breakpoints set (dr0 to dr3) simply by reading their
7 y# q5 V/ J/ K& @1 l# V# rvalue (in ring0 only). Values can be manipulated and or changed as well0 O/ X8 X8 d! [2 z
(clearing BPMs for instance)8 x9 u. X$ Q0 A
: o9 O8 u! x7 z( c" R. D! }__________________________________________________________________________
) E4 Z1 Z# r8 L. |1 }1 f8 z( |, z' {
Method 11
) v! f6 s3 `, H+ G4 v/ D=========" `' R3 f4 v( s, d! d
9 i% a5 E1 ^/ g% v! u2 A
This method is most known as 'MeltICE' because it has been freely distributed! A9 ^1 x4 ?5 c3 Q% |1 c. e
via www.winfiles.com. However it was first used by NuMega people to allow+ }: F, h# Z0 _% W) J0 G
Symbol Loader to check if SoftICE was active or not (the code is located2 _+ \& x$ T0 }; `- X2 G, \2 F1 U
inside nmtrans.dll).; x c, H; b2 l1 |( g: j
; n' N) X* y. D/ ~& j8 K9 ?The way it works is very simple:
2 n2 M0 x3 p& t. TIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
f7 N2 s3 u( g$ ^) ~WinNT) with the CreateFileA API.
& Z* t& o% O7 M9 F6 }/ d
3 Z5 @2 W* n; P% B, V: t3 LHere is a sample (checking for 'SICE'):
$ M3 o' i8 s5 P
1 U, c" r) q; r' g J$ F& CBOOL IsSoftIce95Loaded()
. w* x- _3 Y; r) \ k{$ H$ M( o3 j& `+ ` X1 q- |
HANDLE hFile; 1 H, E( A3 ?3 p
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: G$ O- w' t0 ^( _1 L
FILE_SHARE_READ | FILE_SHARE_WRITE,# P c [. S( v" T
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ v; N3 P9 W& j% n
if( hFile != INVALID_HANDLE_VALUE )" m T5 E9 m0 J
{3 F$ p6 M. ]( b, X: W! f' e
CloseHandle(hFile);8 X1 ?( p' ]( T, x3 h* e. K
return TRUE;
9 E ?" X1 a' [+ b7 n8 B; I }; _2 D: c# E. O2 o
return FALSE;0 i2 p/ }# X' e2 f
}7 B, d# ^% O" L5 D# L8 h; ~
; i" n4 }: g5 f8 o
Although this trick calls the CreateFileA function, don't even expect to be; W# e7 |' Z( e1 L* l) E% B
able to intercept it by installing a IFS hook: it will not work, no way!& |$ g( p* ^/ z* r, p" }* f
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
O* g; ]1 w( k2 u' |service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: t2 ~. ?1 _% w' J2 e8 s9 e pand then browse the DDB list until it find the VxD and its DDB_Control_Proc
, ]! M/ N3 A9 C6 \field." Y; k. f6 u) Y) ]" z" _" w+ i8 G
In fact, its purpose is not to load/unload VxDs but only to send a 5 x: z) s0 p) Y3 n2 V
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
v6 |, c4 H8 Vto the VxD Control_Dispatch proc (how the hell a shareware soft could try
- q+ P6 k, s1 V1 N3 vto load/unload a non-dynamically loadable driver such as SoftICE ;-).5 d1 N( |6 e; Q
If the VxD is loaded, it will always clear eax and the Carry flag to allow% d6 _1 a2 l5 B& L3 P
its handle to be opened and then, will be detected.( \! r F- E3 T# X# L; W% d+ \2 R
You can check that simply by hooking Winice.exe control proc entry point
" Z! f5 |5 R+ N! ywhile running MeltICE., j0 P; @9 B1 y0 [# G% \+ n" r+ G
2 F" H. K. i* G; {* J$ j4 j7 ]7 b4 | y2 N, Q, P' }( d
00401067: push 00402025 ; \\.\SICE, W- Z$ U/ f! e B5 c
0040106C: call CreateFileA
9 X0 D; X5 d; u0 @- m. Z+ y 00401071: cmp eax,-001: J, h' E7 Q1 X% D
00401074: je 00401091
7 ]1 @ {% c' u
( c* l i- b8 }* g1 m1 x5 K
" o+ B/ W) y zThere could be hundreds of BPX you could use to detect this trick.
+ q8 \" f; y8 Y: |4 p0 D9 R-The most classical one is:
+ s! z2 @4 G7 O" M5 v BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
5 j& n" L! \& B- A *(esp->4+4)=='NTIC'
' Z" s1 K( u( g. J0 X) R
0 _ X: e9 a* E-The most exotic ones (could be very slooooow :-(! k' Y3 H% Y# ^0 @) m d
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . K% x/ h. W0 P6 z0 z) }( s4 E
;will break 3 times :-(
9 L7 ^6 g* d+ j5 J+ c! x: z3 ?5 b9 v) k4 Q# A3 I
-or (a bit) faster: , A3 T% z; W! f7 c/ ~7 u) a/ [
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 W" h) \. E) J: i4 d7 g+ d
/ |+ j( t1 T/ o2 p+ X
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
0 t6 Z/ `) h( c0 s+ g ;will break 3 times :-( l1 @- ?8 Q+ t
$ \5 Q8 Z. p$ d3 a: {2 n
-Much faster:
w8 z& B5 t4 @2 k, `1 d5 I) y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) |# I2 B9 G+ D0 ]" R9 @: m0 _$ i4 }2 E! t) L3 Q( \8 Q4 [3 X
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen& ]" f! o. [# F* Z: O0 `+ F) t# ^
function to do the same job:
1 a: h/ f/ G( Y3 k" _
* ]( C: ]$ M8 Y/ D push 00 ; OF_READ
) S- s! C) }) o mov eax,[00656634] ; '\\.\SICE',05 h9 Q7 ?" o% ~( T
push eax& |, B' T4 B5 h5 Z2 ?# U" _
call KERNEL32!_lopen
4 `6 N$ f" f3 Y inc eax e Z- M& L U" c+ m+ q
jnz 00650589 ; detected
5 |+ k1 s6 F) y/ x9 T* I2 y push 00 ; OF_READ2 @" T" p* n0 J) n- x
mov eax,[00656638] ; '\\.\SICE'
- b0 f/ X6 A9 D% L* w2 u/ F push eax: P9 S5 H( o+ G/ v7 d4 c" `
call KERNEL32!_lopen
5 }6 `+ M5 Q; A" v: ^2 |. { inc eax
$ o9 d: @! H" _4 [" B1 o2 w0 ] jz 006505ae ; not detected0 _) ^' }5 X4 L6 y" Q: h. a! [
5 ~4 O$ [8 k8 h- ^% n
$ {/ H: K7 m; y2 `$ I3 \5 O
__________________________________________________________________________% `' F' Z% ], @% W* R( L
8 v. Q; t. q1 x5 u$ m
Method 12
* F- V# Z. G+ [3 Q& {2 W=========" Z# Z: u# @1 M2 u- V
# B* g5 ?$ j! ^2 `2 i" I/ o* {
This trick is similar to int41h/4fh Debugger installation check (code 05
; V; | i# L5 ~$ f! T& 06) but very limited because it's only available for Win95/98 (not NT)9 b; r- m4 e/ J% Y
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.+ U* Z) e8 z. |
2 C/ S; I9 u% w9 u& O: A+ h! W ^* q* k push 0000004fh ; function 4fh
; z) G6 g! F$ V ~# ]) x push 002a002ah ; high word specifies which VxD (VWIN32)
' j; K6 p" f$ r# U% s+ ]& a$ P ; low word specifies which service7 s5 u6 O: K( G: Q! H
(VWIN32_Int41Dispatch)
, A% C# X4 ?. Y5 F0 I8 z- ^ call Kernel32!ORD_001 ; VxdCall/ d3 q2 }% W- d7 m
cmp ax, 0f386h ; magic number returned by system debuggers
3 u; Z& i- o* A' V% Z {) i+ r7 @ jz SoftICE_detected
: ?! H$ D) C2 \) R5 L6 y2 C
* g' q$ @6 T! E2 h0 Y" I: hHere again, several ways to detect it:
1 e0 O& z# V; o6 r
+ l$ _' q) ?: V4 u: x" O* \ BPINT 41 if ax==4f
6 O6 b' H- g1 N' J! ^4 L1 t9 h5 c% |2 S" s- s F8 \
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one$ | U! A( E3 n6 z: b& l! l
* a' F3 H7 R9 d; u2 }. D BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
( Q9 s$ a; q' s7 ]: o* H' Q9 O2 L6 Z8 c. p# f( x0 A% o4 n) W# M% l
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! f, U- P2 ^2 P+ ]
" i; x( V( q+ X5 O__________________________________________________________________________# |( o F* }2 }2 e: }
7 m$ s( r& I" J4 F. B& A l0 n: vMethod 13
, Y7 s) L! w S+ X=========/ w$ J- k) V& l
0 `, \. F$ b( Z3 w
Not a real method of detection, but a good way to know if SoftICE is
% a/ r! b0 ^; K5 u. sinstalled on a computer and to locate its installation directory.
# A. l, U3 M9 h+ QIt is used by few softs which access the following registry keys (usually #2) :0 {% x' w! P$ L2 a
( r8 F3 \2 \# ` o' E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ k5 N" j2 d z# ~+ B
\Uninstall\SoftICE: J6 }" g9 A# t, [1 Q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. n6 k2 s; Q& ?8 ]7 o7 z/ I& {
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 y/ |. E" j: q1 H
\App Paths\Loader32.Exe
4 u! _/ @& ]8 h( s; G* s( w
5 ]: g. n7 N" h5 \. b' o9 R
7 n/ M& r. _9 X9 N! dNote that some nasty apps could then erase all files from SoftICE directory- I/ p0 ]0 z8 b: b' R
(I faced that once :-(/ d) ]! D/ K ] D: {7 s% W& C
8 V' a7 I( N, @1 g. ?
Useful breakpoint to detect it:7 [0 |7 @$ V' a" a2 W* W- B
0 |, j) Z4 c& r0 S
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'1 Q7 a1 K( u- l' W% {. ~; ]
2 x2 B- J& P2 [+ ~+ q: @2 j6 l7 X
__________________________________________________________________________
# ]* h3 x" S: F' {, {, ?/ M/ n7 W" p" r, S
# \- x: \. }# L/ N5 e K8 G/ f A
Method 14 3 R7 \7 z ~% O3 S4 @& u
=========0 h9 G/ d& m9 Z5 w! h1 ~
+ a# Q* |9 U- l. {0 pA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
3 h' V- d# `6 W O% O5 ais to determines whether a debugger is running on your system (ring0 only).9 b8 Q3 H" o, \ ~3 F
8 A ]6 {: h, _ VMMCall Test_Debug_Installed. W% s5 ~. ]1 p. u
je not_installed
+ k. W8 g4 J4 |% J% ` s& a
2 U; m5 r' h1 L PThis service just checks a flag.
. F3 K1 r: \- M</PRE></TD></TR></TBODY></TABLE> |