<TABLE width=500>- T- ]3 K3 j' K" n# F0 z
<TBODY>
$ N' N4 T8 ~& B6 x/ v9 m2 ^<TR>
+ ^( |: W" b& R9 ^* G) q<TD><PRE>Method 01
9 \9 S7 X: q8 J=========
- m1 F) U1 a* t' Y$ M9 n
" d6 W! ]1 E& [& \/ q1 T. BThis method of detection of SoftICE (as well as the following one) is
1 h) b' k7 R( u1 l9 O; k4 yused by the majority of packers/encryptors found on Internet.
& s& X/ z- y( \. a1 ]. KIt seeks the signature of BoundsChecker in SoftICE
/ P* K( @$ A: V# H7 A) L
8 M3 P% y6 e( Z$ t3 q8 v mov ebp, 04243484Bh ; 'BCHK'8 x" B0 `2 R( |6 {. H" v
mov ax, 04h
5 v4 ~( f: Q$ }: Z" {2 N int 3
1 s/ {% E: }" g4 @9 q cmp al,4/ e9 h7 j) Z G
jnz SoftICE_Detected; Y) N5 P' F8 ?# x3 a- ^" z
: Y( E& n' p( E% f% B- r! |
___________________________________________________________________________
) ?7 |0 t5 M4 O
[6 X# Z9 D" t0 i: C- f* uMethod 02
2 {/ t, ?: \+ S: v: T6 r0 Z% j=========4 R2 T9 S) A( J. s+ w
- v5 a. G) D4 S _# @# QStill a method very much used (perhaps the most frequent one). It is used
% Q' m" o% |4 q% n! j& W% Qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. L, _! w8 p; x3 ^or execute SoftICE commands...
|! ^& f& G6 kIt is also used to crash SoftICE and to force it to execute any commands: j3 T/ \# v* V* A& Q' }& B
(HBOOT...) :-(( * C* y! E* p6 H2 i
# a @) g, A( S2 d1 B% ^: w+ AHere is a quick description:
, b1 F( D5 [/ \' R: X7 \. t-AX = 0910h (Display string in SIce windows)+ f8 g% j. b! }- {: U6 B) \
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 ~. k% m+ b8 W& Q* @# s6 U. g* {! x
-AX = 0912h (Get breakpoint infos)
% |( S0 v$ H F- N: E$ f( \3 O0 F-AX = 0913h (Set Sice breakpoints)
) q% t/ x& d; e/ ~-AX = 0914h (Remove SIce breakoints)3 B, a" t: B& _4 p c
6 k- T) Z* o0 _$ M* e
Each time you'll meet this trick, you'll see:1 Q9 V% k' v# E1 e+ b7 F
-SI = 4647h& k @- o' t$ t, o2 K8 J
-DI = 4A4Dh# _& P) s4 w, x8 K* d
Which are the 'magic values' used by SoftIce.4 c# F4 I p1 b5 |+ J+ a5 O# ^6 e6 U
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' |% z4 ~' u& Q4 l. _3 D2 }( H4 P* O3 Q
Here is one example from the file "Haspinst.exe" which is the dongle HASP
7 U: q9 B( \8 q. KEnvelope utility use to protect DOS applications:/ g# R( k N7 r& W1 g
: `; e) P4 ?$ e0 i! |1 D0 ?3 S
. j( o3 s" _1 _$ j, l8 w
4C19:0095 MOV AX,0911 ; execute command.
6 {: |" _6 Q+ U- X4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
. F9 F& m) y8 a7 B" g4C19:009A MOV SI,4647 ; 1st magic value.; i) h0 {* y4 b9 w
4C19:009D MOV DI,4A4D ; 2nd magic value.
/ [- B; l' W. m6 b4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)4 H9 ~/ B/ Q, X0 V# ^
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
. M( n0 U' K6 o$ M7 j: L2 [+ i. V4C19:00A4 INC CX2 c8 Q* g. g, q* S# ~9 k; K
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute3 f/ t2 b& r# _; F" n' Z' [+ c3 j
4C19:00A8 JB 0095 ; 6 different commands.
' A: g6 D( C+ D& f4C19:00AA JMP 0002 ; Bad_Guy jmp back.# d* m2 B" S% E. _4 N( j* z
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( X" g) t$ A. C5 S/ A
6 i! g/ x, l4 u4 T' O. CThe program will execute 6 different SIce commands located at ds:dx, which( y. y# Q4 ~8 G6 c/ E# N% k9 h
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 O" D1 j3 w2 y- y# ~3 l- s* J6 f
: P* P; ]( U+ K& f0 h
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" @# U$ J$ J- W' H___________________________________________________________________________0 E8 ?: o$ @6 F) I3 ~0 \' i! o
, p7 t* h/ a$ a/ m, P t1 y( U: s! Y w7 @7 v8 r. L& i3 U
Method 034 }- E }8 o2 p" I3 [! D
=========
4 T7 n9 x. a* `# |0 ~9 A* a& y
: ^! l' ^3 I( w/ wLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
$ r6 z, R. c+ Q! a6 s(API Get entry point)
* c# g( n' m/ C( k! F$ g; ^
- J4 h: t& m P3 z! J1 j8 a5 P( D2 R
xor di,di
" l, H$ `; F& L; m7 } mov es,di1 q# c, _& r# N( k |+ U6 C
mov ax, 1684h
3 T( R0 s5 \- J* W8 G2 ~, H mov bx, 0202h ; VxD ID of winice
7 J3 ^+ q$ G F" d! _" R int 2Fh* c) U7 {, p$ ^
mov ax, es ; ES:DI -> VxD API entry point
1 o+ k- }: a% s' } add ax, di. q; U9 _* R7 J- W. q
test ax,ax
* V+ n7 J' x$ g$ V# S4 H" d jnz SoftICE_Detected
* U+ {9 T% m7 r2 J7 Y, k& S# C' P) j* G* H/ e3 a. o1 n5 [& ~- R2 N+ l
___________________________________________________________________________
' J4 ~, _: k' k8 j$ ]
. q6 q9 b$ \' \5 L1 BMethod 04
) _$ i& M3 S" d! s=========
! }+ o; X! C# {& K) [1 M& B4 F/ r& O$ R% i
Method identical to the preceding one except that it seeks the ID of SoftICE; x" F/ Z6 M1 f) _
GFX VxD.2 ]" D9 |6 r, z8 ]
$ U+ |1 C; m! l xor di,di
7 o% O- x2 l" O! V* @, ]2 z mov es,di
; R2 x& `+ r5 U. G f6 u0 \+ F4 |- ~ mov ax, 1684h
, P6 e# R4 V2 o mov bx, 7a5Fh ; VxD ID of SIWVID
8 \$ _1 ]& `# u7 h1 Q2 F% z0 z3 h8 U int 2fh( |4 I* V- F$ F% U( R$ T+ n6 m' {0 R! F
mov ax, es ; ES:DI -> VxD API entry point
4 b" z- Q+ o% q/ | m add ax, di
+ s, E$ P# w7 y d' H test ax,ax
; o9 }- S, p3 b1 u% \3 n# b jnz SoftICE_Detected; {% I! L. M- H' H1 b5 I! i
9 I- ^" A4 m9 `$ m" M
__________________________________________________________________________/ P- n! e! g, k
) D2 b- X3 P* T5 U3 V
/ O7 g5 g8 j; E' ^* kMethod 05
, h& g5 O: }' h5 _=========" P6 t6 @9 s5 j
0 J4 {, M- D! p; JMethod seeking the 'magic number' 0F386h returned (in ax) by all system5 q' H8 p, |7 V! @/ M
debugger. It calls the int 41h, function 4Fh.
+ z! k% s5 n. vThere are several alternatives. : T6 A9 ^/ V9 d/ ~2 W/ q
, O: Q8 J. U: Z6 x
The following one is the simplest:$ S8 [0 D& l- V! _5 E: z
* L* k/ k) c* u4 D; v
mov ax,4fh
# e! ~0 n" @4 V5 j" g: e& K9 @ int 41h/ b, X# M1 v+ z' ^4 F: A5 |
cmp ax, 0F386
8 E$ S! u; } M* x/ n jz SoftICE_detected. D9 v2 C) Z6 U* |/ C. \$ Y! t
/ Y9 E) O5 a& F1 j8 F# x
1 X* @8 a. |& Y* p4 VNext method as well as the following one are 2 examples from Stone's
' A! e2 j9 M/ D- Y"stn-wid.zip" (www.cracking.net):
8 O! P% V6 E5 `9 b; k' m! A
2 w: ^) j X o- [1 Y# Y' _7 l" K mov bx, cs- z! ]# T1 p7 {
lea dx, int41handler2; k# ?$ ^* r8 ^" q8 P/ A1 N1 z
xchg dx, es:[41h*4]. Q- v7 o8 H. \4 t$ n" g) o
xchg bx, es:[41h*4+2]
^* H: o: v- U: @5 C mov ax,4fh
" E$ A2 @) h0 H- X4 ? n int 41h
" f4 h3 E: H- ?3 W* U% ` xchg dx, es:[41h*4]* }; b1 s' q5 K; E
xchg bx, es:[41h*4+2]) |& Z) s3 N y! P9 j: L& e2 f
cmp ax, 0f386h
0 ]5 u R1 Q: @+ S" P' d8 y* q jz SoftICE_detected" Y! O9 C- n3 X+ B- g y- r" z# b8 J
7 P& e" W; @/ g
int41handler2 PROC7 W0 C+ x& Z" U, X$ m
iret
7 t7 x( v: |* Hint41handler2 ENDP
8 G5 r4 ^. c, Q0 r
4 r9 ]3 o. K5 b% s+ Y) _- g+ y/ D' R$ L) o6 @; o
_________________________________________________________________________
( X; w9 d4 M4 _( g) K+ ~. B/ H; d
7 x! m* k9 }. C1 s# B- d$ C9 t: H# I/ a+ A% |- C5 o
Method 06
: t9 s4 N/ t( w=========
6 e3 Y& Y9 `% h0 c5 Z& Q+ X" I. F5 q1 G4 u0 B4 ~: K3 B8 u
3 M0 R e$ j2 T2nd method similar to the preceding one but more difficult to detect:
( n1 k8 I" s% v4 ]% W1 |5 R5 I4 A! \ w- F$ y
. z. R4 b: T; F' P0 q" Nint41handler PROC
" q# `4 ~. p3 I2 N/ ? mov cl,al' ^- M" g& |0 D4 k" {
iret3 K! e- z1 x0 f ~4 z9 v/ @: P8 u
int41handler ENDP
) v9 B5 A2 e/ i {7 t0 Y% ^% [' C# {8 B. \
8 g7 m# a S6 R$ j1 l xor ax,ax0 D9 }; ?6 B5 F: {5 a- E" d- P
mov es,ax
: R* V$ i& l! m. ]2 K% L mov bx, cs
" P. F/ h# E; J8 ~ lea dx, int41handler5 \& o: \* D5 d4 J, a
xchg dx, es:[41h*4]2 q7 l" K% [* {* d2 z
xchg bx, es:[41h*4+2]
' d. E- c* T" w+ q5 |( v+ A! R0 ~9 } in al, 40h8 F; E% Z l0 G+ j6 D
xor cx,cx( u7 h. q& m* H4 h
int 41h1 N; t: ^: Z( C% _- L4 g
xchg dx, es:[41h*4]) e& e7 D4 s) S$ `
xchg bx, es:[41h*4+2]
& G6 O( C1 z" N. j% o+ z cmp cl,al* \& s* F" P. U6 N
jnz SoftICE_detected
8 f: e9 H7 d5 s# j! @5 C9 N
3 H. Q- ~1 ? w& l. l_________________________________________________________________________
! G2 |8 q0 n8 t" z7 h. I" n
+ ]0 r6 t( ]7 ~- l' r6 AMethod 07
: P5 \) c& ]3 A, U=========1 z5 {5 x/ W, D2 J9 w% {& Y& U
! q! i* \ ]# }: b2 I6 YMethod of detection of the WinICE handler in the int68h (V86)
2 @; o* K: E- Z2 m2 y6 c/ w x1 d0 h5 S$ _4 ~ w& g
mov ah,43h
. M. y/ I$ b% j" [. P int 68h+ r1 x& {6 T9 P' @+ c) K
cmp ax,0F386h, {) F( ~- b l; Y8 `
jz SoftICE_Detected9 |9 t8 d' z8 i; q& \
1 s4 g9 V# ^. `6 Y& h
6 G- E/ C3 q" k8 l E
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 t" F N: L5 ` app like this:
+ g6 V" Y5 h J% p2 m: R9 n$ c" [+ X! H |8 x: x" g
BPX exec_int if ax==68$ a# n# J: ^+ L* \1 b
(function called is located at byte ptr [ebp+1Dh] and client eip is
0 e/ l4 p6 J- p+ T located at [ebp+48h] for 32Bit apps)' u, F2 R+ m. Q* i# b
__________________________________________________________________________
1 ^7 x/ D+ g* E3 h; l) h# Z3 g; \$ P
* ?- v$ s/ W8 e) f
Method 085 b! m9 t/ |9 ~# K/ F$ N+ \
=========
a6 A- W; ^+ p
0 N3 N4 O% R/ k6 ]9 U( K! I0 y( Q2 wIt is not a method of detection of SoftICE but a possibility to crash the/ C6 {1 A. E) _9 u+ n- E
system by intercepting int 01h and int 03h and redirecting them to another
7 K: H; I3 B2 Z! _. Oroutine.
( Z+ e9 p" l- `' E! g7 v( AIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
) @$ G$ _# j7 wto the new routine to execute (hangs computer...)2 Q2 f: n9 H1 b, H* V; v
9 ? ]: c, }1 U/ e
mov ah, 25h
6 c4 h% |, b- k7 K mov al, Int_Number (01h or 03h)8 w$ k1 B) [9 K- `7 A4 S0 E& m
mov dx, offset New_Int_Routine9 Q3 `2 u: S* X, T. l. w7 V
int 21h* f1 n% P r7 Z8 Y; Q8 R
: i3 M( Y$ P% ?
__________________________________________________________________________
. ]* s$ V1 \2 Z1 G
: j: y$ f N3 G5 l! aMethod 09+ T# T" F+ ~0 _9 O
=========% f/ h) L1 }& o
' H* E& q* o5 E4 c% j( w# [9 ?: @This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only7 R: K- v) W; ]/ D. _) W
performed in ring0 (VxD or a ring3 app using the VxdCall).% p: C. z& z- X7 Q3 k
The Get_DDB service is used to determine whether or not a VxD is installed
& @# @: E# C2 H$ [; O% J! A" Sfor the specified device and returns a Device Description Block (in ecx) for
- S7 e" m5 g6 u0 Rthat device if it is installed.
. v/ V* M$ T1 O1 T8 S1 H, m1 P! A+ c# T6 d, h3 o/ k
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ H+ K* S* c) |, R
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( V$ C, S4 f( D9 G8 ?% H
VMMCall Get_DDB
9 K, Z6 e( V1 O, k4 M/ i mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ ^( x7 K" r7 u
1 @7 K' W/ |1 ?
Note as well that you can easily detect this method with SoftICE:7 G0 u7 ~3 _3 ~$ |; o$ S
bpx Get_DDB if ax==0202 || ax==7a5fh
4 r: j0 @: Z7 w) o w, h9 e/ X1 b$ i2 {3 r; C- s+ f
__________________________________________________________________________
3 |( n& ?5 z- y( O0 q& M7 Y; `, ~5 O% V' O0 ^* t" g1 P5 ~$ R
Method 10
; H P) k2 N( w=========; ~' c. F. n5 v% F' R
% e1 U* b, \8 K* b=>Disable or clear breakpoints before using this feature. DO NOT trace with# T: Y$ O7 Z2 M0 C0 E ?- ]+ g
SoftICE while the option is enable!!6 [; M7 F" F R+ ?1 V X0 `( _, K. K
% h7 P$ N3 z; r) H: Y" LThis trick is very efficient:4 h# [! y& O# N; h) f
by checking the Debug Registers, you can detect if SoftICE is loaded; N0 Y: `( e* [7 e% M; ?3 T! \! a
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* |9 K/ g6 V5 {* {* Qthere are some memory breakpoints set (dr0 to dr3) simply by reading their9 m; Z1 w# o# |! ]7 F- S
value (in ring0 only). Values can be manipulated and or changed as well
7 D) d" R3 _8 v( N(clearing BPMs for instance)
, X5 G& Z1 L+ {7 s1 k1 \7 g) }% t; I, s# ` M/ J) b' b, t1 R
__________________________________________________________________________
5 b1 L9 X# `% C" Q
' w2 _2 |- E' F* S: d \$ n" ]Method 11 S, \5 \5 x$ F2 k7 Z% ~ n
=========- S$ ?/ I- `) c* W4 K
) B5 P- l. Z+ s' F* @This method is most known as 'MeltICE' because it has been freely distributed# k; M+ _& ?" m: }
via www.winfiles.com. However it was first used by NuMega people to allow
; g0 q7 e' }( X$ {! |! B2 G aSymbol Loader to check if SoftICE was active or not (the code is located' |: x" \- v: ~, r1 R
inside nmtrans.dll).
+ I5 U( h1 {) _3 }( r: p9 C, b% u1 q" h0 I/ p
The way it works is very simple:! x( \/ B ]1 A- O9 h0 S" e; ~9 \
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; c' ^. m/ P: D) \2 h- G) TWinNT) with the CreateFileA API.& Q! a2 z1 T2 o2 |0 Z
' O6 h" c5 r( w) M2 O6 Q
Here is a sample (checking for 'SICE'):
: _" l" T" B, m1 q# ^( j4 q7 j9 a) J' @, Q' Y8 L/ \
BOOL IsSoftIce95Loaded()& {+ V: Q# `6 A+ q$ u" s6 H& \0 C
{3 p- X/ v; P) N3 z5 P R
HANDLE hFile;
) ?# R8 | h) X( d' d8 A hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) h: C5 }, J# z1 Q# z FILE_SHARE_READ | FILE_SHARE_WRITE,
) d& k/ [, \4 h* q! w NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ ^" K7 z: A* f* | if( hFile != INVALID_HANDLE_VALUE )
0 c# ^% T0 l% I& |" g {! V0 J0 ^3 d( p2 W* p
CloseHandle(hFile);: E& [$ K4 d4 O/ [! i( Y2 ]% M
return TRUE;
, W# g' \; ~* S! }% c# R }
6 |1 D+ ]; ^ e" K; Q; f return FALSE;
2 W# D4 i- t- ?/ c0 n6 n6 C* h}6 X4 D; w7 O. r
$ p# N( b3 R4 j( K/ d- R
Although this trick calls the CreateFileA function, don't even expect to be) q4 h0 G3 K4 j7 E/ Z4 c9 `1 h
able to intercept it by installing a IFS hook: it will not work, no way!! \7 p% G/ P2 i8 g# `
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; T( z |& h2 ~6 ? Y+ K5 A6 f" l
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
_, c( S1 H- U) zand then browse the DDB list until it find the VxD and its DDB_Control_Proc( e2 c; Y" e/ p! |2 o; j2 Y8 h# J3 L
field.
0 h4 }( E5 X L9 g! S! @In fact, its purpose is not to load/unload VxDs but only to send a " d" b4 i2 b+ w7 K" Z% M
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ L% V9 j. \, K3 G+ `4 H! \8 e8 {+ x
to the VxD Control_Dispatch proc (how the hell a shareware soft could try6 o8 y# V, Y/ B/ H/ g; O8 X* E
to load/unload a non-dynamically loadable driver such as SoftICE ;-).: z, w/ k; d$ ~# n2 f3 Z! A
If the VxD is loaded, it will always clear eax and the Carry flag to allow H8 f: h+ ^; Z
its handle to be opened and then, will be detected./ [) i7 W' x5 Y
You can check that simply by hooking Winice.exe control proc entry point& p7 a. o% r! l7 ?" y
while running MeltICE.& F6 k; ~% h" f6 F) n. I0 V) t
9 u$ w+ A" ^4 k1 J6 z
$ n4 }7 `3 g" E+ Y 00401067: push 00402025 ; \\.\SICE/ w+ ?( c2 Q1 u! @
0040106C: call CreateFileA5 x) f6 d) r, \+ y I1 d k
00401071: cmp eax,-001
* R6 h2 M: D3 s2 f 00401074: je 00401091
. F7 p0 a4 W7 M5 p0 O: o, i! q+ s4 Y# @: h+ o' w m" d: I& P
+ {9 o+ k2 c: j) m Y. [( ]7 u
There could be hundreds of BPX you could use to detect this trick.
5 b/ _/ P1 k( @" l; X! K5 e& F" v3 ]4 H-The most classical one is:
k9 L% G$ Q. T. q/ q% D6 U# a9 j BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 |$ C6 D# _8 b$ ?! I A
*(esp->4+4)=='NTIC'$ w. D H2 x2 O7 j3 ^6 A( w! i+ r
! {5 V Q8 s; w1 l) l' w-The most exotic ones (could be very slooooow :-( }! a7 q* q" ?
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
# D3 n/ z" D' P ;will break 3 times :-(+ Q4 ^9 X) p# k% s% R8 S& E# w6 R
( D$ s: i5 s5 Q; ~-or (a bit) faster:
4 M0 q t2 f- I! `# J8 e T BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* ]) t7 ^& A: o9 b* g8 a8 s. d k. W2 ~8 ?+ Z7 v3 D
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 D/ E* s; [9 Y
;will break 3 times :-(" p; o1 E5 a5 _, F M& p$ b
- f) y( }2 F* W, O5 P6 d5 J1 v
-Much faster:
) L/ t2 [( T& v+ A BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# |& y* u8 h: ^& B- H
1 A" [* v' I% |3 e7 ^% H/ {+ V4 H1 DNote also that some programs (like AZPR3.00) use de old 16-bit _lopen. i `" {# C2 I# [5 o. B
function to do the same job:
6 K; T! i; D1 k) l) Y3 j7 I9 c) D% M
push 00 ; OF_READ# R7 U3 V$ t' G( v0 Q# c
mov eax,[00656634] ; '\\.\SICE',0
9 i# e- ~9 K& Q2 V% O push eax1 g7 p* K5 C& a1 i* Y$ g( n+ Q; {
call KERNEL32!_lopen
+ W1 b5 Y* w3 ^ inc eax) W" d4 j8 Y4 J- f5 ]/ G
jnz 00650589 ; detected' L( n8 g. ?. M. u2 H0 ^6 K
push 00 ; OF_READ
; G R, `1 H+ J% H3 ]; S5 U" w Z mov eax,[00656638] ; '\\.\SICE'
3 P7 S! A$ e8 X& P2 {& P* u push eax
. r! `" U. l9 \, I# H4 y& o call KERNEL32!_lopen# ^* q3 W, g" H$ h' |; x! H
inc eax. M' O1 r- t: z7 x
jz 006505ae ; not detected" P8 {" S6 [! d1 m( N" `+ X
+ D1 Z* f; X1 O, m, q7 l9 f: s- c% s6 A3 }! k: q- H4 X7 \( Q
__________________________________________________________________________
2 s. b5 o' R4 S. V" }5 B* a- z% l; x* F: S
Method 12
3 o) Z3 W7 B$ ^ s2 V) r# p=========* c J( F3 \1 G5 E
- G- E1 L4 Y R& N& D" a( e* yThis trick is similar to int41h/4fh Debugger installation check (code 05
9 e: ^" S+ E8 v. f- Q, \+ e9 K& 06) but very limited because it's only available for Win95/98 (not NT)
2 u2 b3 R. Y- [2 L2 S" C+ ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.' ~0 |8 E5 N$ T2 d6 v
1 n' ^; H `9 ^/ } push 0000004fh ; function 4fh) ~% w( Y$ s1 }1 A6 k' P: d6 K2 s
push 002a002ah ; high word specifies which VxD (VWIN32)
: P/ Q2 W$ T% j1 ?4 | ; low word specifies which service
/ y/ R( A4 s: [, }- G (VWIN32_Int41Dispatch)
; N* |; H$ a0 j! M2 v7 n( { Y9 R call Kernel32!ORD_001 ; VxdCall& C e6 V* V1 {# _* w k0 a
cmp ax, 0f386h ; magic number returned by system debuggers. J2 Y5 _: i8 b. \
jz SoftICE_detected3 o6 B, n+ W( H* p, R3 o+ `3 Q( [' _
' b( @2 A/ N, {( a! vHere again, several ways to detect it:) h6 ?4 E/ T z5 p: B5 C
4 j5 t; X% l( P d& @
BPINT 41 if ax==4f6 x! Q# ^4 P: ?6 z7 a
$ J/ K0 n# p1 p: y: P BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! x1 X H! `8 T
j* v+ b* ^7 d: X5 Z7 L9 l# E3 e
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' B' I6 q& i5 V4 Z& n" v ^" V2 M' T3 P- a' E# n7 ~
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!1 l1 x) H0 E* o) f& I! y( C/ Y& W
! ]: D/ I u& T- P
__________________________________________________________________________( z7 U, H, b' y$ X+ Z, v
4 d6 c$ q" C! c2 ~/ J6 RMethod 13
, T& z$ J2 W8 A- g" Z2 N=========1 S: N$ I) N( I3 B* n+ l8 @
) h) s' b6 c. l. R8 k0 X; I/ q
Not a real method of detection, but a good way to know if SoftICE is
! E) \5 x- x/ \, {( Ainstalled on a computer and to locate its installation directory.
1 ?5 x: t. @: P8 h; \6 ?3 MIt is used by few softs which access the following registry keys (usually #2) :
& q8 m$ y* m2 G& J/ ~9 F2 B
9 R( v; `- g9 N6 f-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& k: M Y) ~" r' J" x\Uninstall\SoftICE8 W9 H& T, y Y. i
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: }8 x3 ^9 m0 I9 `9 x. m( }5 `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion D; i9 `3 B% g0 L% L' m# s
\App Paths\Loader32.Exe: B; i2 O$ o! C& ~ H* e; W
8 u3 n6 Q G) [
( J% ~; D3 Y; v% @, c/ D5 TNote that some nasty apps could then erase all files from SoftICE directory
6 [8 f1 {" B: w) V* {5 Z- K5 v" m/ @(I faced that once :-(
! h/ u* n6 d! D% \# {$ j' m; A8 p8 c0 |$ f9 O
Useful breakpoint to detect it:( m, }8 n8 X9 @3 w
2 M) s: h9 P: g& O3 Q* }6 x r" |
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 d. R" f% c0 a* ~# c
. k8 F" q) @9 I+ R0 E- O. O__________________________________________________________________________
0 v; w- z5 A: }" n y3 S& p& ~; M$ q. L; o9 w$ Y+ o4 O( `; U
" t$ F8 h( {3 i# k$ E
Method 14 + D6 M- P# {. {' M
=========
" m5 W/ H, ]. X( j5 }! Q* \" R
5 z- \9 W$ d. F, {6 A: w' N/ r5 W" DA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
/ O) |2 }0 P+ X# Z) Y# ]is to determines whether a debugger is running on your system (ring0 only).9 r# J% g( @1 U3 Z7 B: L
$ L& @6 ]8 H8 |* H
VMMCall Test_Debug_Installed
: k4 G. V$ I* N" B* T9 f4 e1 w je not_installed
( B- K1 S5 i" P: K
# K& H9 M3 D1 K- \8 c. yThis service just checks a flag.9 s/ W7 a( S5 }& V& ?( {
</PRE></TD></TR></TBODY></TABLE> |