<TABLE width=500>
4 M" W6 m' X& O0 i& H# F# |/ f<TBODY>& n7 G* G9 L. ~8 U) D/ H
<TR>* w9 _; N/ l) Y# o7 [; [& k9 Z$ t
<TD><PRE>Method 01
' }3 M e5 h8 s9 l! I=========' _! f' O& ]0 }( D( ]" S c/ A
! t8 z3 y! k" P+ H5 N ^# T/ HThis method of detection of SoftICE (as well as the following one) is
/ h% V0 p) k R& Kused by the majority of packers/encryptors found on Internet.
! c; l* X* s' K7 x; DIt seeks the signature of BoundsChecker in SoftICE
{, [( h4 |: p+ e7 j* U
& Q9 K$ |8 N: F3 J# e mov ebp, 04243484Bh ; 'BCHK'3 P7 _/ t3 A' P, K+ Z7 m; D7 a
mov ax, 04h+ }) K5 Q0 @ r6 S" V* q
int 3
, D: S0 z3 w+ B$ A- l cmp al,4
: H8 x* U, w5 F5 @! P" H jnz SoftICE_Detected1 M1 Z, y7 L1 E) b+ A4 b7 }
: K1 C" a w- S3 L# y/ q) e___________________________________________________________________________ h! |1 c% q" I$ h; s. @
8 A* o8 Z( r" ~2 _! r) x7 ?Method 02
5 h! B, ~6 O. u \: V=========
& ?. @4 Q- |, f+ G: B" k5 F8 @$ a9 v$ L6 |* {' W6 z
Still a method very much used (perhaps the most frequent one). It is used
0 f1 R( T+ g; u# _( kto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, L& B( y5 h6 ior execute SoftICE commands...
3 {# c# m! ~( b/ kIt is also used to crash SoftICE and to force it to execute any commands
- v4 j% \4 [1 p. K3 u(HBOOT...) :-((
9 D. C4 g* h9 \7 }9 b- S8 \- b+ F/ x' k/ Z+ d8 b! u' I/ L
Here is a quick description:
' V0 D* \1 s5 z! Z t-AX = 0910h (Display string in SIce windows), C: @. j( B8 m9 l6 ]/ S
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)2 X6 |5 k; X" V6 N; x- W
-AX = 0912h (Get breakpoint infos)/ U2 H+ U- y# S& k g; X, E" @
-AX = 0913h (Set Sice breakpoints)( C0 T% |" e/ y& t( @, _! Q
-AX = 0914h (Remove SIce breakoints)
. Q; I- O2 r$ ~4 o) d4 L; N, p$ \5 ]' M' o' N, I& o( y+ X) a
Each time you'll meet this trick, you'll see:
2 x0 S# g9 m) ^1 A3 u$ |: ]$ E-SI = 4647h
6 f1 h; ~( O# d2 N-DI = 4A4Dh& j( `3 G) A+ C0 g! W
Which are the 'magic values' used by SoftIce.4 t: H& p; i% O1 t0 H
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ t; f; ^+ l, \+ I+ n
% l' m* ?+ ]0 }1 d( a
Here is one example from the file "Haspinst.exe" which is the dongle HASP* }) o' `! g. N% M3 P- c7 ]
Envelope utility use to protect DOS applications:% ~/ w& J, @8 w. n, Z( P" ~3 s
) R2 e4 X9 ^5 @
9 X6 E( R+ L8 R- h
4C19:0095 MOV AX,0911 ; execute command.7 R {$ [6 t2 j6 o
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; N# K) b: |& \1 {
4C19:009A MOV SI,4647 ; 1st magic value.
u" S% n. H$ Y! C4C19:009D MOV DI,4A4D ; 2nd magic value.! d( Z8 u$ B- V( H0 Q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*): o: Z% B; d- y& u2 K- R8 I
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute8 K6 U5 U' o; \! k6 h% [% ]7 |0 w
4C19:00A4 INC CX/ n/ L- ?9 P/ F
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' ?, m9 J* C4 l- u" n3 R4C19:00A8 JB 0095 ; 6 different commands.* M# f3 r! t ^0 z+ K0 A; n" j% ?
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
5 w1 R! B" }+ w8 o# c( g# B4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 p7 H" b+ N+ t9 n# R
+ Z: {* C+ F: ^" C" y8 h: sThe program will execute 6 different SIce commands located at ds:dx, which
3 h4 W# C+ l; K( Iare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ A {3 i4 q: q, k; F: l5 P F" q! q k& }( G3 Y# k- ]
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded. E5 O7 A. i$ {6 X2 t
___________________________________________________________________________ d2 {+ X3 K5 V; a
2 s$ l' m0 z* l( d5 S+ _2 m( L6 G
+ l( O3 P& F; P aMethod 03 K1 Z4 N( E5 ~2 k6 } w
=========) G/ Y$ b* `; m0 d3 a
( M6 u& z9 T [6 |( Q
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
/ l* ^# q: Z. R4 @$ c; d, i M(API Get entry point)
; F5 p* R0 ? r2 f! f: Q6 X 5 B+ X: g4 h" W
5 C5 [0 L; q+ K xor di,di
$ c5 i$ @" U* T! y! k* ?3 ]+ m mov es,di
/ U/ r; l% Z/ G" I4 W mov ax, 1684h
1 E- e2 G5 o5 ^* p8 ?- } mov bx, 0202h ; VxD ID of winice$ J7 K8 D$ Z& B8 T! H( p3 d
int 2Fh
7 P# O F4 w# S; m' H0 T7 Y mov ax, es ; ES:DI -> VxD API entry point
6 i, k; w v5 E% o& U add ax, di9 K( Z/ k# f% D. z" ~3 v. }6 D
test ax,ax7 q, d4 [- i# ^: l* `4 d) ?
jnz SoftICE_Detected- K% h3 _% B0 {; m$ r/ z
: C# u- p7 S; Y6 q }, L' J___________________________________________________________________________+ Q1 B2 f$ |" N. b$ R1 Y: X
1 u1 g1 |3 D* j! N! IMethod 04
# |( @/ ]/ K& H" w& O5 a7 [=========
, \; ?$ x% p/ o- q. K1 r) ~
. m. \( W+ o, p: G9 K% R2 R$ V5 EMethod identical to the preceding one except that it seeks the ID of SoftICE
3 r: v- X4 j6 t" d4 ~7 vGFX VxD.$ _. e5 ?- t4 K; e7 i0 ]; D
9 d/ K" n% N: J& J1 [4 w3 G
xor di,di
: Z) X0 I6 d' s4 O) B! L9 X mov es,di8 k. |2 i5 B$ P# O- F! [0 X! Q
mov ax, 1684h 1 ^' j2 J8 n+ ]0 Z! }
mov bx, 7a5Fh ; VxD ID of SIWVID
" G# Y/ U8 g# L9 a' E- T# U* M int 2fh5 L0 K, T! E7 d; S# t- |; x
mov ax, es ; ES:DI -> VxD API entry point
; S6 j9 L) Z3 X! K add ax, di- r: P4 T4 N# Z6 m/ p3 P% f: b
test ax,ax( `! Y5 v! A5 ? ]6 i6 O
jnz SoftICE_Detected; _/ A+ ]) i0 W! G m1 m* _5 A
$ k$ x" ^4 H; U9 r% F& R7 z
__________________________________________________________________________
' i* S, e* O* m
; V ?+ f* ?2 S+ O% q8 C. b0 t4 K/ Q: @
Method 05
3 G7 l3 b3 G! b( R+ Y" R8 }* M+ U=========
L* C$ Q- }; ? m% F
3 w4 {, {9 c2 y' gMethod seeking the 'magic number' 0F386h returned (in ax) by all system
( I* ~* W1 r; y; A+ odebugger. It calls the int 41h, function 4Fh.
& x6 E9 ~9 R7 n1 z& qThere are several alternatives. . x: Y' V" D" Z( n
5 @. y- A. j) p T
The following one is the simplest:
3 z$ ~6 j }8 H. x7 j' h! g1 ]0 ?/ t& ?$ M8 S
mov ax,4fh
. U) J, N) p& n& q7 d2 X$ d) k int 41h) v7 m0 v; w( h% y5 F) U
cmp ax, 0F386
+ u1 j* W0 w, A$ m7 S1 C. S jz SoftICE_detected
7 V7 o3 t8 s: W' u) ]; m1 j6 \+ Y; U! I- Z- U6 y K0 s# t
9 m2 N5 V$ _+ @6 z* j5 G# GNext method as well as the following one are 2 examples from Stone's Y- `: }. y4 g
"stn-wid.zip" (www.cracking.net):4 o9 `( F' D. n! S% t
9 ~- B5 D# P2 b. ~/ K% k0 q) q
mov bx, cs
: H" W3 q( I; s" O! y lea dx, int41handler22 |% F# L, Z# P! `
xchg dx, es:[41h*4]3 ]8 R; J2 S: N8 t
xchg bx, es:[41h*4+2]
* E4 v4 f- ]% }8 y6 Z! L9 S, K mov ax,4fh
3 q4 J2 n$ ^4 p8 v3 `5 s! q' v int 41h6 e% t d6 l: B
xchg dx, es:[41h*4]
* h+ ?$ m' E- E- \8 m# n. T xchg bx, es:[41h*4+2]
1 z ]& l1 {; Q, `& a. z cmp ax, 0f386h
$ c7 }1 W! y4 V) [ G jz SoftICE_detected
# S' B- R6 q9 C O
0 m( J ?: S. y2 r% Tint41handler2 PROC
7 x% _9 f1 g5 B( ~! k6 C iret! A6 _8 k5 g" e# f% L
int41handler2 ENDP# Y% R: A5 Y: ]* n* j6 r% y- n
+ |9 u! u" g9 x! O6 x/ v1 r l
$ v; ~% R( q1 u( y6 m
_________________________________________________________________________# K- c1 D; J& E$ |7 G3 z: U
, m5 n" r W, ~+ R x y1 S
9 }6 z5 a& L8 b- P0 B7 |5 j" j( |; d
Method 06
3 ~8 M+ Y& d4 p# t9 F& L6 S3 @% p=========+ M. Y7 M$ ~ H4 f. V
$ ^# u6 C& ^# O% T
) c& `# V( R! Y4 w2nd method similar to the preceding one but more difficult to detect:! m2 x# A0 D" v1 a' s2 Q
q% e8 f. Q) t( q u! u
+ h: J, Z- t% k C2 e& gint41handler PROC0 M% Z0 H# s! Z# U
mov cl,al* b o; S' O! A' \' z7 R7 g4 J+ C
iret$ h% E& A% ]# R" `6 l& [$ U5 S
int41handler ENDP8 r7 ~8 Y; p, a2 |7 g, `& C
. l6 S$ T2 w X6 @
k& I# ?5 j$ w& r
xor ax,ax
- J" {0 m8 D1 }5 C6 B mov es,ax
$ s% @! Z" I5 w8 \: f% w* u: D' K mov bx, cs
0 A! Y" Z! O5 k1 H lea dx, int41handler
" M$ S! X% W9 |0 X' r) q xchg dx, es:[41h*4]
0 j3 U4 F+ I1 q1 w/ y8 m7 r xchg bx, es:[41h*4+2]
1 E- ^1 g$ l) k8 w in al, 40h# R$ k2 \, U9 K
xor cx,cx) V6 L" j5 z3 {% d3 B% D4 Z2 \
int 41h9 F/ L% l- x8 a7 `# P, a
xchg dx, es:[41h*4]
% M. [1 O# P! b- h6 b3 X+ F xchg bx, es:[41h*4+2]* E, w$ `. A$ A- h
cmp cl,al+ p; _3 G+ G- p8 A q$ p2 t
jnz SoftICE_detected
" O: V2 e! v: G j
6 l, X ^1 M1 O I, }_________________________________________________________________________
( {6 G' ^9 K7 a( n8 p) R6 ^% s
2 b6 ^' X4 v7 j* n" u5 M% N: s1 zMethod 07
- i, ], g$ I+ P0 A* X( g=========, }, B, O# x0 O
/ {% r9 V d% \3 x3 E
Method of detection of the WinICE handler in the int68h (V86)0 a5 X0 k: B3 }: N
1 [2 l3 ^7 g( Z9 ?+ d6 `9 A
mov ah,43h, b0 T9 d$ E8 F9 }; X# Y8 g
int 68h
2 `. D/ o# v6 n- i: R cmp ax,0F386h4 {9 z& _ |& `* `
jz SoftICE_Detected' r' K, G' f8 F. K! w `8 w
/ P4 h$ Q4 U; u. v6 d; O/ ]! `4 R; r* m7 u+ _
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 w' @" {$ S. N7 y3 u3 z( r
app like this:6 h$ p- `& ^6 f5 S
, O4 B/ t0 w2 j. B! f3 f BPX exec_int if ax==68# d6 B; L6 {$ Y& X% D
(function called is located at byte ptr [ebp+1Dh] and client eip is
* ]" ]4 ~" b% O1 V. E% E& |" k. D located at [ebp+48h] for 32Bit apps)
i$ d/ G+ k- }& b6 r5 d4 B__________________________________________________________________________
4 f: n+ `& [, e! ~# z3 T' \
+ ^! z/ W/ E/ S( O* h0 u( {
# |" y# \& d( SMethod 08
6 `1 B6 Z3 M: g2 y0 H. ^1 _=========
# U- ?& U6 r5 ?; l1 U. C0 y1 M8 d* l9 ?( Y+ H
It is not a method of detection of SoftICE but a possibility to crash the: }& H& x+ I; l6 M, j: {$ i* h7 ?
system by intercepting int 01h and int 03h and redirecting them to another9 y. }+ N Q5 Z# x0 o. u
routine.! u- c% D/ g2 ?5 P4 W+ y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# t, H0 A+ @. ~' S) Z8 H) w6 v0 xto the new routine to execute (hangs computer...)
( Q- X, X! Q. c' U; X3 a* c: W
- y0 p1 y/ r F; c8 k" T% m mov ah, 25h
6 c2 K# x% W& T, b mov al, Int_Number (01h or 03h): o" G; r# x" u% }' z$ H! `5 B
mov dx, offset New_Int_Routine1 m7 f0 d+ @) r4 R
int 21h' D: I" P5 z& n; ]; B& v* k. Z
$ J3 Z3 W: p0 ^1 G: O__________________________________________________________________________! T1 \$ G2 F3 N% I5 R, w$ y+ f) j
0 n6 |2 |1 x/ z) YMethod 09
/ i3 {- \" n, L2 ^=========
1 ~/ B8 z- K; }' i+ G5 y n- s6 ?3 b
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- I* w' q m0 A! B! F: W
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 D6 F z. y9 x/ N% b' K; fThe Get_DDB service is used to determine whether or not a VxD is installed8 L5 O) o2 U# l
for the specified device and returns a Device Description Block (in ecx) for
0 a, R- n8 @4 y, Othat device if it is installed./ y% I5 a0 X( c/ D5 g* ]
; j" h2 G7 Z& S$ o9 E) \
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; O8 C" w# v3 q8 X* J/ E mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ B z1 p% q) m' u5 f7 Q VMMCall Get_DDB
' u0 `9 e0 w4 i0 Q& V mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed/ C3 l, [& K! E( M3 C; F* O
Z1 J/ l6 Y. u* K6 v: h3 d8 a* w
Note as well that you can easily detect this method with SoftICE:
8 R }: C2 G) {3 z3 V bpx Get_DDB if ax==0202 || ax==7a5fh8 A5 t' h6 w: `2 e* _8 M' j+ y) x' `
, F/ R: n6 i. \__________________________________________________________________________
# K+ J$ w1 y8 s) h0 I3 `. ]- ~* v2 K! r( P
Method 10
7 H- w8 X: ?- o! a=========( B4 j1 |- D4 ]6 C" g6 ]
2 i1 U( a6 b/ s6 b+ d=>Disable or clear breakpoints before using this feature. DO NOT trace with
3 @, A5 w: z: b SoftICE while the option is enable!!
; W) v! q! n6 \* P0 H$ ^
5 @( W1 S4 X+ d; ?- Q+ n/ q+ m: Y$ OThis trick is very efficient:: t# s: ~5 G( Z( R
by checking the Debug Registers, you can detect if SoftICE is loaded; c6 S' A9 ^. p
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if/ Z5 _& {: N, N/ X1 ?
there are some memory breakpoints set (dr0 to dr3) simply by reading their
+ G$ P/ \- z$ _9 ~value (in ring0 only). Values can be manipulated and or changed as well
; I! V& w( k" L4 N0 V' U' T4 B(clearing BPMs for instance)( {+ t3 Z, [% A/ t
0 K1 {4 r+ i9 ^: k: Z__________________________________________________________________________
{/ b; ^/ {8 X& g/ f# d+ N5 V4 f+ e6 S, L& x& m
Method 11
% A) v6 X4 |9 t# n=========# j8 H' F2 p$ x
1 R3 j, e6 R+ r' |* Z
This method is most known as 'MeltICE' because it has been freely distributed
: T# _4 L! \# h5 I8 [1 e! uvia www.winfiles.com. However it was first used by NuMega people to allow' s, ]4 T, p- D) r, H+ M5 A9 v
Symbol Loader to check if SoftICE was active or not (the code is located z" J7 _$ p: x' `5 g8 Y: O5 x
inside nmtrans.dll).7 } @1 d& U/ k% u1 S6 q" m
3 V5 d% `' j6 A6 H4 y0 `/ g) M% T
The way it works is very simple:
/ ~6 [$ s3 k/ X* bIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, B7 V! h9 O! a3 o) q' S2 q; GWinNT) with the CreateFileA API.
/ n9 O+ Q2 C$ X z' h0 t% l/ ~1 ^+ f! b1 M
Here is a sample (checking for 'SICE'):' Z6 k+ s0 [) ~0 m0 b
: t% \" R6 s. S( F2 M$ s u* B( hBOOL IsSoftIce95Loaded()- l* k! U* A2 I3 u C- O
{* n. j$ p# l- S' t4 I
HANDLE hFile;
, j1 \0 b. y2 E0 |& { hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. B, q. x% {' n* Y! S3 } Q; j m FILE_SHARE_READ | FILE_SHARE_WRITE,
V; m+ n/ d/ M+ g1 \ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
6 e% n& e) d% B: N) q8 q if( hFile != INVALID_HANDLE_VALUE )! T: O; V0 U) F# r
{4 {0 v5 O5 \3 r3 {2 i8 Q9 \
CloseHandle(hFile); ?, D* W5 j& k) u
return TRUE; L7 M$ v& Y& N+ F J" F- n& o
}
( v) a' Q8 [$ i) {, K9 O return FALSE;
# V) w# M, n! W/ x}1 z: I# Z, F3 d7 e2 [
0 P- C. \: q Q7 ^7 q: a0 K0 I$ C4 wAlthough this trick calls the CreateFileA function, don't even expect to be( V6 I; S1 l& p; ~
able to intercept it by installing a IFS hook: it will not work, no way!
5 u9 e, o2 d. f; L( }% Z+ EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
; T' L7 Q9 E1 p* x2 |( [service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( f2 @" `& c' N' P6 I) p- R' yand then browse the DDB list until it find the VxD and its DDB_Control_Proc& M% E/ T8 S, ]
field.+ P+ |6 n1 p/ C J( a
In fact, its purpose is not to load/unload VxDs but only to send a
' `% \1 d# i" {W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
2 R( d( P0 G( o% B: B# Fto the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 b3 X7 H* T7 j# W" zto load/unload a non-dynamically loadable driver such as SoftICE ;-).
" F; |3 E: Z% c* }& M& r" [1 U# `If the VxD is loaded, it will always clear eax and the Carry flag to allow
( f6 O) g6 W0 F! F# E9 ^* eits handle to be opened and then, will be detected.) f/ J9 b$ H; G/ P3 ]; Z( w
You can check that simply by hooking Winice.exe control proc entry point
. }2 g6 q; }2 S+ b4 q" D5 bwhile running MeltICE.
1 w$ C2 y5 x9 q( r' ^6 H$ o, `! u; `$ O. N; Y
7 H) \3 }2 V0 j& u. H2 a
00401067: push 00402025 ; \\.\SICE' S" e% C9 z' F8 J8 F$ l
0040106C: call CreateFileA) C! N* L% S9 H5 d$ [
00401071: cmp eax,-001
" E2 P& x" W7 Y5 _2 r# R8 m 00401074: je 004010913 e5 d2 p! _4 o' X
1 I+ \( w) ~* o2 K5 O6 U; z( B0 I! v6 ^* d {
There could be hundreds of BPX you could use to detect this trick.
8 y1 }- {. I1 T9 v n' P+ _' c# o: F-The most classical one is:6 C% P i: I: E: p/ c5 Y8 @
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ G. Z+ @) f- T, V+ O *(esp->4+4)=='NTIC'
8 s9 W$ ]! U, Q2 z2 D
* }6 ]) j8 v0 @, o-The most exotic ones (could be very slooooow :-(
* ?2 `4 G- j, Z) x3 u- r BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') * S( V7 [0 }- k n4 }& e
;will break 3 times :-(
, ]; v" }1 k0 b9 U5 B0 l5 E. v" g: g5 S0 x& t" ?0 \; S8 q
-or (a bit) faster:
) i; @; [& w/ x0 v* e BPINT 30 if (*edi=='SICE' || *edi=='SIWV')! C J7 q/ h4 b' W' C( J! y% ^
+ S7 O' V1 ?; A; L, s& o
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ; Y5 }! L- d; t9 Y
;will break 3 times :-(; A. j0 i, Q$ ?" q
& K: w6 s# G' d" T$ ~, ~, V1 t-Much faster:
$ U# n E4 H9 N+ u# V+ O1 y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
1 J; l7 H3 `4 [5 G8 B
, T. ?: x! m. p2 s( P; RNote also that some programs (like AZPR3.00) use de old 16-bit _lopen! o8 J; R% K* _* S- v+ c
function to do the same job:3 r+ j1 S! v9 v7 N% p' N* J
1 Q7 K* E. j& P8 C8 S n7 T3 ~ push 00 ; OF_READ
@3 j- ]7 e9 X mov eax,[00656634] ; '\\.\SICE',04 R* G& B B5 P; T
push eax
% [7 n% p! y3 U. {; H call KERNEL32!_lopen/ _& `3 n0 X/ b8 z) q
inc eax- {( s! k6 _3 `7 d9 ?
jnz 00650589 ; detected
7 t5 \2 p4 X4 z! G- M! g, x* p5 s push 00 ; OF_READ2 Y- `8 B6 |- e( |- h! A
mov eax,[00656638] ; '\\.\SICE'
) f' i Z5 s* M' r* o; p push eax
" d* K- Q# e; C e6 n3 o call KERNEL32!_lopen# C) N# M0 ~& k/ Y5 P) b
inc eax
& M5 y% a+ h8 R! M jz 006505ae ; not detected
8 s# H& q+ \) u7 f- U$ U" [3 G/ ]; s5 b% n- |: A5 v6 k
2 k# f1 Z3 M4 h9 u% U1 ]__________________________________________________________________________8 `3 }9 O2 K! l+ f
+ G% G% `0 E/ U9 c ZMethod 12: c6 X+ q' D4 ?8 F
=========
e+ E8 f2 g3 e- j' @# p" q0 R: ~0 u/ k D" i0 H, J E
This trick is similar to int41h/4fh Debugger installation check (code 05
5 w2 R1 y5 q. ^8 p& 06) but very limited because it's only available for Win95/98 (not NT)5 N) J- u5 h1 d0 @
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.) T' ~; p. I2 ?7 ~5 l2 Y
1 x' d# y: P# W J8 E
push 0000004fh ; function 4fh
' k7 j6 c( B0 B3 F+ r T push 002a002ah ; high word specifies which VxD (VWIN32)' _& z6 B9 ~4 M
; low word specifies which service3 W9 r" p. l) `) {, t
(VWIN32_Int41Dispatch)
- x+ j. w( A7 A call Kernel32!ORD_001 ; VxdCall
! l1 V7 l0 r; |( P' q3 k* [ cmp ax, 0f386h ; magic number returned by system debuggers
/ d. I3 t2 F/ o7 Y* f jz SoftICE_detected
2 u8 T7 E' a# j/ b# S5 U5 a G Z! i6 b/ d# f: ?# B, z
Here again, several ways to detect it:
L, ~9 A5 ]. [8 H+ b1 `9 L
d9 b: ~4 x5 v; }5 O, B BPINT 41 if ax==4f
3 [5 J- c [7 f, U3 e' C8 n& m$ F# w% J
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( W) `3 {4 ?5 W4 k8 U/ a
5 ~* [( i0 I3 ?8 y0 T7 N' s BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
, b+ L& B, e- ?" d& n
7 {9 ?0 Z3 V7 l BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 N# g$ d& f/ a& S; w2 \( d+ h3 I$ t, |6 R0 q3 R
__________________________________________________________________________6 `" f9 \& A- \% P9 i
1 D4 I( M/ `6 v! R
Method 135 o/ u: I# \; h& U
========= H& e% ]1 X F) y1 B% Z2 p$ X
4 l6 `" ^# z* O
Not a real method of detection, but a good way to know if SoftICE is
9 m2 n& Q1 u. j. \7 g1 yinstalled on a computer and to locate its installation directory.$ c5 `/ z/ I t5 j5 _
It is used by few softs which access the following registry keys (usually #2) :
- q3 b7 E$ G$ M8 K7 E7 _$ L* D- n* V0 |
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 |5 r! z! ^% x& p& ?& V
\Uninstall\SoftICE
V- s8 j9 T3 r2 N, W: X-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 F# t0 I+ D* R$ S' w) |, i' F0 z-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 l! J: E2 q( J2 |. W+ q\App Paths\Loader32.Exe
: V/ e! p; X2 ]( V, V; ~: u6 f5 ^$ h# Z1 V/ p* H, E# E2 O0 n, H
4 n% A c+ D, ]- T5 |2 l, T0 c) ZNote that some nasty apps could then erase all files from SoftICE directory
! f8 H& T8 s5 G(I faced that once :-() F( ]% _+ v" m9 F( W- O
3 f5 `& t& c( X9 ~; m- X
Useful breakpoint to detect it:3 C3 D$ X4 U- f
( c! I" V. g, v
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'6 W" \$ a/ i/ ~* k( d* J" F
( H, c; P" b# ~1 M) p) q
__________________________________________________________________________
4 }! _: R: ^6 I$ p+ c( P1 S1 c8 c! C$ q5 B% X8 p! t
) }9 P0 L) _8 Y) h9 PMethod 14
0 U3 R: |/ y, g4 k1 O$ y9 q=========
5 T+ \% E9 Z; `7 b. m2 m7 { D* M3 ~4 U
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 D7 M0 |+ b( o6 eis to determines whether a debugger is running on your system (ring0 only).
- p( L" s" r: n# [" Y# s3 D8 V# }8 o) Y$ u
VMMCall Test_Debug_Installed
% b3 a0 E9 G+ E2 V je not_installed
6 D$ x; Y& f8 h: K$ \' o) @' i+ z) z: ~) @1 S! G0 R' ]# t8 f
This service just checks a flag.4 u/ h6 t- W8 _& Q1 n1 X) \
</PRE></TD></TR></TBODY></TABLE> |