<TABLE width=500>+ c I6 v, d3 u! s) A6 ?2 Z
<TBODY>( g3 p6 B9 ~% y% g( `) }
<TR>
, F/ S1 ?, I! W$ R( h! M<TD><PRE>Method 01 6 u! g1 a& o9 h4 I% h: W7 Z" A
=========
R. B7 y- w, u" I
/ j5 K- {1 E FThis method of detection of SoftICE (as well as the following one) is
, Y9 Y& }" l$ U; M: |used by the majority of packers/encryptors found on Internet.
7 Q% W( F* s: jIt seeks the signature of BoundsChecker in SoftICE
; I9 k8 _" V! m1 D: A$ ^' k, {( t8 z$ l$ @
mov ebp, 04243484Bh ; 'BCHK'& g2 Z+ n6 p5 a/ p6 |( J
mov ax, 04h
5 g/ P4 S; V/ \ m# Q1 I" C int 3 2 P1 E u# x" {8 E4 B
cmp al,4* v3 i8 M1 ?! g' ~: l3 w
jnz SoftICE_Detected! D2 `* f5 {7 O& k m
6 p/ V0 Y3 \8 J! B/ ~___________________________________________________________________________7 u& M0 U3 [; p5 x' ~+ p' c
% F! z9 {' ?1 O% N- d
Method 026 t5 ^4 |% w% l
=========
! ^/ z$ u% N8 M% L; n6 A) }# V3 H& b9 {4 l; L. n
Still a method very much used (perhaps the most frequent one). It is used, L1 k& f E( M, d3 V: s- l
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 o- C3 V d6 q3 A$ r5 O7 Zor execute SoftICE commands...
# U7 r0 H0 n) e D, Y5 t' i$ K5 y* R9 ZIt is also used to crash SoftICE and to force it to execute any commands1 R" X$ m( u8 a2 F( i
(HBOOT...) :-((
5 L3 F8 g2 M4 L, U( n6 G; d8 [- y3 P7 H. S
Here is a quick description:, g1 J' j8 A0 l3 J5 U' m
-AX = 0910h (Display string in SIce windows)9 V$ ~2 V5 D& ^. C5 x1 c$ V
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
& X0 n! \" I0 u+ I4 E3 M4 ?3 e$ U-AX = 0912h (Get breakpoint infos)
2 l4 p, `& r$ A! ^7 z' n-AX = 0913h (Set Sice breakpoints)
) ~1 I6 v, ^' `-AX = 0914h (Remove SIce breakoints)1 ~0 l; T! y) W9 A
4 r* u# g, i: P+ r3 Z6 w QEach time you'll meet this trick, you'll see:3 h3 ?' d. ?- A$ Z8 r* ]
-SI = 4647h* r7 O! U7 g% q# H
-DI = 4A4Dh
K% J6 X( [% |/ Y. d- T4 eWhich are the 'magic values' used by SoftIce.# |/ R, u& E. a) i5 s( Y+ A
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 `& b, d8 e. p8 t% N: y" s) ^2 u+ x8 F4 `- y/ D) {3 C
Here is one example from the file "Haspinst.exe" which is the dongle HASP# k7 _9 h2 R% g5 C
Envelope utility use to protect DOS applications:5 h2 W* r" |& o
/ B) h' \0 s+ u6 u
# D/ H% j) u( ?% P
4C19:0095 MOV AX,0911 ; execute command.
9 k, B s4 \0 F' y1 z' \6 N# v, K: I4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
}" Z v1 }% A9 U) ?( x5 L* N r4C19:009A MOV SI,4647 ; 1st magic value.
% D0 i) s. e' @2 W4C19:009D MOV DI,4A4D ; 2nd magic value.
6 d- D$ q* L' u- S: L& I4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# l( ^% b! Q3 P& ]( D4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute2 h* A t) E& S! w1 J( h
4C19:00A4 INC CX( n# ^* v K9 C1 t. Q
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
6 P9 m; w6 e" P) {+ u- C7 Z( d4C19:00A8 JB 0095 ; 6 different commands.
/ {( p+ x! s V+ E( g4C19:00AA JMP 0002 ; Bad_Guy jmp back.! E5 O4 m3 s, y t% j! M: V
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)6 I& P z! B+ J. [0 F, }
. r, c/ F7 ]; Q" F5 |The program will execute 6 different SIce commands located at ds:dx, which$ S/ L9 y, Z- B2 G+ _8 _1 Z: E
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% p g* X. v6 R0 [1 E) Q
' C& m6 v# O* a5 L9 s7 ?; @3 n4 F* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
j9 j: L/ D1 q, z1 k7 `' W___________________________________________________________________________, X+ s6 X' P3 ] a" p
4 [( ~, \) e9 Z) y
0 n2 o: ]( J: uMethod 03* ]) e' g; o; r' ^+ ?
=========5 F; [6 e: s* @* Q0 O+ D) `; b4 y
+ j1 X: B: V9 N: ^Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) g3 U8 R! }6 l$ {( H4 B& ^: h(API Get entry point)
# H) D$ n& G3 w+ ?& v4 @. I u' W
, l* p2 J/ |8 a0 H
2 A7 h* p/ `* }% r& h+ f2 [2 E xor di,di
/ s4 S2 b/ D% T! z' K! u/ C" ` mov es,di
8 l6 a N4 R2 v4 A6 T mov ax, 1684h 5 | q! l3 z Y: a
mov bx, 0202h ; VxD ID of winice
% N6 i r8 L! o7 F/ B int 2Fh
+ r2 v) N, F& i; C mov ax, es ; ES:DI -> VxD API entry point
: X( a9 p0 W; ~+ y, G$ r( m) ^1 w; H0 U add ax, di
* p, ~8 d& l4 j8 }; k test ax,ax
7 }7 f5 D, X5 ?4 _9 B jnz SoftICE_Detected# Q/ @: Z$ k1 g% P
, g$ A' D4 K( O, K___________________________________________________________________________
% T' U( ?0 v V, Q& @
( m6 Z6 s$ s" P% }/ _# GMethod 04. N8 p' P; Y: P6 c
=========4 @0 E6 h4 w {. a% G* Q% X1 U
6 n6 Q3 U( s7 Z) u( x' i- J. [' RMethod identical to the preceding one except that it seeks the ID of SoftICE
* {% n B- u* ^0 uGFX VxD.! c5 `3 H! @0 l. t B5 w0 q
9 A: r) r8 B& L, w xor di,di
/ J; l6 c$ c. S" e* v mov es,di
3 O4 X9 v- \- j P- [ mov ax, 1684h - r1 h) \3 T3 `) B( f& k
mov bx, 7a5Fh ; VxD ID of SIWVID
! C N0 S2 C/ c5 J; q! S2 ^; } int 2fh
$ K5 i7 [* H1 G mov ax, es ; ES:DI -> VxD API entry point& P# P6 p8 p+ f/ s; f
add ax, di
; ~" h4 F- w5 _4 r# Z7 J( l test ax,ax/ O3 R/ i2 v) i7 m+ t) p
jnz SoftICE_Detected
4 L8 j* b0 v4 P- W4 m& p5 @9 [; P2 W; r* Z
__________________________________________________________________________+ s3 a" k# z, R6 [
5 [3 }: {7 c3 O) D/ _
. W+ J8 y/ V8 i: `4 B" xMethod 05. d( ^4 m6 {& g% C
=========
6 p: A. C$ r# J% N& {0 t9 |3 a$ n/ j' w
Method seeking the 'magic number' 0F386h returned (in ax) by all system
- d! P! Q8 s7 Kdebugger. It calls the int 41h, function 4Fh.
# d9 o0 \( b- Y; VThere are several alternatives. 2 d& x. B/ ^# d6 c9 K; M3 _
9 v$ w y0 W' |$ y4 u
The following one is the simplest:# [. C. T+ M9 L H- C( y
0 v! C! P5 r9 I mov ax,4fh9 q! s% a+ E7 Z$ x3 G' \
int 41h9 O; l. o6 ?/ a; j5 r: p! b: Z% p
cmp ax, 0F386
) O; }9 c2 v2 q jz SoftICE_detected) o5 z* u2 U+ `* H3 H
$ K/ @5 J. v) ?! _
0 d9 Y; s5 H) L
Next method as well as the following one are 2 examples from Stone's 2 \6 K5 k# T4 v2 W
"stn-wid.zip" (www.cracking.net):! a; v4 n5 |* J8 u
+ n) d8 }* w. _* W* Q1 P z- I6 p
mov bx, cs
0 Q; B* q' W% { lea dx, int41handler2& ?$ v6 q: t0 H. B* X4 m4 u- n
xchg dx, es:[41h*4]( T1 {( {! M" W7 S( k
xchg bx, es:[41h*4+2]% ]& T; j3 d8 G1 W0 q
mov ax,4fh: S- _; A9 e1 j* x; _
int 41h w' g% d9 B! M& Z' C
xchg dx, es:[41h*4]/ y; R' {& A2 l9 K- I) A4 b" S
xchg bx, es:[41h*4+2]
3 Y. d1 D, d1 \5 } cmp ax, 0f386h
/ m- @# [' H1 q( Q" R9 @: S jz SoftICE_detected
4 j8 Z7 t! y. S! p( s% a; _ I% X1 H$ W8 V
int41handler2 PROC
+ s6 d+ T( |0 g I iret
) p+ O) N1 K# @, g1 f# B2 H; ?) cint41handler2 ENDP" P, A4 Y0 W) y) }/ x( o; x7 Y
% m- {6 q: y, V$ A- ?
9 ^; m8 v3 _, _' u
_________________________________________________________________________! }3 N% l& w2 \$ g
! n! ~4 G: ?$ z, g+ K( w
! u: @, ]9 e( x* D/ A: JMethod 06
/ C4 @ q: o6 [, t8 w=========) d( E) V0 S, u! ]- l! c, B* R" N
* d9 J3 j2 E( j2 E
* G. B8 |/ ]' ~, }
2nd method similar to the preceding one but more difficult to detect:
3 I9 u, f8 b+ u2 ~! P% W: ?6 O: H, X7 e" j; O p+ J3 B: P2 u
# x" i3 T6 S' N, {5 q
int41handler PROC
. ~* @1 ~1 l: D" Q0 I/ ~" y6 \2 r mov cl,al
5 u I9 D! A8 M% Y, l) @; Y iret- }8 B: p9 }& H& ~1 D# D( ?2 \ y7 M
int41handler ENDP
' O7 O$ s& S3 j# ~" G e; h. Y* a4 w2 L, y; `
5 v" D+ S2 t+ B# J; ?* q; q5 a* `
xor ax,ax4 Q" \- Q5 ~ q0 Z6 S! r7 j1 T
mov es,ax* h$ W3 G; B+ h
mov bx, cs
2 u! y& w, g+ B' D lea dx, int41handler9 b5 `+ R8 U B6 W+ N1 X
xchg dx, es:[41h*4]% K$ K3 V% a h' l7 J9 G
xchg bx, es:[41h*4+2]5 z/ m% r: Z! {8 A
in al, 40h
* E+ P8 ~4 R1 T xor cx,cx* i$ l6 w. w- a' ]
int 41h; I+ L, h& R+ ^$ C& }- M1 y
xchg dx, es:[41h*4]' q0 S2 o) N1 H- r/ E" a
xchg bx, es:[41h*4+2]
4 G5 k8 g4 ~: P' x( N cmp cl,al, L% Q9 c; s( B0 o
jnz SoftICE_detected& u5 `% O' b3 ]0 w1 S
. [$ T- w- `7 f: e3 |_________________________________________________________________________3 q3 H; [6 X1 A$ x& D1 x
* W6 F" i/ ]4 v2 x; `) BMethod 074 i8 i# t+ |/ }, M0 @
=========5 A7 Y! w( w2 D- ?5 `* T6 R
/ ]8 P" v, P+ ~% Q! ?6 w( W. JMethod of detection of the WinICE handler in the int68h (V86)4 s) B8 d% S. Z: I: }! V! J
' ?$ k. U& w& v5 d* O& o: c- b$ q mov ah,43h5 n0 A9 X: m2 h! `( J' F
int 68h
& z4 E2 i2 T: K; r$ L8 L4 ], l cmp ax,0F386h
- x+ r1 Q- y( ^. W3 ~ jz SoftICE_Detected
* v: K8 ^4 M) h7 ^4 V5 I4 A& G7 T% v% Z
# G5 d7 F( h1 M n' l=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 `5 s) Z4 m: |9 l' ` | app like this:
& N7 N, D- h! t, y. h# F& ~ e, N# o5 w$ y
BPX exec_int if ax==68
7 `3 e# d! ^: W" q- |% p- ? (function called is located at byte ptr [ebp+1Dh] and client eip is) ?7 z& u2 S2 ^4 n$ J; S7 U
located at [ebp+48h] for 32Bit apps)* } I# n( F; K" A6 f& I7 m$ P
__________________________________________________________________________
! N8 h( F' n3 m: }# g0 @6 V$ |3 x# k; n
, n# Q+ ?2 Y1 @1 DMethod 08% @4 G% F+ x: u) y- B% q L
=========
2 g1 m) x" x+ X! L$ U9 N# G1 E
/ f2 g. w. k6 ~- B* ]( q1 v1 d% rIt is not a method of detection of SoftICE but a possibility to crash the
7 D# Z5 |5 K/ Vsystem by intercepting int 01h and int 03h and redirecting them to another3 d( x0 e0 q q8 ^% D
routine.2 U1 @4 }/ j3 ~: ]% \+ n! Y+ Z
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# p r0 C/ q: e6 I5 Uto the new routine to execute (hangs computer...), R: f' K; T% r5 p0 B+ k3 n) W5 `
* e T5 R) @9 U2 b/ \ mov ah, 25h. b0 T F [& Y' h$ ^
mov al, Int_Number (01h or 03h)
# e V9 \ h2 G7 Q1 g ~ mov dx, offset New_Int_Routine
. [' Q% a: b' x3 B, f) [ int 21h4 Z0 `) H0 _3 D9 A
8 G, B) E1 J, u4 a' ^; ] I( C
__________________________________________________________________________- `& j% T! U- |6 n0 X
. ~! O0 k& K5 l( T0 V" l/ eMethod 09
/ f1 T9 w! e' D! [5 k7 y! @( t=========- a; K& Q$ i- m s- J
. G1 V9 K( T8 M
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
! H$ a& A' k6 U) ~. ?performed in ring0 (VxD or a ring3 app using the VxdCall).
% a& H: O: k$ wThe Get_DDB service is used to determine whether or not a VxD is installed4 y+ r7 {5 t8 ~' |$ N- [# w
for the specified device and returns a Device Description Block (in ecx) for0 U! G6 v7 ]. L6 e# }% \
that device if it is installed.% r) }+ x" v) c+ E r- r
. b. m' ~: R( ]" q: | mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* x( Z$ e! l& m3 |: B4 f mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 a3 u) a+ z1 c: s0 y7 ] VMMCall Get_DDB2 C0 m( _ I+ p! V3 _5 r
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
; g' x8 |$ m8 R+ I, t% R* W+ n2 B/ a$ |! I( l; j4 E; P4 v
Note as well that you can easily detect this method with SoftICE:2 ?9 I4 C! _. J8 F J5 M" `
bpx Get_DDB if ax==0202 || ax==7a5fh
6 D( n& r% q2 M0 p8 D8 |2 L7 T H1 ^! y2 Y
__________________________________________________________________________8 {& B! }8 T) N7 o4 [0 }5 T/ H
4 z& ] P6 x* G; ]Method 10% |( a1 I3 O# K& S' Q
=========2 E( _5 ~4 M( f
+ r5 R( t% j! j+ d9 s( V Z& I=>Disable or clear breakpoints before using this feature. DO NOT trace with4 C: |- b5 s a5 j
SoftICE while the option is enable!!
8 L, D ?- J, K
; W, j$ W* \( l- YThis trick is very efficient:
: I, e$ n4 q8 A2 hby checking the Debug Registers, you can detect if SoftICE is loaded# N$ Z( h1 E5 r5 I
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if/ O' \4 c4 U" t+ ^
there are some memory breakpoints set (dr0 to dr3) simply by reading their
$ w. T4 W8 i/ T4 T; E+ O# u% mvalue (in ring0 only). Values can be manipulated and or changed as well; @! H! I6 f* g! ?" @1 S( n) v: {
(clearing BPMs for instance)" ?8 U& b3 Q. S: ~7 x: e9 Q
$ K1 `. H( b O) E: Z3 Z! t Q
__________________________________________________________________________# H2 s6 k; G. V1 X& I
; E, d" ?: | u9 bMethod 11
6 L6 U, ?- i; I1 K=========* K) [8 ~$ D3 i9 X8 P- `
; e/ D' n- S& d. _This method is most known as 'MeltICE' because it has been freely distributed
- C& C" Z( H6 Avia www.winfiles.com. However it was first used by NuMega people to allow
6 Y) {1 o* C5 U4 W( dSymbol Loader to check if SoftICE was active or not (the code is located. b5 C1 s- ^# m6 R7 _
inside nmtrans.dll).
: v8 c/ ^. s* d$ Y8 f s
' F2 V- \9 p9 n" U1 b, d6 i& ?" BThe way it works is very simple:
4 p8 j- H: Y% q- v* k/ gIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: u* g7 A1 |# Q( {) n: H$ `WinNT) with the CreateFileA API.
2 ?; N9 e0 D* t" c
0 E/ R W- H+ j# t i+ vHere is a sample (checking for 'SICE'):& M/ \& A1 d3 X. }1 N
- Z/ G) B9 a. S! u% }( b0 bBOOL IsSoftIce95Loaded()
* K4 j+ G' R1 I0 |$ N9 ^# j3 n{5 f' Q8 |( ~6 w" `' q
HANDLE hFile; D A3 L4 a+ r$ r& j1 l
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
# P, H2 p7 h* Z ~' f/ Z% | FILE_SHARE_READ | FILE_SHARE_WRITE,/ B y/ k$ G9 a7 t" x( I2 _7 m Y
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);! Z7 o% g; F" B, x: @
if( hFile != INVALID_HANDLE_VALUE )1 q: y; ~2 W3 [, N
{
! I/ x( ]' q' g* O5 M0 d! z( V CloseHandle(hFile);1 b+ h+ N' T7 i" A+ y( V0 S
return TRUE;! Q" Z8 }) O0 ]/ j1 X+ H0 X6 r
}
& t; N6 ?. E8 N& L; |; i8 z& g/ X, G return FALSE;
6 m% B J- @- O& @; W, o}' r7 [0 _- t' S
' u# @$ O( j3 S5 }4 o5 ^
Although this trick calls the CreateFileA function, don't even expect to be
+ a8 W) M6 \8 `# F4 v. ]1 M' y; c, uable to intercept it by installing a IFS hook: it will not work, no way!
' h: p8 G4 B' ^+ l7 g" EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 n9 u1 ?+ F' h( Y7 j ]- Xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
6 C. x, z% c- f) P+ Cand then browse the DDB list until it find the VxD and its DDB_Control_Proc& J) @; B! ~; A5 I! e: z
field.+ u7 j* v* z8 @5 ]
In fact, its purpose is not to load/unload VxDs but only to send a ' k. Q$ ~3 b& E1 _5 j
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) d. W, U; U9 t; {$ R
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
% V3 e* k6 V; ~to load/unload a non-dynamically loadable driver such as SoftICE ;-). w% C! t# W, I" M# u3 w
If the VxD is loaded, it will always clear eax and the Carry flag to allow
0 g( g3 _8 M& y6 {) L7 Wits handle to be opened and then, will be detected.
8 C4 E: j, l X* i6 XYou can check that simply by hooking Winice.exe control proc entry point
4 o+ t; |, Z% }while running MeltICE.
" W% k; ?$ b% X, x+ W: ?- |
; v6 M" K& g) m. _+ X
/ g6 a, q* h9 u 00401067: push 00402025 ; \\.\SICE! [, w6 N- \ ]
0040106C: call CreateFileA% B5 E, J$ b: v8 c
00401071: cmp eax,-001
* I: |7 A* P7 O. N [ 00401074: je 00401091, ~' h; `5 ~7 l9 j4 o$ O
9 g2 \8 _6 A; e" E: o0 b+ i* U* u
F( s9 M3 @8 w" l3 y
There could be hundreds of BPX you could use to detect this trick.1 l. ~+ |5 ~/ N; B4 s
-The most classical one is:( Q+ a" r8 z4 d$ _8 }
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||' D" z+ ^$ R% a+ \+ v( p' H
*(esp->4+4)=='NTIC'
$ R9 N& {% E' o: I* Q
& ]$ l1 Q" `8 V& ~$ _6 _-The most exotic ones (could be very slooooow :-(' P/ Q; ^1 D, l: | X
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') / ]( r' O1 z8 }' @# W8 y8 g1 T
;will break 3 times :-(* |3 `4 T: c1 X" n8 E
+ `5 i% L* }" p' v, }/ N-or (a bit) faster: " c' O3 V: Z8 |% E% @
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
E! U" \# ~( i V* b: z- R4 [( T8 x2 c$ l- v( l! `( v+ l n4 S
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
* q7 o$ ~( I G9 b ;will break 3 times :-(- |" C7 b" H. v, V& ?+ c
. q; B( s5 z- W-Much faster:
# e5 g# p; L# z5 Q9 O BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 L! A# p7 {' q2 J0 O5 T
6 |) a0 }, V8 T+ |& t) @Note also that some programs (like AZPR3.00) use de old 16-bit _lopen$ K" y& P. o* ?/ V6 ~- I8 k, x
function to do the same job:" x y/ ]$ O! `" u, H
" N( J9 _* L/ i1 P
push 00 ; OF_READ. A4 `* a6 r! X% o4 O, P: I
mov eax,[00656634] ; '\\.\SICE',0
1 j6 Y$ L! S$ b9 e m push eax
& |* Y: N* {0 N1 Y% W call KERNEL32!_lopen: Z9 W V! J- ^! h" i
inc eax- S7 o2 n9 e o$ Q
jnz 00650589 ; detected
/ O- y4 [2 T X push 00 ; OF_READ0 H3 \& o- k* {' I, M4 |8 |$ o S# e
mov eax,[00656638] ; '\\.\SICE'. J3 U: R s# \
push eax
: y' R {( _5 H. m7 w: j \ call KERNEL32!_lopen$ B% v3 R' q1 u) r3 a1 a& @/ q5 E
inc eax9 a4 [' n1 | u* c4 n
jz 006505ae ; not detected
: K9 ^3 t2 O9 c- h% h- r( u; N/ ?5 D- O
7 ~' d* q" c, Q3 i# ?
__________________________________________________________________________3 B: O1 _( x* I" I! C
- x6 o+ b* G; hMethod 12" ~ q5 E, M* F* K; `- A5 d- J
=========; Q$ {/ c& D' v$ \) o* w
! \% b4 W( C" O( I, n2 O5 e) y6 ]
This trick is similar to int41h/4fh Debugger installation check (code 05
6 r4 U3 K% \" p7 W& 06) but very limited because it's only available for Win95/98 (not NT)
6 L; i! s# `" }/ w, Y, eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ e! x/ {( s( w0 O9 v7 X
7 N7 p9 G1 l" N6 I push 0000004fh ; function 4fh
4 w; o% C! d! Z& d. B push 002a002ah ; high word specifies which VxD (VWIN32)1 z1 j. [0 k8 z( _9 t5 x1 _" K$ h, w
; low word specifies which service
$ Z3 G( n) [& Y# F5 ?* K+ | (VWIN32_Int41Dispatch)
4 }4 K( W1 z5 ] call Kernel32!ORD_001 ; VxdCall& C+ S9 _( D! a* z
cmp ax, 0f386h ; magic number returned by system debuggers
# X3 N# _' d! O7 W8 H O jz SoftICE_detected6 |) v( J; i7 M4 Z7 l( W0 a
2 ~8 \: t% R6 ~ t
Here again, several ways to detect it:
y) K; J( W3 P4 A) H7 N+ l8 ?
4 R2 {" i" W G$ H BPINT 41 if ax==4f
- K3 u8 P1 E: ]+ C" X& l: V+ e; K; s
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! d0 j# k9 h p
- M3 i0 P& B3 {1 s! k) R ^( ^8 {! }+ U
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A, R, h! h9 e6 L9 B4 M
2 E9 ?* j- [8 B BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
/ D2 B3 X7 M: R# A; V g4 g
( b7 N. b2 t6 ^9 l% e__________________________________________________________________________9 a" W0 R* S$ X* K9 I; j) N9 a* m
. Q W& N5 E/ R6 l7 P
Method 13/ g1 K( q A$ S8 }+ j9 j7 H% ^
=========% m' y1 W& f" S5 f, r0 g c
4 h1 I7 r% M s
Not a real method of detection, but a good way to know if SoftICE is
5 e" a+ f7 y6 k( vinstalled on a computer and to locate its installation directory.
0 o. B( `* ~; W9 }8 C, U4 ] rIt is used by few softs which access the following registry keys (usually #2) :
9 s q! o* n2 z" q5 r6 j- ~
! ]* l" q. J/ o, D" k; }6 b-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, z) e5 ^# k. {' a8 ^9 H
\Uninstall\SoftICE
8 t3 P7 D: [; X; {4 d. Q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# B# L3 T3 T8 V! b. g-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" b/ o% Q m, y+ m( {9 K
\App Paths\Loader32.Exe, q& A: ]2 y( _! c% }
" w4 ]3 M- ~3 a. p* }! x+ G- f8 s; F; u% H' W
Note that some nasty apps could then erase all files from SoftICE directory9 Y0 E- g5 q/ X4 ~/ F
(I faced that once :-(
$ m/ W' d7 q6 B* F0 `! L% j# j& Q' Q) Q5 }% F! \: U
Useful breakpoint to detect it:
* e; N9 W! E- N! O7 F9 \- @4 t3 a* h$ P. n8 h: s
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% V( } m# l# f# Z* |8 R
# S' z7 E* M' ?5 o* `0 ~__________________________________________________________________________2 M7 r7 ^+ y9 C
$ a" v% r/ p- X: e6 y N% g$ H( L! [. R% ~
Method 14
, Y2 p) B5 z9 n) @=========, S+ a5 [$ F& ], s2 s' F
% W I0 z, ?- ?1 T: b1 b
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* K+ D4 T1 ^: ~8 Zis to determines whether a debugger is running on your system (ring0 only).3 T) ]" E2 `: |* s* N
% G5 c/ c& {) {6 ]: h' W3 B* ]
VMMCall Test_Debug_Installed' U0 c) I' }4 z1 ~( @- I
je not_installed* e* L) a x5 Q$ L4 A q8 I; \
- c+ J$ _0 c- }
This service just checks a flag.
& D8 J7 s1 c4 ^% v</PRE></TD></TR></TBODY></TABLE> |