<TABLE width=500>$ g0 ?3 ?5 D0 ?: f) {$ S7 C6 c: `
<TBODY>
) W( B, z. N S* E" u+ B<TR>5 v0 i9 B+ _8 Z4 N
<TD><PRE>Method 01 ) A8 T+ {& T* @: s9 I) N
=========
. b! V+ B/ [" P2 m" D8 s; s0 `8 k- D* |1 }: G l, x
This method of detection of SoftICE (as well as the following one) is& o* I; Q' P- g5 e/ `0 t5 S
used by the majority of packers/encryptors found on Internet.
' A7 G4 O# M, G) l2 l7 Z4 w( U! FIt seeks the signature of BoundsChecker in SoftICE' M X# `% E9 P2 s+ i# ]
S: G! ?& A& e0 o( t4 w mov ebp, 04243484Bh ; 'BCHK'- j7 Z( d: ^4 p; C* E( l
mov ax, 04h1 h! v+ T0 O8 k2 @
int 3
7 f9 m; b* j. B' @" C cmp al,4$ h; }- W) s) W; H
jnz SoftICE_Detected
- _; i. x- j ]' Y
, o9 @3 F6 A4 W0 P% d1 W___________________________________________________________________________8 W; x Z, ^9 K* F4 ]6 c% j3 t
* }8 I5 L2 s5 t- M+ I% m
Method 02% C9 P8 H5 [- E8 S5 p
=========
1 E5 v6 N' r' V K i. B+ a$ X/ m: ]2 R& `4 y9 {: r
Still a method very much used (perhaps the most frequent one). It is used a8 x1 j v6 r5 X
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,( P( X, n- g1 H9 g, R6 n3 y
or execute SoftICE commands...% }; o3 ~) O2 z3 g. J0 @6 l. n/ \
It is also used to crash SoftICE and to force it to execute any commands& h# {$ C: ?3 ^+ n k! I. E+ i
(HBOOT...) :-(( ; ^0 T4 L( E. p2 U3 ?6 u
( k2 \6 K) l7 f8 p: S* T' i7 L0 nHere is a quick description:7 t: K! o' J/ L+ c- b
-AX = 0910h (Display string in SIce windows)
3 `7 s! U2 s; y c2 u5 o5 ]# o-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
- p. A! v" U8 `-AX = 0912h (Get breakpoint infos)
( J' ~# x7 k; b4 E6 i* T9 v- O-AX = 0913h (Set Sice breakpoints)
! d3 g _1 v5 S2 ]/ h. Z; t4 i-AX = 0914h (Remove SIce breakoints)
8 ?8 v2 h; j/ g5 u$ m B
/ L& X# L* x: M _Each time you'll meet this trick, you'll see:1 i% p; \! w* Q9 S+ S7 ~1 Q S p3 v
-SI = 4647h G& P8 n( H q
-DI = 4A4Dh
0 v" y/ y) w8 X. AWhich are the 'magic values' used by SoftIce.
) \+ |* l+ M0 h3 t+ ?7 QFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; m' ]. ~8 `9 Q
' _$ t( C8 ~9 x" l3 Y1 BHere is one example from the file "Haspinst.exe" which is the dongle HASP
1 `7 @5 Z! A* x5 u- \Envelope utility use to protect DOS applications:) p _4 o) Z. l8 y W
7 E" P/ R5 E; Q& J: F- @$ D. B' v# @7 a& V; T0 S* {" P; z
4C19:0095 MOV AX,0911 ; execute command.2 x# T( d8 v$ G
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; S( A K: [( |% H
4C19:009A MOV SI,4647 ; 1st magic value.7 E# h% s) @- a; R6 s
4C19:009D MOV DI,4A4D ; 2nd magic value." H' v5 M% C1 s4 n6 I9 C8 b$ F
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# [: |+ @* t _0 C q, V' e$ D6 A4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
) F+ \$ A* F- B+ Q/ s: K! ^: \4C19:00A4 INC CX* n# l& E$ Y8 w0 o3 M
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute# N7 T$ ?: T- t! ?: L! u
4C19:00A8 JB 0095 ; 6 different commands.2 D9 T- U. W. E: S% [7 [
4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ J* H b% y8 p+ ?. d
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: }; ~( S5 J- ~* ?; s' d( F: Q2 o7 k: h* j3 G+ M4 A
The program will execute 6 different SIce commands located at ds:dx, which
/ Z5 X2 z! d5 P8 Y' j& O/ Y( }are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ O1 Z5 Z. N3 y% I2 [3 Z6 a: `7 _
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
5 a, V D" N9 \___________________________________________________________________________4 `" S0 v, h2 G0 i9 @. h1 I" H
8 b3 p* k' X: m4 O+ U$ W( `5 E" k$ X
( X( }% E b' e
Method 03' c' E" J8 l4 r) N, S. u6 W4 P
=========
1 [/ e) z C& a4 T) c) O0 o& `! C4 T9 S4 S8 |. ^- @
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' }1 n. p+ x% b! D% D; c E
(API Get entry point)9 X! g( [! L! Q' y+ g8 D6 V4 q
! L! ]* b- M7 M. X. O8 j, b. [! f; L( U! ]2 X) @
xor di,di8 b' b U7 } p' p5 Y- o2 b
mov es,di
% H+ n' T6 X6 J7 C mov ax, 1684h
! i0 s$ g1 ?" t- ?2 [- }2 u4 e0 N mov bx, 0202h ; VxD ID of winice* j, e# M; R7 y" x
int 2Fh5 C9 x3 R# o! E. D+ J1 Q
mov ax, es ; ES:DI -> VxD API entry point
, H; O$ D& d: y7 e- K$ b add ax, di( I; |, [8 k1 G0 S0 x0 w
test ax,ax
3 q/ z8 F' |/ f7 F# A$ Q/ F1 s6 F jnz SoftICE_Detected
$ l- `- B# V: z8 Y$ ^7 K5 J
\1 s2 y7 J( Y/ t9 [( x h8 D___________________________________________________________________________
5 j9 n. D' Z8 j2 ^) p& j8 g
; D7 z$ k, {% A8 U7 e% vMethod 04" h: k* ^. ?6 s& @: M3 D
=========* w4 K9 M2 [$ s4 a+ x+ g" D/ ~
4 T7 S2 v. {3 p+ p0 u9 s3 ]" L1 NMethod identical to the preceding one except that it seeks the ID of SoftICE5 K6 ]9 t2 y1 u; h- m
GFX VxD.4 s T: _) v1 Q$ \" |. j# }) U
- m; s# ?, g3 S xor di,di
9 y$ J. Q/ n" h2 v5 T" o; t; _ mov es,di5 Q2 y+ K3 e! N! K2 A' P
mov ax, 1684h
1 t/ ]# ~3 e, g& ? ~4 b mov bx, 7a5Fh ; VxD ID of SIWVID4 o4 L% E% M. q1 W) ]
int 2fh4 C4 M! [2 o: \! X0 a; D. K3 Q* k
mov ax, es ; ES:DI -> VxD API entry point) w' e/ m" x% c7 n+ b7 ~1 P3 l2 _' w
add ax, di
( {& g: [2 s" Z z5 B" D test ax,ax
, Y6 r/ q) G: A7 b3 N+ m jnz SoftICE_Detected8 n; l1 n w! n, |. X/ c1 h
4 Q6 s+ C, ^( J) g) a0 {9 e__________________________________________________________________________: z' l! D# H5 V% O
% v3 B0 W- e7 x0 j( _4 b8 D; }; k. `
Method 054 M2 J' ]% C3 _! A
=========
+ a& V b; \% Q' m/ n4 X4 P- W* f5 f. B
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 f% s) n# N9 @; |0 v0 kdebugger. It calls the int 41h, function 4Fh." L0 \$ A) \9 T, v! j- R
There are several alternatives.
# i8 n* o0 E9 S# ^" z! U# b* G5 L) Z. Q# V4 g- r& X# c% d1 @
The following one is the simplest:/ G$ E) O' f/ |9 \, g) D" W
& X/ Z3 u U% a' J- s5 k% m5 s! E mov ax,4fh
; P2 B5 w' ~4 n/ M# l int 41h
3 H! i# I$ l; N8 Z& R- j D cmp ax, 0F386* W9 {/ X: [. E5 P/ D# p
jz SoftICE_detected9 U2 w5 W# c' s* s1 \' P
$ c6 ~7 _0 a% ~' n
5 T2 C0 ], `7 UNext method as well as the following one are 2 examples from Stone's
# r% \) B& {2 K$ d"stn-wid.zip" (www.cracking.net):9 y& X4 t, ^; a! E0 E- g- q
" y {. o" _% F: q& q7 ^ mov bx, cs
0 Y7 Y# M7 b6 ~& |+ r' L3 ^4 ?) X; Q lea dx, int41handler2
! @+ e) ]' U# t xchg dx, es:[41h*4]+ z4 P) W/ r( c: U( d( M: T8 o6 d! h l
xchg bx, es:[41h*4+2]7 X1 V% _; o$ U, c8 ]
mov ax,4fh5 Y& p$ [7 v- x1 I- {
int 41h7 M! r2 P* Y' @* w
xchg dx, es:[41h*4]
# l/ d0 e! E3 Y+ U; Q' [) v2 X xchg bx, es:[41h*4+2]
. h+ D0 K. T6 b) R cmp ax, 0f386h5 B3 @6 ~" O( T; d: B
jz SoftICE_detected
" V+ K9 Z3 O- Q9 G0 {2 t6 ^* P$ I
int41handler2 PROC$ }0 m- W& C% f! E1 ]* T% @
iret7 A+ j$ J0 F' u1 a. B7 S! I ?
int41handler2 ENDP. ?2 y a& K& e6 R" Y5 ?3 x
: \$ O D) e& N; R0 h
3 `# k2 V- y" q) r8 z m
_________________________________________________________________________: O9 Z8 C1 N: E0 T* X
( w& B+ l! q: a
# a% a9 G' F. w6 t8 @Method 06; o- x2 g/ d9 H+ M4 a
=========$ O: W5 H) t5 g
+ w' M! l9 ?* X7 A9 `
/ X! j; y$ \: [; I4 G
2nd method similar to the preceding one but more difficult to detect:
0 l( C6 l! E8 F3 t/ L% e* z0 C' I! V% w/ |5 e
% |9 u3 A- Z# w/ l* |4 W* B, Pint41handler PROC1 d7 x9 [/ ], u; r
mov cl,al7 T! I; w/ `* D" J& @4 X- t i& |
iret; [5 j% `4 _8 L, H# I$ a
int41handler ENDP
& r) c4 T) B% C/ j! Z% H
8 o+ _6 F8 C/ ^/ C& k0 H2 I4 r7 ]: f+ M* E$ Q- W( K1 d, l( ?' F* q
xor ax,ax
/ Z/ \& T4 k4 R7 F3 I mov es,ax9 o: v i: w( Y1 R& G" @, |
mov bx, cs
* \ m/ Q$ X' Q8 n" Q) z lea dx, int41handler; @% ?+ y, B2 L5 n
xchg dx, es:[41h*4]. h f3 G4 g* n; _- R9 [( Y" h
xchg bx, es:[41h*4+2]
5 B. E3 R$ ?1 T& ~+ T. O in al, 40h* _5 g3 R# s" G' ]& y! H4 t' J
xor cx,cx
. j, n, E4 R% i5 ?4 Q8 J2 B* z3 | int 41h, K5 L4 E$ b% P4 Y& t
xchg dx, es:[41h*4]
! v! f$ O5 l! m2 @$ B xchg bx, es:[41h*4+2]
, e+ C' ^$ W; P) k: d( u cmp cl,al9 R' b( T- L/ V9 `
jnz SoftICE_detected! Q v) r- @1 C
9 h+ x5 N) t% B4 N) Q% W4 A
_________________________________________________________________________; |* M- U. \4 y* Y4 ]- O! z0 W( P: d; C
$ g1 b8 ?" b" G) fMethod 07
- R( \9 l5 J) s# f0 }=========
* \ `* O( y; R8 e3 Q: Q {7 b
# H! B; b. y4 K: s) V4 u2 F! YMethod of detection of the WinICE handler in the int68h (V86)6 V7 B# n! ^' g" e2 T
" k) N( }/ X4 G! s4 M6 v; U mov ah,43h
) u, s$ Z, g1 S int 68h" F. I* [# [' r
cmp ax,0F386h
% H- C- A4 G6 n1 F1 f, S# B jz SoftICE_Detected( a5 q4 V' a) I5 N6 B) i# [0 |
! B6 n- P- p9 V/ c) f; h1 i- b- Y0 B4 }: j) Z6 s
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 F8 T$ q. y M6 M app like this:
2 M; C' |1 i& T, Z+ O, J# d
" m2 @# i. i# `7 R& \$ \ BPX exec_int if ax==68$ l ~- l- e, K* H" Y# [
(function called is located at byte ptr [ebp+1Dh] and client eip is+ q0 T z. g) U) ^1 U/ M: T' x& H
located at [ebp+48h] for 32Bit apps)
; v- k$ ^; K2 l8 ], e( B9 m__________________________________________________________________________
; }' X% W, ~5 \; u5 ^: N2 V. `& J: _0 r! [
6 p0 o9 e" s! J# H3 b6 U. ]1 }Method 08
6 `1 c. u: {6 l S! V' a. ]1 Q=========
: s3 P( o5 |* O! k9 { d D$ N8 G7 }8 H2 q* {$ j* e
It is not a method of detection of SoftICE but a possibility to crash the
4 m/ {3 K; Z8 X8 D- B# e7 o# ]system by intercepting int 01h and int 03h and redirecting them to another
/ Y' K5 _+ p# E2 iroutine.+ N v% ~. B# H! g# _) Q4 E! h p/ F5 {
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. O2 D* B" M2 h* @to the new routine to execute (hangs computer...)
* Y. |# r; \6 K8 P D% y" N1 b H3 D9 M
mov ah, 25h
8 _. W' \1 @8 Y mov al, Int_Number (01h or 03h)4 \" v; m, C. x! N u& Y |
mov dx, offset New_Int_Routine0 l: C6 o K( B7 V
int 21h
5 J N7 J8 z8 D# r) u D
$ w5 W& K1 z/ S7 A% y$ @- p__________________________________________________________________________
% O& i1 i1 ^* T' v/ O& s
/ m& P9 u' o& B- xMethod 09
' O' ^+ d1 |0 L7 e' ]=========4 N& K1 F5 c8 F$ m# g
" v) q* s( d% v4 m
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" _8 {4 C/ l$ L5 T3 n! ^9 |performed in ring0 (VxD or a ring3 app using the VxdCall).
4 O2 n( L/ B: S( |. CThe Get_DDB service is used to determine whether or not a VxD is installed6 N3 q% J4 x% ^. I( O$ s" [
for the specified device and returns a Device Description Block (in ecx) for' N2 \) y3 C i( M; N4 B( B
that device if it is installed.
@! ~" ~& ]% P2 E% F' q# ~9 n3 F+ P7 F3 m, L
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, C0 O3 g5 j3 g8 f5 r mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( |2 O, c. b9 d VMMCall Get_DDB
! I6 L6 U% e/ K9 D* g/ s mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed4 ]8 J' {1 o. Z, K s" S! X7 w y
4 O+ O) M- g, d
Note as well that you can easily detect this method with SoftICE:9 j, k1 I1 H) J! @1 s
bpx Get_DDB if ax==0202 || ax==7a5fh
0 N: d- Y1 f' U3 K0 d# P/ o4 s$ k/ N$ f" t" H* ~- M5 |
__________________________________________________________________________
( o; I1 M! c# R5 s6 M/ l' ?6 q
2 ]5 G( l' T' b% @- _ u( I% QMethod 10
+ p$ m# }. |, a6 G8 |=========1 _5 Y) I& {- }2 u
! Z( d. z! | r0 I- R0 p% x5 {=>Disable or clear breakpoints before using this feature. DO NOT trace with
- I2 O" m$ G* ^4 x SoftICE while the option is enable!!" c$ l) J X, h1 D* Q
# ^; {3 X$ m8 Y7 |/ {
This trick is very efficient:7 F) e+ p' x4 n5 h8 a7 a7 v+ n
by checking the Debug Registers, you can detect if SoftICE is loaded
/ S* k: H( }3 v- S* S(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: \" @( k/ {" }' e2 Y5 Kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ T9 v7 {, N9 @' v- |value (in ring0 only). Values can be manipulated and or changed as well) s6 O6 ~+ k/ E
(clearing BPMs for instance)
1 T" c9 V3 {# @9 z& T1 B6 q
/ O" [$ I% W2 i2 W0 z" ~__________________________________________________________________________ l, m# I' v, O2 B
0 V! b- w7 h+ Z9 M7 z. A! dMethod 11
+ Y! Q% W! e' T# x% |# R=========
9 f" {( A5 u# T, T) o: \, F W! S1 i4 Q8 X) I3 z
This method is most known as 'MeltICE' because it has been freely distributed
. q2 \7 d. C7 O% evia www.winfiles.com. However it was first used by NuMega people to allow+ t& K. q' V J( n) I: a5 E
Symbol Loader to check if SoftICE was active or not (the code is located
" ?# P: z8 H1 A9 N9 z& [ x. Finside nmtrans.dll).
# |6 Q3 e P9 o6 O' d; S# w6 W. a6 `
The way it works is very simple:. A$ _ K% o+ x/ ~
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
) d* h- e z, O0 B* D+ m2 L2 m8 C* hWinNT) with the CreateFileA API.
0 _1 h+ n% a- }4 C& {4 S" J( m' G$ K5 }3 U$ {6 N# _, O+ c5 C Z8 h
Here is a sample (checking for 'SICE'):
2 a/ {2 A$ F% p+ p+ y
! X) \& [# K) n7 @BOOL IsSoftIce95Loaded()$ Z! L; y$ R. [: m- H0 g. @
{
! K0 X- Z. L: z& n8 ]4 J: b6 E HANDLE hFile; ( c& u7 F% X! ~+ f9 r7 x! e
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) B7 o8 a7 [ R9 a/ |- L
FILE_SHARE_READ | FILE_SHARE_WRITE,* g) Y0 i, F0 A# v
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" T# n4 v" O/ L# t! o& e* ^
if( hFile != INVALID_HANDLE_VALUE )
( T1 S2 p7 K1 E+ K c1 \" l* E1 }& k) r {
3 c1 V. Z0 z$ {! O. w CloseHandle(hFile);
. \( {; j* ^4 H: j return TRUE;/ I4 d& ?; M$ z- v3 d' s
}
1 S. [4 b4 H" l return FALSE;
1 d! l0 B& n5 N8 q l}; A2 y/ ~( f H" ]" N
2 h) u& r! {2 X, D: }6 hAlthough this trick calls the CreateFileA function, don't even expect to be' I1 R8 y" }: O- D8 o: |
able to intercept it by installing a IFS hook: it will not work, no way!# N) f7 u4 H* B' I8 J7 d# T% B
In fact, after the call to CreateFileA it will get through VWIN32 0x001F% p G1 k4 Z: N1 h5 C
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- ~0 i/ E' Q4 R! y: U l/ E3 C4 T+ v8 `
and then browse the DDB list until it find the VxD and its DDB_Control_Proc( y) |# y4 `7 }& e0 Q. B. L+ _
field.
6 M; X( y* A2 W+ WIn fact, its purpose is not to load/unload VxDs but only to send a 2 l- }+ h# _* ]. B! J) v
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)' s( Y" z* ~/ t: w( ^
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
- \* _" c/ |+ p+ Q7 Z( U0 d* Eto load/unload a non-dynamically loadable driver such as SoftICE ;-).2 J9 \. z7 i- S4 e
If the VxD is loaded, it will always clear eax and the Carry flag to allow: r) f. O5 o( W) A
its handle to be opened and then, will be detected.
5 t! b {, b2 t! ?" j+ s' {You can check that simply by hooking Winice.exe control proc entry point3 e* s4 G! I0 ~# a) y, S2 T
while running MeltICE.
; Z6 f5 @ s: K5 U. d; t, a; \0 m3 |
% i1 X: `% t% w5 T! K, P7 c( y, P3 Z% y+ Q. K( h
00401067: push 00402025 ; \\.\SICE% L+ \; ]6 p3 y q3 l
0040106C: call CreateFileA1 I2 r0 ?9 O% V/ Y7 ~
00401071: cmp eax,-001
" W+ V3 g9 D; }: l$ j) d" ]1 _" {) }0 } 00401074: je 00401091
/ M" ~, O! l& _" B
8 [- t7 D( [; Y8 T+ B) A* S, ^+ J3 s$ v$ {
There could be hundreds of BPX you could use to detect this trick.
5 r$ }7 v" S. A0 S8 z0 ^-The most classical one is:! G& v7 `4 z2 J7 t
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||/ s, f; t* U0 Y5 [
*(esp->4+4)=='NTIC'+ d" C8 a) J0 D! }8 u
]+ i& T J, ]6 {& T7 \% ]-The most exotic ones (could be very slooooow :-(& T/ h1 [; ~- Q5 ^
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 r/ r: f# Z8 v% L
;will break 3 times :-(
2 Q3 E$ n; _0 g8 t
7 ?: g' | J8 M6 B) N+ ~-or (a bit) faster:
0 A2 d5 `5 ?& ]9 u4 H. j* v BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 E; q( ^4 w- k2 d; \* c5 Q
) E' _9 K/ e, C( Y5 W BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 5 C9 M$ a$ h0 r" I% ?4 y1 e
;will break 3 times :-(! _6 ~& |6 v3 _2 e7 _4 z8 C
* M! c5 R- @: x
-Much faster:
4 `2 F8 r: e1 y) X" k* h' T BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
4 S4 H0 A$ i/ ^' N; t! j9 Q; i( A7 g' `3 f; |* z, T
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
' F4 C/ O1 f* v! Ffunction to do the same job:
6 q, ~! v1 @. Z
+ F9 y# D! m- {1 J( @- i4 [3 G push 00 ; OF_READ
) n5 G, v3 A' E( M2 ]# Y# X) J mov eax,[00656634] ; '\\.\SICE',0
; Y% L4 h+ W* {2 r9 g push eax
$ g3 q- h$ m: C' v) t# T call KERNEL32!_lopen
; ~7 w7 [" P) S inc eax
, s' J: q6 i) j9 a. D0 R$ N3 d, B4 C jnz 00650589 ; detected ?8 g! l3 Y- z! N& R u% Y
push 00 ; OF_READ
Y) ?# E4 P" Q' J$ G& D mov eax,[00656638] ; '\\.\SICE'. s, ?! a* Y8 p
push eax
" o% s9 @! ?4 \- E call KERNEL32!_lopen" s `( v# u9 c0 T( @' Y% u4 N
inc eax
- _* W- @4 L# E6 f" } jz 006505ae ; not detected
* W' e$ C) k, I. I8 g1 B# N& j& [2 o0 X& L/ \9 ~: Q; p
4 t. H D* o2 U7 e5 f& v5 Z8 H
__________________________________________________________________________/ P* k5 t9 m- f e
- f( Q$ s! ^/ t- V
Method 126 J* s) }8 l- ]
=========
: W2 V$ P7 B7 x( K. U
# O6 X2 y5 u1 n8 ~$ bThis trick is similar to int41h/4fh Debugger installation check (code 05
2 C+ E0 `3 j( n2 D# i A U8 p4 @/ p& 06) but very limited because it's only available for Win95/98 (not NT); R; F8 _4 v% {9 Z: I1 z; m; m) K
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& O/ ~4 W6 I% L/ x# [8 f$ ^3 w( Y+ S" F6 S6 q1 Y
push 0000004fh ; function 4fh
6 S* R* W; W; |; h9 p8 E2 ^ push 002a002ah ; high word specifies which VxD (VWIN32)+ r ~) j! G/ k- ?2 a4 x
; low word specifies which service
( m3 `5 S9 K! a; j (VWIN32_Int41Dispatch)1 N. N% c5 v* d+ _ k
call Kernel32!ORD_001 ; VxdCall: C8 O8 {, X2 p- j" `
cmp ax, 0f386h ; magic number returned by system debuggers2 G) s' e$ z( z2 F$ N) Q: o
jz SoftICE_detected5 s8 G" F/ O7 i3 ?4 n* r
- }1 h5 c+ S6 p6 CHere again, several ways to detect it:' n; ^) V) d8 g, H3 S7 s0 r
1 x+ X3 \+ v( ]9 s BPINT 41 if ax==4f4 J+ [: i! i6 w% B. |4 i# z
8 o; f+ f# t, N4 N7 |- O BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ }& N! ^; Z/ K0 _ Q
2 x; e" A8 Y q. N! |' k; _ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A; a2 w3 b q, e$ S0 C- P9 K
- B& `! N9 j+ h BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
# B4 k6 s" x% I% ^0 x& _. K" g# H a* V6 U1 F+ k
__________________________________________________________________________
! i2 d$ a# o' b3 v' P: Z' Q' X" ?% G& s/ E
Method 132 V2 [" O5 z0 C9 i
=========
9 n5 c' K* d$ R! p3 e; ^
, M2 A1 N- o+ N$ z. ^5 ?1 D: p( h xNot a real method of detection, but a good way to know if SoftICE is" N8 y6 W) H" _" |% A1 y
installed on a computer and to locate its installation directory.9 ~. l4 ?9 c4 |- x% V
It is used by few softs which access the following registry keys (usually #2) :8 X" a* Q- I2 R% m2 W* }
6 \" [9 E6 H5 T% \-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion n+ F% D7 R5 n% n0 v: j) ^
\Uninstall\SoftICE
8 Z( x+ ~. w, `5 F& N-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' z5 M( b* t7 X( F& Y8 d+ {-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! Y6 ^# a: d, \9 {
\App Paths\Loader32.Exe
# N x) `- E3 f% v% e% u K
! S$ G' O% q$ H. G9 d8 N4 M7 U
" ^. L3 H' o3 H8 F$ \Note that some nasty apps could then erase all files from SoftICE directory
: w7 w. G( p+ T! o9 s( S(I faced that once :-(
+ O+ G# A8 ^1 @3 _6 r1 _0 F' H! r d4 U: ^" Y7 E
Useful breakpoint to detect it:
* T1 w, R5 q5 q; c( ~0 |5 R$ |( F5 v" _" f, V. W2 l9 L" s1 R
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'1 \2 m' T0 \: ~3 K; K8 k- A
# {" b o- L. Y* _
__________________________________________________________________________0 ]. g& {5 G q* b6 T
% K0 [0 D7 A" i, ], N. ~/ X, P% q5 a
Method 14 & {& O) q( E( _ V2 ^
=========
) A# {$ ^- n' v/ [! `! X
{3 I" ?' v+ |8 F0 e% |0 NA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* i3 T' u9 F: a1 Pis to determines whether a debugger is running on your system (ring0 only).; c8 A3 L; b9 Z6 U8 \
4 i3 ^7 e+ ~5 c0 K* ^/ X9 ]! l7 D* r- Y
VMMCall Test_Debug_Installed
) i9 p. S$ b5 [" W7 a) w je not_installed5 ~& I2 y2 r8 c9 q$ o' D! G8 j
3 P7 }" w( o, wThis service just checks a flag.
% Y0 l6 R7 L7 k; K</PRE></TD></TR></TBODY></TABLE> |