<TABLE width=500>0 d: g* U' D( H7 U$ k+ V
<TBODY>
7 K! g( r! k. m% x) q<TR>
# B6 m! ^. H+ ]<TD><PRE>Method 01
- l% Z; ]" T1 l' L* M# M% S$ I=========5 @& }3 N& l/ H% P8 P
5 ~$ F9 n! K6 h# A; zThis method of detection of SoftICE (as well as the following one) is
1 n8 C( C1 ^+ b* y4 W$ `used by the majority of packers/encryptors found on Internet.: i) d" G7 Z1 t( q
It seeks the signature of BoundsChecker in SoftICE% Y/ e' p: n8 O3 G m
$ X& W* m _; \+ ~ c/ Z t! r
mov ebp, 04243484Bh ; 'BCHK'
# g" I( a' F+ { mov ax, 04h# b, L% o8 @9 ]0 M F% Y/ v3 G4 C( j4 W
int 3
4 C9 G0 A2 p" c x; R. o9 k. F cmp al,4 |% G# G- I, a- a5 t/ A
jnz SoftICE_Detected: g4 M: O$ F& t1 M" y H/ T5 Q
* g3 r; m8 W+ b" m: D( v___________________________________________________________________________. Y2 z+ Q/ b0 D5 w# K' [
2 r; V" _" @; J6 |5 H! Z, A" VMethod 02" c$ G5 _( H" A& \" Y% R% x$ p
=========. L$ L4 w a; J3 I/ r- i
9 n6 x- i7 A3 `* \
Still a method very much used (perhaps the most frequent one). It is used* b4 v+ P. K) i7 n% _. M$ g t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! x5 U+ @/ a$ V) P; Jor execute SoftICE commands...4 K3 z% L% m) r% g
It is also used to crash SoftICE and to force it to execute any commands4 [8 Q& c+ Y1 p V$ q; H2 K% e& D
(HBOOT...) :-((
9 _" ?* ?' H0 z6 _4 y2 {1 a) y: y; b9 F; d8 E7 x' M- z
Here is a quick description:- L K9 m+ S2 j* Q
-AX = 0910h (Display string in SIce windows)- r; @. ?) q4 \. E- A& t3 p
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 m5 ~. r, w$ g& T' `, A% v-AX = 0912h (Get breakpoint infos)6 K6 g9 c4 f( r+ V
-AX = 0913h (Set Sice breakpoints)
3 O: ]$ @5 n! F6 P' z p A-AX = 0914h (Remove SIce breakoints)
* B. Y7 Z: C) B1 \) X1 f$ ]5 z+ j0 D0 v) @4 {, Q8 u2 w, P
Each time you'll meet this trick, you'll see:4 ?3 C, M, c2 g3 H/ V- N% S
-SI = 4647h
, B3 U7 z$ p4 K$ L3 K0 ?3 h-DI = 4A4Dh# c, `+ v# Z; b: o# A
Which are the 'magic values' used by SoftIce.
& t, s& @: n1 }& @( e @9 ?For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
. ^$ w; A" u) c$ [0 e
2 U2 ^8 _5 ^6 L' t4 J. _Here is one example from the file "Haspinst.exe" which is the dongle HASP# ^' ~! A! e2 A, @0 K7 ^
Envelope utility use to protect DOS applications:
! [5 G% d K$ ?9 S8 X2 H& n6 R" ~4 d5 a8 s; ~" w* Q
* Y0 D$ ~( `, ?6 m# b# C
4C19:0095 MOV AX,0911 ; execute command.
g0 a, U: t/ }$ @4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) S$ T7 @( }! U( {' [) l& [9 b$ a& R
4C19:009A MOV SI,4647 ; 1st magic value.
) x1 E6 V: ?9 e" Y$ y4C19:009D MOV DI,4A4D ; 2nd magic value.! S8 h: e+ Y3 Z) ~3 j0 s9 g. ?
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
' [. }2 b2 c1 [9 ?4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& K, o5 T/ d% {$ c7 Z; F4C19:00A4 INC CX
4 k. U# ?2 I5 L; s4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
6 V' v# A) h* M: Y d# o$ g) y4C19:00A8 JB 0095 ; 6 different commands.7 c# Y- L9 h* k) s7 O
4C19:00AA JMP 0002 ; Bad_Guy jmp back./ j- ]3 _. V! {3 V* G
4C19:00AD MOV BX,SP ; Good_Guy go ahead :) |4 l* P3 ?2 }* Z
. Y% x$ D8 q7 D8 ?$ c3 PThe program will execute 6 different SIce commands located at ds:dx, which
, X7 C0 v/ d6 k7 d# E: B7 F! sare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 q7 V: p' M8 C6 l( t
$ E0 x+ S) H) K4 e. `7 O3 i* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
8 g5 \ |+ S$ K9 O. y4 ^; u___________________________________________________________________________
1 |: E# V& A& F: s2 t( @2 o3 Y/ K7 o2 l( ^* d( ]
& D R5 ?! ^) T7 Z0 |Method 03
& Y5 O+ M2 D8 `1 H=========
: ^; q4 x- A5 p$ ]+ W2 p& U/ n- O. [5 [" s1 U+ u' I
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: n0 r1 L* v5 a A(API Get entry point) a# j3 j4 _) a k4 w k9 z
+ h7 n, p$ e. b4 G# u( z& x
+ C% \4 {. z+ j0 s' I3 N. R8 g) _
xor di,di; { Z9 \0 ~ j7 ]) k2 `5 r! u
mov es,di' o9 o( P! b' W
mov ax, 1684h
. }+ M9 t/ }5 x8 _% E mov bx, 0202h ; VxD ID of winice
- ~" c/ n% P: `6 [! T int 2Fh/ q- P0 K5 k5 Y9 Q
mov ax, es ; ES:DI -> VxD API entry point2 o0 M3 k: G% U' p) [
add ax, di) ?; R2 B! D1 B k
test ax,ax
; ~8 T( I! |0 `, ?4 X( Q jnz SoftICE_Detected' a0 A$ z3 s: S; B Y
Y! J( G+ Q+ v8 ~8 Z' M___________________________________________________________________________4 ~& [+ l7 |5 ^
+ O2 B, V, A# bMethod 04
! |6 v& C; Y) l1 ^, H7 F8 z=========
; n7 ^; j; Q# O; O# z/ _/ P3 H9 Y9 Z% g- t$ M, S* e9 D
Method identical to the preceding one except that it seeks the ID of SoftICE1 ]. M8 A4 L' K$ C
GFX VxD./ d7 N1 @- k7 F/ v% X5 q; H
! F" Z# q# r/ C" Q xor di,di$ Q2 B$ z7 q4 I0 k9 r g8 t
mov es,di
0 J( }! C6 Y1 `. ?! U mov ax, 1684h # P* B: A( m" `& ^ _; C) {
mov bx, 7a5Fh ; VxD ID of SIWVID1 y0 R7 V( F9 S5 G. ^
int 2fh
" e4 g, N% d0 i! a7 F6 A mov ax, es ; ES:DI -> VxD API entry point1 F3 i. C/ O1 ~4 H4 C- E5 a& [
add ax, di7 A8 i0 E5 G' L q
test ax,ax
9 H3 G# m l- c! r& { jnz SoftICE_Detected! Y/ W$ L" W7 A8 O
- Q# G! H8 v0 a* f7 i. X
__________________________________________________________________________# c6 j$ {6 t: G: y0 O
6 n2 P( ?$ H0 C' r" D+ n6 P
2 J2 p/ t, z* h" S( PMethod 05) i0 a" f3 {) G6 o0 k8 o' J
=========
2 u& F, `0 J+ P1 x$ b6 v
% a5 {' ]1 o' C- SMethod seeking the 'magic number' 0F386h returned (in ax) by all system4 c/ N# h3 d# e6 g9 H9 V6 J) Q
debugger. It calls the int 41h, function 4Fh." r9 |! K8 _) Q
There are several alternatives.
( h8 D* b2 S! Z' x* Q9 D5 q1 _5 \' k4 w, o) f
The following one is the simplest:
; X' {2 V. I; d; O9 o
! w! N0 C# F- Q& w mov ax,4fh
% F3 o9 n9 B: B c! t9 H int 41h
3 t4 O$ }# [" l: T6 ] cmp ax, 0F386
7 |8 v5 ~* A0 L i" k jz SoftICE_detected( t9 I3 n, P% Q, Z/ c
& M+ j1 P: z. R# k2 _4 W
4 p; M6 g$ v _1 f, j
Next method as well as the following one are 2 examples from Stone's # U! U$ {1 k0 q& G4 Y# ?
"stn-wid.zip" (www.cracking.net):
' p% \8 t8 j) ?) m+ j$ r+ A' p* m0 J. J9 U, `: F
mov bx, cs, A C) Y6 `- h: I
lea dx, int41handler2; E& f5 T: y7 @# w$ U
xchg dx, es:[41h*4]' R8 `$ d% p6 Z9 @5 g
xchg bx, es:[41h*4+2]
1 \- [; V8 V9 H! d/ b mov ax,4fh% X* R+ \+ _: a4 |! j
int 41h
9 y0 z# O) P3 l xchg dx, es:[41h*4]' @- _# ]5 g) K+ C( X, P/ H" F H
xchg bx, es:[41h*4+2]6 o8 A" B q$ t2 T1 b' Z
cmp ax, 0f386h
% R9 c: |. y; A; ] jz SoftICE_detected, S3 A+ B1 {/ V% f$ n/ T
+ u# t) h6 F6 k: lint41handler2 PROC0 W0 M' \5 c# \6 A
iret
7 q) _& S; l% e8 y/ nint41handler2 ENDP
* |* ~$ F. n2 }+ y& g$ V' |4 a/ N9 H7 a* R# i8 ]9 E6 h- G' t
4 R4 Z1 ~$ x# X+ @; \, p, J( __________________________________________________________________________+ c s- \- }: j1 L
. S- k3 x6 |' [, U0 }0 [$ d& W- ^" F- \5 X9 D% j7 r" g
Method 06
) R4 _5 S1 t: K* O$ t( u2 E6 V) ]=========8 e$ q, `9 [: s- h d
/ Z( w) b6 `. _2 I( A" M/ M0 f
1 V6 x( S# ?! t7 Q0 q/ k1 [) x2nd method similar to the preceding one but more difficult to detect:
0 z6 u, L' M4 N/ Z
$ l, s9 n/ q+ j' a- v/ t+ B& r2 [! t* K& _0 l
int41handler PROC# K+ ~& |! C7 {# g+ ^/ ~
mov cl,al
. n7 x2 P# ?- u \ iret: _ M$ o+ }" z: I% u x& }
int41handler ENDP5 ?: I9 L: Z: T ?/ |% y$ T4 g* P, G
$ V2 U7 a5 @* \+ v& R7 P
; M& {1 I- |5 z! A
xor ax,ax
- b$ Y6 B+ r P7 F" {- B mov es,ax. A: r1 H/ v4 q# Q2 ~- y2 Z# C1 p: e
mov bx, cs
& G, A# y' C8 Z lea dx, int41handler% v5 O8 A6 Z; ?9 x, {
xchg dx, es:[41h*4]
) o9 M* L: _, _& P xchg bx, es:[41h*4+2]: \( o+ C3 l3 }5 D8 U
in al, 40h4 r! o- {+ b9 c, q1 k
xor cx,cx3 B; r/ R e- P) O% f0 K- q+ p
int 41h4 w2 k, a2 u( j. @. W2 q& a- R* F
xchg dx, es:[41h*4] L5 [; A ?9 S
xchg bx, es:[41h*4+2]; `1 a) A& L6 c) t
cmp cl,al
* W: I; |2 J; g3 A jnz SoftICE_detected& n5 e) ~. O9 K* O- Q2 x! K
7 ]0 A+ `: U) F" a: U_________________________________________________________________________
/ Q9 ]1 | F+ D, |! z5 [8 [8 ~) s3 F, Q
Method 07& a- s: u# |) m8 U& E+ }5 Z
=========
1 M3 u6 {# m) C9 S& m. D4 g3 H4 s$ v, R/ ]8 y( b
Method of detection of the WinICE handler in the int68h (V86)
3 z& l4 e0 K7 r6 }% J8 ?; R9 u6 e3 {- s4 j5 F/ ~/ Q
mov ah,43h
: g2 |& L! q1 X' k" z int 68h6 O& k9 r" r9 K8 W5 d S
cmp ax,0F386h2 u( D2 p& t3 k2 \5 a
jz SoftICE_Detected
: u3 B) k2 [7 g3 e( F+ L" [; i/ n- p: x! V
2 a" Q1 v: \0 i% u
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% V! g& z* z" A6 H. E
app like this:" ^( n, ^7 n6 T
! q2 l p6 n( T4 ?. o7 B: V BPX exec_int if ax==68
/ Y2 K, s+ I. I( `* {( G- ^ (function called is located at byte ptr [ebp+1Dh] and client eip is
% M2 Q) M; P" s) l0 J8 j located at [ebp+48h] for 32Bit apps)
% m, `6 a \: F, n__________________________________________________________________________! [- }- d$ m# H0 w; i
: q1 q5 }7 o- s c4 X
2 M+ q# M8 O3 V0 o; p5 X$ \4 OMethod 08
* B6 `1 s; G5 G1 M- d; r=========8 d% t5 l# X7 ~' @) R
6 a9 r$ ] }1 g
It is not a method of detection of SoftICE but a possibility to crash the
I+ B2 B8 ^, n! @1 F9 Ssystem by intercepting int 01h and int 03h and redirecting them to another
- s: a% r: K6 |) Oroutine.
, q1 i* D5 p& A" e: O' XIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points% @, b% O" r9 i
to the new routine to execute (hangs computer...)6 Z5 {2 K' D5 f1 k
" V: b0 y6 a6 R$ J* l' A3 G( g mov ah, 25h
$ N6 p9 o( b1 A0 L mov al, Int_Number (01h or 03h); r' }+ Y) g' a( s
mov dx, offset New_Int_Routine
! D# S# X! [" I% j p* X int 21h5 E2 X0 p7 e9 p. S( Z; M
" l1 P9 w7 T8 ?8 C* S1 n1 }* [+ i
__________________________________________________________________________
6 `; f, q c C" e
6 c2 m5 k. n) DMethod 09
( N% N ~# [* _! B6 ]$ J7 i( ^+ v=========/ P. v1 d; G& `9 c% _: K7 E6 y/ R
- {) ^/ `; K6 j) f% ]* c; ^! j6 rThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
m1 A% Y1 R3 N! P0 f, Y- pperformed in ring0 (VxD or a ring3 app using the VxdCall).
3 r$ r: y( x" P& y' ^- }! dThe Get_DDB service is used to determine whether or not a VxD is installed' Q: h6 J4 }0 G2 F! T/ z
for the specified device and returns a Device Description Block (in ecx) for$ m. { h& x) A& P1 l. R
that device if it is installed.$ g4 h& J7 ^2 E& @$ P4 u
8 ?' E2 @& {4 e9 C mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID( m# G/ a( w( D% U8 k
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- d2 g; K" V; X/ y4 ^* U" S
VMMCall Get_DDB: {3 r' z0 E; u1 E( x
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed G# q0 G. j- S$ F
5 L6 i) W7 {7 f- ]. X
Note as well that you can easily detect this method with SoftICE:+ P' q5 m+ j ^* G
bpx Get_DDB if ax==0202 || ax==7a5fh
. K5 S1 ?3 \6 B7 C+ y8 i1 T0 I2 ^7 [. y2 w
__________________________________________________________________________
4 B" F$ W4 n2 y, H. j. ^' S0 ^2 a$ k/ M D1 q
Method 10
: W j8 [; I, H9 T5 z2 Y1 y=========
# A3 [8 U" \ x# O5 y5 j: u& G6 T1 |5 g. l& }+ a! }6 f: a! Y
=>Disable or clear breakpoints before using this feature. DO NOT trace with; v( E' P) D" s! T w+ T9 e0 s/ a
SoftICE while the option is enable!!
# \$ `, Y1 x4 _( r1 m! e) T; O* k6 v g! x1 i2 Z: K6 v4 L1 A$ p
This trick is very efficient:
- S# \% G- n0 o9 [9 M. cby checking the Debug Registers, you can detect if SoftICE is loaded
" G6 w$ z% ~2 b; X6 E4 B! G(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ s/ ?6 f% E5 j( r% uthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ K: ]8 ~& L9 zvalue (in ring0 only). Values can be manipulated and or changed as well
5 A6 x7 C0 P8 B(clearing BPMs for instance). w8 P# G/ s6 [; S1 o
8 \: `. j' g5 I' Z+ C" |__________________________________________________________________________9 [& f$ @4 ~1 O6 ^0 b1 ]& x5 ~
. d0 x2 l$ c5 P$ LMethod 11
, c% c- e7 S* z% ?* O=========0 p6 n1 I9 a- C
" T) A7 _0 A& JThis method is most known as 'MeltICE' because it has been freely distributed+ [& v9 G8 x8 e8 f- {
via www.winfiles.com. However it was first used by NuMega people to allow
; p! ^$ T2 }4 ISymbol Loader to check if SoftICE was active or not (the code is located
! T1 I8 Z3 n$ H# I6 Ninside nmtrans.dll).
4 h! M! w0 v/ }1 i) ]7 y2 b+ w. o
2 a ], s. t; b0 p7 OThe way it works is very simple:
* d* D0 E9 e+ t4 W* E3 A: l7 e: UIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 N' D, s8 Y/ I) N
WinNT) with the CreateFileA API.* _5 g6 C, J' m
2 M0 Y8 k5 X3 @. L" B! A
Here is a sample (checking for 'SICE'):
3 C( B6 ^* C9 ]6 Z1 a
6 h. `8 s5 q* f3 L& C c( A4 TBOOL IsSoftIce95Loaded(). l2 \4 n* X: F6 s
{
7 q' w2 d: t# s- Y: X HANDLE hFile;
6 x5 }4 y2 [& X( Z6 n% d) V* G hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 ^- P+ g. `- F FILE_SHARE_READ | FILE_SHARE_WRITE,5 F# S+ c5 v: g) \% O
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 p- \ [: G3 ?$ Y if( hFile != INVALID_HANDLE_VALUE )
" t0 }, E! H! B' i& C1 X {# ?7 M. q! d5 n8 ]" l/ u. z
CloseHandle(hFile);
7 L, t' K3 l9 E8 b* [ return TRUE;
( l, w3 i1 ]1 N! ^ }* x L* c8 N. v0 n0 Y/ \
return FALSE;& Z9 |- y% `2 P) r2 {! F. D
}" U- a0 u: ?9 `4 s
& F1 d/ `) N2 D( V' H$ |
Although this trick calls the CreateFileA function, don't even expect to be
; _8 |/ z: P1 o6 p1 ^able to intercept it by installing a IFS hook: it will not work, no way!
8 R! p( b! S, b7 RIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
" n0 k; S) ^0 W7 [# A0 }5 J( ~4 mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. B( s4 ~! R4 R7 gand then browse the DDB list until it find the VxD and its DDB_Control_Proc+ [8 l6 x) Y. [5 |9 P# O# I% [
field., j7 f, O' \+ O: m' J
In fact, its purpose is not to load/unload VxDs but only to send a
- o' Y; f3 n8 d- P" }+ hW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& j' N" V6 l9 T& r# O) Z0 t& h
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# k4 d, C8 R" w$ a) bto load/unload a non-dynamically loadable driver such as SoftICE ;-).6 s2 D+ e* x4 C+ `7 J- J
If the VxD is loaded, it will always clear eax and the Carry flag to allow9 k7 ], m1 l" C4 `" A! k" H
its handle to be opened and then, will be detected. p6 r' w, ~* X# B( o/ z# V
You can check that simply by hooking Winice.exe control proc entry point
H1 L4 ~) m* l2 R% h1 Y4 h" E8 Gwhile running MeltICE.
& _# X4 L0 ?3 X6 h2 ]" g5 G+ b1 L' e. M8 g4 X& u+ {9 g
1 R/ P* p; p! R- ^
00401067: push 00402025 ; \\.\SICE
' K& u( t6 w0 Y- A# C( g1 q. w' m0 u 0040106C: call CreateFileA- Y& L& a, G. v2 o
00401071: cmp eax,-001
. z ] B( ^! Z# W, E3 x2 m# } 00401074: je 00401091
0 l4 ~, N7 U% Q- y; ? N+ R
- u2 [7 Y O! T6 W: ]0 q
5 J' | l+ g+ E* qThere could be hundreds of BPX you could use to detect this trick.5 U$ c1 C% e& W* r7 f' `
-The most classical one is:+ Y' o4 [/ A# I, m5 g4 r7 o% w
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* q! m' g6 x- N9 e7 Y3 X% N
*(esp->4+4)=='NTIC'
- x$ w# }+ m$ Z2 `# Y9 H, y4 o( J5 |9 z4 ?, s: f
-The most exotic ones (could be very slooooow :-(
. C- @! Y, k: x* s BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 5 ~! u* b4 d8 u# D0 M$ [5 j% c
;will break 3 times :-(4 w% P4 C- J# x7 }+ }
# k1 _' z6 V! K, g2 Y6 Y# K% g$ Y) `-or (a bit) faster: 1 W$ ?. Y8 R4 I# f+ x
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')) {- U5 U( k$ r; V1 t
) ?, e \' \7 e5 p; w& o8 R, i. D0 Z BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 3 Q8 @* u! e4 w3 s& T3 {7 V
;will break 3 times :-(# ?* ^6 w) ~8 \0 z5 Q) A
4 E, E8 F5 N) ?' L6 V6 E4 i
-Much faster:
4 b; C* i* h* K2 p& i! d* W3 A9 F( e BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
- K2 G1 Y l- I! i* Z0 }0 A; j) ]( v" k$ u( f0 b4 ?
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ k$ d4 Z1 Y' g w6 l7 w tfunction to do the same job:
2 Y( s, u* ]8 X6 z1 X5 I4 ]
/ q1 _: m$ \2 d; m push 00 ; OF_READ8 y. p6 `. N( d1 R
mov eax,[00656634] ; '\\.\SICE',0+ L% N1 S! |% x! T# t
push eax, q+ J/ U6 e7 E
call KERNEL32!_lopen' U5 u0 d9 m% s/ _, U" @
inc eax8 X& v2 h( P! t% _' j, _7 `, Z
jnz 00650589 ; detected
. F' Q8 _! k0 f# c4 q* N' Y push 00 ; OF_READ
E& I/ U. F0 v2 c4 O; ], M mov eax,[00656638] ; '\\.\SICE', |" [4 E. N; b. Z/ Z/ x: q, ^/ D! g7 a
push eax
I& b8 c* f$ g9 \ call KERNEL32!_lopen
, @4 ~2 H0 u4 m9 u inc eax/ N1 x$ |8 h. @
jz 006505ae ; not detected
1 L A0 | \& i) p+ s3 ?4 o( D) {8 A. |; p. v
; n0 o8 r" I" J+ R__________________________________________________________________________7 |2 C+ E6 D" J: m, _7 a: t' |; H- g
+ ]& t- I4 r% ~; M7 vMethod 12
" |' m2 }8 I( Y8 J=========
) N7 _* u3 ]3 e# `7 Z/ U# y5 H
This trick is similar to int41h/4fh Debugger installation check (code 05
& p4 B7 V* h* Y& 06) but very limited because it's only available for Win95/98 (not NT)
6 v2 `% e" {6 t) r# Was it uses the VxDCall backdoor. This detection was found in Bleem Demo.
p0 t; Z+ O& }5 J: e! \9 W; m' ^8 q3 n0 ?/ T; ~, _
push 0000004fh ; function 4fh
2 D' ]0 U. O' m& C- ?. n8 l( z push 002a002ah ; high word specifies which VxD (VWIN32)* ]. y3 L# P2 E2 N) F/ G) v$ B
; low word specifies which service9 U) o. _6 Y# m6 _1 E
(VWIN32_Int41Dispatch)
6 f% \: ^3 B5 R' L2 M call Kernel32!ORD_001 ; VxdCall
/ z A8 v) ]9 t9 D5 G2 L cmp ax, 0f386h ; magic number returned by system debuggers
; w/ H- i+ b( K3 h: D o; x jz SoftICE_detected) ?! E5 R( S3 O) w X
A9 S. P: J' W) L! H8 c5 i% G
Here again, several ways to detect it: ~ z# x1 Z- T, {1 L- o4 |
& f1 v- P* t$ Y2 V9 c/ Q
BPINT 41 if ax==4f
2 m$ c+ H1 E+ u1 W5 A. o3 ^
, g+ U2 N d3 [3 M( Y& X) V BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 X1 i" Z, N: p( m# g& c5 b6 L! g A; O. b+ ?4 C
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A" `- W. Q+ \! ~% q/ {
# B( ]- `% O7 `2 v2 I. q+ i
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- H; K, C% |# `! T# M- p r$ J8 d* y
__________________________________________________________________________) o* k0 p/ I: `; u! H
- ~& F3 W- c- A) W: @/ U9 k
Method 134 y1 A$ Z3 K8 f6 `3 _
=========8 c1 S/ u, `/ d. Z
" T- l; a+ O/ x0 A
Not a real method of detection, but a good way to know if SoftICE is
- U1 g7 p R0 kinstalled on a computer and to locate its installation directory.
/ K3 u) G8 s8 YIt is used by few softs which access the following registry keys (usually #2) :1 S' c; e$ c7 z. x% H. _, C- n
, Y# j4 u+ Q& O) U( ~% Z-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; P* T0 |% v) }. g\Uninstall\SoftICE
1 I; T. j' J" q! _6 _-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
( D7 m6 k3 a8 `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 _6 e( M6 p; ?# g. @ o\App Paths\Loader32.Exe
/ [7 k) e" I9 J3 ^! n
) V0 G" g T6 O$ U3 l) S$ S
8 Y, i& N9 p" k& O/ @4 gNote that some nasty apps could then erase all files from SoftICE directory
0 ~9 j3 W' j' J$ B5 x, `8 }(I faced that once :-(
j3 K F: D: _& S# l8 O, ?$ a
|/ G f1 N2 S- S7 x9 WUseful breakpoint to detect it:
+ E" _5 v0 k: j$ a$ R3 }
+ c7 u) y$ `. F3 ]! ]) h BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'$ d9 A. ~2 u/ B2 _7 Y$ R
5 n5 s( m! U8 `) R8 E+ N" J
__________________________________________________________________________- x; L; r9 @" ^2 e1 ~
E" y: z, @; X" @ N5 N0 M2 h5 t m7 S/ l. d5 M5 K" ]
Method 14
$ j j5 \$ Y. d. r=========7 w, f+ s0 ~" E- l: K9 V! d
( ~$ s& I' Y( oA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: L4 ]0 M3 k: K2 k! `* }+ r
is to determines whether a debugger is running on your system (ring0 only).
) _5 N! r8 x' L$ J7 k8 D& h6 I5 L+ @5 [7 I
VMMCall Test_Debug_Installed6 B/ U% s4 k' p* G( F* Q9 X% R
je not_installed
; o |9 X* e- s7 `/ a5 z: g! H$ P' U& P' c0 _
This service just checks a flag.- \3 |+ u! u) z: R4 [# H
</PRE></TD></TR></TBODY></TABLE> |