<TABLE width=500>
# k/ A$ g9 H7 O- Q) Z$ @<TBODY>
0 {1 P: c) ` M3 w, E<TR>
. ?! D- f' w/ F" s& }4 w3 \<TD><PRE>Method 01
' D: n7 ?4 |; k: T: T6 u. d4 A. k=========
2 D$ ]7 h" Y% o8 p! T6 H% K2 h& k7 V& v; _5 O2 C
This method of detection of SoftICE (as well as the following one) is6 D+ }6 i$ Z& M6 {! }. _( C/ ^0 x
used by the majority of packers/encryptors found on Internet.8 ^( }7 d- Q) U0 S4 T- |/ B" L% t) @2 d7 }
It seeks the signature of BoundsChecker in SoftICE
" G8 n1 z( \. N1 x! M; Z8 E- w7 F3 l8 S0 a M' D+ G3 n2 v( S
mov ebp, 04243484Bh ; 'BCHK'
6 v- e Y+ o" M7 l; M4 F$ l mov ax, 04h7 W' h0 x2 m9 w" A
int 3
' p8 p3 @" |7 N; U cmp al,4
" t1 L( r$ C! v% U/ Z; @; ~$ G jnz SoftICE_Detected
7 ` {( z+ _6 q# \' P, n
3 _. h4 E9 ~1 ^1 D0 v4 H! v. l___________________________________________________________________________
, I9 `6 R: S3 [- V, u/ u$ `
: N( F! @+ D; f+ LMethod 02$ m9 l" f* V( n4 Y( [3 n! B
=========: _! d! x- O* }) N: e
' M) J1 L7 I% z5 ?! u
Still a method very much used (perhaps the most frequent one). It is used6 O" h/ i8 E* U3 X( ?' E
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
0 f- i" y8 _% @3 ?9 B; Y" Bor execute SoftICE commands...4 V6 |. V7 G4 [" f8 M, u; t
It is also used to crash SoftICE and to force it to execute any commands
8 V: M( R* L0 K: W4 z( R$ H(HBOOT...) :-(( 1 X# x$ B9 p; p8 m7 N6 o! N
9 a1 k" G, f" A; b9 f( D KHere is a quick description:
1 r& H( N) [7 G, M) Y8 w- x* z-AX = 0910h (Display string in SIce windows)
) t. |9 ]* N, q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
0 D4 ?0 p2 ~- \5 |5 G; A' q- `/ `-AX = 0912h (Get breakpoint infos)+ S* [* A: P( z; I% a0 S
-AX = 0913h (Set Sice breakpoints)# n( ?$ X+ L3 _/ ]9 i
-AX = 0914h (Remove SIce breakoints)- z# J' i2 l) D2 @
7 \% M2 j) a8 U0 oEach time you'll meet this trick, you'll see:+ P/ u9 D) Y' m8 ~* O
-SI = 4647h3 }5 @- e) r" v" }' ]
-DI = 4A4Dh
) `/ {' f2 q0 `3 j+ {+ T# RWhich are the 'magic values' used by SoftIce.5 }3 I* x$ J: U8 o' U6 U) e3 N
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 z, _6 z+ L1 J, J; v( @
# S* v. x/ b) X! n4 P( V, M* t
Here is one example from the file "Haspinst.exe" which is the dongle HASP
3 u% G; _/ ]5 p, OEnvelope utility use to protect DOS applications:0 y9 F2 t6 c, |7 C7 F
0 v2 b& X4 b* \
( s6 C* X% e" c% `7 Z! l4C19:0095 MOV AX,0911 ; execute command.
( x, T$ @* G2 y6 J+ V1 ?4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).$ q+ _* f6 Y( m
4C19:009A MOV SI,4647 ; 1st magic value./ x5 C$ x3 m2 A+ ~# U+ s; i- H
4C19:009D MOV DI,4A4D ; 2nd magic value.0 L" W8 h+ x3 X% q2 T6 J. \
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
% d! v- J+ H( R, V; p' w4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% [; K, z% o) ]2 m# t% i
4C19:00A4 INC CX- M3 s5 F% b1 U2 f* C4 l# U
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ z2 r2 o" a7 }' i/ z! e
4C19:00A8 JB 0095 ; 6 different commands.7 L( z4 ~. c0 \, v/ b: _* B
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
0 X+ W) F: g; A4 I& c) h4C19:00AD MOV BX,SP ; Good_Guy go ahead :)8 F, E! c0 R7 O" s K
- w* } M# H: Q; e' u4 d3 t! d; LThe program will execute 6 different SIce commands located at ds:dx, which
. W: |% v- M' {& W+ W9 Tare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.+ F$ n$ ~; Q+ Y: {
' y. x% c& k; M# V& c! J2 E. L4 n
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 [. o) }) p2 @% E; {# w0 E7 t& ~& g1 y* X___________________________________________________________________________6 L: q! L- W' K0 [: j* ~
/ i4 a' g# {: P4 n9 o
" |% g2 c& G& R. h
Method 034 z* L, T. U% S7 x# k! g" e
=========) `& u7 _5 w9 Q1 e+ Z
( X8 a) s. F- `) [' ]
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 q( f: g- r2 P w1 a3 I
(API Get entry point)
$ R' q; ]% M- P5 R$ T: \ |5 s' t + [" R! U8 Z& }% J
- x! b P" V/ o4 h& e
xor di,di
5 _- X+ A& ?0 [" n! i2 R9 G1 Y mov es,di, ^6 \& c- T6 _
mov ax, 1684h
* _3 x/ P, e0 z5 k9 ~3 v mov bx, 0202h ; VxD ID of winice% i- e! l8 D- ]; N' n" a8 X
int 2Fh1 B2 q4 ]& \2 n5 S& a' [
mov ax, es ; ES:DI -> VxD API entry point- p* C/ d1 _8 j
add ax, di+ W+ k* C T& t
test ax,ax
( u2 u: U$ m3 u- L9 R jnz SoftICE_Detected! |+ H" N$ P, e; `. A
: Y2 g. C' ^. Z___________________________________________________________________________/ ~- w' R% J# A
% l5 p) j7 f: I& L% X
Method 04! u( r- [) k' z) L: q% u9 n1 K5 U1 D/ k7 n
=========4 F; m3 u0 Z* M$ l3 }: B; b
2 J$ g0 p( A: A! R+ R c6 D
Method identical to the preceding one except that it seeks the ID of SoftICE
7 o9 X$ D( P+ c) F, m: | xGFX VxD.2 S+ E+ Q3 u4 @8 g& U
% W3 D7 Y% M z& q6 a/ {) t xor di,di
. w; O! U) U- t0 }! g) ?. I4 r mov es,di
P. _. O: O- F4 W7 f6 C7 s mov ax, 1684h + j1 O; L$ P8 D: c2 }0 j5 i; |/ i2 `
mov bx, 7a5Fh ; VxD ID of SIWVID+ H; G; o/ t' C+ D5 c+ ~% ~
int 2fh/ W! Y) `* O. O- U, I& \8 j
mov ax, es ; ES:DI -> VxD API entry point
/ j" w3 b4 u* e4 B: G add ax, di" S" ^% d& h/ q1 X8 `
test ax,ax! g8 o4 X0 ]) q5 T5 ~3 v+ D
jnz SoftICE_Detected
$ g8 k! p5 c6 Z4 \
) v6 h8 j: y+ Z t! A__________________________________________________________________________4 v, g0 k; @- q! o
! o) i! q+ |9 S& ^ y' L! w
- ?; O; D! r0 @& m# E$ f1 fMethod 058 [: e2 x7 b& e p' e* H4 h
=========9 g( @- r) J( @. n$ |
$ L4 ~" o) A2 g" [$ o0 s6 A3 c5 SMethod seeking the 'magic number' 0F386h returned (in ax) by all system
) s3 ?8 J, @' M3 O5 ~debugger. It calls the int 41h, function 4Fh.* g& V7 x0 _, ~. v8 S( Y4 Q
There are several alternatives.
* A3 f" u4 a! r
) R1 v5 V3 m4 t S- V6 ?* e( X: [+ }The following one is the simplest:: Z* U2 u; _: ^% X, G
" S( D, P7 X, A) g- K# _ mov ax,4fh- M) K/ M3 \, t' y) k
int 41h
2 g1 {. y$ z4 K" h cmp ax, 0F386
+ X; X D' O! X" F0 |3 P7 Z/ Q4 M9 @ jz SoftICE_detected
, J1 }8 O7 [& d" Q1 } o% M$ ~0 a: _
$ d/ ^. T# g1 h5 }* E0 c$ @Next method as well as the following one are 2 examples from Stone's : j* o: j0 L: j3 |8 k% P/ Z
"stn-wid.zip" (www.cracking.net):3 l- b# o1 c$ m: |6 d6 w* x
3 I2 Z! [, T0 W' _2 o mov bx, cs
: R# M8 y" e+ e- ^" K8 U lea dx, int41handler2
7 \) W& S, h' {2 y" L; C xchg dx, es:[41h*4]6 q. N) v$ N( E
xchg bx, es:[41h*4+2]1 |% R' A/ x( o2 V3 y7 `
mov ax,4fh
# G8 S+ L5 V: U# n/ \% G+ A' c! G' J5 b int 41h Z- A+ ` `6 F$ c+ _5 K. Z* d
xchg dx, es:[41h*4]+ p# w* x- d% { p
xchg bx, es:[41h*4+2]
' }, B# u: b. h: M) p6 E cmp ax, 0f386h
) s2 @9 |) m4 V' N5 j7 _ jz SoftICE_detected
3 z8 d& }. R# r# C0 E$ f- e. J2 Q) M4 [9 P% @
int41handler2 PROC8 F5 X3 T: ]( q( p# v9 y
iret
& v; _# m2 |6 a) K! Q7 pint41handler2 ENDP( F' x& z. W4 R* K" {
; [5 x! U3 n* P# n$ \8 G
9 J1 A) Q5 J6 p% T) `_________________________________________________________________________7 Z' T+ z: R4 g; P9 D9 j& y6 b* F
5 L6 d: S) ~' W! n$ L
2 G/ y V4 y4 i7 u0 o0 E* eMethod 062 i/ y, c9 d4 {+ E
=========
0 L+ T5 _. i* r# N1 {* d
! i: y. k: W7 z8 q% W, {, j( o( A6 @8 i0 T* c. J: @! q
2nd method similar to the preceding one but more difficult to detect:" \# g! }' p- x% L h9 j* y5 M
3 J. n2 j K. j; {; B" c
f L) ]( O: J: p l3 Z0 }int41handler PROC: q0 y j+ X+ S
mov cl,al" {9 M6 r6 R A% q! ]0 y
iret$ C/ X6 t, P4 i, e, Z$ E
int41handler ENDP
* ~ D$ \+ _( O: j6 [6 C$ P' K5 O5 p7 D8 A' S$ u I% M
' R8 m8 J9 Z$ a2 {: b. n
xor ax,ax
9 A# U2 B1 g" X7 [0 a mov es,ax
; G; ]* Q' K) t# c mov bx, cs
8 o: W: k+ r; V5 F& i, O, t lea dx, int41handler1 g- O- x7 L/ S1 j4 P
xchg dx, es:[41h*4]
+ i( M0 p- W& g+ x xchg bx, es:[41h*4+2]9 _4 k& J( `$ |* k4 f7 c# ?! i
in al, 40h
) T: t* J _8 o1 X( Y xor cx,cx
: I9 L+ |4 W E, u; v2 P% J1 n% u$ p int 41h
9 T, ^' J8 r8 u: _8 w xchg dx, es:[41h*4]5 w1 r! K! N1 N$ {+ f7 f
xchg bx, es:[41h*4+2]$ L+ a( E8 ]; t; A {
cmp cl,al8 z9 a5 n1 @! ?. o" H' ]
jnz SoftICE_detected w u' V R* D1 Q5 V" ~
! @. t! c7 _, U$ @& z% [) H/ S1 r7 j) m& [
_________________________________________________________________________
1 V5 S5 N5 j' ]/ n- O) ^% I1 V
/ s5 L0 {% N% Y9 _# LMethod 070 N1 s: t- X) T( \* w9 b
=========
: W% ]9 y- U1 K
+ L/ J7 a+ h1 qMethod of detection of the WinICE handler in the int68h (V86)
5 H# f( T, m6 F: y5 C) F
" Y% ?% A' F! O3 Y* |# d% F mov ah,43h
2 P/ G0 H) e6 U5 U, p int 68h! Q% @2 f6 I2 c) I# v% {
cmp ax,0F386h
1 L1 U& |5 T- N. v# Y jz SoftICE_Detected& H) R- Q" p2 {, B1 O1 e
" s1 d% e$ Z* X5 q. ]* ~% v$ X' e: w/ g
: F" T) _2 E4 A=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit" \& F/ k5 I4 h5 ~! O) h
app like this:
7 F0 Z5 J2 A* V# N+ z* R" j' Q9 g* c7 c+ p; s. p5 w
BPX exec_int if ax==68' p, v* Y8 s4 _0 f% ~( P
(function called is located at byte ptr [ebp+1Dh] and client eip is
% O# i; A1 _/ ?$ \6 f! P6 i located at [ebp+48h] for 32Bit apps)0 l6 w) u" c" H
__________________________________________________________________________
* a5 f; V& f- z9 @# k1 ~- a' E* u- }
7 p9 R' s/ i% k' [! h
Method 08
" c" M# d5 U9 Y, H! W' Y=========
) E" b& q. I: n, n8 Z- A6 u( ^$ B) g, q4 @! X
It is not a method of detection of SoftICE but a possibility to crash the% e |# f4 b9 X& K
system by intercepting int 01h and int 03h and redirecting them to another! P, I& |' y) [) U5 e; o7 r
routine.3 m4 R$ Q* N4 ?! W+ Z) E J
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 Y+ t" x: `) R) J8 U3 }. }
to the new routine to execute (hangs computer...)
: t, W7 D. a) D. K! k( u1 r
8 \, ~, i# K) f' H mov ah, 25h) }$ W4 |+ N+ O) z1 Q
mov al, Int_Number (01h or 03h)6 a! C# h( O& H1 b
mov dx, offset New_Int_Routine7 Y1 s) f2 r& K
int 21h& G0 v" q' P3 q4 Z/ M P6 f
0 F" o3 _. D5 C0 H% ?__________________________________________________________________________, G1 i! Y' \# Z' O6 ^. ]$ x
) L( Z( b* h* i5 E/ `4 \; aMethod 09( ]. [& T' t/ Z* I/ s, }
=========
$ `, W+ R' h5 R v" F1 @' l0 o+ b; M: ~. _ p& `: m" _
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, f9 ?! `! m. vperformed in ring0 (VxD or a ring3 app using the VxdCall).$ O; X# i) N; V
The Get_DDB service is used to determine whether or not a VxD is installed
6 G5 ], a* H6 e9 ffor the specified device and returns a Device Description Block (in ecx) for+ V7 C6 J% }# B* u- v% D
that device if it is installed.
, e4 i! Y5 |3 D! i1 {: ~0 b" v
0 V; p+ e, b0 H- J" f$ U* G mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 j8 M: t' `3 n2 ~7 I$ Y
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)+ K1 @0 U N1 p1 z# ^
VMMCall Get_DDB
4 |" X1 W; k$ G mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
: S# B: x6 e: A' J9 a* U9 V) O' z6 [( ?+ @( _' e4 Y7 q
Note as well that you can easily detect this method with SoftICE:
1 ]8 b1 F% T& o0 Q0 ] bpx Get_DDB if ax==0202 || ax==7a5fh
4 ?$ d9 ~# ?) q. H' t8 _
A8 a7 v4 C1 Y, ?" A__________________________________________________________________________
7 A# m! P5 [3 C% L! Y
( f' b, `; E$ [2 l6 O' xMethod 10
+ ?! K1 I2 _" g& T! @! \=========
! ~# l# t9 h4 S3 [6 @' [9 ~6 g5 A0 k/ L/ S4 F8 w. F2 `; @0 w# o
=>Disable or clear breakpoints before using this feature. DO NOT trace with" ^& ?$ J4 ^/ j; p0 p% G3 ^5 H
SoftICE while the option is enable!!
$ e' x+ Z H% U7 m2 e0 k1 q& `
" T$ N9 u' j2 ~; c* s5 `. bThis trick is very efficient:
/ R: n$ H8 r4 kby checking the Debug Registers, you can detect if SoftICE is loaded: W2 G2 D: l5 }) ]1 F6 W6 E A
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# O8 W: L+ G9 W/ k9 wthere are some memory breakpoints set (dr0 to dr3) simply by reading their
2 j8 U+ h) `- R9 N. \3 \8 T' Fvalue (in ring0 only). Values can be manipulated and or changed as well
- U/ m! l h. m; w(clearing BPMs for instance)# q; ]6 q- }0 K: f z
4 W! }; W! S$ b) n__________________________________________________________________________6 R7 {+ y2 x8 g3 d. B+ |% Q
9 [5 b& J& Q6 `/ R
Method 11
8 p- f6 [ t- j. `8 g* w8 R=========
5 {( H4 E- F3 v) X
1 r: m3 {. Y2 j- B2 @, d+ E& n9 I) \This method is most known as 'MeltICE' because it has been freely distributed4 b/ O2 `+ c; V# |7 }) l1 l
via www.winfiles.com. However it was first used by NuMega people to allow
( w6 V8 T2 e( j3 u$ ]Symbol Loader to check if SoftICE was active or not (the code is located
5 O0 S" [( z% v1 P( vinside nmtrans.dll).: C# t0 C7 T2 q& r* Y) a" ]2 h. d/ V
6 F2 i; C% @( v6 k7 Q9 g7 x
The way it works is very simple:' ]5 ~' P r9 q( r0 P5 i$ H
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% U/ R0 p% C; ]# e6 h3 e
WinNT) with the CreateFileA API.& n8 R* p m$ X8 e; g5 N o: `
* G7 `+ {; w0 f9 Y, L# Y! T
Here is a sample (checking for 'SICE'):1 _0 s4 q. S7 h# Y
) q) v$ x S6 W) w. c0 O9 lBOOL IsSoftIce95Loaded()
$ D' x2 W- W3 o) G. E- U* D{
4 A5 R' [ F9 w HANDLE hFile;
^' v( ]0 j6 K4 ^; @ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ h4 ^- _- |- X7 a' B8 G" `1 `
FILE_SHARE_READ | FILE_SHARE_WRITE,
5 `1 B- k! _/ q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( K3 t3 j7 ~% ]7 `2 z if( hFile != INVALID_HANDLE_VALUE )6 y5 E( c# t5 E3 p
{
: U- e; Q8 n$ N5 S$ z CloseHandle(hFile);( q6 c" P. I' [
return TRUE;
0 T8 O% p! i6 T! ^( \ }3 _, x$ k% K9 K5 J0 H
return FALSE;4 n. ]3 U4 t: |9 D0 i/ y+ y( r7 h
}% l# ~$ H5 ~8 h8 t. X
- Y) H7 r2 C o7 }
Although this trick calls the CreateFileA function, don't even expect to be0 z# S2 o q: i# u( E
able to intercept it by installing a IFS hook: it will not work, no way!/ P1 C, C% u6 ?# v
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
' L4 |8 u b5 d: nservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function), l5 n& z, t$ b& v- ]) L% D/ O
and then browse the DDB list until it find the VxD and its DDB_Control_Proc( ^6 K9 o2 B G+ X* ^
field.. m/ \: B4 i% a* T' s" t
In fact, its purpose is not to load/unload VxDs but only to send a - H, c2 j" |0 C0 `6 A# ]" _
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 @8 Q6 ?5 t5 l( N
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
) ]; s7 N1 v; H, _4 i+ ?to load/unload a non-dynamically loadable driver such as SoftICE ;-).
% T4 Y+ r+ h) \. uIf the VxD is loaded, it will always clear eax and the Carry flag to allow H, L+ R' J U- T/ g, x1 W& J
its handle to be opened and then, will be detected., \) Z" l9 G1 a1 f/ G" r' J
You can check that simply by hooking Winice.exe control proc entry point
7 W' z4 f2 \% w/ k- P3 V1 d* vwhile running MeltICE.
, Z; \% t1 `+ J" U! x' Q. n
! Z6 w9 ^ Z& j, l% w( k
3 z: @ p; p) \1 h; | 00401067: push 00402025 ; \\.\SICE5 m( ?+ o! ?7 T2 o4 | M3 r8 m
0040106C: call CreateFileA0 |9 P& H$ ^+ f% r2 c1 u" A
00401071: cmp eax,-001
/ r3 u1 w) b' V( Z9 r 00401074: je 00401091
3 s- Z! j% A/ ]' J# f6 W/ f, l A0 l/ Y$ j4 b% C' I
% m9 V9 |6 W: KThere could be hundreds of BPX you could use to detect this trick.$ @: U+ g- n& G0 s( J/ u
-The most classical one is:
5 s+ @+ ?/ O' }4 P1 \+ {1 Z- _5 P BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- M s: `* E V3 l* b: w+ Y- n *(esp->4+4)=='NTIC'2 c# Z! m/ ?! h. n
: Z9 I8 x3 _9 ]) W }# n M2 w-The most exotic ones (could be very slooooow :-(4 F; k6 D X$ n$ }, {8 M
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
/ i" |0 i4 _7 S$ W ;will break 3 times :-(
" @4 o) ^; C, {* k8 a1 |6 H, l, }
3 H3 M- W/ w, F* B- r-or (a bit) faster: , \3 [0 X9 o3 E" e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 c. s2 \' W' D
! H' W# W; b" b. D7 S BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, a( M/ \; `4 {$ q* s ;will break 3 times :-(
( \4 l* w* o- W$ n0 A, K, x2 S: ?6 m* v1 _# G
-Much faster:, y. ~( Z$ r6 U2 R4 A( Z( \
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! t- ~4 ~% }) _ G
$ g `7 N2 G5 q9 FNote also that some programs (like AZPR3.00) use de old 16-bit _lopen3 k, J' _: K7 m' A
function to do the same job:
' p7 h8 |* t% I' w! w& K1 s! i* E: k3 f/ e! ~" ^0 q
push 00 ; OF_READ
4 c+ f: z4 j* n+ T+ w: R _& _, N$ g mov eax,[00656634] ; '\\.\SICE',07 a- G0 @- t+ A/ `6 f3 T% Z" M
push eax
1 P, Q6 B- g$ S! J# T' V" } call KERNEL32!_lopen( ~- o' g+ \/ R7 e. d9 S- _
inc eax2 V, `. w0 t+ H: G
jnz 00650589 ; detected2 _0 M& K6 t) ?: o* ~' S
push 00 ; OF_READ/ @. o. \, B5 L( b* A; j4 T
mov eax,[00656638] ; '\\.\SICE'( n! j! v+ X/ U. X" g) z4 a
push eax
7 d) X$ O' E1 k call KERNEL32!_lopen
+ p* a( J7 M `% R inc eax5 f# ]- }+ @! X% a4 n: w+ s, \0 g) g$ p2 N
jz 006505ae ; not detected
5 [! [) E6 `7 W/ p @
7 S- {- ^5 X+ }8 k$ M* d0 Q
! K1 A0 S* C/ F* E" w# ~__________________________________________________________________________
) P+ ^ p/ ^+ S q6 ^. q5 _' R' U
- D9 y: M n: P, h! G d: iMethod 12
7 u. W f4 u9 C* c% A=========
% {5 j& o5 P! g' ^/ g0 a- t* f) S3 n! L( s( T& \
This trick is similar to int41h/4fh Debugger installation check (code 05
, h+ U" r% T6 o1 S2 G& 06) but very limited because it's only available for Win95/98 (not NT)) i; U3 X$ W6 `( W5 ~# M7 e2 a
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 I- v4 `0 g+ c( ^" Q' R, f, b" u7 f; Z" d
push 0000004fh ; function 4fh
9 _0 z& L3 W/ m0 y- G8 o" C0 G push 002a002ah ; high word specifies which VxD (VWIN32)
: m$ M8 u8 J" V% [* z( ~0 ~! F1 _ ; low word specifies which service
( ^6 S: y2 l% b: m0 G( M6 _8 L (VWIN32_Int41Dispatch)
' m1 w! e- |8 A) { k, S$ R0 Y call Kernel32!ORD_001 ; VxdCall
/ ^# \* `4 V0 W% P. ^: y! H cmp ax, 0f386h ; magic number returned by system debuggers
' F2 K' ~% X+ v0 N; a+ A9 K jz SoftICE_detected5 F% x- Q+ M5 `6 A
, w; W3 P6 J0 ?9 k5 i. ]Here again, several ways to detect it:
( u5 j5 P5 j1 R5 c3 [7 C J; T( D5 _
BPINT 41 if ax==4f
1 G4 U S. q* G9 m5 [
/ e0 ^, x. m& J BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 z: h- V( y8 E2 Z. N" N# ]7 L$ z5 ?: a4 K! ], L. _
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
5 G& b) ^ l. }0 C
9 l1 M) k2 q: s BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
1 Q# u2 R& G/ i( I+ ^1 b7 }) d! t6 f W, C
__________________________________________________________________________0 A5 s }, j: @( ~4 T H8 g
0 O+ {% m$ U9 @# o+ E8 z
Method 13
6 \( w. R/ ~# b6 C/ {! X=========
3 ~: w9 Q2 N* v% c: ?
1 \6 v" w3 o4 n7 F- w* @, t! E$ f3 tNot a real method of detection, but a good way to know if SoftICE is+ Q8 g( P" I7 G& Q' W6 u/ j
installed on a computer and to locate its installation directory.8 G8 W% j5 y( b, I! q
It is used by few softs which access the following registry keys (usually #2) :
) h+ h7 t a: B1 O; |/ S) t% V4 |6 J
! Q8 ?7 `3 D2 c! e/ H+ o* A+ [-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% |& O* K2 \& N\Uninstall\SoftICE7 X9 m, c5 d1 G9 M
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% f& M5 e4 K8 U5 A) {
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' a$ S3 n* O( ^$ s1 q\App Paths\Loader32.Exe
9 }, d& d6 z- l: Z% o5 `; W3 I
" Y) R& {6 s! e/ l' H3 Q9 j+ j
( o0 {: n; t+ ]9 [& P: P ~Note that some nasty apps could then erase all files from SoftICE directory. M9 F7 J9 H7 g' u- W5 g' w7 S$ ?+ d) u
(I faced that once :-(
, x4 E _' c( \9 ]3 {* q/ S# Q) O/ Y9 H# j
Useful breakpoint to detect it:: s" n* N C1 a6 N+ P- O9 h, ]
/ c. W( @5 [" J0 D5 m2 F& | BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
; D3 o, v$ L5 R' x5 ^
- C7 o# y! q& F& I7 {__________________________________________________________________________! T' x. I$ s9 a6 }( T- I, {
# S) H4 e- a8 _& I/ d \1 L+ s. ]+ q, g+ V3 k- S2 E6 u8 r
Method 14
9 T* h2 J$ Y" i4 u2 f=========
( v: r R1 J; t! h8 c6 r# S- O `% T1 F4 u: S; x8 |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; A! u+ O/ \+ @# M5 U3 x. w
is to determines whether a debugger is running on your system (ring0 only).
2 u. K. R* E8 r% Y& |8 m& O% _+ @) ?9 z5 [9 r2 _" M
VMMCall Test_Debug_Installed& A* }$ v7 N& N4 b6 R$ w
je not_installed
; c# I. I3 }0 z7 W# k0 x# J) M. _% u: J$ e0 f: i
This service just checks a flag.
& M' z9 c, I5 F9 y5 p% g: k E</PRE></TD></TR></TBODY></TABLE> |