<TABLE width=500>/ Y- f2 |) F6 ], J& B% n0 q
<TBODY>
% t6 R$ W' s/ w$ h3 M- @! ?3 n6 e<TR>
: z9 o! k5 c! k* j1 T0 q; M! l<TD><PRE>Method 01
8 T) i% f V/ g% z=========4 B9 u [- c3 M% @) H' I. Y$ R$ W. u* n
$ }8 w$ q( L! D( \! R8 ^+ yThis method of detection of SoftICE (as well as the following one) is! N1 W+ w* @" k8 w5 `/ Q' P- }
used by the majority of packers/encryptors found on Internet.
/ k& i" a/ d7 HIt seeks the signature of BoundsChecker in SoftICE
$ }- a: x6 a9 I f
- |1 B, v V: y" z mov ebp, 04243484Bh ; 'BCHK'- a m+ |% _/ ?- a2 S* f$ X+ j
mov ax, 04h" u) D \+ J+ p6 q- V( D9 ?- y
int 3
6 q* y, y5 M3 U# `! x1 ^ cmp al,44 {; i. h9 X u" g
jnz SoftICE_Detected
2 r8 ^0 v3 D4 H8 m6 ]& {. w4 `- E1 v* z$ `3 _
___________________________________________________________________________
$ G' N. ^% p* c4 _0 F9 p' ^4 S% C. f% G4 ?
Method 02( l1 z1 O5 [, d" I2 E
=========
0 t) Z; K9 Y9 [& R0 U/ ~7 c: S
& M! q% j; [0 N; w$ oStill a method very much used (perhaps the most frequent one). It is used0 f9 F% C4 l) m* V" E
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,, e% B4 v& k) J
or execute SoftICE commands...' u) Z5 y& P! r7 c7 K- d" G
It is also used to crash SoftICE and to force it to execute any commands# [, C. {, L) ]7 ^, ^* l
(HBOOT...) :-(( ( q# y% D! J2 y) Z, i- N r
' l$ f/ `9 f7 l6 Q, h/ C
Here is a quick description:
}& d& ^* s1 g+ Q' X) h3 f-AX = 0910h (Display string in SIce windows)
) R% ]% L% A ]. W$ R& i+ N-AX = 0911h (Execute SIce commands -command is displayed is ds:dx). a& l" N5 U9 l5 z* E3 f
-AX = 0912h (Get breakpoint infos)
0 s$ B. S& M# t2 w) o* s) v5 p7 x5 T-AX = 0913h (Set Sice breakpoints)
7 b- _# }4 q6 h- b) [-AX = 0914h (Remove SIce breakoints)) g( u5 F) C' e* c; E8 D0 d, i
* m, W5 @' S* L; k6 R$ C+ [Each time you'll meet this trick, you'll see:0 w+ `) @* \" B) G
-SI = 4647h
9 G/ c1 Q# l, ~! c, Y% }3 i( Z-DI = 4A4Dh3 ?2 e7 M" j, s+ Z
Which are the 'magic values' used by SoftIce.4 s: n2 b( W9 p6 P$ l
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' l2 s# W. T' `/ W: r1 l; D/ v
# \: B# {2 k Q- r6 C$ M. \
Here is one example from the file "Haspinst.exe" which is the dongle HASP
6 J) ~# {( \2 K: y2 ~3 R) ZEnvelope utility use to protect DOS applications:2 W+ w w, u$ U% O& Y0 p
; e; r% ~" C ^1 F. G8 I) X$ b
1 ~7 C' e( E+ C. A9 ?6 r" g6 Y+ w
4C19:0095 MOV AX,0911 ; execute command.
3 l) l" ~& e) t4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 ?2 u3 h, x% s. i( Q% \$ h. F. j* ~) V4C19:009A MOV SI,4647 ; 1st magic value.# M+ N; h3 v* A7 q2 x" v% F7 W
4C19:009D MOV DI,4A4D ; 2nd magic value.
5 ^5 v1 C* ~% K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)9 K2 D+ q8 _) }" O
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& [+ o* ?5 X% x4 X" v. o/ C4C19:00A4 INC CX
( |+ C' G. m8 t/ J4C19:00A5 CMP CX,06 ; Repeat 6 times to execute) e& I: j( x: U! U0 F' n. R/ Z1 x
4C19:00A8 JB 0095 ; 6 different commands.
( l2 U7 c6 p6 E: @, g# _1 k U: W4C19:00AA JMP 0002 ; Bad_Guy jmp back.
7 ~$ U2 N! T' L4 O* C4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
' j7 o! O# e5 ^- F
: z6 F/ B9 r% PThe program will execute 6 different SIce commands located at ds:dx, which
! w" [& x. q# h6 e: Sare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* Z5 S) j, t, | G4 N
* T- T1 @/ P% l7 G( o5 N; U, \
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: e6 e" R& W2 `% V9 e2 c( \( Y& J
___________________________________________________________________________
* {& d) @- D ?: b+ ~1 C0 _* C0 v# Y1 v3 Q0 m2 x" _" ~
+ } i6 }6 L- V' y, V. V Q3 u2 Z
Method 03* ~2 G/ `; i! y; I. x
=========1 p8 ~$ q% d& O6 y/ {
* p6 B! T$ b4 T" C R/ cLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
" `" _) P% t/ O' c7 l$ R(API Get entry point)! o% {# A2 J' E- `, \
; y5 B# a M* R# {
' k% n# z+ j4 A/ a+ } xor di,di; ^+ f, s- H/ |: f7 U3 P
mov es,di% @# S: C1 R- c/ H$ }( s
mov ax, 1684h
- W0 C9 ?" Y" T+ ~' A# H1 G; K mov bx, 0202h ; VxD ID of winice8 ]6 Q0 @1 I( q& ]; C3 P
int 2Fh
! R9 w: B- a8 }1 w mov ax, es ; ES:DI -> VxD API entry point
; V5 H$ {, _6 C+ l+ H add ax, di
! u/ z [' p9 f4 G9 v test ax,ax+ T4 \7 c4 C8 B5 Q$ s- N
jnz SoftICE_Detected
0 E R1 k: g) b9 |
" e/ K5 e: N: E, Y___________________________________________________________________________
! }( ]4 A5 i( S. M# B) }
1 W+ d6 D. g" E3 a- AMethod 04. s4 q! u# Z X. W
=========
, s+ l3 }9 Q" @& t2 x, k) ]# \3 @
9 t: K u6 U9 H8 A7 [ U7 JMethod identical to the preceding one except that it seeks the ID of SoftICE+ Y) S8 o1 |$ P
GFX VxD.0 t2 Z% n( f- O& D* U r3 n8 V
2 n2 c, Z0 v! h! d
xor di,di
: U1 m1 d8 s; p+ j5 z4 C. r mov es,di( N% x9 m" @/ [& s8 C# h% }5 o" B7 I
mov ax, 1684h
4 l6 _. O3 [7 L1 v2 K0 Q* k mov bx, 7a5Fh ; VxD ID of SIWVID/ n0 o" j$ X, G6 p$ k
int 2fh
( T q1 M8 \9 a% ~ p U- Y mov ax, es ; ES:DI -> VxD API entry point! |. f+ c/ i9 f1 y+ w
add ax, di& O3 [- N1 Y8 N! E2 t
test ax,ax8 C+ ~% d/ ]: z$ z" v9 b
jnz SoftICE_Detected! F4 [; B2 n3 s j2 X E
% l- G! G4 e# f( H5 ~9 u
__________________________________________________________________________/ h, A. r- }! M1 |
' T: A: e7 c5 h0 g8 }2 D I5 t0 B7 A Y) H5 I( u% t$ U0 N& X
Method 05
8 @* d3 d! c+ C( A" D3 n2 \& v=========
; ^8 }2 o+ _: l, w- d9 R/ O
* r) g7 m% s: s! D( P: [ \Method seeking the 'magic number' 0F386h returned (in ax) by all system
4 f) n, R* ]8 Y2 N" E- {debugger. It calls the int 41h, function 4Fh.
! d# |4 x& c& Y$ ] h m$ pThere are several alternatives.
0 b; Q: [" p6 X2 q2 \) N( P& L$ C$ l! S6 Y c6 h8 U
The following one is the simplest:
$ b- \, H* @5 L8 L% S( X5 x2 K. h& Y5 f6 V: ~! D9 c; }- d
mov ax,4fh% a; O$ u$ W( c
int 41h
" W( ?$ t" [( y" b. M) w cmp ax, 0F386& i& B+ T: e0 I- Y3 [- l8 F
jz SoftICE_detected
& o$ n- [( X8 g& e) B1 I
* k) R' u, p$ A+ [: z( Y+ N$ n3 \2 q- S& `3 {0 x% m( o9 S
Next method as well as the following one are 2 examples from Stone's , y4 g0 A' V( q. X% f+ M
"stn-wid.zip" (www.cracking.net):$ y) B& U' {2 o- ?0 g- ^
& W3 o9 L" ?/ \& r mov bx, cs
# c9 `/ Z8 b2 l, I+ R lea dx, int41handler2
9 z; a2 v: K; a* | xchg dx, es:[41h*4]
9 Y0 M' w2 K( C+ N: T- D xchg bx, es:[41h*4+2]
& b* Q- J6 B1 A( ]. J) u mov ax,4fh1 \; p2 U, ~4 C: N0 Y
int 41h J# H5 A8 i9 g
xchg dx, es:[41h*4]. M$ N8 a1 J+ a/ j
xchg bx, es:[41h*4+2]
7 s1 z9 a9 q0 \: B6 U8 y cmp ax, 0f386h: b3 O9 m9 T8 Z: k/ ~
jz SoftICE_detected+ F! Q7 a5 s$ E# `# @9 T
4 I/ x4 v- y) Y, A- rint41handler2 PROC! l3 m9 n2 E4 x. Y, x0 O C+ a+ H
iret
3 \1 P" P$ ?8 X; U7 e- c9 Fint41handler2 ENDP/ s+ {) ?, x4 V, t0 j5 N; _
g4 N8 Q; X$ v. K2 L+ e8 M
; [+ ?% [" w) M8 e8 w* R! a$ I
_________________________________________________________________________
/ R( d, i; c0 }$ A# A! C
& E+ E* v9 _, h! J2 [2 p6 D# J/ M) P6 \) b1 f$ @, i( G
Method 06
1 J) D( M3 A0 p$ l/ K( r$ v* _5 p( J=========
. P: f) ~; p& c, ]# X% z" L3 y6 r4 N" l( E. u' R3 r4 R
8 \$ R$ ?& Z1 X8 L* o2nd method similar to the preceding one but more difficult to detect: O" e7 V9 I; I/ a7 K
! q+ i1 |: G, @2 |0 ?
" U% ]0 J* ]* |1 S$ Bint41handler PROC( m- {/ r4 g/ X w
mov cl,al
F0 {* S4 F5 N3 b' L/ I0 A iret$ h: s, q! p! p h
int41handler ENDP
7 b3 S4 q) p4 _' w# B9 `$ Q% j, l, K8 C% z( G- k- q/ X! e
* R3 R" x8 @6 j4 |, O9 B. n
xor ax,ax9 }0 l @" I' Y
mov es,ax6 K, a/ @- W$ t( B! c/ d
mov bx, cs
+ ^ c: [ w8 i: v& }' T2 ^5 M lea dx, int41handler0 K5 M% Y3 D8 n
xchg dx, es:[41h*4]
8 K. w" @# O" ~, u% F3 D xchg bx, es:[41h*4+2]% @& Q3 n6 e$ |! ]
in al, 40h. e# Y. {% I; {5 Z* x% I9 q7 }' O
xor cx,cx
& v& |+ ^+ U# C int 41h
; W9 @ h' m4 V& b2 E8 J* ^ xchg dx, es:[41h*4]
* t6 G, g8 ]2 i5 H6 u, k xchg bx, es:[41h*4+2]( a9 q: W2 b' S3 H/ x
cmp cl,al9 u' \5 m5 S K" e; `( L
jnz SoftICE_detected' G# R" ^: N4 P! c3 Q
" ~9 c" z5 l7 ?9 t9 D1 P2 U* L n
_________________________________________________________________________
2 r' Z: X8 N1 r) y
5 I$ ^& O) b. ~3 v& R/ pMethod 079 C' E+ J3 h( D- n2 @
=========
2 e2 ?- ]- ]) k! ~6 ^4 Q7 b: |, E8 s1 P3 m" n% N
Method of detection of the WinICE handler in the int68h (V86). [5 G# T. Q+ X) E# _
0 ~: V2 H5 A$ U% \- }4 ~1 M
mov ah,43h
( `' j1 N" B! t* J' [6 r int 68h
" ]" l( h1 R R! ?) N cmp ax,0F386h
5 U: V% ? S% v: r# O: [& n jz SoftICE_Detected
& A. H8 [/ {& @1 K: k4 n+ X; q' Z9 m! P6 P, M2 H
4 D9 `8 e& B( h5 a9 {) T
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# o2 P3 \/ p# W2 r, w
app like this:' e& ^9 h" U' ~
7 r3 E" \3 S: [ BPX exec_int if ax==688 g8 {; U+ q$ l2 K! J
(function called is located at byte ptr [ebp+1Dh] and client eip is% y0 ]# q, t# ^! l; Y) c% ?
located at [ebp+48h] for 32Bit apps)5 |4 {' h c+ e) B; m
__________________________________________________________________________5 c1 ]: |* b7 m7 d
/ B* X' Z W( a6 i- A5 Z
0 Z- L U, u3 d0 u+ N$ }Method 08
/ s( R" c; Y% o* L5 \1 _: ]# b) P& k=========
$ c& _* d1 A& d& {0 B+ w) l" P m* v1 ~: H6 q. M' S) S4 A
It is not a method of detection of SoftICE but a possibility to crash the
2 W) w- O% S: _% ^/ csystem by intercepting int 01h and int 03h and redirecting them to another
/ F3 Y4 r/ M2 {7 w* n0 troutine.; A/ J. ]6 `2 a' _, p/ z' z8 H
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. |: e$ o; ^8 G$ a" rto the new routine to execute (hangs computer...), w1 b/ C+ n' K3 k; m3 I& E
! M/ O( Z9 s+ h5 [& ^ mov ah, 25h
( l2 C ?% D/ S- L2 ~ F mov al, Int_Number (01h or 03h)
2 h& S: g; n& c mov dx, offset New_Int_Routine
' m9 B; b- u2 w. x4 R8 o int 21h' K. [9 V0 c ~" O9 e' c) D
: C$ W8 W% U d' C* b; h$ s7 D
__________________________________________________________________________1 b" x E! M+ ]7 b4 I
5 n) P9 x+ ]" @
Method 09
% H0 w- c& Q4 _( E9 h=========
$ n; `; \$ O! B! O' @ E5 `7 S! q2 Y$ H+ B: [+ j. |" {
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
7 X4 I# i* U8 p6 Tperformed in ring0 (VxD or a ring3 app using the VxdCall).
3 b9 S, p% s L+ fThe Get_DDB service is used to determine whether or not a VxD is installed
; t/ M% H( L9 X5 s& Ofor the specified device and returns a Device Description Block (in ecx) for% k2 P" |7 F$ {$ s# j; j, I" [
that device if it is installed.0 \" B5 E' ^0 v) O
9 d3 O6 \& Y1 O
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! s0 E3 z! Y$ D' [
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
' n( h% C4 ?% q/ j VMMCall Get_DDB( h- `, B& B& {) E F+ |* ?
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed b: D5 e; G" o; h9 j* z6 C( h, A
& |. z; M. ^& ~7 h+ ~5 k
Note as well that you can easily detect this method with SoftICE:' _+ X9 H5 F/ Y( K5 m
bpx Get_DDB if ax==0202 || ax==7a5fh
^' q7 Z5 @( W+ m
$ [: E4 ]" w8 w! ?$ D__________________________________________________________________________ D0 `* X2 s5 Z. e) V# v: Y' x) r
6 Q: T- z# i7 O& U/ C6 T7 ?6 W4 DMethod 10
0 W, N! i }( j, H- R1 i& |=========
! a- X+ A( p, z* q- O
8 J4 q- R# S8 z- ~6 S=>Disable or clear breakpoints before using this feature. DO NOT trace with' [. w# @3 ^7 v9 S4 D
SoftICE while the option is enable!!* m3 w) @8 y. X5 d( N' `4 q; }" u
3 u' A4 v0 s* ]+ ^* C! _5 T) Z
This trick is very efficient:
' f; J0 {6 k% O) b% h" Cby checking the Debug Registers, you can detect if SoftICE is loaded
3 H ^# m0 A% K# V3 _(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 p: }1 ~" L5 B d# P9 o7 b9 xthere are some memory breakpoints set (dr0 to dr3) simply by reading their
; _# s, m$ [, U! O |( h/ w7 cvalue (in ring0 only). Values can be manipulated and or changed as well
8 o( x' ^7 o8 [+ f, {& b3 g: D(clearing BPMs for instance)+ A8 r: s. Q' |, O3 |
+ k2 ]: o Z8 j1 n K- ]1 Y& d
__________________________________________________________________________
! U8 M$ A3 R4 Q g, ~
% ?/ M( |! ~( }4 m( eMethod 11! P* t0 y& {5 A, ]+ J/ t$ t5 E
=========" S) ?. X: y$ O: ]8 P( x4 e
/ t2 J3 z) ^) c. G4 vThis method is most known as 'MeltICE' because it has been freely distributed
8 E7 }" q7 ^8 M' |! avia www.winfiles.com. However it was first used by NuMega people to allow$ }& w6 a) n2 e) L& P d
Symbol Loader to check if SoftICE was active or not (the code is located
$ R J8 L# v3 O2 j* k; binside nmtrans.dll).( S) W- E# f$ e
( O; V) \# W- n- z2 CThe way it works is very simple:/ j' a% t9 {+ j, B$ s6 V I
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 f; q: r3 [0 t3 C: y& {( y6 n8 fWinNT) with the CreateFileA API.& S0 m7 u" s! o Q7 V
7 S* N; U s4 }Here is a sample (checking for 'SICE'):& u, @! O2 x$ i+ O1 ^/ C% c
0 ^! [9 l# _0 _5 T' L P
BOOL IsSoftIce95Loaded()4 R K S- Y1 T
{
0 o' L* Z! u3 @ HANDLE hFile;
1 [" d, d, M, S* G+ r' o' } hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% k- y5 s2 h2 U6 X# H+ w
FILE_SHARE_READ | FILE_SHARE_WRITE,) S! W3 F' n0 a- p7 G
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 @$ r1 `+ r) C4 V- K) e& j; F$ p5 N if( hFile != INVALID_HANDLE_VALUE )
( d" P8 b6 Z9 q) a% B- w {
' h/ Q0 V( p/ l& U) Q l CloseHandle(hFile);) Q Q5 y: `3 f/ Y& b' g- z; t/ d
return TRUE; A. ?6 y7 m/ x8 w7 j0 r9 g" z
}3 v' [4 |7 N& F) n
return FALSE;
, I0 O0 x, c4 C* L" [ j5 P}
: _/ Q- q0 ~0 z. r
7 S5 P9 g t r+ I: r( E$ g% DAlthough this trick calls the CreateFileA function, don't even expect to be
h$ b9 _/ {4 Eable to intercept it by installing a IFS hook: it will not work, no way!
9 b, W( r: w+ C, KIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
& c; G, H8 N6 I3 D. _# _service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function): N0 ^& {, I9 G* ~
and then browse the DDB list until it find the VxD and its DDB_Control_Proc6 @7 C2 @; }( T# G% _ p' M
field.
# {, I2 @; E; l& v8 L5 LIn fact, its purpose is not to load/unload VxDs but only to send a 6 U2 x8 r1 p( W! S
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 B; h1 A: T( {5 Sto the VxD Control_Dispatch proc (how the hell a shareware soft could try9 y7 g, s7 @' }
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 P' k2 N; x9 o# kIf the VxD is loaded, it will always clear eax and the Carry flag to allow4 M5 | M: y- |, E
its handle to be opened and then, will be detected.5 ?4 b0 m1 t8 Z7 J( _0 \2 k
You can check that simply by hooking Winice.exe control proc entry point
l* {. d, @4 e7 G# ]+ Z% Q! p+ lwhile running MeltICE.7 \% D! V9 W9 i" m6 M5 s2 u- |
9 }# O- v& K) `) O0 t8 j
" G q5 ]7 n7 D( S# ~
00401067: push 00402025 ; \\.\SICE" p x$ S5 L. L7 w% Q
0040106C: call CreateFileA" t& b! l3 S5 \ |
00401071: cmp eax,-001( J3 Q [- p2 Q( w) e
00401074: je 00401091
# Z* j/ r+ ^9 V9 d/ x! o# F7 l7 U6 D5 Z! A: r& [
+ Y( e v( P8 B3 b
There could be hundreds of BPX you could use to detect this trick.
' M) a5 ?! C8 i2 ^3 O/ ]-The most classical one is:1 g2 _1 a2 q/ b# _* Z3 ]
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! Y4 m2 D% A6 ~" n *(esp->4+4)=='NTIC'2 p" G! A. Q2 c# I' g
$ n& k8 _) E0 k" ~0 ]( j
-The most exotic ones (could be very slooooow :-(( }- G l" d* s: } h, f# [' C
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : ?/ [! i: z- u- s. `
;will break 3 times :-(. I1 X! v+ Z9 Y b' x& v
) P, p; P0 }6 F
-or (a bit) faster: 0 f& ~3 p1 G; ]/ U) _4 g% B, i% \. }
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
# q; m0 G' z x! \, `. c& A8 S' F9 F0 _1 t2 U) t- Q
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
8 O0 T7 L- k" I: B1 b. l# Y ;will break 3 times :-(( H( I5 |) w3 P* E* o& U
5 M0 f# u& v8 m) O) i: S% {
-Much faster:& }0 o6 G$ u( r; h& T, C! ~. w
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ }3 B1 l' X% m) R- }) W7 s4 B
* x7 u+ o _6 b" i+ T, d( i, x; NNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
" W9 ~" {; v; d, g" r2 tfunction to do the same job:/ v% F: }* K. G% n; L& S7 M
8 s% @; I- a9 X" E% |- c push 00 ; OF_READ; n; e4 [ k% E" h3 b( z
mov eax,[00656634] ; '\\.\SICE',0
% ^$ A; |+ ]$ e2 ?9 r push eax) v5 y( Y$ |' d& e" T
call KERNEL32!_lopen
+ D/ a- j( ?2 l6 T9 B( D5 l/ [ inc eax
. \5 C) y b9 N4 s% P jnz 00650589 ; detected
9 G; \- a/ v# B4 s% e1 t; L! v& X push 00 ; OF_READ5 i" R( z; Y; Y+ q$ [, C# Y
mov eax,[00656638] ; '\\.\SICE'- _1 b* ?$ b! T" c
push eax
. b+ w8 g/ Q, @+ B call KERNEL32!_lopen
( P* w! s+ P) n8 K4 Q8 A7 c( m inc eax% x8 P8 v: z9 D1 J6 R% |! H% t
jz 006505ae ; not detected
5 Z$ {; B {* ^
3 N3 }2 C$ H u; ]/ Q- P) p
, B+ w' A- @ N: X# S__________________________________________________________________________, N% a/ q0 T0 H3 D
4 P- h- b+ ?6 D5 D/ H Q2 A( tMethod 12
6 y6 K1 n; P$ o) \) l2 S2 o=========+ G) l# c0 i9 q! f1 d1 P
% s1 r% {3 `# ?# NThis trick is similar to int41h/4fh Debugger installation check (code 05: I Y- S1 q& l
& 06) but very limited because it's only available for Win95/98 (not NT), T% x; l3 M0 I* H8 e- Z- i
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* [( J' ~( F* G7 m
' e, B4 x3 ^) A2 }, K push 0000004fh ; function 4fh
) w) I% z* P' v/ w" e push 002a002ah ; high word specifies which VxD (VWIN32)
- O3 o6 O4 _/ E. v ; low word specifies which service* M% _* i+ X% j! ^
(VWIN32_Int41Dispatch)1 l- Q% ~! Z' c6 Y1 w% H6 I
call Kernel32!ORD_001 ; VxdCall
7 ?4 {$ n8 {" R5 L cmp ax, 0f386h ; magic number returned by system debuggers9 T) P) u& I& \1 I2 ^7 A
jz SoftICE_detected
$ ~! k' \! A/ N9 u B4 i+ w1 j: w' H; {; {- Q
Here again, several ways to detect it:
" ~7 e W6 |# Q# Z1 G3 z) A/ y7 }: E0 R- v3 b& s4 t8 X
BPINT 41 if ax==4f
1 ?! F6 r0 \6 n) Q0 z
' g" U3 X9 C- S; ] BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
' u! v* I3 B7 @( m, F9 ~- f/ e& n" h/ A; h% @
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A4 d, d: G8 E1 V
! Z# x0 V6 O I: y" V- B BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ W! v; t' r V+ e1 o: o1 S4 I; s e: H7 i( G9 P2 s+ ]7 v! d
__________________________________________________________________________
' V* {% \* ^7 b% n
1 ]8 v1 H. S* S5 sMethod 136 Y/ l+ l7 Y$ E" m
=========
4 y3 d$ ^9 W# ~6 g1 y |
+ C5 r. U6 D3 C) [1 @; TNot a real method of detection, but a good way to know if SoftICE is" J+ m q4 B7 S6 g# n/ P
installed on a computer and to locate its installation directory.
. c2 W% V5 n# N8 tIt is used by few softs which access the following registry keys (usually #2) :; }% M5 S6 s/ b6 X' f, N* m4 l7 m
9 v% d0 E% w& I2 z/ Y7 G$ c
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: A4 L4 L& Q+ B/ d( {) k; O\Uninstall\SoftICE$ Z( V6 p3 p; N6 V) U: o
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* N: m% q3 C. V1 X: L) Q% [$ g6 [-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# m2 s# O2 {& V# K\App Paths\Loader32.Exe
9 E# K' @9 r% N+ |8 \7 {: J8 ?8 n+ ~. b
% A/ W( O; q- {Note that some nasty apps could then erase all files from SoftICE directory
! n8 w* b& s7 a) s1 ?1 h/ S(I faced that once :-(
4 R p/ d, M+ K$ Z. z5 ~- f- f1 v$ C/ }% B+ f4 C( L
Useful breakpoint to detect it:1 Z2 t1 U9 @3 q8 o
& P K& w. R# u+ u8 G% e0 @6 [
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
8 ~# f5 B( U; g$ M# {( l( z* D5 D& g/ D- p1 ^+ h2 g; j& V
__________________________________________________________________________
. ]- S0 C3 a: u
9 h$ Y5 w, \& h$ s7 O
. R j9 @3 E% U; s9 C$ NMethod 14
0 \1 P' h9 ^0 G2 \3 F=========
- _- I. a% y, \( D, ^# j, K$ K0 O( T
8 U- q t( q6 C2 M7 R! c' w* o; PA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* G; w! |- ^$ u/ Y0 a6 v) x+ Nis to determines whether a debugger is running on your system (ring0 only).4 M+ n0 R. Z. n5 g" i
9 h2 t9 A( D! s VMMCall Test_Debug_Installed, D/ v; R% |3 M
je not_installed( i4 }8 w% A* |- P1 |2 V
" x' ]4 T4 m5 s. y5 K9 f% uThis service just checks a flag.- @! X: c: I2 }7 Y
</PRE></TD></TR></TBODY></TABLE> |