<TABLE width=500>( {6 e3 _$ v+ n$ Y4 |2 g
<TBODY>
- }: Y- ]% u* c<TR>3 W( ?. F. H- V+ Z7 r# b( W6 i
<TD><PRE>Method 01 ; f7 N; x; B; F# T* u& l; d( E
=========
% O( k( c) ?% e# w1 K- B' t# t
0 C4 c2 z- F% j1 F& \$ c/ SThis method of detection of SoftICE (as well as the following one) is" I0 D5 Y0 U1 ?' h
used by the majority of packers/encryptors found on Internet.# m+ w ^8 q1 e# G! j
It seeks the signature of BoundsChecker in SoftICE
- `+ ^0 Y; u: {
4 u) M3 X* D2 P( h' Z( h* C mov ebp, 04243484Bh ; 'BCHK': ?3 n5 }* R& B# c
mov ax, 04h8 H* S# w: }" Z( i+ ^- u6 q( n% `8 z
int 3 1 o7 X: [6 [# U7 g& A
cmp al,4( O; h6 y( k/ U9 Q# J7 U0 C
jnz SoftICE_Detected* ` T4 \( G9 P# L8 N, D0 K
: o1 m- V `* A9 X
___________________________________________________________________________( \9 n3 @/ z7 u* X, w
: u# F8 J4 f6 e% y+ @Method 02
" M/ `; v- v: R=========
& [6 p4 Q, O* |2 b/ `9 [- o( r* u9 j) l
Still a method very much used (perhaps the most frequent one). It is used
+ Q$ a2 ?3 V$ d9 Z& E. ]: qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 ]" p1 u7 ` Eor execute SoftICE commands...: O. d& l- |6 \1 F/ f
It is also used to crash SoftICE and to force it to execute any commands
# X- q, `/ _* L4 i2 l! V6 \(HBOOT...) :-(( ! T7 N/ l, k2 v% r/ Y
% |! p8 r2 S- R @9 H% ^1 E% h2 P
Here is a quick description:
5 n* y$ i- Y& H. o* B-AX = 0910h (Display string in SIce windows)1 r, B# @1 x0 U C
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)/ t* f6 ~0 N, i* h( Z5 _* A3 W
-AX = 0912h (Get breakpoint infos)
3 e4 ~8 O( ~( y9 w4 p-AX = 0913h (Set Sice breakpoints)( s" Y5 }4 W% J4 R0 K" F
-AX = 0914h (Remove SIce breakoints)
/ p X4 s# g( j. W* U3 T/ Q
?' ^* L) u! W4 |7 v; xEach time you'll meet this trick, you'll see:; n! T9 c+ V% X7 I) T" v
-SI = 4647h
5 ]1 J/ m: D) |9 _-DI = 4A4Dh% ?. U; C% y" _: }4 P+ ?0 }: ?
Which are the 'magic values' used by SoftIce.
- t( A4 o0 G3 L7 G& T+ @For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 R' p4 H6 h) |" i8 e
1 ]% G3 ]. @/ w8 g8 ?Here is one example from the file "Haspinst.exe" which is the dongle HASP1 M. ?: E/ ]; j+ W
Envelope utility use to protect DOS applications:
- V6 S$ a: z. @' s4 x2 u- l, c# b) X7 y9 d- g
% i& J- M0 i; {% b4C19:0095 MOV AX,0911 ; execute command.
' r, U" t1 j0 F t F4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
8 i% W1 r6 ]; f R% _8 g5 k& {4C19:009A MOV SI,4647 ; 1st magic value.
4 h5 W! S4 C+ R8 b; k4C19:009D MOV DI,4A4D ; 2nd magic value.
# |0 a/ q+ Z7 D9 `0 g4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: q: S' O7 L# b( g, g4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
3 E4 ~/ S- _2 @% }. f8 C$ D" [4C19:00A4 INC CX
3 Z) Z, @$ @ N2 W7 L' W4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. N* i0 X3 }3 M* S4 |/ a
4C19:00A8 JB 0095 ; 6 different commands.
9 d7 E; Q S5 C- C/ k4C19:00AA JMP 0002 ; Bad_Guy jmp back.' [% p& Y+ P' J( x5 Z
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)& F' |; `% P6 N& p7 E" o
6 q7 ~$ W( H7 a! H6 ^; {The program will execute 6 different SIce commands located at ds:dx, which
4 M( H4 x: l, f6 l- O" Z% rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( \% A* M; P3 N- @8 Q2 }$ W
6 ]8 q2 ~7 p3 {% u) A: u) i* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
b) [+ ?/ G, D0 Q6 V___________________________________________________________________________) c5 N( G. Y( {6 V
& @1 D: a$ @: K4 P& a2 @+ S u& Z9 Z
Method 035 c/ o# Z6 f8 g& r
=========
9 D$ P& {# l: r9 x2 R$ \
& |$ @4 N# z$ Z! Q& F9 e+ hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 O* l2 T8 W' I/ Z
(API Get entry point)
% ~ M+ G; {. l4 C# y: q6 f 1 V8 x9 i& ]1 Q" ~! X% S" \
6 X6 N. ` k8 M, b) b- x; p
xor di,di
/ O) f2 D* y( M+ {' l8 Q! ^- |# h& O mov es,di
% K- O! e' J) ?- z" A _ B7 t: q mov ax, 1684h
% s0 l" C! c z mov bx, 0202h ; VxD ID of winice: t" H, _ M9 u5 {' d$ t2 K
int 2Fh
" W w5 ?8 D% ] mov ax, es ; ES:DI -> VxD API entry point/ x4 ?) w' `2 X8 X& h
add ax, di
; m, c D# Z# {6 a% A test ax,ax9 w" n4 b3 L- ~& J
jnz SoftICE_Detected
. ~5 Q b3 `" ]3 V4 d& g1 t0 u) u0 Q8 T8 B
___________________________________________________________________________5 w& A7 }) n) u! ]# @; a8 }
+ j4 w- G# Y# s+ s# J {" \2 o
Method 044 f S0 n" m8 E; I+ h8 A/ v% U
=========
! F, B7 e; ?6 ~6 u+ t, `" I& N1 x/ a$ i1 g7 i9 R- {
Method identical to the preceding one except that it seeks the ID of SoftICE$ D, N& F8 s; A" W: Q/ ~6 U' R
GFX VxD.' z$ }. |% I! Q; m
! |5 G) N5 p4 Y) m r
xor di,di
2 [ P r O4 F. T# N* V9 J, F; l mov es,di
8 z; s, _ J* {* O mov ax, 1684h ! N) I: s# T4 V- |6 s8 [
mov bx, 7a5Fh ; VxD ID of SIWVID
6 Q. d# O7 F4 r int 2fh
7 H9 w9 M) j2 P o, B mov ax, es ; ES:DI -> VxD API entry point
. i) q. z( N! L" g# d; V4 ] add ax, di9 N1 `! O$ v [4 S6 }+ h
test ax,ax
: y6 Y; {# J) q, U jnz SoftICE_Detected
/ p8 u6 ?8 g" N( M0 W Y+ Z
- Z: v7 v& q- c, _5 ]2 L__________________________________________________________________________
, R D! R! |- T) R2 [
6 u# l* g! u8 r+ S& v
* w% n, J3 Z* a$ q6 e8 l4 w6 tMethod 05& O( E* x$ h0 Y0 z- P \+ ^. v& x9 x
=========% {2 @ U9 n( x: c6 @
( o0 I$ [' Z% j7 R' d/ ~, x. ]Method seeking the 'magic number' 0F386h returned (in ax) by all system
! P/ n6 v+ [& L5 ^2 R' _1 g! ~debugger. It calls the int 41h, function 4Fh.) O; l9 p9 j' w! M2 w
There are several alternatives.
+ E+ J, p& T$ P: R' |8 w9 I
" N3 W: N2 g$ Q/ t2 b1 VThe following one is the simplest:4 A" t/ J7 p8 z" v2 ]# `' r
% W7 l- e) H6 e. V) w# U mov ax,4fh+ C' W" m5 U( W1 z" a& d
int 41h3 g2 {: E; j! b. D
cmp ax, 0F386
# [8 C$ v; z) V* [ jz SoftICE_detected# k% C- U0 }% A4 d
: }8 i Q* q! X" i' A- ?$ `
% I& y( Q" a q' Y: {) c7 p& U
Next method as well as the following one are 2 examples from Stone's
$ ]' i4 T/ G$ i- u* A) i' d"stn-wid.zip" (www.cracking.net):! i% I2 } K j9 e' a7 \& @ P
) x7 R' v& U! h mov bx, cs. z7 [0 w; G2 X2 ]3 m
lea dx, int41handler2/ X+ ^: {9 }" e9 q! d
xchg dx, es:[41h*4]! }4 q& H& r8 I" D5 i* ?
xchg bx, es:[41h*4+2]
/ |& H7 J5 N( Q5 i& { mov ax,4fh3 Z6 D& W1 Y, D0 g3 O4 K3 D3 y! t$ c
int 41h
% Y6 e1 r3 E- ^# p xchg dx, es:[41h*4]( K$ R$ a- [9 X1 P7 ~8 U: z
xchg bx, es:[41h*4+2]& V+ F% G3 t2 g6 s1 S* H
cmp ax, 0f386h
4 H' w1 f6 | a3 e/ E jz SoftICE_detected
" m X% k( ]7 s6 p2 ^6 F n$ ]) G$ P d
int41handler2 PROC
8 S8 i* X* _) d, }* Y5 i iret/ N; \- v) e8 `$ }( J
int41handler2 ENDP
3 S7 g+ `: }; W) }3 \2 b' W; ^
+ u/ r: Q' G5 \2 k2 W1 @! f
9 F; }- H0 K5 ^1 r: W0 P_________________________________________________________________________& {: j/ p0 ]$ [5 A% q
) [# H' Z% n5 S
8 ] u: a+ N4 \- c1 j* u% PMethod 06
4 @7 E. q5 W6 A. x=========. Q G' m# R2 w d7 a& I' G1 \
) S( J" ^1 Q% a! W) P1 a; z' G
$ f/ h) e$ k3 R& \
2nd method similar to the preceding one but more difficult to detect:1 O" h$ Y. ?3 \( m$ Y) s" d; Y3 L a
$ y ^4 q6 T7 {; g
* O7 I2 ~" @$ _# x* F: @int41handler PROC
, D# ^; R$ a% z3 f* x6 b- B! K mov cl,al7 ?3 ^3 {; s2 H# ~! w8 [
iret
7 G) X- A; \# f* pint41handler ENDP
$ s6 Z- g, t" B: h9 d8 [2 I! ? g1 j2 H
) r# C$ ~! v% \+ A xor ax,ax$ n- h5 N/ |( ^: |3 G9 v/ X
mov es,ax/ B0 Y% @/ ?8 e$ e$ d. [
mov bx, cs* ?/ ~& F& j) b5 R. [
lea dx, int41handler3 S8 i7 d) n' w. Y5 n% p! L3 F
xchg dx, es:[41h*4]3 ~0 o3 l; g* o
xchg bx, es:[41h*4+2]
* _& i8 r& d1 z5 | in al, 40h
0 \% u" e- I( c1 A" T& ^ xor cx,cx1 K6 }9 U5 W0 l/ O4 c9 }2 ~0 `
int 41h% P r8 y! S! ?, ^8 d
xchg dx, es:[41h*4]
4 `7 n5 E" n# n" Q' w xchg bx, es:[41h*4+2]2 Y# [4 ^/ B+ D! ~+ d% I, J
cmp cl,al
* j, |( o6 L3 r B& U' F jnz SoftICE_detected% ~( K: ^" O' w; X" C c
0 d% a5 W! ^5 f4 A
_________________________________________________________________________/ {. L* D# b9 H
& L- ~7 M$ ^' Q% U( ~ z" V0 N+ qMethod 07
' N; [+ j; S( e9 a" @=========
8 q; z; U- G) z+ _' E+ q
- q7 l: Z0 }% u4 o. M; hMethod of detection of the WinICE handler in the int68h (V86)4 S6 F4 O _# @. _+ I" V
& R0 C6 ~% Z9 F; x+ L* z2 { mov ah,43h' Y4 z e4 W7 `2 ]
int 68h
1 I% r$ [) A4 ~$ N4 W% |& v cmp ax,0F386h
2 F4 e0 L1 t1 m" _1 Z/ ~ jz SoftICE_Detected9 [* A D3 D) o! V, B3 s; C$ P0 @$ a
% `- o& ]: L& U3 _
* \9 ~( ]6 O% M. E0 s=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit( Q+ n# z& ~) X. }
app like this:
/ P g4 p4 u2 X1 {0 v
' }/ ` v/ U: U2 s+ k( q' h0 B BPX exec_int if ax==68 {% Y0 s% r5 W/ H% Y7 H2 Q+ d
(function called is located at byte ptr [ebp+1Dh] and client eip is K9 t/ F, o7 s! B/ T' [" K
located at [ebp+48h] for 32Bit apps)% }, q5 c8 P0 B) u, {& {9 z ]7 ^
__________________________________________________________________________3 _0 n1 f$ j9 P* ]6 g9 H% t
) v/ n+ N4 H2 c, A
. r: e+ b/ w- b) ~
Method 08
: y! |8 d$ k& j% u( r8 n=========
1 B6 `/ J. w9 X! h; X
6 k7 G4 s# W) ~( s1 yIt is not a method of detection of SoftICE but a possibility to crash the
! T5 M- E' ~9 @3 G' dsystem by intercepting int 01h and int 03h and redirecting them to another
" G- F. {! a0 F, x6 l$ T: Y9 Zroutine.
7 {: H G% O/ P3 q/ vIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) A2 A0 b, i, F4 i# |
to the new routine to execute (hangs computer...)* s* f: e1 f/ Q0 I, d- p
# m% I; a. j! N5 ~. R1 u
mov ah, 25h& j5 C2 }, C4 X! `: p
mov al, Int_Number (01h or 03h)/ ]) t- H, m6 v
mov dx, offset New_Int_Routine
0 F3 N) _! H' g' Q int 21h
* L9 s& F( G" T* z- Y/ B- v* w \% X- D, O4 p
__________________________________________________________________________ ?* h! j4 h# S( M0 o5 Y0 K
5 t' s: M& F K1 m% C/ f6 k4 `
Method 09% _8 \" Z. k/ t6 e
=========/ I) a5 c: X& c' ~
$ T3 R9 g0 P+ z4 U% m
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ i! P7 j* I) `# {' ?9 c
performed in ring0 (VxD or a ring3 app using the VxdCall).' z5 e6 k% h0 C8 K1 G* A) i
The Get_DDB service is used to determine whether or not a VxD is installed
; C3 `# j; [+ \/ [% o7 zfor the specified device and returns a Device Description Block (in ecx) for: _4 y4 l: c8 q/ o. A" y4 g
that device if it is installed.8 O1 r$ E N$ ~. _3 [
' O; Q0 m: Y9 x9 R' } mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% Y2 {* ^! H. o- M8 k+ ] F
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* n$ o. G1 ~1 s* b2 R, r+ Y VMMCall Get_DDB4 @% j8 a+ G$ M" [) r6 i8 d6 R
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' ~8 ]8 l3 [' C, b; B
. {$ L% w% V# }% f; vNote as well that you can easily detect this method with SoftICE:
. A' b0 ^/ D' ^* @# P5 \ t bpx Get_DDB if ax==0202 || ax==7a5fh
6 _2 d+ k* s6 s1 y+ d+ |0 {4 B: J! n7 b
__________________________________________________________________________
8 J) N+ ^/ r6 ^
& V6 h0 }- v7 {Method 10( W: U' H( u- G$ O: ~1 t
=========
% A. T% j, h# L0 N2 Q' D3 R# W( Z& W& m
=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 k% K# v* s7 m2 K$ ^ SoftICE while the option is enable!!( g" w. y7 R/ K) I
' n1 }6 e9 h) N) D
This trick is very efficient:: M+ ~3 ]. F# _; _4 D3 F3 p
by checking the Debug Registers, you can detect if SoftICE is loaded
t: @* i2 @* m$ a) w(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if* O r1 x* X9 e9 z5 h L+ i
there are some memory breakpoints set (dr0 to dr3) simply by reading their
* T* \" I% B0 d8 Xvalue (in ring0 only). Values can be manipulated and or changed as well, U" V! B( h5 L
(clearing BPMs for instance)) \7 [; j% m( o
* L1 g3 m* R) s( v__________________________________________________________________________: i, p7 X5 ]& l* j% {# h
, Q/ @1 R1 Z- ~: K
Method 11
% d; _0 O7 ?" v3 B7 `=========
- D$ \. P6 L- o' a7 p) V7 H4 f$ T" ~; s- r8 U8 b$ i
This method is most known as 'MeltICE' because it has been freely distributed- z- C+ Q+ S2 S6 D- M( G
via www.winfiles.com. However it was first used by NuMega people to allow
2 I4 j/ y" z# j& I+ a! f3 @Symbol Loader to check if SoftICE was active or not (the code is located, [3 |) ]: i8 n9 l) c7 F$ e+ r4 `6 N5 y
inside nmtrans.dll).
8 ~" N/ u8 g5 J3 j8 d5 E; I# g( T0 H% d; }: O
The way it works is very simple:- V$ q, L/ q7 v" T
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for ]5 l3 u2 u/ K/ m5 |: v1 J7 E
WinNT) with the CreateFileA API.: s# v5 G9 B1 z
% S$ Y4 I, l/ w6 ]6 e6 P# E& t
Here is a sample (checking for 'SICE'):6 i4 U% ~7 x! D/ G5 ]8 |, K
6 H1 ~" j- P6 C6 X: P
BOOL IsSoftIce95Loaded()
( [5 d+ |/ s; S, z{
/ l7 q) H0 l# g- D* p HANDLE hFile;
( k9 ^7 I6 ]2 L% f hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. q3 t; i3 N' _( Q' K FILE_SHARE_READ | FILE_SHARE_WRITE,! U/ @% i E2 O$ O$ Q* r; m
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 K2 a5 c- Y: A
if( hFile != INVALID_HANDLE_VALUE )
0 c3 J' G9 n9 A5 ]+ ]$ { {
: w/ _9 {% E# w4 ?3 S CloseHandle(hFile);
3 d1 i+ E9 u F2 U return TRUE;$ M1 y) @: w. m2 L
}- g# F* n$ d8 I) Z
return FALSE;; t& c0 S: f) S/ u" m+ Y
}
: p# Y+ Q: ]4 s! U$ l% O
& K. r M( K1 s) d: I- GAlthough this trick calls the CreateFileA function, don't even expect to be) s K. b8 m. J( [. X
able to intercept it by installing a IFS hook: it will not work, no way!2 f- T; n; E* D; g! [8 U/ y' @
In fact, after the call to CreateFileA it will get through VWIN32 0x001F5 \; N* m1 @4 K; Z6 E# l
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) l0 ~' ^; o, [" W- h: A- M% wand then browse the DDB list until it find the VxD and its DDB_Control_Proc
, {& [2 x Z) zfield.
* S; J# k* \/ {6 }: w- GIn fact, its purpose is not to load/unload VxDs but only to send a
; Z7 m$ t( Z3 c' P, LW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 [ \* t$ o# Y7 e, L6 c7 |; e) Nto the VxD Control_Dispatch proc (how the hell a shareware soft could try4 j, c% c% G: |6 _2 U }- m, `
to load/unload a non-dynamically loadable driver such as SoftICE ;-)./ l. p: ]' N; G1 G# O
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ G6 L5 N* i' r4 A" V4 m
its handle to be opened and then, will be detected.
: W# o$ \% t9 Q2 g6 Y3 v! I% Q( eYou can check that simply by hooking Winice.exe control proc entry point. ^# v9 D( O( u h7 }
while running MeltICE.) f! S K- ]( }* s7 y
, i- t' ]) t# o; b
* |0 O v: D2 r- D7 m4 @ 00401067: push 00402025 ; \\.\SICE: ~2 ~! `9 w% c# }) }6 W
0040106C: call CreateFileA; W/ A/ G* R3 C5 @# r# ^
00401071: cmp eax,-001
8 q- M. S0 u) _- f }" m 00401074: je 00401091
: ]" ^6 f/ {( b# O; y" W+ d5 @
/ X+ r% ?7 A q! z, n. f
+ X6 S: U a" H+ cThere could be hundreds of BPX you could use to detect this trick.3 p( N& M: r; p( ^0 ]& _1 }5 o. L* A1 Q
-The most classical one is:
, h5 k: |6 X5 v% e BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ c- t& }+ {3 _3 \9 e* E *(esp->4+4)=='NTIC'; |3 R& I% z2 e4 [! P, c% Y2 w
! c! ]) p/ _: x# C-The most exotic ones (could be very slooooow :-(
- T/ S0 G8 a: D4 m7 X2 F% l0 p& ` BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( X6 I5 a6 q$ ~ ;will break 3 times :-(
: P, C {! m4 [+ A5 ?3 x( R: f8 l# O7 V
-or (a bit) faster:
3 W9 K4 r/ y. C4 B% Y& [ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 j+ X3 |* I% d5 A' T7 a
0 l2 w$ p, L; T9 o BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' " S4 O# Z/ U- I* F* K D
;will break 3 times :-(
& `6 C0 L* I y; E9 i, |+ z; K3 d! m8 F5 K. d3 y) S% v% m
-Much faster:
, ^3 k/ }8 R2 u6 o" g; T5 q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 `8 f, B' R7 {( b i
8 C2 g# o$ k& CNote also that some programs (like AZPR3.00) use de old 16-bit _lopen( |4 F% z J* ~0 @
function to do the same job:
/ c+ Q! }- `% x7 J V9 Q
( j/ K0 |2 ? A: F+ t& X7 K7 ~ push 00 ; OF_READ
& Y M7 K6 O( u, `" j mov eax,[00656634] ; '\\.\SICE',0
7 b! K& V& S5 O [/ n push eax
3 e& X0 B# O+ ^, n call KERNEL32!_lopen
& i- ?, V+ ]! w/ q7 a @ inc eax0 v& x: m; D5 k& r! o
jnz 00650589 ; detected/ B, u, H3 Q$ F/ ?( E. r/ W
push 00 ; OF_READ0 C2 ]9 b( W: j0 t
mov eax,[00656638] ; '\\.\SICE'6 T4 q2 m( b$ q# h! q
push eax
& L' i7 p1 N0 A% }2 C+ Y call KERNEL32!_lopen
' p, d$ {0 F+ c, C' c5 Y inc eax0 A: X0 K# H" I7 B
jz 006505ae ; not detected
3 K: h2 A3 T$ s
% \# w% P. t1 C" C
1 d% t$ z: i2 D2 O__________________________________________________________________________
, F) N6 [ s/ ~7 W
/ Z6 b/ C @1 M) T" |5 n2 CMethod 123 |/ l0 w8 ~) N: _! O8 ^' B
=========8 h& O7 k7 B: I5 @( z- ^
, E* q$ N4 ?$ H* h$ }. w* u3 L2 nThis trick is similar to int41h/4fh Debugger installation check (code 05
, i: d& X: Y7 `. ^3 O& p& 06) but very limited because it's only available for Win95/98 (not NT)' d6 K' f+ s5 n! G! `& `1 l$ ?
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.! f6 |2 M- F; b1 _
r, L/ i( b! X' |9 h- ? push 0000004fh ; function 4fh
+ |; E1 o w; r$ Q push 002a002ah ; high word specifies which VxD (VWIN32)) g: s1 ~; Y) I' ^9 w9 ]! L& T
; low word specifies which service# K) _, |8 H0 q% |
(VWIN32_Int41Dispatch)
9 C. X& A5 O* I3 W call Kernel32!ORD_001 ; VxdCall
+ U0 I% C+ `% J/ Z: Y cmp ax, 0f386h ; magic number returned by system debuggers6 L' v3 `7 s! g: m* o
jz SoftICE_detected
& Z" u U( R, G: p5 y. Y, ^ ?
Here again, several ways to detect it:
. T; S( m4 U! Q6 p7 s
3 l8 v* n, a: ?7 P BPINT 41 if ax==4f: i. M! o- o1 F. ~5 d/ L1 P
9 ?3 z6 m2 y; O
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( i/ E7 y& [, J. s* d6 T" b- V. r
2 b; i9 c2 a) @5 C
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' \& _5 ?2 U" C% T) b& a( ~9 R& L; |
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
) H- c# E; h$ t9 E
% c- N6 O. u$ K% Z4 d4 T( {! b__________________________________________________________________________3 I$ X2 o% x; z- d1 t! Q
. F4 E4 ^3 ]( k3 AMethod 13! B. w( h! O; v) i' J0 l
=========4 i- N0 j4 K: m' I3 c
/ E; Q- }* Y9 H$ Z# \( F
Not a real method of detection, but a good way to know if SoftICE is
6 A9 B4 [- O$ E3 l, Cinstalled on a computer and to locate its installation directory.
% m' ?! L) Z8 W2 R8 _% w6 JIt is used by few softs which access the following registry keys (usually #2) :
4 I/ I( J0 L+ z% g, d0 o+ A' L3 s
/ \ R) x9 g8 @4 x. I-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 p+ B! k$ ?1 x' C7 B% u8 }! g\Uninstall\SoftICE
- Z6 [4 w+ h' W3 e" S9 C% `) K: k" n-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* h7 L7 Q# a9 J8 M3 ~4 ?& i* F9 q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion U& X# d5 A' g0 {* z5 R) ?5 |
\App Paths\Loader32.Exe
, o3 S+ Y# x1 r& c! O2 i# D
; U, m! w5 D. I& W& \( G L
$ P9 W+ v& g3 ^: p: t; UNote that some nasty apps could then erase all files from SoftICE directory
& z" V8 U) D+ l! c- c y! {(I faced that once :-(
5 g2 ]' O0 H8 z: }+ X0 S H4 v& c: k* d5 P) m
Useful breakpoint to detect it:' m0 C; P$ I! }3 o3 |& `
# }9 R' d# Z, L5 n2 H& O
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'$ [: Z" e! Z- v& p* K& ?
( Q- D4 |$ T) V2 j- B& Q) {/ ?6 |__________________________________________________________________________
) E" T: W6 t' {1 m& M* v
* ]+ Q8 T6 J- i: M) J
/ c/ \ c; |0 w5 ]3 Z" q! ZMethod 14
* m/ l5 S5 Y* q: s. Q=========
# x( z' ]7 y7 j. d! `6 [
" m- p; _9 Y& y) G. NA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, P5 [% l5 S4 W& e1 @
is to determines whether a debugger is running on your system (ring0 only).8 M8 O( \; \' f* L' n2 q
1 s. Q6 \7 P' ~% C1 K% L VMMCall Test_Debug_Installed
& o6 Y; }. s$ Z" T9 Y6 O: ` je not_installed
; ]& |+ ? K5 n! g
. I* D* R; p4 D' b) C* p' T8 rThis service just checks a flag. O( o0 N6 t! e$ w1 n3 g
</PRE></TD></TR></TBODY></TABLE> |