<TABLE width=500>
- y% N1 `; f t- q$ o! g! e<TBODY>; c0 A4 V# Z( }* N$ ^
<TR>3 O ?5 A# h6 r# U+ l
<TD><PRE>Method 01
. n0 p0 ]% r0 ~; O=========
, [. d: L" d0 a3 s/ z# y. }1 z8 i+ O( {
This method of detection of SoftICE (as well as the following one) is
/ y3 F2 [. s! c4 Q% qused by the majority of packers/encryptors found on Internet.
6 l% Q$ G$ U" Z) u tIt seeks the signature of BoundsChecker in SoftICE/ P& C6 s6 D( U- z. y
) u; n/ A4 {1 _+ Y
mov ebp, 04243484Bh ; 'BCHK'1 Z8 e5 p1 M& N: L' p/ s
mov ax, 04h9 d( x& y: h7 Y* `. e
int 3
) L2 v' M+ s9 M1 y cmp al,46 z- }) d+ t; u8 g3 J
jnz SoftICE_Detected
9 w# Q3 Z+ T7 n1 [
/ C7 C" y2 }7 z$ ]& [; O8 H4 H___________________________________________________________________________
8 u1 j1 J; p* e, q$ ]7 ]
# Q% E4 t2 P, q3 u+ ~' MMethod 02 F7 T# _9 c( f. {. ` W; O4 X
=========4 b7 W5 A6 S/ {- R2 |5 \' l8 w9 y% n
2 y, m' l1 }! r8 a. |! U8 k7 w8 W* t
Still a method very much used (perhaps the most frequent one). It is used7 R8 Q$ Z: w) W1 {7 m
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' z4 t5 y% P- B% D, D9 q
or execute SoftICE commands...' K' b5 `7 y/ [; [6 [9 ?7 q$ Y5 A
It is also used to crash SoftICE and to force it to execute any commands
7 G4 ^! @( f: ^: {: D3 ]/ a(HBOOT...) :-((
?) S9 u3 J) a' p& ] M# [! g; ^2 F( g; C8 |
Here is a quick description:
' J# u1 L2 w! G: A5 f/ d V-AX = 0910h (Display string in SIce windows); E2 e- j6 ~" K$ ]& I; m
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ `& {9 q) y( X. g, R( V( V3 `-AX = 0912h (Get breakpoint infos)0 B3 r# c3 G& w6 x& ^ `
-AX = 0913h (Set Sice breakpoints)- G! h$ b2 P6 ?: A1 Y5 Q
-AX = 0914h (Remove SIce breakoints)
* g9 e. E4 ^/ u7 m: X0 k7 w3 X
- z6 E$ Y w( h5 m$ s* {& T( X0 K: Q) `Each time you'll meet this trick, you'll see:
; u( ^! U; n* z! z-SI = 4647h( Z: F/ V$ ~; S3 X; F. r3 a( v
-DI = 4A4Dh x6 a* I3 C) N* K$ o+ o
Which are the 'magic values' used by SoftIce.0 E7 w; m8 {" F3 D6 r, `0 p
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.0 h9 ~5 q% j8 f) ?; Z5 \
6 E: \* ]" {- t3 S. `; w. }
Here is one example from the file "Haspinst.exe" which is the dongle HASP
. O: H# g8 p! N- S& L( uEnvelope utility use to protect DOS applications:
5 H# f* E. v% j. D: U) k: V( K5 p- S$ a% O: T+ T4 \) b
* I1 N& U c; {
4C19:0095 MOV AX,0911 ; execute command.
8 I! h! p2 v2 B! ^4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* U- z! e. q: [6 m* \
4C19:009A MOV SI,4647 ; 1st magic value.
, t) H6 x- Q S: I8 C9 v* j4C19:009D MOV DI,4A4D ; 2nd magic value.2 {$ X8 Y' P' ^. e$ l% e
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ \* n# n/ E) z4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 `$ i& n l% X2 z. l# [# J
4C19:00A4 INC CX$ h& t( w8 T/ G: j+ B
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ C7 A$ T+ O4 _! e
4C19:00A8 JB 0095 ; 6 different commands.$ z" j& S4 B7 m7 r
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* x) ]; I9 J- f& ~4C19:00AD MOV BX,SP ; Good_Guy go ahead :)0 Q" {/ u- v9 y% w, [
8 k- |5 I! T5 Q% V8 Z7 q: \ i& N7 g. YThe program will execute 6 different SIce commands located at ds:dx, which8 }# M0 g3 k4 r& O0 T8 y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" x# z0 H/ h5 P* A9 S
7 L* y# Q# @) p( f& i8 b* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. C/ ]* I$ Q7 k6 k* U* W/ l; x
___________________________________________________________________________
9 k1 c* G$ I* ]" d2 `5 r) m' @/ L( F# Y8 R. r3 V
7 r: v, m4 T A
Method 03( U, A4 w4 b3 u+ ~
=========" @' E/ A. M4 x3 h) B0 P
% F& C4 G% }: L ?/ p7 [# i) T
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h( I, {6 e* ]6 ^8 S; g6 n
(API Get entry point)
# b* {$ d9 A2 h' |7 H' G8 R
2 ]. B* W* Y# w; }1 s! U
; {" u0 X8 Z7 ?- R3 u" @1 F xor di,di8 ?4 h! k& X. M- Q J# l
mov es,di( S& K+ t! Z1 R* Q
mov ax, 1684h 7 E" y/ d* I' z/ S
mov bx, 0202h ; VxD ID of winice8 j: \ U% X9 i! W
int 2Fh+ w# ?5 w" P, L- d9 t
mov ax, es ; ES:DI -> VxD API entry point
2 ~! p% z9 |* p# J! V' s4 ~) J; @ add ax, di4 @) R* r# j& V2 V; y
test ax,ax, C* L# @+ t- e3 [6 Z
jnz SoftICE_Detected
# O: p; M' f p+ {
% X: \4 f( N0 d7 L- `4 A___________________________________________________________________________8 U% o& z `5 q
, A+ g' c" l2 E" k0 q6 R5 F1 {
Method 04
1 P" k! |+ l+ s/ _. Z8 J! ]+ p, i=========6 f( L7 W" J: Q1 X- z. @5 N, b
: j L' |, Z' `( U! c$ L% j
Method identical to the preceding one except that it seeks the ID of SoftICE9 ~5 U8 p# T3 T) Y/ ~3 E, u& A
GFX VxD.- W1 W& c, H4 j0 E) H4 `
L. ]) Y2 w7 `
xor di,di0 _$ p& n9 y+ c G( O4 _# d
mov es,di
/ p5 W) ~; a; W9 N' {1 o" Q mov ax, 1684h $ P5 z' ]* b0 @% C# K! L
mov bx, 7a5Fh ; VxD ID of SIWVID
7 v3 r% A8 v7 e. x int 2fh
6 d+ n5 L) h) D+ S3 E5 Z mov ax, es ; ES:DI -> VxD API entry point
3 i: D* n, g, y' a( \8 F add ax, di
b, t8 w: A, a3 u' k2 A. p' f7 N0 W test ax,ax
4 O2 U6 o, b5 C jnz SoftICE_Detected
0 P; {! }. g+ {: Y4 a& \8 M. i8 ]& a% q9 z3 @- [- Y
__________________________________________________________________________
+ [3 ]( P& H* E& t' z
6 [8 b1 b4 } Z6 J3 j4 W' M( f
; K3 c( g- ?- i7 I, w' q: E3 WMethod 05
: m# T, m" b' M- z. _+ N=========
0 X% h& D3 `& ?2 r- ]
6 u5 C$ Z% _0 fMethod seeking the 'magic number' 0F386h returned (in ax) by all system
# b n, E- q9 }2 S. S5 z$ Vdebugger. It calls the int 41h, function 4Fh.
# K* q/ ^/ r0 t [, g4 b" @There are several alternatives. 9 D& W' l% i$ U7 D6 S; _% @
; m% o7 v9 ^6 X( F2 }. i# r: G1 dThe following one is the simplest:( @: K' M& D- C9 V) t
/ e; X8 k/ U$ F& w mov ax,4fh/ g/ [) O7 H; G4 N/ h& d
int 41h
& z9 s( \3 j$ `7 Q+ P L cmp ax, 0F386
" u" P- v {9 P1 W& q jz SoftICE_detected
c- Q8 o3 X G' J/ w3 R
( t4 Y0 }& g; ]) N5 D$ F; w& N
9 w6 [4 C1 ^/ L) JNext method as well as the following one are 2 examples from Stone's 6 ]2 o, z r" h0 }& h
"stn-wid.zip" (www.cracking.net):& Y- t) O! @ I1 A, R0 \
6 K% b, A O0 u7 Y/ M mov bx, cs
, a1 s: U; m- C9 t! l lea dx, int41handler21 Y; O* [, R' r, ^; p+ _ p# m
xchg dx, es:[41h*4]
, H7 @% v' p$ ]$ K/ p4 b7 p xchg bx, es:[41h*4+2]
- \+ k7 ?& H3 @3 P mov ax,4fh6 p. Y7 ~* E6 q& z7 C! B* }
int 41h1 Q5 A8 w" q: ^9 [
xchg dx, es:[41h*4]5 R0 W8 l$ l& Y
xchg bx, es:[41h*4+2]
$ ^3 A0 J! Y# q; a* E. G cmp ax, 0f386h, u# t4 |/ f0 b6 y" C" n
jz SoftICE_detected2 i, G4 @+ H! C6 I1 m' w
, ^- [! |1 [ S, K
int41handler2 PROC
7 ]4 v3 R0 @ ]! |) t iret
. f/ t) Z# b7 I% B( Bint41handler2 ENDP
+ _" F. Q' M3 P5 u6 v3 C e6 F3 J/ ]' n9 \
# i% I! i) c% e
_________________________________________________________________________+ H1 J( G' J0 n4 a
3 I5 t B* v4 w- {( k
& L2 c; a, Z7 k3 L9 ]9 z
Method 06' u& Z/ l0 H3 o& O7 C1 I5 \* x
=========3 X* P. s& x; Y. E+ i
- g2 M) |6 }6 S. p; n
5 r% u. u9 R3 m! {( e* y/ T' ?2nd method similar to the preceding one but more difficult to detect:! i3 J6 U2 u& j
9 H2 Y" @2 L, x1 A+ V _1 t4 ]0 r# P r
int41handler PROC1 h5 c. m# w- |8 J9 g# Q/ n q. l
mov cl,al4 t+ T3 K7 X0 j+ D" X* U
iret
5 g' F( @- ]( |0 J% V U- J* g0 tint41handler ENDP! M$ [( X/ u2 Q9 P. a. M
% Y2 f+ s& P* _ V, T, t# P" E, L8 z4 l; G) s% I) w4 a$ e) {
xor ax,ax
9 R1 o; v" G' P8 ~6 S7 E mov es,ax
/ }2 E; f; S( `* P# L1 M- h: h mov bx, cs
, Z9 h5 n) x7 E- X7 l( m, v lea dx, int41handler
, z6 k: ` w1 S4 F8 _3 E) f- d' M xchg dx, es:[41h*4]9 k% Z" }! Z6 m) d( s- e
xchg bx, es:[41h*4+2]
) Q7 o: s P& Q7 | in al, 40h
3 N- B% e2 M* c! k0 k, r) k0 T xor cx,cx
" f9 n1 f: x2 O- H1 h8 A int 41h3 J7 t/ y8 y+ _% E# V, ^$ m
xchg dx, es:[41h*4]
9 k3 I) r+ `! x8 K! B! f( m xchg bx, es:[41h*4+2]
# z- \5 _2 V+ \, _% v) i& V5 X cmp cl,al" ^+ v4 I9 `8 e2 K$ T. h# g) Q
jnz SoftICE_detected
7 d1 T% R1 C0 D) k# M
; A! ]$ i) K0 ]/ s5 z* h: R_________________________________________________________________________
& s% v! R$ ~% M2 G" r$ {8 V& _% V3 D
Method 07
6 L$ d& _7 F. F8 d- y4 V( N& {=========; y/ G! t: @3 z7 _% r: U( v
, Q6 F: V; @1 ^: E, t8 B
Method of detection of the WinICE handler in the int68h (V86)8 f2 @" B" D& `3 a1 ]/ J0 W7 G) e
) x; d! ?0 ^, O mov ah,43h
# N& M: E- J9 u. t int 68h
7 F$ k) V: ^6 J4 A% _ cmp ax,0F386h
( B$ E: g2 c; k) n6 n jz SoftICE_Detected
& Z6 Y C0 Q- ]) ?
, O3 ~2 O! n; p
6 S# S9 M8 b y) T=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: c$ }% |% B) d- R app like this:# ~, L+ _6 V" S" {/ _0 S: l& A1 c1 V
: |- J0 t! B, Y$ F' r- @
BPX exec_int if ax==68+ P9 j7 i H4 w! G; z' ^
(function called is located at byte ptr [ebp+1Dh] and client eip is6 u' @) W2 o& N* @* v" W
located at [ebp+48h] for 32Bit apps)2 P* y' f. q7 T, ?- g1 r7 T8 N
__________________________________________________________________________: _8 n6 K& S8 z
" g! I x- O a4 Y
! e% Z) t3 d. T& xMethod 08& x, K% v% ?4 Y# Y
=========
2 B4 n: e5 U5 X2 `. A
q0 u* b7 q; _0 q4 ?/ r' Z& qIt is not a method of detection of SoftICE but a possibility to crash the
9 @4 g: k4 J- Q0 O4 Jsystem by intercepting int 01h and int 03h and redirecting them to another3 v% w d( F) t3 k1 |
routine.
7 p2 O) k$ s; b4 R" @: v1 o1 aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 Q& @2 J, ?/ o% |to the new routine to execute (hangs computer...)
0 E: U* ^3 T9 j- I
3 ]* m& A* P6 v7 N* t mov ah, 25h4 G( a' U$ i" q; d: r1 {& \, m8 V
mov al, Int_Number (01h or 03h)9 Q! @( F7 Q% J9 P
mov dx, offset New_Int_Routine+ x# M) ^+ |2 I5 t& @8 W2 W5 J# q
int 21h
8 `0 e/ w! ]! e1 c% b+ L7 l& n+ z
__________________________________________________________________________: D1 f8 B- {; h9 _4 I2 G
8 M4 w/ u( j# J+ K0 i6 VMethod 09. [! I x a& N! z8 l
=========9 F: P ~3 q% t0 Z
* N' S& S E. v
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
~3 y: F+ D j: N2 m* ^performed in ring0 (VxD or a ring3 app using the VxdCall).4 w3 j6 |5 O9 N7 Y1 u
The Get_DDB service is used to determine whether or not a VxD is installed
# o& I- w- ? ffor the specified device and returns a Device Description Block (in ecx) for& O& J) C n* c4 P8 K i v$ }
that device if it is installed.9 I8 d0 M* v8 I. I y
1 w; b! S+ G7 d2 o
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; J9 ^& L, L# i7 O9 a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( }4 S; v7 }1 s' T( Y0 X$ C VMMCall Get_DDB; d) a! M3 ]( R+ K
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) b5 C( m* z( c* t& W
4 h6 M$ z* C) j2 f6 d
Note as well that you can easily detect this method with SoftICE:: M6 j, C( ^. f& j, {" P) f6 ` C
bpx Get_DDB if ax==0202 || ax==7a5fh! ]' z# s* r& e% h3 K) E
# m4 v* d( o& Q- r4 B
__________________________________________________________________________0 Y9 |8 b1 `# W/ `4 s+ J
- T& q: I1 ^6 S: A: w# ]% iMethod 10: n4 K$ L& `+ \0 Y! z7 s
=========
0 S2 ], A& C' G6 `* f$ B
4 e' W. T- ?7 f$ `8 H& C=>Disable or clear breakpoints before using this feature. DO NOT trace with
C# p- ?& k' {* I' Y+ k! [ SoftICE while the option is enable!!
& z! `+ {5 t: ]+ l& Q3 v
. T# g+ e* p/ e* r+ BThis trick is very efficient:2 R1 s7 F% j" r* D! G2 \
by checking the Debug Registers, you can detect if SoftICE is loaded2 I: W' _0 p2 r, @1 `2 f% l( x
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 g$ w8 Q/ w5 k: Y
there are some memory breakpoints set (dr0 to dr3) simply by reading their
8 s2 Q1 k0 H* W$ t+ v; }value (in ring0 only). Values can be manipulated and or changed as well
6 ]) F0 i3 a6 U$ N2 f; }% ^1 [# y(clearing BPMs for instance). ]/ z0 h9 K2 p- Q4 W2 U4 l0 u
1 u/ K& Y* s# y! R4 G1 h__________________________________________________________________________
) ?! z/ g% q8 f0 [3 F
$ ` t9 v, C% t+ i0 G" X7 v7 |2 dMethod 110 F1 E/ w; z M# l
=========
8 d7 ?1 X0 _; ]8 }8 \
3 A' f4 H5 b9 h7 e1 s! I8 U4 AThis method is most known as 'MeltICE' because it has been freely distributed
! A1 d7 a! o/ F5 t8 j! A9 g0 J- Ovia www.winfiles.com. However it was first used by NuMega people to allow& y' v1 @& ^: |( G$ i
Symbol Loader to check if SoftICE was active or not (the code is located
# F8 ?6 q. O( y5 j4 s! l* D% Linside nmtrans.dll).! t# Q( Y7 |6 u( |# U! p
1 a7 W5 I3 [0 ?; z) U$ }
The way it works is very simple:
& x5 q" ]0 g3 e" o/ yIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 r& E6 @. |/ D
WinNT) with the CreateFileA API.
6 C& b0 E7 N9 [+ F/ e. z7 `0 r, V ~
Here is a sample (checking for 'SICE'):
/ l$ {& z- e2 t: e4 h# ~8 L2 z) O& [1 q4 J6 l
BOOL IsSoftIce95Loaded()
9 C" G# I/ {; Q/ T5 e/ E' e{
! `: V7 Z& W# k- ~: N3 v) [: A HANDLE hFile; / p! u3 _4 e' {! H+ Z* t: a6 ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* I' Q' Q+ e3 V FILE_SHARE_READ | FILE_SHARE_WRITE,$ | j; p6 M1 t% {
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
# K+ w% o6 _; e4 n* s if( hFile != INVALID_HANDLE_VALUE )+ K4 g g! P+ J1 q( \+ g
{4 j5 r0 N- l: j8 R: N4 h, B
CloseHandle(hFile);5 h5 {+ p/ n. j/ L, _6 R
return TRUE;
$ i5 `$ Q# ~, |. b1 O& t }
4 s, A6 O( g- m: t( q6 ^! R) _ return FALSE;
! T" n' I: Y* }$ m4 ?}
8 t: E! C1 w' O( M! Z6 T/ E. K3 h5 u B8 f5 Y% v7 E# ]( i
Although this trick calls the CreateFileA function, don't even expect to be& }6 J2 @" H7 k, }0 Y5 k/ A
able to intercept it by installing a IFS hook: it will not work, no way! V2 {5 Z/ t1 q- ]- x' b; g) m
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 v7 `% ~2 n7 f' k6 g0 D3 B9 |: ]service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 w/ ^' x: L D+ I/ y# ^0 ^' xand then browse the DDB list until it find the VxD and its DDB_Control_Proc1 X8 D/ {- ~' p2 m
field.
" \3 H" }& N$ l1 E+ S) |In fact, its purpose is not to load/unload VxDs but only to send a
' y+ d9 R+ G5 ZW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ o3 D0 ~" F9 Y& l3 ito the VxD Control_Dispatch proc (how the hell a shareware soft could try
, l9 L! y5 }# @to load/unload a non-dynamically loadable driver such as SoftICE ;-).8 F; h3 d y W# K6 v8 ~3 p% H
If the VxD is loaded, it will always clear eax and the Carry flag to allow
% w* h7 ^1 e' {9 J1 a9 T! Cits handle to be opened and then, will be detected.
( M. f3 N$ E+ c' i: M& ]& jYou can check that simply by hooking Winice.exe control proc entry point/ V3 b) ~ I/ ^" ?9 O% h6 \
while running MeltICE.
- `" H% F- Q6 v/ Y! n
: k$ D# k; e3 h6 t, m F7 @% a" G& b3 q' o. [* p \
00401067: push 00402025 ; \\.\SICE0 a3 w5 j0 j9 }( v2 G
0040106C: call CreateFileA9 j: U/ G/ V: j: q4 Y
00401071: cmp eax,-0012 O0 A. h, @: N* e6 n4 |" Q
00401074: je 00401091* T, }8 i& ~& p2 m& E
7 u5 e! a. k: h3 F) C2 M5 f9 n/ }" l3 ~! R2 G* Y) G! h/ q
There could be hundreds of BPX you could use to detect this trick.6 I5 D6 e5 W/ _" h% M# G6 x
-The most classical one is:; @& N' u$ H, B# D k$ H; [
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||' T% [5 c; X. ?* w6 s& N
*(esp->4+4)=='NTIC'; j5 O6 Q: Y, k+ |: A% g* H
2 F2 h6 ]/ |) p9 J$ c# C& A+ K) H
-The most exotic ones (could be very slooooow :-(
* G1 C8 A& e' G. o, i- e2 i7 j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( l" W' [" b2 D; U4 S+ K: B7 A ;will break 3 times :-(8 B- ^& }! ?2 {! T" s
' W7 C" j, c! R* o$ q6 r-or (a bit) faster: : o2 s$ ~6 O* r/ _
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 Z P8 W' s8 ^4 M! ^& O1 t; S! H b" |8 ?4 j. G5 |
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
! i/ G* R9 M! ~4 c/ Q ;will break 3 times :-(0 ~& r6 V* ?, D7 q+ f
( v6 P' S: [+ l& I& a4 e, u5 q/ D-Much faster:
* D) K% F0 |6 c9 ~$ U BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' q! j" C* X; L" o+ n2 `; ^4 Z7 ?2 F5 s& B8 `* u, A) b
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen2 y9 n+ s. X* N+ `) {2 h
function to do the same job:
9 K% |/ j2 v+ X6 ~6 d4 A+ S2 B( l* x6 B
push 00 ; OF_READ- C7 F' R, _( s$ B' E% m$ r% [
mov eax,[00656634] ; '\\.\SICE',08 W( \9 s/ h& J; Z' i5 L _
push eax; U: Y+ M$ H% n' y
call KERNEL32!_lopen
; x4 c5 v) J, \1 I' u inc eax
! { J. h! K1 }5 }9 V jnz 00650589 ; detected0 u+ g1 f: @; _' o2 t# Y: M2 T
push 00 ; OF_READ. C% z4 x' K/ r8 ` R, Y* M
mov eax,[00656638] ; '\\.\SICE'$ K! L' r! \: g
push eax# {: D& O' ?& s( Q3 ]
call KERNEL32!_lopen
$ F* I5 T/ e, o2 K. I1 q9 i: m inc eax& O# o: p6 w8 U [# b3 w9 x1 p- M
jz 006505ae ; not detected
$ j* W, W+ K5 ^9 v5 `6 U! u& `9 t" m0 B! j5 z
% J; x9 `# C; ?- H5 W
__________________________________________________________________________
) X0 V n1 i+ k( t* B8 b& [$ I
6 ^7 z) E% y, ], B$ pMethod 12( A# x; D3 @" t6 U
=========
. p. ^# d4 y; }7 o! _- K4 k2 S7 H! }& a
This trick is similar to int41h/4fh Debugger installation check (code 05
/ b8 g$ R* ^/ N# s& I2 {! h& 06) but very limited because it's only available for Win95/98 (not NT)
4 E. y, g) i z$ J# \as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' T$ g D! K# k% x% h8 D
, u1 M+ a8 @. }0 K! Z) m push 0000004fh ; function 4fh
& g6 L5 M4 S9 Z" D( {+ w4 M7 V push 002a002ah ; high word specifies which VxD (VWIN32)
# b) f$ B8 Q5 a6 K ; low word specifies which service2 r' H4 {" W3 J$ g
(VWIN32_Int41Dispatch)
7 F9 T0 e5 _+ m' ? call Kernel32!ORD_001 ; VxdCall
) c5 _2 R2 M7 T/ ?0 n cmp ax, 0f386h ; magic number returned by system debuggers
# e8 K0 } P" }' ]$ W/ r jz SoftICE_detected
7 U& V" V. P9 B/ }! l: S
. Y" T' G9 r1 g/ j; ]! UHere again, several ways to detect it:+ r$ Y- V1 D2 @' d9 k( h0 y
! s# [' R5 ?2 W( G
BPINT 41 if ax==4f
. h+ K7 ]( k; s! N; R9 K$ w0 w% M- c8 C/ u. _- r$ j
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one. u/ b0 b+ d6 L. Z X8 I$ z
O( n3 t R# w5 M BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A( H: _ i, O( }8 J2 o, K; U0 Y
" m1 i2 B8 z9 ~4 u7 l; E
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) ^7 O% Y# i% ^4 p: `1 P% m
4 r" K7 c0 r1 F2 l. Q
__________________________________________________________________________
% [( E& M! A/ C- E" B9 U2 u# k6 C
! c3 C# ?3 D9 ]! H. c% Z0 BMethod 13
0 z% h1 ]+ u2 [ i4 u7 J; r9 K, G=========
, _5 j' j) d: Z
- X; E; c/ m5 N$ W- M8 N4 ~: ^( y: LNot a real method of detection, but a good way to know if SoftICE is6 \8 ~! S# _8 e+ u9 S$ B
installed on a computer and to locate its installation directory.
9 P$ L4 G, y7 D# F- XIt is used by few softs which access the following registry keys (usually #2) :
! s1 i) I1 Y% @# [! F" I9 e' P. e1 u. |$ u: L
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# k K* X4 H' _/ a. H2 D+ x2 z
\Uninstall\SoftICE
8 l4 l3 V- C9 \/ e% Z8 p/ i) P-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 w0 ], X5 s' J: |5 ~/ b: i-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) z1 S9 c Y6 u& V% R7 a# ~* o
\App Paths\Loader32.Exe
+ N# B! ?! D! r5 l! f; c$ W
0 O- ]" F- K: v3 [* @* Z$ @- p( u
Note that some nasty apps could then erase all files from SoftICE directory5 A( _4 X4 E: N9 L' U* G! x& F
(I faced that once :-(
: o/ [* B) |5 L9 X1 N7 J4 U. l2 R! _4 l
Useful breakpoint to detect it:8 _" e5 [' W0 \$ ~4 B; y5 J6 Q
+ e& l$ p( J6 K: W; x BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ G/ {) J" e" T) x% w( C: ?' ~. L- ]
__________________________________________________________________________( V3 c5 Z* I8 A$ E
! v$ Q+ ? R9 C- y$ P3 ~5 d# [
% G* X+ |$ O/ t2 y% oMethod 14
$ n# |/ i/ @) w& V4 x, P; ^: a% y=========
- r. N/ T6 X! H* ]& v
4 r* Z5 T: P0 MA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 Y6 l u6 J: G$ D+ `. o; S" w4 Fis to determines whether a debugger is running on your system (ring0 only).
9 n' R3 e j( Y+ U- T! K! X% E+ Z+ C* {- z: p& B
VMMCall Test_Debug_Installed
7 @" `9 n% `9 f7 ]- \4 G je not_installed
) L$ \2 ]: q$ {; j/ G; r: k3 ^ q& k/ ]0 g/ L- h' h1 T
This service just checks a flag.
* U5 w7 A4 h. {</PRE></TD></TR></TBODY></TABLE> |