<TABLE width=500>
9 e9 J7 K4 B t5 J) e$ K<TBODY>1 L, q/ _7 U9 \
<TR>' j s5 v8 `, p3 \# N
<TD><PRE>Method 01 1 |7 S9 p5 r V# g9 a$ e0 ^, n
=========' S7 D& K0 i# Q6 O) _& ?) C" b
3 H: T/ \5 A# `0 i( d4 {+ m' N$ KThis method of detection of SoftICE (as well as the following one) is2 R3 y2 D& W3 f
used by the majority of packers/encryptors found on Internet.) a$ ?5 c% U% f( a
It seeks the signature of BoundsChecker in SoftICE; q& B' Q" y; O) H1 [* R% l
) ^! I6 l& p4 A1 a( W
mov ebp, 04243484Bh ; 'BCHK'
: W1 Y6 I, y L9 p/ s mov ax, 04h
+ i& ~ J" y% O int 3 / O4 a7 F- x4 A% ?% Y
cmp al,4! q) ?6 X5 h, A
jnz SoftICE_Detected5 P! F( D+ @2 l( F' s& n
) o8 Z& F0 i! M' I% p7 n- f
___________________________________________________________________________3 O; d, V0 U$ W1 }' Z6 \
/ h& r2 z2 m' _9 \; k' @Method 025 H1 ~; s0 a& n' G' j1 U
=========3 A+ K2 g6 v7 ], R6 g3 @2 O: ~6 k
: r% f6 w3 r O) h9 w" I" }
Still a method very much used (perhaps the most frequent one). It is used8 D+ r3 W8 `4 }$ Y5 v6 h' @
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
# q$ A! {# k2 ]1 q1 O' x$ gor execute SoftICE commands...6 T& s1 c2 Z% ^$ O" `
It is also used to crash SoftICE and to force it to execute any commands
9 [/ M# k- ]2 x(HBOOT...) :-((
% [4 r, J0 n+ B. E, Y* S1 g- Y2 p" d: e
Here is a quick description:! {9 D- d6 L2 ]0 @5 P# m+ t8 E
-AX = 0910h (Display string in SIce windows)" S* @% U) k/ \+ P- X) H1 s
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) i- I# b h6 J3 a; z, R. W-AX = 0912h (Get breakpoint infos)$ B9 c/ Y' Z2 _! C/ [9 o+ B
-AX = 0913h (Set Sice breakpoints)" q8 S( | j/ G! A! ^( _; D
-AX = 0914h (Remove SIce breakoints) N- A7 m! g2 }: S4 I
* P7 V, E/ K) wEach time you'll meet this trick, you'll see:2 @1 L; ?. k( n" e$ @, i
-SI = 4647h
" E, |* k. ?1 C/ |# R' h6 J-DI = 4A4Dh
8 E% A3 A1 R& L+ D, i" P) PWhich are the 'magic values' used by SoftIce.
, t$ Q7 x, Y/ A/ B' DFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& u! x D/ m! z; ?# d5 q7 p9 ^" C# D# k+ }. i0 S g$ p
Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 @. _( K+ k' XEnvelope utility use to protect DOS applications:2 n2 `% L+ ]/ t; x+ p
3 v! _! {9 F" U3 u3 X2 z
4 R1 _/ j! @; S! @) g" K4 L
4C19:0095 MOV AX,0911 ; execute command.% f# ~( ], }3 N. B n
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
, I& X2 g: I7 P7 @( T/ x2 K( V4C19:009A MOV SI,4647 ; 1st magic value.! R) M4 o2 p% x0 n9 k `" R' R1 ^
4C19:009D MOV DI,4A4D ; 2nd magic value.
4 b- R" m! t7 h' f7 ?4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 b7 v7 I" {0 b6 p2 m9 K6 I4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
6 I p! j$ G4 }' E% R, V4C19:00A4 INC CX9 F% a6 R( a$ I+ c9 B' @
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: P! M1 ~# u( u" ~4 c
4C19:00A8 JB 0095 ; 6 different commands.
4 h; i8 b: r- K' k4C19:00AA JMP 0002 ; Bad_Guy jmp back.4 }! O' P) p- h- P( f5 F W& C
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; _9 q2 `2 E V# Q
, \$ R% e3 _2 V6 n% f3 {The program will execute 6 different SIce commands located at ds:dx, which
. Y: q Q( _; v1 `6 m8 E# Iare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ U0 {0 q. L6 E {4 P
" U8 z% m) {5 [) S2 T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 z* z3 l k1 L+ n
___________________________________________________________________________
3 w: r* `% n9 s, h0 \
5 z/ t& s( _* B6 `+ N4 x% x
5 G' m- B6 t0 d, Q q: BMethod 03' P2 R5 @6 u/ ^! w
=========7 Z# |) q# c; d9 a A
+ `* p9 n- Z8 B- y" M# m3 P" k$ u8 I
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, X3 q( ^- p+ V1 o* [2 |
(API Get entry point), v- `0 _8 T! u& B* m3 ~1 G. A
; ^) o, N3 C& E+ U' _
+ ]7 C% t1 X* N! i v
xor di,di# W2 g/ k& O8 W
mov es,di. Q& h5 l2 |' l9 l
mov ax, 1684h 7 f' j/ T1 Y8 o B% N
mov bx, 0202h ; VxD ID of winice- H' f6 `* R/ h+ I: S! Z
int 2Fh2 m2 T/ |, S2 S0 f5 z/ n0 O7 ?
mov ax, es ; ES:DI -> VxD API entry point0 l5 j% N' v. j9 t1 z" {
add ax, di
m9 V& s4 l6 a; G+ @ test ax,ax$ H. Y0 t+ b. f: i
jnz SoftICE_Detected9 v' v; K3 R1 W+ ?, n
5 b' h9 ~6 h4 d0 i
___________________________________________________________________________
5 r: Q$ z5 `0 ~9 n& p/ ?
6 f# n% Z0 d3 N; Q* ]Method 040 J+ b( ~6 h$ O: G$ l
=========
6 b# l8 `. k0 E. q" y2 r+ A4 ?
0 J( V4 J% v% R' r& U+ i( y; EMethod identical to the preceding one except that it seeks the ID of SoftICE
7 G9 u# R, q' \9 {) f/ v! ~GFX VxD.
+ Y, V/ {+ X8 M5 S8 p3 @8 }- P) N: h3 t4 T' C0 g
xor di,di
* i. s% [* p* B( U mov es,di
z* h* _, G9 U6 J% |/ c! s mov ax, 1684h
! O* L% H S" G* B! ` mov bx, 7a5Fh ; VxD ID of SIWVID
/ }' d1 ~* l+ s; Z int 2fh& |8 [: g- V4 b& |0 _9 x
mov ax, es ; ES:DI -> VxD API entry point. t e; T; b% f( M" b+ j' |) T. d
add ax, di
1 Y( {( R% t/ T: y test ax,ax
( d' V( G0 E5 B jnz SoftICE_Detected! |4 r8 _1 u# ?/ T
9 d+ S. ~7 `" E( N
__________________________________________________________________________% Q$ q$ J: B2 j- }! v# ?
5 M7 E) O# x2 G) H+ G
5 ]1 G6 j$ B* g4 m" i
Method 05
; G, v4 ~& ]( S0 Z/ r1 K=========0 k5 k2 U" ]$ @+ D: N2 R
v/ f2 e8 g5 @1 O, Z2 `9 \6 }4 z
Method seeking the 'magic number' 0F386h returned (in ax) by all system+ S, t! `+ v0 P5 A* O& M2 c/ r
debugger. It calls the int 41h, function 4Fh.
, D4 h9 ~1 P2 I3 A0 d1 b$ s- uThere are several alternatives. ! _& m! t) P% R4 K2 j. K. [
0 `9 y7 q) m# f- ^" {2 i3 J
The following one is the simplest:6 [' D6 J: H* r- k1 R0 @
! y% V W: B+ W4 X8 B: j mov ax,4fh4 r- Z' g* U" N( P
int 41h" C3 f. r; V( \& ^, y
cmp ax, 0F386
- ?; h) d l+ G# G# \ h jz SoftICE_detected
$ a% m6 s" e7 [2 v
4 B" R* r6 D Z1 a* s1 K7 {6 l
+ y$ @& l. c: g3 ENext method as well as the following one are 2 examples from Stone's 0 g6 D$ `6 I: O$ n8 X7 w! C8 {( I
"stn-wid.zip" (www.cracking.net):% B7 ] n7 X% p
+ K/ h0 D3 J1 v1 @& z mov bx, cs# s$ Q/ i/ b9 ?% T
lea dx, int41handler2
% S6 K3 _3 o# [6 y3 L) P1 h xchg dx, es:[41h*4]* k5 |/ L: X$ Z! k8 t0 D0 w
xchg bx, es:[41h*4+2]; a0 M \1 c+ S1 p( \: j
mov ax,4fh
5 \% J& e5 K7 a/ ^/ ^: u+ s4 ? int 41h$ d Z0 F2 ]: d4 D6 C8 \
xchg dx, es:[41h*4]
7 m6 k" Z" ^! r xchg bx, es:[41h*4+2]
) B3 W ] C! t2 W# E cmp ax, 0f386h8 T; x: B, x) ^2 A, K
jz SoftICE_detected
5 q; ~; o9 t2 X. w9 G$ R4 ]% m, \! |; v8 I: o* L: `( A* b
int41handler2 PROC+ h( A1 U& e, [1 {, S; _/ E1 _& E
iret
+ g: s' M; j* x Z+ b2 `int41handler2 ENDP9 `7 ~$ L4 T2 N3 s
3 Q8 n9 j0 s" h7 B- I8 A6 t: p+ Z
- C' Q% [ {( l9 `_________________________________________________________________________+ r# j+ G/ T- V/ K1 w
- e7 p6 l4 l. O: W8 b y
9 d, w X- ~' S3 X! e5 D$ OMethod 068 ]; D5 [' p5 a4 j( \0 C9 x
=========4 |/ C9 T0 [0 {1 b
: }+ w1 a# a+ h, a! ~
4 e* N' q! @0 H# T# `+ x5 r" w2nd method similar to the preceding one but more difficult to detect:% u: ?+ a; Y8 k" m6 I) E/ q
8 R8 v. J/ [: D- X$ y) ^) W, h
' c$ d! Y- O) N' U1 o: h
int41handler PROC& l8 N7 d7 G8 Z5 B
mov cl,al% k# q$ p# s1 Q1 f1 Z* `( z
iret4 c3 s" c+ E5 M6 o Y5 a% l
int41handler ENDP6 T. V8 Y7 C/ j7 Z
) W, @/ ~. W0 x% Q5 B
8 U; V: Z2 S7 a5 h5 D
xor ax,ax5 c4 l" A: J F1 w) Q
mov es,ax$ E* D: ?* A, c
mov bx, cs6 Q4 o) p+ N. ?& Q5 t! E# j9 e! d. L
lea dx, int41handler
; m) Y6 H) Z- P0 ^. Y- T w xchg dx, es:[41h*4]
0 C G% @! J; l xchg bx, es:[41h*4+2]$ R" F, N. q& M. V
in al, 40h5 T2 I1 F( ?4 C6 c+ u! m6 J
xor cx,cx) F: j! ~) B8 x8 p9 ~& F# o4 n' m
int 41h
F1 `2 c6 O. x' ^0 y8 Q3 W xchg dx, es:[41h*4]3 O$ `6 E3 Q+ ]
xchg bx, es:[41h*4+2]& l! w* q, L- [4 v9 \* |# ]
cmp cl,al0 B% S2 n5 u ]
jnz SoftICE_detected; s! S! z* H5 V
% X$ \; l* |0 ?* o_________________________________________________________________________
: @( ~! Y& ]1 L3 j: N% g& s% O2 G( p) F
Method 07
7 i& x5 j) X% \% V=========
, N4 J7 a" B [! P, E. ]6 }: s- a7 Z& T6 M/ F& H5 ]5 I% `
Method of detection of the WinICE handler in the int68h (V86)
U7 e" J* G: M
- `2 S1 E6 \" O2 J) V6 u5 }. p mov ah,43h
% N6 K: A& e( T2 Z* R; \! f int 68h8 t4 \8 }: b% u3 ^/ r. T0 v
cmp ax,0F386h
; x% C- M6 Y1 P* q jz SoftICE_Detected% e* [& T1 g( l4 z* T; d1 ?8 t7 _& ~
# u! |! V) k, v5 `% p6 N# L
8 W# Y% g, ?! Y$ z3 N$ J=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' \! a# u: X2 k% w7 w4 X: m
app like this:, B C N6 |* [2 k" c
S7 B7 l+ b2 ^& e! O; O( p
BPX exec_int if ax==68, U( q! u/ l; h3 K" V5 E/ D# ^
(function called is located at byte ptr [ebp+1Dh] and client eip is( q* Z) |2 I% ]8 Q
located at [ebp+48h] for 32Bit apps)
# x; k) I( ^3 G+ w3 ~ ?+ x__________________________________________________________________________
" O+ G' E y l1 d: L- I6 j
" {1 o5 X# Z, p: k
6 S: W7 q/ H, _: f4 IMethod 08
( j8 {% c, x$ z=========2 f- I+ O- A; @( ?' X
, t/ H' r4 a( l5 eIt is not a method of detection of SoftICE but a possibility to crash the
9 ~6 b, e1 }7 E5 Dsystem by intercepting int 01h and int 03h and redirecting them to another
& i7 r& G* Z/ B! oroutine.# V% m* T: b3 d7 N& i9 z- ]1 a
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. V& \/ d; k1 C, F- U& K1 L
to the new routine to execute (hangs computer...)
$ w. }# U7 G1 a" ]7 P, M$ w% \
, w) J8 F2 ]6 d9 P1 X' p( N mov ah, 25h9 ~. p7 T6 k1 R0 l
mov al, Int_Number (01h or 03h)' @. [! F! f- q
mov dx, offset New_Int_Routine
& f2 j# x8 C) | T5 f, M$ @0 { int 21h0 `2 l& f# Z% n: p3 r; Q
! P$ H7 a" ?2 z8 a' D__________________________________________________________________________
; y4 b/ D3 H8 D" I" s9 v) @7 z+ W
Method 09
1 @1 g3 g% j* b# i/ ]4 U& Z% l=========9 H. \# O! I! S, w, o$ c, P8 x/ L
; J. Q4 e) u) O3 [& J. }) l$ ~
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only4 i k. `) X% e4 {% l
performed in ring0 (VxD or a ring3 app using the VxdCall)." q7 c1 b, J5 o( {: T& R- |- a
The Get_DDB service is used to determine whether or not a VxD is installed
6 A! v0 [( x2 G# }for the specified device and returns a Device Description Block (in ecx) for
6 Q2 A. ]/ p' R3 Tthat device if it is installed.! ?% M2 _. ^& M
3 r+ N, @. U8 K mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 V4 o3 E! N4 P. ?1 N$ W mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( o% ^3 m0 {( [- T9 `+ ^" Q
VMMCall Get_DDB
1 K: Z4 K/ t: z' p& Z E5 L mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' p. K1 `( ~0 G9 O4 U2 z' ^$ m$ ]
+ G/ F6 G q [1 z; K$ z$ xNote as well that you can easily detect this method with SoftICE:+ O }9 ^9 G( N4 r* \* @
bpx Get_DDB if ax==0202 || ax==7a5fh/ X' `. Q% Z( Y* _5 O _
- d2 z. g" p( P' R. v* Y; S
__________________________________________________________________________4 }5 R- u9 \7 V" N5 `7 K
$ i' S, r. G$ f2 H; D* j
Method 10- C$ P5 G1 ^ B6 l; a
=========
$ Z( h, y) f$ y( j7 V0 q7 K7 R" w. Q& q; \- J2 n: R- Y7 J
=>Disable or clear breakpoints before using this feature. DO NOT trace with; c3 R! \4 J7 s) i% P( O8 w6 \+ u
SoftICE while the option is enable!! T* }& R; }" o) p6 s$ W
' N: H% {% F* L" yThis trick is very efficient: p5 c- S+ y8 f) k6 _
by checking the Debug Registers, you can detect if SoftICE is loaded
: P8 J$ c$ n* L6 b k: `2 @(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: \4 m( x; ]8 _- v {there are some memory breakpoints set (dr0 to dr3) simply by reading their. q9 K; y; S" H
value (in ring0 only). Values can be manipulated and or changed as well: X( s$ h# A9 u' u& t" G! a4 D q
(clearing BPMs for instance)
s4 n* p' z( ]' }2 D. I! P$ _% }9 X; X }
__________________________________________________________________________
- W9 ^! B2 [0 s3 O* f
7 P& r+ n0 Y6 `1 eMethod 11
5 L7 A+ L) e5 M& F3 d- G1 L. s=========$ r# |" z4 Y. Q) ?
3 l# \' g* M7 y5 B+ [! `
This method is most known as 'MeltICE' because it has been freely distributed
* M o& ~1 m. V! d4 L1 `via www.winfiles.com. However it was first used by NuMega people to allow8 | P( w0 T2 O' V8 F: y8 o
Symbol Loader to check if SoftICE was active or not (the code is located
9 Q% \9 [- y) c% P; Y: J# ?inside nmtrans.dll).! ]5 A( z' E$ y* G" Q2 \
- c# D& g/ P" z# H" u; _; d+ YThe way it works is very simple:
2 N2 o: W) R) c* H/ BIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, ^, P+ j# j/ C- B0 h/ y/ u% j
WinNT) with the CreateFileA API.# P4 g3 M! x3 ]. a; }
6 @2 q' f* e. p7 [
Here is a sample (checking for 'SICE'):9 d/ n; ?; t4 T" \* i' s
; S2 H& K% |+ C9 ]
BOOL IsSoftIce95Loaded()% I4 K% L" j5 N1 ]1 ]
{
. j% y. p1 _9 v2 l HANDLE hFile;
" H: f! H( _5 U) v! R hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, L! [% P0 S A! {3 ` M& h FILE_SHARE_READ | FILE_SHARE_WRITE,
! |: m' @& s2 n) {1 S NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 J+ Z4 C) @( `; v- r6 w
if( hFile != INVALID_HANDLE_VALUE )
9 B/ y( c6 u0 c$ ]$ F {8 M) r" M( Y6 `2 ]: X0 T
CloseHandle(hFile); Z. W* M# K4 O
return TRUE;
0 G- A2 }4 T3 h9 _- D% J }
- q. j$ v4 f1 {; g- z) t: @2 Z return FALSE;
" o% z: l- p# A}8 a) g K( w2 s
" v2 W- `: r, `$ ?Although this trick calls the CreateFileA function, don't even expect to be
/ `( s- x# o5 N2 Z4 o( uable to intercept it by installing a IFS hook: it will not work, no way!' n g5 A: y. D% P, q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
1 L) `* z# N4 gservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ Q4 U; X0 ^; |% g5 {# W
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; O6 k7 V I: h7 A- ?field., y* Z2 d% O" E6 f6 B
In fact, its purpose is not to load/unload VxDs but only to send a ' B* Z" U: k0 c' J1 R \; h) @( F
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 G5 C! ^& d6 L$ M/ \. g9 n0 bto the VxD Control_Dispatch proc (how the hell a shareware soft could try
0 x" \* e7 d" O. N0 kto load/unload a non-dynamically loadable driver such as SoftICE ;-).1 g& K+ k3 c. }' S6 n
If the VxD is loaded, it will always clear eax and the Carry flag to allow
" T$ D6 [) J( C( Lits handle to be opened and then, will be detected." A" v( J0 R( H9 }, b, Y! A
You can check that simply by hooking Winice.exe control proc entry point( ~/ |0 A# B0 ?0 c- d: Y6 p
while running MeltICE.
' v4 b* a7 B; U0 h
8 Z" P5 l# Q* V
0 f+ U2 @8 p* T8 `' M- d# A. I# b 00401067: push 00402025 ; \\.\SICE
+ @0 \% _1 ]- X- a- c+ x 0040106C: call CreateFileA
7 p4 A* O1 d+ X( i5 n( C) T+ b 00401071: cmp eax,-001
0 d' D) `" X0 k3 {" [! ? 00401074: je 00401091
) b$ U/ g; l1 q' t9 M0 R
% Z% X" B1 U( V+ u7 T6 l7 r4 M
* ?# W5 Y1 \& _1 m- h9 }There could be hundreds of BPX you could use to detect this trick.2 B( @5 o& P! }7 G9 [1 x$ g5 N( ?
-The most classical one is:
$ v- B8 R) }) z l+ k BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||% f) O+ F6 P, i# o+ D
*(esp->4+4)=='NTIC'
" s0 n0 v' N, ?. `4 y* Y3 W% {, w o7 U2 @
-The most exotic ones (could be very slooooow :-(( O( A" N4 Q+ t2 Q+ Z+ a$ S
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. W; E. g! r5 Y ;will break 3 times :-(
/ w) f) M. W3 z" y. B. a4 o
' N) G( O5 ]) F' L2 P7 F) j5 @9 J-or (a bit) faster:
) u; h. v1 L6 k+ x1 M( } BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 [5 i, V! m# Z7 o; b3 {$ h! v0 ] I
]7 n" [& K& a' ~
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' / d) @3 V. c" j& u! l" u g8 D* d
;will break 3 times :-(
" }9 D5 g0 Y5 f
7 F" x$ E$ U: s. \* u G-Much faster:7 D0 [% r: P3 T/ Z) N7 q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( j& G' ^/ y" T, r
/ ~6 O* H7 k' |1 s# P
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen) _' E1 O6 D8 @3 U- h4 K: z1 r; r; V
function to do the same job:
7 _$ t/ r) o: l8 j- d
- R5 V% O/ F, h4 j# @0 P1 |3 m push 00 ; OF_READ
) \* Q0 J% J$ j3 ]( h. T mov eax,[00656634] ; '\\.\SICE',09 Z8 e* a9 m+ x" t* x. V
push eax
( B7 |- w! s8 L5 r call KERNEL32!_lopen
& r" K# D6 I% P$ X1 J* D inc eax
, p9 e6 _1 u4 K! n& d jnz 00650589 ; detected
/ O% b0 S! d; G4 h" ^ push 00 ; OF_READ
& @; ]4 P, I3 y2 j mov eax,[00656638] ; '\\.\SICE'# _* _. Q5 p4 w+ g1 [
push eax
6 o7 Q" u7 P& X call KERNEL32!_lopen# ?. S5 V) S. w0 y. [3 S6 N' J4 P
inc eax! a4 z3 S2 {' U) p
jz 006505ae ; not detected
2 B% d6 E) z: O, s3 ~+ X' Z4 b9 [" W: N8 o4 Y' ~; d
z' Q! _! y6 U1 `- `__________________________________________________________________________
6 |: }# a9 ?. f9 \% }4 i& H: S, d" R# [
Method 12, S+ c; m; T0 d ]* G7 ]! m1 C
=========
" ~& A: T* `- P) m }
/ }. N" h2 F" k9 L9 z9 M8 B" m( R: cThis trick is similar to int41h/4fh Debugger installation check (code 053 t W" E) \7 ]5 M: D; q9 d
& 06) but very limited because it's only available for Win95/98 (not NT): l& f. j. J. F- d; z2 k
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ w6 d& x: ~' }8 q' Y' u9 ]. L- M6 ?
push 0000004fh ; function 4fh
. j7 X7 u6 S+ y G8 Z4 A push 002a002ah ; high word specifies which VxD (VWIN32)
# y2 g. |4 A8 V0 F ; low word specifies which service
4 f! K6 u% s+ q/ T x (VWIN32_Int41Dispatch); t; Z T# C% N) t
call Kernel32!ORD_001 ; VxdCall7 J6 X# V+ [- A( |
cmp ax, 0f386h ; magic number returned by system debuggers
0 \' _6 p; e0 M( z jz SoftICE_detected1 x$ ?( h, Z8 v9 h
1 @8 O- z/ ^% w) L! g/ h3 H; PHere again, several ways to detect it:9 Y+ `1 i& M. ^& O+ C7 x
' |( R/ q1 w9 d# U BPINT 41 if ax==4f
' H, Z2 @# C7 K6 f H
4 G! |- L2 ~5 T) C. F! F; L BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( V' e/ h1 V9 i$ ^1 p
; V& n& Q; U/ G: f8 H BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
! F! k2 ~. Q4 Y1 ?! o
0 E& L! b" d* n6 X+ \$ {* I# y BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!- `+ m9 a" a4 A1 t2 m
- H' d o9 p% X" K# b
__________________________________________________________________________
, M7 x2 H. [: \3 v! {; ^ A$ `2 H1 f* N3 k2 m& w: X
Method 130 s2 c) U3 f( P$ }3 p* A, n
=========
- z: ` M' ` y
, i: _& D8 A4 ~% R( ^Not a real method of detection, but a good way to know if SoftICE is
6 {1 d3 t" K' V1 f3 {6 j& Q, Ainstalled on a computer and to locate its installation directory.
% | y8 H, P% k3 e6 V+ q' EIt is used by few softs which access the following registry keys (usually #2) :
0 k0 X, J# e9 }' _/ f. w" M% @0 T5 z& K5 k
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ m( z3 l2 ]3 J\Uninstall\SoftICE
/ q" c$ U1 \0 ]2 J-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! E; _$ {- y5 [2 y: j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 o+ W: h9 h" u% t1 s\App Paths\Loader32.Exe" s/ s; K4 A& ]. t3 ^+ e" C: d
+ t2 I" N6 k( `& {. c( R" U
: y1 [. N4 o) P2 Z: J! N+ e
Note that some nasty apps could then erase all files from SoftICE directory# i+ b& D) r4 ~; ~' J8 Z; P
(I faced that once :-(" c/ d* k( S- }
3 `3 o8 j6 r& G" uUseful breakpoint to detect it:9 K! [" o2 Y5 e7 {8 G
# r/ z2 _' J* Q* ]9 J- s$ \' ~ [- t- f BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
: X3 k2 @; l9 J5 _
3 @$ x2 p' m' X: ]/ I8 V- i" u__________________________________________________________________________
7 {+ n, k0 C7 S- ^. |% p/ b/ Z
) O. q3 O! V% R4 O, g4 O8 E2 U) X D/ A; y1 n: B3 J ]; [' |
Method 14
! x9 W' [: M7 [8 X% M. Z=========$ m2 Q( k9 M! c
# n: i! C" P' y1 V, O' hA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose5 `6 {* S. j" r3 {4 K9 y W# @! B% @
is to determines whether a debugger is running on your system (ring0 only).) A7 S! B: u6 [! N- s' L$ i
3 T4 j" l+ ]8 M& }% H( a VMMCall Test_Debug_Installed) K9 ?2 p. P' ]2 S4 Z) a" `4 Z. b( H
je not_installed% L: L. z7 M$ g8 Q9 K
: K. u/ U9 G& O7 c2 ?+ A
This service just checks a flag.& f' R& H6 q5 @+ [: G! I) S" B) U1 h
</PRE></TD></TR></TBODY></TABLE> |