<TABLE width=500>
% k) N; i0 E( x5 O6 b<TBODY>* y! _: w) I+ W" t8 r$ r
<TR>
, `% p% I( m, W9 g) r<TD><PRE>Method 01
! b' R( q9 Q* d7 d. Y7 S2 f=========
: i# N; N5 ?" @3 d3 t; c7 o* x- P% C
" s: R* `6 ~6 wThis method of detection of SoftICE (as well as the following one) is
7 d, n0 N' t. e# p" _- B$ u5 ^used by the majority of packers/encryptors found on Internet.: N3 l7 v" H" l" S* m, C% \
It seeks the signature of BoundsChecker in SoftICE1 k# @* t3 [& n( _; q: |6 u2 C
% N' n- H5 Q% @+ s2 m% M: [ mov ebp, 04243484Bh ; 'BCHK'/ E' U1 [" C5 R# |2 C
mov ax, 04h
4 M% T3 Z7 F4 h" P' ^ int 3
! x& ^: i7 b" c4 w+ A4 ]. K cmp al,4$ ~7 ^* \( Y7 ]- d( o, d
jnz SoftICE_Detected
8 z' h. B X' a" q5 q- C( k: u7 k7 E' N# s
___________________________________________________________________________
) t* ~- H" r% L3 d8 k/ {3 }
`& O2 T! p" n6 _$ aMethod 02
0 G6 W2 O# L' J, Z6 H: \=========
4 ]3 {. k Y& ~+ R7 L# V9 d. C C, |+ T4 @
Still a method very much used (perhaps the most frequent one). It is used
) Y" ~& T, F+ N7 @# ]' d5 f) {to get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 ?6 j! y8 x. m+ w2 j' X4 P
or execute SoftICE commands.... s7 m& N& n. z0 p3 O4 H
It is also used to crash SoftICE and to force it to execute any commands
, N5 F& p8 l, g- ^! y7 Q( a4 y(HBOOT...) :-(( + S2 C) I6 |) S$ F/ L* x
{9 B, j4 h7 o: Z2 C: l5 ?# b
Here is a quick description:* V4 G X; h+ W$ E4 {
-AX = 0910h (Display string in SIce windows)
6 i" [3 J7 e. W4 D+ H-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; A, z4 l; ^& o-AX = 0912h (Get breakpoint infos)7 X& Z) [ O6 R2 R" ?
-AX = 0913h (Set Sice breakpoints)/ y6 o& z' {# F$ [9 m
-AX = 0914h (Remove SIce breakoints)
" q* L+ {8 Z$ } r1 d8 w& K
' q5 Q# |1 N& Q+ x! ]! REach time you'll meet this trick, you'll see:# s1 `1 u" w7 l8 L8 e
-SI = 4647h
$ e+ {# ?( U* s' m-DI = 4A4Dh0 K# M: P0 }0 e7 u
Which are the 'magic values' used by SoftIce.9 {8 j% K+ t3 N& { Q5 ^
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.; z, N ]* Z# t$ W
5 Q* { I8 Y, N) b$ G5 _Here is one example from the file "Haspinst.exe" which is the dongle HASP
1 c4 l7 \# x8 L& Q& gEnvelope utility use to protect DOS applications:
# b1 Y- J8 [" {
; ~8 a7 j4 G5 a; Y4 @+ e' T4 m$ W+ [0 n8 F% g
4C19:0095 MOV AX,0911 ; execute command.+ |- @6 I* h) D2 r
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).8 L% Y& b/ o6 w% N, ?; U+ Y' ]
4C19:009A MOV SI,4647 ; 1st magic value.
& z0 s; ]# x8 n* a2 w4C19:009D MOV DI,4A4D ; 2nd magic value.
% d# y. H3 y' {" q4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' ]3 @, g5 ^, _0 ?
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 p+ ^) A2 J: ?, s. z* L0 g9 L$ ^
4C19:00A4 INC CX& o) j/ N6 j0 K# v, ?/ y
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ G( `, h2 r8 L
4C19:00A8 JB 0095 ; 6 different commands.! k" j& G. E; {
4C19:00AA JMP 0002 ; Bad_Guy jmp back.* V; ~4 e c& O- K
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
2 J6 @0 x0 ~3 ]) w* l& C' t3 X H2 [1 p: N
The program will execute 6 different SIce commands located at ds:dx, which; z2 x+ S6 g% C
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 z9 `; w3 t' Y2 [* o" s5 V& B/ S& Z' s0 ]* j. s6 F; t; p
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
- w8 S L/ L1 _% t___________________________________________________________________________" E( o7 [- O/ `% }+ W% I" W9 }
0 m& X2 o6 U2 X7 U6 _8 y$ A) x% r/ P: u2 L
Method 03% p' r6 L6 U5 l( E2 F$ I2 t2 u
=========
: b3 e5 a* A$ A- c$ t
[ z9 G. \& a1 b d2 ULess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 x$ V0 `8 u" k. h0 Q- H7 ?7 U2 y5 s
(API Get entry point)
. z7 d9 k0 @- [! c9 V' y( I 8 ^4 l, r" d: F3 `) m+ U/ g
4 R" {. u' z8 S; o4 {6 v& t8 _
xor di,di
% F- \% b( I+ A mov es,di# P# Z3 P0 W5 {* O9 S" n; ~$ b0 _- v9 T
mov ax, 1684h
7 k3 X; O) _: B, |' F+ g3 t/ f mov bx, 0202h ; VxD ID of winice
* J: W# v( ]" A5 m int 2Fh4 U) Z; C3 K: l
mov ax, es ; ES:DI -> VxD API entry point/ H3 G7 T3 L' D8 P5 E/ r
add ax, di6 m7 }% B8 Z2 K/ U% w
test ax,ax
- T8 f6 U& |) b T, ` jnz SoftICE_Detected: b2 \" m: |1 v1 N5 h- E. _
* o# z e6 p6 ^9 g4 U+ `& \___________________________________________________________________________. t/ u% F8 S) z# U2 ^; b+ ~
- m/ I0 n) F- S$ T4 v+ aMethod 04& H# B* i) z; k( r- `0 q& W
=========1 d2 M" ?' j3 W% s' {9 j
& z$ w% P7 y2 k1 r; GMethod identical to the preceding one except that it seeks the ID of SoftICE
% ^+ D9 `. s& GGFX VxD.
2 e& t# U/ g* g7 Y3 b$ v* x0 L. r' s
5 D |* M% r0 J3 X- d xor di,di
4 J# q- w! z! N; m# G mov es,di
7 G1 c2 O3 S; o mov ax, 1684h
( @" t, A4 M6 S% B mov bx, 7a5Fh ; VxD ID of SIWVID
8 Y$ f$ z* s; p& L/ W W; P int 2fh
S) I8 ]4 L3 l6 Q3 F mov ax, es ; ES:DI -> VxD API entry point
. J" f& [- q4 U4 w1 L4 V7 ^* P. l add ax, di
q* C. b- a- d: j5 ^ test ax,ax) s6 l9 R% V6 c1 D1 v
jnz SoftICE_Detected) D0 q& g, y" Y( q3 q4 e. i
6 W& v& z, c" ]/ A__________________________________________________________________________1 C, n, G6 L9 V( U# {, D
! R3 F& O( s7 o' l. A
# g& }2 Y+ Y- q( V5 q9 s8 }Method 05, h. p6 v& f& y; Z! ?2 r" ]/ m7 A
=========5 j. f1 j: f* ]% A, n3 P7 m
4 e) n$ @3 h9 l- pMethod seeking the 'magic number' 0F386h returned (in ax) by all system. u: w3 s& @! n( ?' t. Y
debugger. It calls the int 41h, function 4Fh.
& T- Z4 O9 {, VThere are several alternatives.
3 X6 L( L7 p; P
1 e G( H1 K' e7 `# |; LThe following one is the simplest:
; t8 `' r: \, R* W7 L, k5 h
. \' b9 k7 ^( Z- R6 B) @3 ? mov ax,4fh
* |/ G. ]+ X. E! |) ~ int 41h
+ }5 Q. P4 t7 K$ N2 | cmp ax, 0F386
1 U$ G9 C" J; | jz SoftICE_detected& k! L- }; S& T. ^4 w( `6 ]
! z* X( F7 Q! y# T5 c
+ s; [) \# u3 L+ G6 k4 ]2 v/ l
Next method as well as the following one are 2 examples from Stone's O" R! e5 R- t1 C
"stn-wid.zip" (www.cracking.net):
1 R# J5 a+ U# }, ^6 F9 x# @+ c' v- s* c+ j/ f7 C: }, `
mov bx, cs& h* L( {2 V+ Y( P4 O; g
lea dx, int41handler2( G, |! V, \1 F: n2 [
xchg dx, es:[41h*4]
4 Y3 m) h1 }1 M; p1 c- G2 N& s1 W( Z1 p xchg bx, es:[41h*4+2]
, S) g! n+ U {& S4 h$ L j mov ax,4fh! [' @5 Y4 M$ s# l
int 41h
: M# Q( _0 W+ ?$ s3 m7 F) L xchg dx, es:[41h*4]! H- x' f$ D8 M( \
xchg bx, es:[41h*4+2]
% L K5 t/ }3 J" C4 s2 P cmp ax, 0f386h4 S( v, I g4 u, n9 q- O, i
jz SoftICE_detected% D v0 P, _4 M! |
2 t' {" \( p) ]) _, W% ]6 [int41handler2 PROC+ X7 p3 f0 `6 p* n/ k; H
iret$ X; w! b2 _( \ r. \
int41handler2 ENDP
" q$ Y; q& O, ?0 m# m( J' X
* `8 ^3 L; w6 o- h/ G* y# K* @& e9 d0 [ @, I
_________________________________________________________________________# N7 q; K6 n( B& P8 I6 E
; S( K; j5 b$ A+ p& F5 L
' m+ n/ ]9 C3 O# v" V2 T5 l
Method 06
/ @9 X( h) J( L* \/ t=========
, _# f% X4 |! m Y! U% c0 T2 V# n' ~1 ^! h' n8 Q( c5 _# u5 W) g( [. C, {
4 U$ U; Z& Q( m+ `& L4 J
2nd method similar to the preceding one but more difficult to detect:9 x4 q; c9 y- e7 m7 K+ n
& m8 E7 L, `; M- Z8 i# O. V
6 _% V& N3 g6 Cint41handler PROC
) t- D) w3 K3 I0 z- z$ f: J mov cl,al4 q6 Y, b! b" ?/ B2 u
iret
; Z+ X' P ?& B* s d1 Z6 Iint41handler ENDP
4 C K6 E3 q, @5 Q6 W
! r& E9 l. ~ _! e3 D8 W4 x9 X6 _$ U" m2 U
xor ax,ax
0 @- G/ j" ~8 p$ }7 n mov es,ax
2 g. b: \0 U, f7 l* _ mov bx, cs
" ^& j" g& @1 U: z/ D4 o. W0 k lea dx, int41handler% O/ P' U) s; R7 A
xchg dx, es:[41h*4]. `5 W- D0 y6 N
xchg bx, es:[41h*4+2] o) e% ], E3 r) N$ s+ F
in al, 40h+ b: `6 f' n( h" [: f2 F K: _" Y
xor cx,cx* f t! Y- ]- _* W# G! m( G3 o
int 41h }1 \% g) O L
xchg dx, es:[41h*4]
3 ^) [8 ]0 O {. S! [- v xchg bx, es:[41h*4+2]
% B" ~+ f5 T9 a3 m; Y! c cmp cl,al
# U* Q, a0 G# F- K6 o2 K$ k jnz SoftICE_detected
2 a7 s- S! l- e& A9 _4 B9 i6 }# x' `! h
_________________________________________________________________________
2 g7 R$ |7 V7 t2 ]
2 \, v* V; M) y1 k& ?. T4 RMethod 07
% g, w8 q# t2 V5 A k) \( }=========
( U1 k$ D; a6 I/ @+ l; T1 N' {" t
8 H6 A: ?$ |- M% \/ K; nMethod of detection of the WinICE handler in the int68h (V86). Y% ~# ]/ s' I; O( y
9 P" c5 L" ?* S; X
mov ah,43h2 k4 y# z8 A4 W. N# {( @& ~! |
int 68h; W/ j' j c% d2 X; `* s
cmp ax,0F386h
! w& H9 O) n! [3 J7 v5 ^ jz SoftICE_Detected
5 p6 d6 @7 M% m
1 s, P8 ?+ z+ i
9 N8 R4 @2 z6 C* I8 L, ^0 h. Z=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& L5 y& X! c$ a1 P, o app like this:* L6 E- [* b4 J3 Q
8 }( T, o( o/ D
BPX exec_int if ax==685 U1 `5 |$ w4 J$ k
(function called is located at byte ptr [ebp+1Dh] and client eip is
, {& m8 Q- e0 t7 h: ? located at [ebp+48h] for 32Bit apps)
' Q M! l( j: F% r* h__________________________________________________________________________
& ], O |% i# W& x+ y% c6 i- _* H" N) p( V) `9 k# l
& G' E. G" a) j
Method 08( i& f- T* a: u: A% ~
=========3 g9 F$ @; t: f2 L- j$ G4 M
* A4 m& T7 V; l2 eIt is not a method of detection of SoftICE but a possibility to crash the
4 G. ^3 X% d7 Z" e# u* ~' u; |0 tsystem by intercepting int 01h and int 03h and redirecting them to another& X( D6 b8 W: i/ ?' O
routine.
* u2 ^- D* a* E) DIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 s, E7 ~; _# S) A8 g! Tto the new routine to execute (hangs computer...)
) S5 m$ E6 U) Y; b' Q8 k7 U! j. {! o3 |! y7 t- D8 t% M5 H9 _
mov ah, 25h# w2 H& B2 n; D2 G) d
mov al, Int_Number (01h or 03h)) |5 x; O# N3 @5 _7 W
mov dx, offset New_Int_Routine" P8 |( p. M/ \* z6 i x( e
int 21h
7 n/ h( B R8 O' i e$ {4 t5 G# G
__________________________________________________________________________8 N- q5 D5 A/ y# g4 n. I
9 R) J* h& Z3 n% N! ^: G3 h
Method 090 z( [1 ] F$ H
=========
6 P" E' S) T' w+ M ~0 c* B" P' Z) E! b( k8 C
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only3 v7 g, I: P# o X( t. C
performed in ring0 (VxD or a ring3 app using the VxdCall).
% j9 a% e1 v& G3 B$ ~The Get_DDB service is used to determine whether or not a VxD is installed7 X4 c3 J+ G$ _2 S
for the specified device and returns a Device Description Block (in ecx) for
p, @5 ]% ?1 y1 _7 ethat device if it is installed.8 M* w: a+ m$ L9 S* C( ^
- N1 [& Q0 R9 g# _2 v! x
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% l5 |, G4 z' i J3 i+ F! i# J
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 i3 B& r" f, S: B$ x1 i
VMMCall Get_DDB
, f: D( w1 Q8 l1 k7 H$ W& c4 L2 e mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed1 H0 K% K/ d# w: j) F
2 }! o* D6 x, c: ?Note as well that you can easily detect this method with SoftICE:
! N. d! t q; c- G bpx Get_DDB if ax==0202 || ax==7a5fh
1 d3 E& `7 Z9 t$ T* Q' L2 L- h* Y P+ N4 \0 w, R9 _
__________________________________________________________________________) n& U- _- q! o2 J# M- B3 }
5 X n& Y# l9 M0 _% N* i- @ w- nMethod 10' S4 C1 u; \) T& F. m
=========
3 h* H0 U/ V% z7 V
' M5 u( I. k `% Y=>Disable or clear breakpoints before using this feature. DO NOT trace with9 p: A& ^$ l' O* s
SoftICE while the option is enable!!
7 V5 T$ O# U. s
+ T8 ^, e. f" R) \This trick is very efficient:
1 c/ w- Q: E( E# ^! ?* P7 N! `by checking the Debug Registers, you can detect if SoftICE is loaded
1 n8 `3 P: L+ \. c H) R( X(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
% ?. ?, n5 @/ Q: h4 X! athere are some memory breakpoints set (dr0 to dr3) simply by reading their3 ^* n. j# q( V! P# \3 Z9 {
value (in ring0 only). Values can be manipulated and or changed as well
( x( @2 ?! }" o* d(clearing BPMs for instance)
( p% [: h) J8 C3 @4 U+ C; }8 n7 C6 D' j* @+ @! R1 T
__________________________________________________________________________
9 f7 s5 W! W7 m5 u3 Y& M* x/ _" C0 J. d4 d% \
Method 11( ~( R9 Y0 C2 i5 o& u7 z
=========! j" T7 z( D G% ~. {1 M0 d/ T+ P, h
7 O! Y0 ?: ^$ r4 b! F: R: S8 { FThis method is most known as 'MeltICE' because it has been freely distributed1 c1 n) T# S' u2 C' t
via www.winfiles.com. However it was first used by NuMega people to allow3 f k7 i! C, r
Symbol Loader to check if SoftICE was active or not (the code is located( I& R7 n1 K! B; _- V* n
inside nmtrans.dll).
. X' ]! ~: R4 M' F7 x4 K x
0 }; J/ H) T: b3 n& Y3 \The way it works is very simple:
# w2 A1 @% C% ]7 U' IIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for/ T9 X5 C6 B- Y
WinNT) with the CreateFileA API.
2 |1 f, _) I0 M" ?3 ^6 `( Q& y4 _9 ^9 I+ J0 L2 Q* H) H' D
Here is a sample (checking for 'SICE'):# l8 K* |6 Z7 p8 z2 ?2 r2 u. v
$ ~& a0 @* a) p/ ~6 m6 LBOOL IsSoftIce95Loaded()% H$ m1 L' P' `, M/ I
{
7 a: b- H! _; r( B: o1 L HANDLE hFile;
1 |& C8 J" C( j0 K7 i% m2 i hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; I8 j- W- U* n z9 `5 q4 y
FILE_SHARE_READ | FILE_SHARE_WRITE,+ L. O+ U2 `8 J1 ^0 Y6 c) J
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ ?4 r2 u) h, C+ m1 R& ^* V if( hFile != INVALID_HANDLE_VALUE ). e- ^9 s/ r& Z6 A j. p6 D
{) D8 C& N" r& b7 y: f) y4 b. ^
CloseHandle(hFile);
4 ^/ @: I# L( @* O" @8 u7 ~& A return TRUE;0 l) b" O# A0 ?* F9 w) e8 f
}
3 w# H- a7 o4 p return FALSE;! m6 V$ |/ L! f
}: j9 g" C% G" W
1 Y, q/ z( Y6 T& N$ V' p2 }
Although this trick calls the CreateFileA function, don't even expect to be
- D @9 |& \9 D( S/ Fable to intercept it by installing a IFS hook: it will not work, no way!' O% r# L S4 ^( j1 T. N4 e# R/ t( u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 e. v5 `, ]. D4 k: f! J; d$ v, fservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 I* c4 M u. t" q g
and then browse the DDB list until it find the VxD and its DDB_Control_Proc0 }/ p8 w/ g" H5 _
field.# W! s% ^/ R! d, d+ Y3 ~- Q
In fact, its purpose is not to load/unload VxDs but only to send a
, d+ t. q9 k1 Q- r! I+ bW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- P, S9 ^/ S4 H1 Q9 t! X
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
: I6 v7 s$ M7 m: h+ sto load/unload a non-dynamically loadable driver such as SoftICE ;-)./ t# Z" |0 l, Z. |9 ~' b0 N. N
If the VxD is loaded, it will always clear eax and the Carry flag to allow" L3 p8 D* _: c* _& \, G7 c# [% c
its handle to be opened and then, will be detected.$ n0 p9 a3 @2 n) g2 b- K, o# R* P. D
You can check that simply by hooking Winice.exe control proc entry point3 N- D4 `) b4 F* l, F) |( c
while running MeltICE.
/ p1 Q- k% \$ m! u1 Y, q7 o( k; V! F8 X
! K- \/ j8 f6 v3 X7 z- o1 G
00401067: push 00402025 ; \\.\SICE
3 p# V$ E8 d [! W3 W 0040106C: call CreateFileA
$ X: Y( q/ \- @; l# C$ ^3 \ 00401071: cmp eax,-0019 k$ b8 }" Y( o
00401074: je 00401091
' l2 _3 g5 f: m; T6 x# \1 i7 p" L3 t- [' `
8 N: J1 R3 D- Y0 U5 RThere could be hundreds of BPX you could use to detect this trick.
g8 }0 F2 Y0 m. j1 F9 e-The most classical one is:
* ~! T8 t' b& m' n# y BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||$ T0 L3 t) U* J0 C( Y5 c
*(esp->4+4)=='NTIC'7 Q* G/ B2 w& y4 P) g7 T H
' a: D* |4 ?9 }1 p/ Q) P-The most exotic ones (could be very slooooow :-(
! T$ L! m ] p, R! k4 M BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
f; s# z" l# k8 s ;will break 3 times :-(
* G) [- ~1 `$ a# l% Q. }/ @7 h* k; d) ]6 p* {, L1 S# x( Y( k
-or (a bit) faster:
0 ?" d5 j" h d BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ e' N. v* q, w; Y7 Q) B5 X8 Q" [ m
4 Z, p0 N4 b3 r7 X; C) e BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( f+ m# c% a+ _" d ;will break 3 times :-(
" Y; @: R/ e6 {$ z) `9 }9 ]7 s H! C2 W. a2 h: z: W8 n; j) B9 K
-Much faster:7 ~) N0 W8 @9 W9 H, ? E" {7 {+ n# B( ?" V
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
1 M" x1 V) a3 F) y. r$ Z; I. @+ a8 a, Y" b L+ R
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
, W& _; i5 c, o$ m$ b8 }4 F8 [, Ifunction to do the same job:' [ ^7 i' |7 U) O! ~) T9 z
+ I2 g* Y! t( J& F8 s push 00 ; OF_READ. c; f. D" R5 x
mov eax,[00656634] ; '\\.\SICE',0) A+ O M" J8 R- \ I
push eax& \; M5 l- E7 ]. f6 Z
call KERNEL32!_lopen/ h4 J& `2 Q, W4 l2 v
inc eax0 ~) a: M6 I+ c9 R
jnz 00650589 ; detected2 ^3 @8 b0 P2 L5 E; B4 v
push 00 ; OF_READ, N' B# L' ~8 B0 D; Z
mov eax,[00656638] ; '\\.\SICE'
. M) C5 o" _$ [9 ^8 w& O. j push eax
% I! ^5 {2 C% a0 ?- `) [4 | call KERNEL32!_lopen
4 G+ a8 q3 V2 y inc eax
7 t5 R- K" l( R/ B jz 006505ae ; not detected- n& W, P( x5 ]5 e
$ L8 v& e( W4 V" Z* \4 n2 v% X/ P- O# b# ]2 ]
__________________________________________________________________________
2 i0 ^7 z2 J' T
" V% _9 b$ Z! ~* ?( TMethod 12
+ N" S5 u4 ?3 u$ e=========6 u- G; z& O7 B
1 B, Q/ t8 H; [% C2 I" FThis trick is similar to int41h/4fh Debugger installation check (code 05
) Y; U: T! T1 G9 f8 e& 06) but very limited because it's only available for Win95/98 (not NT)
* }: h" W8 c p2 |, D! A. ]as it uses the VxDCall backdoor. This detection was found in Bleem Demo.8 B0 z+ _% N6 `) t, q/ `* s, S0 _
% k6 Z! a6 M* b push 0000004fh ; function 4fh: L" p q! j- f3 H( Q
push 002a002ah ; high word specifies which VxD (VWIN32)
, M( D) k& P& ?9 l% P! d. `1 w% x% J ; low word specifies which service
! O- [9 C( V& S; w7 o' _3 R (VWIN32_Int41Dispatch)9 S4 L' ?9 ?. l3 [) H$ l# K
call Kernel32!ORD_001 ; VxdCall
5 w* l+ c' @+ k' @& O: _8 D cmp ax, 0f386h ; magic number returned by system debuggers
: V: \7 q6 C) e' N3 p# V; N/ } jz SoftICE_detected8 m) [0 E! N1 ^; M9 t
4 ~" z' `( H5 c0 yHere again, several ways to detect it:6 o: C. \# D+ b2 a- C. `
- \( j" M+ e( d; X BPINT 41 if ax==4f' K. W9 c, r# c v! \ [
* G# _; h( B7 T- E3 y BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
- D5 D( \2 }) T: [6 v
5 J1 ^$ f5 O: y" L+ T8 S8 B BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A: s3 `; U3 i1 x' w. ?! w" G
1 _$ |0 t/ l) t4 M8 u
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!- K l) x6 f1 Q: n4 T$ @7 G z
6 n2 J8 Y4 X7 c* h__________________________________________________________________________
9 w7 O8 p! O/ |# ^- L
M ^' ~5 j% v" uMethod 136 h& \3 ~; h( K# W, n. }
=========
( q3 C5 b; a$ U$ g' Z/ n" j g, e8 \- Z' ?9 C) f' r! t8 V# Q
Not a real method of detection, but a good way to know if SoftICE is
2 l' T8 t! p R& d) `+ T" _) Ginstalled on a computer and to locate its installation directory.( u. ^' c; w- a) G6 N0 l( m
It is used by few softs which access the following registry keys (usually #2) :
6 A; L- i: f5 F6 ]! P* e4 h
; t2 ~( p5 d7 l6 Z2 b Y& a# H1 y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* }, E! R/ D4 Z1 L! s5 _4 g
\Uninstall\SoftICE0 ]+ b. u0 Z# F9 P) F1 u0 S& l
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" N# W- E+ K! @7 f" F! x* D
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% w* U' F& A2 `9 P. g& h9 W$ k\App Paths\Loader32.Exe' v4 Q/ M! N* O3 R# ~
+ ^' F, g7 u' x5 z; o5 j
- u+ s6 J3 v( B9 Y- J: N5 rNote that some nasty apps could then erase all files from SoftICE directory
8 b! p1 L3 l* f. A+ v(I faced that once :-(
8 E* Q$ Z+ h1 b U2 u/ |1 }6 m- p- h4 v* L
Useful breakpoint to detect it:. o6 J3 {8 b) C. P; {$ h: J7 D. r6 S0 ?
) f" A* T' L- e4 |/ G4 J! H BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 \; r; H# ], N
1 U1 \+ x. H3 z
__________________________________________________________________________. E' r/ k% H! T9 a- X. F
! j# c$ ^/ H& `/ ^! i! s( p4 l* R
7 O3 k8 T/ q) m3 oMethod 14
/ L" k6 h1 A, \5 p6 l9 P========= @" p! A. p; Y0 W5 ]7 @6 @8 ~! ]
4 H' W$ w/ Q7 A; i4 OA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# ]+ J# D7 {% m' Dis to determines whether a debugger is running on your system (ring0 only).
* H& ]* ^9 e" d* ~) n/ r! ]* S# I- p( k9 _& l
VMMCall Test_Debug_Installed
' W! @6 N9 E9 @. I# Z je not_installed# w2 H% `# e0 H1 F% T7 ]
! n$ }( k: G/ f, Y; DThis service just checks a flag.9 W* }4 y5 p& C6 F/ X# R' r! a. l
</PRE></TD></TR></TBODY></TABLE> |