<TABLE width=500> V0 r4 L, c) Y3 e: Q4 Y) N) z/ A
<TBODY>5 v7 C7 W% S1 J+ z
<TR>2 A n! s O9 [6 r* _' B' R
<TD><PRE>Method 01 . N' b* c# E& F/ w
=========: z O( v. c4 ^4 }: `9 w
9 I" Y; ?: i6 `8 Y2 uThis method of detection of SoftICE (as well as the following one) is
9 c6 @* l+ d* @$ |" ~used by the majority of packers/encryptors found on Internet.
& s: k- U3 x7 T; a! e, {4 `It seeks the signature of BoundsChecker in SoftICE! g k2 [, h3 v
6 J* ~' l! j- F
mov ebp, 04243484Bh ; 'BCHK'( c# [7 _6 Q4 n0 O/ w& \4 A2 F
mov ax, 04h
, ^4 `. q* D$ I int 3 & Q: u: ~" S. a
cmp al,4
8 g' `! [9 C v jnz SoftICE_Detected
0 C* }. M1 d$ N3 ]: G* s$ X3 T* r/ [$ n# U" T# R
___________________________________________________________________________
0 j5 A1 }0 T- W5 Y7 o/ \- I: P/ I2 K5 O/ p
Method 02 `! N. W, `7 P
=========
3 r- @7 r; } Q0 F: d+ ?/ \- M; y( Q \9 C3 {2 e8 E
Still a method very much used (perhaps the most frequent one). It is used
. j; j# G4 [. \, o7 `8 W! r% _to get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ @" h. p* C6 d5 U5 D3 ?5 W
or execute SoftICE commands...
+ o& P9 k- a3 `3 @& c1 j) V: AIt is also used to crash SoftICE and to force it to execute any commands
1 O6 I# r9 t7 u$ E. p# Q(HBOOT...) :-((
0 K% E% H/ d& f9 t) A3 l/ ]( g A2 I
8 o1 L+ A- r6 W+ ~+ b! }Here is a quick description:5 H- [3 |: n# G; R( }; W5 i! q9 Q2 H
-AX = 0910h (Display string in SIce windows)" `+ w9 e. d) J; Y& h6 {9 [
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)/ y) h1 W) o+ Y- ?8 M
-AX = 0912h (Get breakpoint infos)9 Z$ F! u+ C$ t% t, }. s1 D
-AX = 0913h (Set Sice breakpoints)
" ^- P% V/ g8 S, @1 p [-AX = 0914h (Remove SIce breakoints)- L( j/ N% |3 L; I: ?
# s7 ~9 L; w0 x8 A7 y9 ]
Each time you'll meet this trick, you'll see:
+ Q, ^' |+ Z, u& q* B-SI = 4647h
% ?0 o3 N) a- K- Q8 [7 H-DI = 4A4Dh- u% u7 Y& I7 v% T9 a% m
Which are the 'magic values' used by SoftIce.( C: Q" ~7 d. }
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: g+ m3 T$ y# m; R) B# r$ v. c7 c6 g
) \6 O" _. w. J5 j9 OHere is one example from the file "Haspinst.exe" which is the dongle HASP
; p) B; | s' V) S( fEnvelope utility use to protect DOS applications:# s3 r2 K c7 ?$ N0 W
0 G2 A: h; ]% F3 v( g/ L( Q4 L6 z# J- \/ U9 a2 i
4C19:0095 MOV AX,0911 ; execute command.
3 B7 P/ c6 b) ^* f3 d4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* |- U7 Q3 d/ t
4C19:009A MOV SI,4647 ; 1st magic value.
. m& S) K0 S% j) q* p) S( a4C19:009D MOV DI,4A4D ; 2nd magic value.: d* |0 E6 ^% E
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
. ?3 P, n# F% v' A# b0 h: ~4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
# ^& q+ V. N) l$ U: f& n3 b3 c1 ?4C19:00A4 INC CX: p+ @0 ?1 }7 M
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 b# P8 V9 X0 R8 g3 f$ Y' r
4C19:00A8 JB 0095 ; 6 different commands.
/ H1 a/ {; W- J7 n9 }4C19:00AA JMP 0002 ; Bad_Guy jmp back.& n( J4 j' ^. y, F' A7 B- h( @
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
8 J% P: h! g$ W3 D! U+ ^
1 L' P. A' A! m' L# EThe program will execute 6 different SIce commands located at ds:dx, which
( B2 j$ q- E, G7 bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' A5 P% V) y, y: ^) z7 u8 v- K" D% B% e+ t4 z% x9 ~1 p/ G
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., L+ A- q. P8 y# K2 _
___________________________________________________________________________2 V0 S# }8 x6 L6 |
, [4 ^5 r# E+ X- ^. z1 b
+ ~1 W/ C/ j4 r0 ^) i, J/ xMethod 03
& w# S/ x, [: w D ~=========
5 C& h: w) \1 U$ ]$ ~
( R' _, v2 l$ t. t+ m6 DLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
$ G. ]) A( E8 n(API Get entry point). a. |: ]/ t9 \8 I R
& `7 n* C0 L$ Y a
; Z! m, A3 _ n1 C* \" \4 Y- V xor di,di% a. h/ w# r4 c! O; e% J8 |
mov es,di+ {( Z1 ~/ Z, S, q7 G
mov ax, 1684h
+ Y- |. q F" ^3 _& I( L8 ?5 X ^0 j mov bx, 0202h ; VxD ID of winice
3 p/ U* D- o% _% A. b2 [0 I int 2Fh
2 R$ }2 a) }! x" D/ L mov ax, es ; ES:DI -> VxD API entry point% D$ b$ Q3 e1 j& A b+ |
add ax, di
, ]) v: ~/ n; {! v# B I test ax,ax
; C+ K$ n( W4 D' h: S2 s7 t' \ jnz SoftICE_Detected# g5 {. Z( S0 r
6 n; n$ h" c0 A+ \___________________________________________________________________________
$ b+ s( w( B) p0 ~" s) v9 S
0 e; E: O& D$ u- J/ ] c! @Method 043 \, X$ T0 {( v' K
=========
: i5 R7 t3 J, `* J
* ]$ C% |( B# R) y5 F$ q xMethod identical to the preceding one except that it seeks the ID of SoftICE
; E0 E* N! |& U8 u/ H; TGFX VxD.
4 _& U2 x' q; m; P5 m8 x& P/ }) ]7 [) m* x% B
xor di,di
3 V+ C- x/ C& G" i) w mov es,di
7 R& A$ W( ]$ L# E9 Q2 E% m mov ax, 1684h
: N' L: n( c3 h1 o5 K! M mov bx, 7a5Fh ; VxD ID of SIWVID, T3 e2 Z. Q2 o; \- k
int 2fh
5 t( p0 ?$ F2 w* G [8 {- D mov ax, es ; ES:DI -> VxD API entry point
1 Z7 K9 o; o2 G' s c* v add ax, di
+ Y* o4 P7 g! V0 o. N- w# N; Y test ax,ax) Z/ |. |3 W \8 N# ]" p$ V" ^
jnz SoftICE_Detected1 c9 s* a5 U1 y7 Z n' x
0 y; q' H- ~$ A5 J8 [__________________________________________________________________________: c" b I" f- e. A/ v( S
7 r7 f) k8 u: ^% x: z1 a/ s) P4 K [1 `
Method 05/ a* \3 j9 J9 r1 Y
=========
5 G+ T8 c ]' I# w: O
1 {0 {9 M5 r9 ~- C( k6 I; {Method seeking the 'magic number' 0F386h returned (in ax) by all system, l& n1 a1 M9 ?/ p
debugger. It calls the int 41h, function 4Fh.4 ~5 f' u& z4 h$ i5 c0 T% o. W
There are several alternatives.
7 w. c0 A2 u/ z. J3 n2 l$ f( _0 A& @; K4 G7 x$ O
The following one is the simplest:, }" f4 Y* `. N4 \- B7 L& H
) F3 }1 _1 J$ a* ]* s
mov ax,4fh2 Q, E: o4 S* D- s6 E3 C
int 41h. o4 n8 s0 @ k" O$ W, n
cmp ax, 0F386) @. x/ E1 x: \
jz SoftICE_detected* @3 g5 f1 `3 Q2 r
! }* t' v3 k4 I' L8 Z- t9 C- S
9 M0 C; t0 H+ M+ H! Q8 LNext method as well as the following one are 2 examples from Stone's 2 G, R2 r* b1 W. k! P- l5 F+ m
"stn-wid.zip" (www.cracking.net):& H) B ~8 C: C! G+ Z' @
# A) Q# @' n7 T. a4 x/ Y4 F' a. b% s
mov bx, cs! }- [0 L# |' Q y+ ]/ Y
lea dx, int41handler2 o+ G. S1 s; k9 a
xchg dx, es:[41h*4]; C& n, k8 }3 E) u& T
xchg bx, es:[41h*4+2]( ^6 C% d/ S" l1 `" n' b0 y
mov ax,4fh) ~; y4 u! r# v$ c
int 41h
4 K( b/ \; l* V8 {1 t xchg dx, es:[41h*4]6 q7 w+ r+ i8 e/ |, \/ s- p
xchg bx, es:[41h*4+2]
' K# J! H$ C4 U1 o0 |! u cmp ax, 0f386h7 ^7 [8 M$ Z( q9 ~
jz SoftICE_detected
/ ]0 ~7 b8 t; H% t& n: h; M8 `: y
int41handler2 PROC
, s/ l$ p( t4 Z' `7 F iret
; i! u5 t+ o$ j$ E+ d2 Dint41handler2 ENDP
9 z) ?; m1 }8 {, b1 A9 O6 g" B* n" s( G* S4 j5 M7 x
8 p* \2 P6 m7 \" A$ j8 ?* t" a8 i; y5 O_________________________________________________________________________
, }5 [! o& |& P: R& S$ [$ Y+ ]; [8 u
. C- g7 S: `7 \8 {# H' Y
Method 064 y- V! L$ H1 x( e
=========& H4 h4 g$ B+ T5 L) Y: N
4 A, x: B+ h& k
- J' Y# p2 k/ s# Q! g0 P
2nd method similar to the preceding one but more difficult to detect:! X) v, k- ^' ?8 H
+ T2 A% Z( N0 I# k3 s4 _+ e8 M
) A) m y( Z* n2 _
int41handler PROC1 F1 w. y1 d1 J; n* g
mov cl,al
6 i g; E# P. L& C5 Y iret
# B- c0 \ _$ `+ h vint41handler ENDP
W% a9 a9 w; W3 G. X8 r8 q$ u# b
1 s% \* R8 y7 S( M U5 k
xor ax,ax+ \8 H9 ^+ \) T" L
mov es,ax F4 A0 P; [ \9 y; \
mov bx, cs
, M& Z+ p1 p p; z lea dx, int41handler
+ j T% }$ u: d& c' ?' @3 x" Q xchg dx, es:[41h*4]6 V/ F; V$ n `7 c$ m* b
xchg bx, es:[41h*4+2]
O9 P8 C) M P( o in al, 40h' a. Q0 V" i! z: X1 }; V+ i \# R' Z
xor cx,cx; ^1 g! D( O2 Y8 s& Z8 x
int 41h
7 | ]' @6 {: x; X. |& ]4 s- h/ b& p xchg dx, es:[41h*4]
7 a, o/ r3 l6 t3 {8 B$ `$ L xchg bx, es:[41h*4+2]5 l( Q; f$ l! a+ m5 P8 ^, y. E
cmp cl,al
7 W2 S" J3 r# {- Z7 g! x jnz SoftICE_detected" |; v0 S8 o0 L+ Y& ]3 h% ?
, }% f% O0 d7 c+ F) N: ]
_________________________________________________________________________9 s) J4 P' F1 \+ E& e* m5 [% {" |
. D- ~" }9 d: g7 a5 u4 XMethod 07
) e- c4 S7 A2 i8 i=========
7 [9 \) X. p$ Y: j5 |0 {
7 m0 ]9 F8 c7 w+ ~; _1 qMethod of detection of the WinICE handler in the int68h (V86)
, f& k' v& I0 p4 Y+ U _! u4 v; t- x3 Y' M8 K1 M
mov ah,43h; {0 G! i7 r& _2 r3 d3 y
int 68h
8 Q# r# M# K2 W& `: w cmp ax,0F386h" N( V+ r* O4 [# A0 w5 h
jz SoftICE_Detected3 H! a2 D" q, t" o( y( C/ P$ e
( R' e! u9 G: |9 W3 g" c4 ?% X# D0 @% F- n1 [, K$ B* d# L7 W' S; s8 x
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ h7 Z3 [& ^! n" y& i1 u- z/ t S app like this:- _% j' E7 I& T4 v5 I
+ {$ b5 W" K E$ v7 c3 i BPX exec_int if ax==68
* H. }) D8 D" U4 L6 p (function called is located at byte ptr [ebp+1Dh] and client eip is4 V5 g( K( f' @# N Y
located at [ebp+48h] for 32Bit apps)1 y# E1 V. A0 V |" s
__________________________________________________________________________: F" q5 T1 ^; A
' ]' P. j: S; I8 I9 K! J
/ F7 `7 S4 t& [5 lMethod 08
' f$ s0 V$ p W9 B& _=========& t8 H3 L! d9 o" v4 v% |( r; w W8 p0 \
% }9 M" D4 G- |. M U4 w+ @
It is not a method of detection of SoftICE but a possibility to crash the2 s& \! @* j# _) @
system by intercepting int 01h and int 03h and redirecting them to another/ {# n, x7 |' t' f
routine.
& ~) x$ R4 M- Q9 T1 I* ?$ bIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) _% O& k2 \+ w
to the new routine to execute (hangs computer...)3 V* l$ n6 G) }' R: e
9 g8 B: I& [7 s [; R2 M
mov ah, 25h
$ t0 o) a' d' l! i3 O6 Q7 R mov al, Int_Number (01h or 03h)
$ g7 W) z( s; H mov dx, offset New_Int_Routine
c) w" B4 f7 x7 I( f) _ int 21h
* {8 d& G& l# L- c8 w3 ~$ {
. W4 l/ X4 A! r6 y* S0 ?/ \- J7 J: Q__________________________________________________________________________
& _( u$ s' A% z6 K7 b2 a: a$ Z/ _' m" R
Method 09
4 F6 x- B. f& K. w1 c( `" f=========
+ m+ y2 x/ m. N( C- ~9 S# a( ]
8 ]; n# O2 q; J1 t1 tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only; o# q! ~9 v# y2 m7 I* \6 R# ?
performed in ring0 (VxD or a ring3 app using the VxdCall).
$ c1 _9 i/ Y% \% d- fThe Get_DDB service is used to determine whether or not a VxD is installed
3 w3 a. d D+ Ofor the specified device and returns a Device Description Block (in ecx) for
9 G9 ^' N) G, R- sthat device if it is installed.
. L @5 ^+ N/ }4 W! e7 I/ ?6 {: u' O, T, ^- g/ v
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 f, o6 T% _$ A" l
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 x5 z2 Q% M) E2 L3 L VMMCall Get_DDB
: j- }/ O) w+ ^4 o& L0 t5 a3 h mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 b% v: c6 X! G7 \" d1 W+ E. A. g) H
Note as well that you can easily detect this method with SoftICE:( j2 h | e. z5 O: M- g
bpx Get_DDB if ax==0202 || ax==7a5fh
8 [' w1 U0 [. }$ m) J: _3 @& @- E! g8 {2 r7 U9 ^+ O: C
__________________________________________________________________________
* p; d+ N4 d( a& k! O$ R! M3 c; _1 M" s
Method 103 x1 e& v0 y, h( O, L5 [
=========0 m( v* x! e# m: o. |$ r! o4 b
: \- P5 a/ z0 t5 ]=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 E5 |2 r) F: Z8 C, E/ W. @ SoftICE while the option is enable!!& g0 L. g% u* Z4 ~
0 L$ i2 H, P2 b* ~' [2 f
This trick is very efficient:
0 z! t# [: f+ x( l5 ?by checking the Debug Registers, you can detect if SoftICE is loaded* x, N) O. I8 R6 d' o
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
% b0 U. J0 q4 [& \$ A. W4 L; U1 T4 X6 Gthere are some memory breakpoints set (dr0 to dr3) simply by reading their
" g9 v$ Y8 \2 J" K) R* K/ z/ @+ e" ovalue (in ring0 only). Values can be manipulated and or changed as well
+ q) ]+ E, K8 [& x2 n(clearing BPMs for instance)" W% x8 n! H) B3 e# D3 Y
`; {& D" k( G8 C+ I5 j2 G__________________________________________________________________________
! p3 d& l5 h* L" r6 i
1 N- }) W5 l+ `( ]: H8 N# TMethod 11
, k+ t) l/ W7 S6 _5 a: j=========
% y6 N0 [3 Y- j( v4 k$ }+ E# X9 A$ c5 Y- Z% y1 ^2 _8 Q( Y
This method is most known as 'MeltICE' because it has been freely distributed
8 d! W# p. q1 o4 Qvia www.winfiles.com. However it was first used by NuMega people to allow
, l, n4 {2 Y. H/ Q7 c( y6 ?& x m) `Symbol Loader to check if SoftICE was active or not (the code is located
" ~$ z# d' h, k0 i' H( |inside nmtrans.dll).0 ?1 `5 p; C* o: i1 g7 z1 K
- F# S- o+ o3 x+ v% z, |( U
The way it works is very simple:* G% C, P4 V, N, T( I0 t" C" S. A) [
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for: g( Q) ~- } t# X
WinNT) with the CreateFileA API.; Y' ?6 E7 }$ z0 }7 Z7 c; v
. Z$ R$ d+ W+ A( d/ V/ [
Here is a sample (checking for 'SICE'):5 b W! v |" }1 r
1 A# ^; s k' Y7 t0 O3 u5 d1 {
BOOL IsSoftIce95Loaded()# i3 H7 ^! I3 y. K, |& i
{7 Y1 G9 P0 K; t3 Q" D# u
HANDLE hFile; ) v. j- U- _ y% L( L
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" [. C$ [& p" _$ e. {3 i' q FILE_SHARE_READ | FILE_SHARE_WRITE,
: e! f2 Y6 R9 J6 D NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 y: f G7 U- t1 _. V N5 @% |8 n
if( hFile != INVALID_HANDLE_VALUE )
: q* C4 F9 N3 y( O" X {
% Y. u3 x& N/ W7 Y# b T1 u CloseHandle(hFile);' E; }' Q6 A- ~' ]" L% i+ _
return TRUE;+ J \3 \+ _8 c/ ?5 r
}! ?7 e5 R! c9 i
return FALSE;
; }7 z# U! Y; v4 e} O& G+ Q @5 Y" Y* ^' e% k
9 N, g, N+ m4 p5 o$ a; D% A7 [6 g
Although this trick calls the CreateFileA function, don't even expect to be; `6 `8 f4 J! |8 H- y# I
able to intercept it by installing a IFS hook: it will not work, no way!$ u$ y: p( B. d, A
In fact, after the call to CreateFileA it will get through VWIN32 0x001F x4 Y2 x3 L& \$ t. L
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) _0 e1 R. K$ I0 v
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
$ D8 I* {" p3 {5 b. q3 ^field.
0 [' [; U, E- F9 ]& f4 c5 {$ e/ fIn fact, its purpose is not to load/unload VxDs but only to send a ; U% d, V8 S' V: H' |/ ?: ]; [# f8 k
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 j/ r3 l6 n8 Z& {" D# f* v2 i
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 x9 I6 g3 f5 I, Fto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& k5 e! t# ~* q `3 c7 A* gIf the VxD is loaded, it will always clear eax and the Carry flag to allow9 ^% d4 {% B4 v5 e' ?/ V
its handle to be opened and then, will be detected.
: M1 ^4 P, u) E2 j* s( P: x2 aYou can check that simply by hooking Winice.exe control proc entry point8 G5 a. B# K5 m# y( _
while running MeltICE.
4 Y. G/ ~4 U- S7 h! S
2 {, p! q# O! ?1 I- x9 D
/ ]9 a: S- A/ p2 B 00401067: push 00402025 ; \\.\SICE r1 ?0 b2 B; q
0040106C: call CreateFileA
! V W+ h1 u1 O4 Q& B2 E# X 00401071: cmp eax,-001
6 `* `/ U6 K8 h. K) y/ \. c3 j 00401074: je 00401091
7 J9 O+ Z3 l1 z0 q
9 h1 M7 ?6 f1 x& z7 f4 k3 ]. V
! _. X9 X9 x. eThere could be hundreds of BPX you could use to detect this trick.
8 P9 M- W9 i" R/ l-The most classical one is:
5 G7 l/ h4 E: g1 E. b0 | BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||! r( z' e$ P* E1 J4 l
*(esp->4+4)=='NTIC'
+ N. r+ f! G) J7 e8 \7 q2 ?8 Y$ i3 `
-The most exotic ones (could be very slooooow :-(( f. l: G N4 ]6 c4 d
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 i: I5 Q; [, _% Z7 E8 f" `
;will break 3 times :-(
4 Y3 @% j0 n" ~, A8 l
4 o5 A1 s/ ~+ G5 t# d$ B* M$ v0 V-or (a bit) faster: 2 |' l9 D" `' `/ n# G3 W5 b4 b
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 g7 y/ d" ?( L. \
5 E3 x% z+ a0 I0 h# ]0 C/ O BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 _ |" u) g* q# S2 l0 t ]- M' w
;will break 3 times :-( _4 w% E' ^5 z7 D, P2 `2 {
; q a$ {( a# R' O$ G! E
-Much faster:4 F3 {9 ]3 l( e4 J/ }
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
7 b5 f5 K) F% Z! I) ]2 {6 B& l ^- i. U1 O
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen% ] x, {; ^- @ j- [
function to do the same job:; x0 ]' E6 L5 i5 F! m' E% d, a
( P" `" w9 x( p
push 00 ; OF_READ
5 c$ C( {- O( E8 A& A$ w mov eax,[00656634] ; '\\.\SICE',0$ C2 ^. ^! l1 P) x
push eax
2 E0 Z) _" t, L! w. a: j call KERNEL32!_lopen
* g/ v7 A' k% j inc eax
% f( l! }: [4 j5 T s4 z jnz 00650589 ; detected
- l6 @2 @6 ~! \- d/ r$ ]! X9 { push 00 ; OF_READ, v9 p1 z" D3 F! i$ m* J
mov eax,[00656638] ; '\\.\SICE'
8 o/ X" @3 C: f1 [. o) X push eax
2 C b7 N; K$ m call KERNEL32!_lopen
( O# |) L$ m7 B7 D+ Y9 s/ F inc eax+ ?' F$ k9 }+ y8 Y6 ~
jz 006505ae ; not detected, t! A2 l$ f8 U1 D
$ \* l3 O- ~3 P3 q9 g! [ v- H* M
/ ^5 D2 u+ t1 P2 m, J2 {: U__________________________________________________________________________3 v& e+ O$ ?$ G
& M' A& S8 v( U
Method 12; x/ D+ M: f; x
=========; X" B; w) n+ f0 M% c$ F' i
1 c' Q5 \+ w b$ _; ~This trick is similar to int41h/4fh Debugger installation check (code 05
4 V, y* q- I6 E* i& F; d0 k& 06) but very limited because it's only available for Win95/98 (not NT)
$ U1 c( z4 C5 y1 C& ?% D8 }& _as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ z* H1 z3 O; ^
; q. a- w4 y! g1 a0 g$ `. r push 0000004fh ; function 4fh
7 d+ u/ D* N2 C( a: O2 [+ U push 002a002ah ; high word specifies which VxD (VWIN32)
# x" o0 e- d/ A* ?) ~ ; low word specifies which service
, t0 R! p, a# l/ W$ l( K (VWIN32_Int41Dispatch)$ P Q2 g( _# F0 E0 `
call Kernel32!ORD_001 ; VxdCall
3 f4 f4 h" ^! g9 ]( O cmp ax, 0f386h ; magic number returned by system debuggers
! y6 l( G5 ^) }+ I% B4 E- O jz SoftICE_detected9 ?$ Y0 V2 Y( v K8 M; f
* C6 s; m& o8 f
Here again, several ways to detect it:
. N; {/ A. ], L1 L v1 v1 ]7 ]3 m% G$ @
BPINT 41 if ax==4f( y; r' M: ~9 \ X$ d( C4 D
, B, {, o/ c+ \' W+ U& g8 e BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one+ h, P" w' d, p; N- a
/ s+ U' K) S2 u X BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
- q! x# |& u+ L, M6 |
/ D! B( A; ~7 C) g1 L BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow! |* o! r3 E/ j4 C" B, g$ H
/ y. l( W. A: W# A4 n% E
__________________________________________________________________________
2 x# \) u/ u/ e: l* i+ M: `! q' g# q* ?+ z" {
Method 130 ?3 s& E; z$ _
=========- V/ w( S) i, `( v
" V+ [3 G5 _) J& A. ?0 x! Z
Not a real method of detection, but a good way to know if SoftICE is3 j% A) G; V9 X
installed on a computer and to locate its installation directory.
$ I- L) @) C: n9 Z7 ZIt is used by few softs which access the following registry keys (usually #2) :: C- ]. O1 T6 ]; w; m+ h7 s
( ]: |( t) b2 y* @& m6 m) z# m-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 X; F! v s$ F" f- z
\Uninstall\SoftICE
+ g6 D% F6 p h3 G2 ?- K$ {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ _! g. @3 ~3 @. _! X& P-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 @8 Q3 ]2 B+ n/ E, J \$ T( ~' W
\App Paths\Loader32.Exe
% |+ j: ]' K- a, t2 c2 R9 z: M1 j
7 o h' j c+ z! \, INote that some nasty apps could then erase all files from SoftICE directory
7 @9 ?+ Z$ W' v0 y/ G: \8 f(I faced that once :-(5 z# f. I. \! O9 h
3 X( q- u7 Z/ U) f% ~8 D* G$ [7 q
Useful breakpoint to detect it:
. D2 o! t9 E* d1 ]: V* W9 ]5 Z) g" h$ q( ]# s' v
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ T8 G0 i( {+ o' \4 G" c- M8 `
/ I4 i9 B: u o3 q__________________________________________________________________________4 k; q' H5 Z4 z. p
3 X1 X- W$ @& \4 k9 b) `/ Q; i
6 U, n4 c* O4 K% U/ M E9 m
Method 14 4 w! s2 a1 n6 R0 |+ O" Z
=========
! K# ^# a2 j: Z; C4 C
9 z2 N4 R n9 D. u' WA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
( n6 U _3 T0 k6 B8 Xis to determines whether a debugger is running on your system (ring0 only).
% x$ g# w- @! K3 c2 T' m& C8 {6 ?1 b
VMMCall Test_Debug_Installed% L. I O$ b% n- u5 R; B1 ]* G
je not_installed$ i' ^. V/ ]) V; P' D& N
( i, D9 A& f5 r1 J- U5 o+ `This service just checks a flag.
1 t6 L! p# p' h</PRE></TD></TR></TBODY></TABLE> |