<TABLE width=500>
7 g# S9 s* n9 ]- ? B0 ?( E<TBODY>9 F9 ]6 H; ?0 L
<TR>/ H# L, @4 }1 G0 r6 i! M
<TD><PRE>Method 01
2 m6 n, H6 V, N1 Z7 m=========
+ r( e. P! Z0 X4 n7 h4 C! K$ l
/ O" G2 ^1 m6 x0 k% ?2 T" OThis method of detection of SoftICE (as well as the following one) is
/ ^# D7 q8 P5 \$ N$ K+ p: iused by the majority of packers/encryptors found on Internet.1 K6 d' s; w% p; k' Z
It seeks the signature of BoundsChecker in SoftICE* b X n7 y/ D4 {, r8 i( e; h
( Y" f2 T& V( T d3 f
mov ebp, 04243484Bh ; 'BCHK'
% u x6 S" W. h mov ax, 04h
- @4 }0 {, m' ^$ _ d" k int 3
, c) V6 ^7 O# n$ d" ]; W& y cmp al,4# J! b1 r$ R5 j- o3 u
jnz SoftICE_Detected* I, ?+ ~/ ^1 [2 w, M
/ f1 N- ^" n8 J% {- _4 S___________________________________________________________________________3 C/ i7 ?3 C9 l _
$ `$ G+ E, F6 B$ Z5 A
Method 020 V4 V) }9 |8 B9 [) I1 @: q
=========
S% G! |. l" r Q
5 }/ V2 D1 n8 h1 G' Q% R2 OStill a method very much used (perhaps the most frequent one). It is used
9 W# a; m2 E' J0 z& }% Y+ wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
& v5 K2 [; ?) g) uor execute SoftICE commands...; ` ~! m: p; s6 J6 M1 i
It is also used to crash SoftICE and to force it to execute any commands
1 r0 t1 _9 \" E' o(HBOOT...) :-((
9 ?7 B \: h; a% q4 t* s" m v' C, w1 Y" T
Here is a quick description:: ] _. R; t: y. Z3 N* D
-AX = 0910h (Display string in SIce windows)
# t* ^6 O6 r9 i' p* q* i-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)5 j4 A4 Y- H0 j4 q7 W
-AX = 0912h (Get breakpoint infos)
! K5 S. q4 X. s' S-AX = 0913h (Set Sice breakpoints)
& `5 w9 _: X/ P$ v4 ^# M: ?-AX = 0914h (Remove SIce breakoints)6 v- F9 H5 w/ A3 e W2 l( E
; h0 z& F, G9 D& M" X! e! N# GEach time you'll meet this trick, you'll see:" u$ R; l7 G: X1 Q+ j4 u k
-SI = 4647h
/ k0 b! M- m4 a! |# L. R-DI = 4A4Dh
' ~; I5 y& u3 R! D) M: u8 n1 P6 PWhich are the 'magic values' used by SoftIce.
1 M0 j( m1 {; e, Y$ BFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.1 o$ M7 |7 J8 O- ]! Z
5 \" m) ~9 N( x$ y( |Here is one example from the file "Haspinst.exe" which is the dongle HASP
7 b( C/ @. x: [: ^. `Envelope utility use to protect DOS applications:
$ {5 H; T4 m7 R- A2 T" W: r& M3 j+ W0 l
$ w! u3 v# K# F# {4C19:0095 MOV AX,0911 ; execute command.$ p- p1 w/ T9 p, D
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% l5 J: h0 K( ] c! O& K
4C19:009A MOV SI,4647 ; 1st magic value.; m# S" O8 M. Q- a/ y2 v
4C19:009D MOV DI,4A4D ; 2nd magic value.
. {$ U# f# B5 S4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* C3 v4 E% B; C6 W" G, d
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- S5 ? C, I* {% F7 s3 H4C19:00A4 INC CX" c7 o8 l! R# ]- y
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: m+ |7 A: s* w/ }5 H4C19:00A8 JB 0095 ; 6 different commands.
f; w/ b. \: B7 q+ I, k' P' P2 U) h4C19:00AA JMP 0002 ; Bad_Guy jmp back.
) L6 F1 O) m1 B; o7 i7 @0 i4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 v" H8 M3 `7 _7 p& |' W- ]+ Z( m4 u6 X5 G M t$ ^4 F
The program will execute 6 different SIce commands located at ds:dx, which5 N+ N7 @; M& _2 I. |# g& P
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.+ I0 _% x: G' T. l' k
& i$ [3 C/ e Y* s, j2 P5 }5 ^9 ]: x
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.+ B0 x- E5 T4 m
___________________________________________________________________________
6 E/ e- B7 V+ i/ u
( z& V( g* M" V2 L8 N; d
) y$ o; a, ^, _0 M5 |Method 03% @8 e h2 m# j, y! P" Z5 J
=========
8 {! @8 t5 S* ^
1 p4 {) i4 W, l o+ x8 ALess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h8 p& L$ B+ f$ N' z j
(API Get entry point)' D4 @3 e3 V0 M. t1 U0 r, S6 b; G; l1 y
! E+ m2 \2 Q! w* g" x2 W6 ?
) c7 v+ w* V: A- b xor di,di" Y) Q/ b; q# r; M
mov es,di `/ [6 @5 m$ }5 p/ a
mov ax, 1684h 8 p; j. O/ ~' n! E4 t3 p$ {' `
mov bx, 0202h ; VxD ID of winice! k5 T7 f: G% Y. `5 L6 N0 l
int 2Fh
( E) W$ t- S9 ^- z% H mov ax, es ; ES:DI -> VxD API entry point* }2 {% O/ j0 i- l* Z: o
add ax, di
% \; d7 i6 z. \, J) ] test ax,ax
* z9 N/ s# M9 W8 |0 K3 F jnz SoftICE_Detected
" ~, a6 V9 c* _3 [, {# k" C- v' ?" p, F- o" `1 H
___________________________________________________________________________5 q2 {3 |1 t6 u7 U- [$ f- T
& [3 H2 f$ A+ a5 X
Method 04
" [3 a+ B; ~: g; O7 \0 W2 a=========
1 `& Z. E4 ]: |! ]2 B7 m6 q) n2 ^$ l
Method identical to the preceding one except that it seeks the ID of SoftICE8 j4 q+ S% q) |$ X1 c
GFX VxD.
5 `4 G u1 I( l$ g, j9 G" u/ ~/ X' w. T0 v
xor di,di y; h( t; G4 m+ Z
mov es,di" Y9 |3 J, [& p4 ^2 W/ R: ~
mov ax, 1684h 3 W7 u9 Y* a8 @; p/ s
mov bx, 7a5Fh ; VxD ID of SIWVID' \) u- K4 S& B% T8 {
int 2fh
4 M0 h9 |8 s. Q( z: L mov ax, es ; ES:DI -> VxD API entry point3 r2 h4 ~* a2 i' M: F8 ]
add ax, di( x3 r, }! d. x& T
test ax,ax) q' r$ _7 X! N
jnz SoftICE_Detected$ c* P3 X# I( T* L! P4 C5 u' [
: g4 z5 H+ d. ?) O* ?- q
__________________________________________________________________________
. Y& G1 k7 M5 Q5 F, @
1 ^* M) ~# V0 y% n2 v# s3 O: o6 t- g$ q+ y7 G& ^( h) i' T. p
Method 05
$ P0 K/ m/ ^: n" y=========' }# S, G* Z- G$ u6 Q$ b( M
2 F C3 X( j/ z8 Q) p7 nMethod seeking the 'magic number' 0F386h returned (in ax) by all system3 ^7 t, c4 p R/ `; k, A
debugger. It calls the int 41h, function 4Fh.
8 C$ `$ \6 X2 u! a0 A' r5 T1 } nThere are several alternatives.
% E8 N# i. [1 [) K4 n* C9 H: O% v- {% m$ K2 h
The following one is the simplest:
$ l% S; B) j% h! p+ @% T# d/ b9 r0 f* `
1 v4 E8 X7 e# H" v# O mov ax,4fh
1 |3 @! v% m% h* v8 t+ _# I int 41h
9 \9 y4 V3 {+ G, ]' ]; w cmp ax, 0F386( w9 A: r1 L; g; O) Y% p
jz SoftICE_detected
- g) ~+ }! Q7 S' L3 f m! J, F2 m6 U% v4 @, v. f; {" b: P/ G
8 G( l+ P3 K% z! p$ @
Next method as well as the following one are 2 examples from Stone's
8 c- ^8 G- j5 P6 S"stn-wid.zip" (www.cracking.net):" u* c4 z: Y( j+ L6 Q3 Z
; c( O9 w! F+ \" a7 ]8 b! F
mov bx, cs2 ]9 }# _) F5 _) }1 {( ] _
lea dx, int41handler2
8 f* R5 `, C$ c+ F2 E/ ~ xchg dx, es:[41h*4], w# i* N5 H+ ~0 t; O
xchg bx, es:[41h*4+2]
; O) a, m9 J) Z mov ax,4fh
: x b8 u f! J2 E7 z int 41h
& W' g5 f# z, s$ e xchg dx, es:[41h*4]
$ L" c$ Z8 a c& W' i8 C- v, v: v xchg bx, es:[41h*4+2]
4 ^5 N$ [& r4 t& s# y cmp ax, 0f386h- S' p" t! T L2 {8 a8 J1 N" r6 R, U
jz SoftICE_detected& c( f8 Y' u5 G* V' m
% Z7 o. n2 w) q+ Z: fint41handler2 PROC
! C0 X# m" I, z& }( ^ iret
- D, p2 }" S' v+ `/ ^5 d% kint41handler2 ENDP
8 R) `0 u6 y' Y* i$ t, H2 T
+ t6 T. y9 r; |) [8 ]9 O; b: H2 O$ E8 V/ B) m& o
_________________________________________________________________________0 h# F5 g5 r: n, \) X1 _
9 j& S1 n& @. b
( p5 _) r% F( e) h$ c7 k% h, bMethod 06
- h) h. O* o! c: }=========
. Q: s$ y9 X8 F; ?6 c8 ?( a$ k" B: L" H& x: H4 E9 t$ j
# q5 W' c+ r: G8 ?" ?1 l8 [
2nd method similar to the preceding one but more difficult to detect:% [0 o0 V6 j- l7 e# W e% R. v
& p" W/ S; R, _8 _% v0 G/ W
8 e* L* Z( |: J6 [# mint41handler PROC* v$ h/ ]5 ]7 u( e; d
mov cl,al; y+ Y( V. [/ V; w) O6 V6 ^, K
iret2 Z( y7 W# d+ b: p6 U
int41handler ENDP
3 z0 B$ J' L# A# Y5 u. l4 C6 M e6 u- R1 ~ \' |
6 _( t' K" w' R# J% S
xor ax,ax
. w% ^% w- D$ B" H0 e mov es,ax
; ~* g6 c; f. |) U mov bx, cs
9 {) U6 A! \# J6 H+ b# r- ^: l lea dx, int41handler4 B' S3 R+ p4 i7 i2 y- c! |
xchg dx, es:[41h*4]0 j" n) d C( x5 O. r! q
xchg bx, es:[41h*4+2]! b$ a( K( k! h% _6 W
in al, 40h2 m0 m0 Y4 ?+ I; A3 V- U8 a8 P
xor cx,cx1 f9 q/ {* T" k- U
int 41h4 |9 B7 F( u% b+ N' u% ~. s" W
xchg dx, es:[41h*4]7 }: w' q$ |$ {5 D# r9 n2 O/ k1 Y# i
xchg bx, es:[41h*4+2]
' c/ T" J6 C6 x. B+ V cmp cl,al
! ~7 A# P5 I/ i, |- y jnz SoftICE_detected) M- O5 H( D3 ?' [$ n# m4 Z% }
# O5 Z* Q3 y; T3 G5 I
_________________________________________________________________________
- [$ R! o; P% O+ T9 x. F
" E$ H# o# y( u+ j6 {# ~) ]- n" jMethod 079 r0 v5 g2 x2 @- J7 B+ H- H
=========
' X. p- x2 f: V" u" L6 b5 G
3 r) k" m1 W9 |; [Method of detection of the WinICE handler in the int68h (V86)
* X8 M1 B4 z& r; ?9 G! a- |9 \6 k9 @, i6 V! l& h
mov ah,43h# I! `! D! [ X
int 68h
( x- e0 B" V- v7 X$ t0 A cmp ax,0F386h2 f9 a6 r& I+ E2 \& F
jz SoftICE_Detected
5 R5 }/ V7 u; Z; J5 O: h
7 K. c. `1 f% i5 r4 E! l8 y( R* Q) O: T- `0 [
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 G2 n3 u5 ?. C F3 s* U2 b9 e
app like this:' I1 `( U4 a- e3 O
' q& I& Z+ l6 C" P BPX exec_int if ax==687 s3 k* K1 b/ v/ j3 C
(function called is located at byte ptr [ebp+1Dh] and client eip is n4 ]" j8 `2 Y S5 R
located at [ebp+48h] for 32Bit apps)
) L J- m; A9 }: N__________________________________________________________________________
7 @5 L: o( q% ]! p2 ^& H* D% n9 b5 J- J! k, b
9 q) H9 \; F1 N1 O2 s. k) ?
Method 08# A5 T b$ R" x6 D7 l0 H: S
=========
% {8 c" C0 g2 W+ J5 s. x0 D" k+ ~/ [, H) y7 E. b" z5 Q4 L; J( b
It is not a method of detection of SoftICE but a possibility to crash the3 S* ?4 n" o( k" ~; s( Q0 ~, X+ Z
system by intercepting int 01h and int 03h and redirecting them to another7 c+ C: g: A# d/ [ z( s
routine.* r# Q. v8 ~, u
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
, F0 o2 Z7 K9 h' ato the new routine to execute (hangs computer...)% o* }- A6 ~+ k! I
) j3 y* ~$ k! _7 V mov ah, 25h5 d @5 k0 T+ U
mov al, Int_Number (01h or 03h)/ |8 e& U& @9 a4 X/ ]: ]8 s
mov dx, offset New_Int_Routine
# Y* i) F9 T! b5 n2 x int 21h
" F2 z. A$ J" U* o- M
: b% c; l1 s+ Y% K+ R9 M__________________________________________________________________________
! ?8 m* u3 ?6 C# S# K$ ?0 b0 y( i3 Q! X; I2 r. Q
Method 09, Y4 w& u- q- w. Y# Z# h' r
=========! |! q2 N8 p7 u' x( O) |/ B
+ n' _" E/ M7 e
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ h& Q7 P) ^' D( G+ Zperformed in ring0 (VxD or a ring3 app using the VxdCall).
+ j6 x% I, |+ A& ^9 A5 YThe Get_DDB service is used to determine whether or not a VxD is installed3 b2 N' u0 D& F+ b# W
for the specified device and returns a Device Description Block (in ecx) for
; f) g9 {) U0 h) q( L/ Dthat device if it is installed.
: L0 u7 ]# r9 S4 C+ P
. f1 `0 g$ v1 i2 Z- X$ @" x mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 r' h; [/ t, n% ]- A mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: y& g* T% {' ]- A1 I; e4 F VMMCall Get_DDB3 }# i$ j r, D/ H1 @" [# L$ I7 t5 a
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
/ E `# x0 g1 v. E, e6 R# A# I
& R+ ~ ?5 j* G) B- n: ?# A& PNote as well that you can easily detect this method with SoftICE:
2 `/ P Y' g! O& E bpx Get_DDB if ax==0202 || ax==7a5fh* K& M% a- q7 Y- C
2 H3 P9 q8 T! j) i6 T" ___________________________________________________________________________
[' N/ a5 ?8 V( _- Y$ e2 d$ T: ^0 q0 t: I" g$ M; C( D( g
Method 10- R7 Q, o" U! W ]. F( I
=========
3 }! G' n# E. ~+ `4 V* D; P! J" F1 O5 M, |6 i, @* o7 N
=>Disable or clear breakpoints before using this feature. DO NOT trace with
) l+ ]& Q% v- _5 o9 n# G; a3 H SoftICE while the option is enable!!# L% t! N( o! G: H
3 {" ~' e, c4 j2 B4 ~& {, p, eThis trick is very efficient:
/ r% B- C S7 l$ [by checking the Debug Registers, you can detect if SoftICE is loaded
7 k1 T' T7 g& l/ K! f3 t0 [(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, S8 z" B4 D7 Q$ d2 n4 Y& nthere are some memory breakpoints set (dr0 to dr3) simply by reading their! q! z; i. J3 W
value (in ring0 only). Values can be manipulated and or changed as well ^$ O: @+ c% M8 N
(clearing BPMs for instance) I8 ]; ~4 w9 T% d8 C% ^1 X
, Y0 Q% q; b5 I' A S1 {! }$ \
__________________________________________________________________________% [9 r( k/ ?0 K2 \: k6 S$ p
' j0 b9 r) W/ D6 [, I7 V& R
Method 11
7 f" n% b1 B$ s3 j7 B# F% r=========
v! D! L! v1 ^# g
3 V& B" ?5 S: W9 iThis method is most known as 'MeltICE' because it has been freely distributed
- c) N1 M# k. ~' h1 ^via www.winfiles.com. However it was first used by NuMega people to allow! a; C: z! z& I: Y
Symbol Loader to check if SoftICE was active or not (the code is located$ y! ^9 A/ r4 C3 m. r" P
inside nmtrans.dll).( }) w. D- {- j" B6 T
. j0 b& b3 W! E8 T9 E; _
The way it works is very simple:
Z# c m, x) M9 S5 M1 xIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for* |3 d6 s6 `6 p- ]" G5 R
WinNT) with the CreateFileA API.' Z# B# ~; [7 o/ `. \
! X2 u# r. n' _+ q
Here is a sample (checking for 'SICE'):8 p6 e+ n A( W- \# L
" }; R; ]2 N! w0 NBOOL IsSoftIce95Loaded()
7 G: g5 b9 l3 ]/ M/ B{
, N9 [" ?4 F% K, E" _' e$ n HANDLE hFile; O9 y5 h% ~6 K
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% P0 \8 q. i2 S0 N# `
FILE_SHARE_READ | FILE_SHARE_WRITE,+ C2 v+ ]# k" [. H) N
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; ?, h$ S/ g8 |5 @
if( hFile != INVALID_HANDLE_VALUE )
. L6 l7 Y. t3 {0 g* m {( ~- y4 U- W5 C5 ?, w; X! N
CloseHandle(hFile);8 r! J/ A4 c0 K- o: u$ T
return TRUE;
, n8 h2 ~$ @$ C0 C# B }2 ^0 G5 r. _" b3 Z& O
return FALSE;
4 a" i3 A, o. n: {3 t}
8 c/ a G9 X: q* p- h- P1 }( v/ Q$ L" w# K
Although this trick calls the CreateFileA function, don't even expect to be
5 Y/ ]+ @% [# L& `) n* ?able to intercept it by installing a IFS hook: it will not work, no way!
9 l7 C0 ~4 Q3 s5 J; C* [) WIn fact, after the call to CreateFileA it will get through VWIN32 0x001F/ L* f" E3 ?. j
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 a5 s! B0 ^; y2 jand then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ n2 O# q, f6 ~! G% zfield.
) b" @, Z9 H, X! C4 L; p! K1 W/ `In fact, its purpose is not to load/unload VxDs but only to send a , l; w! t; T& g, T: F1 U8 _) ~
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 P- h! Q1 c* m, ^+ @to the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 a0 q2 o2 m, J8 c1 r2 jto load/unload a non-dynamically loadable driver such as SoftICE ;-).
2 O! l5 V$ z' F- i( |- RIf the VxD is loaded, it will always clear eax and the Carry flag to allow. p3 J8 I- }# G2 v. P
its handle to be opened and then, will be detected.; D6 w6 X) L# i6 P4 M! _- V
You can check that simply by hooking Winice.exe control proc entry point$ n- U2 X9 ?1 n
while running MeltICE.
' w# R" o5 n$ x( r8 U$ v& e' \ U2 a4 l4 E1 S
- \, M. P# {- n 00401067: push 00402025 ; \\.\SICE
6 x* {% [9 t1 {; G& y 0040106C: call CreateFileA" _/ Z3 @+ R/ w# R- g7 u, _
00401071: cmp eax,-001
( s- l1 x. u" `0 h! S 00401074: je 00401091
5 ?+ h5 a2 D# r3 G& W, [
( E' [" d' @' x
9 M2 ?& C" _! z, N r* n6 o RThere could be hundreds of BPX you could use to detect this trick.. X7 \ |, U. v6 P6 j, v1 `! |
-The most classical one is:* M2 Z5 l- C( @, y& W9 _
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 ?8 C" y" }6 H1 ?/ I7 ] *(esp->4+4)=='NTIC'
. [. G: B' A; ?+ F( J* v' _% v8 _8 y) b: c; n( e3 j
-The most exotic ones (could be very slooooow :-(
' ]4 n. A; U, T. x1 w3 @ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
8 W" D* @$ J' e+ q ;will break 3 times :-(
( o; f: K7 r: O+ U, g
, I; O( O: ]2 X5 C* A-or (a bit) faster:
$ X* W. o5 r# k$ ^) }- w BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
. b8 l/ p3 k9 i4 _2 T+ |2 C# M; R/ l5 M+ i% j1 W" z3 d
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' * T/ d- |* o' z1 f) u/ R
;will break 3 times :-(
* j( f7 Q; [8 F* b$ W' n( m* T7 v0 N4 \; C1 U" r: B# h( E$ N
-Much faster:
2 ~( Y6 X: V) |5 E' | BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
7 R) E8 L' U1 ~2 J1 E. J1 I! o; w- J4 A" i1 p; i7 }( ^, u
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen* }9 f& E j/ Z" b# F7 W
function to do the same job:4 p+ @' F" p; B6 t- a% C; ^) C
( S0 U. `- J# \6 O
push 00 ; OF_READ" a6 T+ a* A9 F& E8 h) U# ^
mov eax,[00656634] ; '\\.\SICE',0
$ m. [4 q. I. Z; l% P8 Q6 A push eax' C D1 X. {! k/ B7 H1 E
call KERNEL32!_lopen7 z$ ^ \8 t1 b( f+ w5 |6 F5 E( c
inc eax/ `) r F, m! C1 ]/ y
jnz 00650589 ; detected
- Q3 G; s% V- n! i push 00 ; OF_READ
" z3 S u- W" Y. F+ _! e mov eax,[00656638] ; '\\.\SICE'
& `! n3 o* X2 m* ^8 ]; v w) C( o: W push eax s7 `3 }0 v, t4 f0 F8 W
call KERNEL32!_lopen
; x6 _3 k! a- O3 q c" t- _! S: \ inc eax( r: M F; Q/ Q d
jz 006505ae ; not detected
7 s' Y, q& u* W/ S3 s# q4 r8 F" o) X! d ~3 c
* j7 n& H# ^" h- J* `; a__________________________________________________________________________/ m; g$ p1 w+ d1 o1 v6 S
. p6 x2 I4 P5 Z! {5 \: PMethod 12: u& [) N8 k4 d; y, `5 c; U
=========$ k5 i, c- c! s
$ U/ ]6 F: \- k( i; p/ a) rThis trick is similar to int41h/4fh Debugger installation check (code 05 B! o: ^6 I/ m* S7 F2 ]0 r
& 06) but very limited because it's only available for Win95/98 (not NT). c$ g3 Q4 V9 n' m- R% P" ~5 K
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ U$ r) m7 i1 C( U
1 k+ `$ P' m3 @+ P, T( l) x
push 0000004fh ; function 4fh
7 h, ^& a$ r( h/ v/ a4 p push 002a002ah ; high word specifies which VxD (VWIN32)$ D4 j2 C. k3 K0 ]- f
; low word specifies which service+ ~3 H) S: {! W/ k0 B
(VWIN32_Int41Dispatch)
7 A, v- t* j4 b. T9 c5 _% P& b7 X) r. D, _ call Kernel32!ORD_001 ; VxdCall
- q1 n0 V3 \8 z5 t cmp ax, 0f386h ; magic number returned by system debuggers! G7 r7 Z! b: | _0 o
jz SoftICE_detected) ` u( X" a/ P. Y( R Y, V
% ~- p3 X1 C% D4 a
Here again, several ways to detect it:
. a9 X, H0 d$ `# u7 X( G
! B6 O% q# G6 l BPINT 41 if ax==4f
% a1 @ p4 w9 \; i# P9 X. q( p7 T8 }' G- P9 _
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 {" N9 D! b# t0 v: K1 h- n9 S/ g) G5 K, M7 L0 {- S, p2 g
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# P2 i$ y2 S8 w4 F% c' j. o
4 G/ Y9 X, ~, g# {. V# J! r$ \! s8 J BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! q3 m; h$ T- ~2 j, j* N
- d) j4 a6 D, ^! b3 D1 Z__________________________________________________________________________' W* A+ O! x# X+ T) C D ^: ^, g2 }
2 j/ K5 a7 g/ D+ |5 lMethod 137 F7 F9 _9 v P/ b" @
=========- e# T1 a7 j j; R1 h! L
# F# x" A; c' D" o N* y
Not a real method of detection, but a good way to know if SoftICE is) L1 X. c) ]8 a# c$ U3 E
installed on a computer and to locate its installation directory.5 c2 O5 h. g4 ]1 u
It is used by few softs which access the following registry keys (usually #2) :
* @$ @" a' e* c% v4 T* o
3 P3 F$ R, c* R1 p8 C& r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* a6 A' T9 W& Q0 L' {# }\Uninstall\SoftICE
0 l+ U; D0 d# i' a% E-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
& J% B" _3 @- x8 k-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# A! K# H/ Q: r) z7 q3 N5 E) c
\App Paths\Loader32.Exe
5 ?3 [1 t2 v6 i" O" i- C6 P" u3 Z
3 Y! @! w e/ O: p1 }8 f, m0 c
Note that some nasty apps could then erase all files from SoftICE directory6 L( D% l2 y$ P0 }8 w
(I faced that once :-(4 C. A! Z: b& Q9 r5 V* ]
% r( y# y7 H4 f; ~% T( E
Useful breakpoint to detect it:
6 r$ m6 D; d! u- d/ c! G2 N# U+ m# m+ Q0 i p0 @/ l0 v
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 ]4 Y1 t& \) w g8 Z+ o
- q/ L8 Q6 o( `; n* I: n) x__________________________________________________________________________
0 K' A9 r1 a* R* M& p5 ~0 g! f' k3 L$ A8 s. i2 w
9 y( k9 m( ?7 X" h7 ~Method 14 . Z2 s0 e3 d3 |& U. B' D3 N
=========
6 F. ^2 H# V6 j: e* ~: I9 k( t& Q6 {1 l2 C6 i5 N. T( B: R0 I
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose+ G- l' r- Z$ {/ E# O4 F
is to determines whether a debugger is running on your system (ring0 only).1 e2 X, E6 W# y5 m" O" k
6 r8 B% i7 ~6 T' `8 f VMMCall Test_Debug_Installed0 ?& A" T+ _8 J
je not_installed+ O( W# z a1 v0 K$ n* g
; g& P: ~" J" I+ lThis service just checks a flag.
' b* A* X: K7 Y6 P% ^0 }6 F- a0 H</PRE></TD></TR></TBODY></TABLE> |