<TABLE width=500>" m1 }+ z: o) a: p
<TBODY>8 m. X& |& a; U9 F- y3 j, I5 _
<TR>
+ s/ r1 H, X7 }" {5 V! B<TD><PRE>Method 01 + j2 [/ y% S4 S2 I; h8 Y# b
=========3 d, v5 t" X [" j# C5 I6 l2 i
5 e% f# h) D$ {* g% K) C$ J3 q# }6 bThis method of detection of SoftICE (as well as the following one) is
8 H; {( H8 U9 t/ Qused by the majority of packers/encryptors found on Internet.
, e# p9 ]3 _9 c4 F+ t( eIt seeks the signature of BoundsChecker in SoftICE& N7 W, @# U0 k$ p' O/ K
9 F5 D5 v1 @- M' g' ^! r( I
mov ebp, 04243484Bh ; 'BCHK'
) R; {: ~* E8 S, b2 a D mov ax, 04h
7 B! x3 n0 s5 C& G int 3
$ U- F: d( {+ L( G- c0 Z. C6 Q; d9 W cmp al,4
+ I2 ~% J6 d; T3 `* R# S, X jnz SoftICE_Detected6 L+ m7 _5 ^# h6 m, G, ~2 Q
; F2 y$ X+ |6 p* o! X; a___________________________________________________________________________
% N# `2 c! P( C( ]$ Z! p$ ?
7 W: A/ E- N( |3 t% [+ GMethod 02
2 T9 Q7 D6 q* o0 C0 I9 U8 a" |=========, F$ @* x) s: U$ F- @) M& P# i& ]
. d$ {# s3 }- a! WStill a method very much used (perhaps the most frequent one). It is used+ w! H* W9 t! }- c1 ?" G1 C; z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 E. r0 |% R0 Z& k3 { por execute SoftICE commands...
% \" a8 D) }+ v" cIt is also used to crash SoftICE and to force it to execute any commands9 { N5 P/ b. P% |' V
(HBOOT...) :-((
" X" o" L5 z% K8 \
* e& m/ }* B7 j: A- z4 Q( r+ ~Here is a quick description:
, s A& Q2 r' A+ w4 U# Q) v; v# k-AX = 0910h (Display string in SIce windows)4 h8 t+ k' R8 t& a9 ]9 @& D8 I+ _
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx), o- K8 X K/ s% R# w7 R
-AX = 0912h (Get breakpoint infos)
/ P* l% ^8 o( z% D-AX = 0913h (Set Sice breakpoints)% Z# e8 d/ g2 Y; c2 \$ k) W9 W
-AX = 0914h (Remove SIce breakoints) s$ J9 o1 j4 g* s0 X5 R
0 E0 ^7 Z" q3 D s, _$ i2 tEach time you'll meet this trick, you'll see:0 W {+ b5 X9 j. K
-SI = 4647h
' G7 f+ X/ q _6 e6 ~; a ^-DI = 4A4Dh: e$ ]! r! z. i7 B( O
Which are the 'magic values' used by SoftIce.! z9 t. r3 m0 o, W9 b7 J
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.0 h0 X+ |3 a& _. @, l( S+ l5 m
3 j" F. f/ B. O
Here is one example from the file "Haspinst.exe" which is the dongle HASP
( A4 k$ o3 b5 |: gEnvelope utility use to protect DOS applications: F/ Z# j% K1 w: B ?* \/ N
1 S0 \& h3 C4 F$ `
, z; X" c/ y1 C' W6 i6 z
4C19:0095 MOV AX,0911 ; execute command." J( D3 B. o! ]1 z$ v" ~( s
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
' b% r8 y5 ]2 k9 t6 E. R! m4C19:009A MOV SI,4647 ; 1st magic value.
: @& Q0 k* t. Y' p# Q4C19:009D MOV DI,4A4D ; 2nd magic value./ i5 D* L, u8 l Z
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
' C2 {5 S3 ^4 \% i4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute# `7 {- A/ ? `& V) F* @% |, A
4C19:00A4 INC CX. [! F8 l) N; x: o) S
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute {4 B7 Z0 v# ?0 e9 |1 I
4C19:00A8 JB 0095 ; 6 different commands.
9 T3 C; b; f' i9 c0 E3 h9 o( v6 [4C19:00AA JMP 0002 ; Bad_Guy jmp back./ D3 F! w9 T# r* J. B7 _
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# K/ U8 o: n3 n3 c: w1 G. G" y5 m& c+ u$ G" Q9 J4 |
The program will execute 6 different SIce commands located at ds:dx, which- ]9 ^6 f4 C( F/ h" C7 y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% G; t/ M. U6 M) K3 Y1 R
; F, ^" M; Y& y. _0 F
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded. s1 P8 h; u" X' L
___________________________________________________________________________' f3 W" v6 u; P: g
& Z" L( _& G+ n: n* {" o
X, I$ z/ Z9 ]- u
Method 03
l) y$ V3 n8 y7 s=========, p" i1 `) u6 @% C/ d
2 }* E% d. e) `, s. z# l7 h, HLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 v9 f3 y3 X% N: d" u(API Get entry point)0 ]; e) j& n* n$ }
0 ?& m1 x8 U" ^
8 c" ~0 r; s8 k/ q$ T0 w9 W xor di,di5 q% r8 t) W( v6 w3 i4 T
mov es,di0 x S1 Y$ F ?. h7 K6 X
mov ax, 1684h 4 |2 j$ d7 @ `- T& E9 k
mov bx, 0202h ; VxD ID of winice
; w$ j" A, r) g, Z6 w. I$ ~ int 2Fh* \$ R# ?. b( a) G4 ?: a
mov ax, es ; ES:DI -> VxD API entry point5 C" Y4 Q o& ?3 x
add ax, di
6 u! m) c0 o+ y% c' f0 s test ax,ax
6 t- [$ q: c" ~$ o I* H jnz SoftICE_Detected
) y4 Z/ `: @0 ^# Z3 x. \% B
) l& p- K4 A. E Y" N0 s' T p% _2 e___________________________________________________________________________
! G4 X9 ]% I$ @; j
& ^' f9 f. g' s+ ?Method 04$ }" [1 g: h* U* \. m( r
=========
, I6 [: P9 C2 j5 l( a0 u' I9 ?( H' @! o5 o' J7 V8 |. [
Method identical to the preceding one except that it seeks the ID of SoftICE$ V3 s1 a' x' p
GFX VxD.
+ V1 T0 ^: K! R
3 a, ]. D$ I! C6 ~* n: g xor di,di
$ ^1 |: p9 V: V( J5 G mov es,di: m# X( }2 K6 u
mov ax, 1684h
1 }* k/ |6 s; S0 s: R5 s mov bx, 7a5Fh ; VxD ID of SIWVID
" L2 v! J) l; w% F/ z* j int 2fh
; D) j6 e3 O# f9 j% K' V* X mov ax, es ; ES:DI -> VxD API entry point% k: g$ O" k' B: c- O
add ax, di6 w. K2 P* Z/ ]5 F( I9 J6 O
test ax,ax
5 y `& r, I$ {( y" a) j7 j jnz SoftICE_Detected* W! a/ C+ q- R5 Z
5 G! _( }) S9 H$ u/ @/ {
__________________________________________________________________________4 c& k: ?6 g6 }2 J2 n
1 F7 W; L' ^. K2 V. c5 R2 e# M
; E& W# x" y9 x3 L" M3 f' H
Method 05
0 _7 G0 }' h3 i+ I=========
# _7 D# W' a( p1 i' ^7 b( D" O" ~8 T0 _3 W0 q: E
Method seeking the 'magic number' 0F386h returned (in ax) by all system3 f' J$ f. v- i2 ~ J/ q8 D) N; ?5 E
debugger. It calls the int 41h, function 4Fh.
, x+ Q0 b! t# O' C9 n( pThere are several alternatives. 5 D* h \6 ^6 O' i
# L# h/ h% K) _* e, @1 qThe following one is the simplest:, w8 I5 D$ N: N$ ^& q7 p4 a
' m6 A+ s) D4 @' w6 {8 k mov ax,4fh
: |- }- q2 W' f- R3 { int 41h- }' q' Z. K# Q/ P5 m! g
cmp ax, 0F386; |9 w& g8 d2 }! X j
jz SoftICE_detected
* L) f. U9 Q" u! M* i% y& E
2 _+ {1 W5 d: M8 u! N- d8 r0 }( k( s; j
Next method as well as the following one are 2 examples from Stone's
$ i* Z! ]9 t7 q; ~( a( g"stn-wid.zip" (www.cracking.net):
# U7 F+ }7 E5 d, L! U; c$ a( U, h9 w* }2 J8 u5 n
mov bx, cs
3 W2 I [ g* n5 a2 F8 @' i! V lea dx, int41handler2
% T$ C2 C- k4 \3 C4 F' \ xchg dx, es:[41h*4]
5 U3 o" L( I/ m L, n1 X xchg bx, es:[41h*4+2]% x0 @1 d3 ]: g% u+ \
mov ax,4fh
& f, {2 V6 l2 [9 [# @/ K int 41h
) b: L3 Q$ X" W) }! N xchg dx, es:[41h*4]# c8 W- A6 @2 K% ?( N7 I: {
xchg bx, es:[41h*4+2]
) u0 D: I9 h" e. d( r( u1 Z M cmp ax, 0f386h5 X# l4 Q. H4 F/ ^/ z% Q# J
jz SoftICE_detected, Q' }6 F9 @2 ? D& V' l7 e
% ^( o8 k+ [, o1 ?; r* Q. t! r
int41handler2 PROC; n5 P# c% B0 P0 _
iret; l5 ]/ `, W% ]1 ?; c
int41handler2 ENDP& y" ^3 d2 ]5 H4 S; }$ ]' N
6 \" \0 q- b3 o0 F8 m1 O* O' f
& _$ o8 y' Y7 [_________________________________________________________________________
/ u$ ^ f) O6 o& A
. h- t, \( `. N" `! j2 s$ p& r1 Z: E$ ~. f
Method 06' o1 D3 F8 z+ \- a6 Q* J% S
=========
1 c( P; u( M- T+ t# S. |. x9 [ c4 k& C( G- W( Z- [
2 p1 k4 o5 a3 I& u! l8 L
2nd method similar to the preceding one but more difficult to detect:# x8 y- h( \' u) z4 Y. \/ G
9 z5 T: K* X! M# }" X
. o3 o& q: I+ w$ J vint41handler PROC) o; p [. ^5 A& |) f5 ]
mov cl,al- {" {: h, {( |) A5 n
iret
* V: w0 Q, e1 {( H v: Fint41handler ENDP% u9 x, f& Q- E6 A9 G0 H, i8 u
' u9 x/ a9 S/ ]3 n, H. R
$ t; }8 K% b( ?& R8 o8 Q, ?) T xor ax,ax5 D+ s) C, M8 M2 c3 B& L5 V
mov es,ax
# e6 m! S/ ^' P) d mov bx, cs
+ F9 y# V# F5 ^% X' A8 T lea dx, int41handler
6 r) z; f% P- P7 a4 h# Q xchg dx, es:[41h*4]* ?! u- I( c+ ^6 _$ r
xchg bx, es:[41h*4+2]
( ?4 k4 R0 K+ R& c+ l( [ in al, 40h
+ E1 Y8 J+ c* ~; v: R+ d xor cx,cx( p: P8 T1 n8 [( I8 |9 Z! e
int 41h* H: L5 A8 X/ U3 e2 M9 Z" V+ L
xchg dx, es:[41h*4]7 h7 R& B; S* s
xchg bx, es:[41h*4+2]! N. W& S$ ] j6 v
cmp cl,al
" i, @ K- j; h- w* F7 _! o+ J; E jnz SoftICE_detected
6 e9 _ `; \7 M Z) v- R8 w- C( b9 d# S
_________________________________________________________________________& X1 C1 M% p# G6 N p) x
' G$ d. L: _, a! t4 MMethod 07
" K$ i7 `! o8 T; M=========
7 B- E( a9 @0 Z, D! k. H' P: b6 z5 Q, _
Method of detection of the WinICE handler in the int68h (V86)- l6 F6 N7 M5 B* z
* f7 p G# L# p; L! K$ a
mov ah,43h
: K- j C, E' T$ L, j9 `5 w! h int 68h
" R1 M' x6 v1 p cmp ax,0F386h3 ~% M' @! g- }4 s2 |$ e
jz SoftICE_Detected8 P7 E& i- u- H$ y9 B9 v6 A6 k6 k
& ^, x0 u) ~6 o; M# O# _7 V; O- z
! j- d6 D- S# o5 o! A% P, e
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& s% S8 R& ^& P! g" J7 J; n
app like this:
) ?" g1 I* f+ A+ a0 p
. c) x8 K! g9 ^& \3 e BPX exec_int if ax==68& [/ }' C0 w% t' t+ G% H
(function called is located at byte ptr [ebp+1Dh] and client eip is1 a9 e ~9 j; P, l, I3 `
located at [ebp+48h] for 32Bit apps)& P! ~! t$ C6 F1 C9 E9 X
__________________________________________________________________________
$ a$ L# H& G' ~ j5 H$ z% C, M+ e8 t1 P# u9 A
, G/ s. |* y. j) S% A. F: L6 {
Method 08
2 s+ M- `# z$ ?5 B5 j8 L8 d2 ^=========
) ]3 A* S$ c7 G6 \9 p
, ?! d9 m j: R( \ E$ F+ UIt is not a method of detection of SoftICE but a possibility to crash the
; P/ x# A o& ysystem by intercepting int 01h and int 03h and redirecting them to another
& m. R7 f" k% V! j4 Jroutine.
3 p) {% G7 a. |4 JIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ d- w0 ?( d+ ?; a6 j+ j
to the new routine to execute (hangs computer...)" ^5 ]6 u1 J2 u& C1 v
& q: @: C1 ]& E5 S mov ah, 25h
8 F4 ^0 Z3 m2 L! |4 ?; O* G mov al, Int_Number (01h or 03h)
# R9 s# ^2 B! Q$ V( f: `) o7 [ mov dx, offset New_Int_Routine
$ o% F$ e( K: h0 n4 Z- {8 E( V int 21h
( {! u& Z7 g5 c7 M5 Z! ^8 }' ?6 M' K& \) G" o3 X7 i+ Y
__________________________________________________________________________4 m' V3 c# `8 H- C+ v2 j
5 T3 L% }" i' i2 O, d6 C% ?Method 09
% {# Z+ f/ l1 _+ K=========$ S) M! `2 w- F" l' t
* W I; B6 q$ w8 {) g. _: r) Y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, v# g/ p$ X0 Q4 \/ z5 Y& Q) Uperformed in ring0 (VxD or a ring3 app using the VxdCall).
6 D% P$ |% L4 [. \+ W# r8 V5 TThe Get_DDB service is used to determine whether or not a VxD is installed W" O6 i [7 N0 O
for the specified device and returns a Device Description Block (in ecx) for+ m: U6 f3 s Y1 w- A/ Y6 u4 V
that device if it is installed.; G6 w3 x" n# Z p" N
2 c; `8 k9 f( a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: A& M# g' r# P* O$ ^5 T
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) H7 b! J8 Y9 x; M VMMCall Get_DDB
+ p4 \2 \3 f/ b6 y- W mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) T% o- n. \6 |* B
6 c- [- ~4 p: \0 i
Note as well that you can easily detect this method with SoftICE:
. ]* D0 q/ ~5 L7 | bpx Get_DDB if ax==0202 || ax==7a5fh' h4 g& c9 E @: t; E+ F
, O9 [6 f8 ?' h5 X$ K' ?
__________________________________________________________________________
5 |& [+ [ h: J" m# G; f5 H, k g1 [0 e
% V6 F4 f0 _6 K& n9 }1 dMethod 10: k4 v5 j) p+ u+ K
=========
0 }1 ?; `& T- m3 ?5 l1 O; b4 }5 V3 @8 Q& r& P
=>Disable or clear breakpoints before using this feature. DO NOT trace with
% g$ r: @& P3 E SoftICE while the option is enable!!; M$ n$ L2 F: F
( i; J% O9 Z4 N9 @
This trick is very efficient:& I* p0 k X F" Z% W5 J9 E3 j
by checking the Debug Registers, you can detect if SoftICE is loaded% ]9 i. M+ r7 M$ K4 J' u- N) n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, ?; T3 c, ~5 e5 F+ M3 sthere are some memory breakpoints set (dr0 to dr3) simply by reading their
- a' I+ }7 F5 j1 o( r0 P" Avalue (in ring0 only). Values can be manipulated and or changed as well" x4 W9 o& o1 ~! j
(clearing BPMs for instance)# c6 o4 C+ O" L4 P/ G
8 `' k; d1 Z5 h/ `% f( t) G
__________________________________________________________________________% C' F% E0 j% d& a3 U
9 t7 K" j5 S5 q0 K4 q, v
Method 11
) R4 }$ K" x5 r. q7 s$ f=========
6 B1 ]/ s) a# A* b& Y9 F" E8 z( a& z! C6 _
This method is most known as 'MeltICE' because it has been freely distributed
4 X! i# i. W7 H: Vvia www.winfiles.com. However it was first used by NuMega people to allow; v- I G0 l7 c( S
Symbol Loader to check if SoftICE was active or not (the code is located
7 d) r0 ~1 k+ W/ S7 M: W; Hinside nmtrans.dll).0 n: Q. P7 {' Y: V. Z3 S6 c! a
9 B. ]$ }" G$ k, J% r |The way it works is very simple:' x6 i4 p$ ?9 S J1 k
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for* q. u0 F* M" E* m+ H. {
WinNT) with the CreateFileA API.
) d1 {8 j' X* x$ W$ g
, {. w$ U3 V$ ~* ~% C& {Here is a sample (checking for 'SICE'):
& _0 M! r- \; Q) A# l
; x S9 Z; D4 o8 oBOOL IsSoftIce95Loaded()/ S- m4 c' [6 `. H' s, e) r* I3 I
{
2 i# Y, V& a' ~5 U" L- ^ HANDLE hFile;
/ K8 R" C* ?3 D/ k9 Z5 R hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' j6 ] j# c/ v# c. \( S FILE_SHARE_READ | FILE_SHARE_WRITE,( P9 f- F" h# c& Z, x+ X, a
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
8 f2 A: v! ?9 ^$ k( b if( hFile != INVALID_HANDLE_VALUE )$ X1 W# f* _. M- _) d+ [6 W' U
{/ L$ n3 Y) G: C* w: v: x9 e
CloseHandle(hFile);
, K- k R6 P. f6 S return TRUE;
$ ` H1 P9 B( @6 j: i% x }
8 c) U' t5 p* t$ o; R& Z return FALSE;
. q9 B8 @; k0 w" A, P7 i( _}. ]. u' t# t+ x6 k( \
' N! ^0 q+ }$ D+ D, A0 g7 ~
Although this trick calls the CreateFileA function, don't even expect to be
! o: W. i8 _$ B$ r3 S# B( h2 Table to intercept it by installing a IFS hook: it will not work, no way!
3 l7 j# d; Q9 |+ J& C: q: [In fact, after the call to CreateFileA it will get through VWIN32 0x001F% E* o; }, {# B: [. N \8 z
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
! A% K$ \: a% Y& E6 a* C, m& Mand then browse the DDB list until it find the VxD and its DDB_Control_Proc
# Q; c9 a2 d8 {$ h j- Nfield.
( N6 T; W- D3 K3 F; dIn fact, its purpose is not to load/unload VxDs but only to send a
4 ^! y2 U, F$ b- v. y7 A& VW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* C, v, t' c, S( e/ \1 z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try; B, ?0 o5 l' O& F' c
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
) Q+ q- D% R( R5 O/ z+ tIf the VxD is loaded, it will always clear eax and the Carry flag to allow
; f9 l* `1 \% ?' O- d- cits handle to be opened and then, will be detected.
# A; l4 u& D* I2 V$ F8 LYou can check that simply by hooking Winice.exe control proc entry point
9 ]9 U6 h" w; a$ u$ L1 Pwhile running MeltICE.
2 C# N- ]6 }, U3 g6 N a( L
4 ~/ V/ \, _% F; C. S1 z/ ]+ p7 R; A
00401067: push 00402025 ; \\.\SICE! J: }; {3 ?8 s
0040106C: call CreateFileA, v2 r5 \5 C/ }5 G1 y5 b
00401071: cmp eax,-001' W1 b* c' E9 z$ p
00401074: je 00401091! m, g' s' J- N9 i: H2 V
1 u/ N* j1 {* j
" z. A* N' J( eThere could be hundreds of BPX you could use to detect this trick.* A" `6 N/ J+ @# ^
-The most classical one is:
" L! ?4 ~/ I. c6 l BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
) \1 n: v( m5 I9 g, m6 D *(esp->4+4)=='NTIC'
* h5 a* J2 A6 g- o; n5 f4 @% } k) f, c3 G1 r
-The most exotic ones (could be very slooooow :-(
& M. e f4 P5 k' \0 _2 G. e BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
|# M2 o" J, h, v6 ~" t7 ~ ;will break 3 times :-(
( n. N- ]) Y' U5 I2 V! ^: U* l6 B( T6 U
. a4 w+ h( Q, ^# p-or (a bit) faster:
4 y! u0 L* L, |; K$ R BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
@3 ?# S6 J* C% J& B# E" o- T' D, i: l( r; {; Q
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 6 i/ _+ j1 K" g0 a
;will break 3 times :-(* B' [% z% `) v; r9 a o. t8 F: ]
7 @1 c) x) I2 @0 `9 U( P
-Much faster:
) g8 A, I) v; j2 Y- v% I BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
, _6 M4 y0 g9 p) S- a
* O6 ]4 p$ L/ p; L: ~" s4 |, o: `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen) L7 x9 }) K6 b5 \5 i* h
function to do the same job:
: P0 b0 }. Y4 M2 n
~# k K8 k3 c; B j push 00 ; OF_READ
6 T9 @- k# U0 E9 r; t+ r( I mov eax,[00656634] ; '\\.\SICE',0
$ D( c! q# O" k) ^) n push eax- ?& I! S r# {0 l# t- N
call KERNEL32!_lopen" ?1 K1 V1 t( A& N$ p2 k, Q1 ]
inc eax7 K1 }5 B( [( m6 U7 O2 H) j. p; `
jnz 00650589 ; detected R: X4 l. j, F6 I3 f+ r; y) j
push 00 ; OF_READ) I! ^' S. N) F& S! Z; t$ x. b+ `1 A/ G
mov eax,[00656638] ; '\\.\SICE'0 u; \( K; z% m8 q- h
push eax2 ]+ J6 E1 P e% K
call KERNEL32!_lopen
7 \/ V! o- [0 x, m+ y( k inc eax
2 R1 g( @5 ?( E, Z, e$ c jz 006505ae ; not detected k1 \. t8 u# U" K: ]: S
$ X! @/ i$ z% A* E
' U( n/ s( v$ m
__________________________________________________________________________$ W/ x7 ?- k J0 a' [& P
$ V \& F( R8 G# K+ I5 U
Method 12
( D9 M A+ \$ \1 f. a6 Z=========' S9 x5 j% f0 t" ~# f) R$ m
0 `. U7 M2 C9 p0 m$ T+ f: n- ]$ VThis trick is similar to int41h/4fh Debugger installation check (code 05 r' C( A6 t+ b6 Z* |, D( }
& 06) but very limited because it's only available for Win95/98 (not NT)' m; t% a0 R+ B, Q% ]3 R& Y/ K
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 k' O9 E! E5 L2 j c( h* a9 [# s" D
/ a% @6 w @4 u1 n6 O
push 0000004fh ; function 4fh
l$ _* v3 G G$ N t push 002a002ah ; high word specifies which VxD (VWIN32)
( Q: k7 u0 w1 {' S2 G ? ; low word specifies which service) n1 g, `- O! {0 j% q! L
(VWIN32_Int41Dispatch)+ ?5 n2 z) _0 m* w' s( O
call Kernel32!ORD_001 ; VxdCall
! _- o) ~3 W8 T0 B9 U9 O- y cmp ax, 0f386h ; magic number returned by system debuggers
/ E. U4 Y! S$ V: b jz SoftICE_detected6 ^; C- Y7 F9 Q2 O2 Q, |; ~) H- @
. ]8 p/ f2 L7 r3 gHere again, several ways to detect it:" f# p+ P+ M2 R0 \% b0 y
' Y. b4 |2 J2 P3 ?/ B
BPINT 41 if ax==4f
1 b- A5 k; |6 n8 t
+ ^( c6 D7 r6 i4 X BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one4 t6 ?8 d7 l# C. N7 j2 Z
+ g8 T: {0 Q, [( g+ J
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
( o( q$ P9 T$ n) @: s
/ J" C7 v8 t; b5 l1 f( z6 n BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!# ~/ i% p& ?5 Z" \- c Q
) p' D! ?8 s+ s2 O" D S. ~__________________________________________________________________________$ U7 R6 n5 {7 x$ u0 Q( \
8 Q3 ]/ _' a" {! \$ {7 uMethod 13
) ?3 j2 b2 {3 {4 _=========; F" z) _* X( ]( D( x$ z
) o4 ~6 T/ n: N7 x- e( z$ w6 F
Not a real method of detection, but a good way to know if SoftICE is
: {" k' H( L% S* O" l$ D% N8 I+ Yinstalled on a computer and to locate its installation directory.6 L. n& r% p0 w
It is used by few softs which access the following registry keys (usually #2) :: W D% @' |4 v8 I9 g( P9 ^$ e+ Z; q
8 A* X( q0 j- Q+ f: g& _-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ w: N: e& q& }9 L, D\Uninstall\SoftICE( O' S q% e6 m2 b* G( j1 J( A! j
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% B% e- d) x) L5 [. N
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 k( g# V: P+ f8 ]- b7 G7 i' X- n\App Paths\Loader32.Exe5 D9 ~% s8 I: x3 ^0 Q. f, H9 |
' M+ {0 ?$ X$ A+ M% B
9 b4 |2 K0 Q6 |3 p' H$ t+ Z" w4 [
Note that some nasty apps could then erase all files from SoftICE directory c8 M" z' X5 U0 Y# b Y+ @# Q
(I faced that once :-(0 A8 x% R @9 Y* Z8 f
1 a9 q ^, l9 g E+ a8 X3 O5 o8 n$ kUseful breakpoint to detect it:0 b& b3 x7 U+ Z' v
3 j6 n; \/ [1 f! E. L3 l BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 k& _- j u8 o! S/ Y4 z( e2 F, n) P
# l! G( Y \! S, k7 E__________________________________________________________________________
0 q- p/ A9 I0 B) T" M3 Z$ u0 O% T# w M9 P0 u4 S/ q1 A3 p
3 X, G! I/ q/ W. F
Method 14
% N- y* \0 z4 Y=========
; r" U! _0 b9 }7 G, Q/ Q) w1 b. y5 F( P! @' s, @
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- N! p( i& ~7 I; ?7 B7 x$ Y6 r `
is to determines whether a debugger is running on your system (ring0 only).
9 p) c/ `) h) } v! m" Q4 K" r$ v* m3 ] \& g6 r4 j) s
VMMCall Test_Debug_Installed
; m& a2 O: v; B$ Z je not_installed6 Y \3 S! B) ~" _- c: n
K0 b/ `% M9 x8 l+ @" F
This service just checks a flag.: J0 P- H/ Y; [3 a
</PRE></TD></TR></TBODY></TABLE> |