<TABLE width=500>. o4 ]: b$ J3 S. \6 H
<TBODY>1 w: [2 q; Q4 E; X
<TR>
( U0 G! W" M. W<TD><PRE>Method 01 * x h3 Y) N; ?/ ?. ^
=========
2 U8 E2 s8 H- h( }, _- l" k# E, x4 b9 K" d: \6 {
This method of detection of SoftICE (as well as the following one) is
% ?& s' E. ^0 S8 A1 V/ Hused by the majority of packers/encryptors found on Internet.5 m' X6 X$ R" L
It seeks the signature of BoundsChecker in SoftICE; H+ \& J/ Q( G4 @/ V# v) o8 o8 F
( I/ ^$ P& H& B mov ebp, 04243484Bh ; 'BCHK'
, ?* ^1 O8 }1 P* x! g# Z; ]3 n mov ax, 04h
$ Z/ o6 t6 y, N0 G! T+ q& v, a int 3 ( ~0 z+ _; B6 L$ n0 S
cmp al,4& Y& Y9 s9 p. ?6 E% X9 I
jnz SoftICE_Detected
+ p8 q0 B: a, }! x" u$ `" {6 h: q! o, q4 W1 t
___________________________________________________________________________
" X0 _: R# G7 m( k5 ^$ V" [% j, x* ^
6 H) _% s: ]1 U- Q% Z1 l6 PMethod 02
4 g- W8 _; H0 s=========' V; J3 d9 k8 O+ z3 r
& ?2 z% q: g: c1 |# r1 r2 E5 x0 SStill a method very much used (perhaps the most frequent one). It is used# Z2 D- g2 U" N
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
8 v+ H5 U+ m5 s" \2 T" r+ T2 C b3 hor execute SoftICE commands...
c& f* I* C- o8 l' iIt is also used to crash SoftICE and to force it to execute any commands0 s3 H) S5 L% g% a" c
(HBOOT...) :-((
2 x9 H. ?! F4 M
" p0 {: H# x: SHere is a quick description:
( g& ~) G5 i* }" P-AX = 0910h (Display string in SIce windows)1 s' o+ B5 Y$ E4 Z7 [8 _( x- H
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& O, m' z6 X5 P. S2 c
-AX = 0912h (Get breakpoint infos)3 G2 x6 t3 v5 K8 B. Z, ]' N3 z
-AX = 0913h (Set Sice breakpoints)
1 H( s5 i1 L# [' F-AX = 0914h (Remove SIce breakoints)( j. A& L. w$ A3 q) j" ]
- ~) b" O- t' n; |8 }! w! E9 NEach time you'll meet this trick, you'll see:
+ v8 J, ?7 V \* {# M1 k+ k( |-SI = 4647h
- k" X4 j, e2 D-DI = 4A4Dh
! ~; t* c7 ~- m2 o. z; FWhich are the 'magic values' used by SoftIce., y/ R2 _) O# W5 T' K8 G! e
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 q5 R7 ~2 p3 U2 v7 F* ?, I9 ]% i- a+ A
Here is one example from the file "Haspinst.exe" which is the dongle HASP' x6 K0 m8 Q* H' z5 w, }" y
Envelope utility use to protect DOS applications:6 Q3 W) t0 h2 n5 R- r
6 Z7 N. e/ F+ f
) O2 W& O" g5 m9 o" Q# ^4C19:0095 MOV AX,0911 ; execute command.) c- l' e5 H" f. U, [" {
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).+ [( e5 t! V% H" l6 Q
4C19:009A MOV SI,4647 ; 1st magic value.
3 b" c0 k! y7 t5 J" p- Z4C19:009D MOV DI,4A4D ; 2nd magic value.
' E% H$ m* m X4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)4 [: V0 g0 G7 E T* O
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute, w- J7 X: v" S7 A Q
4C19:00A4 INC CX! }3 r& F+ F/ `/ N7 }
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 A' k( ] A2 `: Z4C19:00A8 JB 0095 ; 6 different commands.4 h4 @' @ g, r2 |2 N7 B& s
4C19:00AA JMP 0002 ; Bad_Guy jmp back.2 O: u3 ]- G; ^9 H' {5 E* B
4C19:00AD MOV BX,SP ; Good_Guy go ahead :). Z: F/ H _: ^0 D& R
9 Z4 |% c. x/ @1 @The program will execute 6 different SIce commands located at ds:dx, which
8 j: {& R H9 Hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 O K1 d1 }: J) s7 `. o) _3 x8 l1 }' M$ R
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& Q2 v4 _( Y8 H r b___________________________________________________________________________
" E$ a& V* K8 C+ }7 V5 ~# s% S- y" f4 J% e( F9 {. e
% z& O, p6 P- \) J' uMethod 03$ [4 O' U+ c' D4 R' b
=========
' c8 h4 t0 I8 P b# E/ D# `& @- ^& J6 R3 u! n
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 v9 i9 S- |. |9 O# Z
(API Get entry point)
. x. n. `7 S7 i- i. x. v : T* \" k& E$ [; p( u8 w( c
0 B& Q7 S3 i. o6 l# ~
xor di,di
3 B+ z3 f& D, e6 h! F o. `; L mov es,di
1 g( j3 [2 x3 G mov ax, 1684h
4 N! V r* x7 R6 Y+ M mov bx, 0202h ; VxD ID of winice
X8 I$ p3 w. u- n% k1 b3 k int 2Fh2 C, O- y3 e0 p' @1 H) Z/ N* f
mov ax, es ; ES:DI -> VxD API entry point- F; B; h0 i$ J1 M
add ax, di i% K3 o' e2 ^1 r% B/ l9 f% D
test ax,ax% a; B$ i0 ~: ]7 W5 U, t
jnz SoftICE_Detected2 V. A7 A: g |0 O3 \$ R1 `- Y0 e
7 b# C0 R0 a0 X( z- B; B
___________________________________________________________________________5 h2 `/ H/ F) `( V1 `( x5 x
; O2 M5 H8 a$ B9 L/ yMethod 04) K7 `9 |" r3 \* t4 o
=========
( |9 \4 w- r7 w8 d: [) G4 m
9 b H! U. A; R+ c' DMethod identical to the preceding one except that it seeks the ID of SoftICE
' ~' A2 r' K0 V+ i$ `GFX VxD.
- J* @4 d# M4 s& w1 }# ~, ^5 W3 L# K2 b" D
xor di,di3 K1 W7 F$ ~4 q) u
mov es,di& N5 e9 y- }3 Z) Y4 l9 c- [# j
mov ax, 1684h
# ~) `7 p8 n! W4 ~ mov bx, 7a5Fh ; VxD ID of SIWVID
) l+ ~# S* ~& f. n% V% r( L! R) ? R int 2fh
* i* `. a# W1 H3 O- B( W mov ax, es ; ES:DI -> VxD API entry point
4 y7 Z x8 Q! m, v% G7 ^: l add ax, di
& R2 C1 Q! O- b; b! M8 ]5 X test ax,ax# F3 `" e7 [# q+ p$ A
jnz SoftICE_Detected$ F- T0 d* x: P' N5 |! }. p) o* _
# M- D9 k' {7 V6 w' q__________________________________________________________________________
% W( P6 L D. Q8 _) K% [( J$ q2 {$ Q1 p# t) X6 B$ N7 |
" ?, R3 [1 E- k* @
Method 05- \- D- l. @- \( ^
=========& \, ]. t( U) ~$ B
! b6 Q% b# U* |
Method seeking the 'magic number' 0F386h returned (in ax) by all system
* H1 i5 _1 ?! l2 O4 L1 Wdebugger. It calls the int 41h, function 4Fh.' r7 Q6 G1 @- G$ j# j2 o& _
There are several alternatives. 2 S! A$ \$ \4 l9 m
' r/ F, j6 o" j
The following one is the simplest:
' ^# u# S0 \, W9 }# j5 \: N! V% R: S+ u
mov ax,4fh
; F( O- }$ a; y9 Q int 41h
6 G. y, X" T' b* Z7 g8 c cmp ax, 0F386
% P: I( v4 Y) G+ O: a jz SoftICE_detected
& Z" I' C* n2 g c. N6 @# F2 P- t" f% p. S. }- C2 }+ ]
/ i; C" Y4 ^% [8 b2 R& s! i% n
Next method as well as the following one are 2 examples from Stone's 6 h9 e: k/ }' j8 x( Z, o7 h0 Z
"stn-wid.zip" (www.cracking.net):
( K2 e0 L, |( O) O" w# d6 G- P: J
# s% D' f0 G- a" e- X mov bx, cs* y+ ~1 o6 ^' [3 n# P
lea dx, int41handler2
5 u8 a5 E0 F7 t xchg dx, es:[41h*4]
. a6 ?8 E0 p; ^3 T1 O. L) k. \: Q xchg bx, es:[41h*4+2]2 w8 ?8 M: h8 ]' ^" Q( [* L' `
mov ax,4fh, M5 F! \+ Q* I' D* J2 c6 d$ v" z ?
int 41h
# |3 c/ ~. J! W( U; x0 C* p8 ~ xchg dx, es:[41h*4]
+ z& l' D! a, g% I8 W xchg bx, es:[41h*4+2]
8 s7 ~ s1 B7 l% O: f" j5 g cmp ax, 0f386h
; @: W$ P( V- X( S jz SoftICE_detected
1 O' b% D: [- w) r$ T. t
: N a6 I( A; b) H0 ^int41handler2 PROC
' _" F, H1 b! Q iret
% Y$ l# J- u( bint41handler2 ENDP
, h! w' J; U8 U0 D9 x: l; m b+ z$ E; B9 s: Y# D
; W, ]2 d9 r5 ]: ?
_________________________________________________________________________
0 G- }8 o+ D K2 h8 x# b) m: T0 q4 U4 D9 N
; B$ g/ l5 d6 fMethod 06
5 b7 Q. F' Z" c- ]7 P6 n=========) o. w9 Q& L" |! Q! i+ w
# M3 L7 V; Q: [2 }
2 y4 B; q/ W( c
2nd method similar to the preceding one but more difficult to detect:) ]; X; H+ e, z7 w |' |! O; j# F
# {: {! m$ j9 C# d; P
9 N4 b, \, j8 ?9 ^/ m" S, S8 V6 qint41handler PROC( `6 N- l: T( D, F/ D6 {6 ]* o
mov cl,al& X3 w, g6 @1 h9 n+ m- {( w
iret
; Q8 u. a+ z. dint41handler ENDP, f6 t3 i* z/ w7 h# o
4 v! O: n9 P8 N2 P
3 J5 @2 y! U. C& d
xor ax,ax( O+ m- Q( C4 ]6 E, E7 h8 H) X8 X
mov es,ax$ h3 @ s$ Y3 b) ~/ S' F
mov bx, cs7 H Q, d5 m/ Y) d" |1 B6 M. r2 m
lea dx, int41handler
* y3 \5 a0 h8 v5 s, i: G5 K/ x xchg dx, es:[41h*4]9 C3 \. m$ R+ j0 {) H! e2 E
xchg bx, es:[41h*4+2]
5 T# [: ^5 R- _% Y in al, 40h" }5 m. f' c5 s; O3 e/ V" N
xor cx,cx( H K5 w5 s" E0 C( H$ X, ~; i
int 41h
" o6 Z7 a9 G) G' n8 C5 ` xchg dx, es:[41h*4]
2 M5 }9 [7 Q, x- P/ ~ xchg bx, es:[41h*4+2]2 q5 W9 j$ M2 O
cmp cl,al
) j) L0 Z- z+ K8 B# C jnz SoftICE_detected
# O( H( }# p7 P, ]. H v1 j0 y. g/ M8 h- { L
_________________________________________________________________________8 I: z( b: h9 ?
" ?$ l/ m, Z' g- x3 l9 k5 CMethod 07
8 e3 N1 B/ _; v* O=========
! K8 S- }! L# w$ P- B2 A+ ] M8 ~: Q2 @8 T8 E
Method of detection of the WinICE handler in the int68h (V86)
2 \+ R+ D8 o" d1 [# H& W" A! d/ d0 q4 l
mov ah,43h5 R1 c+ N/ z6 g! {7 @0 Y2 e
int 68h
2 J7 ^, d' [# P+ j cmp ax,0F386h$ ^+ x8 }& ^; z, O
jz SoftICE_Detected
: i/ K a: O* Z) A
1 e1 x8 a9 M {0 U- y# N! Y$ g
$ [& N2 {+ z! k7 J+ y6 O8 g+ Y" E=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, ^7 q3 d k( F7 S- n2 t* l7 k
app like this:8 w; q" ^4 q) }
' y# N A; a; z6 W
BPX exec_int if ax==682 p3 b/ X3 t" u
(function called is located at byte ptr [ebp+1Dh] and client eip is
2 S J4 u) l$ R5 r. k1 P2 h located at [ebp+48h] for 32Bit apps)6 Y" e7 X; j- ^' @3 Y r$ J" a0 V
__________________________________________________________________________
7 H* O" o3 e u7 _
. h" l8 `# x) f0 X- J
/ Q" z9 y0 e4 [6 S& ^+ u" AMethod 086 e# p1 S! ^5 j ?( O X: F( Z
=========+ }9 L8 o5 O ]. [1 Q) i- \! h; R$ e
7 C: H! ~5 z3 r' TIt is not a method of detection of SoftICE but a possibility to crash the5 G9 _8 i- s4 Q1 `
system by intercepting int 01h and int 03h and redirecting them to another
% M+ f8 d: ]/ }/ Y6 R/ V |routine.3 u* U* m8 z" ]
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
) Q- ^- Q4 Q, d" Oto the new routine to execute (hangs computer...)
+ D, f; E V* ^" Y( |
/ Q' O' U& P9 B0 ^( }! E* E6 ? mov ah, 25h1 p) N( u$ [4 D5 \# z
mov al, Int_Number (01h or 03h)
9 o3 L9 v% O- q& {6 U& x v( j mov dx, offset New_Int_Routine
6 W& ^- |8 l5 ]% `! q9 F int 21h
/ b3 ]" S- q& D w
& X& X( @" F5 U- w% O( e4 m. h__________________________________________________________________________
3 }- |. x. [3 S7 ]3 P, x) e# ?7 C5 ]; m# i# r5 P
Method 09
5 L: i0 ^+ a" ?& [=========
# H6 @3 l% C4 k8 O' ?0 C y0 ?/ D) C( Q4 o$ r+ ~( I
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' S4 R. x4 ~* t+ j2 b
performed in ring0 (VxD or a ring3 app using the VxdCall).
$ P; f! F. W) r6 wThe Get_DDB service is used to determine whether or not a VxD is installed
9 X$ W8 ^0 C8 o* }$ p3 D6 z) O5 ~4 @for the specified device and returns a Device Description Block (in ecx) for
0 B% t5 k' |! n! a3 m9 z; ?* Qthat device if it is installed.$ j7 t7 Z7 K2 C3 r: ~
+ J4 |/ t1 O! U$ a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! W$ {. ]: k% h: Q$ H* U
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 e# t; q4 i$ D0 |- j% p9 |4 }
VMMCall Get_DDB+ o, M4 y3 y# u) Z
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* n# I. |, _5 Z K) g2 z4 d0 i- q6 e" D- K w
Note as well that you can easily detect this method with SoftICE:# D/ U* X$ N/ S- O7 U* F6 B S& A
bpx Get_DDB if ax==0202 || ax==7a5fh- y5 O- T& n$ X: w. G; Y
6 G' \+ ~9 C; @+ Z# a0 S8 |
__________________________________________________________________________4 g" Y4 g% Z& S* I% y5 P3 t6 Q
# t/ ~/ C) d2 K* I, pMethod 10
/ u, Y2 J! b$ \" z=========
' d/ S: q+ T% ?
# F+ x9 }* T1 u4 ]7 [$ Q=>Disable or clear breakpoints before using this feature. DO NOT trace with/ N- W& z+ S7 R" X
SoftICE while the option is enable!!
% b5 H" |- h5 A6 v
+ f5 u. ~- R$ m, G- ZThis trick is very efficient:; }( F! ]3 k+ l4 B4 Y8 {
by checking the Debug Registers, you can detect if SoftICE is loaded
2 d+ S5 G/ Z9 {* \) q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# |& q# L# f/ M) F( ?! [there are some memory breakpoints set (dr0 to dr3) simply by reading their, f1 I# `# @, ?% N9 |
value (in ring0 only). Values can be manipulated and or changed as well) G0 v/ ]. e7 d( {7 s, O. I0 a
(clearing BPMs for instance)
! e7 s' ~* i" [* J6 |) }0 ]
% Z) c% K6 Y4 ?' j__________________________________________________________________________+ v4 q2 f% }0 R
i2 G% p+ i/ `, i9 l. lMethod 11
5 L. ~& l7 D* M, {& \8 X9 E5 {=========
5 e4 Z# q# z4 y$ P; T
7 F% a0 x: g, g( X/ G7 n# K; U! vThis method is most known as 'MeltICE' because it has been freely distributed' o" W8 O# g4 E( K8 X7 z2 I
via www.winfiles.com. However it was first used by NuMega people to allow
7 g8 s6 s0 X* ?Symbol Loader to check if SoftICE was active or not (the code is located
% N2 f6 b* ]! L+ \- y" ?) {- W' ]inside nmtrans.dll).
5 K( c% ]/ \* \* s
8 n% ~* O; t) P( b8 uThe way it works is very simple:
; f8 i0 G2 O; U3 [; }" v! ~- }It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ r! U3 R- \' \; L9 f+ Q
WinNT) with the CreateFileA API.
A: Z! J! Y& Z0 r- q! _! i5 R+ ]& ?& \5 M3 L P/ Z; U4 q
Here is a sample (checking for 'SICE'):
2 j' m+ O* i' C; i( l% ~- _: d( I0 ^+ G5 n+ }
BOOL IsSoftIce95Loaded()
0 e/ P0 `! ~( Y% G7 T' g( Y{6 Y) a: z: Y0 z; l5 b- s- Z7 l! O) _ d
HANDLE hFile; 7 ?" P/ A' B7 \% q& n# z+ r
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 [- ^" s$ i1 m X+ E: c9 X7 B
FILE_SHARE_READ | FILE_SHARE_WRITE,1 x- [" s! z |9 ?. d$ U. N
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 G) I& \1 N* @' T% s2 l! o E" j if( hFile != INVALID_HANDLE_VALUE )
5 h# ~& R- q2 u, t9 M {
$ l7 P3 l2 E* W1 J0 x1 e CloseHandle(hFile);/ u5 [( i8 p+ V8 F4 \; k& @) W" E" A
return TRUE;
5 `: ]" e3 U3 q$ b7 P }! c# q. r, [2 y2 m% j$ S, s D
return FALSE;- `/ G, ]( ]0 o" P7 A
}; ]* u4 V; X( v$ W% V% X% p
$ W$ U3 Y# @$ f& d2 I2 e
Although this trick calls the CreateFileA function, don't even expect to be: j% z0 q+ u! p2 u. I$ }
able to intercept it by installing a IFS hook: it will not work, no way!
& }8 Y" P+ A) ?1 G3 o7 x+ XIn fact, after the call to CreateFileA it will get through VWIN32 0x001F' l. `" y6 N' k7 J+ G% C* J
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ V, _: d& S* c0 E! h0 ]2 Wand then browse the DDB list until it find the VxD and its DDB_Control_Proc" `0 p# m3 m4 z( O
field.# b- i* h/ q, M9 E1 ^ U
In fact, its purpose is not to load/unload VxDs but only to send a ) g! I/ S* |: g/ e- _* u {
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) A7 {2 T' u% [# bto the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 J, H9 c; n# _+ B4 Tto load/unload a non-dynamically loadable driver such as SoftICE ;-).
* W- a( D/ p8 N) T# qIf the VxD is loaded, it will always clear eax and the Carry flag to allow
* @* j) D# ^3 W5 aits handle to be opened and then, will be detected.7 m5 C9 r; N7 g. p
You can check that simply by hooking Winice.exe control proc entry point
# ~9 l9 P* Z' k& L/ j# f. T9 gwhile running MeltICE.
: `& U$ s5 s& y \( c( d
2 o: n& g8 j; v% J% ?7 Q5 R! H1 D+ N0 G
00401067: push 00402025 ; \\.\SICE$ O& [/ l1 o, c
0040106C: call CreateFileA
+ n, Q0 K9 r- G' n- d+ O 00401071: cmp eax,-001
6 U/ G1 Y* i% E/ S8 C, g B 00401074: je 00401091
8 U# |# a2 N6 q, ?- I2 W$ O) @0 l3 l1 K# b0 e% D* `& h
; A* q; r6 n- L& N
There could be hundreds of BPX you could use to detect this trick.
( F/ @% w+ @* i' G( ~$ d9 K. d$ c-The most classical one is:' O% a% G5 d8 R @$ M
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||- e R& P5 G/ {" e* b: c& Y" ?
*(esp->4+4)=='NTIC'* W. l3 o2 x0 [
- [2 ]# Y4 G6 H; S, s6 ]7 h( D& c-The most exotic ones (could be very slooooow :-(8 x4 Z, b* a: E, b; G- h
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. F, R' z* x9 D: ~: W ;will break 3 times :-(
' y0 p% `* z6 @2 m
/ S4 h, E2 W( O4 Q: u9 R/ S) z-or (a bit) faster: & H/ }5 n) }/ T6 V& D6 q+ [
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' C* I) J t& i" P! t
) ?. {" o3 b" w1 R1 W
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, c( ~. X) [8 j' ` ;will break 3 times :-(
' ~3 }& A, b' I) h1 d
* N+ t0 a1 a' x6 V! h) i0 w0 n-Much faster:# |' q6 M" ?: J
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) n0 ]# P% Y+ W& Q0 U
& _% O& g8 b" N; Q0 V1 ^7 RNote also that some programs (like AZPR3.00) use de old 16-bit _lopen# \" c" [# P1 F/ b
function to do the same job:; f+ y+ X: B5 K
) p( }% f+ m9 _8 ]" m! I7 N1 Q b push 00 ; OF_READ8 h m: E7 i( V* w" ~( n; @6 u
mov eax,[00656634] ; '\\.\SICE',0
: r6 `( p M+ Q3 h8 ]+ Y* z$ h push eax
6 v5 f$ _# k5 @( g0 m; K6 w call KERNEL32!_lopen
6 u$ F/ e6 g5 D0 i4 ? q inc eax
; |7 T' q8 v! f+ I" [9 o jnz 00650589 ; detected
' A; W. {4 }. M/ p, ~7 f( t push 00 ; OF_READ
) L& W8 q9 M3 v- s& q8 G5 a. V Z mov eax,[00656638] ; '\\.\SICE'# m$ p Q$ C6 O
push eax. u9 D& M' g- S5 D0 ^( S7 [
call KERNEL32!_lopen
4 S) K+ ^% \# v6 y0 P' l6 T inc eax* {8 D2 y. Y1 s: b
jz 006505ae ; not detected6 M8 w, _5 a# s% X
) I- l* S3 Z, F j) t& B( r( F( S; V
* Y* ?* q1 e" R! N6 h l__________________________________________________________________________: V& P, w9 N( N+ H1 z8 }* K
/ l E' e! e5 |6 W- H6 _# eMethod 12
% W' \; e& [- E. S% e, I=========
: g3 `" A& K8 j7 }5 }# ]) K1 u2 L# M" o7 F
This trick is similar to int41h/4fh Debugger installation check (code 05
, ^7 {2 q/ O8 v& 06) but very limited because it's only available for Win95/98 (not NT)
; ]' u L, Z) `% `as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 T5 d& h, M0 E9 L Y- V8 E/ X" \# f% p2 [+ b( P
push 0000004fh ; function 4fh8 Z$ V6 v/ J0 e8 J. b$ V
push 002a002ah ; high word specifies which VxD (VWIN32)
$ i* ]: O5 W: S/ O; o% ` ; low word specifies which service( i; F/ c; k# S& e* t: i6 h$ s
(VWIN32_Int41Dispatch)* _& e' k: p3 @1 k# E3 R
call Kernel32!ORD_001 ; VxdCall9 C$ U$ S" Q3 ?9 F2 _
cmp ax, 0f386h ; magic number returned by system debuggers* O, V3 g5 r2 _; _
jz SoftICE_detected
/ `4 h% T' T/ U) o% [; a0 J! e9 f# F2 p L+ d j* b% p
Here again, several ways to detect it:2 m" F3 r% S$ e
5 B. r5 o" p2 D- F# ^' D BPINT 41 if ax==4f
% t8 t3 Y& m$ O& ^
" D8 @) Z v/ O8 _* p4 D BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) @! H1 g q/ P( D1 |
1 a. \5 N9 {. r- }
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 P0 O4 I/ Q. ` D8 P$ u5 k
S# R6 h$ l6 ]& n' X5 p0 Y BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! t b, D* _" I+ V$ M
! h' k: A5 I$ a0 s/ n3 \3 T5 x__________________________________________________________________________
6 ]2 y0 _8 q* }$ N* F
% e5 t& n# B- H* C2 ~# _Method 13
2 j7 |- Z# B* U9 P4 N=========
8 B6 u/ b' C: e- i Q* _( Z7 ~4 y1 s3 Y/ _- u
Not a real method of detection, but a good way to know if SoftICE is+ i- ?0 |, q/ r/ J8 T& r( H
installed on a computer and to locate its installation directory.. j& m) v6 w* a- |. A& o
It is used by few softs which access the following registry keys (usually #2) :
2 y3 f: @9 r/ i
# g P- C/ n3 i' g2 v-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 C1 m( r% A! g$ X7 y
\Uninstall\SoftICE
4 q- b2 ^. |! F4 v' U. k x-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
+ p. P2 H5 P& _3 Q [6 i-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: {8 J% U, i& }: E/ s3 I
\App Paths\Loader32.Exe
* @. d# y# k9 _9 E
; h% U& N J4 P/ [
# Q; \& l3 m' V; S2 s4 |Note that some nasty apps could then erase all files from SoftICE directory
, P. }- [# O+ m. e(I faced that once :-(
$ G+ ]4 ~8 P" P- X# i' s$ g/ ]; ^, p- D% | m$ G
Useful breakpoint to detect it:
8 q' x6 @, F# I' l0 U8 H6 M0 `- i8 ~0 V5 K1 n0 ^6 \6 U
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 @4 |6 D' y+ N. G7 h" ^
* G& a& {8 O D
__________________________________________________________________________
% O: d) _% O8 M/ a; Y+ q0 ~
' @6 ^, [1 T: u# n
( Z) [+ s i2 {9 r# JMethod 14
- W) O& ]9 x: T- n# R% j" K! _# {=========' F# o0 C: W2 e$ |( [5 f6 n4 ^
^$ ~' ^9 [- v" D1 |, O- e4 a0 |! A
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 p0 K& B0 `# ^1 lis to determines whether a debugger is running on your system (ring0 only).
' c. s+ |& A: d) d
5 h; m0 E$ t/ a2 M( \! v) m VMMCall Test_Debug_Installed) M, F* U+ [/ p+ V
je not_installed# u5 w: t8 O& |' D' P9 _7 @- k1 D
. ~# u- z3 b, p1 g
This service just checks a flag.
! x+ o9 r8 K& G7 B5 R* B& L</PRE></TD></TR></TBODY></TABLE> |