<TABLE width=500>7 ]5 o$ N( {( j7 R* s
<TBODY>
) R4 F, ~) K& ~: m. K2 L) u1 L/ m<TR>
# V3 b' f9 ^% g5 Y<TD><PRE>Method 01 7 Q8 x$ s& ^) [/ V4 ]3 S8 Y1 ^
=========
/ m9 ]0 t$ y3 ~4 ?" Z/ C; l# U W! o: d1 z
This method of detection of SoftICE (as well as the following one) is
( j$ S& H* F) `3 ^7 e+ N7 ~used by the majority of packers/encryptors found on Internet.3 L, [# n& Q/ |3 Y5 G( r& z
It seeks the signature of BoundsChecker in SoftICE r6 R3 m) H# z# A/ ?' X3 ?' c' l, A: q7 p3 H
: D: X$ T" D" @! A3 N2 B Z6 |, L
mov ebp, 04243484Bh ; 'BCHK'# R# c% K$ c# {5 W7 s
mov ax, 04h+ I' U' p. Y' g" u
int 3
3 K! i% a, C! A: z9 G5 [) Q" M7 @7 g cmp al,4
) q3 Q% f7 M! L* u. L: L7 f jnz SoftICE_Detected7 ~2 j+ ^4 N8 h
2 N% G5 d8 q& C9 j+ t' G- v___________________________________________________________________________
: e: p- f4 ~+ h0 t, W, I7 T- n8 [1 G
Method 026 `3 Z% y" z" t; m5 s! @
=========- \/ Z @$ B) t" C) r; k2 B9 z, X4 h
5 P. Q. y1 w Q0 S% F! n0 A" q' dStill a method very much used (perhaps the most frequent one). It is used
2 p4 H8 O' I/ e8 b% K* wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,. i; o6 \" v; J, p2 u% n
or execute SoftICE commands...
5 x4 D5 J E3 N$ f- LIt is also used to crash SoftICE and to force it to execute any commands
. h8 E2 u* P* T" t" ](HBOOT...) :-((
' R' C- P2 ?. j0 S( R1 M& \2 O' Y. w& F. H: ^' y
Here is a quick description:& }# Y) \6 a+ c
-AX = 0910h (Display string in SIce windows)
% z/ P, J# j' [-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
: [8 S, d5 @% p$ W1 I-AX = 0912h (Get breakpoint infos)
, ~% @/ l W2 w2 R+ H& x7 a-AX = 0913h (Set Sice breakpoints)8 k. z$ D1 z. U
-AX = 0914h (Remove SIce breakoints)* b% r1 T! Z' j3 B# D& `- k
6 J4 p/ y+ x) j* K7 IEach time you'll meet this trick, you'll see:
0 D$ o0 P+ D3 q- O( C9 ]& E-SI = 4647h
3 S7 q8 O& D% [! V-DI = 4A4Dh" Z! T7 F: `, R: [% @0 d/ x
Which are the 'magic values' used by SoftIce.' C/ D i+ w" X4 C
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ X4 k8 i% |/ x) M5 X+ M" P
# ~5 w7 ^8 y8 D
Here is one example from the file "Haspinst.exe" which is the dongle HASP
, M n' ^ r" F. l4 j& v; @- ?- O/ oEnvelope utility use to protect DOS applications:% @4 l, V4 [$ [/ y8 N1 ^: j& l! M
G1 @# z+ t( B4 {: C& o* A& P0 o7 k" H9 m) l6 Z
4C19:0095 MOV AX,0911 ; execute command.
# t/ T0 w: Z) n2 G0 k {3 e4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).2 A7 w3 ~: e2 X' T+ \3 d* W0 x
4C19:009A MOV SI,4647 ; 1st magic value.
; |( v% k! M5 R+ w. a( s4C19:009D MOV DI,4A4D ; 2nd magic value.
! l& z0 {& L7 L/ A9 g5 V4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*); w# ?3 A9 n5 c0 Q$ n5 o+ u
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
r. g8 ?# y1 ^! q* P4C19:00A4 INC CX, V5 B; M$ w9 t0 f$ s/ T3 D% y7 i8 V
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 V+ }. @1 p! \' `
4C19:00A8 JB 0095 ; 6 different commands.& y$ }4 o, I- {2 J6 `! |, r* N
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
' m' C4 F7 X( R o4C19:00AD MOV BX,SP ; Good_Guy go ahead :)+ g' N* a. H+ l5 h
8 m% T( r- R- n2 J+ bThe program will execute 6 different SIce commands located at ds:dx, which0 Q7 U8 ?( Z4 A
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* A+ y* O: f" p' }' M. t3 |1 s) h- h
8 V$ ~7 V# {% k2 Y
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 H) z5 S2 l5 V( k
___________________________________________________________________________, S/ w+ d' B# o1 h' W1 \- R
" j" w+ ^' y& W- U: u
5 S# Y! k7 B5 f0 d7 \6 V
Method 037 \2 V1 Y4 w) {, \, e9 y
=========8 a3 M2 p' n' V5 x' m# X, a
9 H& _3 t2 p5 p# u; t
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 C( O$ i. D2 O1 n" `5 Y8 w4 C
(API Get entry point)
1 s6 T6 X# u$ J5 h" d * f8 L$ v' `; p2 G% T7 x! b
# ^2 w+ I3 g$ j& d xor di,di, M: P1 y3 g3 i( `& u3 _; P
mov es,di
; |& {2 L! U! g+ N9 C! @% f: F mov ax, 1684h 7 p9 H0 H; R3 L1 l8 w
mov bx, 0202h ; VxD ID of winice/ n1 u+ H0 e1 k# Q
int 2Fh
) L) s" ^$ L6 W# P, c! d mov ax, es ; ES:DI -> VxD API entry point
# m! H7 ]5 z$ O4 D+ J/ M9 _& T add ax, di1 O+ z- u' `8 q* i9 S& i" u. d
test ax,ax j [9 ~9 B# @" B
jnz SoftICE_Detected
% {7 A, Z7 p G ~
1 f1 N- u0 r/ J a% |___________________________________________________________________________2 a1 ]3 ]4 ?( F0 ~% W" L, [
7 F% Z& B, o& d* W! W; D/ U" R J
Method 04, l' K4 W% m( z
=========' u) N: r% h! f" F9 W% R
6 k2 l9 c3 E) x8 B( C
Method identical to the preceding one except that it seeks the ID of SoftICE
1 r* P/ h! Q" {6 \( Q z; eGFX VxD.) B& D, P8 `; a8 X, j* `5 E$ }0 c/ d
; h1 J" b( S5 Z) H2 s% H7 A( H( {3 l+ u
xor di,di
) m; j" @' v& E$ j* S' X- q! N mov es,di
: V+ |9 F1 L! Z+ M# ~/ A mov ax, 1684h 9 ?7 J8 W9 B2 s0 R+ S( y+ X
mov bx, 7a5Fh ; VxD ID of SIWVID v' `! b+ {7 j c0 h6 E4 r
int 2fh
) |: {: i. p4 H* E( V0 f. }( c mov ax, es ; ES:DI -> VxD API entry point
0 K' a$ G6 Q% d' ^# e add ax, di3 o, q; j& `1 L( `0 D+ L0 A0 ]
test ax,ax
) r+ d% k O' U! t- e jnz SoftICE_Detected
4 b& `7 e3 J1 N* U# w' e) w
0 I) {# t) `% l2 Q2 l# P# \4 x__________________________________________________________________________
1 F3 r$ z: F) y2 o
* O. }! Y5 B( T2 |$ ]' f
4 U! O; V$ d( u% lMethod 05
1 ~5 e, o8 r" L8 l=========' b1 D/ F; ]3 Z; u
5 L0 N+ F* b& r% D! _
Method seeking the 'magic number' 0F386h returned (in ax) by all system
# d% |5 S+ k# r, R" }/ Ddebugger. It calls the int 41h, function 4Fh.9 t7 _5 \$ i; D* O/ q" {8 s. E
There are several alternatives. $ J; ~/ s, Z7 c( U3 C2 X- ^
. v8 X( T- S/ M5 p* w) J6 cThe following one is the simplest:
$ g& @1 M! j/ ~7 X0 y
: u5 T# O; Y. Y, C2 J mov ax,4fh2 D9 \6 y! g ^- y$ U
int 41h( U$ R9 F+ L" B3 F; @$ r5 n9 t0 P- y
cmp ax, 0F386
) {: w8 Q) ]2 j* e) z jz SoftICE_detected
& F8 y( @7 ~$ ?1 W3 m" I
5 S5 g+ l! Z' u2 W: @/ e: l' m5 \ L- H/ ]8 l; O
Next method as well as the following one are 2 examples from Stone's
" s" x! W3 q6 j" v& w"stn-wid.zip" (www.cracking.net):+ Y/ l" J6 K, ?7 `+ x: P
# h& x5 E4 f/ j5 R H+ m mov bx, cs2 o$ I4 v: r u( D' m
lea dx, int41handler2# x) ^* d B, x# `
xchg dx, es:[41h*4]
# }2 v x q) |6 R0 E* l xchg bx, es:[41h*4+2]
% {( h7 y! |7 D6 x( p( {( t mov ax,4fh7 m) P! e) r Y; }4 F! ?& W# V
int 41h
1 }. O1 [+ y- h j& t$ `) t xchg dx, es:[41h*4]
3 m- F5 S) ~- B+ F1 l- L/ m5 r xchg bx, es:[41h*4+2]6 |8 @, I# D; R
cmp ax, 0f386h
; E: x( q+ T9 ~* k v/ e jz SoftICE_detected# U9 o k5 F6 e! ~/ e4 z) f
, ?0 U( g% W/ ~" K% q0 {
int41handler2 PROC6 \. k, y& B, D0 U( U
iret
; \0 O' C/ P% I2 t# Q# y5 ~5 `int41handler2 ENDP7 t1 w& b; K1 `7 z" j
4 t; \/ [' W" j( H% g: U6 \6 X* Q8 n# }6 f7 T
_________________________________________________________________________
. U5 P1 ]; j- m4 g P3 C1 l$ k1 Q/ D0 q3 [- S
+ e, W7 Z T0 ~" C5 k( f2 v/ v
Method 06% `+ A+ n `$ d; s9 a
=========, Z' Q9 s y1 b5 x
8 [0 D) K5 k( Q: p, w( c% A- L" c. M" Z
: F: e/ d% O+ f
2nd method similar to the preceding one but more difficult to detect:3 u) e" I9 |3 P
) C B, N- ~' X/ u8 E
" f' [% j( a' a. m2 T( G
int41handler PROC
' U9 R9 M7 ]2 B K7 s" G4 R mov cl,al6 ]7 l' C. A5 O) ]" y' t
iret
' _# b) H; P$ D- Q2 v/ Oint41handler ENDP1 u, p+ C D7 R
: U- K9 ]! v, w x8 X' S0 W) q$ p; L
xor ax,ax' y, u8 g! N _
mov es,ax
3 P* h, f8 `- Z1 T mov bx, cs& p' a0 E, E; [5 R3 ~
lea dx, int41handler
1 l) ^5 F" e F! I9 \5 w g9 l; v xchg dx, es:[41h*4]4 s6 }. B2 c. f4 a' P) s) H
xchg bx, es:[41h*4+2]
2 v6 z# ?; u& Z: l, F; g% _ in al, 40h" z. A. @% x& b5 N( u
xor cx,cx
+ q# E9 O9 [- C int 41h
2 {/ X7 i4 e( Z4 D xchg dx, es:[41h*4]
# ^& F* o* C! m! U/ Y2 R xchg bx, es:[41h*4+2]2 D9 R1 r% p6 h! h8 B% L4 S: L
cmp cl,al, X! j( W& f8 k0 [+ _7 f5 k2 w
jnz SoftICE_detected9 Z# E- B- i, F3 R
$ t \' C/ r6 X2 c- N* ^: P_________________________________________________________________________
+ j9 L; E# p# W+ p. d7 S# A
% Q9 C9 L( e: ?; i. J, f) S2 h0 G5 [4 tMethod 07# g/ T1 ` Z' H% r: Z* Q$ @5 h- U
=========0 M' Q& L K1 m) B6 i2 z% w1 t
+ ?" j' f3 U2 }$ ]& g. {
Method of detection of the WinICE handler in the int68h (V86)
$ N4 q+ @" L8 y: q# A' f
0 w. [; a! d% K6 f* @# Z) Z mov ah,43h
0 a- x, A9 V& O7 Y int 68h
8 \$ w+ }( z5 s! @( z- j* s cmp ax,0F386h
7 ^& A: c+ U( A/ @$ w" X jz SoftICE_Detected0 B* u6 B, f. d0 N% U
$ k) s# g7 x5 x! m8 P& t' E) i
$ v8 Z3 }6 W1 P, Y) E3 S
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, a% L( f! }; X0 [" `, O
app like this:
( s& p; z& v, \6 F, H& ?( \
! [' c; Y5 l6 t- k; j BPX exec_int if ax==68, {2 R% y/ T" d4 }2 |/ o. A" }
(function called is located at byte ptr [ebp+1Dh] and client eip is
, x% O& n" ]: A$ k" ?) \! r9 Z; v! E+ X located at [ebp+48h] for 32Bit apps)
0 I, [9 h5 A# \3 J__________________________________________________________________________
; ?& [ O. x, I0 j4 @+ C1 `; }( m# _* p' p& U, ~
% [5 e0 T+ W7 P& [1 ^0 b0 FMethod 08! b/ m) @6 |0 ?) p6 }3 t% j
=========
0 ]" j. P2 j6 g2 R* E1 t
' T6 b9 y' a! X# n% R% bIt is not a method of detection of SoftICE but a possibility to crash the
0 E3 g7 l6 {" G S" nsystem by intercepting int 01h and int 03h and redirecting them to another1 [3 y5 M! h1 L
routine.4 J8 B' [# @& J G" U: H( m
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" H5 e1 i; I6 E. y! E% R" E) fto the new routine to execute (hangs computer...)
9 U2 m6 @- G' g' Q( k" u* k2 I4 h+ d! D v {* }
mov ah, 25h
/ `( g5 k4 w# e6 C" u mov al, Int_Number (01h or 03h)
3 c( D5 b$ N' C) S1 y& C mov dx, offset New_Int_Routine+ i/ b( S- T7 f. l# Y
int 21h/ |, \$ |0 C$ ]* X9 M: B
4 j4 T7 u* V, Y2 N" |7 \
__________________________________________________________________________# \+ F; g9 B, H% C3 r+ n
4 ^% X& Q- b% I, K# ~& f1 p6 ]' \4 pMethod 09
! X C; m( Y9 X& D=========
, }$ r9 |" w- I& |. [# \1 j0 h* y# v2 B
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: D( K! ]1 ~9 l" O' u+ E# F
performed in ring0 (VxD or a ring3 app using the VxdCall).. o$ M4 e5 e% Z( u9 W: Q# G
The Get_DDB service is used to determine whether or not a VxD is installed5 A, h( ?/ `* R- _5 j
for the specified device and returns a Device Description Block (in ecx) for+ y; t& b& B$ ~ y# Z3 m# A
that device if it is installed.; M* ?! A, f# i; `. T! g! x% L: m
7 D8 C6 {; r" f( Q4 S3 E mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 X. V# G% D0 q' f/ g2 F Q
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
+ ?3 n& }& |; y3 |# P VMMCall Get_DDB7 c: ~! t" ^4 c# V4 k
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 K. i: L- u8 o" \( d8 U
: ?: z3 Q7 w# t0 @8 Y: DNote as well that you can easily detect this method with SoftICE:
{1 G$ Q/ c: j& t) w9 f5 X bpx Get_DDB if ax==0202 || ax==7a5fh
' Y" ~, ]9 Z4 B% F; `- V: W
& K- i% R$ ?0 C0 ?$ A. E2 a__________________________________________________________________________
" _5 F+ {5 Q6 u3 b2 J' W3 Y9 ~& t3 b& C, [" h' v9 p
Method 10
& a9 D2 l# A' Q=========3 A/ N5 L8 K0 g' M
5 B, q2 o! y+ K x=>Disable or clear breakpoints before using this feature. DO NOT trace with0 R7 d6 l& n5 W. E
SoftICE while the option is enable!!
8 X: j, G( J4 p* w2 D0 O7 G
; O3 Z# X$ m, l1 D+ ^This trick is very efficient:
' |0 A1 m: b% P' wby checking the Debug Registers, you can detect if SoftICE is loaded
5 U ~& z1 x1 c0 b9 {3 U2 h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; z9 o0 c5 E$ I( v* a) X- H
there are some memory breakpoints set (dr0 to dr3) simply by reading their
, ]+ f1 a' I5 N2 _8 C# U0 f8 n/ l6 Pvalue (in ring0 only). Values can be manipulated and or changed as well2 K$ h; u$ b# L) |" v8 k! b$ ^& Z
(clearing BPMs for instance)( v3 }% ?% g X0 R( z
: N5 L$ r& Y. ~. L__________________________________________________________________________ ]5 ]- R$ t5 B4 ^
1 O( L0 ^8 g, A/ ]) }! a
Method 11
T5 Z$ a, [5 c2 A- m# p! A2 l=========, U: m$ e7 n8 d# Y9 ~
# b0 I8 k8 ]. |- {4 I4 ^% {
This method is most known as 'MeltICE' because it has been freely distributed; o" z( l- S* c' O- b$ u* Q
via www.winfiles.com. However it was first used by NuMega people to allow
: D& X; Z+ `1 S; cSymbol Loader to check if SoftICE was active or not (the code is located
0 n! c0 k2 w/ N* i. M% `2 qinside nmtrans.dll).
* \2 ]. E5 ]3 L
; L% j: p4 o: f: X, EThe way it works is very simple:
% o* b1 j7 s. i4 [It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, M1 F% V+ n6 r; L: _2 j" UWinNT) with the CreateFileA API., z: t+ ?3 F7 d$ O1 U5 U; e
- d K' l& O9 j
Here is a sample (checking for 'SICE'):& V" i2 b* b" r' J& V3 x
) j, m1 Q7 k( S2 u4 ]: R! l% lBOOL IsSoftIce95Loaded()$ h e& @ b# C
{$ k4 |; X2 `2 |8 B
HANDLE hFile; % v, p& A+ q) o9 v0 Q" s1 t
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( r0 Y6 K h- f0 q! ]
FILE_SHARE_READ | FILE_SHARE_WRITE,: o2 ~( j+ v; P2 h+ Y' t
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 ?+ L/ ?4 A5 B- c% H/ @ if( hFile != INVALID_HANDLE_VALUE )$ ?& B4 Z5 z' }
{* @# I% }& Q4 [; i, J" G
CloseHandle(hFile);- e" e5 Z. P# e& S# p: c, I. f( v
return TRUE;/ q) u$ Y* V+ i6 L
}5 c+ a1 U7 M' y. P& ^3 w
return FALSE;7 q3 F- `$ T+ Z5 @
}/ E* r- D' c& R, @" w/ t2 [) G
( \$ h f0 q# ?4 @Although this trick calls the CreateFileA function, don't even expect to be3 f# j& T7 F, l
able to intercept it by installing a IFS hook: it will not work, no way!
* e% [' B9 n; G6 J" }# FIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
; D5 J3 t1 d: g3 I7 h* p+ t/ wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
% l+ h& ?- A/ L" n5 hand then browse the DDB list until it find the VxD and its DDB_Control_Proc
: H' n$ x* B6 ?% dfield.
* i% n% f @& B2 F& W9 R1 _In fact, its purpose is not to load/unload VxDs but only to send a
& W5 A7 E! P. R' t; C9 n: rW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE), h$ E" Y- M" r% i; J
to the VxD Control_Dispatch proc (how the hell a shareware soft could try9 f' h: u p Q0 s" R
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, [. h+ K4 m% R) AIf the VxD is loaded, it will always clear eax and the Carry flag to allow& p, a2 w, P( B! q- v' ~
its handle to be opened and then, will be detected.
2 A+ O7 U1 q+ HYou can check that simply by hooking Winice.exe control proc entry point* ^& {8 ]: K% y/ l' ~
while running MeltICE.
# Q7 {; Q1 E% e' z- k5 n8 V+ j0 [
) x }* Q* V9 s7 N9 y# Z" L 00401067: push 00402025 ; \\.\SICE+ m4 X$ K5 o! r L
0040106C: call CreateFileA
, e4 j. W7 p4 k0 d 00401071: cmp eax,-001: N- U; ^- }9 {" t5 F; T
00401074: je 00401091
8 W/ K7 P. K$ `& a& T2 l- I# \4 z8 S
5 r; @% m! `! f0 F2 H
# s `8 t0 |3 x1 zThere could be hundreds of BPX you could use to detect this trick.( d- X* N K' i1 P; n
-The most classical one is:
! L% `, D) ^$ S8 k9 c6 f BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
. p. h4 F9 L5 Q8 g2 j* y *(esp->4+4)=='NTIC'
. ]7 ]2 F! S* M* p" O" N) E: v" F
-The most exotic ones (could be very slooooow :-(
L( c* B! G+ v0 k/ o BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
^0 D8 s8 f4 C$ j& F ;will break 3 times :-(: h! I, e( g9 v( k6 E& z5 y6 s# g
8 a# w r' q# ^) i/ h
-or (a bit) faster:
( W/ E; G! X7 n/ E) g BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 L. f# g+ n: t: k5 k7 E
0 \# R7 g! T# @( W
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
6 ^' K* A/ c1 X) p, s5 n+ w ;will break 3 times :-(% R J+ B+ U' V" S3 l n* T
$ p1 c) O* O5 u- {
-Much faster:1 [" g' U! K, I) ]) v/ {
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! d1 i3 q. q+ i
3 |- C: a4 F+ C# c; C; T b: `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen( m" S4 b' B% `9 L3 Y/ Q s
function to do the same job:
! D( S$ j) N) Q3 n; ~
0 N+ W c4 l9 q; J push 00 ; OF_READ2 ^$ m& n/ ~8 [4 F: ?7 ^
mov eax,[00656634] ; '\\.\SICE',0) L) R9 @. c b& a: W6 E
push eax
- M# o; L( n9 S5 N- i: b6 ], Q call KERNEL32!_lopen
: U$ A9 w# w2 z6 p5 @; F U# C4 n inc eax
/ D0 q; S) A* F6 q8 h5 { jnz 00650589 ; detected
! `6 ^/ L8 J& B/ i0 y' q push 00 ; OF_READ6 H" V$ m- J6 S
mov eax,[00656638] ; '\\.\SICE'6 C, N: s( o3 `4 O3 v
push eax. m7 F1 f! L' L! E7 r
call KERNEL32!_lopen
. J1 F A1 f- j inc eax4 E) X9 |% F1 @& p& Z- ~! A6 `
jz 006505ae ; not detected
; q" ~% K9 ] q3 Y$ A, o1 |/ x* M3 ~4 C. X
0 z2 a1 g' b$ U' ?5 W__________________________________________________________________________
0 \& r3 A# D/ Q9 l" ]; c
9 m: Z. S7 Q4 O( o6 Q+ n6 BMethod 12
; k+ _( x. Y& ?9 v2 o=========
* e4 ?# n& K$ b; g
+ `# z' H, `( J4 J$ w8 E; q9 lThis trick is similar to int41h/4fh Debugger installation check (code 05
0 H6 [0 x- a# F3 T& 06) but very limited because it's only available for Win95/98 (not NT)# c. F; z: A8 ^0 t
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.- v! v- t4 |% s# j5 k5 a7 h; A
( E; ?- E; B* l% ~' _$ V$ o push 0000004fh ; function 4fh/ {$ K! y; B* o) M
push 002a002ah ; high word specifies which VxD (VWIN32)5 D$ [% N: R: j
; low word specifies which service
5 @* j k9 T1 k, c# a (VWIN32_Int41Dispatch)/ W$ t$ m7 ~8 P5 q( J. b c
call Kernel32!ORD_001 ; VxdCall
* A& m7 d. `% {( S' U cmp ax, 0f386h ; magic number returned by system debuggers
/ `. a2 Y w2 u$ X* U) k0 m jz SoftICE_detected5 ]8 K' ?% a& b& Y+ d
) j& d% p! g" J
Here again, several ways to detect it:
) A% f- {/ |' S
* d2 i2 B9 L, P2 n% w' t BPINT 41 if ax==4f- T9 Z* A0 ]: Z4 C0 ?! Q# Q
m) t( j- g% w( D5 A4 s BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
1 b8 e9 a: u' m" e- b1 R# D6 g
4 L( Z! U. X' k9 S) s: F! c! r BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A8 l- }- z' z9 P* E: X N" Z
@$ `( N4 E& C$ b. c2 C1 }4 m
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!/ a) f: [: C. N% t; P; X
' v% v! C* y1 c__________________________________________________________________________% k. q: o( ]# U. F; B$ Q) C
/ L+ ?7 K# @3 o6 [- P
Method 139 L: I+ T; w2 L4 o: K1 `$ }
=========
& x9 z: H4 X2 z7 ~5 [1 {
S. ?! i7 w# ?2 J FNot a real method of detection, but a good way to know if SoftICE is( ^% t+ E1 j/ Q) g
installed on a computer and to locate its installation directory.
J" Q# W( y! wIt is used by few softs which access the following registry keys (usually #2) :
9 O4 j+ H# |5 ?" K2 [- t+ s; T1 \( v2 S0 P H1 Q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 v3 I+ |$ L' w) S8 J5 O\Uninstall\SoftICE9 ?. h* z4 q8 ^5 G& s
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. R" t3 {* w6 m3 Q3 B7 y
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ e' S* I+ a5 E& n% Z/ _\App Paths\Loader32.Exe
& w, N' A! O g' ^7 K1 {. T" q1 P# F4 Y' @7 j7 o. C
+ H) d7 [8 S+ fNote that some nasty apps could then erase all files from SoftICE directory
! n$ k; [) F7 r* [1 l+ |# L(I faced that once :-(
. ^" p- T T' D3 k
" s/ w0 L) W( h% c1 XUseful breakpoint to detect it:
9 u; \2 P9 J/ |8 A* t( H t, d' G5 e! Y" g# ]. l" {# F% l& f
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 k* L- q! `% h1 B0 p2 j- R
$ }6 ~* M& O# H( T2 D, _% U% k7 q3 n__________________________________________________________________________( g3 U2 c& f( \
- r, O( n" c' p; d# Z6 F
* b a( H( b: HMethod 14
! g2 y; ?5 C' s# y* e5 s& ]=========# Q$ y# O6 o2 A
- v# C8 @5 z3 `" _2 k6 D
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) x% N$ O2 W% J* l7 his to determines whether a debugger is running on your system (ring0 only).
* s* x3 P. ], P: i( L4 {& h* [$ g, m$ d: l$ C3 l' ]# A
VMMCall Test_Debug_Installed
7 J& p) d1 N$ P& f2 n* U* J0 T je not_installed0 @% O2 Z5 K1 n
" D; ~( Z) E, @) t( j
This service just checks a flag.
# u. v6 C# u7 r. P0 n</PRE></TD></TR></TBODY></TABLE> |