<TABLE width=500>5 I0 Z" \* L v
<TBODY>
! i& `7 O+ D6 ^ u9 X" T<TR>
' H( u Q: X/ l/ G* a1 X; Y<TD><PRE>Method 01 / m. q. m+ r1 v
=========
0 a5 b7 v! \5 q* K1 Q# i7 J' F+ o! z4 T1 W, A! |" c& C
This method of detection of SoftICE (as well as the following one) is& f3 v! J" c- K* l5 M# P
used by the majority of packers/encryptors found on Internet.
[: @9 X, ?8 Z/ LIt seeks the signature of BoundsChecker in SoftICE
7 |9 {: u- z2 \& m& }- v* V' q% P: ?" F0 o# t
mov ebp, 04243484Bh ; 'BCHK'
4 e) X6 I# A. \8 F+ W$ o( x. ? mov ax, 04h
, [. X6 ]$ ]. y3 } int 3
K% y* m0 H2 a% Y" D cmp al,48 ?' z. `1 x; j0 z7 R/ ~
jnz SoftICE_Detected: U6 L0 f% n7 m
/ x8 `; `8 Q8 ?3 ]2 V___________________________________________________________________________
& |/ |4 K( B' v* B' K5 T2 l E9 i) p! Y' y; J9 I. y* G
Method 02
3 v: j1 Y) J9 A=========
) h% U! \$ Q/ m9 H( Q
t( l4 b: J+ n4 X9 m/ P) gStill a method very much used (perhaps the most frequent one). It is used; `6 }; [4 W- v, ?( b. [7 S6 F) N
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 }8 H |% g/ E5 X" D
or execute SoftICE commands...
5 p+ y$ ^$ o' s9 C3 {' ]0 OIt is also used to crash SoftICE and to force it to execute any commands( f$ k8 @# k) F% ?2 }6 m
(HBOOT...) :-((
! F6 a$ [! @! {: y# P: ^
6 h1 p( D2 G6 u- X$ p8 X6 FHere is a quick description:
; Q' A& Q3 o* B. T* z! ?. G-AX = 0910h (Display string in SIce windows)
5 C& D* Y u. z/ `" n) c-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)+ M+ }2 G m9 r+ ]9 p
-AX = 0912h (Get breakpoint infos)
2 W& J" O! x: X0 b! r+ J6 n-AX = 0913h (Set Sice breakpoints)
; a2 i( m' z& Q8 Z" ^-AX = 0914h (Remove SIce breakoints)
3 U F: q6 A( Y9 |9 s) h2 I( y5 o! L0 |- Q, w9 t: T7 P* k
Each time you'll meet this trick, you'll see:) F5 v4 Q* u6 y" r- |- R
-SI = 4647h
! M- w8 x- J# ^-DI = 4A4Dh
% ^7 d7 N$ b+ P9 X8 k( C; }Which are the 'magic values' used by SoftIce.
) K* B' O# u: g# m# c' _For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
0 X d+ l, T2 A9 y
( ^2 [) {, M+ c& {: THere is one example from the file "Haspinst.exe" which is the dongle HASP
~+ \1 b* K1 D$ y6 j6 SEnvelope utility use to protect DOS applications:
( q9 a7 O. A% z( S( q
+ I) x, S) p- E( G: @& ^+ m# i! a, o) i; V' X3 i
4C19:0095 MOV AX,0911 ; execute command.& |% P8 k( }6 B; P
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).# Z' b% M6 a' s
4C19:009A MOV SI,4647 ; 1st magic value.
4 `, q5 x- K/ H9 {* R5 C% i7 [4C19:009D MOV DI,4A4D ; 2nd magic value.# q2 h+ U1 z8 D' x8 ^
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
3 p9 d; O- o, z- S& V3 |4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 n3 ~+ E9 W/ j6 Z& n4C19:00A4 INC CX8 o1 L9 C' [$ e+ }. r
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 a- c$ H2 M* w5 P" K# W; J5 h
4C19:00A8 JB 0095 ; 6 different commands.
7 W' V7 q+ e* _, N% g( T {* d& `3 [ ?4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 _& ? d! |0 {% e
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
2 I6 Z. P5 V2 ]4 Z. l1 q3 N2 D, B+ ]- n* p; o7 z
The program will execute 6 different SIce commands located at ds:dx, which
+ {3 C) ~, c( X7 P Hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' ~8 R' F p7 Y( W7 B8 G9 g6 F7 x* u h1 v p- ~6 x: b
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded." d' P! n% M% ]! }, z7 U `/ A) ^
___________________________________________________________________________3 ?) E9 |1 ]/ G: Y9 s0 B
6 T, W" w3 F5 s+ G' C( W/ L0 r8 f* X! w
Method 03
a: X' k: \* ?9 j$ m=========6 p) Q' W2 g1 ^, G. X0 x
V1 e/ ^3 R. \. A7 ]9 ~7 {- L
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h" H4 B/ L& b! D5 P0 g! k8 ?
(API Get entry point)
7 G/ ~. t {9 v5 @ 2 I8 \4 G# r! m. r( h0 x- X
$ @* {0 E' c* x U& E xor di,di
% ]& d- A! L4 o mov es,di+ X+ C1 O0 W" C! h, I8 z' s
mov ax, 1684h
, i# g, i& z9 J. @ mov bx, 0202h ; VxD ID of winice2 C9 q7 J' `4 x: h
int 2Fh" `+ E/ T) y6 R. C Z6 t( m
mov ax, es ; ES:DI -> VxD API entry point
) |2 P( R5 v2 {0 {" Y add ax, di
' `9 b g- S6 d `7 \# W. |2 P: z test ax,ax
5 N' X) p% N0 m) v* E( w2 k jnz SoftICE_Detected
( @- P" f7 x8 K0 |
! i. e \" U% s& X___________________________________________________________________________
' [1 B# e9 [4 C" J/ F! \
& q9 }! f9 o0 Z w% pMethod 049 ~; _: ^" {; _8 ?. P8 \- z
=========9 o. L* y* a8 }& l# j! z
! V3 S: D4 D$ P& ^6 g S- f
Method identical to the preceding one except that it seeks the ID of SoftICE4 {; N7 _1 b3 e1 m" f
GFX VxD.
5 S; j7 _8 h3 `% w9 i7 M% e! U: m. V
xor di,di
2 ? ?6 u: M/ p2 b& E$ U) H mov es,di7 x& X( H3 h" G! o6 _8 D
mov ax, 1684h
6 h" I) V: Y0 M" h# X+ [# Y mov bx, 7a5Fh ; VxD ID of SIWVID
0 ~) z' \) e* c: i' o$ ]1 G6 i$ y int 2fh
% e3 a' Y; N5 Z [0 s mov ax, es ; ES:DI -> VxD API entry point
& n+ r! n ]; O' A0 A! y. C6 w8 P; p add ax, di& O8 k1 q1 u9 Y. B
test ax,ax
4 o1 v3 J5 q9 V8 ^ jnz SoftICE_Detected& [ \' a; D6 l3 L! j& E
9 ^4 y. x. J! m- y* H0 y' y, g__________________________________________________________________________! w# Q9 Z3 j' Y5 B* F0 R' e; p
; Q; {! \; ?$ M
G, f" }6 ?7 @; {; Z- L& oMethod 052 [. J# p* X x; O' ]% P" g$ ^
=========
' ]3 O, z3 [5 \6 ~8 e, E' ]/ `5 m# G; c
Method seeking the 'magic number' 0F386h returned (in ax) by all system
' @0 B$ Y: l/ d) ^# u5 M8 D1 gdebugger. It calls the int 41h, function 4Fh." G! {3 i2 w" n4 g* A# A# D1 o/ ^9 `
There are several alternatives.
$ b0 u! z; ], V+ q8 x6 O Q. \5 j7 s3 m+ g, p; v1 C2 }# @ ]: N
The following one is the simplest:* f9 I0 G' k+ z
" f! _1 X- `5 A7 G( r Y0 L
mov ax,4fh
" y# i" U6 v+ e' b0 U int 41h
* x% g. ?6 s1 x ^ cmp ax, 0F386& u% F8 e3 |9 q2 k9 D9 q
jz SoftICE_detected# q+ |0 L3 d3 E8 b4 I: _: A* |; A
! {+ a7 R9 h( ~) d% U h9 {9 e _+ @5 d' B2 |7 ?! G8 u! k
Next method as well as the following one are 2 examples from Stone's
- q# t! l! M, Y$ W! B, g1 G"stn-wid.zip" (www.cracking.net):& k. K+ s$ F+ p) V
( A3 z+ I2 i8 A, x. ^; H+ q9 A
mov bx, cs
: ?8 s/ E; h, V7 k! L lea dx, int41handler2
# I2 d) I- y& ]5 ] xchg dx, es:[41h*4]# \6 X! O, W- \2 z3 L
xchg bx, es:[41h*4+2]( |8 {% X5 T$ h; v' C! r5 ^: x
mov ax,4fh# r9 F2 e; W( U
int 41h
% U9 g# u' B9 v$ I, J xchg dx, es:[41h*4]
; J G) P3 i5 Y xchg bx, es:[41h*4+2]$ J! a9 Q( ~3 B5 r5 E
cmp ax, 0f386h
B2 v3 R @6 j2 Q jz SoftICE_detected" A5 k. [' [9 k& K' e
4 f* w3 g. G% H
int41handler2 PROC
! W$ T' T6 {6 z) s iret6 X/ @( }2 v, v. E
int41handler2 ENDP$ m1 ~; W# v' X$ T: A
) V- u4 ~5 Q+ D! A, ^5 T0 W
K1 _* R9 i- T1 __________________________________________________________________________
% `. M% g. i* N
7 b# W) t6 @2 b: s
5 Z/ W- ] p8 ?* o' Z" NMethod 06
* R8 o3 R" ~" _& A% L0 }=========
- B. Z& L2 S: j. d( R. |6 A5 s0 w$ r& |
* C$ u$ ]0 R$ Z6 p# i1 |# D
2nd method similar to the preceding one but more difficult to detect:
! o/ b+ F: T M
: T+ `4 O C0 H6 F
# C1 z4 h4 A' K+ H: u4 [int41handler PROC
; u& R! }4 p. t- A mov cl,al; G3 T9 U3 \" z* y9 r9 _- O
iret
1 R/ @, M+ k) q A0 Eint41handler ENDP' a( o' r/ ^: i
! p; d( s% W0 v4 a/ L4 f) o. {
; Z6 Y/ m t/ `1 p8 B/ w. i7 k
xor ax,ax
; O+ T" c- H1 Y/ F2 v% u5 _ mov es,ax
9 V' c: _" S2 \3 ~+ S+ }4 Z mov bx, cs( P0 I4 M+ `0 H4 k) N+ M& y
lea dx, int41handler
3 E+ B _2 e- |; n$ c1 h* P xchg dx, es:[41h*4]
' b; U& _. ]" F3 q) O* V xchg bx, es:[41h*4+2]$ o( t6 X% B0 F: Z, _8 N9 k
in al, 40h$ n1 I" z8 X, D( N" S+ h2 R: _
xor cx,cx) p& {/ e# ^) @! r9 e4 o P
int 41h& m, Z: }: D" @* _, W
xchg dx, es:[41h*4]* @" z; y. M" M9 |' _
xchg bx, es:[41h*4+2]
7 y/ K# Z- p; ]2 d8 ? cmp cl,al
6 g: L" n, g2 T+ r x+ e. \/ K- ~ jnz SoftICE_detected, F+ E0 N% ?! n1 |0 f
9 Y1 d0 Z# b- x$ X_________________________________________________________________________
3 r3 w+ l K' e: Q2 p! f
* z: Q S( i( t4 f# _Method 07
) I5 x5 S. q4 I: g. P4 m=========, V+ d1 K8 G( u1 K' K0 ?9 W, d) R! `1 t
/ V5 P1 U* N3 Q/ i
Method of detection of the WinICE handler in the int68h (V86)/ a# B" j- G; H& c+ v
) K# c9 [. g6 Y9 l ?" l3 u( A mov ah,43h5 ?5 @- A+ s) ]7 B
int 68h$ f$ z# t' c {
cmp ax,0F386h1 a! h& p# J k$ o$ O& }
jz SoftICE_Detected6 `" |: u) S+ ]0 p
3 J; a+ z& D( f7 Q* h/ h2 p
! ~9 G2 @& s. U4 w% }4 c=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( X& D3 C" D2 N; A, j% m2 K) l/ Y app like this:) v' `( ^, M6 P% w1 i" _4 w c
" \6 o+ w# l' _% P; i4 M( I. `
BPX exec_int if ax==68- h- m, S! z/ l; |
(function called is located at byte ptr [ebp+1Dh] and client eip is
1 r+ c9 y, P( h0 [8 m located at [ebp+48h] for 32Bit apps)$ B7 x* e) G* M( r6 v- N
__________________________________________________________________________
1 X) l7 M6 H9 }/ x: p t7 @$ @9 p6 b
( f; _* i M3 H# qMethod 08
$ J6 R, W3 R( b=========4 S8 V; v% q4 p5 Y n. U
3 K8 f6 t/ z" P8 F7 ]; ^
It is not a method of detection of SoftICE but a possibility to crash the2 y2 a8 i( H1 x8 U, x! d
system by intercepting int 01h and int 03h and redirecting them to another
5 s& i9 z. n# uroutine.
; c1 c* X% i8 b, R+ BIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points |7 U/ k: b6 p% ^ s5 m% d
to the new routine to execute (hangs computer...)
. n/ L# ^) W7 Z, s9 z
4 S- f0 f/ Z/ y1 Y mov ah, 25h
4 ` F% a7 U- i- a mov al, Int_Number (01h or 03h)
2 q: G3 M$ H4 Y8 g mov dx, offset New_Int_Routine
6 y8 I$ }# z" I4 K, I5 ~$ J int 21h
9 B* u6 d, z( T, i/ o7 b6 [5 E4 [; b$ W {4 T
__________________________________________________________________________
( z- Z) h5 u0 _+ g$ m. m" E6 Q) p r) ?" v% v0 y9 n
Method 09
* }* R% P* R; p8 u ^=========
0 U/ F4 q. M, b' o A% k$ n
( ~% J: ?8 e1 d3 g; L4 EThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) A$ K! p- z" Y. B0 W
performed in ring0 (VxD or a ring3 app using the VxdCall).( p8 W: @, T: G0 Z( ?: |
The Get_DDB service is used to determine whether or not a VxD is installed
, j9 ^; ?2 u& t3 @7 U7 `+ wfor the specified device and returns a Device Description Block (in ecx) for) O* H o- @9 D7 R& V3 ^
that device if it is installed.
$ y$ p& q" A* ^7 Q! E
7 W0 s g8 ` `1 H0 I$ | F3 F: _# j4 z mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 l/ ~4 ^/ s) F" z% v
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)* j: S, Q, O9 h0 K8 n+ K. F8 k# ^
VMMCall Get_DDB
4 M' X, b5 Z2 z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; P2 i7 a0 P0 V9 V: C, }- h
* G7 s8 l& h. ^- ]
Note as well that you can easily detect this method with SoftICE:1 ~ |5 Z* h4 D7 E) h
bpx Get_DDB if ax==0202 || ax==7a5fh9 C' j$ s/ b; A5 c# o
- C: ~$ I6 ]( T6 A6 m/ q6 B
__________________________________________________________________________
: F, Y: _, d0 h D
' ~2 W4 m! J! yMethod 10) l# G g" n7 I5 i: J9 \7 _. d
=========# L1 M* `8 |' q
2 Q- W' P& m: H=>Disable or clear breakpoints before using this feature. DO NOT trace with6 P" c5 c" D% A: Z
SoftICE while the option is enable!!
! d! _7 D; `& e% v" O; S( ?
( [2 r n, X* E: b4 BThis trick is very efficient:
0 V) Z: u1 T* _ _by checking the Debug Registers, you can detect if SoftICE is loaded
% J+ D- z' d0 q" J+ a8 j(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 O5 K: [' W5 [+ t2 M+ P* V3 q7 }there are some memory breakpoints set (dr0 to dr3) simply by reading their$ R0 ^: T0 C/ {6 V
value (in ring0 only). Values can be manipulated and or changed as well
" s5 z3 w% X; a$ E2 w7 K% [" ^(clearing BPMs for instance): y/ Y# T0 _, _& F
5 b. {1 e) w4 k4 H) a, o! \) T
__________________________________________________________________________9 i. F/ I" e3 d, ^8 x8 W
, W) ~3 U) S+ g6 @
Method 11
W: g4 s [+ E. F# M=========
: }; L, X: p6 }: m7 y, w
# L) _( u5 P3 c. @7 [; aThis method is most known as 'MeltICE' because it has been freely distributed
, C7 ^ B9 a+ W# Qvia www.winfiles.com. However it was first used by NuMega people to allow) j* C. s' _7 [1 j# m
Symbol Loader to check if SoftICE was active or not (the code is located
/ ?& h+ r" Y1 |. finside nmtrans.dll).
+ A) G8 l; m8 t; j) w6 E2 g% n# h: Y4 W9 r
The way it works is very simple:
* v" x6 w. h$ t0 a& }/ JIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; Y# @( k: `" G- e9 b- Z) p! P/ HWinNT) with the CreateFileA API.+ s" @' @+ _1 G- t
! j! V Z q5 q- R* `7 v
Here is a sample (checking for 'SICE'):
. F% b; [$ o* N8 a; u& l; V7 ]) N/ B
BOOL IsSoftIce95Loaded()
J# b) ]9 k1 `( q/ H9 g{
% w4 j, i0 r. w0 P) x HANDLE hFile; & x" d3 }4 B3 q/ {8 j( ~4 p8 H
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,& c. y: i- _6 @7 A
FILE_SHARE_READ | FILE_SHARE_WRITE,1 L3 R5 Z; n2 y( y A
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ S% I; N2 r, l% u6 O, \# e1 F if( hFile != INVALID_HANDLE_VALUE ), |! F0 z; G @. i2 s ?5 e n1 u
{
' @# V* R% f2 ~. T5 v8 b$ ~) E6 H( B CloseHandle(hFile);
# c8 `$ r B5 ^* K; r& ?2 E; l return TRUE;
! f5 B" Y$ T0 o- z' L# L }4 t( o0 F7 F$ L U3 P, F/ ]
return FALSE;
' ~2 }' F4 n3 p4 E2 S6 L}
: \! Z$ t9 ^8 [6 i) v0 o9 w; ~% p$ p0 t9 y' q
Although this trick calls the CreateFileA function, don't even expect to be3 t5 y2 o- ]/ R- Z
able to intercept it by installing a IFS hook: it will not work, no way!
2 ?/ G$ f8 r2 B% {- f6 U% J" j6 {7 WIn fact, after the call to CreateFileA it will get through VWIN32 0x001F4 R- j* |9 `& L# A, F
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, T }* v E( band then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 ~* l9 C2 p3 d8 h0 W2 S8 O8 i/ efield. ]8 z! ]- z6 r1 V. c2 u/ a
In fact, its purpose is not to load/unload VxDs but only to send a
( l8 v0 Q! n J6 a3 KW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& x5 k- D6 i/ o* ~; D
to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 N6 g/ A- p7 I
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 u' q7 l1 ~- ]' ^% AIf the VxD is loaded, it will always clear eax and the Carry flag to allow4 L7 M2 Z7 V3 N4 q
its handle to be opened and then, will be detected.
2 y( Y4 F7 Z% }) G/ [( t. LYou can check that simply by hooking Winice.exe control proc entry point% L/ s! O4 X2 |6 W, g
while running MeltICE.
, x# S* u G. W$ ^4 e
6 z# S6 G$ E* G' E& O- d$ A; K+ p' `& X! f2 ?0 ^* L; k- ]8 N
00401067: push 00402025 ; \\.\SICE
4 R" i p: Z8 t" @$ H5 C# n8 O 0040106C: call CreateFileA$ O' G V( D! Z, n0 I; \6 \* v
00401071: cmp eax,-001
2 H# \" G+ X+ }. |# |! _ 00401074: je 00401091! k' r# d7 u# `- j: l
) ^" ]( N: G: I: T% x
% ?* t. ~6 w4 v! R3 h! I( HThere could be hundreds of BPX you could use to detect this trick.; Q6 I$ O8 m, D+ @
-The most classical one is:6 g+ y+ R0 H/ [9 C1 e
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
6 q O' f0 a' {( e! ? *(esp->4+4)=='NTIC'9 c$ A. H6 s. J1 b9 x
2 ?2 V# D- K0 F! T-The most exotic ones (could be very slooooow :-(. e; w: b1 l3 t# g
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
0 p& z# `6 M" d ;will break 3 times :-(2 J2 S! \2 V; P; a5 U
9 y( z, F& b0 N F0 f
-or (a bit) faster:
' X( V$ s. w9 u( U3 V BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
# w! c1 R1 i4 w5 x5 J( w+ M2 e8 ?4 ~, W2 v" r8 } F. ^( x3 R0 ~
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 h6 |$ B o$ L' ? ^; d- _
;will break 3 times :-(* ~) H4 G# K. l p8 m% A
; P( X" U# Y6 P6 Z9 _* L$ i3 _
-Much faster:; W5 u6 [6 X9 J o' X
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' A' c* d/ s! n# U# j
- C& i8 P" W) Y' W% s4 Z! tNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
: g4 J5 T N' b3 o3 ^function to do the same job:
5 {+ l5 _/ S# [% N1 g* Y8 u1 K) V" Q- x& q* c% M) d, e$ V- m
push 00 ; OF_READ
# \0 x' p. x2 \, x mov eax,[00656634] ; '\\.\SICE',0) W, V3 n9 l5 q" y$ ]' x
push eax* G9 y$ V* X) w6 R) k
call KERNEL32!_lopen
8 I2 s4 L! N/ Y9 B& } inc eax
% i: f" }, ~9 N* D jnz 00650589 ; detected7 H) B9 i% P+ \
push 00 ; OF_READ; K/ a, k0 x) u8 F$ G- ?. H0 e/ _1 [4 _
mov eax,[00656638] ; '\\.\SICE'
9 E5 S9 H( z$ r" m) @7 h6 Q push eax
) }- _8 h$ |+ ~# t# q call KERNEL32!_lopen: S. ~1 c* e7 ~
inc eax
/ x, h* ^- ]' g& R- i) d jz 006505ae ; not detected$ O8 w+ b m- ~- E
2 Z# S# ^6 e& Q, c4 K* S( o3 i7 {8 k9 H) L
__________________________________________________________________________. B6 u+ V2 N( e1 z3 _6 b8 r
9 d: \3 N8 J0 _$ D9 w* A# _: bMethod 122 {$ h( b+ ?1 l: L9 o
=========
: x1 n0 _( ]$ g Q5 \
. ?9 X! f$ A! l, g0 n4 dThis trick is similar to int41h/4fh Debugger installation check (code 05* q' d( U8 A2 D# i
& 06) but very limited because it's only available for Win95/98 (not NT)8 I" U/ I/ Q; E0 N3 N
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.& [7 H+ j) R( v. C' B, L4 `/ ~4 m4 n
$ S) P7 d, H( D& J0 a" w# F( W push 0000004fh ; function 4fh9 |$ M7 F2 [+ G. D& g
push 002a002ah ; high word specifies which VxD (VWIN32)4 k @0 h @9 e
; low word specifies which service
n$ H% q, j0 I( x* D, z (VWIN32_Int41Dispatch)" ~# `1 Z8 E# O8 Y- w' P
call Kernel32!ORD_001 ; VxdCall
- Z9 |5 j5 A3 `1 ?6 B. u cmp ax, 0f386h ; magic number returned by system debuggers* \* B6 M- T6 c0 j2 E Q
jz SoftICE_detected
O4 _9 p2 I/ A) k) R- @7 [& W8 a; H4 @6 ^
Here again, several ways to detect it:
0 J9 b0 Y* n9 P- J" h- ~+ K
, P( O) o2 K0 |2 u5 {1 G BPINT 41 if ax==4f
* E b+ Q- x6 m! x. [* ^/ p0 B- X# _
M' z0 e' Y2 l: r( J1 j$ x BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
# e6 b2 r+ F6 K. W
+ J6 G1 A3 D- E' B0 l$ w BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
+ B0 b2 G$ t1 c8 }
7 c7 h ^9 n5 b% U8 B BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!6 w4 V3 w! n; B) B
7 c5 p/ b7 b8 f9 n9 e
__________________________________________________________________________
7 r; x7 X2 b. |$ Y. i2 H6 [9 y# D, v0 M# O' C! g
Method 135 x5 x0 k% J$ D3 R4 X l9 z
=========
: ?4 b J# l& w5 k1 s* H L2 a, T; m9 D! r; n8 O
Not a real method of detection, but a good way to know if SoftICE is
8 w8 ]# J5 G% H9 v7 ?0 W* yinstalled on a computer and to locate its installation directory.4 V" l1 K) Z4 |4 c: V+ Q4 }8 N |
It is used by few softs which access the following registry keys (usually #2) :0 m3 t: s% k1 d, X5 m
. S9 H3 v# W; Z+ K6 |
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ O. m* p$ [0 W4 Y
\Uninstall\SoftICE
8 w4 K# O( e9 j% u# `; o; [+ J* \; ]/ x-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* r. E5 N8 a$ t% i; `8 Z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 d0 c- I! M* q* Z+ X8 O\App Paths\Loader32.Exe
$ l8 G' z/ S/ ~; f c- A8 n$ V. G- s- | j
$ _# e( ?2 K& m l1 S z G; ?- Z
Note that some nasty apps could then erase all files from SoftICE directory
. U2 h( n# I3 g4 }$ w(I faced that once :-(& J3 T% a% B) u! ^$ B+ Q
. ]# ?2 K- B1 ^& }7 o9 s' }Useful breakpoint to detect it:
/ b- D+ K% ?; A/ z4 @5 m) Y" c* }4 b; b& B! O
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE', l W/ }( V9 v+ H3 d4 K1 K5 `1 i
! B) ` Q6 _' \4 c, B0 O
__________________________________________________________________________* N% b& H9 L" c( G: e6 O
1 ]% @6 D- |7 c' w" x
* n, [0 `+ L; U9 i$ ?! _5 Z% s- U
Method 14 7 J; \9 D/ T7 @4 {
=========* ~# v) ]7 H- s% }
& Z/ f$ y- ^( p* a& ?/ ?
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; y* l" R% s; {9 n
is to determines whether a debugger is running on your system (ring0 only).* u( \5 R5 o* Q: a I3 W6 F
% O. [" p: e- X8 e5 m
VMMCall Test_Debug_Installed
6 R' L8 z" k4 I' X5 I, F je not_installed/ ^* n/ @3 h- F
7 z! V: g9 g# W- v( e$ XThis service just checks a flag.5 d5 ]0 c9 z% N3 m/ z
</PRE></TD></TR></TBODY></TABLE> |