<TABLE width=500>
8 H. U U5 D+ K6 m0 G<TBODY>( B' Q8 x& j9 i) Y6 P
<TR>
4 {, i" W6 Q) E' D3 i7 X6 k/ Q, {<TD><PRE>Method 01 " c. r# A- Z! `( P b3 y+ t2 _% l
=========) y D0 r; P! {6 u; G6 g/ z
8 V; @4 p, D4 q, _! s5 D+ H( J
This method of detection of SoftICE (as well as the following one) is' i( T4 f* e( f
used by the majority of packers/encryptors found on Internet.9 E% S B1 _2 E. r+ U- C$ v/ E& T! {
It seeks the signature of BoundsChecker in SoftICE
# f8 L$ V% c8 i5 U; }
$ A& z- D' f& N mov ebp, 04243484Bh ; 'BCHK'
. g0 Q: Q% K" A! w+ K mov ax, 04h
% m/ p' E3 ~. B int 3
4 j7 p" h$ ^. e0 V# p cmp al,4
! r' G6 B3 D) v: t jnz SoftICE_Detected) n4 g$ F1 N+ Z3 x& m
/ z, i5 W; ^, ^. f___________________________________________________________________________
0 c& I; ]" A- ]: }4 G% o5 U: S I* [' h+ l
Method 02
; w0 G$ L! E F! _" s=========
! I% S& g, n5 H+ P& c4 k e6 q) c+ f' _- h, g8 t
Still a method very much used (perhaps the most frequent one). It is used' X& W2 f! v1 N. D S1 c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,* Y# f3 F1 X1 t$ N/ |& L' ~* A
or execute SoftICE commands...6 w. n. W* ^' R" v) B- ?% F- A# O, r; _
It is also used to crash SoftICE and to force it to execute any commands
+ L1 l# m$ L& \$ t# w5 Z* ?! M(HBOOT...) :-(( + h( N, v' J# I
3 J- a* _5 d: p) iHere is a quick description:
S# I1 ?' P0 Z9 ? c-AX = 0910h (Display string in SIce windows)0 ~& \: }" n# Y" n9 f0 z7 F; M1 P
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; \5 @7 J8 i8 E: R9 P-AX = 0912h (Get breakpoint infos)
- N6 n2 I" {+ I4 T- Z-AX = 0913h (Set Sice breakpoints). o4 y+ N n# l4 F4 X: e2 k/ C( x
-AX = 0914h (Remove SIce breakoints); A' \8 }1 \5 C- e$ N, u- [8 ^: ~' ]
( m: C s- Q' e REach time you'll meet this trick, you'll see:( U! z# H4 ^, x/ w5 O
-SI = 4647h
# |/ n0 A6 _' q) H1 d+ f-DI = 4A4Dh
$ l5 l L. p3 F- f) MWhich are the 'magic values' used by SoftIce.
9 C+ {! i) Z, Z$ A) F8 m: c) |For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ \5 G/ P; r) P! O
- ~# T7 G- A7 g: @8 h- a# m8 l( ^Here is one example from the file "Haspinst.exe" which is the dongle HASP# J8 B/ `4 G' E+ c; H
Envelope utility use to protect DOS applications:3 J, K" _: j; d
" b$ D5 O+ ~7 m: E; }6 W3 r T2 n5 x# U9 S, N5 N1 C0 p6 t, |
4C19:0095 MOV AX,0911 ; execute command.
, t. @9 l4 b6 u4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
% h: H9 e. W% r: n" w4C19:009A MOV SI,4647 ; 1st magic value. W( H; X3 V8 b5 y0 W
4C19:009D MOV DI,4A4D ; 2nd magic value.
2 F1 y- Z2 K; `3 p3 I4 ~- ^, M4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' F$ x X( `' n ^
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 F. N2 X( O; ~7 t) V9 s( x0 u
4C19:00A4 INC CX
" a/ B, Y/ ^- P: y! W1 ]8 ?3 i4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
8 B7 {2 w2 w1 ~- t Q% W4C19:00A8 JB 0095 ; 6 different commands.
/ s( P5 A+ ^2 _* p% k7 F. ^& G4C19:00AA JMP 0002 ; Bad_Guy jmp back.5 n9 b4 m/ N5 _) f2 c
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( S- y+ H c3 c6 L+ ], {) n4 {) H6 O* i/ S2 h1 b/ l) J! v' d8 c
The program will execute 6 different SIce commands located at ds:dx, which* R L" D {. }( s
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
9 ~3 d# ?4 F+ c! W" O5 q6 M, I2 P6 J. Z
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# @ ]; r3 t) o2 ____________________________________________________________________________7 o9 X7 e" X1 M$ r0 g
* v. y/ |7 F% Q2 j
( w) i/ o1 q* @5 x8 x6 U" n+ ~9 VMethod 03
4 e7 a/ I W: x) R6 l5 ]=========
% Y. T U0 Z1 D; d4 w) I( c
" W; C4 p. O$ f* Q4 MLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
/ Y$ F' N, \6 @" _, J- W: F+ E(API Get entry point)" @0 @ S0 W# d! n
. f& ~# o( k$ E% }
1 Y- ~1 D# p. @3 j: ` xor di,di
! m y. N2 `5 Z/ S& U' S! s! o mov es,di
* N7 T$ ?9 J0 [& i7 a$ ? mov ax, 1684h 4 e" B( b( ^/ w6 }: y S; h
mov bx, 0202h ; VxD ID of winice
7 o3 D' j, r$ L int 2Fh
" ^7 Y' W$ `' M8 N- e mov ax, es ; ES:DI -> VxD API entry point
' t9 d4 X8 O; E0 ~# q# w8 O add ax, di
) ^' O% y7 _6 e; V6 r0 b$ O test ax,ax5 ?7 Z, P, ]& K% u# [8 l) h
jnz SoftICE_Detected! E2 E! `) z- k6 O; k: i+ h
. Z: V+ p. I* c; n___________________________________________________________________________
6 I( U' G- a( C+ A, h+ h3 m% {) g0 x1 h
Method 04/ Q. j' G! P4 f: |
=========
: }: I- g4 e4 r! p' v* G6 s2 s) ]% l- i- }" i) w% E
Method identical to the preceding one except that it seeks the ID of SoftICE8 D9 U# u6 `" g+ C4 y. y+ H
GFX VxD.
- B2 `. Q4 a, x; Q8 G6 b! E+ H, l; R* ]7 R1 q/ X X$ k+ A$ D7 x4 ]
xor di,di. a9 K! @" ?! p
mov es,di! G, A. |. C( p' h7 W9 t
mov ax, 1684h
5 N( U6 Z5 a; M6 V+ D mov bx, 7a5Fh ; VxD ID of SIWVID
: m% U( P; |8 X4 v6 i; E' d int 2fh! X3 Y$ o5 o' r) [% d* d
mov ax, es ; ES:DI -> VxD API entry point$ ?3 d9 f' w$ L: y8 A' j
add ax, di b7 s) {* s; F9 |; Y- b
test ax,ax
) Q( t2 V1 B4 ` jnz SoftICE_Detected5 {( |6 ]6 i, ~4 N" K
4 E) Y3 A9 ^; e__________________________________________________________________________3 W9 S! F6 T- A8 i/ c' _$ D
% F9 c, @$ X5 Q& S8 z% N
% o+ c) ]1 k& Z2 [Method 05
9 c/ u( U" X, p/ P! \. n. i" m8 H2 Z=========4 S, H2 i+ [$ K- E, \
, ?! _ _" i) N: z4 y! I# z
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 i0 j5 B! N$ v/ v+ M3 V8 ?# ydebugger. It calls the int 41h, function 4Fh.8 ^. g4 n" c+ j- M/ ^
There are several alternatives. 0 X* e( A, p- I0 ?- \3 J4 F: o
1 q3 t! a, T. w& R2 f1 zThe following one is the simplest:
+ l5 S! {7 `5 p( t2 m0 q: o& [ O: F( i: j% o7 K4 w+ J
mov ax,4fh/ a) D7 t* b6 |6 k7 v" ^
int 41h
9 S9 ]: R1 h# v. C* F cmp ax, 0F386. }5 X4 B5 e# E; v% H1 ~: C
jz SoftICE_detected! [: Z% _) W0 y6 H
: l, A; |% R9 J( w
0 F: G3 P# ? I2 s% `* Q
Next method as well as the following one are 2 examples from Stone's
& S! g+ }% _$ P" X3 o- h"stn-wid.zip" (www.cracking.net):
0 p( y0 w# [6 N$ F6 Z5 g
- \, d* E$ ^# _' N! y mov bx, cs
8 R0 m0 H9 a1 w# @ lea dx, int41handler2
/ T! x4 W* m! H xchg dx, es:[41h*4]
! i6 ~3 }5 m' O n% O7 K: Q xchg bx, es:[41h*4+2]
0 l# Y: S3 |2 [# V& n: E* H mov ax,4fh
* r" E: X* D# Q: Z int 41h
/ w+ y/ C# _* U/ I xchg dx, es:[41h*4]7 O& h/ q& o2 x" ]( B4 v
xchg bx, es:[41h*4+2]" g% E7 B6 a7 m% j
cmp ax, 0f386h
4 `4 ^5 G/ o& F3 o! C% c# I2 t* b jz SoftICE_detected
5 W E# e& _) p1 v# w5 ^1 e! }- \1 s0 C, F, B' g7 u" e% F. S1 L; J
int41handler2 PROC M4 J; D6 k8 V
iret
; Z/ f7 q0 X% E) Oint41handler2 ENDP2 y$ w f, p: {. j0 {! }
- D+ J5 V3 t3 w
7 E8 A* D b5 \+ E+ G }
_________________________________________________________________________. i2 @) @1 I- L. Q8 u/ w' s
9 n( F/ e1 y6 P9 R8 |% Y7 {
; j) B7 R+ _. F9 M. M& sMethod 06% I8 J' D; i, S
========= B2 T+ ]2 l6 F0 F0 v+ e) m
. R/ o% N" ^; v# \3 o9 E) r* y
- N @+ G; V1 i7 s2nd method similar to the preceding one but more difficult to detect:( p) V: T- @8 H1 `
* E, ~, H3 S5 }+ \: s8 M- ]( Q
! I# T, N& v: a9 t F4 g% Q+ @& E& Qint41handler PROC
3 p; g; t1 f! o0 I* O! \+ c% t mov cl,al: ?8 v4 c0 Y/ f9 g* W2 i: B
iret
9 H6 b$ p3 I$ s# {7 ~4 Dint41handler ENDP' q$ s& Q6 @" ~( ?1 v
' ]* v6 L0 n, u- L1 l
; b+ q$ y" ^# W xor ax,ax
/ J+ d' y) V4 f mov es,ax* N x" `3 S/ X; B
mov bx, cs
5 p: |8 C2 h% P1 _4 A, ] lea dx, int41handler2 K) W( q A4 V8 e! X" f
xchg dx, es:[41h*4]
) _/ w# P" h* |" k9 O) Q xchg bx, es:[41h*4+2]
& G/ }4 \# N& Z+ Y' W% g4 f( }: X in al, 40h
2 j+ R% t' ~3 {' O9 J xor cx,cx/ g( ^! g$ Q+ T$ |, A5 w" ~$ {
int 41h
0 n& ~2 G6 s8 E4 g, k: b4 o- X1 w& q xchg dx, es:[41h*4]% L6 ?2 f; N5 B5 R
xchg bx, es:[41h*4+2]
9 n1 [9 N5 q+ }5 U1 J4 L cmp cl,al" M2 ~# c( U5 S1 ]; c- w
jnz SoftICE_detected4 s. R/ j6 e5 s( G0 Q% Z
W u8 m. F; N4 }5 @) T_________________________________________________________________________$ |9 S% z6 _0 ?# g' v! T M5 d
# [ d/ I e& G$ Z0 e1 \, wMethod 07
3 O, }4 l" a+ w8 R=========
( H$ A' d8 v, V' x
6 U) f+ p/ ^7 k! yMethod of detection of the WinICE handler in the int68h (V86)8 C1 W& C5 z7 P; E _ {
6 t* I% L' L8 C4 {" Q! [% P0 ? mov ah,43h
- r- R/ z) {/ t% j int 68h
. N: R4 d* R* q/ G cmp ax,0F386h
! `: w/ [% a- {7 x' Z jz SoftICE_Detected# u, s" X' Z* r4 r1 m
. c" i, X* p) p$ A" ~5 c
8 B# h* {$ e1 c% ^. L=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& v6 _+ O+ Y7 w* c5 m; L7 d
app like this:
1 f+ q8 k5 j( ?# E8 ]
1 r) I! Q) ?# z! T) }5 f1 Z" i BPX exec_int if ax==68
% W, i3 O, E: e- m9 x/ R* o3 q8 b. t" K (function called is located at byte ptr [ebp+1Dh] and client eip is
4 Z0 k6 Q$ y& l7 l located at [ebp+48h] for 32Bit apps)
# c6 A, w G: C. b0 J8 \# p* i__________________________________________________________________________9 j' y( W0 E. d, T+ V6 y, D* p
) I$ b# v. p( T5 E$ z
& _$ x7 W+ y9 B8 m" o+ b6 XMethod 08
/ H- j9 r, y# Z3 D6 z=========* s) F; K$ \& L; X
, B7 J- Y. Y( i a
It is not a method of detection of SoftICE but a possibility to crash the+ ^ R$ M, K5 j8 p
system by intercepting int 01h and int 03h and redirecting them to another, U# d, u% U5 P
routine.- s, `3 Q- ~- o1 h: Z" @
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) V& F. h' [9 ?0 I& y) i
to the new routine to execute (hangs computer...)
, V2 g X! o9 I9 n6 k+ D& e1 U
" M' Z/ k+ f7 f' r' K' X mov ah, 25h/ ~( |" {; Z7 c6 ?6 ~
mov al, Int_Number (01h or 03h)' a( S1 Z5 ~2 { D/ h3 r- B$ g
mov dx, offset New_Int_Routine
" e6 r# {7 P' |2 c. q8 _" H' C; Q& C int 21h
7 N' l) c8 @. a* s! [8 E: \/ N3 T$ H5 J
$ {9 I9 p; N. P# _# s# N__________________________________________________________________________6 h$ B) W- }1 l+ q" S# v
! J7 I( W. E, |Method 09
" ^4 f0 f p4 u& F3 T. k=========
( w0 M! V! W, a& \7 P2 @' _
6 g( ?; h9 R8 _% [" L& GThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 _: d$ {3 b6 ], E% z1 p7 A# f+ l5 g
performed in ring0 (VxD or a ring3 app using the VxdCall).
3 @* z$ T+ ?4 z9 s9 ]0 h; _The Get_DDB service is used to determine whether or not a VxD is installed
2 ^; M; E2 i8 J/ A# jfor the specified device and returns a Device Description Block (in ecx) for
( I% I+ m$ J, Y" L- m+ w7 Athat device if it is installed.! M& \3 l1 |5 I$ N! v# P: l! W
/ r3 T" U( c7 @) ?
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
+ E* Z4 \5 q5 f4 D mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 M- m& u, @" l" G VMMCall Get_DDB
& c, M; N) |3 e _. c mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
0 ]2 {" ~7 f, g2 v6 k8 P, C9 E. U# | P& S: A3 j7 T
Note as well that you can easily detect this method with SoftICE:
0 i1 J$ j# V! j" R# v5 h bpx Get_DDB if ax==0202 || ax==7a5fh/ B6 d: Y. l h" ?
3 i6 ]5 q3 S8 ~' b& J+ f
__________________________________________________________________________ l9 z* C/ A( x4 W2 a: g, w* s
! ^$ B6 k5 D9 I9 S* ?& eMethod 10
$ [; r/ N6 Q* Z* t$ @, y=========5 l! Y+ v2 b; @( V/ a9 k$ {
+ M; c* i! ]) `; ~
=>Disable or clear breakpoints before using this feature. DO NOT trace with
0 J9 q7 o- ^, j0 X SoftICE while the option is enable!!9 G1 @* s+ h/ t3 H/ k
2 d4 d: a- J: A9 `- R3 vThis trick is very efficient:
U9 {, Y' X: ]/ N( ?by checking the Debug Registers, you can detect if SoftICE is loaded o, I& W# a0 [. S) o2 p2 j
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 I9 w8 Z% V1 x& t& Y' S
there are some memory breakpoints set (dr0 to dr3) simply by reading their' {" H" w: R- |9 Z9 E% B
value (in ring0 only). Values can be manipulated and or changed as well
; C y' d1 _! S/ r* B. ](clearing BPMs for instance)
+ e. W; ~) h& Q7 b* H
9 O3 {+ ?0 M, V0 {% B__________________________________________________________________________" V) W) D9 U8 c7 `" G/ L
" I! _; G0 W0 ]+ m: g( V
Method 117 Y; i7 R5 @$ @5 {& g
=========
+ `$ o3 k# A; u# |; \$ D1 ~# {3 F; b$ ]! I+ T; D
This method is most known as 'MeltICE' because it has been freely distributed
8 @; w$ a- Z0 @* U% e! _via www.winfiles.com. However it was first used by NuMega people to allow) c1 K5 m' b% C( a5 j: ]8 P
Symbol Loader to check if SoftICE was active or not (the code is located* F3 O4 W& l3 r" c) M) r4 t
inside nmtrans.dll).
; `& v$ N/ e8 u1 L: S% L A b1 [6 V
The way it works is very simple:
3 r0 `. s3 X+ y7 ?It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 S; h0 ]$ f, S' R! O- ~* lWinNT) with the CreateFileA API.
, R4 g7 d& E9 f9 u+ m+ E5 v5 f% y! M: _' \' O
Here is a sample (checking for 'SICE'):$ e! I7 f2 Z# I4 H
5 e* O# D Z. F; B c* mBOOL IsSoftIce95Loaded()/ M& v- ?# f8 i& h3 a
{, [, D& g! h# C9 m# @
HANDLE hFile;
& L, y8 V( c. B7 f+ b& i hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: {% t$ i( F9 K# K" S, v0 I
FILE_SHARE_READ | FILE_SHARE_WRITE,+ g# R8 B" e/ y: J) ?" t
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ E; E6 w% R0 c& [& f) W# r
if( hFile != INVALID_HANDLE_VALUE )
+ O9 O3 O( t4 c" X4 O5 \& t {
# ?# |1 t# i% ` I CloseHandle(hFile);1 L. s$ Q' j# p0 l
return TRUE;( [0 b% p. o5 ^) N
}
1 h1 X4 u$ S$ H/ T0 E" c$ F( F return FALSE;
" K: ~2 F) A5 h}2 D* Q1 Z* X$ Z# G+ \; S. S
' a. x9 P0 K7 Q V t6 n, J7 [! }
Although this trick calls the CreateFileA function, don't even expect to be/ C2 m& l6 P6 E8 u, z- W$ s
able to intercept it by installing a IFS hook: it will not work, no way!
" N6 l5 Q4 [4 g7 s2 D8 pIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 b6 \$ j5 V4 [6 N% ~# b$ V& H" Wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)8 m0 K! h: J C2 e; e/ f- x7 `' B# V }
and then browse the DDB list until it find the VxD and its DDB_Control_Proc6 h1 [9 U0 y, y0 n$ j+ i
field.
4 S# N, o7 t0 R+ A- vIn fact, its purpose is not to load/unload VxDs but only to send a 1 b6 k: N2 P5 F
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 S; b o2 M$ J% G' a7 vto the VxD Control_Dispatch proc (how the hell a shareware soft could try% y7 C$ D8 |9 v" c$ n
to load/unload a non-dynamically loadable driver such as SoftICE ;-). \$ Z! q# f, ]5 e2 d) k' l; A/ I k
If the VxD is loaded, it will always clear eax and the Carry flag to allow, @/ f+ I9 A, _
its handle to be opened and then, will be detected.
: E: v+ o& J3 w) s, ^' q WYou can check that simply by hooking Winice.exe control proc entry point+ Q. _$ t. m) Q$ M- Y
while running MeltICE.
8 g5 v* B; g9 P5 L; X$ k
1 ]( R) {' y3 T
. L* V. V# b$ _. A7 e' H; c k& w 00401067: push 00402025 ; \\.\SICE# [: @7 a7 @, r1 v, k3 `; Y# X
0040106C: call CreateFileA
. f {2 t2 z. K& G; n' W0 B$ @ 00401071: cmp eax,-0019 r4 Q9 v- q% l) p9 h9 w
00401074: je 00401091
4 H0 A3 f7 b# c! p/ S q P0 O5 a4 w8 f1 N
! { H* A j6 V' L G4 ?; {There could be hundreds of BPX you could use to detect this trick.) ]2 R k& p! r" J" [+ n% e) {
-The most classical one is:
. ]& K; {* F2 j* J- Z BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, {2 C9 e7 L+ O [7 Q! ?: A6 V# ]
*(esp->4+4)=='NTIC'+ Y; v# L: ~1 Q- \: M9 |* R @
. E4 A7 {! ]5 B$ w* k) G* \8 a
-The most exotic ones (could be very slooooow :-($ T$ |9 W$ h a; ^0 v. q% b
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 s b, N# f) [0 M, e7 }3 I ;will break 3 times :-(& R7 n- \" _' I$ S8 j
5 Y7 N5 z' M1 O- \; n
-or (a bit) faster:
0 k* O) S5 I* J% T& C/ e1 i BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ D8 w2 T6 E; X# Q; U
: @4 o5 I# d- o. U6 q6 k7 m
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + n' L7 F& Q& d {0 u
;will break 3 times :-(
; |6 }7 j/ C- `1 H% o! J1 V' `
! O8 _% t/ K, D% p# R8 Y6 F, d-Much faster:& J8 X8 f# `" N/ k) A/ F8 o+ [* `
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 W( G3 f; P4 V. J; r$ P+ [6 {9 G. S S% ~8 U# ?: F% }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
* u& T' l8 Y& E2 E. T* `, v: C$ ^function to do the same job:! t2 W9 M& L0 T6 Y
# y3 ~/ x& t( w push 00 ; OF_READ7 m4 J) |' w) B1 f
mov eax,[00656634] ; '\\.\SICE',0
- K9 ] d; H6 t) U! O+ ~, G push eax
2 B) h1 H7 p- Q call KERNEL32!_lopen4 ~# t; V: R1 u+ \1 z
inc eax f, U. M3 }* a8 s0 T' X) M
jnz 00650589 ; detected/ X# A, T5 c( J) r9 w
push 00 ; OF_READ' D/ m2 ?8 p1 j$ W0 c" B' c/ a
mov eax,[00656638] ; '\\.\SICE'
7 }5 x# V+ R9 e' V& D3 |# I" I5 d push eax/ ^+ q0 O* Z+ X) d
call KERNEL32!_lopen$ [0 J0 H3 r3 o, S5 i5 c
inc eax
+ W2 j4 u6 K, t/ e jz 006505ae ; not detected3 @$ D+ L h, }0 M+ P( b
9 {4 ]7 v3 [) k+ X0 ~7 ~ S+ B9 Y9 s o+ q
__________________________________________________________________________
+ w+ L5 Q) E7 r" U) {/ [8 u) Z1 j5 W" h* v1 \
Method 126 c; D0 H& X) T- q: ^$ ?" C9 f
=========
; _" `7 D# M6 ~
: t& u Q( S; e# y: LThis trick is similar to int41h/4fh Debugger installation check (code 05 W. @/ ~0 @ @3 F% q2 `' |
& 06) but very limited because it's only available for Win95/98 (not NT)
, i3 P+ u( ^! has it uses the VxDCall backdoor. This detection was found in Bleem Demo.+ ^' z3 k8 f1 u6 F
+ x1 ^8 m1 E* \ ? push 0000004fh ; function 4fh9 c3 l3 R! I4 B4 o3 ~! P( }; u
push 002a002ah ; high word specifies which VxD (VWIN32)& a" B2 Z6 t4 O
; low word specifies which service5 |( i) w( F5 y$ K# k8 W( @, t
(VWIN32_Int41Dispatch): c# X. T4 D0 A" {4 T# J N) m
call Kernel32!ORD_001 ; VxdCall
- r) S2 g; P/ q# |$ g4 ~ cmp ax, 0f386h ; magic number returned by system debuggers
1 f8 f$ ^: b# c5 I/ o8 T jz SoftICE_detected) V0 c+ F; u) y7 V
* a8 q+ J, r, d$ fHere again, several ways to detect it:
3 L- p: r8 R4 w6 l) o) [! l( i, [4 f' ~$ Y( G6 v7 `
BPINT 41 if ax==4f8 x1 n, E4 T6 g( y+ x7 n$ H6 D
: h4 j( V1 T) j) j+ [5 T! d9 W
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
6 c0 e4 m' F3 s$ Y! N# l
( W3 A8 Z, P/ G% U! u/ Q/ r BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 y: K- W4 Q: @1 h- @+ |
% z; R( c3 S- X2 t$ B
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 T+ D! E: |, C) K
( J( H; w+ g) o/ @0 N7 E: C( u__________________________________________________________________________
* `0 Y" |) M* J4 D6 H- n; |
& }: l" D- Z8 b- y" ^Method 13
4 A% `. F7 @0 X# K=========4 H; k$ k: P3 t( s. G$ F
6 O: t1 J3 h2 A" t; N$ u( E
Not a real method of detection, but a good way to know if SoftICE is
' E9 w$ g& j5 V1 ^# `3 d- C# \installed on a computer and to locate its installation directory.
& E& W" Q" R1 y0 q. |It is used by few softs which access the following registry keys (usually #2) :
: s' o+ p) d) q! b/ x
4 L% i- M! `: M" w! _-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 X, R: @1 ]; g6 V9 |\Uninstall\SoftICE0 L, q' P) M3 b" N0 [" ~2 W
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
I7 G; i6 f* {" Z& |$ h C: ~3 S-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 |) i+ [- w% d' s3 ]3 |! a+ j, ]
\App Paths\Loader32.Exe, l9 h$ R" Z( H2 ^2 Y
8 U. z ?. {7 ^" Q
6 E8 v; H, e3 U" \Note that some nasty apps could then erase all files from SoftICE directory
5 p5 Z3 B$ d# J+ E0 k7 s" y(I faced that once :-(( Q% [' n2 G2 L) [8 m1 V$ H
* }% }8 e0 j5 B+ [/ @% U! ]: YUseful breakpoint to detect it:2 Y+ o: T( ~* \
2 \% z" r7 I: H, P! Q( D/ L( p BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
, n! Z/ X- ` E5 F9 ~5 ~: _2 T0 u7 u5 u3 ?2 i; E
__________________________________________________________________________* s1 v1 v7 k7 o
4 f3 `" `6 q6 Y
4 X0 G8 ?" G% ~5 s3 U- P
Method 14
: A: w4 r! w1 C& L=========8 l! F, {7 n8 @$ l
& n0 | {1 Z) `2 c0 p7 ?, R, ?A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 F7 D1 ~8 E4 o8 [is to determines whether a debugger is running on your system (ring0 only).
0 ]' {5 t3 l8 m4 O6 l2 {% @! ]& b1 w+ \- m+ Q3 u1 Z: @$ C7 J
VMMCall Test_Debug_Installed# @) O& e: e- m G% Y- T
je not_installed% j* z& o) h2 N4 @3 ?0 p
4 B$ d" {8 e7 i' h/ f
This service just checks a flag.
! O# H8 S V* y+ Z</PRE></TD></TR></TBODY></TABLE> |