<TABLE width=500>1 g, ?7 j# J$ b$ Q3 m+ i9 O
<TBODY>
0 T8 [# o" S3 a" O<TR>* ~( \: f# \( J6 Z6 }5 v8 ^! I
<TD><PRE>Method 01 % m2 ^. S6 F% ?5 @7 J* z
=========) G( I( B4 ^; Z$ d
0 b8 H5 e ]$ j/ i( l/ B8 `This method of detection of SoftICE (as well as the following one) is/ P; e3 V$ e: B& a( Z
used by the majority of packers/encryptors found on Internet.2 V' {! w4 @6 D Z% z e1 N( O
It seeks the signature of BoundsChecker in SoftICE2 N' s! o+ D# V8 b
& b* Q2 V' B$ U) Q, Z' G. I. u
mov ebp, 04243484Bh ; 'BCHK' P; O$ I8 |( }- Q: m0 E
mov ax, 04h
0 }+ q7 l3 U+ F# ` int 3
- k; I* B: t# `6 C& h cmp al,4- R4 l9 c ?/ y f# U5 M4 K
jnz SoftICE_Detected5 @! g4 ?: ~' b- [
6 H4 d5 c* c9 K! D" N___________________________________________________________________________2 j% h' f2 b6 i6 \ F! g# `" y, \' m
: _* m1 ?- K9 j# s3 z0 B4 g
Method 02
6 D+ T7 F$ P- h# E=========! ^* d4 x9 P$ y7 n5 @
- W L5 v) V6 dStill a method very much used (perhaps the most frequent one). It is used0 N! S% @0 \- D% a$ f; F0 S* R
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* S! z* {0 [; y! H- X7 Xor execute SoftICE commands...0 C: n, {7 _% D, \# {$ r+ ~
It is also used to crash SoftICE and to force it to execute any commands
( X7 T* o% |, K' z8 F(HBOOT...) :-((
; s6 m" M4 Y9 T6 N1 ~
! X/ S2 L& o" E# B7 ~Here is a quick description:
- C$ ]" | t- P. H! M$ C6 c# ?-AX = 0910h (Display string in SIce windows)
( \ v; M# o ~; w; h& d) z) E-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
& f, d: ^& s+ u% D3 E O-AX = 0912h (Get breakpoint infos)
0 d* _$ x1 g: c; \4 j. c+ b0 f-AX = 0913h (Set Sice breakpoints)
7 j1 {# V7 m. [% L1 E7 u! Y-AX = 0914h (Remove SIce breakoints)
9 J: b% C0 k* ?& W( a
9 `' O5 L2 y6 j4 H7 lEach time you'll meet this trick, you'll see: v* J. e5 ?, W4 E# j8 J4 E
-SI = 4647h
, N& \4 b, \. s: W) w( {+ d-DI = 4A4Dh% o3 F' O+ J2 i/ i0 p5 a
Which are the 'magic values' used by SoftIce.
, l* I# k( T. g) d1 g/ g8 q! D- \! U; c7 QFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ ?+ F" v5 y$ D0 f2 p0 [5 Q F. P% d2 D" M8 ~$ d% E, d
Here is one example from the file "Haspinst.exe" which is the dongle HASP
5 i- K* M8 s, N1 M' u/ yEnvelope utility use to protect DOS applications:
/ a7 A$ s. W$ l8 y% g$ a; M! |' ~+ |* w0 a) |
7 d3 V) ?* J3 W4 L2 F a
4C19:0095 MOV AX,0911 ; execute command.
" k/ C* U: e$ k4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).5 O8 }- _' H. Y, I a8 @
4C19:009A MOV SI,4647 ; 1st magic value.
4 K k: W1 J3 Q, [# p0 s9 W" p4C19:009D MOV DI,4A4D ; 2nd magic value.
7 ~5 \1 l8 k3 M9 D' q8 Q; `% [4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
, p$ n7 W2 [2 M- P7 k4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute N! J5 z- g& J) X6 ]
4C19:00A4 INC CX
9 b( h8 h1 [+ ]4 }; M7 [6 j4C19:00A5 CMP CX,06 ; Repeat 6 times to execute/ S7 \. c- V6 b% a# i9 e, x3 v" P
4C19:00A8 JB 0095 ; 6 different commands.
f/ ~) ?9 M4 U: h4C19:00AA JMP 0002 ; Bad_Guy jmp back.
) \2 V+ Z+ n; Q* r4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( g# X/ W6 |+ h S! ]# e1 L/ J' _. \9 S
The program will execute 6 different SIce commands located at ds:dx, which
1 S: r5 @7 X# T9 s8 Ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT.- I$ u( }, @% p# V
c1 W9 c! Q3 M* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 ~. _4 S+ f5 y7 D- ]! u$ ~
___________________________________________________________________________; s8 [2 U! J7 l6 ^) l' F9 J
, n q4 s0 T$ w7 P S+ v; @0 H X1 |# b
Method 03
# `) e- G' v1 F q" k=========
- s% W2 h: @, ^) j- \% h- b0 q) I% `8 z
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 ~3 Y+ ?) V Q3 S* c/ d; b/ L* y
(API Get entry point)( a" |* f; n9 x' v( B
( w3 {5 T. B7 r! ` g0 [ I; N) \2 z+ m8 l9 C) i7 o/ o
xor di,di
: j. f$ l( b' @' H% T4 a mov es,di8 ~3 K$ C! I# K0 [% [
mov ax, 1684h
0 k7 X! d, s. }$ o8 Y7 } mov bx, 0202h ; VxD ID of winice
* q' i$ m- Q Y, I) X% B$ M$ V int 2Fh
/ S- n/ W6 k2 w3 T9 k mov ax, es ; ES:DI -> VxD API entry point: x' R+ o8 ~: E% D2 u/ ]( K
add ax, di
' [3 }& U, R& K test ax,ax
) h" o9 K+ D' l9 G4 S jnz SoftICE_Detected" t/ m# n, w8 R5 E
8 E- ?, P5 M1 R' s+ l! A___________________________________________________________________________
: U7 s# R' k4 G& A+ }+ m& b4 Z* b9 P
Method 04) f: B$ @! k2 [0 w8 t+ [
=========+ ]: R2 F8 ?6 n; V" k
1 q1 q, \ P) z/ m$ rMethod identical to the preceding one except that it seeks the ID of SoftICE8 S9 n, m7 `( U* L% E
GFX VxD.
9 S9 A( ^7 s1 d, B( \6 Z
- Q8 z& v; K7 j: p- s$ ?$ n# a0 O xor di,di9 m: t3 S5 ^7 N% ~1 F2 `, S5 ~( ]
mov es,di
* \2 k2 S. _ D% s4 ~. y- C0 ] mov ax, 1684h
; X% U* t+ A. Z/ n9 W mov bx, 7a5Fh ; VxD ID of SIWVID
+ R# w" c! \# U2 ~: C& B int 2fh2 l0 f) _0 c: ?- i' B) ~8 d1 m' r. d
mov ax, es ; ES:DI -> VxD API entry point
* n, A" D) ?# z& B add ax, di
: r; j- f+ `/ V" ?% ? test ax,ax
/ g0 }+ l: ]4 Q2 {! G1 f1 P jnz SoftICE_Detected
3 y( e. o7 r" x- w2 M! a7 W6 v/ w9 R* [
__________________________________________________________________________4 r9 H. E' X& L% ^ }; `- `
. v' v& ]3 o- A8 v
. V% u2 _8 ?. h9 [2 x7 w* B
Method 05
( b0 D8 R/ B" u+ H; t3 k+ b& {# M& }=========
0 h D% ~7 t) y( F6 t+ k
) X9 a% w. i+ Y/ a3 X! HMethod seeking the 'magic number' 0F386h returned (in ax) by all system
; `. ]- p' ~) D2 G5 Sdebugger. It calls the int 41h, function 4Fh.
5 j" N3 p6 Z6 y% \5 `* GThere are several alternatives. ) A+ n" p. ?0 a0 B
- l% P3 N: D+ y& Y+ u9 o; EThe following one is the simplest:6 a; t a9 ]4 |1 b" _9 X* }
+ F$ ?( N' e- m1 i9 x% [ mov ax,4fh
& D/ o% n7 f" l! r' h( u D int 41h
' T9 n/ h" U* \3 W; h$ [7 q$ w3 n cmp ax, 0F386
( b9 x- T, S" y: y jz SoftICE_detected
6 L$ f. }; I g5 \3 Z9 {$ J' H# I7 a+ B- J
- e, c2 [; {9 U# t, Q0 z, \
Next method as well as the following one are 2 examples from Stone's
' Y- N; ~: _. J9 E( z& N( L"stn-wid.zip" (www.cracking.net):
5 _: J9 \) G; _1 `- a3 g/ ` K, D" f' q& G
mov bx, cs. w* t) r i3 Y; O
lea dx, int41handler2* U/ b7 m5 t3 F
xchg dx, es:[41h*4]: o3 A* M( G3 T& v* D8 b$ G
xchg bx, es:[41h*4+2]
! D( t0 g* c/ @& f& ~: Q/ m% j mov ax,4fh
/ W* L6 i3 \0 r9 T( v9 {. m+ H int 41h
, A, ~! C1 ]; w! ]6 M6 f6 i4 T4 a) f xchg dx, es:[41h*4], ^9 {( q5 b9 x, ]& R; I& n
xchg bx, es:[41h*4+2]% x: ?% W% g0 M$ O* k" P2 T
cmp ax, 0f386h
/ G( d5 z+ s5 B9 u jz SoftICE_detected
" [& \5 B6 w" [" f% o& `* f% @" [4 |+ F/ H: D; P
int41handler2 PROC
) z# m# l. l6 O& h& {& Y: b9 A: G iret/ U) F- x% Q, l/ b1 ^- L$ H
int41handler2 ENDP
8 `( j( t8 m$ ^* Y# X& e" G' D/ g( ~9 j v
; t& x9 U7 ]5 {0 E: `8 ]( A5 J
_________________________________________________________________________
, b& ]9 M% q/ _$ w# l$ N7 K8 r% K. | c
0 e" q c& N. {8 B% X
Method 06' i' ]/ R. N v7 q
=========
4 g$ {' G8 k, e2 y }* B$ O# U, _
& u6 n3 y6 }2 p7 h6 `
2nd method similar to the preceding one but more difficult to detect:( Y( h1 ~- Z R+ v7 Y+ S% R
2 W) s) e# p+ F( ?
) Y, K& U$ Z6 c5 g* r* sint41handler PROC2 o3 Z6 o: D2 d; R! w
mov cl,al6 w' n' C8 v; O' T" K5 H
iret( @* Y ^8 Z, e8 A% m5 w! z9 K
int41handler ENDP
, ~& S' J6 [9 j5 Y& M9 `1 C4 L+ Q( ^
/ o4 b0 R9 L% s2 D! Q
xor ax,ax6 ?- }" G/ R0 L( a7 ~7 |% h. `3 N
mov es,ax. R- F$ p4 T7 o( p1 h
mov bx, cs
7 s7 Z. _" p3 F6 Q lea dx, int41handler
! H- ^9 R" Q/ I i7 t xchg dx, es:[41h*4]
2 F0 ~( X+ X) {4 l& ~ xchg bx, es:[41h*4+2]& a* T# C* s0 p8 g `9 ?0 R4 b
in al, 40h
5 n3 O# |7 l/ V4 b1 C6 Y xor cx,cx* j% h: P/ s" ^+ E! t
int 41h* V( o3 S$ M' [- N) N
xchg dx, es:[41h*4]
9 K$ q* w( }& Y# X xchg bx, es:[41h*4+2]% @) \8 U/ p* `
cmp cl,al* q) d( Q0 a& e* `1 Q
jnz SoftICE_detected
* s+ N/ w# J% F- b$ u* r: b7 c7 _7 s3 c/ e
_________________________________________________________________________; H: f1 [! [6 H y1 g8 ], V
) ?8 D6 J ~4 a+ [) s' vMethod 074 B9 Z6 W+ _1 q+ D1 _
=========; L% m* t |, A* F8 H% b. K
* L' f p m$ m, EMethod of detection of the WinICE handler in the int68h (V86)- F/ ~% O5 ]4 y1 j7 c9 i2 t+ m
% P- r* v E# E. |4 M8 f# {) Y4 o
mov ah,43h) L. g. j. ^% O" l$ L
int 68h/ T* A1 E) t+ f& @& r( G, g
cmp ax,0F386h
* u2 M; l- w# z% Z) W jz SoftICE_Detected
8 V. V: a' [! O" A4 E6 \; F" V+ l6 f I4 n, G
1 a9 s t# E4 B2 G; b9 F3 l=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ L: _( @- _2 H1 e9 J/ z app like this:
: N; {! Z* |/ h/ ]
: a7 n5 ~& o% _5 } BPX exec_int if ax==68
& T5 t0 o T' R; b, c9 b (function called is located at byte ptr [ebp+1Dh] and client eip is
# p H k1 b3 c+ ^ located at [ebp+48h] for 32Bit apps)" x+ |0 E7 J& o: ^& t$ s
__________________________________________________________________________- h0 A: H, L, p. M* v( _
- P3 Z' T* b: L( A, \" |: i3 Y0 P- ^$ F* G0 ?
Method 08
! q5 {& @+ B) W7 J% W* g x! S=========
8 O; Z- i8 r: q5 V( i
/ y9 J/ \1 E" _9 h bIt is not a method of detection of SoftICE but a possibility to crash the q L# | j" z9 Q
system by intercepting int 01h and int 03h and redirecting them to another
) G) a3 Y7 R( C2 k- L( v1 Uroutine.
1 ~8 ~/ [( }! j# DIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ r4 M# ?( D) z
to the new routine to execute (hangs computer...)4 C# G6 [# Y2 u7 m/ v
* x D) t2 t7 C! [- D# n, w* _
mov ah, 25h N4 s' t* w6 b: M' P& x
mov al, Int_Number (01h or 03h)8 Y; b6 \- m' Y* m2 Y
mov dx, offset New_Int_Routine
1 }7 l6 z7 A4 w1 C& a' U9 X7 N% E int 21h
; R! a6 u$ T- w; K9 v/ \; E! W+ W/ B- P& L. o. l
__________________________________________________________________________
8 I( |) _6 l. O! I4 k/ |5 K- {' W9 [5 @) `
Method 09
$ Z, s' ^) \# K=========
" U4 C, E$ W! g2 w0 Y8 q1 J% E
' I. ^ Z- {1 Y/ G, K' W0 KThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
4 C" t' `/ j$ F0 L4 `performed in ring0 (VxD or a ring3 app using the VxdCall).
* @: G& |" G' g" JThe Get_DDB service is used to determine whether or not a VxD is installed# k/ f( V! j- o" f
for the specified device and returns a Device Description Block (in ecx) for
0 A0 @, j7 w! r3 cthat device if it is installed.
' [& ^# Y! L; s3 ^; i9 Y" j
5 \8 J% t; d/ O9 d7 y7 Z6 n mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& t6 Q$ h* p% A* w3 B- k mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( _% O S/ ^9 f
VMMCall Get_DDB
) l5 g, I! W9 p9 h1 A' p mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
- h/ C" B/ X+ [" j
& z( M' {0 B( s4 x% Y1 i4 ONote as well that you can easily detect this method with SoftICE:- C2 v- T V' v& b% _
bpx Get_DDB if ax==0202 || ax==7a5fh+ V: U; {, T. O- T5 {
3 b! o+ Z( C/ c; N4 q" t
__________________________________________________________________________+ f" o6 r, \" z h8 u
- F0 E+ E) [. @* m; Y2 x4 HMethod 102 z8 I$ `+ k' J# z W. W) h
=========% Q7 D' K2 e; G! |, |
5 y" h+ _- ^ N; t
=>Disable or clear breakpoints before using this feature. DO NOT trace with# y. N+ y2 w% K$ O& j9 F5 U- X: l
SoftICE while the option is enable!!
6 W7 ^9 S$ {9 h9 y2 ?- A+ B6 ~3 [" V3 _7 b. \
This trick is very efficient:
]- q$ ^: u2 ?7 ]3 U) o, p& s7 k2 Jby checking the Debug Registers, you can detect if SoftICE is loaded, f) P1 C8 P6 s' L
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* | N6 w4 |/ p0 dthere are some memory breakpoints set (dr0 to dr3) simply by reading their
0 ^6 M; P! G2 g7 e* n9 A Y2 ]0 O0 Qvalue (in ring0 only). Values can be manipulated and or changed as well% M# x; c1 |; ` d: t, f5 \
(clearing BPMs for instance)/ ~: I7 C) q$ G* b. g; W- Q5 Y$ t
$ C" L& P' q+ @0 w L% G__________________________________________________________________________
$ E! D' b; ^( E, a$ Y- f( n( g0 n0 ~% I: M) Y4 J8 N3 J8 C; w! Q- y
Method 11
4 A) \0 f& s$ \ n7 O6 v9 h' T4 U# W=========
1 ?4 `4 A* M+ W( r }7 H' n" @* k. W3 J! n
This method is most known as 'MeltICE' because it has been freely distributed
0 G( d- x( ^* ]. M& G+ Dvia www.winfiles.com. However it was first used by NuMega people to allow8 g5 |2 U3 z& v7 O
Symbol Loader to check if SoftICE was active or not (the code is located
& i0 o+ |6 s+ x+ t3 K; ~/ iinside nmtrans.dll).. V" k. R) a* V8 U' L
+ p. p( [0 N( _& Y) AThe way it works is very simple:
4 L( M! z$ e6 T' _+ X% S/ nIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- G: u& P/ X3 t
WinNT) with the CreateFileA API.
) K5 h4 `" f. A$ a9 J
$ Q# K' j. M' F8 k/ @2 NHere is a sample (checking for 'SICE'):6 t4 _- r/ C5 k2 w O
" v9 [" q+ [# a$ K* s- y; T
BOOL IsSoftIce95Loaded()- C# O% j, G. B3 P6 e6 @$ x2 f
{7 N; E; ]* R- O3 q2 D+ S# Q
HANDLE hFile;
( m6 z$ p- K1 J' n) { F% k hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
- z! K* E9 t7 m7 B& | ^; k FILE_SHARE_READ | FILE_SHARE_WRITE,
4 g7 e3 E, ~9 A: @" z$ K1 y+ t; c NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ p0 h7 ?& t$ x0 e) M" [ if( hFile != INVALID_HANDLE_VALUE )0 g1 l, L- q$ `
{/ W) p, {5 u0 a8 A
CloseHandle(hFile);7 t0 O8 z: @/ m+ x! x
return TRUE;
( k& c/ ^: L8 V. |* {* d }" f: x* X4 @% Q z) U. ]
return FALSE;
+ a% O. o$ k- {8 f1 o2 {1 J}
3 g `2 v+ s9 i9 U1 X, F( X7 b6 g1 j; S% N% ~1 ~9 g
Although this trick calls the CreateFileA function, don't even expect to be: K- n. D' l6 Y, B' z6 n
able to intercept it by installing a IFS hook: it will not work, no way!; k. U* X1 t S4 L; {* E, _' Y
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 t: I8 s) |( C5 z) [1 iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ k ~- x6 z2 W. e
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
( Y! q) U6 f P+ J- Kfield.0 o+ \$ o% s5 d, X6 Q9 v7 f
In fact, its purpose is not to load/unload VxDs but only to send a
( x# j% J% K- M* N" ]0 L. G; G5 sW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( h) g* }) j+ i7 y7 N( ato the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 @( u; h& x6 `4 X) Dto load/unload a non-dynamically loadable driver such as SoftICE ;-).4 P+ O; k! |5 Z( B
If the VxD is loaded, it will always clear eax and the Carry flag to allow1 b! d# T7 S7 `: ?) e% F
its handle to be opened and then, will be detected.0 R7 V5 N" V2 i# H
You can check that simply by hooking Winice.exe control proc entry point
. R! }7 ?+ Y- R/ F! d Nwhile running MeltICE.1 S" @3 K! L" N! u: q
& ?4 W" r u N4 w" S2 P
4 s1 i; j* `9 A 00401067: push 00402025 ; \\.\SICE
" t9 X* e5 Q* t" u+ e 0040106C: call CreateFileA8 ^6 f' C: z+ k
00401071: cmp eax,-001
5 U: o) I+ w1 g9 ] 00401074: je 004010913 u5 u* x6 _4 `3 \' r# V
4 l8 R; R6 F3 V, K4 B" X2 c7 A# @: k) @
There could be hundreds of BPX you could use to detect this trick.
: J1 z4 u3 E8 q5 F1 h-The most classical one is:
/ `' ~6 s' ` z9 g3 }; l. k6 R BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ D: O+ h6 J0 L# w4 X *(esp->4+4)=='NTIC'
3 y) r% P5 {) ?
# M9 K; a4 ?- r-The most exotic ones (could be very slooooow :-(
% e% D0 Y+ I6 h+ Q1 U9 Q: Y BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
8 O# G" e. I, e ;will break 3 times :-(% x8 k8 A1 i, w
: |; ]4 d. f. `+ m-or (a bit) faster:
! S: F& O; g1 G8 w5 Z1 |; V8 M BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ Y" V% B" {: i% X
9 Q* k9 j+ B$ }% M% @- x9 U% S1 c* j7 R BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, t1 J% h+ e. A7 A) C# x- i1 T ;will break 3 times :-(
2 m3 c, C. T# f8 U
4 s: o6 z1 a9 D" n4 B5 \* ?-Much faster:
9 d7 h3 |' y5 _/ s; P% R BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'; p2 L' z4 x* ]7 q7 C/ ~% z3 b- C
" n' e( Q h, j: X+ _0 JNote also that some programs (like AZPR3.00) use de old 16-bit _lopen7 J; g5 Y9 i2 a$ W) A( H- L" M
function to do the same job:
2 R( c4 y6 S5 K, A+ L
8 ~" Z8 X8 C5 [* H# Y8 r } push 00 ; OF_READ
4 x! b* e7 ]+ y/ J; q mov eax,[00656634] ; '\\.\SICE',0
4 c* F! z! c9 n2 U push eax
8 \& c5 g; ]( D0 I, H }. K2 x call KERNEL32!_lopen9 g5 p$ Y2 W# E* H( c9 Q
inc eax
5 ^5 U* k/ D! T0 Z/ D0 f- w jnz 00650589 ; detected3 G0 j3 l. U" ?) E( L7 J; r: S
push 00 ; OF_READ8 x, k. e( r" Z) d `+ H8 W
mov eax,[00656638] ; '\\.\SICE'
( T" K0 ^' j) `( f+ w- B K2 f; }% X push eax( @* L8 k, o; L+ C
call KERNEL32!_lopen
# x) @; v# y. ^( ~ P o inc eax
# W$ O6 |/ L9 Q$ h jz 006505ae ; not detected4 N# p' v+ g6 }1 M! v
. _4 E6 S5 l0 c3 F
0 C- n* _' q9 s/ m* t( w& q& n G- H9 g__________________________________________________________________________! K% r. X+ z4 Z. ^ d
* g: ~6 H+ K. n% E* UMethod 129 J- k6 c( t. e% g/ d0 ^6 _
=========
9 o/ F5 W4 I1 c! I
/ ~3 n% ]2 E( o- y# }This trick is similar to int41h/4fh Debugger installation check (code 05
# |6 T! q* o, e* \8 u& 06) but very limited because it's only available for Win95/98 (not NT)
: o5 O! A* Y. K, J% C' t! kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% z7 o, _9 s E; G* R. \. y: j6 b4 }' P2 u* |
push 0000004fh ; function 4fh
: l; D1 S# Q9 b# t# F push 002a002ah ; high word specifies which VxD (VWIN32)
3 W# l5 w, ]* j' A' u( x$ [ ; low word specifies which service- B( Q6 @! \) r9 R" z# T8 B' v
(VWIN32_Int41Dispatch)' B* ~2 L6 d# J! x6 @6 [
call Kernel32!ORD_001 ; VxdCall+ u' C1 A6 y9 `. L& ~9 P
cmp ax, 0f386h ; magic number returned by system debuggers: ^: @) w2 @+ N- J5 E, S2 [2 j$ u
jz SoftICE_detected) G) q# d4 n3 H6 `) [
. {( q! e! h# x. t G% K$ XHere again, several ways to detect it:
) H" @# o( N/ d f9 C7 ~8 V% D1 l& w' f; x7 h
BPINT 41 if ax==4f/ `5 @4 r7 X4 l
8 \- o% `5 j9 w1 _& p7 v BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; l6 c3 j, H& Q5 Q# C) s0 k1 X' d# Y& |5 ^9 D
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
" i: P' q# e6 h1 e0 a7 W# K4 H7 k1 ?5 e) D( b3 [3 |
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!8 a6 T4 [$ C8 @7 A: J
+ t6 i/ h; f- L! ~0 L" ?
__________________________________________________________________________
# t6 E! k. A7 a; U+ P6 }& {; L. m+ `1 q
Method 13/ C- s+ s7 K) Y# K! q
=========
; Z! o) p$ N/ Q# l5 |4 G1 |; `( z9 @5 |* q/ [" N
Not a real method of detection, but a good way to know if SoftICE is- T+ _' K0 m* Q* ^4 v5 C
installed on a computer and to locate its installation directory.5 Q3 ?0 c5 E+ _3 j% b: z8 D. T
It is used by few softs which access the following registry keys (usually #2) :
5 M& v$ B5 q f. ?9 o9 z4 F) _; N( q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. V9 y) K1 y3 K8 [( @\Uninstall\SoftICE) |3 [2 u6 F' R0 {
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, R& z" W) h+ D
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 |( z9 A. C9 C. U2 f\App Paths\Loader32.Exe
3 r" f, `: }8 l
0 r' p+ ]) z9 {& l, x. x5 [& N! w
Note that some nasty apps could then erase all files from SoftICE directory
( M7 Z; {+ O/ P) z$ i# N2 z g(I faced that once :-(7 b0 X \4 ~* k
- e7 q; K$ r3 ?5 ?$ R
Useful breakpoint to detect it:
" B4 |# B* \( E* Z4 E8 T% a3 {* Y. \9 z5 I
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 j6 U2 R" b/ n- T
( `" K: S7 ~ }3 H& {3 L, q3 |
__________________________________________________________________________
7 G6 |5 ~* T, @% f, y) M0 {& C- ~& R! u% Z# {6 D2 E
" l- c# w a2 M; @6 V2 O
Method 14
- E7 }* y0 v" [3 K=========
9 u# K0 v% y( G! Q' F/ b; C: B
5 Q A2 O t& ?3 m8 U9 P! \4 EA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' Y: k6 m+ j9 j* a/ _. L. kis to determines whether a debugger is running on your system (ring0 only).) y- Q, l. b3 Q7 f
& S: L, c- Y) E& y( w8 V& s VMMCall Test_Debug_Installed, u1 j, {" }& b g7 I
je not_installed o/ L( m6 l8 G9 P/ T& o1 `
- E. H1 G! @8 }2 @+ b" V6 C4 i8 rThis service just checks a flag.
. g6 [3 X1 \# d: V$ j5 i</PRE></TD></TR></TBODY></TABLE> |