<TABLE width=500>; b9 w0 _" J) P: G( L# R) z
<TBODY>
# E& ?- u$ X' Q0 ]<TR>
* t! H4 K( H5 n: ~" w% a<TD><PRE>Method 01 7 E& ^4 v4 B$ Y
=========
8 ^7 I1 ^$ `' I! z: h; W& r" l8 E" E. q" \& K5 Q
This method of detection of SoftICE (as well as the following one) is0 @* ?/ U+ ~- Q' C" P
used by the majority of packers/encryptors found on Internet.
3 w5 q1 T1 h1 v4 aIt seeks the signature of BoundsChecker in SoftICE
7 \* `2 R. j0 I& l& O- q0 x1 G! @4 t# }6 R! Z% @8 ^/ g
mov ebp, 04243484Bh ; 'BCHK' g7 r6 b! A! h7 Z
mov ax, 04h$ }8 C! I7 a/ ?/ X7 I) F4 V' d
int 3 ; T3 i) x: Q0 t( v- _4 G4 K
cmp al,4
5 f0 l) i6 H* m; K jnz SoftICE_Detected
' H7 Y' K, s# K! c8 n0 ~
5 W: G8 Z& d+ M2 {___________________________________________________________________________
0 J+ |/ i/ O$ q6 S+ r/ V3 e9 ?' n( B' b8 V* h( z, c
Method 02
9 X! I5 x; a) @4 y0 o( u=========& z8 \$ s# B3 K: F2 B4 P# V. f
3 K; G% E* }& S& u8 Y1 p
Still a method very much used (perhaps the most frequent one). It is used
3 \. ]5 P6 P; y( Uto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ Z7 V' b& O D9 }or execute SoftICE commands...& Y# R. t4 t5 C( q1 V0 _
It is also used to crash SoftICE and to force it to execute any commands0 S+ ]$ |; q! h% e
(HBOOT...) :-(( 4 |( A; G' `# O
6 Y5 o4 _$ }. e" l, K4 h
Here is a quick description:- h% Y5 N b- W! N2 V" n
-AX = 0910h (Display string in SIce windows)) A2 [1 I6 H1 p! `5 H5 b' I8 ?& v! E
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)" @2 Y& P/ w: b* S, I
-AX = 0912h (Get breakpoint infos)
/ X2 G2 \: J- \-AX = 0913h (Set Sice breakpoints)
4 i1 X7 K5 e" V$ P4 W-AX = 0914h (Remove SIce breakoints)
: m- c1 H% l& v) F) T0 S" g8 Q" R' w$ ?/ D
Each time you'll meet this trick, you'll see:
( Y/ r/ Y7 \' _' k# d& c% m L-SI = 4647h6 u2 y) u1 E2 \& t$ r) @, n F
-DI = 4A4Dh) \2 J5 ?9 L4 ^
Which are the 'magic values' used by SoftIce.
, i h' K, Z P. b* U6 yFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
4 K2 N, F( a' K' r }$ m0 ]* Z7 E) h7 Y6 P5 Y5 q5 d
Here is one example from the file "Haspinst.exe" which is the dongle HASP
& A( X5 Q0 U% SEnvelope utility use to protect DOS applications:
1 \1 c3 j; W* f4 Q _1 r2 {- H1 Q' e+ ` r, d; X2 ^
2 O2 Q+ z( \3 k4C19:0095 MOV AX,0911 ; execute command.% i) @: R# D5 A; e
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
" [; T' s0 g% c B1 P0 [ D4C19:009A MOV SI,4647 ; 1st magic value.6 a. k% x% @ o$ o- V6 o
4C19:009D MOV DI,4A4D ; 2nd magic value.4 L" U: R2 _, @/ j
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
! j; e' ~, T1 I: C4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, }. J$ `1 j; V4C19:00A4 INC CX- j( u1 [9 M5 G+ ~1 P q+ w
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
( w0 y x" M, B$ {. f4C19:00A8 JB 0095 ; 6 different commands.( X2 s, t7 O4 A& Q8 i
4C19:00AA JMP 0002 ; Bad_Guy jmp back.2 Y$ q# l( {- H- ?: m
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
8 _! i( D8 o: l- E3 u" r
1 E: A4 U/ d5 o8 k# RThe program will execute 6 different SIce commands located at ds:dx, which
/ t: k, s' Z/ b1 jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.$ p0 H% Y" A0 m. Q0 Y
( D; J) R& C5 ^0 F7 ?8 P* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ R" l: m) J( \9 P___________________________________________________________________________
6 {( @+ H, k4 y: v+ Z0 w5 C
9 i% J6 S7 u* F- k+ D: B) B$ X' J3 n: e+ }
Method 03* A# ~- I/ i$ f: a
=========
! L" y& {! ~0 J# G3 i j) Z0 a$ m- Q$ K
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
+ w; y$ C' S+ w; _# H(API Get entry point)
3 x- `! R; B5 I: F
2 o+ k- N5 `, c9 c0 H, ~: T6 J% c( ]5 z5 Y# N! Y
xor di,di
2 p3 n# a5 i4 @4 s mov es,di: c4 \& d4 ], R A5 r
mov ax, 1684h
$ W' u" m Q, {4 m3 j3 ^ mov bx, 0202h ; VxD ID of winice* S; v% v( }( {7 Z" {
int 2Fh& t8 I# Z* v, u9 C9 i! v; Y
mov ax, es ; ES:DI -> VxD API entry point1 c: r5 l! U, e) `0 D- s
add ax, di
6 Q7 F! u; y4 r V0 H" C( G test ax,ax
3 x0 R* m* g% S+ N' \ jnz SoftICE_Detected
1 J8 z- A6 ^" Y( k' m& j+ F
I- p9 p4 S/ c___________________________________________________________________________
- y& X9 I# L+ B# c8 t* e9 s7 J# {
Method 04" _" L1 p; f; {6 ]4 z) v6 y
=========
* b, F5 v; k0 k% c- g6 C; Q+ d* v' g
Method identical to the preceding one except that it seeks the ID of SoftICE0 d5 Y Q8 z1 r! x
GFX VxD.1 J$ `5 `* z9 b
1 q7 i; D" P% l, [
xor di,di. ?# Z" T7 i; O4 ]5 Q
mov es,di- I( W: q4 ~- P+ o1 ?
mov ax, 1684h 0 {8 l; i4 z5 Y( C) M) L) B
mov bx, 7a5Fh ; VxD ID of SIWVID) ?3 s! o9 k6 y* n
int 2fh
* T! r9 S* k# L7 Q. b$ e" ^ mov ax, es ; ES:DI -> VxD API entry point
" F5 z) H/ a- j. C& T add ax, di
0 A0 g! a. i0 D" b+ q2 g |( E test ax,ax5 k: x; v' g! M2 t2 e0 f; T
jnz SoftICE_Detected
+ J( z! v" N9 Y* n' o' w9 X" E S6 \& j+ a; e
__________________________________________________________________________! |4 i5 _" Z L2 q0 }
* I6 D7 f# b* ~, z: Z
: f, [5 [3 |0 tMethod 05" ^, V1 n9 u6 X2 P5 Q( T. ~: y
=========
/ b4 f0 ]& D9 f! P$ `: k9 [2 V5 K5 A: b5 V8 g. Q( R* q
Method seeking the 'magic number' 0F386h returned (in ax) by all system R7 ]0 @' I9 }, _3 X
debugger. It calls the int 41h, function 4Fh.
$ _: c, Z) w) c$ U! }There are several alternatives.
2 t5 u/ R& b( E% a
2 ]" R& J# G7 l0 Z: JThe following one is the simplest:, K$ f* t4 g9 O! ~$ \0 ?8 z
8 @" O; T: J! l& m' ?/ i
mov ax,4fh
: C. P" C/ ~' @ I( ?0 \! o# V int 41h
# L. M/ h, {5 G* T cmp ax, 0F386+ ? ~: O8 P! G# g1 S
jz SoftICE_detected, q% x7 h. E8 Q( r
! {5 F: b* E" @9 Z7 }( \$ H/ J0 w0 h' ~% d2 ?! k* L1 O% _6 E
Next method as well as the following one are 2 examples from Stone's
6 `2 E6 A; b7 o0 w"stn-wid.zip" (www.cracking.net):& M5 k& u' H# m
; q! w+ ^7 z& l" d- @4 O8 C8 V
mov bx, cs/ x9 ~" U0 ?2 |1 o, r$ f4 M6 W" }- \# `
lea dx, int41handler2
$ F* V: }) H+ Z) s. X xchg dx, es:[41h*4]1 R' y# @. x" o* ?
xchg bx, es:[41h*4+2]" F2 s7 H# J3 n- }
mov ax,4fh
; k r4 s( I* G# ^5 S2 D$ G8 N+ S int 41h
c+ @, [/ t; L xchg dx, es:[41h*4]4 R1 P4 @5 C/ l2 k- T5 i2 X
xchg bx, es:[41h*4+2]
6 p6 k9 e- B& Z. q9 A/ b cmp ax, 0f386h% E% { ]8 a7 Q5 f+ B- h1 l m6 a
jz SoftICE_detected
8 M6 J6 n, C9 _; s. c7 S" S9 p
: H( Q* N8 D4 T9 R8 X$ Wint41handler2 PROC6 L4 e3 R# u6 q3 @* i1 E1 v/ D
iret+ w3 ]) g& i- p3 ^5 [* l
int41handler2 ENDP. a0 D2 v# `5 V- Y9 Y
2 h3 J8 A* c, v. W
' g: f# j% D/ q2 s0 o
_________________________________________________________________________
1 s8 n- k. l$ Q% P. a' g! b
- R/ J% [7 B' _$ k! u3 {* f9 r' N0 Q% g$ e% r% O1 e
Method 06
+ g% r, d/ [2 J5 G0 U=========) C8 j {6 L* o3 Q5 x5 M0 ~
& i0 e& Q# C7 u8 H' w! [
' m% ]" m: i: X4 u! a( s, i2nd method similar to the preceding one but more difficult to detect: {0 W* P& ~$ L2 P+ a) V: }
& T; b F! O9 n
) x( F( r8 r9 f% d& w: w3 H
int41handler PROC) |, e7 {- }' c+ @
mov cl,al
5 n/ B2 b5 L! {" X/ E iret
! B. T7 Q6 e, |int41handler ENDP
7 G, A& l: k5 F# q" w/ f, r
7 h8 h; l+ q' _' i. R! W% `( M' _- V4 M$ q [' F
xor ax,ax- U4 }' Y6 w/ U( B3 C/ d
mov es,ax
# g: f; s* M& s+ q. c mov bx, cs
. w5 Q; U+ s0 z' ] @! K7 M. E lea dx, int41handler" G. N$ y2 @# n, P; M! ^; d% Q' i
xchg dx, es:[41h*4]
5 t, K0 N8 ?" D6 G xchg bx, es:[41h*4+2]) k5 V; U' ~ b3 N- A6 y$ n
in al, 40h
# k z6 J b, ^) a' O) ?1 N" N# k xor cx,cx
& W& s" Y( {# [ int 41h
5 x6 v) t( o( R* o xchg dx, es:[41h*4]1 ?& v) |$ K; D
xchg bx, es:[41h*4+2]$ D" \ Q/ n/ Y9 ?7 O
cmp cl,al! g$ u8 C/ N- o ^1 e- R. o
jnz SoftICE_detected# N) O" w: G8 W- z
6 N ]/ j- N$ R: c T3 I7 p8 Z8 G# \_________________________________________________________________________2 B. D2 d; |+ X
2 X6 L8 p3 T* jMethod 07! M* i. X4 Z% n. W
=========# Z6 E! G2 Z, n( ~( N
+ U! H' Y% f1 }
Method of detection of the WinICE handler in the int68h (V86)5 U0 W+ E* P# Q% E: Q# p% o, O
" |8 i, M* u4 Q+ _+ S
mov ah,43h
: I& F8 P* P7 p; S1 M9 v5 P* C int 68h
/ K4 n8 t7 s# b2 [/ T/ _ cmp ax,0F386h
4 F4 _' _ J5 n) Z1 F; u jz SoftICE_Detected
7 Y; ?6 s* e% F2 W- C
0 l' c( a, `7 t K' R8 D$ `
6 D& o, [4 O3 i/ L O- ^=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- P; g3 {0 Z6 X7 t- F1 s* L+ i app like this:
t8 s i% K% g8 A. u. x3 o
. _$ g' r& c0 S BPX exec_int if ax==68) F: l9 m K1 ~
(function called is located at byte ptr [ebp+1Dh] and client eip is: Y) o, W& P9 T
located at [ebp+48h] for 32Bit apps)
& R, {, b+ J6 s* b2 |__________________________________________________________________________1 a) K, Z! t) G! N O) V
, x, m% o$ y; v7 E* b7 R- S% Y! d$ E2 ^5 b0 U3 ~2 ^- Y
Method 08) a! F* y5 _3 D5 j: Y
=========
4 Y# f( R! I* Z: P$ U. l* R* W' }( \1 A
It is not a method of detection of SoftICE but a possibility to crash the$ q3 h4 T9 [2 x8 ~: g5 Y8 M1 R8 {
system by intercepting int 01h and int 03h and redirecting them to another( [0 u" z* d1 w& ?8 y
routine.
2 P8 P- l: S" ^0 \It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! n1 e2 s; {9 uto the new routine to execute (hangs computer...)9 v O: O8 |, H7 h
9 ]: B( t; e5 J7 O% \/ j( T mov ah, 25h
1 s2 c( w4 E& g% }2 P! Z5 r2 W mov al, Int_Number (01h or 03h)
- _1 t3 C6 ^0 R3 }0 d0 `2 ^ mov dx, offset New_Int_Routine5 a7 z5 i2 g' m1 ?! C
int 21h5 k }+ A& Z& k# A0 ?0 m
$ ~% w6 D. o$ A& i* W__________________________________________________________________________" U9 _* R- N3 M! E( z% f
3 I% E5 H" U, [! Q: n' z& ]Method 091 ~+ s& [, A/ J
=========
' E" K: f; n* K+ c y2 K3 u ?2 H" L8 M, G ~/ [. d; Z* ^. l! p' {! N
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* h0 e. V# g$ x L
performed in ring0 (VxD or a ring3 app using the VxdCall).
( K' c5 H3 o6 `; I# p3 ]2 U( H2 q8 fThe Get_DDB service is used to determine whether or not a VxD is installed0 L/ H% `# J# h7 w7 F |3 ^5 ]
for the specified device and returns a Device Description Block (in ecx) for5 x& F1 j P+ n/ B: x
that device if it is installed.
0 p% a' L3 [/ Y& c+ o+ S& ?* @3 c3 F" @, y9 u0 @0 U2 r
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 D6 s. x' x, Q! U' O. \" L2 T+ U+ S
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# h% A7 a5 B# @* v VMMCall Get_DDB; t" q; [9 O" s: R2 Q8 H
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed9 ? S8 }- U3 r. P
+ ?+ Y. @9 z8 ]Note as well that you can easily detect this method with SoftICE:
0 B2 S, a* Q# _ n" f bpx Get_DDB if ax==0202 || ax==7a5fh: X( Y; f0 D- S# t0 _9 r, |) C
+ b( x5 ^' c) \* ]
__________________________________________________________________________3 \% y) E( F# E- c' J, b9 {% |
4 Q, S( t2 O9 a! i9 ^& gMethod 10) X) n- H1 J) P( Z9 F$ |2 L% W
=========
" I- Z4 _/ I2 T; `# d
5 }3 s, H2 @' h: F& M- o3 q/ N=>Disable or clear breakpoints before using this feature. DO NOT trace with
. d5 w% \# q1 g SoftICE while the option is enable!! [. w) Y$ V+ }) v$ j$ D/ s
; w4 f$ I1 E" e) i
This trick is very efficient:: _! E" o* R+ n. T7 N5 r
by checking the Debug Registers, you can detect if SoftICE is loaded4 C+ Y. `3 E" M+ V' K O
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. d7 m0 G% _% C
there are some memory breakpoints set (dr0 to dr3) simply by reading their& U: |! L" J |
value (in ring0 only). Values can be manipulated and or changed as well
U! Z0 m0 ]% O) D3 M' a+ z% E x(clearing BPMs for instance)# r2 s [- y" {4 D( B; m. R
9 C' Z* ]* M" Q) D) W2 ~- ^2 [: ]
__________________________________________________________________________
) P9 M/ k+ t! U8 D1 P
2 ^" H% W% j7 S8 ]8 x5 ^Method 116 M! M3 w2 `( R" ~/ V0 R- |
=========5 |" Y$ X; k/ h
y) F' H) ?% _ K3 _This method is most known as 'MeltICE' because it has been freely distributed' y8 H2 V0 ~ n" s' m
via www.winfiles.com. However it was first used by NuMega people to allow- G6 R9 I5 ~7 C2 X5 L* _
Symbol Loader to check if SoftICE was active or not (the code is located5 i7 e: k. @; u3 W
inside nmtrans.dll).
K8 v& j+ g% v/ H V+ _! b* Y3 o: W! r1 M, [
The way it works is very simple:1 \8 z/ u, V* E# X0 x
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for/ [) T- ~4 \3 n3 R& M
WinNT) with the CreateFileA API.! R* o" h2 J' c# `, F" L5 C, o. u
9 O& `# I" m" H" @- y( AHere is a sample (checking for 'SICE'):
8 h3 Z$ |! Q) A* J* z2 h4 f
$ |8 _( ` B% T0 pBOOL IsSoftIce95Loaded()
8 X) D' ^( m2 H5 T1 b{
m5 s' Z" P2 A* T9 O- \+ C" G HANDLE hFile;
: L$ p6 o. N2 J3 r hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ W2 ]9 i/ f- ^; _, {5 d, h+ u FILE_SHARE_READ | FILE_SHARE_WRITE,! }$ W& [' y/ c# {" \7 E2 B1 R
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* c- _' n) V# `: I
if( hFile != INVALID_HANDLE_VALUE )8 E9 ~! y, G& x9 i6 o2 J) N" a3 y$ ]# R
{' o2 K+ Z0 }. u) F7 y, ~% z# M
CloseHandle(hFile);
7 H; J- t: k" K% m" P# i return TRUE;
$ M Q' D/ P: h* Z7 S+ u }8 ?& e- ]- a; Y7 Q/ t9 n% b
return FALSE;$ P9 d4 b) D K6 m6 |1 ^
}
6 u! N2 W# ]' n# F0 D/ H* N0 X% X. R0 d6 {
Although this trick calls the CreateFileA function, don't even expect to be% S( C- e9 q# k+ k& `$ q% r W( h
able to intercept it by installing a IFS hook: it will not work, no way!
0 @" N# I$ E" i! [; K+ x) EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F; F1 ?8 ], p) v. s# t" W* c
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, ^" |) z8 n' @- Yand then browse the DDB list until it find the VxD and its DDB_Control_Proc1 s) M* ?8 r$ B5 f7 R5 O8 N4 u+ ~
field.4 K- K! @7 }6 D6 S: |2 Z8 }
In fact, its purpose is not to load/unload VxDs but only to send a
4 H7 i" e9 G( | C5 M0 \W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) \" l! r$ |/ \
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
8 r8 Y+ c0 `4 p" n2 D8 j oto load/unload a non-dynamically loadable driver such as SoftICE ;-).$ o+ \# l) ~0 n% W d& t, K7 ~. x
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 ]5 @& _/ ` z' t+ E. s' _its handle to be opened and then, will be detected. X' x# q+ \4 w; e$ E, g
You can check that simply by hooking Winice.exe control proc entry point
' b% o6 U v3 Q; t7 @while running MeltICE.
& B+ I: x& k8 c3 e( ^& X
0 {# G) U3 h1 S( q! ?: a$ m6 ~+ L2 V0 i8 m s& N7 ]/ R& D+ Z1 f
00401067: push 00402025 ; \\.\SICE
4 Q; S( J" g. `& X 0040106C: call CreateFileA
# {' |; k! |8 J2 d 00401071: cmp eax,-0015 q5 p! A* K/ _3 }
00401074: je 004010919 p5 }/ W. p i! [. H m9 z
- t4 q; P9 R/ l
! C% O' q3 k- R/ wThere could be hundreds of BPX you could use to detect this trick.
6 k' Y4 B& d9 P1 J-The most classical one is:' ^& ^" _* {* a3 q6 G0 F
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) _& p1 e0 ?' }* L
*(esp->4+4)=='NTIC') Q! ]0 J8 Z, d+ p! _) b
" U1 {; ~1 [- h
-The most exotic ones (could be very slooooow :-(
; W2 Q& f3 G9 b7 o/ j7 z( N BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% T2 `' t4 x/ Q% ? O5 Z o* h% W ;will break 3 times :-(
& E1 j ^) L9 y M& ^) O- ?4 T0 Z6 V8 p/ d9 Z0 h
-or (a bit) faster: 3 X) _8 J4 ?# `1 h7 G% W
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! s- B: I- \9 R
6 d4 \7 P6 d' N BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % P1 p: l9 Z" a& S1 N/ N' g4 w
;will break 3 times :-(
9 Q5 o6 }' \& `+ [5 x" J, V
) G E H: v, ?% }-Much faster:
8 }/ X0 l4 L% P( K1 s BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'- Y2 C% d) D8 W3 s. H _ V* `
6 H3 i6 ?! ~) J; I( y0 i8 s- U. {
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
0 B& V' I1 I- ^" Y, Sfunction to do the same job:
0 r/ m! x& n. M; K+ J( R2 E0 ], Q1 r) i" R
push 00 ; OF_READ
# r, J5 m- B0 c; h+ { mov eax,[00656634] ; '\\.\SICE',0& ~+ K0 k7 m2 w$ b S- o6 g) E
push eax" O5 Z% u ]. H: u Q3 h
call KERNEL32!_lopen, M7 Q( d7 X/ T) |7 C
inc eax6 }9 I8 g, h: ^# I+ f
jnz 00650589 ; detected
' R" l9 {/ Z; M- M. H! A push 00 ; OF_READ
% Y, r; y' O6 _6 r: L mov eax,[00656638] ; '\\.\SICE'
" `0 F2 ?5 N2 P) o+ y0 O push eax5 X% `2 P1 p' J" m% N5 {- Q
call KERNEL32!_lopen
3 H2 v/ N% f6 v; T9 U inc eax
# ~" R$ B+ e; Y) k/ x0 v. e4 B/ R jz 006505ae ; not detected
! c3 ^+ D X, x1 x7 g$ Y( r9 G, c2 h7 K0 J
" M9 J2 i7 ^* {! z__________________________________________________________________________. k+ c) D. m# ?# T9 ^5 W
0 X/ g% C0 O3 d9 K A, }' K- n
Method 12
u& z6 n" _) l& h! l/ v8 T/ D7 T D=========
; V* o" ~( S0 @* b' m; y( z4 R4 u$ z; T) x7 n- {
This trick is similar to int41h/4fh Debugger installation check (code 051 `. [' G/ C9 `% k! |
& 06) but very limited because it's only available for Win95/98 (not NT)
t, j$ d) {2 Sas it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 U# i5 ~7 g, b7 i, c. [3 d% h2 ?0 ~8 T
7 [% D1 j9 k- W6 m9 {( d) B/ w2 X
push 0000004fh ; function 4fh2 t# `+ i2 [* k9 n; v& X
push 002a002ah ; high word specifies which VxD (VWIN32), U. ]$ P9 |& @ Z
; low word specifies which service( Q8 a( K+ Z7 A7 u6 S5 e& M
(VWIN32_Int41Dispatch)
: A9 \# g" W" l W, G o; f call Kernel32!ORD_001 ; VxdCall/ f7 J) x* t' x- z$ T, I
cmp ax, 0f386h ; magic number returned by system debuggers- X0 G) X: t( \7 j
jz SoftICE_detected6 p% v8 F( H) r) U% h5 j, d+ `- y/ ~' {
+ F$ v+ t( D" { ]Here again, several ways to detect it:
1 ]% w2 u9 {, x/ P
& D9 w, @, K- h: I4 B- i BPINT 41 if ax==4f4 Q: [/ f {* u# [" q( N
8 t! K2 _4 w3 M t0 A BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 D1 M% c2 N- s$ F% ^' H" S
: I3 g3 T+ I+ Z. |" e. ]0 X
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 u$ M' E2 I8 i6 F3 {# E9 m9 i/ {/ ]5 J* S' a+ G* g, h
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
5 m5 I( h2 m# q" {. ~0 _
" ~! i( H( f3 Q1 q& I% A" Q% {__________________________________________________________________________
# d( O$ @. v2 j) L: Y% K
1 z! W: G7 o/ R( CMethod 13
$ ^: |0 m; f; F2 N% _=========: a9 M, Z% o1 e8 c9 ?
% z; `0 y1 X, d, R2 N
Not a real method of detection, but a good way to know if SoftICE is
X% _+ v0 a, @4 F+ W) @2 ]installed on a computer and to locate its installation directory.
8 d# H. |6 R/ s( b1 [It is used by few softs which access the following registry keys (usually #2) :
& z+ l+ D7 Y2 ?8 q& Q; Q' V* ?- D. L- c9 i, k) z6 I0 n
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& E& U/ m/ Q+ Z\Uninstall\SoftICE
0 S' }& T9 f" d. A1 Z1 d; [1 T-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
( U. z3 i( x0 p# @3 o/ c-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; n$ S0 ^+ Y7 S0 h! A. G
\App Paths\Loader32.Exe# c- A. n3 S6 y5 j' p( ], c. q. e
- w% B+ f& H% P; y4 H
. z9 Q- J( h S& `# h- `/ q8 vNote that some nasty apps could then erase all files from SoftICE directory8 p4 u6 I0 B! {0 }/ e |
(I faced that once :-(/ A3 _: }! I/ @+ f
/ N6 G3 ?' y" SUseful breakpoint to detect it:
+ O4 Z! f9 @( m* U* [( d( T1 Z5 h* H3 ^% U. j u
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. S* e. J+ h$ h! ^, S7 |
. S& s6 e2 |# Z; T__________________________________________________________________________( {0 Z1 o4 ^! x, M3 H- }2 f# b' J
, _" }8 Q/ f/ ~" ~2 G# n
) F; G+ X% w/ f# |Method 14
i: i. {) C( L) S6 q% D6 M: T=========
6 Z6 z2 s3 W0 l4 k p7 y- z( {3 w" C# f# h3 T1 Q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 i) f$ K5 p7 y! ^
is to determines whether a debugger is running on your system (ring0 only).
7 z/ ]+ K& `. `: w5 \3 s+ w& p3 Z
) \3 s4 E r4 b% F7 U7 M VMMCall Test_Debug_Installed) D- n( |8 a* z$ x8 H
je not_installed4 @3 j3 n% ~8 T! x& G: `1 l& o
3 ?0 D6 f3 K" \+ l v
This service just checks a flag.4 ~; i" h- N1 j; Z, [
</PRE></TD></TR></TBODY></TABLE> |