<TABLE width=500>$ C3 j9 d: @1 n' X
<TBODY>
2 ~. ?: O; f9 _% n/ W2 i<TR>3 y' e' @ N3 s* K
<TD><PRE>Method 01 : A8 f7 o, F5 M# p8 s( Y% G c: l' [3 L
=========7 C( m# ~1 T4 c) w4 D
5 k, z+ s, F' ?. R. X- ~This method of detection of SoftICE (as well as the following one) is
, Z" T+ X6 M3 ^0 V* A S( u* b% vused by the majority of packers/encryptors found on Internet.9 e* ^, i7 Q$ [2 h7 H, a: r
It seeks the signature of BoundsChecker in SoftICE
0 A0 ~7 o: X& A% r* Z. M& [1 X% G4 ~# t3 `3 i& @' y7 Q* l' {
mov ebp, 04243484Bh ; 'BCHK'3 G) s- o" e+ N: m5 i
mov ax, 04h1 f( _' f: \8 S
int 3
6 K# N! \- G z# E% X/ f9 B cmp al,4
2 N; p! X" j9 U* h$ v( c- \ jnz SoftICE_Detected
4 i' T I: ?; K1 b' m. J
+ F" w; @6 Y7 s( X M2 c7 T___________________________________________________________________________
' |! G w t% V% s6 O! s) m! C& p Y5 |1 u) ~. P6 K: F$ o' k. X! ^
Method 02
& D' A: h; ? |" O: U& v" y+ R=========
7 z3 Y; O- B% ~( h' h
$ n1 [5 K5 q. B: H4 |+ t, N2 D. ]Still a method very much used (perhaps the most frequent one). It is used" c; T" J! [9 I: k$ {
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- B# E( t# Y9 D# U; j" ?8 }0 v
or execute SoftICE commands...2 H3 h) o4 `) g, r3 A9 s3 w
It is also used to crash SoftICE and to force it to execute any commands
( \! K5 T: {: q, A(HBOOT...) :-((
% A0 r, ^7 m( a1 M) ^: Y3 w% A4 A2 O0 |6 z' b9 o
Here is a quick description:
+ k, ^$ ?, Y1 O x7 x; b6 N$ J-AX = 0910h (Display string in SIce windows): ]# T( r, s, z8 \: t$ h# `
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
8 [2 F; Q. P/ a-AX = 0912h (Get breakpoint infos)' B* U: A) Y* r/ b/ {
-AX = 0913h (Set Sice breakpoints)
+ h- c( S w/ d8 H% f" h-AX = 0914h (Remove SIce breakoints)
\- Q+ [* q2 X) F
% ^& m9 ~7 t5 j2 hEach time you'll meet this trick, you'll see:1 u2 t& }& U) @; g
-SI = 4647h
! b) a, v2 U; S7 C1 S: x/ t; w-DI = 4A4Dh0 y0 J$ T% o& v/ o. b3 I
Which are the 'magic values' used by SoftIce.
+ a0 h) z+ p) u) ZFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.& ~- |: o! g% F; N; N6 A: C" M
0 |6 x4 b n8 c. X ^; sHere is one example from the file "Haspinst.exe" which is the dongle HASP* @& I4 U3 x8 T, L. I2 q3 K
Envelope utility use to protect DOS applications:& ?- n3 d1 H: `4 [( E3 d0 S
; I: j) P9 L) d. y
# |9 A! }+ c* o( g$ C4C19:0095 MOV AX,0911 ; execute command.
: U+ K; O; n8 t- L6 j4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 I: }* H, O# a/ P% p8 T4C19:009A MOV SI,4647 ; 1st magic value.
9 N; k0 B: T! {$ n' a- A8 A, G4C19:009D MOV DI,4A4D ; 2nd magic value.
! o3 t" u: @5 _4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
* n! }# z F( ~1 @3 m& z4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 L4 ~0 s, x- n
4C19:00A4 INC CX; O/ m; }5 m" L: K" e
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* ~- E; h+ V5 x8 s4C19:00A8 JB 0095 ; 6 different commands.
7 k( p/ W% U- [4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 y5 q9 @( X1 T& |. D9 I/ K1 t4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( n# V4 t$ g& B
8 p" P9 f9 s5 J/ O1 RThe program will execute 6 different SIce commands located at ds:dx, which! I, B8 @0 [: U) i
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 A3 D6 D9 v: S `; _& q- W2 ?, ~2 e' g
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 Q- U$ ^& I* @___________________________________________________________________________
' z4 n9 m9 `( R& u! m Z
- C8 N" K) ^) K# a- M6 t) E7 V4 ^$ \9 I1 ]( S
Method 03( z: S9 k) v# P* t0 b. {% t8 H
=========; D+ j, k8 U$ I/ \$ @
8 M' s/ Z" x3 k* m4 W' k
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. Y* M2 D1 C7 R& C( y7 N$ o" \ r
(API Get entry point)
. p3 D+ D" X! S1 m' f h/ t
7 B4 H$ Q7 v$ U; T7 A( r
& T- Z3 |6 X$ V( V2 { xor di,di4 @) f3 W! `5 A: m
mov es,di% x, _4 p- @. U3 R9 d+ l6 \6 S: ~' P
mov ax, 1684h
' O, k F) x- m" k: N! n6 \) f0 R mov bx, 0202h ; VxD ID of winice5 D3 G/ T6 \- E9 U3 e0 |
int 2Fh
3 |& R+ e3 G2 z: N& T3 s: L4 | mov ax, es ; ES:DI -> VxD API entry point. L. k8 A0 g0 Y! e
add ax, di) D: y; {1 y4 Q' @
test ax,ax
: `+ y' e* n2 }) w jnz SoftICE_Detected
1 ^9 x7 J- N- ]5 q! d, L( f9 o: m4 ~' L/ [6 X
___________________________________________________________________________% `5 u+ x, s- y& c0 d7 q
4 H0 f# u7 N( o) e2 H; R9 c# C
Method 04
$ l+ E" f2 D! t: F2 Y# d=========+ l k# ~8 E) p. a% j3 w
% U2 S( t' u# N8 x3 NMethod identical to the preceding one except that it seeks the ID of SoftICE
@+ ]: v' f7 PGFX VxD.
3 A! E0 m8 q! Z c
0 u1 h( u# U9 w$ D# _1 | xor di,di
6 b" N/ W5 R" s' F8 r: U3 v mov es,di
% j- K+ y' I. g* D! _$ @; r( Y! X mov ax, 1684h . e/ R4 s, w7 z# J; r# e+ n; _
mov bx, 7a5Fh ; VxD ID of SIWVID
8 v3 f- a: h8 w( b int 2fh
8 J6 \1 |4 o# a6 n* C mov ax, es ; ES:DI -> VxD API entry point
. l. |; h; [% Q. i1 L4 | add ax, di
* V9 }9 ]( L2 ` test ax,ax* b$ Y0 I; t+ ]* f% m
jnz SoftICE_Detected
" |9 R3 [* l1 g8 z$ X; i) Q" s4 N
/ _! z7 A. k: A, O; t- y9 e! j G__________________________________________________________________________8 {- k3 n( L' G8 z
# |& {7 O: K! P% b9 ?; E
. `+ C; e! }; X& e9 H
Method 05! W# t: o4 J1 m k6 {/ P1 T
=========) d0 P+ d* B+ \! v" g
6 t y, I) Q% |4 F* B
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& {6 G3 y: L0 ~debugger. It calls the int 41h, function 4Fh.2 |4 r7 ~$ J f& g9 Z/ J/ x
There are several alternatives. 9 g9 n* i) W* x
) N+ e( ^+ s6 V2 f
The following one is the simplest:/ y# A+ n+ f' s( [0 u
' y* S( O" a+ J/ d& ] mov ax,4fh
! W, Q; v! D: c4 L+ ? F int 41h
3 R! r) M5 U# I+ C cmp ax, 0F3865 B7 `% x& ]- o, @8 `! n+ ^6 y3 v
jz SoftICE_detected5 _5 [; h0 m3 Z. b g" w
a9 O( I; T( I. W; t
: m9 n$ g* _' Z6 p" l& R# C! iNext method as well as the following one are 2 examples from Stone's 6 y. v! r; u* G3 ]' Y) d
"stn-wid.zip" (www.cracking.net):
+ P9 \5 Z$ z! O
0 w4 l0 G9 G" V! }' s! F mov bx, cs
) F8 X2 h+ y# J4 a4 d% O, X% g lea dx, int41handler2
A* @: [& {6 ?4 ] `0 m" {$ E xchg dx, es:[41h*4]
2 M& r5 ]1 y3 R# [8 P6 f xchg bx, es:[41h*4+2]7 X- X9 |% ^; D! y
mov ax,4fh
+ g5 @3 T5 Q- ~; R5 P& C5 ?6 H int 41h
]& p9 {! ^) H6 D5 | xchg dx, es:[41h*4]7 Y2 a) S+ b: F% M7 b& Y2 A
xchg bx, es:[41h*4+2]
6 l5 l3 v) u r2 p7 ?$ d5 o- P# ^! m cmp ax, 0f386h N9 |, |+ B4 T. d |( V
jz SoftICE_detected7 ]# K- D% X- f% ~) u$ y
. C) P& a2 [9 Y/ w' m
int41handler2 PROC
) ?* O/ W; x+ V0 W- |. R iret/ ^ _0 K/ P; v0 [8 a M- K' |+ \
int41handler2 ENDP
W7 `" X- S- y% _8 U# x/ N
, |/ j: {& D) w+ x, W
- w, j5 c k* }, |$ B& i7 N_________________________________________________________________________
5 Y" f7 W6 v% p" I3 ^$ r
; T8 X6 j; V% _) X. P/ _6 _8 F) X$ q0 N- l: n4 ?# V
Method 06: d4 _# N. _4 u& w% l
=========! M4 ~1 ^( m& W+ I$ C% x
R6 B$ C& Q5 h. X+ m# A
( `6 u. I2 S: {5 x) t* w2 a
2nd method similar to the preceding one but more difficult to detect:8 b; j4 g' v4 [2 B* L8 ^
: I/ t% K2 w9 k [& M' X$ r. P
" \5 I# r2 A1 a3 F |- Zint41handler PROC
: M- S- ~. A, b; o mov cl,al
* E% p. R+ Q8 E iret
% L9 {4 G- k5 u1 Y+ N' Mint41handler ENDP% B" y% m' l6 s
. G3 g" k5 L' l5 z0 ]) y+ d) Y& ]' C
' x8 A- u$ S! W# \; s+ p& R xor ax,ax
, m1 ?: i& \# o+ p9 D5 R6 h6 a P: r/ M3 R mov es,ax8 }0 r& e( ~/ H, {) x5 e. ?7 B1 y4 L
mov bx, cs
# ?7 ~+ t8 A: b! u4 W ~ lea dx, int41handler+ s2 d: y$ l5 T v3 _ H
xchg dx, es:[41h*4]
2 e: M( Q+ S2 I# K& l8 z- A xchg bx, es:[41h*4+2]
% b; [, d1 D V* Q5 g! _ in al, 40h9 I2 F( G. ^& t
xor cx,cx- @5 Z* l2 J) d* B% G4 b( v! g
int 41h( h! k) G% u- b% m) M
xchg dx, es:[41h*4]9 u- F! |& t* Q; N5 v
xchg bx, es:[41h*4+2]
( x( J$ x* r) i& S9 O( B cmp cl,al
$ I* m- q% e% T, q" y3 d jnz SoftICE_detected
: ~- j7 k" b. D4 `8 t5 A& l# ^2 w
/ h2 w: `( p; o' n0 I_________________________________________________________________________, u% f. P! o P7 s
+ H5 F7 n& p/ N* _4 C/ o
Method 07. U9 n4 S1 {3 N) z
=========
- R$ {' ]/ r, p, M: t6 k4 ]* ~2 {6 C2 t8 E' E$ {
Method of detection of the WinICE handler in the int68h (V86)
3 e4 i, a i1 H* e0 V
# x7 ^2 I$ q ~% j mov ah,43h0 L" v8 K1 j9 ^8 I
int 68h
6 C P0 j, R/ Y" ^7 G, c2 r/ J cmp ax,0F386h" k/ k, n- H( r
jz SoftICE_Detected: i9 K/ c/ t/ _& D
o! d* d0 C+ l, h
+ [- k2 y' E1 E9 y: V" [) M) g=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
/ Y6 @4 Y" {. @! C! B" H3 m/ F! e# p app like this:
6 N( D: ^, p/ r7 P' \( `, O! b3 V0 S" X9 K
BPX exec_int if ax==68 J1 Q6 v9 Q' `0 {( [* Y8 X
(function called is located at byte ptr [ebp+1Dh] and client eip is9 I( j0 c$ L j6 l6 G0 \) ?
located at [ebp+48h] for 32Bit apps)3 \) U. f( N: e! q2 t* F
__________________________________________________________________________
: P; c+ C4 E0 K! @- i# U
5 L( q' A& v; o! w* Q* o! j
C( ]3 W, L3 m/ J' yMethod 083 a9 j$ T6 \! U' f5 ?0 j1 B
=========
) D; |9 f u! b7 f" u
9 q+ C) K. N8 R1 @$ J( NIt is not a method of detection of SoftICE but a possibility to crash the
, ^; R# g: ]1 K0 O" Csystem by intercepting int 01h and int 03h and redirecting them to another
: f. N/ [/ ~/ z- ]5 m3 C: V0 xroutine.) L' Z/ g5 G+ J; ~
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# ]5 z# l1 L, Y. t: o) m2 G) @
to the new routine to execute (hangs computer...)8 [+ F# |# c! Q5 \% p( g" \) P
4 k. V5 V3 W V3 R. ]$ k# d+ A
mov ah, 25h+ a. W. _* o/ r _! ]6 Z* O B& }
mov al, Int_Number (01h or 03h)
1 H3 t* f% ~0 g/ ` mov dx, offset New_Int_Routine
% Z/ v0 C& w% i4 y7 j int 21h1 Y4 L; @, Y9 p
& O* E7 j% ]$ N( b; I0 T, Z
__________________________________________________________________________
3 z' g" z0 |8 G, g
N0 r0 C8 K& V0 I. S0 ^Method 095 I# J- ^' M7 V; ? u! l7 @4 w
=========, Y" V$ y4 \9 s' F
7 J' X* k% N8 P0 nThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ i' p$ R* O( ]4 J/ ^# E& i+ [$ V: I
performed in ring0 (VxD or a ring3 app using the VxdCall).
) y, T) ]4 M1 v/ ]. ~5 v. OThe Get_DDB service is used to determine whether or not a VxD is installed
?& v9 Z, H% Ofor the specified device and returns a Device Description Block (in ecx) for. B9 e; T, d# p5 ?
that device if it is installed.
6 P. ^; z/ {- t1 E L: t* ^
" p2 G$ ^1 S. k+ Q% r) i$ E mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- P$ [) F) c7 H$ A- }4 M- j( o0 M
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 k2 a, Z4 X7 e. z4 K# ~8 b5 l3 U VMMCall Get_DDB3 K2 x( x% L. E( P1 ^
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
6 R/ v( \% V. A- p' ~0 H9 d" k0 |' t. E- x( f' e- E
Note as well that you can easily detect this method with SoftICE:
9 i- K s0 W, ~ bpx Get_DDB if ax==0202 || ax==7a5fh, z5 d& ~4 u2 w
/ \+ m- w; W ~9 Q6 n$ E D& z. [
__________________________________________________________________________3 d" b" D# k$ c- T4 g
. [5 c: \* j1 r
Method 10
8 {% B! y# ~) E, m3 N5 n9 G, l=========) U" X7 i# |8 e, u, P( ?1 p: F
' W. I; Z3 {; I, I" [
=>Disable or clear breakpoints before using this feature. DO NOT trace with7 Q0 r: W3 {) z _ r3 a
SoftICE while the option is enable!!
z b1 E$ {, l0 K2 x2 y e" [ f# ?
This trick is very efficient:
/ x- s7 t0 D B( O: J6 X# s& aby checking the Debug Registers, you can detect if SoftICE is loaded5 W2 a7 D. O3 U' m' q
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
5 |5 G& ]/ \% D' r6 e0 Athere are some memory breakpoints set (dr0 to dr3) simply by reading their
) U8 c, l' |! E# Pvalue (in ring0 only). Values can be manipulated and or changed as well: ~6 |- X" F3 S) ~
(clearing BPMs for instance)( u$ W: u$ B( U/ s
0 M! h8 e' o8 M: T+ @% n# `
__________________________________________________________________________
: ~7 @9 v. O$ t
" `8 Q5 e8 t1 G0 p4 F; s* OMethod 115 Q" z1 d! @8 b3 B; Q- t1 c
=========- J- R! |# m9 H/ A* F2 N3 Y
- s( i" E3 [7 Q8 ]) ?. EThis method is most known as 'MeltICE' because it has been freely distributed! d7 W, @$ r( ]; T/ x3 p3 k. ^+ A
via www.winfiles.com. However it was first used by NuMega people to allow
% u' E. } U: ]: \# b5 r& P/ Q, ?Symbol Loader to check if SoftICE was active or not (the code is located
: D7 z8 b: ]* P' finside nmtrans.dll).
% D, E: x0 i3 j+ A& E3 `6 v5 i+ ~# s2 J" v, u* R( k( P
The way it works is very simple:
- z0 u8 K2 a% ]7 o& TIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for# j) F$ y5 H- ]" V" K: A9 G# d
WinNT) with the CreateFileA API.
8 [/ |6 n; z5 n- t. N9 y+ v
) ^: g7 |& m5 S r) {9 L( [. n' NHere is a sample (checking for 'SICE'):/ Y+ b+ u/ U5 ?& Z( R ~& m) l
+ E2 f4 t- n: h/ \4 FBOOL IsSoftIce95Loaded()
- R4 U! ^* F9 x6 B; p{
; _ j) {2 e! [ J6 _" N HANDLE hFile;
& _1 i- k+ Q7 I/ e hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 K. P! W; }! Q0 F3 U, s2 O
FILE_SHARE_READ | FILE_SHARE_WRITE,4 k6 A- j2 [5 p/ |* D5 l
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: C6 Y, X' e4 y; { if( hFile != INVALID_HANDLE_VALUE )
+ c, G( G8 ?" p4 v) u$ ]+ E {. x/ D W7 P7 e$ r8 {
CloseHandle(hFile);
; [- ]7 o2 U' O1 \( v% v return TRUE;# o9 t7 q0 f# V, }3 B8 Y
}2 |2 V$ T" K8 D: C- e y" @
return FALSE;
7 S" O" A, P6 C+ U! T& Z}
/ @7 ~# K* L) K! x: C
0 \6 V( a( B, x" M% o) t8 ~5 N" AAlthough this trick calls the CreateFileA function, don't even expect to be2 F: a Q0 D- L5 Y2 @. L2 }3 _
able to intercept it by installing a IFS hook: it will not work, no way!
$ `, f7 S- ~% g" w- TIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
' A7 S3 K* y; c9 W0 l$ nservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% X7 ^ a0 Q) ^* J! G, s
and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 M ?+ m& V ^& k
field.
' P7 d& c( x* x3 H7 Z# Z+ N( ?In fact, its purpose is not to load/unload VxDs but only to send a
0 u) W* s! n i; N4 N7 f) YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 D3 a% S6 q M3 E1 E) u7 j
to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ T& S& P" ^" f* R
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
- k1 y% Z( {4 Y4 pIf the VxD is loaded, it will always clear eax and the Carry flag to allow
4 U& ?- A. T1 }- ` nits handle to be opened and then, will be detected.* t8 n5 Y6 F. j% p: ~' X
You can check that simply by hooking Winice.exe control proc entry point
! F$ H0 l o" O5 ]while running MeltICE./ B0 P; r! Z: S& t
! B8 j. Y) b6 |; z' a0 }
# R+ x- G$ ], b/ b% d 00401067: push 00402025 ; \\.\SICE* l& E) s6 T/ ?# A
0040106C: call CreateFileA
0 o" f/ C { N; I! ]) m 00401071: cmp eax,-0011 Q6 t/ T" c1 y8 v' B2 L; `# m
00401074: je 004010912 [! G/ f6 W6 c( s
. B3 |" z4 e# H2 F- g$ ?
4 j2 U, h0 L9 K1 B* }3 F$ Z% ?There could be hundreds of BPX you could use to detect this trick.
9 i/ f1 S3 u7 q5 X1 N-The most classical one is:
# F5 F% }& V4 J+ r BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! N0 E9 y) E7 e' `( Y *(esp->4+4)=='NTIC'* `* o$ r& t. l9 K$ p6 }
1 F# i$ ]* c" v3 A" `* e e-The most exotic ones (could be very slooooow :-(
; J8 f* k; Y+ F BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
3 E4 a( C* ~5 s7 S ;will break 3 times :-(
) P3 u2 N$ C- ^$ Q6 v
1 x% A, @$ w$ ~" a1 L( D-or (a bit) faster: 1 f4 A4 K0 Z9 E: h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 x8 M) T( @. g5 h9 c3 u9 n$ O& \ e. G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. f4 h; Y9 ~) c8 p1 X3 z ;will break 3 times :-(
; Z" @ O( i* V( A, E' W
$ r4 a m: J4 O) @; j! T-Much faster:+ q% W! A+ C* y, j. W0 B0 ?3 _9 p
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', [: Z5 W( W# D4 ]
5 Z" Q# O( {! o# @' G: h8 gNote also that some programs (like AZPR3.00) use de old 16-bit _lopen( u6 k4 K' s4 x$ O
function to do the same job:
( ?) l3 }8 P9 r3 i- H$ `/ Y- V1 X8 ]9 D% z! q
push 00 ; OF_READ
5 H+ @1 W) q0 k mov eax,[00656634] ; '\\.\SICE',0
+ k% |' [- U4 S3 ]0 I push eax5 T3 n) o% R5 D0 O% ~; X
call KERNEL32!_lopen
4 @$ g" X F1 ]4 }% C! } inc eax
6 V- T; z# P9 Z- m# D5 ^$ T jnz 00650589 ; detected7 e* R: [! z, l# v) X
push 00 ; OF_READ2 M# h) N& }( v8 E: n) M. Z) d
mov eax,[00656638] ; '\\.\SICE'2 x8 ^2 n0 u8 b9 x+ i- B
push eax
" c( A/ `( w# U7 O2 E call KERNEL32!_lopen9 H- k/ w) I: }8 |
inc eax
( s+ [! T; ]& M! @- s& w; l jz 006505ae ; not detected
& \; }4 Z0 b. b) P
! y4 ]- v7 {& d9 z$ y. J; f0 O5 I8 I5 ]8 q- R
__________________________________________________________________________
6 ]6 B# x* J A$ U
/ y$ O$ w; W9 g7 A& X, q# _Method 12
6 ?! r" l! z9 B, p; Z=========0 [8 w; j3 ^9 g3 U! G- U: G
- Z/ X9 W \/ O+ c& rThis trick is similar to int41h/4fh Debugger installation check (code 05 [ f8 k% P2 Z- @5 m
& 06) but very limited because it's only available for Win95/98 (not NT)
F- ?+ ^. Z4 Y. Z( D* Vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
! O4 p5 N z4 E4 C& s# a {/ N) c7 Q& y# z- i) N) Z: a9 a. J- J
push 0000004fh ; function 4fh ~+ A4 U8 `) E
push 002a002ah ; high word specifies which VxD (VWIN32)( l: P: O, R2 \5 x8 Q% s2 T
; low word specifies which service- N! S! q$ x$ P6 w
(VWIN32_Int41Dispatch)
+ Q2 T0 f3 u; b" e1 k call Kernel32!ORD_001 ; VxdCall
& N3 ~+ r- b+ a) C cmp ax, 0f386h ; magic number returned by system debuggers5 j# f! n% c) z$ e& ?; ^ O
jz SoftICE_detected9 F0 @# o x( p6 G0 D" r9 N4 T
( {6 Z" {! V* E R2 U$ U" ]
Here again, several ways to detect it:
1 A" i9 d4 }; d# ?- B
$ L1 Y9 {# x- q& _- e$ x BPINT 41 if ax==4f+ r, J& R* `7 C
' U2 H- A) J {- p
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; d7 C# c7 b2 F( \$ I' B0 G
9 h g# ?( o. G' d5 [$ n/ c BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ z; r, f2 L* X/ u$ L4 w+ k
5 ^2 i& Q6 y. @1 z) X8 T7 b/ k& j BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: Y1 i0 f1 S" M }
7 J& Y3 ]' a0 y0 T& s" ^__________________________________________________________________________
: U! Y( z1 U0 E; q% h% T
* L9 Y; d3 b% Y: N1 `5 NMethod 13
4 t" q8 i: a- L8 b- x=========
4 _1 C' L$ t; h! O" `! x( x; X2 ?" Z1 v w) E: b
Not a real method of detection, but a good way to know if SoftICE is
& P9 W8 B4 q7 X$ U1 ~installed on a computer and to locate its installation directory.) `! ~4 v2 s& e- n# K
It is used by few softs which access the following registry keys (usually #2) :' W ?& E5 A V) W' a8 g! e* Y' } g
; c& O: N4 d1 x( q9 j& Z y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' I: w6 ~' D+ B5 ?* P
\Uninstall\SoftICE
4 e. `/ V. |: ~$ W! D. }-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. I! ~/ `) N3 \5 o
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% H0 Z0 {1 p) m& e: L a) x\App Paths\Loader32.Exe
3 g) b% c+ ^; c2 q3 C
- L; u& {( ?5 o1 r0 f4 B: Q% k4 ~/ X8 r! n1 s
Note that some nasty apps could then erase all files from SoftICE directory
! Z+ |2 F6 ?, u% k! q b" Y(I faced that once :-(
( u1 @; o6 P9 u& p* s2 e, m) J6 f. |' ~. _! h. Q, A" R
Useful breakpoint to detect it:) b0 a0 ^. Y8 o5 ]
2 C# \& c G, O. t: N9 r i( _ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE') M9 ^5 B2 x7 {" i! `& P: G( ?8 Q5 l
, Q7 p1 x" q2 S1 r! o__________________________________________________________________________
5 r" }+ C) {" C2 J0 l' Q K: @! q8 `( T: `! p; t# ]3 H
; t8 _0 Y) S+ y8 k9 T. a% Z* D) @Method 14
1 N7 S2 \; t4 Q; a: V" u. v=========8 \7 ]1 ]9 C# x1 f5 F$ p6 d
: ?* V) ~+ m( P& i: U7 RA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 }4 J d9 t9 y) S+ Y6 Sis to determines whether a debugger is running on your system (ring0 only).
: w7 {- W5 e. u4 ^( g8 K$ h
; q1 N9 J6 n$ n/ m VMMCall Test_Debug_Installed
& r O# l0 B! M% ?) | je not_installed
, w2 R# {% X5 s4 H4 d( n1 |5 O- A- E
. o/ X& ]) |/ M7 @" F6 rThis service just checks a flag.
% r3 C/ L6 ], o6 |* S: k</PRE></TD></TR></TBODY></TABLE> |