<TABLE width=500>. k1 m* m$ Q! t6 e0 v% E
<TBODY>* J' _, @* s* k4 K/ k. l* f6 |
<TR>1 Z4 A. @% Q! h& R1 s4 J
<TD><PRE>Method 01
5 j3 [9 x4 D5 }! T( v# ^=========, S$ H1 M9 g% }7 T
* V P) c8 x" \8 qThis method of detection of SoftICE (as well as the following one) is7 ^! g6 P( f) _2 P9 |
used by the majority of packers/encryptors found on Internet.
0 a/ r+ ?, |; h( ? \It seeks the signature of BoundsChecker in SoftICE8 \% v( j6 O3 O4 O* X
/ t1 w; F p# r& {0 ^" B% |
mov ebp, 04243484Bh ; 'BCHK'
! h+ R! y! [2 `; r1 x' X mov ax, 04h
8 s3 N9 Y7 F* H5 ]: n" B int 3
! u* Z) h5 b9 U+ a6 ?- e cmp al,4
: |. H9 {, }0 y4 O9 z8 B jnz SoftICE_Detected
( ?* r3 D' H1 b1 z( L: @* b2 L [- m- M& z) \" ~
___________________________________________________________________________
4 x4 `1 i3 @3 f) R
2 Z8 y$ k0 R! R1 GMethod 02( `& c- T8 g0 ?1 Z; Q9 B x a9 a& r
=========- k8 ]; L( o6 a* g1 S
) a+ s, X- R0 p$ W- r
Still a method very much used (perhaps the most frequent one). It is used
8 _1 G5 t$ Q \7 X7 L' T, tto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* l+ ~- d( n9 Q5 R) C, A/ p5 H. Lor execute SoftICE commands...9 `# h; R; N" ]
It is also used to crash SoftICE and to force it to execute any commands7 L- C) e9 E1 B) ^
(HBOOT...) :-((
) p/ W- E! p j
0 w) T# x @9 ]6 I+ z m* _* l& @Here is a quick description:
4 g$ `& U1 t3 O- \0 N, t% d-AX = 0910h (Display string in SIce windows)
" n/ h/ G. B/ Y. J4 m-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
* ^+ x" G! \" v/ I5 U' U1 |; r: p-AX = 0912h (Get breakpoint infos)
8 y9 P l& p3 |( N u5 y8 b" I8 w-AX = 0913h (Set Sice breakpoints). X* R8 M( W* O- z% C, b6 k
-AX = 0914h (Remove SIce breakoints)" Y7 x3 m) ^6 j" D& B1 \
4 D. d( I% Z. ?: n y: M3 wEach time you'll meet this trick, you'll see:8 n0 t& y; E: S2 ]9 F
-SI = 4647h
+ D( N, r$ m$ j$ _4 L-DI = 4A4Dh
5 \! f/ D3 Q1 HWhich are the 'magic values' used by SoftIce.
! N9 P1 R) E: L7 P& W8 VFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.0 I8 G$ q1 a& ]4 t& ]& R. P' W
3 D- n) u' _& @
Here is one example from the file "Haspinst.exe" which is the dongle HASP6 ^8 g- e |; K* C
Envelope utility use to protect DOS applications:4 P' E# d7 a7 W% _7 ?, {$ T
9 j) z* _8 h" ]8 w
0 e8 ~* N+ g. j; _4C19:0095 MOV AX,0911 ; execute command.
) H6 p5 t: L6 F# a$ K' }4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* l% p/ }. k8 \( S3 k* _# d; R3 i4C19:009A MOV SI,4647 ; 1st magic value.8 f5 `1 ^& L, T1 R9 W
4C19:009D MOV DI,4A4D ; 2nd magic value.6 M- z1 W- |* N9 ~4 q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)1 ^9 ?2 D. x8 Y' `) W5 }3 ^& j
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ S0 Q8 q3 i7 r% R' ^4 q
4C19:00A4 INC CX
$ o8 X5 x/ t# x$ M5 h4C19:00A5 CMP CX,06 ; Repeat 6 times to execute% r. U" X* R1 u( G7 M( X
4C19:00A8 JB 0095 ; 6 different commands.
2 l% ?* Y+ E, S9 k1 W4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ a$ h1 \- m, g( ~
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* G, ^3 W0 \4 o$ z8 X& d Y* w! X
# l' Y; `$ B7 k4 w% E3 N9 EThe program will execute 6 different SIce commands located at ds:dx, which
6 U* E1 @+ i9 }$ u, ?are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 {% V V3 ?; a4 z* x
& J5 [* `. I( F8 o/ j* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! M. f5 M7 D; a4 x$ E( G+ z5 R- w___________________________________________________________________________
4 Z0 b7 t& B0 ]4 S3 r: t8 M4 s: d# L9 K O
/ [% Z6 k4 ]" F0 lMethod 030 I9 v' `3 u/ c7 E2 M. t. V
=========% y5 ?4 Y" C S. `& n8 K/ u
& n2 ]' V* h1 `5 L2 dLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 J8 g7 G( F5 q: M2 p, d(API Get entry point)
0 f8 o& z3 {: e7 x1 ~7 N) h
% Z: V( }% n' f" y8 \0 d) c+ o; U6 B
xor di,di% u% Q0 r5 q! N @9 S6 j& u7 A) w
mov es,di
2 }% F% n* a( {7 ]. I mov ax, 1684h ( O- |3 X7 u7 l# q" X6 B
mov bx, 0202h ; VxD ID of winice- t+ C( J6 A! q7 |; J8 N, g2 Q
int 2Fh
0 a, I! M6 L3 w }9 u! z7 {* x mov ax, es ; ES:DI -> VxD API entry point! t* `4 v. g' f5 y. _0 w
add ax, di
( u* S/ V( J1 g* k6 ~ test ax,ax3 c7 {- m& Z5 n
jnz SoftICE_Detected' A. u) Q- N& d5 S
8 b2 N/ S6 Z4 e* l! G8 v! I
___________________________________________________________________________, O( a- l( L. e* y$ x
+ P+ l5 Z4 K' ]' F
Method 04
& c% L7 A, N" v# S% {, a0 D=========, [/ W6 u0 O8 g% k7 c
) ?4 e; `: c# C, V, |
Method identical to the preceding one except that it seeks the ID of SoftICE5 ^3 I# @* C" m& ^8 r/ W$ Q+ X! U
GFX VxD.( b, N. D) x- B6 G1 a
! q7 X7 n2 U. o2 ]# O
xor di,di
0 d3 j! B0 p* h4 O2 `, T mov es,di
- I6 w- R8 ]: g1 a4 u mov ax, 1684h & J1 @ Z1 T. _) C, V
mov bx, 7a5Fh ; VxD ID of SIWVID
9 P9 i; ?6 V- q int 2fh
. b# |& _5 }" F) z" _8 U mov ax, es ; ES:DI -> VxD API entry point
/ ~) [8 q( X7 D add ax, di
' ?0 F# k# V. j6 F test ax,ax5 c- e' `1 m" @' t' ?! n0 C
jnz SoftICE_Detected6 u7 a2 o+ t$ f' k4 `" O; v* Z0 a: |! |' [
8 f! I2 s( e! M, U- B__________________________________________________________________________
; d7 S, o3 w& H7 C' Z4 E8 b4 T& S# {8 U. j3 E" b8 z
8 d1 d: q5 `- x6 O( }
Method 05
. Q1 g, Z$ z* d( U=========
6 X( z" s& K' t; j: y. _. t% o: ^
) Q* q- H$ H7 K2 AMethod seeking the 'magic number' 0F386h returned (in ax) by all system, q4 i% l3 E: m" ^7 ]
debugger. It calls the int 41h, function 4Fh.
* a# Z! u4 G1 X* p) EThere are several alternatives.
; [0 L; |7 Y! r8 y+ }
, I3 O+ R7 R! AThe following one is the simplest: H- ]* N! M, r. O$ w6 [
$ z" S9 r; x) N5 `3 g. J' ^3 u
mov ax,4fh5 _9 I0 i& @, b
int 41h+ S; ]6 ?# X0 W. J) p9 g- m, p3 F
cmp ax, 0F3860 ?* v3 Y, P# n0 w# Q# E# F
jz SoftICE_detected
& i5 X* [2 p( S0 u( |) }8 |: H# ^+ y5 w- z0 |/ S
9 v- g5 Z5 \6 ^- N `Next method as well as the following one are 2 examples from Stone's 0 [6 M% e) ` O3 A% _) j7 |
"stn-wid.zip" (www.cracking.net):# S+ X+ @0 ~% V; B) @) ^# n
) s* g) V' C9 C+ i3 s, i. n mov bx, cs
0 `; c) R5 K/ {6 l lea dx, int41handler20 H7 f2 C7 r6 S. `; d
xchg dx, es:[41h*4]
8 p7 e/ _0 g; U* I, @7 G xchg bx, es:[41h*4+2]
- ~" R! m, k, r: A3 q7 o( j" ^7 z mov ax,4fh
, I9 N5 E2 }0 y+ d* Z. r% m/ `6 z int 41h2 ?. q6 H7 y" B2 x/ p( P
xchg dx, es:[41h*4]
5 B5 ^" ?2 a8 k! d* C( y xchg bx, es:[41h*4+2]
7 b, D8 w8 d1 B2 k- ]' d; n6 W cmp ax, 0f386h
4 p {! B" {* |3 Q3 ?8 G jz SoftICE_detected
+ J+ r2 O6 c9 ]' k$ {! r5 S3 n' [8 ]- @0 e; t
int41handler2 PROC8 H" ^' N1 B# E1 @9 U$ e
iret
1 F: x# v6 Z7 }- N `int41handler2 ENDP- @$ I1 N9 ~6 e0 L% g5 V9 x
, k! m# Z+ t7 l# {3 a2 G$ U! d4 d' e
0 T& s+ A' M1 t. x, Z" y
_________________________________________________________________________
5 y3 [ _, F9 J" n! T& A* e1 Z4 Y# f( i" Z8 a: u8 K
. C. F: a) ? Q5 K
Method 06
$ m g) I$ N" f' i- K! v- z! U U=========
0 t; A/ k# Z% N! u' Z2 d) m2 Q: Z k) }: l4 j
- J! P7 \! { h1 `/ k9 ?4 i+ j
2nd method similar to the preceding one but more difficult to detect:" ~/ h- o1 X2 ]- b _
* e9 {8 m6 R: N0 C6 {) w+ C* B2 ~
int41handler PROC# y9 x: A0 B; W% }( F# C4 V
mov cl,al% o# @% J; ^, z$ X6 G& Q
iret2 \' [9 ^% Z0 I+ @! m) M
int41handler ENDP
8 k' u; [' G- n6 D; [3 m: ?3 n3 z6 R
) w E/ v& _- X* m3 w7 s8 ?
xor ax,ax
$ R! W' A/ m! G# T( J mov es,ax. p. `: }0 n; S/ A/ c: v8 J
mov bx, cs
9 r$ `( ?5 ]" n* z- C' A; N0 | lea dx, int41handler
" r6 e9 m* C0 c" L+ k xchg dx, es:[41h*4]
: @0 r! E& o" o/ J. L/ o& w/ k; I xchg bx, es:[41h*4+2]" X3 t+ A X) D: Q+ z0 z3 D$ d3 w
in al, 40h
1 x( v1 Y: P4 b9 ?4 u: @# j5 _ xor cx,cx
1 g7 r: R8 b" J b) z/ m0 Z9 H9 ~, X S int 41h( K+ e5 y$ ` ~2 H( m/ v
xchg dx, es:[41h*4]- s* t2 U, ^5 H1 C
xchg bx, es:[41h*4+2]4 x& i6 i* Y2 l2 p; U. m' F' i- c
cmp cl,al
9 S6 g) P/ m4 Z( ~8 B f7 e jnz SoftICE_detected
: |8 Y3 k' n1 b3 P7 S# h, Q5 @+ a1 W& q6 C8 j. Z5 u _
_________________________________________________________________________2 \. f e4 S7 ^( S/ G
1 m% o4 @2 ?2 M: ?0 }Method 07& H$ P$ a- u$ v6 [
=========
% X2 r% K1 ~) }+ s' ~: t9 Y N: J8 O9 C: e. b) B
Method of detection of the WinICE handler in the int68h (V86)
/ z" Y/ P& G- ~* Y8 b: ?. ]) e" u0 }/ H% b, M7 p
mov ah,43h9 L1 ^) _ E1 w# h( p6 c& w
int 68h& d- R/ s1 Q- S! r0 J% R
cmp ax,0F386h8 |6 f% |4 m; R2 [; \
jz SoftICE_Detected
/ A4 ]) O9 e% E9 i8 Y b' J
- B9 P2 ~1 F7 B) Y! T
! M" i' ?- Y' ]$ N1 b- c=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 g. C( f3 a* m. I app like this:7 s, ]5 i8 \( y. u: ?0 y
8 R) m; S4 x3 J0 s BPX exec_int if ax==68
+ p0 y& I6 Y4 l& a (function called is located at byte ptr [ebp+1Dh] and client eip is. G7 Q5 K5 C! ?$ Q
located at [ebp+48h] for 32Bit apps)
# Z3 ~7 W+ X3 B* g) x__________________________________________________________________________
6 ?- d# O. l1 J$ u% C% G# B! I5 W+ b G: f. E5 z
6 {- z, k$ U8 v- {4 {" aMethod 082 ^' s; M* s8 Q$ v( D
=========$ }7 u [; q/ {1 M" E% E' J1 O+ d! y
1 Y% ~: f+ i% W8 D+ @
It is not a method of detection of SoftICE but a possibility to crash the# L" A) r8 E" G* ^6 \9 a" p' e
system by intercepting int 01h and int 03h and redirecting them to another# @' j! j$ q1 D& `
routine.+ B1 S2 p+ o0 e/ I
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 J$ k3 E5 j H \1 tto the new routine to execute (hangs computer...)8 \ J8 p- m( f0 f: X4 |$ Z
x2 l" q; u% h2 y) f
mov ah, 25h c. Q3 d4 _1 v4 Z
mov al, Int_Number (01h or 03h) x) [( Q' [$ S( ?' @& o( M0 D* @
mov dx, offset New_Int_Routine
" L: G# W: L& G2 _! R/ X( x int 21h
: M( f" v5 o% s5 C/ e% Y
3 b9 A0 U/ N/ n5 P; {9 O5 g__________________________________________________________________________
- a9 z7 t$ }8 a2 @' `. g* Y! T+ ~* l" Q$ |
Method 09% s/ B5 C+ y- z6 k6 u
=========, v$ ^ H/ i ]. A6 R
' q7 i- h* a r; j+ e. r. o, O% e/ JThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ S' B+ Q7 F) N. D' z0 Rperformed in ring0 (VxD or a ring3 app using the VxdCall)." e+ g+ ?, X1 y p2 L" [
The Get_DDB service is used to determine whether or not a VxD is installed0 P" H; }9 X. _. [+ D) M
for the specified device and returns a Device Description Block (in ecx) for/ d. x$ H" @3 o7 z4 E1 l& R
that device if it is installed.% I/ i! v) G9 S: |
" @- D7 \: c, v+ r4 n) R mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
6 n( ~# ]& n9 @: n9 A5 @ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 a7 }1 e/ n- I8 p& Z* A d
VMMCall Get_DDB' k. x( V) i+ n
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- w8 I+ X$ p( H6 b$ |# B5 y3 c
1 V& |! m' z, Z4 }Note as well that you can easily detect this method with SoftICE:
2 P W& a' Q1 v c, w- N7 s3 U* ~ bpx Get_DDB if ax==0202 || ax==7a5fh
- }5 k5 C# q! z; O2 C/ }! j/ S1 w4 S/ p3 D
__________________________________________________________________________( L- g3 u! r) U( z! h
' ?, H. z& ]* K! K6 k5 P" tMethod 10* v3 I' T9 a* q/ e2 J0 P/ c. N1 I8 e
=========
0 U; Q3 P: P) w4 }
; h" j/ a4 T3 a8 b=>Disable or clear breakpoints before using this feature. DO NOT trace with4 U; c& w1 B9 q' R
SoftICE while the option is enable!!0 m. G" H7 E* l% D* ~
w+ U+ `& r8 A( r/ W8 H+ f
This trick is very efficient:. Q+ f, c7 {) A6 b* \
by checking the Debug Registers, you can detect if SoftICE is loaded
, i( T5 K; l1 D(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' B) m4 ^ z' v; o) bthere are some memory breakpoints set (dr0 to dr3) simply by reading their9 ]* e) u. u$ L. u$ f# n- s
value (in ring0 only). Values can be manipulated and or changed as well/ }- Y" y5 {5 I: K% B; S
(clearing BPMs for instance)) ~* i8 j2 S$ m U$ j
* v8 y# c$ u5 f# r0 i__________________________________________________________________________5 t; ~5 `7 [! J( V1 M. d
0 v1 s6 b7 G1 p8 b }
Method 119 T" `1 _9 i3 R1 W4 w
=========- n2 y9 ^9 q! Q! X
' \$ |0 S) }( v6 M0 c PThis method is most known as 'MeltICE' because it has been freely distributed7 x9 P$ o+ q7 ]* U2 a( \ o
via www.winfiles.com. However it was first used by NuMega people to allow
9 o" h+ \$ b# E4 q# Z1 xSymbol Loader to check if SoftICE was active or not (the code is located0 r/ B' v5 {* G: L1 q& n
inside nmtrans.dll).. i, w2 J4 R# p; @9 Y/ `
0 ~1 g2 E: g: Q/ n; k) dThe way it works is very simple:
0 v+ v0 w2 t5 BIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 f v: I& ~6 |2 B# K% GWinNT) with the CreateFileA API.
: q% d# A5 T5 f$ O+ e. W
6 d, y3 O8 A4 h8 V; F8 ]Here is a sample (checking for 'SICE'):
$ J Q) i5 a( {/ ?' z
2 p+ O2 D6 m0 g9 P2 qBOOL IsSoftIce95Loaded()
! D! b. N7 n2 K4 \{
; a. O4 W! Y9 J HANDLE hFile; - R' I; B8 I" {( g
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, ] s& V3 u W" ~9 U6 `+ g
FILE_SHARE_READ | FILE_SHARE_WRITE,5 x- v, g7 B& D3 n+ S* |% w7 x5 ]
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); n; M9 n! W) ^# [6 z
if( hFile != INVALID_HANDLE_VALUE )
* r* X# W( @4 U$ J0 j# E {
; e: G/ _! t/ E' D! h* G CloseHandle(hFile);+ P3 K4 J1 u( A8 w/ k
return TRUE;. z, Y/ G/ j! p/ P; s" J( {
}
' p3 p1 j: v* f+ i p5 _' E return FALSE;
* k5 @9 l ~' Z& O' L* T$ y}
9 `6 L2 }5 j$ t7 |% X; p# j/ f0 O2 H2 n6 e
Although this trick calls the CreateFileA function, don't even expect to be
7 P. L* b1 o! Z5 b% z* p) m" C' r+ rable to intercept it by installing a IFS hook: it will not work, no way!# n4 |6 t$ ^ \8 B4 l1 x( I
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
: X. v- w8 l7 i8 {) X! N- pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 w( k) ~, k, |and then browse the DDB list until it find the VxD and its DDB_Control_Proc" y3 k) E6 B* \2 A% ` F) J: Q
field.( u7 R/ V4 Q4 V( v/ y. Y4 Z
In fact, its purpose is not to load/unload VxDs but only to send a
& h/ G+ T5 u4 y, IW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ W; ~* u1 d, v p: R d6 f; |8 _: w
to the VxD Control_Dispatch proc (how the hell a shareware soft could try( f4 q/ [; R5 p7 u$ s7 C
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
( W( I9 O7 ? CIf the VxD is loaded, it will always clear eax and the Carry flag to allow
7 {( ]: L; s9 ~5 c: L% ~its handle to be opened and then, will be detected.
; s! N7 ^% K7 u3 A$ e% U- A7 ]You can check that simply by hooking Winice.exe control proc entry point" F- ^ k3 a5 g; I
while running MeltICE.; o( q0 Q5 e; l6 W4 ^: ~0 E
! \5 |, X: I; R) Q: D, U8 F, L# r+ p7 D6 L9 ]5 Q9 U2 b
00401067: push 00402025 ; \\.\SICE
1 X; q0 D$ H4 K* o3 O& ?6 k 0040106C: call CreateFileA
9 @# V/ y& j2 i2 J 00401071: cmp eax,-001
% S3 J+ d" i8 L& ? 00401074: je 00401091
& E w0 R. f0 q: L5 U' r& C6 L8 Y/ {: v
9 J% D/ Q {) y& r3 ]8 C y1 ^$ kThere could be hundreds of BPX you could use to detect this trick.
. K- [* G4 g+ v( E' d0 A8 [-The most classical one is:
" L; A( m B! q7 x/ V' D, ` BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, `) y) [# N8 ?7 Y+ j- W0 U
*(esp->4+4)=='NTIC'
1 H& h3 J4 e7 `% O. _6 N% y N2 j- b @ c1 Z2 Q# r: p8 `. F
-The most exotic ones (could be very slooooow :-(
+ B, ~" H* q5 ~& r; o0 w BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
5 n1 A) n$ V; j4 b7 u0 P4 Y ;will break 3 times :-(
1 m. y( U, D# c+ I/ K/ a. C+ K3 w' n. V) o5 W* x# F0 J# v4 _0 E3 f( n& ~
-or (a bit) faster: ) G( N/ ~' l2 O( L/ r! w/ m) ]
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* s/ W7 d* h n1 f% h0 b6 i9 G7 f
+ }+ }: ?( @% S, \ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - c4 D( l5 ^2 W8 z" N: b
;will break 3 times :-(
7 G4 C" F8 e& q4 x' {; }" a* ^- \1 I; s) K
-Much faster:
5 H3 [) s: ^; T, W& p j- F/ y* r* } BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 b% v0 s" V u* |, @+ h4 R
# q5 D2 E+ k+ Z- B8 r4 f
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 M1 l/ r; m9 _
function to do the same job:" E: { D1 n( g' `5 a/ e
; @/ x) Z* Z' A
push 00 ; OF_READ
+ x5 h5 D5 {5 C! _7 p- b mov eax,[00656634] ; '\\.\SICE',0: S# P/ z9 f5 I9 _; }7 |
push eax
. l+ i( G& Z! L/ [+ ?* @ call KERNEL32!_lopen5 O5 C4 ]7 K U) ^
inc eax
; ]3 h% }& d* u$ t" w, H jnz 00650589 ; detected' P. u5 i) ?6 l* h& V
push 00 ; OF_READ
! m$ O: O- c2 v( D9 o mov eax,[00656638] ; '\\.\SICE'
( T% k' D% Y3 t" V1 V& @ push eax
, ]$ @5 [# f. y* i, H" j2 Y call KERNEL32!_lopen6 z/ d. M- D/ }7 U, y: k, {
inc eax: M: s( r+ }: d a4 k Z
jz 006505ae ; not detected6 q4 M* E) e& t9 D. ?% t
+ x, u0 O( @+ V$ V
* k/ T; G4 R7 j" _( z& l__________________________________________________________________________
! N s# u9 w+ w4 Y+ @; u& {, r: ?
+ G3 ~8 n$ z3 Y$ G' _" k) d# ?( kMethod 12
& G5 E* C0 K% q=========5 o) e* V( A& Q- P" b2 y0 N
- @; k$ H, ]" S2 i0 I. o
This trick is similar to int41h/4fh Debugger installation check (code 052 z# R% [! Y4 u# N9 e$ w/ x. i0 N
& 06) but very limited because it's only available for Win95/98 (not NT)
+ |- ?3 ^" C9 M/ o H3 |4 P# w/ aas it uses the VxDCall backdoor. This detection was found in Bleem Demo.; C2 V t# h7 j/ h6 A, g; v ?' Z
! U' T+ e" I& B# w' e" N push 0000004fh ; function 4fh0 k- w1 R i- I+ X: d. E
push 002a002ah ; high word specifies which VxD (VWIN32)
2 z# n1 a1 a. I0 ` ; low word specifies which service; z" e8 z! b$ b8 g( o
(VWIN32_Int41Dispatch)
' G$ U0 v, D$ `8 w% u7 O @3 P call Kernel32!ORD_001 ; VxdCall; h' Z% ~5 u9 Z2 L M
cmp ax, 0f386h ; magic number returned by system debuggers4 d/ m/ O' p- a8 o
jz SoftICE_detected1 e/ Y! y: S" Y. ~
4 N. U% \& i' i, d* ^Here again, several ways to detect it:
. p" y9 e D$ x+ i/ w, K+ Q: u2 D& X& b; X% O
BPINT 41 if ax==4f
" Q+ D9 _) ] s6 O* ?: Q: N' \. y
2 d% ?- ?+ _- v' A8 }& P! E1 [ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) U7 F3 }- F: W4 V
X% ~" r: m) w3 i( a
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A; R( R2 b7 _+ A$ R Z3 A
# f' ]( j% a2 u# z& s& L
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!7 D, h. I' k5 i" O, w% ~! \
' D! H7 z! P B* L6 c* M
__________________________________________________________________________
% X8 c3 s5 n' @) j& A# r0 {% P- z
Method 132 r8 |6 }; D# g* E1 {3 s) m
=========0 w+ Y/ C/ u2 h9 w' ]# X
& N7 v8 F+ a9 I* m9 ANot a real method of detection, but a good way to know if SoftICE is" c" k3 n. B9 p' V) @8 M4 Q
installed on a computer and to locate its installation directory.
$ j1 j: Y; v9 c# _/ ?It is used by few softs which access the following registry keys (usually #2) :
; @+ U1 j2 r8 Y# }$ ^# b/ L
; Q/ t6 P) f+ r3 {! `7 P-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, O1 D3 `; P% k& f, @" K, u\Uninstall\SoftICE* @: _; ?! E0 g
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE( S; I( e9 J1 g: I8 F
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( T, I# t; o: i- {! U% a/ p4 r* H\App Paths\Loader32.Exe
' j1 P- s* ?% Y$ F
2 a% I+ I+ b6 X F4 O" k1 S
/ b+ A6 d) }" V& [Note that some nasty apps could then erase all files from SoftICE directory
# s( D% d) | k5 h& f' L# _(I faced that once :-(. B/ v+ v- d. g2 {' B5 x$ ?% m4 z
* M2 H: H m y% S N" x
Useful breakpoint to detect it:
, b# w }4 s: j0 I1 n0 v1 _+ d; h) b5 o. j) Y
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
) ]( O- q$ _, v% G q5 \" T w. d1 M: _& P4 b) Y- [
__________________________________________________________________________8 u# _6 O, G. k
4 ^7 Q5 E3 t3 h- p2 K2 R
( u; a, S1 V. c' | x$ e- o
Method 14
, n4 ]. i' I; \=========
$ W2 d/ ]$ w, o+ N& A4 D7 J; V! o
" @6 f7 w. R" }( UA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. N% W; p( O# f4 O @7 V
is to determines whether a debugger is running on your system (ring0 only).5 @* R, w% U- s- _5 N
- M! k" a4 V2 [" H- H: K
VMMCall Test_Debug_Installed: w4 E+ W2 Q* O5 j
je not_installed' _* K' D7 o ~
! h. S' b8 O# ~/ S7 t/ ^
This service just checks a flag.) U7 C6 @4 w% i) F. y$ f' H% J
</PRE></TD></TR></TBODY></TABLE> |