<TABLE width=500>
+ C& [& w' B2 T8 v, T$ m; X<TBODY>4 T! o$ e; h: w
<TR>
& s+ N0 B+ h: b9 A( E4 ^ B- D<TD><PRE>Method 01 - R7 X; R0 i+ E) k
=========$ D% k& l* Y0 D0 x5 U0 q
* {; @& i" c7 k8 R4 R0 ~This method of detection of SoftICE (as well as the following one) is
8 \5 a' d! r u: Iused by the majority of packers/encryptors found on Internet.
. M5 k4 V+ @# pIt seeks the signature of BoundsChecker in SoftICE' c* b' K- Z% O$ S
0 s8 a c# K6 m mov ebp, 04243484Bh ; 'BCHK'6 r& {/ S/ J5 ]* g8 h0 y' H
mov ax, 04h
E8 ~5 X2 G/ D int 3 0 M; |+ l2 G7 ^0 j- {; V7 Q! V
cmp al,4
! j& _+ ^ T7 k9 m/ c jnz SoftICE_Detected
! J* l: n1 m W. X4 c
8 C- ~# y0 R. }0 x: }___________________________________________________________________________9 h/ \ l2 A( r: D! n' a# _) E
) \; O% E s: ^ D9 s: z1 gMethod 02' E5 q5 c; y( B
=========
- I1 G# G/ G7 p: R. `: s5 [0 J: m" P8 Q0 ?4 Z7 X1 H1 l$ x! h
Still a method very much used (perhaps the most frequent one). It is used Y' G+ p7 ]) h' x" n; O8 D6 z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints," H: g7 _$ T0 g; A
or execute SoftICE commands...4 M+ n7 c) N" `% V0 k- v( d/ ~
It is also used to crash SoftICE and to force it to execute any commands
9 F+ u, \3 V; ]7 E. U+ @(HBOOT...) :-(( * s9 Q+ b: W3 z9 F) F0 q7 ?0 ]* b
7 E* W% T. a. F8 K- MHere is a quick description:+ t8 s) a3 a: `3 _* O5 R2 M
-AX = 0910h (Display string in SIce windows)
1 }* J3 k! N& s7 b-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)7 z5 [" ~; @$ x/ w
-AX = 0912h (Get breakpoint infos)
9 S" ?8 g$ ]* L3 j* u6 L-AX = 0913h (Set Sice breakpoints)! j) |* d6 u' b5 f o' c( a# y' G
-AX = 0914h (Remove SIce breakoints)
* n1 N, i: F U+ j4 L
* X; O& J& ?% Q( ]; ~' h, b; XEach time you'll meet this trick, you'll see:
; n: P4 B/ y0 Z/ A, q-SI = 4647h" E8 p+ c9 z5 x X. q: I
-DI = 4A4Dh
8 K0 K5 {3 b4 \: _. m5 ~0 pWhich are the 'magic values' used by SoftIce.- Y$ ]/ K$ d; _/ p
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.# H8 e$ H1 v8 \" R' k: J/ h4 r
/ _/ P! Z% n! i0 x) G+ v7 i
Here is one example from the file "Haspinst.exe" which is the dongle HASP a8 ^% ~# f- u0 N& K7 s+ d& v
Envelope utility use to protect DOS applications:% v1 A+ o* x w$ z& K6 X& M4 H* F
$ V* f6 Q8 ?2 A# d+ t2 J$ P0 P7 e/ [2 j `* Z) ~% q! I9 ~
4C19:0095 MOV AX,0911 ; execute command.
( K$ R ?7 Y( D# [2 A4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
: m0 J) f/ r- v! n# d4C19:009A MOV SI,4647 ; 1st magic value.
8 e3 e& |% j8 y4 b" j1 S5 R4C19:009D MOV DI,4A4D ; 2nd magic value.7 B0 F1 ~" m( `/ n
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
% N* I- V+ P# S4 b' i8 Z: O, `& Z: E/ \4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute9 X/ |5 b# f3 a
4C19:00A4 INC CX+ m+ |' v2 o* u1 O# b: @, H" j/ [
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: r$ h% Q+ l1 P3 W4C19:00A8 JB 0095 ; 6 different commands.+ _8 B1 \9 x7 G
4C19:00AA JMP 0002 ; Bad_Guy jmp back." i/ {: K. H0 q$ P' l; V7 ], |
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# O/ V g3 n4 L; }/ O& R# n! |- y
- C! I/ V$ T# s- B. |The program will execute 6 different SIce commands located at ds:dx, which
$ ^/ I$ W; y8 {% b; o4 s I; vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 y9 O& f4 t5 e; M& K# [
* X( E2 d$ q% _4 E* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 D1 J' Z, Y0 r: f) \' Q
___________________________________________________________________________
; b/ z# N" M: y9 c8 [5 x$ g- r4 B9 |1 B0 {) v$ n, e
1 G, G( I+ ?' QMethod 03
: w3 w4 I4 [7 C3 [7 C! X=========. M, v% |7 ?9 c9 H& B
6 e; I Y% @, B5 w: v' x4 ~) t8 m
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h# G3 g, s; q& ?1 h: H8 j0 W
(API Get entry point)
# Q) h9 i* U: M4 u+ J* z% a
2 Q: ~: y& S2 t3 k s; e$ x2 a
8 [5 Y# N; Q/ X+ B1 ^( d1 T+ p xor di,di
; y3 s0 ^* q( \7 E6 a" q: [ mov es,di
; z5 X t) j) i9 p mov ax, 1684h # v7 L$ i3 J: P0 Y- D+ f4 ?
mov bx, 0202h ; VxD ID of winice( d# o( L/ Y" T& B& G; A
int 2Fh
# E3 G, h# _" m; A, }: r mov ax, es ; ES:DI -> VxD API entry point
6 v0 w* }( T1 u. ]$ @ add ax, di
; y7 S; i2 D/ V% O$ s% _$ K( S test ax,ax% d6 W; x8 s% g5 Y1 L6 E3 q
jnz SoftICE_Detected
( E+ G1 u) d# |5 d& B
; g, K$ t. j4 V) T- W$ y! F___________________________________________________________________________
/ p! X; d+ N# @) G0 A6 S0 {& {0 ]. A
Method 04; d' h2 v' D+ Z1 f5 h" P
=========
( T6 w2 H; ~- o
. O" q$ ~% f$ j+ gMethod identical to the preceding one except that it seeks the ID of SoftICE1 D/ ]. d. z5 E; K8 w8 s( F
GFX VxD./ t1 e+ P/ g, I' Y& h
o. i! B/ P5 z* M xor di,di; o6 P( z$ C0 t/ j: x( c* `
mov es,di
3 e6 C& b( @; C& Q# P mov ax, 1684h $ S7 E; U9 \- y3 e7 A" w+ O3 g# d: B
mov bx, 7a5Fh ; VxD ID of SIWVID% ?$ N5 _/ I+ d: }5 j: A
int 2fh
( \: z5 c4 E g) x9 ? mov ax, es ; ES:DI -> VxD API entry point. U0 d: U0 b! P
add ax, di4 y! a8 Q# A7 ?
test ax,ax
& }5 S8 Z4 {! e6 x* n/ k3 B+ ^* r9 K jnz SoftICE_Detected
/ ]% P1 d! g9 b G k& C& q# B9 J* c0 D9 @) d4 p/ N9 u! C5 ]/ Q" P
__________________________________________________________________________
" z5 ]" ] F2 R. ]
6 A! T8 ^- w) T5 m5 L
/ j: m8 C* R9 g: x4 J1 P7 ]" VMethod 059 {: p1 ~- [" L9 ]; H
=========( g4 _/ ^# o5 E+ E, ]) _* K U
7 w4 y% B" Z+ L& J8 aMethod seeking the 'magic number' 0F386h returned (in ax) by all system: a/ n; u0 W# g! v8 y. G; y
debugger. It calls the int 41h, function 4Fh.
5 f+ q. K( d" |3 H+ |1 NThere are several alternatives.
/ M# j' j( l: t. ~
2 O; \0 [ t" Y! T# J( {9 F s+ P7 mThe following one is the simplest:, G- M$ r7 D' S) q
6 P( z. f' \6 m5 O3 N' ^
mov ax,4fh
+ R2 s: t3 O8 c2 x1 D2 [* A int 41h
Q. r0 R/ b. D' ^, y5 M cmp ax, 0F386/ B- ]) v) A& O3 j
jz SoftICE_detected
" \# d) X. g# ~: k/ U6 b7 ?
$ Q- k7 R4 |- Z0 ^
/ ?4 g) Y/ c& WNext method as well as the following one are 2 examples from Stone's
) r$ D% B; s4 H+ a- m Y9 }"stn-wid.zip" (www.cracking.net):
# F; X& K" ^0 {5 D d- w
7 Z+ ?2 T& _) T4 K, V% C mov bx, cs2 D" e& {( q; }3 D
lea dx, int41handler2
/ ~- y0 n/ N8 _, G; A/ S9 j4 Q xchg dx, es:[41h*4]
$ J# d. N5 Y+ `+ Q. ~6 N" n xchg bx, es:[41h*4+2]* K' p# v. H4 u- w
mov ax,4fh+ @7 I% o- C7 W9 r. ~
int 41h# G$ b& Y- N; |5 v) H- X
xchg dx, es:[41h*4]
' |1 \* e2 l7 | xchg bx, es:[41h*4+2]
: w# T5 ^' _8 s+ n cmp ax, 0f386h
6 M% o7 a1 D. _+ i4 C7 [2 R jz SoftICE_detected. }$ F" G& {, y) ]" Q: E. U# s
g: @; I1 q" H, [' Y# T& Mint41handler2 PROC
+ J/ t3 D5 v7 Q3 E- l1 H iret `8 `9 {+ Y" j- F b+ b! a! j. n; [1 u
int41handler2 ENDP0 Y; a* S# o/ w2 j/ a. Q
2 u0 b" n( {% s( D; L. ]5 q4 X
9 z2 g& @, E3 @2 I" @" V_________________________________________________________________________
; u# {- Q4 d2 g2 x0 L* u- i/ {# Y
3 Y5 ^: X) O1 M0 Z/ i1 d1 ^) v- e2 Q) r3 S) W! y) ?/ k& m
Method 06
( D7 o3 Q9 g# H" H=========( w5 t2 W$ |" A' v7 [
+ U) }# ?9 R/ s* g1 x& G7 i0 L- [- @
( r% R" m/ J4 E$ a4 B3 ]" B' p& W2nd method similar to the preceding one but more difficult to detect:8 Q2 q8 ?/ t. G5 {2 w- Y' |% N- J
. \' O* [2 N6 g B& n: \! y
' t$ `- p8 D' L- X+ O# Mint41handler PROC. e. ^+ V) v* N
mov cl,al- J1 Y7 _+ K" X6 _+ [5 i( i
iret
$ g7 n5 G# r( J6 D$ zint41handler ENDP
! j! v6 J4 A" f8 a
: s5 G) a. l7 U& Y: u( Y, A- _, ~# ^ X7 j; @( Q+ F7 j) u
xor ax,ax' ^$ [; A% Y. }1 q1 Y. v9 N% p; K; T
mov es,ax% `, L+ W' m, I( |: ^4 L+ [
mov bx, cs
& ^% r0 ~ `: Z3 v8 m q lea dx, int41handler
" ?0 f$ z1 h* [3 J7 L* Q xchg dx, es:[41h*4]( `% J4 [ W( W2 t: u5 Q
xchg bx, es:[41h*4+2]/ S% k: k/ M3 q- d: L% D3 A
in al, 40h; H2 ^6 a+ u1 I/ g
xor cx,cx( O7 P7 Z- O; |, r& y( ]0 C
int 41h
, z. Y/ \7 W# C- k9 u xchg dx, es:[41h*4]
5 C# J% i3 p( V4 t$ ^3 j* { xchg bx, es:[41h*4+2]
. b/ l( @0 {. Q5 J" \) I cmp cl,al3 f, v( j- X' y2 m. ?: N- q
jnz SoftICE_detected
/ T0 |9 f O. _+ f% |, L2 @" A2 i% b) I5 u7 u: `, r
_________________________________________________________________________
- g/ Z9 Z4 O4 f$ k! ?' N! D/ z1 H* Z; L$ u
Method 073 W: J0 e- Y6 L% Z' ^. C
=========8 i+ ^4 S% j4 ~$ B4 R: d9 T
7 V6 k0 J$ q, x3 M/ V/ G- F+ DMethod of detection of the WinICE handler in the int68h (V86)
9 b$ O( V1 f! L- D- o+ s% Y) {; v; R, q
mov ah,43h i/ J4 O# N. M. A
int 68h; t; T! Q* N' `2 f
cmp ax,0F386h
4 E4 }# A2 B2 X jz SoftICE_Detected- K; x/ Y. Y. ?, A( A
/ h5 U# V+ l, \0 K X
( C; l3 A- q: o) X u( ~; g=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% T* k4 d- b$ x" x3 v1 w" ~4 B7 i app like this:" O7 o! x- l2 h' u4 U0 |; L$ k5 V1 ~4 h
* e* ]# C# p3 k! Q
BPX exec_int if ax==68
# r# h5 \7 g. l4 N) k( S (function called is located at byte ptr [ebp+1Dh] and client eip is
: _% _, @" A1 s" V8 p located at [ebp+48h] for 32Bit apps)
3 A/ L) {9 \; A/ u__________________________________________________________________________; I% \' U' O# F8 _1 R, Q- F b& C# ~
1 x/ T2 r) T" _' ?" ?) M3 G
+ ?1 P) a1 i/ E
Method 08
) W' m5 s9 }% p3 `2 f=========
) ?; j2 l) l) h" k2 x" ?9 G: K8 t" }" p5 _3 |, o
It is not a method of detection of SoftICE but a possibility to crash the0 L1 z+ l+ ~, o; n: `7 |
system by intercepting int 01h and int 03h and redirecting them to another2 Q$ D$ l5 u; t& s9 R
routine.6 [* {( _* Y$ i1 O
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points s+ o1 Y6 g! i; n2 r- }/ {
to the new routine to execute (hangs computer...)% U' T- j) |/ n* z
* @! @& T" o7 V3 i2 K6 S mov ah, 25h
/ f2 X* G' h6 A5 l) f g mov al, Int_Number (01h or 03h): E8 C9 p; A& g' Z- m. Z
mov dx, offset New_Int_Routine8 o5 s4 K& _1 m# x) O2 A k
int 21h
/ m. Y8 {7 w6 _9 ]& J2 y) U0 G$ r/ p( q9 g: P8 ^2 E
__________________________________________________________________________) M- U# n9 z: D1 |, j$ }. B
( @# Y. i$ T# e1 l! w0 s' mMethod 09+ s3 K2 n6 t0 L- ]0 `+ N9 p: n
=========) P+ @! h/ R3 e/ @/ s, ~5 R4 `
3 o( f H0 B9 R" jThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
` n& m! U. F7 Zperformed in ring0 (VxD or a ring3 app using the VxdCall).4 ]. s; O! z0 J. z" W
The Get_DDB service is used to determine whether or not a VxD is installed
( S6 Z6 R( Y/ D; _9 Q% b1 ^for the specified device and returns a Device Description Block (in ecx) for5 ^ {: D; |) V7 Y+ ?0 F% h1 W/ G
that device if it is installed.
1 ?) E2 Z- s) r+ B/ Q, t8 i3 G, n+ U! { E1 V5 x
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 G+ z6 [0 o4 r% P" `. D: `
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 ?6 j/ a/ ~7 D
VMMCall Get_DDB
% B! y8 J, w( z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed0 b" P- e% L* R9 w. r8 M8 v
5 }$ R2 J& t5 x2 {Note as well that you can easily detect this method with SoftICE:
% e) |! p1 t4 j9 r2 s8 \8 k7 p0 A bpx Get_DDB if ax==0202 || ax==7a5fh
" }6 d8 J h: G+ @0 ^* H3 l& Y' ?: U7 H# j% |* G
__________________________________________________________________________
. q. V+ A5 j' ?3 i4 d% E5 @( ^
& \, Q% D* K7 dMethod 10
- g% G, R+ Z( E% a=========. z, F! U# Z' L4 X' r- X
) _4 k: E8 F7 k6 M=>Disable or clear breakpoints before using this feature. DO NOT trace with+ S& z8 _6 N p. Y
SoftICE while the option is enable!!
* i0 N) s: _8 Z- J) y2 M+ g. ?* x6 Y; w9 B* P% o
This trick is very efficient:/ b5 _7 e$ H% X. T, K1 U& H
by checking the Debug Registers, you can detect if SoftICE is loaded
9 Z1 K, i& H5 A8 J) Z$ k. S, d(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ A8 L( u6 ]% S0 W7 n0 othere are some memory breakpoints set (dr0 to dr3) simply by reading their
% M) ^! E" `" `- ]6 ?. Vvalue (in ring0 only). Values can be manipulated and or changed as well
7 ]- s: ^ B0 ?- ?: p) P(clearing BPMs for instance)
$ }5 r8 Y$ E* E! N$ D& W. U/ p& U, @! W+ f+ a) M) d7 ~) L
__________________________________________________________________________
6 b& X! x% X$ e" d) V' m1 g# O7 T$ I/ j& h$ K7 U
Method 113 w: a% P. W' h( B8 @3 z, l& n/ J+ G" M
=========
3 Z7 d: h5 }" z" j1 _ ^3 L* _- B: j) X0 p0 X1 K
This method is most known as 'MeltICE' because it has been freely distributed
: t- c4 O$ _9 G7 Z5 b5 ?: H1 `via www.winfiles.com. However it was first used by NuMega people to allow
# X2 C5 c5 D- eSymbol Loader to check if SoftICE was active or not (the code is located
3 W* @7 R8 r4 {# y+ A+ q8 finside nmtrans.dll).
! [# G0 y* Y7 j7 f; \1 t
2 t4 _8 l o# O5 T/ v6 Q+ r# X. m. CThe way it works is very simple:! O- j+ W0 ]& u' l5 x
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- e6 T; y8 m" F7 z. A/ x, DWinNT) with the CreateFileA API.
% Z! x5 Y5 A' e% m+ M/ Z* t; m: [$ B* O' e" q4 M$ k, l" ^2 X
Here is a sample (checking for 'SICE'):
6 s/ n6 o7 U, D6 k4 {: m- a; h* a Z+ s6 ]1 [
BOOL IsSoftIce95Loaded()
) ], b; b4 F+ o! X: v/ s L{
$ R j7 n A' s0 ]4 L. H: L; v4 i HANDLE hFile;
: b) y! n9 n9 t# o% I hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. J8 E. z& i6 T# ^9 H FILE_SHARE_READ | FILE_SHARE_WRITE,- d3 e2 M9 E n# Z. O
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- C0 F% W: b* r/ J! Z3 T# y0 I if( hFile != INVALID_HANDLE_VALUE )
( T2 ~' c5 H2 _ {2 v6 Z) [, Y7 W
CloseHandle(hFile);
0 T3 z. e# m- f return TRUE;
% J5 \, u" D$ w7 A" x( } }1 R: a. G0 t: k/ l
return FALSE;1 t: E, C) [ r( X; t0 c" W
}
/ ?' H8 |' P4 _! o% d& j
+ ~# W5 ~( k% tAlthough this trick calls the CreateFileA function, don't even expect to be! P# E, S' l- F' F
able to intercept it by installing a IFS hook: it will not work, no way!
6 E* D) C: W# Y3 R' @ L9 @/ iIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 F p E6 h& c- u- T2 I7 z% Yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 U# w) i1 w1 F: R% oand then browse the DDB list until it find the VxD and its DDB_Control_Proc4 _; p8 g g. {$ X
field.
5 b+ L+ S8 `! g) s8 m$ |+ TIn fact, its purpose is not to load/unload VxDs but only to send a - R! t/ g8 Q6 B5 Y8 Q8 L% x
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
& l& z& {$ d( j2 e* fto the VxD Control_Dispatch proc (how the hell a shareware soft could try
) k8 v4 w+ B4 z1 c: q$ |to load/unload a non-dynamically loadable driver such as SoftICE ;-).5 _# u% z3 V) t5 I+ v m
If the VxD is loaded, it will always clear eax and the Carry flag to allow' G p. E' l9 ?: j1 Y6 i
its handle to be opened and then, will be detected.
" E5 c$ O4 s" `6 [8 M8 YYou can check that simply by hooking Winice.exe control proc entry point
8 _" l9 v4 Y+ r! K5 Fwhile running MeltICE.
- h, F+ I! k- ]3 X
+ M' T& I z- }+ O" U( k4 C1 b# ~2 K! F/ N: X4 S5 h0 b& Z
00401067: push 00402025 ; \\.\SICE7 V0 a0 L4 d" z; q6 N1 U
0040106C: call CreateFileA
9 d ~( t5 s9 k7 x& x. q% e6 b7 r 00401071: cmp eax,-001 g6 N0 q0 b4 s( ]" X% R7 r
00401074: je 00401091
& V, @. B0 q( ?; _6 S Y( Z8 s' f, W$ a) h! }$ t4 }
% L c: z# y, `- sThere could be hundreds of BPX you could use to detect this trick.
9 }( T3 }3 u. D0 K1 \: |+ ^-The most classical one is:4 b/ S- X& q* { h5 ]( \
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
0 B0 {: Y4 {, w$ \) G5 {' q1 P *(esp->4+4)=='NTIC'
) U0 H& y% o- t D. _: q
/ a% G9 o. l# U) U* W% t% y" b-The most exotic ones (could be very slooooow :-(
% e2 C5 L& |' H' S8 l) P8 s BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ! A/ {6 w6 p6 q! e: q
;will break 3 times :-(
( W0 K) q9 x" t$ q
) j4 Z- ?( r& E8 v- ~# \6 q; m-or (a bit) faster:
$ e8 ~: M# y& I BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% L5 W1 _$ A: r `$ y/ Z& U! V$ E: N* c7 V1 }& Z3 Q
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
3 b0 U: q. @: R; A( C ;will break 3 times :-(- O& @- K; h+ B0 }# Q9 I
, a& M6 J# W/ C4 U% W2 U
-Much faster:
5 r! |% l/ Z0 y, c+ k, X2 ] BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'; e) @1 w }5 Q* o/ ?' s
9 a E5 I C, L/ k: N: M
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 m2 c. `9 P0 {0 ?- S! V; j! u0 B Afunction to do the same job:
4 |# V" R9 p2 @0 |
6 N2 x# Q; Q8 E1 J. F& y0 {* ~ push 00 ; OF_READ8 j# A7 |5 Y3 m& G. b4 _: P
mov eax,[00656634] ; '\\.\SICE',0% W3 W2 H- t4 m) f' @+ B0 o2 U
push eax
3 R# W) Q! q. Z: d/ `3 v9 P# v0 b* [ call KERNEL32!_lopen- P) f) F* ^# h/ Q* s" U
inc eax6 L5 J# a# F7 b% p- l( _
jnz 00650589 ; detected
. P) P4 A! C" c& n. D$ }! I push 00 ; OF_READ
( M8 B' H; ], R$ F mov eax,[00656638] ; '\\.\SICE' ]; t7 n4 u% E0 H+ E/ i
push eax7 v8 m# e2 j8 `# N
call KERNEL32!_lopen
* [( U# H: v, m& H9 F% W# y inc eax9 g; d3 z& w4 ]
jz 006505ae ; not detected
6 K1 F S5 V% E9 B
& H7 n- d" ~" X V, N1 q9 Z U
( o* k& V. b- C1 J8 w__________________________________________________________________________
$ J3 X z* H& J
( G2 i' R8 g2 n& kMethod 12" b4 u0 c! [: I4 q" N
=========5 g" V8 A8 B8 [" C9 j1 Q
, g: j% N3 x1 g$ a$ }This trick is similar to int41h/4fh Debugger installation check (code 05
0 ^6 K6 m" O0 k, X- |& 06) but very limited because it's only available for Win95/98 (not NT)
$ ?+ D, W6 B9 D: ? Cas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& z3 s! G' K5 }+ Z5 \7 n0 x# n& w% u1 V: Z& c |' ~
push 0000004fh ; function 4fh* _: U5 y3 k2 Z$ W
push 002a002ah ; high word specifies which VxD (VWIN32)
( y. A, }# T" ]3 ^% U7 b6 q ; low word specifies which service
8 ^9 S+ Z5 U6 z# O (VWIN32_Int41Dispatch), K: N( x! B* _) K
call Kernel32!ORD_001 ; VxdCall! D; x- t' [# l$ H5 W: Y
cmp ax, 0f386h ; magic number returned by system debuggers
# a8 M7 {6 m, i8 \8 J; G jz SoftICE_detected5 d1 U& R$ M% z8 ]1 K4 l
" ^4 i& U! V$ O$ a
Here again, several ways to detect it:- q+ n- w7 t4 x4 [' e d* V- d
4 N4 ~+ o! K# w: N BPINT 41 if ax==4f; z' J- }7 t/ `4 x' |( b0 Z
% `/ L7 Q' \- ? BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) `; q- c; ^# }8 }
+ ]3 h1 R# Z: X' f$ J BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 P) l" A' z- v5 a0 ~1 m/ _) I0 B
- [; j- ^$ y8 N9 g BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!( c, u+ z7 p- [5 w/ W
, \. P$ Y4 \4 r, a4 x__________________________________________________________________________
) }3 x3 ?5 V) C/ t4 J6 M9 w j3 e* R# n& U
Method 13
/ [8 M. ~' K: ~5 g$ V=========+ e8 k+ r- h. S. V: B
. d) K6 @! ]. M" l
Not a real method of detection, but a good way to know if SoftICE is6 w+ R2 h L6 G$ ~- o4 ?
installed on a computer and to locate its installation directory.
8 h* `9 O! |% lIt is used by few softs which access the following registry keys (usually #2) :
( X% c4 ^: X/ |+ ~; Y
. X r* X- p \6 M: Q8 ^-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 G, w: z1 P" I# ?" |7 V
\Uninstall\SoftICE1 S2 y( r' v: u5 @- ~
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# p" s3 L1 l7 e* _7 ]
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- F( p0 n% D! n. k& U( x A7 Q\App Paths\Loader32.Exe
" I# J6 L: ^; x4 j9 z
& [" n0 j, `4 `$ t! k7 q
. L, ^. M/ e8 t+ ANote that some nasty apps could then erase all files from SoftICE directory
9 p* o/ _% L. [1 U& ~6 {" D1 U(I faced that once :-(
9 A6 T4 r% N @2 ~* n- ]1 @+ y8 L* Z b/ a
Useful breakpoint to detect it:" t: @7 `' m- Z. z
# A; t, g a& E! C w
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" V; W# f" ~& j( h5 t8 \' f5 P& g& }/ H4 L" p% D
__________________________________________________________________________
/ [* c5 t+ V3 H P2 s1 v
# j& L0 o& l2 a" O; B! V! V4 T: ]* Q+ N, T( I5 Z! l) J
Method 14
: t M9 x. ^3 X- c: f=========
- R }* O. Q; y& e3 g* \. D* _! d2 X3 R9 \% l/ c4 h3 G
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 u9 e& ?" ~' g/ ^1 e
is to determines whether a debugger is running on your system (ring0 only).: E+ G) Z" j' F: T) d' }
( @4 ^4 C9 }8 C( S- w6 ?3 i VMMCall Test_Debug_Installed
" @0 P0 S& w5 Y$ C2 A) ^, [9 C je not_installed
* |8 O8 z5 P. j
0 z8 l d* L0 z K1 s5 CThis service just checks a flag. D8 o- G1 }. j5 v$ \' s- V2 k
</PRE></TD></TR></TBODY></TABLE> |