<TABLE width=500>6 A. |8 ^8 V, F
<TBODY>
; N+ w1 S+ l) u/ |% F) F* u+ n6 |<TR>- t* e- [/ e- m6 w
<TD><PRE>Method 01 + h) C8 K7 E8 \
=========5 D x, ^9 z9 ?+ I2 D
5 P1 J$ f: f3 j: \# s3 U+ ~This method of detection of SoftICE (as well as the following one) is3 i8 X3 U; B* e \5 W# {& x$ ^6 i1 j
used by the majority of packers/encryptors found on Internet.
! W9 G+ G: @, h" Q8 M, cIt seeks the signature of BoundsChecker in SoftICE# P2 }$ i# d/ u& d1 K, N4 o+ A4 }) n
; q; ?. V! l& C6 j$ G# K; P4 L mov ebp, 04243484Bh ; 'BCHK'
: l. A" S$ B0 w& |% \% c mov ax, 04h
; ?4 X8 C/ h2 A& L- @" S int 3 3 m' f7 C( \( ?* O( c2 g+ y* ?3 r
cmp al,46 L# o, ?% C) _; i: _6 @8 x
jnz SoftICE_Detected
6 J% c- Z. C, @& t; X6 S! l, a0 q' Z8 N+ x$ ^
___________________________________________________________________________
$ f' p; I" a* d! d- M( h
6 a9 f* g' ~/ Q7 s* }& y- }5 TMethod 02* s/ W% M6 x. K5 z% V, n9 `. v4 D5 N9 r
=========& r. `( t* ~8 a
6 _7 U6 T+ v* D0 g* r' H
Still a method very much used (perhaps the most frequent one). It is used
0 t- u) j# \$ k x# A: d3 l" z; Mto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
( W |' M0 d, y* \, [6 sor execute SoftICE commands...
% L- j$ A. L# uIt is also used to crash SoftICE and to force it to execute any commands
3 {5 Q) Z( }- O; ^9 u. b(HBOOT...) :-((
0 `0 m5 o! l9 E6 g h7 Q
: Z$ V% Q8 j- d0 M0 {. aHere is a quick description:
. `5 m! T2 G% v8 k4 F% I-AX = 0910h (Display string in SIce windows)- d' r# {$ k1 P0 S1 V
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)% I+ V" g1 j: [& X. o
-AX = 0912h (Get breakpoint infos)
1 L% J) ~" [( K6 K- w$ Q7 ^-AX = 0913h (Set Sice breakpoints)' ~2 Y. |" x, S
-AX = 0914h (Remove SIce breakoints)
6 e" g+ o, H' I9 N7 J( l3 {! Z! l" F8 z8 ]5 ^
Each time you'll meet this trick, you'll see:
1 Z" o3 Y8 `" Z, a j' H$ n6 y-SI = 4647h# ^' t6 |2 H* E- S" G. z7 ]1 G3 E j
-DI = 4A4Dh- `- U/ G# j) Y; E* T
Which are the 'magic values' used by SoftIce.
& o5 l$ K$ A6 i- E E5 q2 m/ LFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.. W7 |/ j' a1 B7 f2 N. V
1 U4 F- C, l, P% u/ s$ LHere is one example from the file "Haspinst.exe" which is the dongle HASP
. f, e- o; }, j l+ \3 @8 |Envelope utility use to protect DOS applications:1 _+ L$ D0 Q8 a- ^0 P, G1 s
. f; X2 p9 W; j z5 w
5 a2 }( l6 G+ r6 w
4C19:0095 MOV AX,0911 ; execute command.5 ?5 g/ [6 [7 s" l/ }: j$ H
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
# j) R$ O: a8 X( Z! J; h9 i4C19:009A MOV SI,4647 ; 1st magic value.& I; r& p- M, T/ I6 I7 Y
4C19:009D MOV DI,4A4D ; 2nd magic value.
7 d4 G; P) ~/ F) G5 U) {. @$ N4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
7 A" O3 o0 O, R# [6 U7 e4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute2 w2 Q# X- I. O- d
4C19:00A4 INC CX
# S" x9 Y: |+ r( \/ K4 _4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
! \1 a5 y: K1 Y/ B4C19:00A8 JB 0095 ; 6 different commands./ H) d0 y- |8 g
4C19:00AA JMP 0002 ; Bad_Guy jmp back.9 W% Y# [. u) w: w; P
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 |$ ~0 l4 n# S, g9 |
) D! ?7 C4 b4 U1 b; T: mThe program will execute 6 different SIce commands located at ds:dx, which
9 L w9 I, g! P6 M0 h/ X* Ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT." x( p) o( W% e4 s/ J
( A; R: [9 K' v9 `8 k, ~ V* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 |* g+ u* q4 `! _
___________________________________________________________________________% _% L0 q! k7 K* d, {
+ f, D! G! Z- D' B( \
+ c9 b' E2 ~- Y' V, P. R# t6 W6 v) x: O
Method 03
" s' l+ Q! ? T W4 [=========+ S u: _' p# V# @4 o4 j, G+ n9 m
- W- x& O' ^7 P$ e4 \- G0 l' hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h: X2 M- @, ^6 {5 s6 V0 _, B; j
(API Get entry point)
- h5 W: w5 i, [8 U 5 ^' d! i3 V }1 ^, o
; ?7 \! @. }8 U; C xor di,di
p: I( e' H: P* I8 _; ^, ^ mov es,di! V |0 M! H" D7 q: \% O
mov ax, 1684h , ^% I; ~0 |, {" @0 I/ s4 ?
mov bx, 0202h ; VxD ID of winice& ]- e2 `2 Z# A+ t: T
int 2Fh, Z0 _9 e$ a3 v4 o. T' Q
mov ax, es ; ES:DI -> VxD API entry point
! {9 c. \( R* p' w. Y add ax, di( x7 q/ q _4 ~4 x5 J
test ax,ax
/ A# O2 u& V% G* a* \, _$ V+ E2 A jnz SoftICE_Detected, X/ _% |; a2 a
: q6 G( ^3 G: i: T0 S! [$ x0 @
___________________________________________________________________________
7 g) K8 H. Y& z7 z. @, C
, B/ M k' r4 H2 D6 U% M7 ^% [Method 04
; b$ y: W& L _' D/ g$ t; e' Q) ^=========
2 g9 F/ i) s9 e6 \: }2 T# F! e# L; A) S* R& D
Method identical to the preceding one except that it seeks the ID of SoftICE
$ q& G! E$ i9 B; wGFX VxD.
0 }9 \4 h8 _* L
1 ]9 j4 V9 s: w- C2 R' w xor di,di" I9 y4 m7 j; _: p$ \: l0 C
mov es,di
. m, p0 t8 |3 c- V( p mov ax, 1684h ( }& U1 B4 t/ O, v
mov bx, 7a5Fh ; VxD ID of SIWVID
6 z0 A8 v5 R: P int 2fh
6 C& T( S$ }4 O9 g4 R mov ax, es ; ES:DI -> VxD API entry point
2 m4 R8 G( j( F( y add ax, di8 y9 v6 U6 N: i2 o3 Y
test ax,ax
) Z2 B( L8 z. G' Q- L! |. | jnz SoftICE_Detected
v3 e C) s8 r. C: v5 C/ h7 U' E, N1 ~: E6 b+ [0 J
__________________________________________________________________________
: g7 k- C6 Z5 @! r( Y4 j$ }! I" }$ B) L
- k) n0 u: d0 z9 _0 G* J
Method 05
5 P5 [$ p+ }- h* |& }0 h, d" c=========
E* y) p4 v5 Z7 S# F- _/ ]7 j+ `& D$ }2 T. G
Method seeking the 'magic number' 0F386h returned (in ax) by all system) W+ g# h% Q+ T. J
debugger. It calls the int 41h, function 4Fh.5 E- i. V" _( j- }) s; Q# S
There are several alternatives. |6 X* w2 q- |/ `! c+ o
) `) m4 q$ P" f8 c* }
The following one is the simplest:2 ^* b/ u, M; y3 A
" Z! _4 m, E9 u3 |- \) ]2 l, D; ~
mov ax,4fh
, J$ B& ?+ C. V( m1 p4 F" b int 41h v! H1 R7 X" S$ m) N
cmp ax, 0F386! G% {# T E7 \( {
jz SoftICE_detected7 u+ x0 m* U) ^) B8 ~: k& D5 T
; J7 I1 Y8 A; g* } @1 Q8 [* z2 I! r- {
Next method as well as the following one are 2 examples from Stone's 1 D* ?! [( i/ i# j1 E* A8 d7 Z9 C5 c
"stn-wid.zip" (www.cracking.net):6 c8 M1 j( h8 A1 w1 R: _
) S) g/ S9 E- @% V! O3 q+ {6 r
mov bx, cs
3 {1 D% e Z' ^( @; P' y& t8 o& r lea dx, int41handler2- q$ k, F9 j7 B5 ^3 s
xchg dx, es:[41h*4]
1 ?+ B. Z+ a& C. {8 m+ S xchg bx, es:[41h*4+2]2 O; ?4 x9 d4 G- {
mov ax,4fh. Q5 ]; m: R' E% I
int 41h
6 z' t& P+ \: W- x, v+ X3 ~ xchg dx, es:[41h*4] t9 K* b7 N* ?6 o0 U$ c
xchg bx, es:[41h*4+2]2 ?0 v0 h3 ~! Q3 z' C F J- s
cmp ax, 0f386h
2 [" s8 K8 l7 q; x0 a# T jz SoftICE_detected7 J1 E' |$ \: X1 t( X
. c! s" c! D: E. j# y" a+ nint41handler2 PROC% S/ g( O( a6 {" X* v% _4 U
iret
m5 {+ |% {+ k" o& V: d, X, Eint41handler2 ENDP
% x3 v& \* g: C l3 b# O" b
! h3 [4 w8 Q+ c! e- j& V0 e8 x3 h. c w
_________________________________________________________________________
$ M. W! L T+ ^2 ~- }2 W0 i+ f& e$ y
k) b" `2 t& S5 k; a& D7 ]Method 06
$ g& L- T) b/ E; q4 a! _* o$ S+ y$ l* r=========
; G3 w) \, l0 V5 e
3 q& ?, a/ ^. f$ U: n
{! P# q- F( \) H' ~2nd method similar to the preceding one but more difficult to detect:, l, B: x& X! M6 } B/ J. A# B+ `
" |- q* ~# M% S2 P" X
1 A2 }6 S5 o4 q; L' r% X0 B* [4 e
int41handler PROC+ }$ \; P9 b# r: q. T* h
mov cl,al
3 D, o. i+ f# {, |* M4 l iret
; L2 z$ I3 \6 G# W O7 h% @: Aint41handler ENDP
% h: @) I2 J; o9 |" {! D2 r/ z0 Y& E2 P# x @3 w
$ I! b& k# ~1 k% E6 g/ P2 m( u8 T) h xor ax,ax
* _. U, i4 Y. _& \& ~ mov es,ax7 p9 {1 q+ s% R( s8 H
mov bx, cs. [, R. c( X3 x$ ]
lea dx, int41handler
8 C! p( _. }1 f% l" W& T4 @ xchg dx, es:[41h*4] ^5 \ ?: k% T; Z8 R9 G" ?
xchg bx, es:[41h*4+2]6 Z& v7 Y& y' g7 \
in al, 40h
+ m/ h: O3 V2 i) C xor cx,cx: q1 R( w! ~. g( W+ r
int 41h- [+ v) ?6 |- r, A
xchg dx, es:[41h*4]* G4 A5 Z0 {/ Z# C
xchg bx, es:[41h*4+2]
) M7 M/ a- m4 l& n3 R( c cmp cl,al2 K# |1 p2 V: H# U" `2 z6 y
jnz SoftICE_detected! j I4 o, Y# F! w4 _: {
$ l4 P& o/ h7 K/ K. D' n_________________________________________________________________________: R f* l% i" V: O
% u2 n/ |9 ?0 r6 T+ nMethod 07+ {' ], t o3 N; t1 E M; {
=========6 W; e8 d2 w) Q4 d$ ~
+ Q5 N: x( o" w3 m% Z7 {Method of detection of the WinICE handler in the int68h (V86)( }* U# T) M+ f! a
- T9 q8 h p! _; q, `- b( A: E mov ah,43h
) c& i+ w2 j3 A int 68h
! i4 a- O- X/ X cmp ax,0F386h8 I4 J' }' G$ `6 v' ?! m
jz SoftICE_Detected( ]# ? p& R' k
5 j- X% a& h B/ I' @7 N$ D
" b- w0 O2 Y2 s=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" V% R& }+ @- Y4 |! a8 e app like this:2 s4 n$ d' R/ X5 \8 v: X0 s
6 |7 B }/ [2 [1 F) t2 g, D$ a
BPX exec_int if ax==68
; Y, Z' J1 ~' \. \( q F+ D: A (function called is located at byte ptr [ebp+1Dh] and client eip is
1 F/ f0 t1 B( |1 W" Q( c1 U located at [ebp+48h] for 32Bit apps)
1 o" g5 k6 ~8 c4 S$ L__________________________________________________________________________, b4 L! u* T$ K1 u& C- H9 T2 z: ~
( C1 I9 h1 L& f! \4 E' D4 A/ j8 S+ l
& N e K- n( ?. x( Q K( ZMethod 089 O/ T9 E- ^2 c( c9 x
=========
6 D/ k+ v1 q2 c& B* |+ e1 U7 \" @: P- ]) h7 c+ ~
It is not a method of detection of SoftICE but a possibility to crash the5 |/ [1 p9 r e$ m+ I& p
system by intercepting int 01h and int 03h and redirecting them to another
" ]" H2 t) n; y& K nroutine.
# W$ F* J9 @. UIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) }2 K, r9 w+ y. u$ V
to the new routine to execute (hangs computer...)
9 U, G7 I3 j, z" f
; ]1 z1 ~" i) c$ e- J mov ah, 25h
! V' Z$ F1 o* u; u3 M4 ` mov al, Int_Number (01h or 03h)) W( ?1 X& A: D
mov dx, offset New_Int_Routine; q: L% B* g- _' h
int 21h; n& {- t5 m4 `8 [, |* }# e, u4 _
, ?9 d, R$ I, s% y& {+ L n# T' _5 M__________________________________________________________________________% w1 T6 K4 M) w
0 L+ r: M$ @: T* \) f7 @+ J/ BMethod 09) t) y- }/ Y" @+ I9 u6 x
=========
# A/ i& D; j! a- `5 }1 u9 B
! z/ H' G0 i2 ], v0 `2 |2 RThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* e# q% H# a6 G- ?7 U" C$ iperformed in ring0 (VxD or a ring3 app using the VxdCall).
" o$ P% ]& q/ vThe Get_DDB service is used to determine whether or not a VxD is installed& G4 U& S- J# Y/ u1 @
for the specified device and returns a Device Description Block (in ecx) for$ ^) |0 B0 K6 l$ K- E
that device if it is installed.3 x& A; C2 U1 Z; ]) A. j
- m& n: f! x) O# p1 w3 O9 v4 U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
5 B) _( `% d" G mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( P I) G$ K" _* i' d
VMMCall Get_DDB; u" N, a* I* n. o, F
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed. P) r0 J$ i$ x# N" n" F7 T
6 @& R9 O1 H0 Y* ~Note as well that you can easily detect this method with SoftICE:
: Y' D1 l& V: G4 r7 ]4 \* J bpx Get_DDB if ax==0202 || ax==7a5fh9 n0 S4 P! j; L; \# Y5 Q
- b6 ]7 M( }# T& V__________________________________________________________________________
( Z8 T0 k& l# o9 y$ {: V
/ I/ t# J) ^: ^Method 10
' B- ] _/ k; o# |% j9 c, i- i=========9 A9 d7 Y! a+ q; _9 O
t8 S( c% {& q# K
=>Disable or clear breakpoints before using this feature. DO NOT trace with
$ K2 I% e1 J! ~; j SoftICE while the option is enable!!- Z/ L' r4 P! p( j" w; s( ?
; _: a/ Z3 f) {& C+ q; V
This trick is very efficient:
3 c. R5 P; r0 ^: _' aby checking the Debug Registers, you can detect if SoftICE is loaded% A9 \: b7 W, e" U ~, h
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 M7 K* p, O! q3 K% N$ b" @
there are some memory breakpoints set (dr0 to dr3) simply by reading their
- T0 s6 R# v% s; b h( z* bvalue (in ring0 only). Values can be manipulated and or changed as well8 ?. f3 F2 E5 \# k0 r/ {7 U
(clearing BPMs for instance)+ _' A) ^" V$ u! n1 H3 r7 @
+ \: M- s; W3 Y- X
__________________________________________________________________________, m6 f- _, M( q" v; X4 A
; F' Z6 Y/ i% m8 H/ p, k8 f$ q0 ^; zMethod 115 X* |! p) }0 ^) |: C
=========
8 e- e- m- T( K. U! a+ N* S, E4 m1 W! y6 R2 j4 k; B
This method is most known as 'MeltICE' because it has been freely distributed4 l, p/ b& [/ I0 Q! O
via www.winfiles.com. However it was first used by NuMega people to allow
+ X; C( _2 X9 \7 @Symbol Loader to check if SoftICE was active or not (the code is located" A& C6 Z8 U; _5 ` Z
inside nmtrans.dll). E- o$ v. i& Z
& V% L9 c6 e2 D2 E0 }
The way it works is very simple:
( G9 M/ D# [( q8 [, I% _It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for+ @ O3 h0 V4 F& O/ }& U t
WinNT) with the CreateFileA API.
% v9 m) J6 }. b! F. j4 c5 d
- d2 H& |. H+ `8 O c/ SHere is a sample (checking for 'SICE'):8 p" Y& F" ?* i
& v* F) }$ l4 nBOOL IsSoftIce95Loaded()
4 C# D8 A6 d. W4 G{
" J% A6 r8 m! S: R' {5 q HANDLE hFile;
7 K$ a6 Z. s: _* t hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* Z( w+ a- Y" A! x FILE_SHARE_READ | FILE_SHARE_WRITE,4 e, U' [: ` b) [9 G- I
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, T7 X! n! q! h: D: J3 f5 V
if( hFile != INVALID_HANDLE_VALUE )+ n0 I, a$ h: s1 }: V
{$ @0 V5 c M5 o: H+ o; A9 p
CloseHandle(hFile);7 q% Y6 h# L% N" M8 k8 Q' v
return TRUE;
1 u: @! J, m, a" G a& I3 v }
2 g. u K4 q" A5 v1 n2 V; N# E return FALSE;
( J7 q" L% r4 X}
. i. T# i( M# g6 [2 a
4 E: O. A; l- x* V' I! ~: bAlthough this trick calls the CreateFileA function, don't even expect to be
7 \) E3 K6 _0 e0 [: c( t5 Sable to intercept it by installing a IFS hook: it will not work, no way!
. h. T* m* h, _! h: ^0 J3 [In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 I, W, P* x5 [+ d5 Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)* S+ q0 }% O& Z% ~7 C
and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 E5 z7 y/ Q; Q' E: w
field.
" ]5 z# {; d' C' {! m0 [+ nIn fact, its purpose is not to load/unload VxDs but only to send a 2 T5 p* Z$ a0 J
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
6 ]8 l9 I* X& ^5 }# s; V9 T8 |to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# o' h- P' t4 a$ A1 h$ J2 yto load/unload a non-dynamically loadable driver such as SoftICE ;-).
# u( ~! t) n6 U& f8 {+ h- _If the VxD is loaded, it will always clear eax and the Carry flag to allow: |3 ^6 @* K6 p0 U, @3 l" R
its handle to be opened and then, will be detected.
4 T. r9 D8 Y; r, ]You can check that simply by hooking Winice.exe control proc entry point9 o5 G/ q. }: [$ g9 z1 N) B, m: C( D/ m* Y
while running MeltICE.0 O8 ]5 j, [: k# X) [5 R) H
+ F: F! S" q- `+ g
" J6 x. @% J6 U- l+ u+ z6 j* u m$ Q 00401067: push 00402025 ; \\.\SICE
5 ]* n6 b2 T" m7 S9 f 0040106C: call CreateFileA
0 _2 K- w4 f7 G1 _& N 00401071: cmp eax,-001
T' S5 u \/ s+ e$ Q 00401074: je 00401091
$ S3 \' o+ Q# B4 q
5 d4 m6 `+ d0 U; j" w
8 j4 t p) B% } b5 M( l3 UThere could be hundreds of BPX you could use to detect this trick.$ o) T; K3 F+ m5 C7 p( K* Y
-The most classical one is:9 e7 M0 L _+ ^4 P% k2 |
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 L# o/ M3 }. O0 j3 G, I7 G- X3 v
*(esp->4+4)=='NTIC'
+ W4 v- t: }8 Z) W/ w; z7 ?9 I9 E& e; G
-The most exotic ones (could be very slooooow :-(
8 X0 T3 o. Q' G) N0 B! Y BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . S+ [( m2 O! L. t: G- W$ P$ s* ~
;will break 3 times :-(8 L6 }$ y& H9 O* Q( V [
* D% A, X+ K2 L1 B0 h: N
-or (a bit) faster:
* t6 X; c6 l1 `" Z0 J BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ i% G0 {" j6 e; V9 F1 R
K4 n5 }" X8 q BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' / [8 V6 E0 w; b7 Z* p: X
;will break 3 times :-() k8 a* E3 _6 J% h
9 j% [+ P' \7 z& ], S
-Much faster:" m6 f0 k& D. b/ R& o
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 W( i& M* d: s {
/ Z7 y$ k, x! ^Note also that some programs (like AZPR3.00) use de old 16-bit _lopen' P. f# @+ h2 y
function to do the same job:" G" W8 ^: [$ a$ s5 `
: q; C5 |) x+ y! i. T5 }* g push 00 ; OF_READ
7 L& z y6 i& j- i* @: T$ a mov eax,[00656634] ; '\\.\SICE',0
. n4 D# `) v3 E+ M0 [ push eax
. ]+ A, N: ]4 H call KERNEL32!_lopen) v- d+ }% e8 N: a1 u a* a
inc eax
8 m7 r8 e9 D$ A+ D jnz 00650589 ; detected
8 e% t6 m0 Q3 h6 @! f# J3 w4 `+ q! k push 00 ; OF_READ6 Z5 k. p3 q! s# V: `3 z
mov eax,[00656638] ; '\\.\SICE'/ C3 p& E% o- u9 ?2 j- x
push eax3 G9 E& |) L2 p2 z
call KERNEL32!_lopen9 Q! ~; Q+ R4 d/ g! h
inc eax/ q. X; S/ o# D7 a
jz 006505ae ; not detected: ~: k0 m; J: y
8 T0 f, R9 B, u2 U
: K; S1 M2 |' i* z: N d__________________________________________________________________________9 `/ \% p+ D' [7 W
# n2 Q8 D/ E; n: tMethod 12
) J" U* j8 p H [" V=========" g" V5 g/ @- c. ]/ t
3 u/ h; x( A# j1 E
This trick is similar to int41h/4fh Debugger installation check (code 05- \& A/ f1 N% ~% I( Q* W
& 06) but very limited because it's only available for Win95/98 (not NT)
0 E5 x7 A$ J5 B9 _# G8 H4 R/ i5 b. das it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, G" X8 Z b% k. q( `7 J8 t% `3 [3 x5 a7 z$ p0 W' D- H
push 0000004fh ; function 4fh
& Q+ d+ r c0 O8 f! t push 002a002ah ; high word specifies which VxD (VWIN32)
; r: ~8 i+ A# Z ; low word specifies which service
0 D3 Y1 d4 v# _) k# B d (VWIN32_Int41Dispatch), g, B7 V: j! V) U* L, j
call Kernel32!ORD_001 ; VxdCall
+ `, e9 J& T; Y1 e& x cmp ax, 0f386h ; magic number returned by system debuggers" Y8 R5 ?7 {; W, F
jz SoftICE_detected
/ C, S: i O8 {5 f( n( V6 N9 Z" o: [- J! w s% t. g
Here again, several ways to detect it:
& m: S- D8 ?2 \/ t; @, L! ]6 ?. A1 O. |) t: m
BPINT 41 if ax==4f
: P! e$ V$ ]% X, F
- @* N2 T0 I# ~2 b: J BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one4 U3 E K2 |) | T
) E' @2 \1 h0 s( |! z7 ]2 l
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) Q( M+ Q8 O2 L' V" J, A9 Q
' |3 ]" p8 X. |7 z1 H BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: {: i/ D# M4 d+ ]# U- y! J# Z3 l1 z0 u
__________________________________________________________________________
8 {& t4 ]1 X1 w4 l& t& o% ~6 c0 L/ j& F- T' P3 ^; J/ ~! d
Method 13$ |$ c& \) M) T% o& `( U- c
=========
$ Y: J7 g: Z8 j0 H/ O, J" F1 h% E5 c3 O$ G
Not a real method of detection, but a good way to know if SoftICE is! J7 k# o' k, G' e" `# p
installed on a computer and to locate its installation directory.
5 }$ G. {8 I2 y1 y. ]4 |It is used by few softs which access the following registry keys (usually #2) :
) C; J# n# r1 n& e# _. U; v8 N" L) P9 q0 k1 I: b ^! i* C) i9 t. D* g
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 W% T% l+ b" a% J\Uninstall\SoftICE5 ?3 v; O+ I. v2 m2 u. |
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ y% P% A$ G6 G& V' D i" R3 d* K-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 j) J" Q `5 C$ z" O; d N\App Paths\Loader32.Exe- U9 f4 {/ W1 s+ H/ B
6 g9 N3 n% r# y( k
; E/ u8 p* ?$ O9 v4 j% |
Note that some nasty apps could then erase all files from SoftICE directory
) a% S0 K8 W8 v(I faced that once :-(; @6 k* S! I' v/ l) P
7 Y; U y' k7 ^
Useful breakpoint to detect it:, Q2 J6 g1 a6 l
& }( B I! A! _, d L
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'9 y) e% T, Z2 q1 b- p5 H
6 ^' v0 N- L6 |( A0 Y) i+ M6 C5 ~__________________________________________________________________________
5 M! ~( h& M, x: ]; o! J- Q
% O3 W5 {0 L+ b: y& S. m" S
6 H9 z9 R" B" p, ]Method 14 : j. o- h9 J: s! a: w; t
=========2 b; {( ]& {3 E c3 a& c, s4 u' j
; J% c4 c+ x. z @& ?2 \( P
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# v# u/ @$ f1 Ais to determines whether a debugger is running on your system (ring0 only).1 z& N! @" K" U. L+ ?
# I( }) N. {0 \6 ]/ K* T# q% q VMMCall Test_Debug_Installed: P4 p3 v' T. f5 d
je not_installed# d6 B) _2 \% A9 h6 p1 ]
5 D- G. l& N X7 e) @( NThis service just checks a flag.$ S2 w8 \4 q4 k! b
</PRE></TD></TR></TBODY></TABLE> |