<TABLE width=500>7 @, p7 C% L- B$ V
<TBODY> R7 ?8 k0 l B; R) {- g! n
<TR>
" }% r* r* g, o% Y) u" h- @4 M<TD><PRE>Method 01
/ s9 Z# F' c0 _% y=========- W4 Q) Q. I+ S! I+ c
9 c2 q. K* Z7 l2 f) V& k
This method of detection of SoftICE (as well as the following one) is
8 F) _, f% Q6 Z, N8 M/ tused by the majority of packers/encryptors found on Internet.
+ U! U. W9 C Z3 GIt seeks the signature of BoundsChecker in SoftICE- D" U4 S- q( z1 j' C# I3 L! a
! ^$ B X6 T- o) i; A$ x2 e5 u mov ebp, 04243484Bh ; 'BCHK'
, B% y. ], _$ L1 k+ m mov ax, 04h
0 T M: Z% U! K* H int 3
/ ?: U1 z: _1 J cmp al,4
8 |- d% A2 A; u9 r# j& B, @: U% N jnz SoftICE_Detected+ c% @ L/ y, ^6 {9 u
3 \' a8 b8 N. P; L1 n" {0 g7 X( H8 Y___________________________________________________________________________
5 r0 b3 B+ J) k/ c9 N2 J4 R
& K5 f3 N5 F/ S* S; x' d4 ]6 `Method 02
( [2 j/ v. r8 G* n# L=========; n' d1 R# H% G8 o
3 t" u; l ?! |1 J
Still a method very much used (perhaps the most frequent one). It is used
' m. F+ l4 q! jto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 @) L( D3 T/ o& ^' N8 aor execute SoftICE commands...
! A$ x) X2 D3 M# Q& q/ v XIt is also used to crash SoftICE and to force it to execute any commands
! f- A$ L9 [6 u6 \ o(HBOOT...) :-(( 4 T5 z9 [( C, Z* b
( n5 f, A8 A5 Z3 iHere is a quick description:) P1 N- ]) }* W3 c
-AX = 0910h (Display string in SIce windows)7 ]$ a! T8 R) V# R
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx): ~5 Q3 w+ s. [! P' B
-AX = 0912h (Get breakpoint infos)) d: N: A1 U8 n8 f- N5 H
-AX = 0913h (Set Sice breakpoints)+ T( }, z, F7 B) m- U
-AX = 0914h (Remove SIce breakoints)
4 L* l5 `+ A$ l& F3 `2 x4 y) x) K1 v; D! T; ?" l2 O
Each time you'll meet this trick, you'll see:
+ ?' T: F0 l0 j% }-SI = 4647h
1 c0 ^% R" w: V" S9 ?( P-DI = 4A4Dh" E& s2 K) d% W6 B" p2 n
Which are the 'magic values' used by SoftIce.0 p0 d1 k$ N3 u1 x
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.# w8 R6 O n& J* e
! V! O7 g7 @4 c
Here is one example from the file "Haspinst.exe" which is the dongle HASP
8 u2 S' D* h4 m0 e2 }: cEnvelope utility use to protect DOS applications:) X' ]5 [" u+ }$ m& _
' z) r8 d H) j6 u% }2 L3 M- r4 D- Q6 h8 Z" f
4C19:0095 MOV AX,0911 ; execute command.
) h6 [5 a2 ~/ C, }6 p0 u2 L4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
+ l' p2 {8 I/ ^ `4C19:009A MOV SI,4647 ; 1st magic value.
: \! Y8 {3 o/ O6 s2 w/ M4C19:009D MOV DI,4A4D ; 2nd magic value.
1 M% N" G& Z$ a+ I/ O4 k4 J) h: p4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 l8 y0 X' V5 ~4 }4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 l* }- x5 l* u" u% t! a4C19:00A4 INC CX! w2 C5 I' @4 e3 \ R
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 }( M2 ^# x" a; r; h
4C19:00A8 JB 0095 ; 6 different commands.% Y% f3 {+ H F$ s0 ~
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& `8 W v! G" q0 q/ x5 e4C19:00AD MOV BX,SP ; Good_Guy go ahead :)$ f9 ~1 A* _; a* r9 |, n8 B
: O) r4 }8 y$ h8 M$ p- U+ CThe program will execute 6 different SIce commands located at ds:dx, which% V. d$ [8 G D$ V1 d; c5 K8 K
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 D; H% i* U* M2 j# d7 I
- Q7 t) K) c* H% S* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.6 ~0 B' S( p X2 z: q
___________________________________________________________________________" w3 h# X6 M9 W) O' h+ b( X- J" G
6 f- O5 G" P2 v$ M- Q" T! O& I0 z, `4 j! x0 X# K4 w) T) D
Method 037 L) v% J3 o. u: A( f/ v' ^
=========( p' R; ]( F$ d, p8 z
2 I$ c0 U7 F7 k' W4 j4 @
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 |4 n0 x& h0 p
(API Get entry point)3 r) C G- Q* l$ ~6 v. `
' _7 y7 A5 q- i
6 h1 R+ K/ G6 A1 R+ {" G
xor di,di
7 \8 |5 F9 Y3 e mov es,di$ Q9 d% @) W6 s9 a4 z' k, x0 X" G
mov ax, 1684h
. F) y) V' h7 x: j8 s mov bx, 0202h ; VxD ID of winice. x6 N( j. R4 d; B
int 2Fh
7 D& D$ }9 p) Q& ` mov ax, es ; ES:DI -> VxD API entry point
9 ^$ N3 V( V- s$ P: `+ q+ k add ax, di, K h: a, s$ C' T- w' b
test ax,ax
' e; }+ ^' a5 V6 |9 u/ L jnz SoftICE_Detected
: }' m1 L$ P7 C, w8 p" W. M+ C6 \0 ~# o& M+ k0 v& {
___________________________________________________________________________
2 a' ]. c; z! k/ G" P9 ]# n, p; S7 L
$ n- } v& C' S8 b7 CMethod 04
" i9 r( w- B7 t. t; l7 N=========
% J U- w" G6 P
# }' i+ T0 g( ?3 aMethod identical to the preceding one except that it seeks the ID of SoftICE
; |5 z1 S i8 \# f# kGFX VxD.4 Y, C5 Z0 [# l. N3 S0 f
1 a1 g7 F- ^( y3 S) c. L) }; c% P xor di,di# u9 a# O9 d0 x; S* {6 T [
mov es,di
/ U. \0 Y3 o9 e- @; |1 n4 C ^: q mov ax, 1684h 6 o' \# \: r4 w9 U. Y4 x. [7 z& B
mov bx, 7a5Fh ; VxD ID of SIWVID8 w* G/ _" h q" M* h3 ?
int 2fh9 T; N% M, j+ z% S
mov ax, es ; ES:DI -> VxD API entry point6 C {( i6 U5 B* ~7 L" y
add ax, di1 f( R S9 R9 ~6 f7 p! k+ m
test ax,ax7 j& {& f/ ^, G& {! M8 |1 b3 |
jnz SoftICE_Detected
; v+ K) v. _: L: J r4 w M6 M7 k) m$ k X8 v
__________________________________________________________________________
% c4 ?* J8 M$ [- Y. H& E/ I
# F6 r2 I! ^8 O8 F) P
4 ]0 ~7 V8 T8 h7 fMethod 05
4 v6 V/ Y- D. e1 W+ V+ s3 p=========
& ^2 f1 e0 K; B# x/ C
% ~# a1 B7 r# D/ a; n+ |Method seeking the 'magic number' 0F386h returned (in ax) by all system V# p5 ~4 E1 f9 Y, ?, i* t
debugger. It calls the int 41h, function 4Fh.
( D# B% e* i# J# c1 AThere are several alternatives.
, x/ t6 l9 e' _; L5 t; r) H7 H; q7 `$ B, h: x$ H! F
The following one is the simplest:% \( [! D3 F9 S, U! C5 o, |; i
# Q7 z) T1 ?' _; ^' U mov ax,4fh X3 u- | `* G% J( U5 T
int 41h( i/ {: x- ]" V7 A8 W
cmp ax, 0F386
. J- D9 U! C6 b9 P4 u! c jz SoftICE_detected
0 \1 k3 w+ k' y, `! C' x9 J/ d
. |/ |- L0 E: y% G3 y& L: n* m/ A9 K4 c4 R4 l' Z2 {
Next method as well as the following one are 2 examples from Stone's
- {) {/ Q5 Z5 o4 W7 \) r"stn-wid.zip" (www.cracking.net):
4 |- l& J2 I. u6 ^$ h; o; d% m }+ W1 U. t8 U% d/ ?- X' d
mov bx, cs6 N, i/ t s: J3 J' ^ M
lea dx, int41handler2/ y& ^1 m9 `4 M" p& t
xchg dx, es:[41h*4]# N8 e- T" k2 q) o: J; v
xchg bx, es:[41h*4+2]
0 o/ A' I& h+ ~# Q$ O: J f7 o8 R$ M, A mov ax,4fh
& q0 f) S. \6 P int 41h
5 b+ V0 {) T1 F' g" E+ ] xchg dx, es:[41h*4]+ b8 z' f- C1 o: g$ q! {4 p" c
xchg bx, es:[41h*4+2]6 L: w9 T* N8 \# Z0 I' I; S- n
cmp ax, 0f386h
3 _5 E9 A7 k( b jz SoftICE_detected
/ a9 j) n' R2 [; D4 b1 i, V+ a- e7 k" u# _7 u; j
int41handler2 PROC
: z, @$ U6 c6 I" R* L" m& \5 \ iret1 q% k/ J% t3 N2 G
int41handler2 ENDP
3 d. W. i' a# P" ]
% h2 T4 S' U X3 r8 \# h+ j3 @( G( x/ t0 a' C3 [2 \
_________________________________________________________________________$ \$ N$ S6 R5 ^& A* h7 G) D* i
7 M7 S/ R# T* N! s# O. i# H
2 |2 e) L. {6 p. d8 T4 M
Method 06
. g3 M- H* h- |: N; P+ e2 R' e=========
2 X( K) c' A+ b6 ^& ]+ @ A- W a5 C/ A
' H! K8 D$ X4 ]! S3 z' Y
2nd method similar to the preceding one but more difficult to detect:0 }0 G( r$ `1 C6 R4 X& C
6 `& Y: y& H& e0 ]! l4 g& Y3 ~7 [$ R
) i: B$ h' K* n+ a' sint41handler PROC
0 A" T! a$ w) t( d4 W( J' U# Y) @- L mov cl,al3 h! G# J( d7 c% f1 v& H E
iret# }( j0 b& J2 L; q. w
int41handler ENDP: `3 b7 V- A6 l/ g; c3 y; Y
3 [' U; y6 m; L1 ~8 x4 u% E" o" B8 [$ l9 N( r
xor ax,ax
8 }: j, E( m7 R% s, `$ J: M mov es,ax. e2 q4 F4 @4 H) n" _
mov bx, cs
+ @* h) E. L3 s/ Q lea dx, int41handler3 x, _3 Q% Y, ^9 F
xchg dx, es:[41h*4]
9 q7 l6 @1 p# T9 X" R6 s) h xchg bx, es:[41h*4+2]
- l. p* D1 Z1 V/ R3 Z F5 e in al, 40h
2 ?1 z8 O# k2 n) B! q, h4 B* y xor cx,cx+ S) L9 B; j& d: ?% W) c
int 41h
5 S8 E/ s5 J* \: [8 w$ Y1 _ xchg dx, es:[41h*4]" r) i( W, J' u6 u
xchg bx, es:[41h*4+2]3 N* j }# [7 Z4 Y7 s
cmp cl,al
" o' ^% W6 W' u( R jnz SoftICE_detected% s, l8 U# B$ v6 M
5 Z8 G* @4 y9 [% f! g- ~( P# v( L H6 O_________________________________________________________________________
2 ?8 i; Y: p! Z! L+ o+ G5 I# L* x; Z" r
Method 07% ]- B; |8 a# Y, x% j% w0 ~
=========8 @% D; f0 c& `" c
/ q6 \; W8 `; x& J1 N& B+ p7 f
Method of detection of the WinICE handler in the int68h (V86)
; S: ^; i; u3 l+ x" x' R8 A0 n: ^* l1 z9 G! G# A- G
mov ah,43h/ {$ D, i$ r. y7 N( _
int 68h; K' J& D' g, {* u/ R- v
cmp ax,0F386h
& ^6 g0 }& Z% h. {# X5 ^) ?+ i+ t jz SoftICE_Detected
8 ^* d. R: {1 y7 z/ W
{5 D# a+ z" i6 M# o% L% e! Z# l
- t+ g3 U$ B/ w( c=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
5 I# m9 V; d7 \4 q# v5 Q# | app like this:: x4 h v5 ?2 W% s
& H$ E# Y+ e/ J [8 n" j3 _! U2 a
BPX exec_int if ax==682 ?0 n1 e& f8 Q- j7 v6 K
(function called is located at byte ptr [ebp+1Dh] and client eip is
( Q0 a" R) e/ F$ S( M located at [ebp+48h] for 32Bit apps)
% ^/ D$ s1 R0 w4 q( r+ H__________________________________________________________________________9 b: @2 N1 n* o+ a
, W1 a( P# r% V+ d }
5 d. [& N. d7 q5 A& @Method 087 ?& C4 l/ C" I% t9 h' e
=========( Q3 ?% y; [" R' t
5 A. u% Y% \" l6 `+ A/ H$ L7 Q1 n+ LIt is not a method of detection of SoftICE but a possibility to crash the, B; V' _! E7 H0 x+ c8 S
system by intercepting int 01h and int 03h and redirecting them to another* H/ A# `5 b }/ [- j+ X
routine.6 q6 V; N$ T5 F/ O+ r1 T
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% M5 W* F3 \, o( G8 Vto the new routine to execute (hangs computer...)
9 x' @; l8 d" p/ S) g- g
6 l" v1 {$ M. z' k @' j7 W+ @ mov ah, 25h
6 M: `: q% _$ }4 u- S" B! l+ y mov al, Int_Number (01h or 03h)$ I w$ i2 I7 O. i$ D- C
mov dx, offset New_Int_Routine/ V% J9 d! `7 t9 A# |1 Z9 S& a& M
int 21h6 A( z$ w2 W5 R- v0 T0 }) p
- ~! x: [) G' W- B( f6 D3 Q, W) f__________________________________________________________________________1 }. \' K1 ^. q3 N1 Q9 u
5 d. G$ J) U3 `) t) P
Method 09% O2 O- N$ ^8 ~( w+ u0 H# x# b
=========
; {/ `2 v+ q9 M7 }2 e3 j6 o+ g7 W v
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' ~/ y+ I/ }7 s, Operformed in ring0 (VxD or a ring3 app using the VxdCall).
" r5 v& n4 H( p# S1 j4 c, V6 DThe Get_DDB service is used to determine whether or not a VxD is installed
% ? B* d: d: y( s0 s" q# _3 [+ A( gfor the specified device and returns a Device Description Block (in ecx) for* K# [" P- @ \5 M) c5 ^4 K
that device if it is installed.
, I8 Z4 t3 p; L& K$ k) u- |% f* |/ x% s4 }+ D& t# t
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& w6 p, X, r* H1 k) @' {$ R8 r5 S mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 G# j z$ ?+ K x. C4 H VMMCall Get_DDB
|! r$ S2 }1 ~6 L9 u, K( f! d mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ J. v z8 A9 @# M# I' j' m- W2 [/ ~/ ]3 Y P" r! {
Note as well that you can easily detect this method with SoftICE:, v: w- y, g0 s" z2 R) C
bpx Get_DDB if ax==0202 || ax==7a5fh, v8 w9 D8 y2 p' l+ X- M" V9 L
! }+ `* g: z. }3 b__________________________________________________________________________' m/ C6 {# y1 P3 j0 j" h- ]8 W
2 W9 _* r9 I( K, V6 I! F+ v
Method 10
: A1 C" N" B5 O( `8 }1 \=========' C# H! a8 b- z' O
+ `, L, f7 n( j1 o7 U G; O& s=>Disable or clear breakpoints before using this feature. DO NOT trace with
A# }( H, h" Y) M SoftICE while the option is enable!!
F& w% t2 f8 {4 E, s- P% l' t' b. d
This trick is very efficient:% U5 i) C8 d k" X* g
by checking the Debug Registers, you can detect if SoftICE is loaded' {8 m' ^" K; X" s
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 P. j+ B0 Q% h7 ^5 a8 P
there are some memory breakpoints set (dr0 to dr3) simply by reading their4 K6 Z( T. A. h5 A
value (in ring0 only). Values can be manipulated and or changed as well
+ O& v2 Z2 y. j# B5 N(clearing BPMs for instance)
- k& N. O% Y, j% Q# [! Z" C- O6 b. g: P
__________________________________________________________________________
], U4 s8 R: ?% n& ?
3 k. K6 h6 m7 L6 `9 \6 i: @Method 116 W" I! r: M5 ]9 ]! H5 Q& n
=========0 m( |" V/ E6 ~* ?. t, |9 c3 F
/ {0 \, w! \) _, \8 }# h: t
This method is most known as 'MeltICE' because it has been freely distributed5 S# c2 |9 z3 t1 @1 H) o
via www.winfiles.com. However it was first used by NuMega people to allow
+ X( \' ^ y; _6 X9 w: kSymbol Loader to check if SoftICE was active or not (the code is located
# j7 B5 e$ e' I7 S% pinside nmtrans.dll).4 G+ X4 O5 ^' i" t
8 a3 s! Z4 s* ?/ I
The way it works is very simple:
: w9 l$ X! e" z5 R( DIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
+ R6 F( T1 K) ?) H0 N: yWinNT) with the CreateFileA API." B3 W/ V/ x& L' i( g/ }
1 ^9 ?' E( \! i3 c* D( g9 {) f
Here is a sample (checking for 'SICE'):
" x& G! _1 r3 g# C/ [6 j
4 p4 h, e- H3 k5 hBOOL IsSoftIce95Loaded()- E1 j- N' @) k
{0 L+ O- A9 ^2 U, t0 n l" |0 v$ _
HANDLE hFile;
4 E7 B3 a) x7 y$ I0 W hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. l* f. i/ [# {7 I ]2 ~& {2 i
FILE_SHARE_READ | FILE_SHARE_WRITE,9 Q) p2 j p8 j/ C- \
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 Q+ V+ L- l/ F
if( hFile != INVALID_HANDLE_VALUE )
1 N/ Q; K! L) |* W: g4 L% z5 G {
. F% D% S$ L9 ?/ } CloseHandle(hFile);. k) [1 F' ?+ o
return TRUE;
7 S9 w9 [' b0 y2 {1 O7 O }
, Q! B* f1 w4 y7 a, \: t, r7 H return FALSE;. E! J9 F/ R* \+ T
}
) I9 [' L' {5 H+ w3 R" n: Q$ `' y' G* k% H
Although this trick calls the CreateFileA function, don't even expect to be
! Y- Q$ h' e& s+ e# e2 sable to intercept it by installing a IFS hook: it will not work, no way!
( T, q" L$ r: g6 ^In fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 R4 y' }/ T! S& C. H. Y) j+ jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ j9 C) ~1 L D/ rand then browse the DDB list until it find the VxD and its DDB_Control_Proc6 _0 L2 v1 {/ _5 }
field.0 D9 \/ Q% s: ?# U
In fact, its purpose is not to load/unload VxDs but only to send a
& n# a5 l! Q( _* o4 D2 Y+ cW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 b. }' [+ i, }5 L& y4 U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try% ?: r" I. L- ~- ^3 ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* b* Q% z r! X- [9 _; M: ?0 g7 o2 [If the VxD is loaded, it will always clear eax and the Carry flag to allow5 u# W( a3 Q: W6 }
its handle to be opened and then, will be detected.
: l6 }( `0 b) m' j1 [! Y9 IYou can check that simply by hooking Winice.exe control proc entry point
/ p( Y# a6 g# _8 Q/ v# g+ C) r$ twhile running MeltICE.
0 Z1 u. H) U# J, i8 Y) t% j2 C
6 Q* T8 w5 P+ B# ~" ]
; P% @$ }* o K- P# \: m0 Q& m: ` 00401067: push 00402025 ; \\.\SICE
4 ^. L( z& F+ F+ R; Y+ ?, H 0040106C: call CreateFileA; D8 q+ i, P( v& ?6 E
00401071: cmp eax,-001
3 F# F) K9 n1 P& U 00401074: je 00401091( @- w I$ l$ X
2 X# M( p* ]% N Q' J" {# U
2 N' M* a* t* \# p1 q% S
There could be hundreds of BPX you could use to detect this trick.6 |+ O: ^: I' e& L
-The most classical one is:
( i6 a+ q1 I5 j" Y; \8 S, e BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
6 Z3 G! z" c4 K3 l' n( j; y, q *(esp->4+4)=='NTIC'
/ c* |4 }# y! k& ?! b5 p/ Q7 A7 U: O7 o! r% i4 ^
-The most exotic ones (could be very slooooow :-(5 [$ W' s+ }0 t! E: \
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
3 h. u3 |1 F1 F, { ;will break 3 times :-(
, H. a) Z8 {$ K* s/ U) d% A/ R" m, L1 U! S1 }# n! x% Q, Z. t
-or (a bit) faster: 5 {5 q6 a) \- \6 v8 \
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 w' m1 I. L; C3 ?) G
: g( d5 c5 c9 J7 m. h$ y! X4 e BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
9 x. w4 e2 _! M7 l T ;will break 3 times :-(& H. _( j7 D6 ?% S7 s D1 i
7 s' I& ^( ]) }+ y: a9 ]- G3 T! H# C
-Much faster:: K, ~+ y. H2 N3 A# _' H# I
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'5 e6 g# A( [4 z- U6 x! v1 j M& n! O& P
1 N( ^, t1 d0 M/ P6 }5 P) M) {; e$ `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
0 Z n9 i0 c- Y5 f: Cfunction to do the same job:
7 G+ H& J' Z" v) g: g& l7 r, ?; g
6 B1 Y! Q7 z) f8 i push 00 ; OF_READ
( C) K) o4 Q y: Y8 `( P mov eax,[00656634] ; '\\.\SICE',0: n0 Y; ^/ q/ n3 j/ p }2 L# ?# H
push eax
' E! |- E! R2 ^( m2 F# ] call KERNEL32!_lopen
& p) Z' ~( @3 f; R! M: _ inc eax# ?5 v, x) P7 M. }/ l" d& w# L0 q( y
jnz 00650589 ; detected
/ ~5 y7 Q2 O5 J3 L push 00 ; OF_READ
* l8 b6 ~" {% Z mov eax,[00656638] ; '\\.\SICE'
2 Y9 j7 x' p- T push eax
5 V1 W2 c" d u call KERNEL32!_lopen
/ p/ b8 V9 `' m; s8 p( n7 p1 O0 L inc eax' D6 }, }( c0 Z, ?0 [+ d( a
jz 006505ae ; not detected
! Z' t2 A6 o& d* _# o5 A7 u+ O
0 R8 O0 `, P: m& i4 k8 J" T$ J: h2 ~7 @ W V9 A6 `
__________________________________________________________________________2 ~( q/ S+ x* A6 q
: \8 ?0 _2 a/ ?: ^+ l2 } \6 BMethod 12
+ J" f; q+ M% F* R$ `, [. l. c=========
' S1 ~% E: S9 x% ~
2 P }3 k0 j. Y% m* y0 tThis trick is similar to int41h/4fh Debugger installation check (code 05
L' y o% l! d. K+ x$ A- r& c3 q& 06) but very limited because it's only available for Win95/98 (not NT)
+ T" q2 U% U5 \5 d& was it uses the VxDCall backdoor. This detection was found in Bleem Demo.1 L$ v: |( \$ E" `( T# h0 M
. f8 O& v7 x/ R! n- Y push 0000004fh ; function 4fh
7 c* p; Q4 ?. h3 O+ A push 002a002ah ; high word specifies which VxD (VWIN32)6 F+ k( W" }& e, y6 r
; low word specifies which service
2 _* v5 X9 _" H% D1 Z) R* }1 G1 _4 R (VWIN32_Int41Dispatch)6 O" g7 E0 \0 u! L. a- R2 x# v! ?
call Kernel32!ORD_001 ; VxdCall w7 Y% n8 v+ {& Y! [% Z5 s @
cmp ax, 0f386h ; magic number returned by system debuggers: D* Q- K0 h3 S2 Q
jz SoftICE_detected
/ O! T, @$ m3 _" s4 t
6 j1 O3 R5 a9 N0 b. r& pHere again, several ways to detect it:
- U2 e8 E7 h! n9 L7 r. s, m$ E$ |$ S# @: f/ }/ H/ k, \& z
BPINT 41 if ax==4f
+ {7 D# k8 d2 C+ C
' m1 ? N- A) c/ `) `% s# D' g BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
4 d# Y$ V( w6 B& W# f, f$ H* v2 l- ?9 F: O4 Q. w
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A, ~$ s: g* G4 K2 |% W
' R6 q$ D6 r! B2 s4 z1 i BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. A' O0 b7 h! \! M' E
' e: I5 _2 ~( M$ r: `0 a6 Y__________________________________________________________________________
; p9 p+ x2 h* k* G2 r( u* v" c Y! Z9 j' H* a, z
Method 13
1 r: S n/ i( x=========
- L' h% l7 M- U* Z% f) p+ ~# E P' Z V& Z! p
Not a real method of detection, but a good way to know if SoftICE is- r7 l5 ]* i; h7 s! M0 U( c
installed on a computer and to locate its installation directory.4 ^1 V) z; f! b# C+ o ?( `
It is used by few softs which access the following registry keys (usually #2) :
0 V* X) a: c: n& {0 I( _: \( r3 s& R" c# ^9 h' v
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* {3 ]" a# Q) R0 e! r$ j- }
\Uninstall\SoftICE
) R: T, S" j: l U$ _-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- j, n3 T/ l8 L' f q% m8 E-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- e$ R" p3 v# O% Q8 o
\App Paths\Loader32.Exe/ K; t1 X0 ^1 ]8 y* w. }
! l5 f' G; X# ~3 l( X+ w1 E) y8 V" U; H
Note that some nasty apps could then erase all files from SoftICE directory1 s( ]( U T* U4 E/ ^! ]
(I faced that once :-(" H' z J {1 G3 b! w& U" p
7 b5 N) `( e3 |Useful breakpoint to detect it:5 d: B0 L- i; t$ E3 W7 _/ @* \
* P ^# K8 G$ ]
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 ]2 w% [* C1 d) d, w, m+ f. H: }$ [" e L+ b
__________________________________________________________________________" _0 {# J' I* O/ y6 H
! M* z9 b3 D4 u( x4 r! }/ {' n
2 Q& U9 a8 Z- I+ z* {, r( o- ?Method 14 # R U+ F {* N
=========. _ e" k: _8 U2 L* l" e
& R V8 l, T) z4 ~1 ]( dA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' [) }. V j% y; S! L) ~is to determines whether a debugger is running on your system (ring0 only).
4 `' i; E! A8 g9 z* H, `# i* a' _ h: q5 F% @/ t; k
VMMCall Test_Debug_Installed9 v N0 O# I$ C% M) ~
je not_installed
; u- k$ }# J" N& }2 ]( p
8 v. N1 L( ~$ \2 }2 k/ m- tThis service just checks a flag.
8 w/ S# Q8 H6 j% F' L1 j# |/ t</PRE></TD></TR></TBODY></TABLE> |