<TABLE width=500>
. Z$ ?5 |7 U% a& h: e' X0 q<TBODY>. T) ~. O- A. D! C. A
<TR>
9 L( W5 {# p* Y- C. g<TD><PRE>Method 01
& y1 r j) s% X=========
5 V$ n# A) Y1 g1 N
# m* g5 s4 ~6 H* ~This method of detection of SoftICE (as well as the following one) is- H$ P. Y0 `+ R
used by the majority of packers/encryptors found on Internet.) g, w9 D* L5 E0 V/ K( M( F2 h
It seeks the signature of BoundsChecker in SoftICE
2 {: j0 D9 W' F# z9 x/ O4 C% ]: F+ c6 _6 e
mov ebp, 04243484Bh ; 'BCHK'
1 M2 O( y+ t3 m5 p7 z" x4 F mov ax, 04h
+ [- m7 s# v& n% n8 K int 3
) H6 `! L6 |, L2 ? cmp al,4
1 ^& Z T4 R. r; ]0 X8 K1 m. Z9 T9 C jnz SoftICE_Detected
2 ]; f. g+ t7 C5 k8 P% c0 z4 E) l( }2 W0 ~7 o( |
___________________________________________________________________________
- w2 V) e1 t( s+ c. y: t/ {+ P/ }7 u5 }* o# j7 I
Method 02
5 k/ J. u6 x: @( x% {) C3 k8 f5 O=========
# h" V0 `5 p( R- V6 v) B, L
% r, g! l/ m) C2 D# ~. |Still a method very much used (perhaps the most frequent one). It is used Y2 j1 o% O$ x t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
8 X' t* a5 o/ u: `, ?( Sor execute SoftICE commands...5 N( z' ^0 F5 Z7 h3 a
It is also used to crash SoftICE and to force it to execute any commands
0 K! n/ [( n$ O! Y- f5 S(HBOOT...) :-((
# V! l+ N7 w: ^2 @* H
/ { k( e$ b. C( V: G9 ]8 BHere is a quick description:
2 Z4 U) N+ ^# N4 R. e-AX = 0910h (Display string in SIce windows)' Y; i! k, p7 ?2 e7 Q( }
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)7 s4 d* l( L. W% y$ i. x
-AX = 0912h (Get breakpoint infos)
% K& X! J; h( {-AX = 0913h (Set Sice breakpoints)
& J+ x* u& A2 V) q) N9 U7 `. F-AX = 0914h (Remove SIce breakoints). D! K2 @3 z) x% M0 a" x' f
1 O+ p2 H# Z9 iEach time you'll meet this trick, you'll see:
. p) ]9 \+ r" ~$ \-SI = 4647h
* x. ]3 o2 |$ j' _-DI = 4A4Dh
0 o# [" Q1 Z4 e% ]1 [Which are the 'magic values' used by SoftIce.2 X* e6 T) `2 G& h0 B
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.# P$ K( V" z. t7 }6 j+ k% f
5 d5 V% ~- U! ^6 d: J. G
Here is one example from the file "Haspinst.exe" which is the dongle HASP
* E$ a6 K. G7 j* y6 R! SEnvelope utility use to protect DOS applications:
: @: y: ~* b! }. t, v0 N
# |# n# b/ C$ a' P/ H* _) Z' n8 R; q
5 ^" P8 @6 ^; L4 f4C19:0095 MOV AX,0911 ; execute command.
2 ^" f8 m0 V& E% n4 J4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
6 S/ U: |7 \" p& V4C19:009A MOV SI,4647 ; 1st magic value.
0 o* x3 M- w# b( {& }( m, X4C19:009D MOV DI,4A4D ; 2nd magic value.8 z% i* B1 Z, Y. o
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
/ H9 j. Y. T/ S/ M# x( m4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 m8 y5 g- O" L- J# M6 t/ N4C19:00A4 INC CX
6 o2 P- D- G5 W) T4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& R+ U/ B* V% l; ]4 F
4C19:00A8 JB 0095 ; 6 different commands.
8 {5 ^- [8 x) O8 d3 y# _+ \) e2 x& \4C19:00AA JMP 0002 ; Bad_Guy jmp back.) \4 q l: v8 V, c
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: R6 m/ d5 L7 ]% i8 t n; z1 n0 F% A. B' ?9 N# p
The program will execute 6 different SIce commands located at ds:dx, which8 Z/ B# `: B) d) |* X+ z; {7 N! k
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& [, ~# @" n+ t( v4 p O) n% t
0 {* u `' O+ R; w* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
X- q# _7 {$ h+ K- b/ ?___________________________________________________________________________; D2 J% h2 {, K/ Z
9 y8 }% T- t1 z0 `# A1 i
) m! `7 W/ Y7 K! a; c6 A2 a
Method 03
- j) ?2 m. @$ A: @=========
n+ ~1 ` f" N, W
6 c0 Z& l+ q% ELess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h* L# t! _; N( c- U2 M u9 P
(API Get entry point) v" X6 F8 N! c6 v' M5 J
: s' _' s1 s+ t6 o1 ~# V; P( C6 g# H$ L3 |3 w
xor di,di
. W# P; R* I5 ~2 _' t mov es,di% f% _: J& r. E
mov ax, 1684h
; d+ s2 Y7 p4 n7 J1 @ mov bx, 0202h ; VxD ID of winice
! b) H3 d; ]) o* t$ \ int 2Fh
6 N0 Z, ^2 N6 {7 F+ H a mov ax, es ; ES:DI -> VxD API entry point
! w4 Z! ^: ~) B- L8 X) |* s: r* G7 Y add ax, di
5 x7 M' |3 y, P2 V# @ test ax,ax
( L' w" Q2 W0 R4 A jnz SoftICE_Detected( J* a; m+ ]1 k7 i& i; r! E% q
K5 W) m# i7 m2 @0 U/ z: g$ X___________________________________________________________________________
. w5 |3 p( X: Q; A/ n1 O/ r! q3 _9 s0 k1 G4 i' C- B$ n' J
Method 04' E! ~- d( H; H( K6 `
=========7 q% _9 s2 F* k; J4 u( Y+ a' d* V5 D
, r. s2 J7 L7 E( r |' ^( @
Method identical to the preceding one except that it seeks the ID of SoftICE
1 o. f; }/ |* MGFX VxD., w% p! B0 `# L+ J
! X' E0 x' e5 Q0 N6 C8 `0 x xor di,di, Z* f5 d, {9 v; C' t8 b% e" D
mov es,di
% Q9 C8 @* ]+ L8 D% k. s( M: F mov ax, 1684h : S6 B! N/ S% c5 F; `
mov bx, 7a5Fh ; VxD ID of SIWVID
) H# m; j# r. O- n int 2fh
7 G" [! K. e- H. d mov ax, es ; ES:DI -> VxD API entry point6 K4 t5 m( ~# p+ l- o8 r
add ax, di: Z/ P+ J% U" Y$ g4 D" ^* r4 I
test ax,ax
( Q% h9 J( J, b9 u- D jnz SoftICE_Detected1 Z6 A2 x3 E" u0 i, C
: O, s {" c" ?/ H# l) w__________________________________________________________________________' H- W0 o: L* k' P S- t/ K! Z
& h# {* e$ q7 a. V" p6 E& U- f- E0 d9 [0 {' j) G
Method 05
, \2 F0 @. t+ e g- M o5 @=========
" d4 Z+ T# H9 K
8 `0 Z3 l' U$ l: h9 CMethod seeking the 'magic number' 0F386h returned (in ax) by all system
* j3 _7 w6 I/ z5 O* e# c: s( Zdebugger. It calls the int 41h, function 4Fh.1 a1 C# Z" k' B5 \% F1 `# C
There are several alternatives. # B, k( p" a \+ j# G
, o) w+ `* b' ]* m* j; j( ?The following one is the simplest:. h ?' \( r7 C# N0 t. r8 a+ W- E
3 \ m- z& s* g* ]+ [! _
mov ax,4fh
$ n+ P8 Y" P2 Y# X1 `- K/ J int 41h
' t% k, {7 Q6 l" Z cmp ax, 0F386
7 A6 [! Z6 D* K* _2 L3 Y jz SoftICE_detected
2 S5 L4 Z% Q, W$ r, O/ Z+ j3 V3 t( A! q& ^5 w, K0 Y8 g
6 l# o' p1 @" p5 A+ |5 S% K+ H3 cNext method as well as the following one are 2 examples from Stone's 3 i& m9 [9 S: }7 R/ C& ?
"stn-wid.zip" (www.cracking.net):
2 `" I' t% j. u# m3 o0 J& C! y6 I/ A
mov bx, cs
: T9 k6 s: r: N ?+ X$ q lea dx, int41handler2' S* n8 E1 m) n+ E0 Z
xchg dx, es:[41h*4]
) J% o* e# a7 L; N8 O9 J; \3 a xchg bx, es:[41h*4+2]
9 P* t7 ^0 K# x* k' x mov ax,4fh4 W; S4 P; e; n! {
int 41h* G& ]3 J- j0 R6 k" l' V
xchg dx, es:[41h*4]( b6 S+ R1 p$ Q# [& z
xchg bx, es:[41h*4+2]
0 l: F1 |8 z! q9 Z, f5 p0 X) A cmp ax, 0f386h0 l1 C0 K v6 \% w7 R
jz SoftICE_detected" w6 z+ I8 {. }/ z u4 e
0 e. w# v; ^) c y( O, r1 t4 ?
int41handler2 PROC
& V9 g( _ D3 r iret1 r8 R* n! ]$ t j& X' D' ?, D
int41handler2 ENDP
4 i8 m, Z4 X' J9 u! P5 A1 d0 ~
3 w* q; p/ E1 y4 R- J% V0 x9 k9 _1 m1 Z4 i4 C4 v
_________________________________________________________________________0 J/ r8 _9 a$ k- t4 b
& C% I# P) S4 }: K' z
i8 K# Z+ L5 J, Y
Method 063 {0 v2 T8 V9 A5 j7 g2 |
=========1 b$ _$ p1 `. _
; o( p. m+ r1 d/ g( D
t, D5 N/ s3 V8 S2nd method similar to the preceding one but more difficult to detect:
, A" d4 A( h( ?8 R. K h! o& P. T0 q) s2 U' E9 S
W: p1 c, ~+ D9 w8 \; T4 l
int41handler PROC
. Y6 O% K" \- t, |* u4 |; f mov cl,al
' N5 G* N+ {& X iret
9 N% L. B. m0 _1 e! rint41handler ENDP
/ X( w; }6 u6 ]8 H v H9 q' {3 ?. R3 B- p& e/ A( u
& e6 I& |1 j! i1 @2 l1 X2 {0 C xor ax,ax
. r$ C3 O. ^; i# g mov es,ax" s& q) D* F2 \* q' y
mov bx, cs8 m, l N- }! z. P9 B; G
lea dx, int41handler( _0 t% r% n: Z0 {5 Y J N1 @9 O
xchg dx, es:[41h*4]- C# i/ V+ C6 c! m4 `$ {
xchg bx, es:[41h*4+2]
, w2 n3 [8 ^! ? R! E$ z in al, 40h/ m. u8 ^+ t V% ?) ] r
xor cx,cx
; ~- } N5 [! s% x3 {1 _2 g int 41h
" D, Y- M' S/ e& C* g xchg dx, es:[41h*4]
6 l$ j1 h. I9 n1 G, U+ E$ V xchg bx, es:[41h*4+2]8 q* Y+ F, J8 b! h* q7 U5 M
cmp cl,al
; E) w! a2 f+ J8 u; L0 w8 C/ p" d jnz SoftICE_detected
# U+ X; R% h; ^8 w2 P/ ^$ p
: w- N+ h- `: z5 B_________________________________________________________________________1 I; X$ }$ A6 Z5 Z" u; h
! x3 Z+ P& J# Q, m( x, ~Method 07
3 W- `/ D6 b, W& _3 S6 [( j=========
/ ~7 Y: u' u2 [" q- \
$ J- `! M+ F$ Z+ GMethod of detection of the WinICE handler in the int68h (V86)! c- N7 b2 c: J+ ?
! ^# G0 L! ]4 [( F3 ^1 [
mov ah,43h9 r4 P" O3 o* q; M" h' i" I
int 68h1 _$ I0 m4 V6 s- Y; Q
cmp ax,0F386h
. y3 L. d4 r* T: C! @ jz SoftICE_Detected6 n! P7 R4 n- p7 `4 {
' {7 p+ O% `" s& q/ a, o
5 F* ?5 I' Z. Y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! w1 }% e4 E( n6 I
app like this:
5 u6 }2 \: N: d/ q; m" A& k. S& W' T5 I, i/ A: B
BPX exec_int if ax==688 S6 O" @- G( _8 l' z
(function called is located at byte ptr [ebp+1Dh] and client eip is
. r% B5 w& J; K! C3 E- C located at [ebp+48h] for 32Bit apps)
' N1 f3 ?- n3 Z) P/ [0 A* E8 D__________________________________________________________________________
- X( G( G; R5 d. U3 s0 @7 O6 x
5 \9 M7 T; u6 J
. C( `1 P; ]) Z4 W9 aMethod 08
, n# `9 y' r( {=========- L( i' k/ n- E \; h
' q3 b' K1 \1 N" z# E
It is not a method of detection of SoftICE but a possibility to crash the; e/ M9 G& G: o5 O3 p9 d" ]0 s ~, Q; g; k
system by intercepting int 01h and int 03h and redirecting them to another
# c" Y5 `- B5 n3 groutine.
& a6 v9 ]3 N$ o0 XIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
8 x" k% J) q6 @5 `! d$ x3 E/ Kto the new routine to execute (hangs computer...)
1 N4 B) C, ]+ [6 b9 p4 }- R4 A
( Z/ @% ?- a& ~6 [+ g, {8 b mov ah, 25h
; S* Q6 q* I+ ~8 i! p6 c mov al, Int_Number (01h or 03h)
4 M1 T5 A( T$ G) s) Z6 _! J3 I mov dx, offset New_Int_Routine
& V* Q2 c2 Q5 ^* B. p' _ int 21h6 {6 Z- x# k& ~* z
# s* a/ ^* L! T( ^$ B; ?$ j__________________________________________________________________________5 R/ c; T W+ c/ V3 a
, o* |5 w* D4 PMethod 09* y8 W- K) H% r
=========, M/ @2 ]2 w- \% ~: \
, M# e) r8 H ]: d. AThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only3 {/ ?1 z6 z6 q: L" j' W- F
performed in ring0 (VxD or a ring3 app using the VxdCall).7 ?: m* i ^' a, y$ H+ l, [
The Get_DDB service is used to determine whether or not a VxD is installed
: I `; [, k) s, G" Q7 i9 lfor the specified device and returns a Device Description Block (in ecx) for
( O `% i. _, y$ I8 K; E, qthat device if it is installed." i6 q2 t# _* k2 ^
" N; k2 w4 [) }
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! _. c3 c J! z# u9 T& c0 V
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
8 p1 c5 l6 m# ~ VMMCall Get_DDB* {* x; ]3 d5 X0 k) _4 l U" j7 S
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
0 M5 E9 ?0 F1 J* a; F y# ~' T/ V' _' i- t7 C
Note as well that you can easily detect this method with SoftICE:- G" u) T+ i. K4 [# _
bpx Get_DDB if ax==0202 || ax==7a5fh0 R- s4 ?7 D, m
+ [/ C* M* U9 Z1 k; B m2 T
__________________________________________________________________________
' F" w9 K/ ^- W0 |$ y5 F- x+ D7 o5 m8 q, G+ i- ?, I
Method 10- w& _' P, k1 x- h1 L
=========
+ j' k" R$ T: m& @. A' i4 o
6 J s# d, n* I& T. ~$ V+ [2 n/ }=>Disable or clear breakpoints before using this feature. DO NOT trace with; A8 M8 g) x5 k
SoftICE while the option is enable!!+ P4 q5 ]+ B+ [9 d# F( o
+ \- P! T0 j; M& }$ M6 J% nThis trick is very efficient:: r9 ^8 G. C: N; W4 b
by checking the Debug Registers, you can detect if SoftICE is loaded
# ?& w7 \& E/ B- e$ d) v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 z, K- ^( G' w
there are some memory breakpoints set (dr0 to dr3) simply by reading their6 ^8 r2 {* q1 s
value (in ring0 only). Values can be manipulated and or changed as well
- P5 ~; g: C: n& q1 H9 u(clearing BPMs for instance)
2 o9 V0 g9 N3 g, @& l- a
% c* _& q' ]2 k1 W9 Q__________________________________________________________________________1 Z9 s# {' H& k7 p; t0 ?
) P# l. y R8 _Method 11
. c) a2 h6 y0 l! i+ Z/ F5 N=========# n& J# W j. }+ _1 V5 E( r
$ L. h+ J* D' Q8 WThis method is most known as 'MeltICE' because it has been freely distributed, t6 K, z' j* Z F
via www.winfiles.com. However it was first used by NuMega people to allow
$ L& c# P7 D% Q, jSymbol Loader to check if SoftICE was active or not (the code is located# w! {2 I' L0 f: V3 I* o/ ?
inside nmtrans.dll).6 |9 t+ t2 G8 M' `2 J
$ U6 O: i8 A b. |* e. W+ b* }The way it works is very simple:
2 K9 l- a" ~. T- g5 Z' pIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 d, z% V/ `% L$ |2 YWinNT) with the CreateFileA API.3 V7 q, r1 n, S, M/ s/ F. S
4 |! l/ f( i* l* d3 {4 l, dHere is a sample (checking for 'SICE'):# z. k) x0 t' n' ?. e2 h
: q6 q: C. Z5 @" _* @
BOOL IsSoftIce95Loaded()1 l5 u- q6 Q0 r4 \6 B- R' s, |
{
- }9 s0 e6 n: a% O& L( V HANDLE hFile; 9 _+ ^( s! V; @4 y! l8 Z" Y/ v
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
# @+ N) q9 k+ _& Q8 }! Z3 _ FILE_SHARE_READ | FILE_SHARE_WRITE,. P1 i& S) I0 a: G5 Q7 w, @# ]3 C
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 }0 V# |# W& g
if( hFile != INVALID_HANDLE_VALUE )
5 o* U3 g( S: j {
: v0 p, W3 l$ G# p; k2 F+ M! S1 j& a CloseHandle(hFile);( {% ~) A$ q6 W# R4 P, N
return TRUE;! f3 B9 V% F5 w' F
}3 z R- V5 B1 f+ P E7 {
return FALSE;0 P: O* ~) k. `2 Z8 i& F
} X' W: y: M$ X; S0 |; Q* W
, ]4 J" z$ A4 V: S' _Although this trick calls the CreateFileA function, don't even expect to be
+ l" b$ B, c! fable to intercept it by installing a IFS hook: it will not work, no way!
# J8 U) s X2 sIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ M) |9 J4 ^$ e9 R& O) Xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 l9 q, j$ r( M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc- {6 o" w1 P+ j% u* F" L
field.% l( A j2 u0 ?8 o7 C
In fact, its purpose is not to load/unload VxDs but only to send a % b# b ]) u; f) w
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 P) @4 f& V1 u) t5 Jto the VxD Control_Dispatch proc (how the hell a shareware soft could try& u7 e1 c5 B: [( Q+ A8 |' P ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
: Y# _; S* X, a7 A0 F. AIf the VxD is loaded, it will always clear eax and the Carry flag to allow! u- `9 `6 w- z$ K' H/ g9 }0 Q4 p( }: T
its handle to be opened and then, will be detected.
& K# f- L/ X7 c* A, t8 T, _You can check that simply by hooking Winice.exe control proc entry point' g6 I" ~8 F& a( F- @
while running MeltICE.
7 k: H! p( n6 m6 G9 D! C M, q9 q! q( S& x6 b
8 f( V& i% [" ?- {- {" b8 y5 n
00401067: push 00402025 ; \\.\SICE4 g7 w& o+ ~* r) g9 U7 ]& `9 L
0040106C: call CreateFileA
' ~" c" ?, k1 ^1 ]3 V 00401071: cmp eax,-001
- T7 E2 C c% u* G 00401074: je 00401091
8 r) R* e- x( i9 ]" |) L' F8 q9 D* h% ]+ Y9 x
/ r0 j! d7 Q9 z R. K
There could be hundreds of BPX you could use to detect this trick.
* S2 u* Q! b# J1 q4 y7 m6 j" }-The most classical one is:
# F5 I; @: \) e w BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||$ W' e, D* P/ L+ c
*(esp->4+4)=='NTIC'0 u9 B+ M$ P2 `' I1 P+ I
; {/ F0 v* F, w+ c-The most exotic ones (could be very slooooow :-(3 W5 H, T9 t+ E& l$ u/ ^
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 e9 ~* s, B+ B4 O& E
;will break 3 times :-(
0 s% l; h: W$ }5 {$ a* L
# e$ S) V: ~3 F1 o-or (a bit) faster: 4 }4 X3 o1 ]! U" y) \/ s( X3 }
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( i. G. ~ C- f$ \" h7 S" F
5 |- u' ]% k; O BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' & P. u8 s2 Q, v
;will break 3 times :-(, T0 P# }. @# I7 [& q! [
2 g1 [/ A4 d' j2 W-Much faster:
' q/ M& S) \' H- @5 u& t( ?; u BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'3 ?! U2 w5 a+ M/ N6 p% d/ v( F# m
( h; Q* A; ]9 @. P. _Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
& I# b- g" o( @5 Hfunction to do the same job:
$ _4 }! v$ p, b+ j3 g/ U/ ]
4 S) v I9 g) }$ p% ~ push 00 ; OF_READ( o% I; v v/ R ?' C
mov eax,[00656634] ; '\\.\SICE',0- p% X1 Y. G" K/ @7 M3 k
push eax
) N% l; `5 B0 Q call KERNEL32!_lopen! ?1 J6 [4 P0 f8 h
inc eax
& }, q# E/ Z' a6 P jnz 00650589 ; detected
9 ~ k8 \/ Z4 V# l# X5 F* a7 d push 00 ; OF_READ
1 ?( b4 p+ ?$ |9 z4 K mov eax,[00656638] ; '\\.\SICE') a# I1 s: ]5 c
push eax4 H3 P k1 Z# u
call KERNEL32!_lopen
; d8 A% m$ }' p% d* [( C+ T inc eax6 T5 b- r7 [3 o# n7 p
jz 006505ae ; not detected
( k `0 m2 `! K3 }9 h, ]0 H: s* c' V1 P `2 _' z
0 L+ J$ C" I, g& v5 q- ^7 J
__________________________________________________________________________
7 p& J+ d/ P+ ?$ g& b) u' x1 }% i0 S4 M$ C* s! v
Method 12& I6 J- E' B$ P4 o( _
=========6 V& l j) ~) q$ k* x1 ^
. o S6 k1 J* G* h9 @" i# }This trick is similar to int41h/4fh Debugger installation check (code 05( O4 M0 m4 g$ L( J- ~
& 06) but very limited because it's only available for Win95/98 (not NT)6 P- @+ _, ^! @9 T
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: q' i+ J8 C5 y: W
R8 L' `* K, t/ U push 0000004fh ; function 4fh# P: P7 K* J2 S1 y
push 002a002ah ; high word specifies which VxD (VWIN32)& F& K; r) r0 S3 U) i# ~" m
; low word specifies which service- ^1 X1 c; V0 ?4 ]3 a5 S
(VWIN32_Int41Dispatch)
9 }# z6 @$ p/ G3 ]7 D/ w call Kernel32!ORD_001 ; VxdCall* `) p" w4 G- Y+ u/ s
cmp ax, 0f386h ; magic number returned by system debuggers
3 e8 J& I R( Q1 p jz SoftICE_detected
) s8 M6 K' J: t% P8 f" x" B4 c) n& Z$ Y2 S" y7 C5 l5 N3 Z/ i1 Q
Here again, several ways to detect it:
: C- L( g5 n1 k; [) w n
# F7 ]/ W$ Q) B, k. T" a BPINT 41 if ax==4f5 N- E9 i4 ~! w3 _* n* o
7 n) e! @2 J8 _- H9 U w& G1 g5 W) Y8 t. p
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one5 v3 D( o5 @6 D2 t8 R3 _
& q; ?) K( q4 m# `! C2 S$ [
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
# K1 `& m2 L7 u7 v a7 e7 P- o8 L4 r; s
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
1 v2 y- X. R/ M }! |- E+ V4 y
" C& u$ D% b. ^4 r q__________________________________________________________________________
q& U" W8 `! @! l/ J. F: C( j
/ h; S! P& s% ~1 J" g! @+ {( mMethod 13 L$ D) _1 l: X! c1 P
=========, p [/ s& u9 ?1 p! I h
7 y1 s2 M. t" k# Z5 K' }. x
Not a real method of detection, but a good way to know if SoftICE is- i" e Q5 U( r* ^( J& @; s
installed on a computer and to locate its installation directory.
( e; x! e9 T% x3 m; C/ lIt is used by few softs which access the following registry keys (usually #2) :
( S' Z. ]; Y8 o* E! m
# k" U, t* F" u1 ?: n1 S# i7 J-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ d7 I; y4 A& S3 ]+ ^
\Uninstall\SoftICE E" V" Y9 N& I2 w% v) c7 x
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- u3 K# x K6 H( e% U; U-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: N% q* k! _+ s; H( u4 }0 f\App Paths\Loader32.Exe
8 l7 }% m/ p2 K; w& Q: Q% C' i% `: B; c( s" a6 j+ H6 A" D5 e
! x! I0 H' `( E; D. ]! aNote that some nasty apps could then erase all files from SoftICE directory
: S1 d5 i0 |5 b, b3 M2 O& J(I faced that once :-(
: e. L* r* K: ~+ o
( H' j& H5 M6 X1 yUseful breakpoint to detect it:
, w4 p$ X: r; Y5 n4 n0 d" E. Z# B7 _/ T; W1 Q
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ U+ S6 `' c" y% i
8 j1 f ~+ u0 O9 \. x
__________________________________________________________________________
0 B: k6 }/ o1 q4 C" {! Q2 v
! M% _" z1 q. x$ F; D
) K2 T+ L7 ~9 c2 c% l4 pMethod 14
* z$ l! c" A% s5 {=========1 f. d) W" ^4 W) \1 k1 j
4 p7 t2 Z/ Z4 a. sA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. g$ z9 O" w% S0 y; x
is to determines whether a debugger is running on your system (ring0 only)./ {/ q! t+ ~# K- m# k$ v
0 H, O7 x9 M F1 G
VMMCall Test_Debug_Installed
1 E& L" @9 g" D# ]; C je not_installed
' j" W9 x5 w* ~6 P4 o: @8 l
' _4 N" j- A7 c: A9 G2 U: GThis service just checks a flag.
. R+ z4 N1 L) v) Q$ T1 a</PRE></TD></TR></TBODY></TABLE> |