<TABLE width=500>9 L' u* B3 z! j
<TBODY>
F$ K( j! A7 Y% ^& j( L6 v<TR>
. e! @; Q0 _8 Q# q4 Q! _<TD><PRE>Method 01 5 ]$ B- l+ d" h9 }- `# p; M0 {
=========2 d- {/ j/ d6 r
1 b; Y9 h- L' n5 [! nThis method of detection of SoftICE (as well as the following one) is: f7 c! F& L% o @
used by the majority of packers/encryptors found on Internet.
* H0 E8 X5 |5 ~* Q6 RIt seeks the signature of BoundsChecker in SoftICE+ m) C8 p. C- o3 L' C
; y2 V/ e: b& J/ \2 k mov ebp, 04243484Bh ; 'BCHK'
' ^% T4 f8 _$ X2 n( Z1 i1 @ mov ax, 04h
/ X ^3 E% P: Q7 ] int 3
4 [- a3 [- n) Y1 G& j cmp al,4 ~. Z+ m" b6 g1 ~, Z5 g
jnz SoftICE_Detected% p+ ~. c( x* D/ i
& N0 ]8 ?/ \9 ^
___________________________________________________________________________
. {* D+ b6 @3 R$ `9 m( _' h1 @( M; Q- [( \- Y# R
Method 02* Q% ] t6 n- E7 k; f$ }9 p; H4 Y
=========$ R3 o" ^$ v* H0 [9 ~7 U0 p
) v, z( x. t7 P) X* _6 ? b# V
Still a method very much used (perhaps the most frequent one). It is used, G* S3 K0 Y& v. g
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,! u: W. ^8 I6 P( z5 D& g
or execute SoftICE commands...
: V- s8 i0 Q( T# @It is also used to crash SoftICE and to force it to execute any commands
- H9 ~0 h1 _; S& H( p(HBOOT...) :-((
+ Y! d! R1 d2 C# q
4 E. A9 B, p0 a5 n* S0 K+ L/ CHere is a quick description:/ J$ r7 Y0 Q2 Z. B& [ _3 U& d3 w
-AX = 0910h (Display string in SIce windows)! E6 u+ F) ?* h' e6 {
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)2 L3 t o6 L2 ]& V0 ~
-AX = 0912h (Get breakpoint infos)) K+ x p6 m* }0 [
-AX = 0913h (Set Sice breakpoints)
6 {% b* A4 @1 k5 R-AX = 0914h (Remove SIce breakoints)6 e9 W3 x- H$ A& _" S
" j6 A4 H8 \! g7 d
Each time you'll meet this trick, you'll see:, D" h+ x7 X% g' ~
-SI = 4647h
) e9 x8 y9 x W& a. u-DI = 4A4Dh
- I3 x6 P; d) a" K, z: d+ `Which are the 'magic values' used by SoftIce., _' h# P5 q, M y; }, y: p3 j
For more informations, see "Ralf Brown Interrupt list" chapter int 03h. e }$ R4 e( h5 J
0 e8 S9 U% I9 p/ I) K! }8 R4 u1 W) J3 zHere is one example from the file "Haspinst.exe" which is the dongle HASP( X% k4 C6 ^$ c; ~: L
Envelope utility use to protect DOS applications:5 M( p- e& ^9 W" ?2 y- A0 c
% e. W s. c/ M i+ b" D/ E) O
4C19:0095 MOV AX,0911 ; execute command.9 f5 x3 Q l, S& f6 I5 w1 W
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
# I% T( ~. |* N$ A* z# V4C19:009A MOV SI,4647 ; 1st magic value.5 |( f+ _1 C) a$ h# b; S$ O$ x
4C19:009D MOV DI,4A4D ; 2nd magic value.% E. [5 u8 U# r4 I! ~
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ W d- l. k1 Z; W- w4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute* | o! v& l5 s9 {) q
4C19:00A4 INC CX
! @* {0 X& ^2 U6 `' |# ]4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 a9 K _6 c, H) J% t4C19:00A8 JB 0095 ; 6 different commands.+ P1 c1 v! Z6 E; c6 a
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ G8 D+ k" J* @3 y6 f0 `) {9 O. L5 v* p4C19:00AD MOV BX,SP ; Good_Guy go ahead :)& z+ Y- K$ w: s, ]1 |
6 O; a! g+ m; B1 {4 W9 b# U
The program will execute 6 different SIce commands located at ds:dx, which( W. G; x. s. E$ W
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' y. q% s4 b# E- l; I+ u' T1 T3 l+ s! _$ P% q
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 k9 \: F9 H9 A
___________________________________________________________________________
B! | O) e/ k" g1 d0 C/ i; t/ C0 F, J* j2 v3 o7 ]& @
& ~& Q; e0 l1 j+ R5 eMethod 039 v3 A. J% E% z* t$ ~
=========
9 F' E) v- L2 K6 E' N7 m/ P
% L9 _5 Z5 k g/ v8 U( fLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 _# v/ a2 ~- s2 k3 J; l' m" i; V. ?1 t(API Get entry point)
1 b! W* }7 ^& z8 P 9 Z1 |1 x9 I9 O1 Z" _% @. W4 L
. b' e4 W( E1 b+ i& @4 r
xor di,di& p! |5 h1 x' a5 O3 [0 [
mov es,di
7 z* O5 C9 d- \5 b3 ]* R. b3 K mov ax, 1684h
" h# n8 T, T# P. e E7 a( f# |8 r9 @ mov bx, 0202h ; VxD ID of winice8 H; l/ E; C3 q3 U1 ]
int 2Fh+ f2 h- G3 Q; h
mov ax, es ; ES:DI -> VxD API entry point
! S H9 s/ v2 R5 m& T- O- t5 M; D/ G add ax, di
2 `6 [# V" `' _: ` K2 ] test ax,ax
5 w& b4 W( B x jnz SoftICE_Detected; Z7 H1 c- D. y7 g
( b# S" ^8 o6 U- `# C/ L
___________________________________________________________________________( Y! R3 y' ?. d" H% h7 G( d, _
/ ^8 m. y) r. m+ ^& G6 i0 @Method 04! m0 s# {6 m. R M
=========
% M6 y, d: r% I# Z2 K" o( L
8 d( ]1 }$ d) P: E6 l* z! ^Method identical to the preceding one except that it seeks the ID of SoftICE
3 Q+ J! Z9 P# r2 uGFX VxD.! y1 H: o- W! z5 N9 p
" `% E' E- x2 K% w$ b
xor di,di: o5 t5 m8 y7 o; P" k
mov es,di
: \5 }1 e/ A: V$ G# O mov ax, 1684h ! [3 S/ L2 b5 ~6 N7 y
mov bx, 7a5Fh ; VxD ID of SIWVID
- h' i% [ C$ y7 u; p2 d int 2fh) m; _ q4 p" t( k, O
mov ax, es ; ES:DI -> VxD API entry point( U2 Y+ A! B' |
add ax, di. E: M8 K% {1 @$ A
test ax,ax" [( n# ]6 s+ G$ Z4 _
jnz SoftICE_Detected
7 E/ o( P) K- ^* u
8 I! S9 E* z n9 z' L0 j, a, r! h__________________________________________________________________________6 g6 X, S$ R1 O. n
6 X6 o" o4 U1 [
3 [6 d: m' [- m7 F& T8 SMethod 05
4 @) @! B6 f' N* X5 T=========
% }+ q: N2 t! R, _# p5 g% f9 b" n. }1 c% N
Method seeking the 'magic number' 0F386h returned (in ax) by all system
, d2 j) }! S. u5 ]% t6 S edebugger. It calls the int 41h, function 4Fh.
9 d& n5 X' K/ z+ y: `# j3 B w- {There are several alternatives. , q Q" y- G6 ~0 p* {: w
+ }, R# x% D; @6 YThe following one is the simplest:, O- d2 [8 S, y3 b
$ L: T7 v+ u! m) D# I# K$ [3 { mov ax,4fh3 N1 Z* C4 E5 ?( D$ N! [6 M8 U s
int 41h9 u6 ]+ P9 E9 A2 q
cmp ax, 0F386& }1 h% E5 J) h$ e
jz SoftICE_detected
4 b" e' g4 f6 L# ?+ P6 C+ U2 I3 o, B5 A8 F/ Z$ ^7 w
" P- M) U! g( N3 INext method as well as the following one are 2 examples from Stone's
: ?+ ~$ J! }# n1 b! C4 [' j"stn-wid.zip" (www.cracking.net):
# m2 Y* _$ T3 k) @ C- d& D0 B
7 I- Z+ o( `5 ]: w mov bx, cs
S+ [! a+ P$ m8 L8 f/ Q) e3 u lea dx, int41handler2
. }& o3 W1 V5 P& |( E8 s/ l xchg dx, es:[41h*4]+ X) e( ?( @( P% Q
xchg bx, es:[41h*4+2]
# h# e5 p" B" C- { Z mov ax,4fh
8 s* ]% o5 m6 B/ j int 41h
5 N+ z c# }0 J$ W: e xchg dx, es:[41h*4]
, m( ~& X" h! e' u# @2 R& }3 J xchg bx, es:[41h*4+2]
4 l- I# S4 d/ w6 j- P a cmp ax, 0f386h
# S3 d1 E& X% N' U2 O5 q jz SoftICE_detected- i" w, `: B; q# j, j' T; l
; m8 i( m8 c2 N* Z9 K
int41handler2 PROC
: L; A& j1 W7 s5 a iret* \1 e4 ~8 S+ x3 L/ Y
int41handler2 ENDP' I( i, Z% L7 V6 E9 r( o
( }+ K& S; I* B* q3 s8 s$ z6 N
9 ^8 j4 m9 p* c" d- M; E' o_________________________________________________________________________* w6 u3 e+ F" L1 |! F
4 _9 f' m: k6 I
; ^1 ^7 }/ u* H% N3 Y: R7 x
Method 06
z A$ C; `7 H( x6 I7 t) `& y6 D=========# ]8 t. w6 J, R. @ I# o
7 S0 p4 _$ p, h" Q
7 {4 k+ G7 q& m/ Z2 X, ~, M3 t7 p2nd method similar to the preceding one but more difficult to detect:& R6 U! k, j( e8 M( g% _+ }, s
, I- L$ \# S' p2 N2 H
( w# `, t5 M" N- G. M3 g& A
int41handler PROC
$ ?& N* d) Y( I% L# m) v mov cl,al' V! H8 f# o6 c; s* \
iret0 ?5 @8 }8 w* _( H4 `& R- p
int41handler ENDP
% }, \) l8 ?) q& C, l1 n4 h! t' Q0 @6 h% e, m- _0 y$ S
8 f+ O& w0 ^6 M
xor ax,ax. h c z6 W: T, C
mov es,ax
R) r! T$ J5 Q* X. u7 a/ k w mov bx, cs
8 A+ Q5 k) J F5 n: v+ z lea dx, int41handler
& g8 g5 H3 R- v* P xchg dx, es:[41h*4]4 [7 V- k# F2 S+ @2 b
xchg bx, es:[41h*4+2]% L [0 @4 X" c y
in al, 40h
# n0 g% q$ z4 J! E5 M6 V8 o xor cx,cx
( W1 L4 {- ^* C% H5 ~7 | int 41h
/ z- R/ I, y4 E5 [5 q9 B" G xchg dx, es:[41h*4]
' z0 e: q' u! ~9 {3 L9 @ xchg bx, es:[41h*4+2]
& P8 I$ W4 y4 ]4 Q* o9 ` cmp cl,al# j0 e( |! B B0 b
jnz SoftICE_detected
0 P0 l3 A! K8 `1 q% B# {& A% v2 V' Y, [6 h
_________________________________________________________________________4 O: h7 o% E5 O! d7 Z( m
: w- j+ g% {* I
Method 072 w5 f' j. o5 P4 L
=========
( u; v: q! L" ^$ M+ [ b5 a. @$ y$ c
Method of detection of the WinICE handler in the int68h (V86)' x$ X* h6 I8 V' [
/ R3 @5 Q5 ^: p1 \
mov ah,43h9 ~* }& ]5 w& ]
int 68h* s6 _5 B5 A1 z3 _5 t) ?! p2 b! c
cmp ax,0F386h
( k5 \3 C8 ~# C: w! L2 G% e" y jz SoftICE_Detected
4 Q( J5 P. Z; p+ R1 F9 N8 F4 o* e: `& b/ T
' x; c) L! B$ p
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
5 G( |2 l0 {/ d app like this:
5 s6 b o. f0 ~' K, T$ R) w
/ `( l, Q+ _# {* ~: f$ y7 l0 ~ BPX exec_int if ax==68
4 |; O4 y& n2 T0 ?6 u (function called is located at byte ptr [ebp+1Dh] and client eip is
; _4 t$ x u; M- a located at [ebp+48h] for 32Bit apps)
5 l$ _1 a0 Q) e/ e* h+ h1 ^__________________________________________________________________________
) U' a- [ }) a8 n% I6 S
: ?) o! S% Z) @# d& j
0 c* Z _' u- f: h$ @6 KMethod 08
" z/ r8 n$ g& P$ V! h4 Y& l=========
+ \0 m* u- }$ N2 {
9 Z S. ? ~6 GIt is not a method of detection of SoftICE but a possibility to crash the5 L6 D* T, q. L: H* o0 x
system by intercepting int 01h and int 03h and redirecting them to another1 `3 g1 ?2 u* o3 E* r
routine.1 K5 h0 n, Z) @4 G- l% Q- u% p! o
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 x. }/ a+ n0 T- g1 l; ?to the new routine to execute (hangs computer...)
- U4 r# a9 y9 }5 D! o6 U( m9 k* X* w, R1 K. a: U
mov ah, 25h
! ?$ ~# H! l! B4 b) I mov al, Int_Number (01h or 03h)
2 p0 S: j$ Z0 g, `. z mov dx, offset New_Int_Routine
$ G( f, m9 A+ \( c0 H3 p int 21h
3 Q0 f6 ]) Z; K2 m- J$ w6 g" a1 J! C) A, A" f+ ^* g* B; y
__________________________________________________________________________6 k0 z; Z) H( p
- ~% i1 A; c& M: t6 h* _: C+ p7 A6 XMethod 09
; P) r, B) p5 I3 i=========7 G0 X/ _0 R- d: ~' u% u; S. D" d
+ Q( r0 `5 Z% [/ T) f; l& `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ X6 _4 [ u3 o3 {performed in ring0 (VxD or a ring3 app using the VxdCall).
) w$ V) U5 r1 K. U, M( c0 vThe Get_DDB service is used to determine whether or not a VxD is installed
5 d" z; W3 _" X$ p3 H6 r2 mfor the specified device and returns a Device Description Block (in ecx) for
, t2 Q: B1 t+ l# j' t" Nthat device if it is installed.7 g- S9 C4 {* \0 w
# O6 X. h- C4 \
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID+ n# @, S5 Y5 L2 r3 K( A1 U
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-), v. _# i3 s( x: |# }
VMMCall Get_DDB- `7 X+ A6 A0 L- H D( s/ a
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
& M( N) V7 y8 A3 s. Y; W* ]( M. E2 m% W2 A3 |# d
Note as well that you can easily detect this method with SoftICE:1 F2 u1 [0 D8 \, @
bpx Get_DDB if ax==0202 || ax==7a5fh4 h; w# J/ E% j" X* Z
: X! q7 }8 }- K9 f1 T$ \
__________________________________________________________________________
% W, H. s+ w: @: S1 L+ Q8 M
. c/ R7 z5 N: l! G2 jMethod 10% v& l1 Y/ z4 k3 T. |7 N$ y/ c! w' C+ z
=========
% S' o0 v4 g7 Z& b1 j
2 M [. C9 S$ R7 C" X/ S=>Disable or clear breakpoints before using this feature. DO NOT trace with
* g5 }6 @- H _; @6 x) h. M SoftICE while the option is enable!!5 w2 z+ @. O* p* T, T
% m5 d3 ]4 [- a" i3 s( `1 {* G* Z
This trick is very efficient:
7 `1 m$ T( w U7 G) M$ _4 Aby checking the Debug Registers, you can detect if SoftICE is loaded: w- R% g* @) O9 n7 |/ i
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! }' o1 p9 q% a3 v. x; `7 othere are some memory breakpoints set (dr0 to dr3) simply by reading their
2 K. k) i9 M- p5 S0 w4 bvalue (in ring0 only). Values can be manipulated and or changed as well; o6 H5 ^' r. c* L, F1 o
(clearing BPMs for instance)
: Q6 F) j* E8 y5 Z; r4 x
4 O$ l- X& K" u& W' O& b5 w& V__________________________________________________________________________6 {0 w8 L9 n w k; L
+ U( @$ S2 B! E5 _8 Y
Method 11
1 r# u$ p1 ?& o9 X' q5 j=========
! a! |& _ u& d7 x
0 y. I/ l% f( @9 HThis method is most known as 'MeltICE' because it has been freely distributed$ S0 C2 [% ?; N! Q+ S( K/ C
via www.winfiles.com. However it was first used by NuMega people to allow
) R( D9 X5 V7 g/ R7 u- c7 ISymbol Loader to check if SoftICE was active or not (the code is located
3 D! D `( i/ p) Sinside nmtrans.dll).& Y# N' _3 n5 J! j& u7 Y8 g; k
2 _' t5 z8 Y- [, x9 I: V
The way it works is very simple:4 F9 f5 N$ {: s. V0 k# `' Z
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 E& s: y: ]. k; r, v# |WinNT) with the CreateFileA API.; v. M% n8 V9 g1 H4 \$ M/ V
4 z( \" z! P* C7 J8 e- ^Here is a sample (checking for 'SICE'):' ?5 ?# C( m( ^3 P+ E
4 u2 d$ d$ M- @0 N; i
BOOL IsSoftIce95Loaded(). O) e& E! J: q% c) Z( \9 |& ~; {
{! h7 r: q, W0 V: M3 o, }
HANDLE hFile;
/ L' P7 Y. ]0 E6 s1 G hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% A/ S+ m, }, t4 R
FILE_SHARE_READ | FILE_SHARE_WRITE,; J& C4 B- f; V# P# J
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ @8 S5 Q6 Y, h Y& N, Q if( hFile != INVALID_HANDLE_VALUE )
/ Y' U9 ?, x+ w$ O! f {
9 Y4 _+ X" M: [4 D* T% g0 G0 o CloseHandle(hFile);
' f. c1 P! B# @- a4 A# c- k return TRUE;
4 o% T5 |$ C7 ]+ i }; z/ z( }8 V7 k0 g0 y1 J H) y
return FALSE;& U" u9 z2 [2 p. x9 \$ E( f
}
4 q( b$ L6 J7 `/ u% M ?5 g, t
, r, b# A+ b3 R. J& g: I% V+ eAlthough this trick calls the CreateFileA function, don't even expect to be) G! ]9 R) }( p( k7 i
able to intercept it by installing a IFS hook: it will not work, no way!/ A6 j3 n" [% R9 i7 o% ~$ N& A
In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 o& W$ s8 g* Q1 `# H' J0 e6 L
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 C4 l" m3 A( e- q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc J) |2 X \9 D" V
field.- P2 ?% j8 t7 G5 D$ F$ y* d7 B
In fact, its purpose is not to load/unload VxDs but only to send a ; _9 E5 Y, J |* V- F1 N
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) {* m& L7 k+ `% V" q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try# U8 I8 e8 v. \& ^4 ~
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
) _/ `! J7 t* RIf the VxD is loaded, it will always clear eax and the Carry flag to allow
) e* C; Y$ L7 f; |7 X c& w Y1 jits handle to be opened and then, will be detected.) y) s# C3 t' h( H
You can check that simply by hooking Winice.exe control proc entry point4 ^" }3 F! D8 w0 h: p" H" e# I
while running MeltICE.8 o! i- Y" u; A) t1 V7 J7 z
9 f e" O y# x; o9 W9 C; ] O/ |: |7 _% [; X
00401067: push 00402025 ; \\.\SICE
! ^4 [2 U" i- C# A 0040106C: call CreateFileA. _% j E1 x# O, N7 S5 K/ Q
00401071: cmp eax,-001, J+ W* B: Z0 E1 F2 w
00401074: je 00401091; t: Q/ T0 }% t2 f5 S
$ Z; A; E9 j$ z) s& {
( h! x0 }! }$ _( H6 [0 Z
There could be hundreds of BPX you could use to detect this trick.' Q3 c- ?1 v& Z) i( K6 r' S
-The most classical one is:# h" J2 _7 O w% D
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* c0 P, K' W' K, `2 |: }
*(esp->4+4)=='NTIC'
* [$ N# q) }# `( I2 ]" k; x" Z) G2 ~+ t$ R3 M6 w: J
-The most exotic ones (could be very slooooow :-(
* c" i# G. ~5 w# l% n6 t' L BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
& s* Q: G- b+ i( k! l' D ;will break 3 times :-(
2 N" B4 Y _- e/ ?+ G: {7 K# E$ d) H) Y( r- K
-or (a bit) faster: . M& B% [& r6 }" S$ {$ X. Z
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* ^5 {) ?' ^; _2 a9 I
, _+ e: H" B5 ?$ O! K4 U4 W BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' " n2 A2 ^! }2 V8 S/ r% ]
;will break 3 times :-(5 f, \5 @* \8 |* t; `/ L0 ]. z
! M" b5 I% G- I, K- }) S
-Much faster:3 ~3 q* V* r+ T$ @" J6 ?. X7 E2 A
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
, X1 s% d4 C6 S) T \) W7 v$ y5 f
9 A( u% a- L! u4 w: G: n, {( S/ rNote also that some programs (like AZPR3.00) use de old 16-bit _lopen% Y+ z0 a$ H2 k
function to do the same job:- i. z( [- E6 y3 [. T
# S( h7 F% x6 Y; q: z push 00 ; OF_READ
- d7 o% C, i. t* v }* w mov eax,[00656634] ; '\\.\SICE',0* Y$ B+ |; \5 ~+ {4 q7 R+ A2 N; f
push eax8 ~0 B; I% V# y6 d1 h
call KERNEL32!_lopen
2 X$ J; i$ d% e" C: ?, {2 w5 L8 e) ^ inc eax
9 L% n! }6 P/ H! P9 T: j7 n jnz 00650589 ; detected: H7 N. B# Z$ d2 H! ^
push 00 ; OF_READ
$ O( s/ J# X# T% T w& k& d1 A mov eax,[00656638] ; '\\.\SICE'
6 Y. |8 ^8 a! K push eax
9 Y: K" O9 L& B! M call KERNEL32!_lopen
7 @+ K$ n& D: W2 w5 m6 @$ \ inc eax
1 g% E4 |" o* S$ n! s jz 006505ae ; not detected+ T5 i* m. W$ Q$ u# i, o) q% Y
, H; N7 z$ a! z/ Q/ Q3 q2 f: m/ [8 K
__________________________________________________________________________; p7 t3 T$ t. r
6 ~0 M" t1 S) R5 |+ b0 TMethod 12+ z0 c) O3 O# J; [. J8 r* B
=========
7 y' C b. q3 G4 D$ I
0 t& W5 U0 n. \4 i; IThis trick is similar to int41h/4fh Debugger installation check (code 059 E; D; T3 b4 c8 ]; D
& 06) but very limited because it's only available for Win95/98 (not NT)
& y* `. f6 a( y# x, nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.& B! E' G# ^; y
# [3 W# {) }# y" `$ j
push 0000004fh ; function 4fh
. J+ x( Q& O, h+ V push 002a002ah ; high word specifies which VxD (VWIN32)
+ g5 R: ?. v. w: G# ]2 N- Q4 f ; low word specifies which service" D- J* m, p1 f, U- j0 p: y
(VWIN32_Int41Dispatch)) t" v' P( z" |8 W0 I
call Kernel32!ORD_001 ; VxdCall- B; t* U; u+ f" r$ u
cmp ax, 0f386h ; magic number returned by system debuggers) b! S) M: M' D1 G' ?3 n$ B
jz SoftICE_detected& q! {) O, U! Y) G8 a) }! b
/ h2 ?! `. {1 c5 \
Here again, several ways to detect it:
2 a) N. ^1 x" S3 e
9 a9 h6 ]5 C( j0 f7 F% a1 ` BPINT 41 if ax==4f
" A/ }) a5 \. K
3 [* U; ?: |& k3 r' B- z. U o BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one. X7 p* K& ~- k$ e5 S+ f
; Z2 V3 h3 V; p9 @0 H! V: B& s BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 s$ ^* r3 k+ o* G1 j: x3 ]4 i
3 }" j$ J: ^4 I+ g0 l# E BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! [1 \6 v( u a' b: D7 b: a0 {4 \* h' i8 @: }
__________________________________________________________________________
5 @" e3 c9 \' J4 S" B2 o" c) ]; [- |# g4 ~" Q
Method 13% x7 f/ J2 u$ L0 Y
=========$ q% Q; D) V% F7 z
o* D8 Q" \+ O: Y2 f; k! x* `Not a real method of detection, but a good way to know if SoftICE is: n X2 T6 P. {, a/ h a0 \2 l
installed on a computer and to locate its installation directory.
; u( G8 v1 Y5 h) l/ E; e" y4 sIt is used by few softs which access the following registry keys (usually #2) :
' V* F6 t4 \0 j7 S; [% g b, S; H$ z4 F: g. l0 H2 o8 G$ l" \
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 s; W9 F/ I& Q/ s$ J2 r
\Uninstall\SoftICE
6 |7 l$ G4 S' @) {# F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
7 d& S7 i4 | @( h2 N7 m9 ^-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; E0 Z/ K7 P! @
\App Paths\Loader32.Exe
9 f7 d/ R! @2 [- s% u3 b7 X( L+ h
+ b# q3 e+ P3 R' ?$ Y1 ], o
# E6 R [9 p Z3 ]7 g1 Y4 w/ hNote that some nasty apps could then erase all files from SoftICE directory
1 _9 Q" k$ j8 h8 k7 X(I faced that once :-(/ C( }% h6 I- [5 p' ~. ]% N
5 C3 F- L. j' u( x; `4 v1 eUseful breakpoint to detect it:
B0 I \5 W7 S7 v4 E) _( v
1 E, s0 Y; X8 X5 Y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ g! f5 H. N/ c1 d+ [" a, h e! A' r) z& B
__________________________________________________________________________) S/ n- o3 z, H6 b% K6 e( T3 q
2 W5 e* f) e( B+ ]; j
) C5 n7 c( L; A& {, NMethod 14 9 \% b T6 f/ S, p8 ~' X3 ?
=========& o! a% B& O2 A- _5 X( f- R
- p; A S) B2 z8 k2 X: _7 TA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, N. i, X- r: T) V1 I- u
is to determines whether a debugger is running on your system (ring0 only).! q8 s5 R2 r4 V+ i4 D& |- p
; O) n+ f3 w" Q4 Y; q' L& ] VMMCall Test_Debug_Installed
% a8 v* e r+ j* P. y je not_installed
@- {9 [# a& B# ~' f* X( m3 K( X( v- w8 w; e
This service just checks a flag.& F3 e! Z, j. p7 T% r0 P
</PRE></TD></TR></TBODY></TABLE> |