<TABLE width=500>
3 W% P6 D+ e. Q6 @<TBODY>
( p) ]) a1 I9 e<TR>; d6 V5 n/ M9 q- z, d/ H
<TD><PRE>Method 01 6 w1 A* E. A4 m% J1 i8 T
========= Q, B! C9 Z- S" h8 ]& W, h
8 ^+ W; y6 Y" M6 `: \This method of detection of SoftICE (as well as the following one) is- `6 f* q$ w0 X
used by the majority of packers/encryptors found on Internet.$ H) _8 J K7 W5 f' l% E$ x% H1 b# o( l
It seeks the signature of BoundsChecker in SoftICE
2 I+ O: D. S2 N* C+ u0 r, y e- ^: J! q& P- o6 E/ G- o
mov ebp, 04243484Bh ; 'BCHK'
" y: h* Z& s+ r5 Y mov ax, 04h
! x6 F; @5 q; I+ p int 3 & f* _! g! {4 |2 Z" I5 s" A' L
cmp al,4
7 U) A1 X2 s$ T3 n+ T9 N jnz SoftICE_Detected3 s6 q: j- S* S6 R# J' y8 c
. s8 I' d/ G/ w5 E7 u. P3 }: B
___________________________________________________________________________$ h4 P1 `( b3 A* X$ _3 m" ^+ {
, f9 Y5 L! G; jMethod 02* \3 M) `/ F; S7 w( F7 Z* M! ~4 n; I
=========
7 U; h1 ?# J' ^3 v
8 ^# Q) { R. j, l9 G5 }' A0 BStill a method very much used (perhaps the most frequent one). It is used
/ y1 \) ]6 y! ^4 Nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ \8 Q$ I" q8 N6 Uor execute SoftICE commands...
# j7 N+ C7 g/ i" e4 `It is also used to crash SoftICE and to force it to execute any commands
6 R/ s/ v% X% m1 g* G2 t(HBOOT...) :-(( / m; u: g3 m1 _9 H4 {1 m
* L! {6 E* H+ K# K5 S
Here is a quick description:
2 D3 ^! |( Z! z, l( Z( G0 h-AX = 0910h (Display string in SIce windows)
6 ^$ e- ~$ l& w' v4 R; s Q; J+ i-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 G2 _0 ]& L1 `) N5 Q-AX = 0912h (Get breakpoint infos)* j \9 O# J- y0 \ Z7 E# x. E
-AX = 0913h (Set Sice breakpoints)2 |: A9 X, Q0 F0 _, h
-AX = 0914h (Remove SIce breakoints)) L$ V, N1 s- q* G9 k
/ [; H: a$ f+ x( ^Each time you'll meet this trick, you'll see:
: b4 ?0 o. h/ K% M _-SI = 4647h( k9 R: U& ?/ v0 q+ z+ l. L
-DI = 4A4Dh
7 Y9 R3 [% \ Z8 g: _: k" g# KWhich are the 'magic values' used by SoftIce.
9 P5 z1 n1 ?- ~9 l4 |For more informations, see "Ralf Brown Interrupt list" chapter int 03h. w' q& A1 ^# K) I, W5 R
, W. o1 e- o; F& b
Here is one example from the file "Haspinst.exe" which is the dongle HASP% @: {1 E8 z& n
Envelope utility use to protect DOS applications:
6 F6 w+ e) R+ M0 T1 K. [% J
# C9 P; w) V2 w
- U0 A5 g( S+ W4 L" T3 d+ t4C19:0095 MOV AX,0911 ; execute command.
' u# E* w. ^4 K' |# G4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; p- b: ]3 r1 W4 b, N+ ~
4C19:009A MOV SI,4647 ; 1st magic value.$ Y. l; a" ~* ]% O& }. E
4C19:009D MOV DI,4A4D ; 2nd magic value.! _5 e) l s$ H# v5 u
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)7 [6 T+ o0 }# z% o3 @4 r9 N6 J
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute5 ^3 Y6 X O/ ?+ Y
4C19:00A4 INC CX2 v: d) e. D0 u1 f i+ L
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' E; g8 E. I* B7 I4C19:00A8 JB 0095 ; 6 different commands.
, j: L, ^5 |( }( @: _+ L# I4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 I# Y) [- Z) s
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
7 q4 z2 [, J1 [$ v/ ]/ m4 b2 l8 L; ?* X4 ?8 X
The program will execute 6 different SIce commands located at ds:dx, which; y* Y% H9 v& _( P; Z E7 E
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' S: `, ?: C1 d1 U# w& l7 a1 s; u
! [, ~: E( C7 k- z' O, ?* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ q3 F2 y1 f2 d7 r' p U; F___________________________________________________________________________
7 {1 J7 \0 |) {+ F( p n
1 b% x; z& v" S4 v; N3 T" Z' W2 t7 x( F7 s9 h) W
Method 03
; c$ T( U5 H" X3 a$ A! g=========. d8 Y+ r. s$ _. P
1 s" D, ~0 N3 A1 k
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h" E+ ]# Z* f) P
(API Get entry point)& e: s2 m( i- U9 ?2 t9 {, G
6 X% c' u) Z& U0 w
+ }1 e' X- ?1 X# Q* z+ Y
xor di,di
& r+ l" l a3 }) {6 b4 L+ k, X mov es,di. I7 t$ M; B0 n, }! q
mov ax, 1684h
+ H! C5 X: Z/ D3 e& n mov bx, 0202h ; VxD ID of winice
- Y7 o& o# y& Z1 f1 Q3 e int 2Fh' O' U2 n/ V8 G4 p% S
mov ax, es ; ES:DI -> VxD API entry point# ^% x+ [* g% h( o* E w) J# T
add ax, di
( W- b1 B: w3 E2 d test ax,ax" i G: A% j! m( @7 y* U8 I [
jnz SoftICE_Detected
0 ~4 U0 J- T! f. f8 f7 G
6 K5 ~& X6 o" Q) P___________________________________________________________________________, d4 K: L: m3 r7 ^
* q" ~3 N+ ~4 K/ q+ F0 h8 Y0 ]( BMethod 04* ?5 C, h5 h- _3 W( ~
=========0 E7 {; O. ?5 v' w6 q
" w* S; M' C mMethod identical to the preceding one except that it seeks the ID of SoftICE
6 U z' z# N) t, d, P8 J vGFX VxD.( K1 w7 a* p# T" m/ T$ j5 _
6 }: c" [" {4 t) u4 Q I& m
xor di,di
, m# ?' ?. u) |, E mov es,di
) ]7 b9 G# W: i4 Y mov ax, 1684h 2 ^ b T; k' X% |4 a$ w5 }+ U! Q1 S
mov bx, 7a5Fh ; VxD ID of SIWVID; U3 y4 \: @4 P! ~
int 2fh
' {: b2 Y* V; h2 x' k, J mov ax, es ; ES:DI -> VxD API entry point, Z% W% M5 }, ?3 U4 R. N
add ax, di- ^1 k# I$ Z [3 `/ J
test ax,ax: |, S6 o2 c: `+ D% t) b: Q
jnz SoftICE_Detected
7 ]. @( Y1 j( B/ B/ A& {
- G6 v/ C9 j9 d7 [# j__________________________________________________________________________
% v) |* R! n1 i
! q# ~' ]7 L" u; g# ?3 q9 i) |! T) Y/ H' N- x$ f; t5 d# Z
Method 05: _2 b( A b) i. Z2 J
=========" k7 D: B* a+ Q( F" j
" |) U, F; k& ?% d5 {1 e) j0 m* {- AMethod seeking the 'magic number' 0F386h returned (in ax) by all system
- u8 p0 U3 L' ldebugger. It calls the int 41h, function 4Fh.
y" ~8 {8 B* i. \" n N8 {There are several alternatives.
; J4 ?7 [: r! [1 W
$ a0 p; I) W# B& z5 Q' CThe following one is the simplest:
7 ]' I/ I, f8 ^8 S: z6 E' ~1 ]5 @+ O
mov ax,4fh( A7 A: O3 t ^2 ?) i) x* Y
int 41h
5 Z: g7 z9 n" z" | cmp ax, 0F386! i0 s" ^6 b. `8 j0 S9 V$ S" F
jz SoftICE_detected" Y8 k$ G5 F. `" ]9 I0 {! Y C
# r R. G* B7 a3 R/ [+ J- M4 g$ e/ V% B
Next method as well as the following one are 2 examples from Stone's
0 q* Y* O! I( |"stn-wid.zip" (www.cracking.net):
/ H$ z1 j2 B7 G o8 E" G4 A* q. a% Y- x2 x) X) H: I
mov bx, cs) B5 I) A( ~" ?4 e
lea dx, int41handler2
, j+ T$ {& ~2 j xchg dx, es:[41h*4]
6 c" L8 ?) k2 J3 M& O xchg bx, es:[41h*4+2]. c, i! O6 i% i- H2 u: M
mov ax,4fh; n/ z7 O% M% A, U
int 41h
A$ q- H9 ^- Z* ^3 P# e# D* t xchg dx, es:[41h*4]: R) m. k' R/ I* E
xchg bx, es:[41h*4+2]
% d& |/ A$ G9 } cmp ax, 0f386h( M$ o. s l3 s( h& x/ \
jz SoftICE_detected
. K, k2 N0 [" U2 I
- m5 l; v, ]4 j$ t: f* Gint41handler2 PROC' } i& B ]- Y/ f# }
iret
. y! b& T6 f6 t6 w) V/ _int41handler2 ENDP% r* \9 v+ X( Y$ `5 ~
% e$ t9 a1 a8 \3 g- v6 o' s
/ {" b0 P( H2 M_________________________________________________________________________$ i8 _" r& Z8 t4 {
9 M( a) s: M1 n% P5 y* [# x- B) M, _) B! {) ?& J% @$ t: L
Method 06
[% R4 D; A/ x) o=========7 y! x# l6 K( R& G. r& u# T8 [
- w& ]0 K1 c' h) q. y
" _2 X6 o9 I8 v) v7 w# O
2nd method similar to the preceding one but more difficult to detect:1 J7 v) [: }$ @3 i$ U2 P
$ ]6 w: _1 _' L* b
$ l+ V9 U$ ?; l5 T) fint41handler PROC; O: }: ?5 {% n5 o$ {% K9 Y
mov cl,al
* S ?) ^8 ]7 p# l6 H! D% | iret! J6 A }6 m3 S9 ?6 A8 O) o/ x5 f6 h5 z
int41handler ENDP/ u% ?- l$ V4 R* g* r0 ]. |7 n
* T2 t; V- k" O3 y
! o, \5 O: f* z1 A xor ax,ax9 u- A' g3 C. W- {/ K
mov es,ax
, k d- L' S8 c9 q mov bx, cs
! x3 c- i9 z3 w# K- n3 w lea dx, int41handler: e' q9 L6 ~7 @' X: g4 e; E
xchg dx, es:[41h*4]; W+ [9 _$ W. o
xchg bx, es:[41h*4+2]
5 ^0 T2 J0 j- A! d" F in al, 40h
- R0 ?1 G/ g) T& m* Y/ H" y xor cx,cx
4 u( Z' W- e2 N% c; j1 L int 41h7 g) }: e/ z: u9 Y
xchg dx, es:[41h*4]
3 Z+ e% C! m; a% v9 T! L! ]( u xchg bx, es:[41h*4+2]
" H0 {1 H' K$ b9 a' j5 H cmp cl,al
5 V3 K3 n( T0 F5 S4 n jnz SoftICE_detected. x8 Z$ W& G& \! x! w
% W& e+ E: v( S* A/ g9 c) E& T5 f% X# f+ h_________________________________________________________________________4 e( n- r" h8 Y, X; O) g0 a2 Y) @
4 }& k1 J. o6 ?9 H7 NMethod 07
) L& Y2 t& }7 A9 Q- F) G, o0 o=========
" G9 p% { i8 X, B$ u* Z* t2 |$ j
/ M( `8 q" a& X) ZMethod of detection of the WinICE handler in the int68h (V86)
" t6 _/ n V( ]) r4 {# P8 U% @. v* T ?5 O6 ]0 Y5 O
mov ah,43h
9 q) ^, R( |& e4 p int 68h
( L+ f0 ~5 _- `! c cmp ax,0F386h+ h7 T# k2 @% P: |% I# `
jz SoftICE_Detected6 w+ i: u1 s8 `0 I
: Z8 ?; J/ Y' `& t, J1 H( e' e' e5 I2 }( m& k& F% V0 }7 `- b9 {
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ F* D1 I4 e' C% N7 C" a# a9 `
app like this:6 |! {+ ~- O8 J5 t
: ?- ?: q* L- V# e
BPX exec_int if ax==68
& I$ h9 ]+ {4 F* \4 A- ] (function called is located at byte ptr [ebp+1Dh] and client eip is# F: n0 I9 o% r l& N+ R8 R
located at [ebp+48h] for 32Bit apps)
" l! h, {) q3 C1 \__________________________________________________________________________& M- W% J3 n/ a! [9 w3 a0 a
2 H/ R% o" v" ]% O
Y; x% W' @- R* A0 \7 _Method 08
! P4 n' {0 a [# M' t0 [) k=========% |) [& ?9 \' d% q3 J. z* C6 R. g
( B8 D' J, d: B: h U/ T
It is not a method of detection of SoftICE but a possibility to crash the
8 y9 B0 F( R2 J- @1 ?2 ssystem by intercepting int 01h and int 03h and redirecting them to another
/ r3 H% d$ r' p" v1 mroutine.# \: Q# T6 W m, x8 d4 [' G( G5 [
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
, d4 c9 ^1 j) c( _5 cto the new routine to execute (hangs computer...)
- z- L0 }7 }6 O; I/ F- y( f$ Z, ]" a- e" j6 _6 F
mov ah, 25h
0 c8 m2 @% O% O5 s8 H6 E mov al, Int_Number (01h or 03h)! a6 U- b1 g$ f1 a3 f1 y
mov dx, offset New_Int_Routine
6 ?5 C C0 W! v( Y& z5 e int 21h3 q9 ~4 l& R5 ], q1 O( y
5 z+ o R: }/ T__________________________________________________________________________
5 G& T% w$ ~( M. J& f/ I* k$ b& B- L' A) v
Method 094 u1 Z Q; z; H# @8 |9 z5 Y
=========- m5 R4 J6 J% ]( u
* s o' C+ ` `This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ W2 u+ e% W3 Hperformed in ring0 (VxD or a ring3 app using the VxdCall).5 E m1 [; O) @* `( c
The Get_DDB service is used to determine whether or not a VxD is installed
M9 j. j# s) N- H( Lfor the specified device and returns a Device Description Block (in ecx) for3 P8 D- _4 a J, p
that device if it is installed.1 T) L0 C; z/ Q0 n% V
6 t7 b9 Q: @& k% D. |
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID* Y" h2 J6 M- K8 y
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 Q9 `; c# r% j) M
VMMCall Get_DDB
1 x1 b& n, K; M+ a3 M' V3 m mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 q/ T5 w1 S! n
0 N* N# t# T' J8 m, t8 E6 ~1 q* D! `Note as well that you can easily detect this method with SoftICE:9 l8 [) d2 K- z0 |2 C
bpx Get_DDB if ax==0202 || ax==7a5fh2 Z6 s' Z) c) X# B' ?9 v$ B
1 z! N- ]1 v, \
__________________________________________________________________________% ?1 T6 X; b/ Y# E9 e( o& @
5 ~1 N2 d! E- _ [, K: r
Method 10( T, O* y6 K. W2 w4 d( e
=========3 a6 K" x% K- A" b* P: \: u- G
. ^4 `7 H8 ?+ c6 I" A1 N
=>Disable or clear breakpoints before using this feature. DO NOT trace with/ i0 o) H$ [ w9 Q
SoftICE while the option is enable!!
" s2 Y% ]6 i2 q% V' I9 T0 a# u* p9 g7 w; B' l9 q+ `1 g
This trick is very efficient:
; i b- Z$ }, `# |5 C4 O! Xby checking the Debug Registers, you can detect if SoftICE is loaded
$ m3 b3 w! z+ P& x2 Y/ n1 a2 B0 u(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* D* K1 z3 L) J5 B, ythere are some memory breakpoints set (dr0 to dr3) simply by reading their
# Y5 G( j3 ?$ nvalue (in ring0 only). Values can be manipulated and or changed as well
% Z" f: d b" m" Y6 W: o. O* E(clearing BPMs for instance)+ J6 k9 T, B# E$ w- \6 t2 o4 @2 A
" Q/ `, B# _% W/ S__________________________________________________________________________
, R8 O' V. F. m/ Q5 y1 I z: D8 V
9 w8 J0 J9 g/ U. U, N( OMethod 11& M c; }$ k9 A6 O! p
=========
9 q9 q- C! N1 e2 r O% [' ]2 X" R2 Z6 _* Y" W
This method is most known as 'MeltICE' because it has been freely distributed: G& n" m9 h" K6 B5 B
via www.winfiles.com. However it was first used by NuMega people to allow5 |8 \; v3 L0 y5 j4 W G D
Symbol Loader to check if SoftICE was active or not (the code is located4 n2 F" I# @4 I3 O
inside nmtrans.dll).4 w" s/ Z7 s% z4 X
; `& B0 D j! [The way it works is very simple:
" S y; v$ Q) q1 r' ?8 [8 A( OIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& s% y( o, \9 Q- Y
WinNT) with the CreateFileA API.2 C. ~9 X/ s+ i$ s! G2 Q( |/ U: p" D1 Q
( T* ^$ F/ r; J# W8 \% { Q
Here is a sample (checking for 'SICE'):) { |# e# a2 M( y) f
3 Q- ^ q0 E. T( Z( `6 sBOOL IsSoftIce95Loaded()7 V9 ^0 _ X- B! P+ ]- Q6 i& H
{9 @, Y4 o* j; T
HANDLE hFile; " j4 }, ~/ G5 z# d2 p3 O6 @" ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. H" K- Z K- Q, n; a$ I FILE_SHARE_READ | FILE_SHARE_WRITE,8 z% q" B6 D; I. Z, ^
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* i- F# K: y8 ?$ U, u( H$ c, k' l
if( hFile != INVALID_HANDLE_VALUE )
4 W5 F5 U' F: ~2 B1 U {3 s {. K" }! N/ @
CloseHandle(hFile);
' x* b/ [3 b3 j. v" H return TRUE;
% \2 ]0 W ~* j1 k }/ \) B$ T& m! K2 E
return FALSE;% d9 c! p: O9 f# @/ L! X: a
}4 I9 w& Y/ h- O( v9 T
: F1 A% ^7 S! {: \Although this trick calls the CreateFileA function, don't even expect to be
# g5 U i% t# J$ z% p7 b/ pable to intercept it by installing a IFS hook: it will not work, no way!3 ^" H! P4 ]2 l; v* X. C/ N
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 p0 B1 ?9 A0 q" X* M* p. C, iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ O. \# Y6 q3 \$ H+ h+ D
and then browse the DDB list until it find the VxD and its DDB_Control_Proc( i( M# v9 V6 u" l; Q6 n3 n
field.
) E/ j* @0 W7 c( L/ b% Q; gIn fact, its purpose is not to load/unload VxDs but only to send a
* R; { c x; P: z$ x/ o$ DW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! q# z0 F. B: k: r
to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ X% I9 H. e4 Y: a1 x0 g: N' X
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ v2 ~" {6 |) f; ~. F6 K0 kIf the VxD is loaded, it will always clear eax and the Carry flag to allow
: ^) u* z" w1 Bits handle to be opened and then, will be detected.' O R/ z( |6 ?8 @
You can check that simply by hooking Winice.exe control proc entry point0 ?5 f/ w& ~# ? y! Y
while running MeltICE.
$ g* A0 M- G; p# Z% J5 X' \# ^+ g/ D4 }% `9 [
3 w$ ]1 ~9 e( P/ e F, o3 q 00401067: push 00402025 ; \\.\SICE* f7 @( T% c* F' g+ @$ n+ F# y
0040106C: call CreateFileA
0 I3 K6 } x8 {8 U9 q 00401071: cmp eax,-001& R5 p0 s# A; }( X v6 g% `# k
00401074: je 00401091, W- | ~: e$ U; G* ^$ E- f
U# Y7 R& u8 o3 c
; R3 k U+ Q/ {1 FThere could be hundreds of BPX you could use to detect this trick.: d; p% G, z9 Y4 `, j# T- }0 F+ n! n6 w
-The most classical one is:1 E7 P: T* h8 L) w, q% v
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* t. x8 Z+ V8 r. |6 X+ t( }. G/ w! X *(esp->4+4)=='NTIC'' ]2 n6 ^. J! O8 h% a
& d- x& W( I" E$ d, c5 j! ~-The most exotic ones (could be very slooooow :-(6 j# b+ f" X5 K4 t( j/ X+ K
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 U3 L" [1 ?+ U7 V) I
;will break 3 times :-(
~8 @% q, f& q8 ?: I+ Q7 O* J# r4 k. |& }; z4 M
-or (a bit) faster: 7 Y, ?5 o% h9 J/ p) Q/ P
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" [) z2 o# ?/ ?+ j
% Z7 \" l Z; ^) B
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
5 n. v, H; w1 b+ Y, n ;will break 3 times :-(- c) T5 g) ?8 ^( O
5 u/ F+ [& ~4 p. }- L
-Much faster:, i# U: I) {" j X/ q3 B
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
& Y5 X, B* N( \3 l2 M n
p7 }/ r1 v: y0 ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen8 y! J- m3 y7 A1 v. V
function to do the same job:+ e7 P% K4 e. k5 z9 F6 w. C/ j
9 U E8 T4 v+ o# n2 J0 h* {9 w push 00 ; OF_READ! e; t$ A) Q% ~0 Z
mov eax,[00656634] ; '\\.\SICE',0
, X/ e( h# L( y- Y push eax
* a9 x( G8 m8 w/ M- k, X! \ call KERNEL32!_lopen
5 @' h) `) i. L9 k1 A, o0 _) h inc eax
* u3 q) `3 m6 C/ N7 l F. o jnz 00650589 ; detected- A+ p0 Z1 i% G
push 00 ; OF_READ' w: H6 w; \% S8 f c4 Y
mov eax,[00656638] ; '\\.\SICE'4 Q& [ `: x0 L+ `5 S
push eax) _5 J# ^3 p& N
call KERNEL32!_lopen- ]+ M8 E; @8 G- E. {1 _8 A
inc eax
' R7 ]0 D9 s- ` jz 006505ae ; not detected
0 ?3 ~4 }6 S; T, d) }/ R3 @1 t& q2 L& B& \! I& E3 y
2 H& h' R) w( y0 X6 F# K__________________________________________________________________________/ j4 D$ |- v2 [; i' h- m: s
9 r3 [0 c( w! K* J+ r% Q1 h' uMethod 126 _, G2 J( I' o' r j0 p" i6 t
=========
6 w4 S _4 ]- M" N0 Y8 c) z( y8 O/ S" _+ Q
This trick is similar to int41h/4fh Debugger installation check (code 05
: h6 ^3 b5 b$ A( T4 `2 E1 z& 06) but very limited because it's only available for Win95/98 (not NT)+ V' P8 r1 i! a8 z2 l
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.& Q) H5 r3 m. D# I# B8 X3 a
5 n3 k' w2 Z& o+ ~" ?3 r' ? push 0000004fh ; function 4fh
# p+ N, ?% l1 y3 r% |& V U push 002a002ah ; high word specifies which VxD (VWIN32)& z' I( D5 p1 ]/ I9 l. ~
; low word specifies which service9 ~; J; o4 `3 O: ?- \4 P
(VWIN32_Int41Dispatch)/ _" d( k: I7 f& |
call Kernel32!ORD_001 ; VxdCall
) \# w0 _" ~$ h$ R! O) P cmp ax, 0f386h ; magic number returned by system debuggers* D" K' `" [0 W
jz SoftICE_detected9 `$ n$ i) c/ y1 `0 x" Y
* P7 j2 ?+ }+ ]3 O3 R+ Q, e
Here again, several ways to detect it:' e2 h e( } C; c
7 j, q& N9 N6 K0 F. w* M
BPINT 41 if ax==4f5 u& _, S, M, p' \! j+ y
% P9 m5 E: s- x0 y8 q
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 L& J6 K5 ^* ^6 \2 }8 A; e& `
2 Y! a4 q. e! `8 ]" k: E3 q BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' ^1 m7 Y) M5 O6 M
8 S* o2 V0 _! i' B: |0 L$ i. {% J' Y+ | BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- G1 `( Z: L% X4 X& w1 ]$ u- X6 q1 Z8 z& K, E7 b
__________________________________________________________________________; I5 m/ ^3 O& L, \3 G
X" d& S) K7 u$ H! s, f: G
Method 133 k4 B% B, v# s. Z% f4 i- |
=========
, u: `0 y0 j2 c; N" Q' D( Y M7 W
1 g0 ]! V: Q9 S8 a qNot a real method of detection, but a good way to know if SoftICE is
+ h, f& ~- G1 H6 Xinstalled on a computer and to locate its installation directory.! E3 D1 B; b7 d) j, \& R
It is used by few softs which access the following registry keys (usually #2) :
8 v- S5 e Z, _& L! l' D+ ?# C2 y3 D! i2 W
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
@8 t' V2 x: Y* T4 G4 P\Uninstall\SoftICE* [# Q, {+ X* \" X
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 m! B: d! d T9 J
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 C3 K$ m6 j; T5 h. t" Q$ Z
\App Paths\Loader32.Exe% {+ j9 D( d( q0 }
9 v8 f# _/ ?6 ?% n( K9 i
$ d$ f" S) p+ G# T/ n7 qNote that some nasty apps could then erase all files from SoftICE directory4 N5 F1 l* |& p: C6 L7 `' b
(I faced that once :-(, Q7 M8 t- }" T1 X1 }
2 r) |! @! ?" S" k: K' Z. Z' xUseful breakpoint to detect it:
% j) J2 T3 c; @0 ?: F4 x$ I0 h1 l% ]! f: J: d
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
: Y( a* E, Y7 l" i; \+ ^- o3 @7 a `3 T5 f( { G/ Q
__________________________________________________________________________
2 t6 I( h! m( ~. c! r% [$ t; C \" q
, R2 V! } [/ l; W0 b# t6 c5 m) i3 {
Method 14 / I5 @8 `4 r4 ] m! c
=========, Q, o3 k8 q) v
# o& ~( K& g2 z0 x8 G* y+ ^) LA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% f+ ?' s W9 Zis to determines whether a debugger is running on your system (ring0 only).
( Z6 ?3 F2 P2 ]/ y( T2 ~: e. J
9 ?4 j; M9 I0 p8 L0 I: ^0 K9 m VMMCall Test_Debug_Installed/ L% h0 u7 `2 Q% R
je not_installed
% g1 L6 s' L6 u' z( R* L9 y6 M% `4 I D
This service just checks a flag.
" c/ o# R" k I7 m. \; O4 K" ?' }</PRE></TD></TR></TBODY></TABLE> |