<TABLE width=500>, `/ p6 F0 b/ N6 L" p% }
<TBODY>
" E7 p( M/ U, E9 z1 X" V7 {<TR>. r; p7 r; @% y6 Z" N" t
<TD><PRE>Method 01 ( Y8 y' b$ R1 ]4 f6 M+ R! V
=========
9 F4 E- C' | y P y0 x: j3 _( p# e5 K
This method of detection of SoftICE (as well as the following one) is
) r7 [* O6 g6 i' {) Bused by the majority of packers/encryptors found on Internet.
; c& h, |! P: D Y/ ? i- W8 zIt seeks the signature of BoundsChecker in SoftICE
% ~, w% W" E' ~1 `2 Z1 b& D/ {$ t3 i5 E8 Q C7 k
mov ebp, 04243484Bh ; 'BCHK'5 } b6 B! w g7 ]5 ?
mov ax, 04h% G+ K6 x2 N8 C% T$ i
int 3
) V4 v# K6 _; J& Z7 f/ U. D0 E cmp al,44 p8 }2 F2 _2 \. {( f% j5 y
jnz SoftICE_Detected4 I) o! ] M% z7 f3 n0 `& C9 O$ O
3 F' j7 m" o, P; o___________________________________________________________________________
; H+ d; P$ o. P, o4 }
% P% ?" ^1 m; K1 h! a6 JMethod 024 E! R+ a; C. O- Z( S# h1 f6 r
=========
+ u+ {& S. g$ z0 g, q. b5 D/ o a E* l% ?" p
Still a method very much used (perhaps the most frequent one). It is used
, ?+ P- K: t6 E2 Dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 V' e5 g8 T# Z2 q4 Jor execute SoftICE commands...' f( z- W6 ?# Q+ w
It is also used to crash SoftICE and to force it to execute any commands/ w& t3 Q$ b2 k$ |" J+ v" U2 ^
(HBOOT...) :-((
( P0 K2 E S( o. n" D" z" b6 h
( k0 M! f$ Y! Y; F$ oHere is a quick description:
- ?" @' x& m4 @1 |( a1 Y# \9 M$ T-AX = 0910h (Display string in SIce windows). P& C5 `: z8 V- |6 G' F7 Y
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' D1 a- L! k* z3 a2 y6 N, b2 ^, X
-AX = 0912h (Get breakpoint infos)4 {) f, }: z; _3 i) x
-AX = 0913h (Set Sice breakpoints): B/ S4 S/ Z4 m$ r" f c: A& S
-AX = 0914h (Remove SIce breakoints)8 ?- j" Z3 y7 p3 E! | I: N
m" I8 C# Z; L! \" t. KEach time you'll meet this trick, you'll see:
; O' D% A7 h" X, |5 D-SI = 4647h1 I$ U8 J: g* u3 C- J3 g
-DI = 4A4Dh3 \. q- Y+ D. D
Which are the 'magic values' used by SoftIce.
* f, Y3 C: _ K* t0 a' SFor more informations, see "Ralf Brown Interrupt list" chapter int 03h." ]2 s( x3 a" l; Z5 A8 u3 X" c
* N f9 m$ G/ @, r
Here is one example from the file "Haspinst.exe" which is the dongle HASP& h- j$ s, ^6 [% G- D& I- `3 x3 ?
Envelope utility use to protect DOS applications:
! G% D S) |; z3 k
2 J" c3 b' _ c2 w% |" |7 @$ J7 A
4 b Q) T u; F( y7 Y. i% M/ \4C19:0095 MOV AX,0911 ; execute command.
* ?( `8 N* H! k4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* G- g3 d: e6 ~9 B: N. V4C19:009A MOV SI,4647 ; 1st magic value.( B1 Y5 V5 D5 c O( t- H3 W
4C19:009D MOV DI,4A4D ; 2nd magic value., H" D4 I# W% n% y& {8 P/ E
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)/ S' X$ [) Z! q4 b3 E
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute( @+ p$ g; j' ^) {
4C19:00A4 INC CX
2 k2 e9 r! ]$ [2 U% c' r4 A4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' B! o& i N' S' i1 `0 b( k% m4C19:00A8 JB 0095 ; 6 different commands.
2 P% s! N5 X. m8 b4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ _( p8 M0 e) _) ?0 I% ?, V
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
' } F" _& r5 `) F% P$ l9 g; a( v$ U+ C* c
The program will execute 6 different SIce commands located at ds:dx, which/ @. ]& w! u+ f7 B7 C
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 v1 S; \' b0 \$ R% Q; i$ a, C" Q" e! p
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
5 @4 ~+ C# f7 K3 ]0 f" `1 }9 E___________________________________________________________________________' r% d) N2 R) C3 C6 V- D5 |- g
+ ^2 F" C; y0 J' f8 `' T8 U3 w M: e0 x- p7 w
Method 03, z4 y8 m' G. [5 A7 _0 t
=========
# h! C/ c5 t2 h$ q6 q, \, B* C/ Y
+ D( Z( G0 \" Q3 q5 C' KLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- P) W5 @: y3 P( c
(API Get entry point)
& v2 L; s8 q) K $ j, k" h5 `; o* `4 j3 e
/ R/ [* ?4 k( i8 S
xor di,di
, F0 ]. Y q2 N mov es,di3 B+ M2 l. E8 y- J
mov ax, 1684h
9 Z1 ?3 j$ |2 d0 _ mov bx, 0202h ; VxD ID of winice
$ f' h/ o/ H4 V4 K3 C, _ int 2Fh% K) l6 Q! U1 r. @
mov ax, es ; ES:DI -> VxD API entry point
- V9 M* R! Q; ~* P+ v, h* Z5 V' v) a+ e0 } add ax, di
( f1 S2 ]8 r6 K test ax,ax2 v p' J0 I0 @& M
jnz SoftICE_Detected
: f- Y. [7 m6 F/ A5 _
- y6 L5 A+ k- B___________________________________________________________________________$ ]; [) J$ P" Y" C/ I
$ y- q) S7 a- ^" s. K; |1 o3 M
Method 04
K( [7 F T& D! e- U" K=========
% T/ h" A; @ v3 r: L; V
7 r/ G) x* |) o! @! R' xMethod identical to the preceding one except that it seeks the ID of SoftICE& ?) U) f3 Y) Y: k- \4 `
GFX VxD.
7 }( J* V# E6 s
" G+ A0 _$ y! a7 X. m4 p xor di,di4 Q/ p/ Y, z& {: W1 v! d9 @
mov es,di- w& d6 V4 O6 y) e y
mov ax, 1684h 8 E: W5 W$ g/ Z U
mov bx, 7a5Fh ; VxD ID of SIWVID
- B! t0 J; V+ S$ Y int 2fh8 B, _; U$ e5 [$ {# F& P
mov ax, es ; ES:DI -> VxD API entry point' k. @' {+ W- I1 z- C c) t6 u
add ax, di* B; Z* X0 k4 f0 S
test ax,ax6 v a6 L; S, l8 g& F& B
jnz SoftICE_Detected6 b& }7 l1 t: \) o' V) b
) x+ d2 _2 m5 B0 f9 y3 g
__________________________________________________________________________) ]% v, n' V5 J' x( z
2 b; O, b* O9 H5 Q5 x8 e
) n' n+ Q8 D" n# G1 Y6 C
Method 05
( f5 b- g% } m+ n. ~% C* ^1 N=========
, a& y' S& q, n8 H. D+ m$ N! N) Q5 i8 a) ^ h' k
Method seeking the 'magic number' 0F386h returned (in ax) by all system( m0 Q: _, z: }9 {, X
debugger. It calls the int 41h, function 4Fh.9 G5 n @7 |/ Q' s' W+ g. R6 e
There are several alternatives. . L2 ?2 k- g! V) B2 T; D) E
' u7 X' e! \1 h- j8 [
The following one is the simplest:# J: R# |" v3 ]* Z E! f5 w& e
$ V) M- ~2 q+ O- } mov ax,4fh3 I( ~5 c2 r5 s* X* V0 p
int 41h6 g6 ~9 ?& H1 R$ [( V7 q8 v
cmp ax, 0F386
v9 ]. r v3 ~ jz SoftICE_detected. G: j R9 |8 j8 q( W2 v
- a7 e7 N I$ I9 O
9 F* W0 V. M! ^: J1 \( H
Next method as well as the following one are 2 examples from Stone's
( A5 G+ d+ c5 {- K1 q V"stn-wid.zip" (www.cracking.net):
9 B; _ C% o3 p( M6 a( {7 \% t2 T% I) r3 R |
mov bx, cs1 y; \9 D% D9 o. P) T" t
lea dx, int41handler25 Q4 R$ y& [7 e5 K6 J$ _$ z% b7 z1 H
xchg dx, es:[41h*4]
0 p! c; e: d9 K8 e M" w xchg bx, es:[41h*4+2]
* J5 g5 V* q E( g9 @" W/ g8 N mov ax,4fh
{2 X: X( h8 }& M' I: n) G, l int 41h
5 T5 c) T7 W' l F, @ xchg dx, es:[41h*4]+ ]; L. Q9 w, t+ x; t& h+ K" V
xchg bx, es:[41h*4+2]
* K% P- Q+ z' i$ f n, i: k# q cmp ax, 0f386h
2 a( [9 n" ~: ]: h% r5 y jz SoftICE_detected
* o% V4 Z2 b- u! T
$ d1 U. U4 }: @2 B8 {int41handler2 PROC
6 n6 Z. T @' G$ Z5 L; { iret( O: v2 c: J8 D+ e' u6 q3 U
int41handler2 ENDP, W I2 M& v% G3 d4 z- M' P; L& m
4 ?: }8 t8 o3 ?2 B1 `8 F! q2 V
" y* d9 N- u3 d2 h. U_________________________________________________________________________
4 t A/ V4 ]0 ? i4 Y5 O% [
7 T H: Q0 k8 R' d( X9 x, O; N9 w+ ]- D- H h/ s- ?
Method 064 A) `3 p; i) b5 Q/ @8 l
=========
! f& k# N- G3 E! D0 h% U# B4 X. M3 q; k% D5 U! p: A
( m0 d) h3 e4 X1 O4 Q1 C1 ? J5 ]; O
2nd method similar to the preceding one but more difficult to detect:
6 V2 A; A, \4 m) k; w. g2 }3 @. P. G' ^/ l0 K( s5 s/ {9 R" S! r
6 D! J4 G7 h6 u: p/ @. Jint41handler PROC
5 T2 E! x l' e mov cl,al# E$ j/ R9 S- [6 Y
iret& N/ t2 g2 u7 ], C$ I2 I* l; e
int41handler ENDP
" M# {! U* [4 \
4 y7 F0 ] c& V2 \1 o2 x7 S! y: e
: C" Y: R8 D2 y0 S' f xor ax,ax
% O: l Q% d7 F mov es,ax" z+ @* \/ S. V+ i3 n# g
mov bx, cs
; j& y3 U. z! N+ j1 x7 Q lea dx, int41handler
- F( t1 H8 u5 u9 g xchg dx, es:[41h*4]' w/ \9 K0 \0 ~0 I H3 Y
xchg bx, es:[41h*4+2]6 A: b/ F8 |6 k" R$ H
in al, 40h
* k" g Z# l# I' X3 \* t- l' a1 s xor cx,cx! B @& L" o) a) G5 o
int 41h
+ ^% d! S: N2 L: `/ } xchg dx, es:[41h*4]
. a, O8 F" a9 D& o- R xchg bx, es:[41h*4+2]
# t$ R6 i$ x2 `6 f& ` cmp cl,al! [% a# w* _3 h1 d
jnz SoftICE_detected, |% w4 E" ]" Q5 I
5 i2 J; |* E* ]/ P u% L4 @
_________________________________________________________________________
^- x3 v: S# C" j/ H% m3 m7 O, {+ n8 ^( @5 A
Method 07
+ l/ s$ R4 f# O, {& R7 N7 n=========
/ f! n- e) q) W. r- w# a/ r2 Z: T c! F; n. F/ h* b: n U/ n; U/ \+ g
Method of detection of the WinICE handler in the int68h (V86)
* P. p m8 S9 f
] u' c: E* T, a$ B3 ~/ o mov ah,43h: j8 g" z0 S* F/ i
int 68h) |, ~" R& o# L: t7 q
cmp ax,0F386h
; y5 K/ ~$ W; y0 F3 r& Y jz SoftICE_Detected2 E, W; m' _1 C$ u/ d/ `
6 m% ^* D7 w; I2 O g+ e& t/ G3 {! t' b8 \9 h
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& L8 U1 p4 r' U
app like this:) X5 r* e& C+ @" a8 |
/ l- e i+ `6 D! R B7 v BPX exec_int if ax==68' w% F @: f1 s# o" T$ [- v9 |! w
(function called is located at byte ptr [ebp+1Dh] and client eip is# w5 b. k) O' E+ f. [' b8 |9 N$ @; H
located at [ebp+48h] for 32Bit apps)+ c4 {5 A- R* v$ r
__________________________________________________________________________
, O; C, q: o7 {7 n7 L" W# C. t* g9 b& m' u3 \
f( T( m; z, E" W" N9 ^
Method 08
; s" Y/ U; k! j=========
0 O2 f# f" T) z+ d0 s$ { I; d5 Q, Z0 l
It is not a method of detection of SoftICE but a possibility to crash the$ H3 S- m8 Z. V( _9 j
system by intercepting int 01h and int 03h and redirecting them to another
0 q0 ?5 e+ b' I" {0 lroutine.
" T( z- N; F& S; O4 i! gIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, M# |9 G$ U6 D( X
to the new routine to execute (hangs computer...)/ _- E4 Y( v: U( P3 c. A
5 ]( g- d. ~. o' |/ ~$ e mov ah, 25h
: h' ^0 B$ P3 |- Z! w! A mov al, Int_Number (01h or 03h)
/ T7 ^3 r" |$ V; C mov dx, offset New_Int_Routine1 l% h: h" X5 Y
int 21h& L% Z) r* k x8 ~
; L( O& o5 o# Z6 u3 z8 W
__________________________________________________________________________" q5 ]5 ?- b5 W* X8 Z* t) i
4 q( o% Q, U7 `8 k% \5 TMethod 09( \7 s) d+ T9 ~* `7 g9 [0 w
=========
. z; {0 U, f4 w& m. c' m. m6 @( z' h9 X
+ @+ B/ u! G2 H. D) gThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 W C$ O! }6 e% s; ?, v8 sperformed in ring0 (VxD or a ring3 app using the VxdCall).; ^ N9 U% Y; r
The Get_DDB service is used to determine whether or not a VxD is installed
6 S/ W, p% x1 k( tfor the specified device and returns a Device Description Block (in ecx) for0 ?& W2 }* D9 L2 L$ u
that device if it is installed.4 D# F( K& m+ s
) P O- d0 ]+ c$ d7 D+ k, S mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& ?; B$ k2 E$ { m# x( A3 @ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 ]' z2 m3 d2 u6 Q6 K
VMMCall Get_DDB
+ C( t( r/ j% T. R1 A mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
# ]# }9 m/ }. [' N* y8 } _# O9 ?, n& ~
Note as well that you can easily detect this method with SoftICE:
0 o" M3 Q" V8 L4 l3 s bpx Get_DDB if ax==0202 || ax==7a5fh# a3 T! J- m( c! I/ ^
+ m- R; O$ G% M, G6 S, f
__________________________________________________________________________8 T( s+ C$ Q2 B- S2 |
4 F7 i) P5 m. J, O2 e7 Y( ~
Method 10
, N' D0 W! P: p) [! C* s7 r=========
/ K" R/ W' p. _1 [
9 R9 x/ [+ U- o3 r7 M/ e& G=>Disable or clear breakpoints before using this feature. DO NOT trace with
* ^- G* J. R' I: [# D1 Z9 P SoftICE while the option is enable!!! m6 s* J9 ?# V
6 a9 Y4 N. f6 L$ g+ b( t4 b
This trick is very efficient:
2 y T' q) r- [' q2 u# M* Uby checking the Debug Registers, you can detect if SoftICE is loaded7 ]! J- t5 i% K! p; L1 K5 u
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 {" v( y0 G9 U( D8 c; X
there are some memory breakpoints set (dr0 to dr3) simply by reading their) ?9 S' { A6 w0 Q
value (in ring0 only). Values can be manipulated and or changed as well" n" a& J0 W/ e1 u! G* v, l
(clearing BPMs for instance)
8 g; ]6 E: k+ ]* }7 E- r5 x1 B. T
__________________________________________________________________________
$ C& Q6 p; E( ^8 `
5 z. z" R) s6 a6 J: T9 Z5 g+ `Method 11' R9 A7 j$ I4 g' F S& W
=========5 X+ \% B8 x: e: ?5 ?, s
# B% O4 U( t+ T/ b+ J1 DThis method is most known as 'MeltICE' because it has been freely distributed
' [8 }- o$ B$ _% o8 k' p; c- ]via www.winfiles.com. However it was first used by NuMega people to allow4 O7 Y' d7 \$ |/ |
Symbol Loader to check if SoftICE was active or not (the code is located# |) r! D% K9 J5 e K
inside nmtrans.dll).8 w9 X) M' w' B+ [. I3 w
5 d! h9 x. b3 l" Y1 {
The way it works is very simple:6 r, k" E3 D- W3 N4 f4 V7 c, [
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 i* Y' h8 R, u6 r
WinNT) with the CreateFileA API.
/ _* u, y# A; `2 f( L/ e6 G+ t+ R4 V% D3 c/ i7 G% B9 [+ w
Here is a sample (checking for 'SICE'):
# n7 }1 k( {2 T+ F/ z4 E! R( U1 [2 n9 m0 h4 L* x/ U
BOOL IsSoftIce95Loaded()6 e/ u- _0 c& q0 r8 O# X9 c9 {
{
% z3 ` @7 E+ B: l HANDLE hFile; $ b9 j# v' Z. H S- F8 a
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,8 j: I5 c P4 [, |1 u4 @. L
FILE_SHARE_READ | FILE_SHARE_WRITE,* h" u9 J+ m+ `- i! Z K
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( ^7 M" I0 |0 ` if( hFile != INVALID_HANDLE_VALUE )% h+ N6 `6 Z. U6 A$ o: {
{
* H' x! e$ j1 p8 u" k CloseHandle(hFile);
; [- y4 Z+ E+ g5 b K. D return TRUE;
5 Q, ]% u: O, L2 q }5 R5 g3 I2 f1 o9 d' G/ `) j
return FALSE;6 l& ~5 {* w& Z7 \! z: U" E. [
}
# G% y6 t! Q' W3 C! ^! k8 P" j* {7 ?
Although this trick calls the CreateFileA function, don't even expect to be
! M+ `2 u5 g ^/ }" pable to intercept it by installing a IFS hook: it will not work, no way!
1 M" G% H, X* P8 WIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
. | E% R. a" h- t4 l/ Pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' N' j3 ]5 U+ ^and then browse the DDB list until it find the VxD and its DDB_Control_Proc
4 Y& K9 n$ \, M; o# u8 nfield. {) r7 O1 f% `, Z) B, J
In fact, its purpose is not to load/unload VxDs but only to send a
, n& B* e! a8 UW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
/ X3 l( n* J) M# J) L# uto the VxD Control_Dispatch proc (how the hell a shareware soft could try
; |* c2 G( {% k) c! pto load/unload a non-dynamically loadable driver such as SoftICE ;-).2 M3 G+ t) s9 d6 j2 p! o6 i
If the VxD is loaded, it will always clear eax and the Carry flag to allow
7 K9 T; ~" O- F! M& dits handle to be opened and then, will be detected.2 [/ a. F$ ~# v: c* x) P# y
You can check that simply by hooking Winice.exe control proc entry point
. _6 l6 z! l& O% ^6 \4 Jwhile running MeltICE.
; K5 P. k1 b6 ` b- Z9 z. G! Q% S) D( i3 A) k) _
; z: p8 O, r/ v* |5 M9 p. d) e 00401067: push 00402025 ; \\.\SICE
* [ O3 M& I! z' v9 N" m; T+ ^4 n 0040106C: call CreateFileA- r6 [5 h/ A$ S! J/ p
00401071: cmp eax,-001
+ |" [3 w. ~3 i, I# _# G 00401074: je 00401091
I" G" b7 G* m& L. h2 o2 j( H0 t3 Q7 D( M& R4 g
& M4 h5 H1 n4 g8 Q {
There could be hundreds of BPX you could use to detect this trick., T) o7 T$ J# h+ ^, j/ r* g7 {
-The most classical one is:1 W. M$ {. h' z4 R; [) e
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
4 P! v' M. p) X6 A$ I* E" h *(esp->4+4)=='NTIC'
: E. i9 l! g* U" q, R$ F7 g
, `$ ~7 p' v) E3 b3 Z* C6 m& C-The most exotic ones (could be very slooooow :-(
, t, @2 g, k4 _; ~# o; l- Q: {. A BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 {7 w3 m+ f6 o6 t: m" z- ^ ;will break 3 times :-(
+ ?1 A9 f1 a6 x3 ~# R$ t: s1 v- B3 v; l6 N/ S
-or (a bit) faster:
0 E i7 H4 ?) ? C3 a) _ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- i( \6 D3 c+ q4 D" f! g7 b. Z* D) M9 Z/ _, M6 D" X& I; [
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 `8 v+ ^9 p2 Q1 X# N7 H" m
;will break 3 times :-(
Q" f7 R8 l# F( C: k/ ~: i/ B# [1 T" {. u( T+ d
-Much faster:; i8 e$ W# a9 e! Y: d
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' g! T+ w! d, T. [7 g2 }! \& y
0 j& L! a# d. f& L
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! ~) K+ h7 X) n& afunction to do the same job:3 j2 D+ c0 }' d- Y1 q( [5 y9 J
4 k+ ?$ f4 s. M5 C1 c, p0 ^3 e push 00 ; OF_READ" z; h- ~5 P. ?/ N0 G! ~
mov eax,[00656634] ; '\\.\SICE',04 L; o6 L1 T1 l3 j+ d8 o
push eax! k% ~$ Z9 q! L4 G3 ?
call KERNEL32!_lopen/ z1 l! \" l3 v3 `' |
inc eax
$ O0 C% Z1 Q( I! z* ]9 _ jnz 00650589 ; detected
0 j+ ~1 [6 @1 j. O; z7 Y/ k6 k push 00 ; OF_READ
8 c/ U, A1 C# }' l+ Y mov eax,[00656638] ; '\\.\SICE'
+ U3 e' F3 `' n+ l A push eax
8 ?& u& e( g3 I& x+ j call KERNEL32!_lopen: ^( o/ e. I0 m) c: A
inc eax
6 I# \/ \: _( B/ h jz 006505ae ; not detected
/ x6 @% W& g: t, V7 J
" Q& B: q9 f+ S. D8 M/ _" }. z) k- }, A& c" ~6 E4 X8 f0 p
__________________________________________________________________________$ i4 ~9 r& C; n2 a$ |' P- N M9 y7 Q9 {, H
9 |4 W7 f6 q- ~9 v" X( L$ KMethod 12' M% p z- g$ l* z$ v
=========8 t% N k g v+ w
1 g9 D# G9 y5 g. RThis trick is similar to int41h/4fh Debugger installation check (code 05; @: q& P& r- E) J
& 06) but very limited because it's only available for Win95/98 (not NT)
9 t V; [1 `% ^2 k5 ~as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' z3 U, q* f2 |4 ]( w/ ^2 _( z' p" {- M; |& @( Z/ _
push 0000004fh ; function 4fh
! \6 E F8 S V" L. G3 ?6 v push 002a002ah ; high word specifies which VxD (VWIN32)
0 C! q* v6 H# {+ i* F3 V0 J! e ; low word specifies which service/ A' O, j, r F& D6 X
(VWIN32_Int41Dispatch)& L" A+ `3 Q- h
call Kernel32!ORD_001 ; VxdCall; L- _7 f" H2 j4 Z
cmp ax, 0f386h ; magic number returned by system debuggers O+ {5 c7 `, X. z) R% R. R
jz SoftICE_detected' u( @1 y' ?9 [! r; M7 p$ Y
6 E- v+ ]( A# f$ kHere again, several ways to detect it:
: z" _& e7 |& G u' p1 }. T2 D6 b- j$ L5 h9 M! ]% ~) d5 n
BPINT 41 if ax==4f' e' F9 i: A0 m. v
/ p. z; ^7 y* \6 p: U BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
( W# r7 Z0 z( ]" Z; O$ |% @! E: G! D8 `4 R' C
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) I7 j8 `1 H2 A- g2 ` B$ E& K7 Q( c. b8 l7 G1 x
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 W8 W$ P( [% U
7 c8 W0 z2 M X* M__________________________________________________________________________
+ T; b+ L0 v$ f( S s4 g7 q, ^- h% b5 l5 P5 t
Method 13
' m0 u3 r- `* f6 ^=========
3 w0 k* O s$ @* a' ^
F' `' O; s% J' Q7 p. |1 dNot a real method of detection, but a good way to know if SoftICE is, h* V' u3 g. P W' ]! O& Z0 k, M1 `/ ]
installed on a computer and to locate its installation directory./ J: C6 T1 G0 m7 E$ l0 b( P0 S4 z
It is used by few softs which access the following registry keys (usually #2) :
* G& e" r' g( D' H: V s; ^8 F w4 Q2 w w5 w/ S0 K a
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ [! c6 z! M3 m- y% |\Uninstall\SoftICE3 V- N( N/ U A6 f! i* _
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ X+ n) T' u/ k. T-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ g, T( w3 x& w. n! N\App Paths\Loader32.Exe
: T# a( q8 r' m9 F" b+ U- L, f& C2 S3 S8 Z* O5 Z
: P% m* t) S ZNote that some nasty apps could then erase all files from SoftICE directory
) _- p- s5 s$ B8 l' {( `& U(I faced that once :-(
! G$ N2 j+ h& e; K' P' u% m0 ?9 ?9 D+ M3 Q$ [ L; v( D/ G
Useful breakpoint to detect it:; Y& O& y& d- r: a1 g8 {9 r
. W% w, @4 n% P8 V3 l' t G, K BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 U: Q& j% a4 Z5 w* \% u9 p
7 ?+ G* D& B. X" \9 ~; v, h, f" V6 j__________________________________________________________________________- N7 H# \$ Q) Q( U, x# R
! V0 B2 e2 e7 O7 F" N5 ]: |% _# ?3 t" Q
! Q' ?" M9 e9 pMethod 14 ' `4 B6 X5 \( }) d# w5 {9 B4 t9 t
=========7 c7 ^! |9 w, A
* u2 P+ I5 _7 ^( S; F8 gA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 e0 z' U* [) s& X: M' V: w# mis to determines whether a debugger is running on your system (ring0 only).
! r0 M% K6 ~( g
! N9 F7 y. O1 s4 k7 h- T3 F VMMCall Test_Debug_Installed' K' p B/ O- u: c/ g! d9 F
je not_installed( ~2 v. U; Q( L1 r' y
4 F8 c# @0 G! `/ S8 [% wThis service just checks a flag.# s+ X2 h( t5 J3 A. D
</PRE></TD></TR></TBODY></TABLE> |