<TABLE width=500>
# _ G m9 e% T4 s( ~6 g<TBODY>
" f5 }5 G/ G* n) l# E+ `7 w<TR>
1 X, T9 k! {, S<TD><PRE>Method 01
4 Q+ X; U! M# K( ?( B8 ], l' K=========! A! t7 n8 f+ b/ @: t
; j+ ?) J J, H' `0 XThis method of detection of SoftICE (as well as the following one) is
* Q# R# g% ^9 M% Tused by the majority of packers/encryptors found on Internet.1 G1 \& V% S; T( E- j& P
It seeks the signature of BoundsChecker in SoftICE& U _4 i) J% T& |
6 q- @* {+ n5 f0 l4 R5 h2 E mov ebp, 04243484Bh ; 'BCHK'
% M: A* y/ W5 _3 g. x7 s. E! M mov ax, 04h8 @/ M& Z9 A% \6 ?
int 3 $ w6 {% n: \5 L1 e* V& i3 ]7 P
cmp al,4+ B* J! B3 y N" ?9 o0 q
jnz SoftICE_Detected1 a) b Z5 u6 f; M" V2 l0 O( }
* e- G' v7 l" T( ?
___________________________________________________________________________: L4 a8 h" ~, p9 A# {9 \' g4 \
9 q1 M- a2 R H: s. H( s( KMethod 02+ D+ d) E! k, w/ _2 h
=========
) H) A+ B% `0 m" o+ O5 U% a7 o( _, f4 t+ Y0 E( j
Still a method very much used (perhaps the most frequent one). It is used- S( i7 c, a4 Y7 i6 Y" V8 x8 H
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ ^: e) F' Z; `' k% u8 _3 ?or execute SoftICE commands...
* f) N# h! `' R; wIt is also used to crash SoftICE and to force it to execute any commands
; b( x- ~5 V3 \1 O d(HBOOT...) :-((
+ [% R( g; K* G! t' {7 f
. w8 z( H& X$ A d4 OHere is a quick description:
1 N, b- e8 A/ N1 E-AX = 0910h (Display string in SIce windows)
3 D/ `1 e/ d! A/ p/ @" y& X-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( I8 R1 n5 d' r5 |* Q
-AX = 0912h (Get breakpoint infos)! J$ t/ E& b7 T4 y- Y
-AX = 0913h (Set Sice breakpoints), f3 O: o! }6 q: H& W" t5 o7 r
-AX = 0914h (Remove SIce breakoints)
; j. p) _7 R5 L/ B
1 p8 m9 O# |! k+ r6 o2 T2 iEach time you'll meet this trick, you'll see:$ s: U3 y0 q! m1 w. n
-SI = 4647h
( h5 A. w9 m1 u+ @9 g* S) P' B/ J-DI = 4A4Dh
7 I# }, m& b0 q( |: KWhich are the 'magic values' used by SoftIce.6 c2 X* G( b* j' b, R3 l
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.* H: M9 k5 @7 F; h) E* c$ J0 C% ~
" X- L8 v) }4 a4 F& yHere is one example from the file "Haspinst.exe" which is the dongle HASP! P+ k0 y! n! s9 I
Envelope utility use to protect DOS applications:. [% D K% ]- I
; j7 y. |; Y' l& K: u, p% T' Z0 p4 ]4 ?7 \ F# u& n/ E
4C19:0095 MOV AX,0911 ; execute command.
, e. x- F& ~/ G H" M6 h+ |4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).3 _2 e2 H/ \ C7 T0 d' t$ R6 o: R
4C19:009A MOV SI,4647 ; 1st magic value.
; H& G/ k% g+ b$ u* ~4C19:009D MOV DI,4A4D ; 2nd magic value.
3 ~% H6 s) @9 M# M4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)( `7 B4 Z2 D& b% ?. w
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
$ |" C7 ^! K7 h( X4C19:00A4 INC CX
4 x. V: I5 E0 B# U; L4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
, j' ]* Q3 J% F. @2 p8 f8 `4C19:00A8 JB 0095 ; 6 different commands.
4 `' ^* j) q! N% f9 y4C19:00AA JMP 0002 ; Bad_Guy jmp back.- v v+ w. N+ P6 [/ b) R! s
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* y- r& E4 J' g0 _9 Y$ n1 P! }3 s
The program will execute 6 different SIce commands located at ds:dx, which
; h: v) J) N/ E6 \- I" u8 Y( X" v4 @: xare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
9 _# p% ^( V" B9 t- U1 n. t
$ ]/ t3 w/ O* d# h8 z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; J& u4 f/ e8 L) r$ |2 `___________________________________________________________________________3 F# o" f# Z- ^ m0 z4 o
4 k {- J/ e& S) T- A5 M0 T9 E4 C s R6 g, a5 f8 G
Method 03
9 J% ]! [8 T" v' H- Q* D0 }' X$ Z=========
' _% `# U# b7 k
( L: w+ f! O y. hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( B/ I4 S0 B# h& q& x(API Get entry point)/ U) T- M, {/ \4 x$ Z
+ |% D8 x) a4 G) [3 v2 R, ^1 F
' o. T5 H0 |0 c- \2 H* z, t! w _
xor di,di
1 ]& X+ d- y& d( L9 ^8 {3 o mov es,di
, Y/ K7 B4 @ E( S, g8 H& s. s$ ^ mov ax, 1684h + d3 _* l6 z/ ~! r6 `' o
mov bx, 0202h ; VxD ID of winice
8 [4 O+ j' Z" S _4 O int 2Fh) r: |) H7 n+ {/ y2 m1 F. I
mov ax, es ; ES:DI -> VxD API entry point
; n k7 r$ V* T! s add ax, di
$ P, c- ~: ^0 K5 r( c test ax,ax
7 n7 B: ~0 ]; Z: U jnz SoftICE_Detected
4 A6 m- K+ s6 d0 e) ~% D' z* G+ @+ q; a6 n$ |4 i
___________________________________________________________________________
" y9 C/ i: a( c! t8 L( `: w z% H: ]* `
Method 04# `4 z) K* X6 M1 v: `0 v
=========% s& f* C# [! x+ ^' c8 I- L: f8 H- M
# k4 Y! {# T# L# fMethod identical to the preceding one except that it seeks the ID of SoftICE1 y$ t4 R4 S( V* z$ p% t- l! V* d- }4 Q% B1 ?
GFX VxD.
8 K- c1 i" t' G. b5 t* o6 u3 O- J9 Q* x: l. @% I; h, h( e! r" _9 R
xor di,di1 \, q2 L1 f* D( x0 u
mov es,di
" o) d8 x/ U3 M6 _ mov ax, 1684h
- D' T# p' B {1 C1 F0 ] mov bx, 7a5Fh ; VxD ID of SIWVID" I% |& Z! w3 Q: c$ Q
int 2fh
9 i3 q D9 a. Y, l4 \ mov ax, es ; ES:DI -> VxD API entry point
& A2 J6 V- Q+ g S% a& O0 @$ W' B add ax, di
; e' f; S+ Z# u1 U$ @# C test ax,ax
) h7 m, m3 y( _7 O3 j# V jnz SoftICE_Detected( q8 S2 k% ^3 p# h+ Y
' g! |: K7 X3 q, \__________________________________________________________________________
3 H( B$ I# s! e2 }/ B- h
u' _: b' `# _8 U5 ?! p8 C( x* C' j, Y5 V9 y2 j
Method 050 R4 B6 d$ O% P
=========
, B: m4 c+ X) t; H
: N# ?5 l' o- B {: G/ OMethod seeking the 'magic number' 0F386h returned (in ax) by all system
) J. N3 _ }1 g6 Rdebugger. It calls the int 41h, function 4Fh.
7 d9 }/ U9 \! a: p ]& LThere are several alternatives.
, f1 D$ x) S- N+ l
) R2 f2 o) q6 p8 nThe following one is the simplest:
! B0 S& Z; r' \1 \5 T( b9 X8 _ t, W- M: U% H
mov ax,4fh
/ O _: O& H& @ int 41h
6 G2 o# r+ N2 T0 H cmp ax, 0F386! R7 {7 y9 n3 R% |, |2 V) V
jz SoftICE_detected
% q- f- b, a$ g3 Q
$ g% G0 }3 p/ H2 _9 {4 J/ C# X+ k8 d- N. j2 C$ _! M! H. Y
Next method as well as the following one are 2 examples from Stone's
. {, ]3 `# d% d `+ }"stn-wid.zip" (www.cracking.net):
" l+ x0 J, b- Y' `8 S6 f: w
. o: N a, ?! d5 i& v mov bx, cs+ n2 u2 P# a- a- U6 b: p+ Z# [* F
lea dx, int41handler2
/ S: g! O# H: E; Z xchg dx, es:[41h*4]
! a# D. c0 ^, h# v: Z/ U5 T( ~( I xchg bx, es:[41h*4+2]
! B% d6 F) Y5 w) B mov ax,4fh
5 B$ n! _* r) c. U/ G5 [, n2 o int 41h
( {6 O0 T2 r" F3 | xchg dx, es:[41h*4]8 T0 r. ]1 ?% s& P
xchg bx, es:[41h*4+2]
6 W$ V! f+ P3 E/ L# i cmp ax, 0f386h
- B' x' K4 Q0 ^- _: V4 t jz SoftICE_detected5 n' K$ K2 ^$ |! k
- o& T2 t0 P, n5 L& F( j a
int41handler2 PROC& v* z7 {7 J& G
iret3 ~: J+ Y7 `3 V3 u/ @$ _* F N
int41handler2 ENDP* [0 ]' v. T+ t$ e1 y% Z- Y m1 S
2 h9 t. o$ T, P0 o" T2 k1 `2 R# r2 o
9 G3 z/ T4 g9 R1 q: {3 W. O0 t6 p_________________________________________________________________________7 G1 c' e+ y) x
/ Y# y8 s8 S3 r8 ]1 m
/ e( [" f8 ~0 k* s0 _" CMethod 06
* s: n, S1 {* U# [/ b=========
7 Q; |. t* S0 M" R: P$ ~' \* {: v2 w- ~ L1 p: w1 T$ C
% M. x( V. X5 b/ y( ?$ U9 e4 g: k4 |
2nd method similar to the preceding one but more difficult to detect:4 b- [, K- l7 h3 @5 S
# i6 l1 D7 Z5 e& D: {0 Q C4 m$ K" x% P! L" K2 J
int41handler PROC6 h; i7 V$ F9 j0 U7 O# f+ y
mov cl,al n. }* A, `3 D; m8 h( C0 p `
iret: C* c: D( K( A; U9 Z. Q, m
int41handler ENDP, C+ y' ]# O, i' S4 x/ y
7 g8 O0 n5 V) S) N2 a3 T9 I2 x1 E
f% N, m+ y$ K; I
xor ax,ax0 m; D1 |% j. {7 s& p6 {
mov es,ax2 ] ?' p P$ J, W
mov bx, cs
# K" Z( p* _' t; _2 M: a lea dx, int41handler
3 f$ K' o+ ]7 T1 P- ?( l( P& u xchg dx, es:[41h*4]
+ x0 A8 `; R+ X; C xchg bx, es:[41h*4+2]# I6 t* y9 m. H2 S, Z0 p
in al, 40h
" J5 h. I7 l- |- x xor cx,cx% q* c4 A7 b9 S: K
int 41h. d% R( `2 Q( d: y
xchg dx, es:[41h*4]
: u6 z# `* [ K1 J Z1 \ xchg bx, es:[41h*4+2]1 w4 P* R, R9 E- h7 W. |! I4 \
cmp cl,al
: X+ O5 R' s; w( n$ V, H jnz SoftICE_detected
! ?& q8 `1 a8 N* }( F, S2 ]% g, W
_________________________________________________________________________1 {7 Z6 X4 G9 }
! R* F) F( G+ J! F/ g
Method 07& v% v0 D) D( t
=========( i- p" ?9 J* Z! w: L
: }0 X; t L- t8 b3 R! F
Method of detection of the WinICE handler in the int68h (V86)' Y1 ]9 K8 E$ L
2 s5 O% F+ f9 x$ n. \1 | mov ah,43h
# h7 N1 `6 C( k0 ]3 d$ C int 68h3 w$ v) e3 q0 T6 m' {. \
cmp ax,0F386h
+ S1 U1 O" I8 w" Q& i jz SoftICE_Detected. t% n8 p& W9 Z4 ]( W
$ U% u I7 R( _1 c# m6 |
* x2 z' ?5 _2 M
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 g6 X' c9 o5 R) G app like this:1 }5 i, r" `/ w( q" K
0 @& i. X; a5 c% Y) V' s
BPX exec_int if ax==68/ h- M; ^" d+ P
(function called is located at byte ptr [ebp+1Dh] and client eip is
0 ?$ x. k; t1 n) E' i. n located at [ebp+48h] for 32Bit apps)
( z3 r& L# g1 I" F( y__________________________________________________________________________
M8 `8 t' C K" A" T" U$ _$ Q: B" a+ e# s: @7 K
/ o, {3 b9 A8 jMethod 08
( T# g! Q% }' I% s' B: m4 A6 Z: A=========
0 N0 C4 V& p( \, l x3 T& Y& z/ d; ?- ^
It is not a method of detection of SoftICE but a possibility to crash the
8 Y+ b& _3 j7 J8 _system by intercepting int 01h and int 03h and redirecting them to another
% A' U- @3 x8 |routine.6 t, T) C! W: ]% v( |6 X
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 k5 Q9 |8 Z% {4 Q" i) |6 f( _1 Fto the new routine to execute (hangs computer...)* Z9 m9 n3 n$ @* y& B( {* V5 [8 H
" p! w0 b+ A: S. l) [
mov ah, 25h
& t% \4 e7 K8 K- D! o8 B! p% c mov al, Int_Number (01h or 03h)% n1 B- z% e8 W {$ T
mov dx, offset New_Int_Routine
9 \# b) R( E* w- R$ s$ O int 21h
2 [- f2 u# l f. H
7 J% {2 T7 y& j- v6 \1 F4 d7 L__________________________________________________________________________
% k& c) h/ `8 V+ [, O. I7 N8 j5 l7 A/ N6 B! E7 n
Method 09
6 f) }. V) C' Q0 x( M1 k( G=========
6 l# }" z, Z1 @- H1 v+ \0 Y/ ~/ Z& R% h# |% L2 u
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* f. [" q- `( Q. |! d$ zperformed in ring0 (VxD or a ring3 app using the VxdCall).2 E) b$ f ]! H; i0 c
The Get_DDB service is used to determine whether or not a VxD is installed0 r* u/ b( W6 u
for the specified device and returns a Device Description Block (in ecx) for0 u: l! Z! |9 U# w
that device if it is installed.
2 u" L, K( m8 h/ K% ^9 d/ s6 _, Q0 K% d$ @, z- f {( w8 Y+ R- {4 l
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
O2 e2 [( D1 s7 X& p" N; j mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( i \, G; b7 I4 T2 Q8 a4 _! q8 \1 a
VMMCall Get_DDB( _* o2 ^! }7 d' T& t/ t
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' c$ J4 x6 J; x0 s
7 m) u% S$ U' e0 [1 u
Note as well that you can easily detect this method with SoftICE:
) p$ M4 P% f8 R8 t6 t! v7 h9 \ bpx Get_DDB if ax==0202 || ax==7a5fh
: O4 U. C( {& o1 Z& K0 g4 |- G* M' `* d0 C; ]( i2 \" T1 }
__________________________________________________________________________
; g/ g7 ^* y' V& y5 f
" `. Y$ J2 ^( g( {9 Y9 HMethod 10
' y) @5 p" ]4 I4 K+ u4 P: |9 X=========
9 a' P: t. q5 ?" j# J. E
, L) c# n# k# K8 Z( z=>Disable or clear breakpoints before using this feature. DO NOT trace with/ h% q0 h/ C( w
SoftICE while the option is enable!!
( O- w' T2 L" _5 q
( n5 b8 t0 \0 U& R; OThis trick is very efficient:
' E( c# e4 O* f2 P$ H0 f' Xby checking the Debug Registers, you can detect if SoftICE is loaded
$ V G0 f* ?3 `1 k; j(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 T/ {# {( i% |
there are some memory breakpoints set (dr0 to dr3) simply by reading their/ S* i) _" a ~
value (in ring0 only). Values can be manipulated and or changed as well; R# [+ U& t2 n/ p+ i
(clearing BPMs for instance)$ K1 n0 l2 Z% h3 ?4 c% v" [) n
6 h6 E- v X! P; e9 x/ Q5 ]4 ^1 X__________________________________________________________________________
' \' G2 }+ q8 i" B$ i, [( a4 d
f- Y1 R8 p% @ I6 ?Method 11
; V) y' a+ d. ^% p9 c+ f=========
) E S& D% t4 X! Q5 @3 g+ G: a+ H9 g# W9 l% F
This method is most known as 'MeltICE' because it has been freely distributed
- t' y$ W2 ]4 ~. _via www.winfiles.com. However it was first used by NuMega people to allow
# p$ n, ]7 B' sSymbol Loader to check if SoftICE was active or not (the code is located
2 i6 M W6 S% n Vinside nmtrans.dll).) w2 D, y% O" ?8 W1 ?6 ]4 u o( z
$ K4 K3 x3 X/ D d
The way it works is very simple:
' l4 h& q. f$ bIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& g' _& y/ ^0 p5 N, S: p/ A
WinNT) with the CreateFileA API.
$ t2 f9 H+ j$ L
; g. h3 l6 A! `% |$ a# _, jHere is a sample (checking for 'SICE'):
5 Q/ S+ l9 N) V
0 v1 J0 U! }) tBOOL IsSoftIce95Loaded()0 ~. O2 t* ^# Q3 b6 |* B6 ?
{! Y# g* ]2 e7 I4 j/ h# T) j& l" m9 Z
HANDLE hFile;
# ^! I5 |1 U* j C8 z5 }7 p( j/ L) v# X hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
6 p. a4 T8 Q7 V FILE_SHARE_READ | FILE_SHARE_WRITE,
$ f k, M% F. O NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
8 ^; ~4 i. B* e# K1 C: F/ L& ~9 j" D if( hFile != INVALID_HANDLE_VALUE )( d: Q. C9 `: f9 k6 l
{
2 I$ I/ U' L1 G% E1 ]$ N CloseHandle(hFile);
! b9 \/ X, u7 @- Y9 a return TRUE;
& x: H4 p; {) B( x% M( p }
+ ^3 r/ U( j5 u) h* l; R# H- h return FALSE;8 M4 ?3 m, @9 q' o( j6 u }$ G9 o: x
}! ^: u& z- S% s4 z8 f. A
& C/ j" K, H& p/ Q2 r! N9 @, Z/ I
Although this trick calls the CreateFileA function, don't even expect to be( E7 C1 i! M3 u5 Z {/ g
able to intercept it by installing a IFS hook: it will not work, no way!
0 c: X! n# @6 v8 F1 h A$ rIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
% |: {& S* D% N+ G+ gservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
0 B4 w8 Y s( G V- D* [9 ?8 Cand then browse the DDB list until it find the VxD and its DDB_Control_Proc( \4 p8 C0 p7 ` _, q7 R, G
field.
; I8 C$ w+ p/ ?In fact, its purpose is not to load/unload VxDs but only to send a
. M8 r: d3 I8 I9 W6 l4 jW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 Q3 ~% _7 K8 Y* f# F# s, B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try- T" G) j2 a7 C7 G1 X, G' g/ n
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
5 V! f0 m% J1 z3 KIf the VxD is loaded, it will always clear eax and the Carry flag to allow
3 p6 C& K( B/ M6 v8 oits handle to be opened and then, will be detected.
) R w" {1 F& T. W- _* I, bYou can check that simply by hooking Winice.exe control proc entry point
3 Z- \# Y- o; p# i# O, g5 f& gwhile running MeltICE.+ o0 B* |( j5 ]8 t5 [7 J; Q
& ?0 L- L! ~7 \. A! D/ m0 p4 R" ]7 o* P, t b3 [6 F
00401067: push 00402025 ; \\.\SICE/ r6 S' e, E, V u. p2 {4 ]
0040106C: call CreateFileA1 D4 X$ M6 x9 {. d, l8 C
00401071: cmp eax,-001
( e4 q- ]& \- @0 f3 V 00401074: je 00401091
9 t+ X8 g7 ~4 ?
* s. O) q G `; @5 y( Q. }
8 N. x3 o* o0 l+ c, OThere could be hundreds of BPX you could use to detect this trick.
$ Z/ Y% E# l3 A& c-The most classical one is:6 d/ U/ g4 P" `; P- a0 [
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
, |+ K/ f! Q5 c' E4 Z( S% F6 o, }4 ] *(esp->4+4)=='NTIC'/ m$ e) u/ N+ k
( X% W! ]; i; t-The most exotic ones (could be very slooooow :-(1 ~5 D' I3 H* }* |: z, e
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: ^" X1 O" c' l+ X ;will break 3 times :-(8 Y. p5 m1 J6 ] }( U9 v4 \" d
5 E) G1 r$ C3 X h9 i, A+ h-or (a bit) faster:
! W2 f' T0 N9 g# S BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 T/ j/ x$ Q' i' p3 t
% @$ x: N4 X8 W$ ^2 N0 Q+ Z: ~! m; P C BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
2 B7 V4 y( M& ~# ` ;will break 3 times :-(
" x* A3 v* K* s: @1 D" Q" T- ~2 L. Z0 z. R) ?- l
-Much faster:& U+ r" K, [: ^6 \. W: B4 \. T
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' }2 }8 G" V& W( O8 z+ ~
8 g# y+ m- x1 t; m, ]
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 u5 J# o. b$ @ e/ \; Ffunction to do the same job:8 r! C3 i: [ r/ M
+ Z3 T. M' C; q4 A6 ~" }, u
push 00 ; OF_READ
) ]% w. h8 e6 i0 x mov eax,[00656634] ; '\\.\SICE',0
' }& Q/ W( H7 J; W! h push eax4 r6 Z- l$ ?- S+ _7 o
call KERNEL32!_lopen
/ {/ F' q/ n2 }9 u) s1 B9 K! m' J inc eax# T; `! _% e2 _& B
jnz 00650589 ; detected
1 k/ J- }" W( X6 U1 J push 00 ; OF_READ
" ]6 x- i# C" A4 W; a/ I mov eax,[00656638] ; '\\.\SICE'9 e+ a; @# r( F6 Y! r p& P6 h- T, E
push eax
) P3 B: ]) k' N2 _3 ]9 h call KERNEL32!_lopen: _% o0 O- k7 n
inc eax
; t; E+ f# k3 v; D jz 006505ae ; not detected
( O) j; v0 V3 d* d
) ~# E: F1 C, v2 e# h, K4 @, ~9 S
$ k- a- ~3 [# V0 ?; M h! u__________________________________________________________________________9 |) L1 J g8 O- w. @/ k: v! T6 j
' a8 Y' W5 V" {# w2 a F
Method 12
3 W. l4 c5 @0 D# y! y( K+ B- `=========
0 H: j P. p. o+ M7 p8 F0 o
b6 X: N: H- R/ y$ E9 _& g% AThis trick is similar to int41h/4fh Debugger installation check (code 05) Q/ m0 v8 L5 C4 I, s3 @
& 06) but very limited because it's only available for Win95/98 (not NT)1 ?! v, y3 | {+ l7 v. \, y6 F
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
) m9 a$ v) z3 l! z, f6 x
: I8 M& k% J6 B- X push 0000004fh ; function 4fh
* M: V" _/ I: D. G% s$ P4 Q) k4 s push 002a002ah ; high word specifies which VxD (VWIN32)
- Q$ L; d2 s b9 H/ P5 N ; low word specifies which service3 m4 A% v E" n! P
(VWIN32_Int41Dispatch)
% ]% k3 V, {" U; \' x2 M call Kernel32!ORD_001 ; VxdCall
& ?" k1 k$ ~" f# t5 K' N/ l7 R cmp ax, 0f386h ; magic number returned by system debuggers. q9 `8 o2 l k% L" v% K% d' j
jz SoftICE_detected$ s2 j* `; y; n2 E& f
/ u' T4 p3 I9 O+ ?' ~Here again, several ways to detect it:
, m& D+ j+ o+ V; z5 p
5 C0 O# P g/ g) p# { d BPINT 41 if ax==4f7 T6 n3 G* e( P% K1 v: H, B
E$ t' Z. ]2 }( L BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; q$ s6 F) G N. g0 S% w, j
1 X% ~6 N! G8 ?/ ~( t6 Y- r" k BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A; a! N' q1 f v1 y! v* }' G6 x
' C& R% C" y' s( M8 ]( n5 `% H
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ K. h; z3 ~# C3 ^
* W* x4 ?2 A3 ?" L( A$ T4 H
__________________________________________________________________________
- O/ Q) W0 n5 _5 Z& O2 ^( f- w5 p" G
Method 13: {6 T& }# N5 E. U* S
=========6 j5 x5 Z6 N( E+ I* N! S4 |4 Z
& @. ^; G6 ]; C, v" t) a9 D+ Z- o
Not a real method of detection, but a good way to know if SoftICE is3 F" K% T9 I4 k6 K% x* ]
installed on a computer and to locate its installation directory.' Q- X# S, ~" g1 _ R
It is used by few softs which access the following registry keys (usually #2) :
& M3 g r: i- M
3 q/ k) y1 S* L/ x1 I3 E: q% q, M-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 s @5 C+ o$ F {; P: x+ a
\Uninstall\SoftICE
7 O' f, c9 Z: S-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' t5 k* g( I' }+ @; h( `6 `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- u+ u) v$ D. i' w
\App Paths\Loader32.Exe! ^7 N8 m1 Q" u6 f
- Z; L3 J; S- T* p$ z" P
2 y0 I1 i0 K1 z8 q5 C/ B
Note that some nasty apps could then erase all files from SoftICE directory. e) }, r* F: |3 n; C; t E6 F5 P
(I faced that once :-(, {+ J7 H+ c2 m0 x' R$ e
$ m! Z1 G6 `- Z1 m2 lUseful breakpoint to detect it:$ k8 r0 B3 O2 X' p& ]
0 [" j5 i& O, Q# [6 N7 N" ?$ w
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( X# a: V' U4 E `* G
% ]2 ~; t% }* P8 `
__________________________________________________________________________" f5 k: S0 D: }" o
8 D5 r2 z! _1 p+ C4 u- M+ O: u
) \0 g+ p/ Z' q( IMethod 14 ' K& ^/ g" d4 ]# V
=========
5 f$ P l1 ?& ^& _9 c. N4 r- l6 T: R
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" q# k5 z- n3 K6 E- s0 B
is to determines whether a debugger is running on your system (ring0 only).
6 [* A% u1 t5 E+ F$ W, Y9 C0 Y9 w( z! b9 k8 ]/ T
VMMCall Test_Debug_Installed
: Q) |: S5 |6 y je not_installed
8 O9 } ], V# F- m3 E4 T
# s0 j q7 I/ e* j: b' F! h" u7 xThis service just checks a flag.
" |; Z0 C5 ?! h8 z" U</PRE></TD></TR></TBODY></TABLE> |