<TABLE width=500> m" k8 O& \# D$ ?/ V- H* ]- X: U$ W
<TBODY>! |9 i, M* z5 w" E( H
<TR>. ]7 V4 d- G# z; ]3 X! s
<TD><PRE>Method 01 9 g) C5 ~6 M# e8 B+ ?
=========$ z2 [$ J1 G0 Q: ^2 }/ _
2 l# V" X8 {2 lThis method of detection of SoftICE (as well as the following one) is8 L1 C6 M, O" v! P- w
used by the majority of packers/encryptors found on Internet.
' y" J' x' y* T6 d* T3 A/ MIt seeks the signature of BoundsChecker in SoftICE
/ E% D* h* E' t0 d/ \: H! E4 z% @
7 }8 \, a+ _, y+ h' T( Y8 g mov ebp, 04243484Bh ; 'BCHK'
) a6 K% d5 S! g; J e# B+ F$ q ]2 b mov ax, 04h
+ k J @) c7 ^8 V8 L* k int 3 ( T: s) e" V& Z. q9 {. q
cmp al,4! u; p- I. ?7 {& ~& r
jnz SoftICE_Detected5 ~. \/ N" ?' P$ {% M. a7 }
4 D3 q8 Q8 U R. o1 q
___________________________________________________________________________
2 C0 W* ~2 J% ~7 C( Q+ g+ Q+ h2 B3 M$ ]" [1 U u% ?. `
Method 02, Z- @& F& n& ]" L* \+ u9 [
=========5 X' o9 H4 x% W( M( A0 t
$ n8 ~. I' o5 p5 ?- H
Still a method very much used (perhaps the most frequent one). It is used9 L- c% h, q* \/ W" A0 |. d
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ _! Z1 J& R/ Z8 \1 J
or execute SoftICE commands...* Y4 A# m& j) p, d
It is also used to crash SoftICE and to force it to execute any commands( H2 D' [2 O0 W0 z9 W! X
(HBOOT...) :-((
. i7 @: _3 U, l2 P! n
$ D$ k! N8 j8 f: M6 ZHere is a quick description:
; L8 H$ E4 Z4 D/ o& J-AX = 0910h (Display string in SIce windows)$ E9 U& {5 P: f8 P$ x
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& _/ m$ j# n" J% j' i+ u
-AX = 0912h (Get breakpoint infos); V+ y9 U/ Q) |! V
-AX = 0913h (Set Sice breakpoints)' ~: y/ o! G& l1 j
-AX = 0914h (Remove SIce breakoints)! h. J* q9 X0 r2 r4 Q8 k5 e
8 ~2 v, A$ {- a/ a$ |Each time you'll meet this trick, you'll see:, y3 ?5 q" d5 f1 b' z3 w, N5 y
-SI = 4647h
4 U7 B* b" [7 I# `+ t- d# I& d' _-DI = 4A4Dh
) t H' ]+ n. o; ]! u! y4 |' tWhich are the 'magic values' used by SoftIce.
" x" h8 _; R/ NFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 o v3 ~' Z* E* y6 v
6 Z" t/ ?5 N' r( D$ E! C4 x
Here is one example from the file "Haspinst.exe" which is the dongle HASP5 f) a( B4 l( w8 w2 H+ y
Envelope utility use to protect DOS applications: Z" w, W0 G# r
, Q. z; q* T6 B3 A' S0 R( [* L4 A; _. h& B8 N
4C19:0095 MOV AX,0911 ; execute command.6 R; h! x: D2 C2 C
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).# N* O2 u, x# P0 i' [% n* y5 S" T
4C19:009A MOV SI,4647 ; 1st magic value.% @! g% }6 X& W
4C19:009D MOV DI,4A4D ; 2nd magic value.
' m. t% }2 q( B2 p- Q- x4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*) w. _' v3 N% f$ H( \8 p
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 }; J. ^0 {8 A) U( d2 H; r4C19:00A4 INC CX* |, y' T3 Q5 g
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. {, V, @2 g+ |* f0 ~3 N/ M' h4C19:00A8 JB 0095 ; 6 different commands.6 t) j/ K$ ]! n) s: J( I
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
- R3 d% Z/ P- `$ e6 H( S& b4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
8 b" g9 Z2 J* z# {' v- K- ?5 X" E$ r+ I. X: y6 Q$ X( h
The program will execute 6 different SIce commands located at ds:dx, which1 p7 s+ d8 n( p0 d
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 Z5 p% q% O: e3 ]. P
) O8 b2 }# W* J/ O/ o; K+ ?3 ?- @* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% h* G9 {9 O* w___________________________________________________________________________
/ i$ Y: B/ K) z1 D4 V! H3 _# r2 z" M& }
0 y& d( m, m1 c ]- x9 U# [Method 03
4 c A" u9 F. I9 a5 V5 m/ s=========0 H4 @( d% e. b* j4 F$ r+ l9 n- j
& }: w* U# r; M: l1 |
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
/ J7 P) P5 P/ L0 _0 S% U0 Q& D(API Get entry point)
& O6 C$ G$ ?6 S$ F3 h
2 U; s' l/ N% b- b) f! x; ]+ F( H" h9 j5 |' Q) _
xor di,di
2 G! O! h4 X, N& b mov es,di
9 y; r% k; j. J% y+ F mov ax, 1684h
3 v2 [2 h+ h0 \ s mov bx, 0202h ; VxD ID of winice7 n8 ^! f, z4 W3 n
int 2Fh4 ~* Z) Z4 I! ~! U6 h9 ]
mov ax, es ; ES:DI -> VxD API entry point
, I- T# }3 p9 i1 N. ~* [$ `# J& l add ax, di) V% |: h) N1 h7 ~# w
test ax,ax( q2 b% F U( D7 i% E
jnz SoftICE_Detected* i* t% d. z( U ]2 _5 V
. h, v9 m/ G9 ~* x+ A0 |5 k
___________________________________________________________________________. l1 ^) C, Z" @" K9 D4 e8 j
( W# o) h8 v& c3 ]' m1 b5 m
Method 04
& n+ \4 B# O% I0 u=========" V. m5 E: ^+ U- `: m& W* |
9 d. s# q0 v' c+ i& i
Method identical to the preceding one except that it seeks the ID of SoftICE
* | [4 r7 x, AGFX VxD.
/ Z) |5 t- G7 N; ?3 T4 g+ m5 A( m B# Z
xor di,di- F; W; H7 u9 n* j
mov es,di1 k7 `2 W2 `7 J; e( o/ r
mov ax, 1684h
: X$ P9 i* @. o mov bx, 7a5Fh ; VxD ID of SIWVID" @: z4 Y9 Y' h5 s6 a! l6 g
int 2fh
! U! v7 O9 V. S/ \ B; a2 }" p! A mov ax, es ; ES:DI -> VxD API entry point: N; w3 o( m/ x7 M' b P
add ax, di+ M8 n5 Z3 n6 ~8 P! e9 V: E1 F
test ax,ax
+ }* u d! {- g4 J" X6 {% t jnz SoftICE_Detected3 e- m6 e) o7 E. r
5 |4 Y# F" j2 ]4 p1 k" s__________________________________________________________________________
9 b- N1 K4 E1 J- O$ C$ R3 G: a- g! o: c' l: W Q) b% M# j" N* P
' E' A+ T4 a* m( hMethod 05
- S0 ~% P0 p% O8 y ^=========
3 ]: t0 s1 ~! X' r) D
3 w, J# |: e, E: Z4 Y) ?6 EMethod seeking the 'magic number' 0F386h returned (in ax) by all system
# h2 _9 J% r! Y! X# s1 |" D, gdebugger. It calls the int 41h, function 4Fh.
* D Q) v$ A2 sThere are several alternatives. / y% P/ e9 X; V9 T
' j! V# ^3 Z1 M r! dThe following one is the simplest:
0 V/ }9 a9 Z5 C- [
3 [8 F: ]9 \0 U6 c5 X5 @ mov ax,4fh0 I, l, s4 E2 ^. [1 I
int 41h
3 ]5 J8 g8 a4 z+ P4 d cmp ax, 0F386
2 m9 L7 Z: Z+ R/ Y jz SoftICE_detected" u9 N* B1 V7 l3 o, C7 j* Y
! C# `6 U& O, N4 u5 c# z7 p ]! D m
Next method as well as the following one are 2 examples from Stone's 1 {+ M8 O8 v9 s8 [9 ]6 z
"stn-wid.zip" (www.cracking.net):
3 K5 F, ^) d# ^8 N! X
. `5 C0 n! e' s( G' s4 _& S& Y mov bx, cs" r3 J0 n5 g% t6 L: G& f
lea dx, int41handler2; R2 F( `( G" Z2 M2 L* k
xchg dx, es:[41h*4], R+ b* ]9 F, M3 y0 M* V2 [+ T
xchg bx, es:[41h*4+2]5 d. _ a) a. j$ m" F
mov ax,4fh
* e2 V, B% b8 o! I( p5 P# r; r, h int 41h5 e% j, q9 g H: m4 O; J2 ]3 B
xchg dx, es:[41h*4]" _5 j8 ^4 T" x0 U b8 X
xchg bx, es:[41h*4+2]
# c$ v* x; Z- G4 O. H cmp ax, 0f386h
6 W. O5 B8 c. R8 @" }" ] jz SoftICE_detected& o# ~4 s6 s: Y8 y6 a
& U v4 B) H) L
int41handler2 PROC0 s0 k0 _; L- Q: }8 b2 b g5 b
iret, {4 B5 @# s9 b: l/ B
int41handler2 ENDP5 l2 {3 V4 O2 \+ ?
; b* a+ }9 h$ k+ w% \( M5 {( h
5 u/ h- \+ K# [" U- ?_________________________________________________________________________
# ?* ~- Y7 l3 b* K9 h" }6 A; I1 [" C6 ~9 ?! z% ~9 ~5 n% ^
4 ]6 q* |4 {8 l5 U9 J
Method 067 P6 C1 h- p1 p4 j
=========4 E4 j: F$ I* B( Q4 O
/ f# q) V2 @3 ^" y1 r
5 K, Q- s* i4 i; i% }& G2 l
2nd method similar to the preceding one but more difficult to detect:8 d n# U# o! X4 y
. H0 y, [9 [ ~8 N" }, H3 e0 F, _9 z
int41handler PROC. Z8 r5 |8 j# z v
mov cl,al
. k; ^" a/ c' V" m; @+ E$ C iret: L' Z1 e2 Y; R' S
int41handler ENDP! p5 A& z6 E: V/ l6 P
4 f3 f3 O, k8 W1 T* f& Z
& r1 ~- E4 n% I( b: k xor ax,ax
5 l4 ^$ C8 d( s1 t) Q8 `, j% h mov es,ax* R" l4 h( ]/ @% C( _2 m4 z
mov bx, cs J% k$ z% `: y4 Z- b4 [0 m0 s
lea dx, int41handler
, X1 H' k1 [+ p+ x- e/ u4 b xchg dx, es:[41h*4]
4 C6 d6 e: k+ z" W( M xchg bx, es:[41h*4+2]/ n$ U7 X: }! N: M. G
in al, 40h
7 }+ J }, F5 I0 P' P+ F" z xor cx,cx0 [9 ^6 Q8 ]3 G0 A9 {; D
int 41h' _& @' Q5 [8 ~
xchg dx, es:[41h*4]! ]+ `) s1 Y; r
xchg bx, es:[41h*4+2]. z- J1 m4 b; G+ p
cmp cl,al
2 \; s; p, ]6 T4 K7 Y9 j+ P jnz SoftICE_detected7 G7 @. G/ N& ?$ B+ L( g
1 m Z8 r* [8 r4 j7 Z H- _3 O
_________________________________________________________________________ K' t4 o' K* C: V2 i
/ @0 Q9 D3 z; K8 mMethod 07
) I; y, } ?% n7 a=========0 l7 P% a' R0 s' R9 i. K S8 j
+ Z) l. ^. N, `) S( RMethod of detection of the WinICE handler in the int68h (V86)6 I% A7 k% v& A( Q7 `4 P
- ]. A; k- r# O, i
mov ah,43h
5 o* j3 ]; t3 @* C2 h* L int 68h
; P( ` K) `4 l; J cmp ax,0F386h0 H9 @& u4 W; L3 H- L* L
jz SoftICE_Detected
8 _: d4 \8 U9 y9 k; H( w5 \, M7 e7 I+ b2 R9 C, w
2 F0 X) I0 o/ d* l: ~' X3 Z1 N1 @=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
W# A9 ]1 c3 S+ s" ?8 H7 d2 R app like this:/ n6 j' W9 D* B3 U7 k. [4 e) V, A
, x) g/ e1 Y3 U3 e( m
BPX exec_int if ax==68, ?8 z- w( [# x9 _
(function called is located at byte ptr [ebp+1Dh] and client eip is+ S& N( h+ d" w. g( W
located at [ebp+48h] for 32Bit apps)( W7 b& C. e1 I/ Z: ~" @5 k
__________________________________________________________________________
3 _" H. @3 `6 `9 J+ D
3 m" }2 N/ ~: T1 _% D/ _( a$ L5 V$ K( a5 o* `$ I
Method 084 W; `2 P) N/ G4 k2 E4 |( X
=========& w. X$ d0 U7 |/ r
) F/ `; u' r8 V/ }9 o& O7 L
It is not a method of detection of SoftICE but a possibility to crash the. b1 S! M$ k! O, i. b* A, M+ H
system by intercepting int 01h and int 03h and redirecting them to another; C- a& X! E* s* X3 n/ `
routine.! u* Z: Q' X/ A g) n( K# S
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 x9 R c1 x9 [: y( B/ O( Xto the new routine to execute (hangs computer...)
q' u$ h, y3 z1 V: i8 j3 D& p) P0 j; `2 P" K, z' s: P
mov ah, 25h
x* A* z# m& J) U( y# N2 d mov al, Int_Number (01h or 03h)$ R& y- D, ~+ h% \9 T8 i
mov dx, offset New_Int_Routine
% Z. X r- e/ D& r2 H( q6 l4 _ int 21h
2 S1 W A( ~$ O- p ^. @
- N3 S9 U# D _& _" a4 Y__________________________________________________________________________
7 l4 U1 w8 t- b5 d' }1 Q! Y0 c) @0 C1 z( X" }, \
Method 09/ h% y9 Z @, c: V5 ?0 C; L) P
=========
0 D ^: z n9 u" d3 z) L7 _$ a; \2 J1 {2 T6 ^1 O
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( _6 ]- Z) P8 Z2 R2 j5 G
performed in ring0 (VxD or a ring3 app using the VxdCall).( A0 P. e+ C1 W! F
The Get_DDB service is used to determine whether or not a VxD is installed
0 y; E# G) [0 r& ` C `1 h# gfor the specified device and returns a Device Description Block (in ecx) for
+ @# l% k" `3 @+ Othat device if it is installed.
3 |; m* T9 H3 L- y- A! z9 I( ^" a) Z3 u& |9 I
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( ]( w" Q" G% i2 @/ r: ? mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( p2 e: o6 P r$ T, M5 j6 M3 F VMMCall Get_DDB
; U+ p3 l; c% R, j; X2 }: E5 z) f# f mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed0 H4 B% k& d: z5 T# ~$ o" S
. `* [5 l, I0 s0 J
Note as well that you can easily detect this method with SoftICE:* L! J& H3 N) T+ f: |3 g
bpx Get_DDB if ax==0202 || ax==7a5fh* Y5 T$ U/ h/ p* }3 O; k
) G6 J; _5 O3 t% S0 r+ M% `4 N! N1 H__________________________________________________________________________
* b2 D' B$ a" u2 M. n3 \9 s' ?6 q6 X1 w1 n2 F2 r0 a! x
Method 10
2 a1 O0 E# l8 W* o2 W* f* v) `=========
" p. ~# o: m8 {! X. O$ X; L s N* K0 e0 `
=>Disable or clear breakpoints before using this feature. DO NOT trace with5 n: I6 _! Y1 S5 g
SoftICE while the option is enable!!. v8 ]/ F6 \/ Q9 a, p5 Y7 T
" S, M# u3 z: D
This trick is very efficient:
* j/ x$ H/ @( p9 j" D# ^# f9 Q/ vby checking the Debug Registers, you can detect if SoftICE is loaded
. m/ s" i5 G* n6 V8 o) x(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 C, N J: \) e) N$ U# {there are some memory breakpoints set (dr0 to dr3) simply by reading their. A$ d& [ ]/ Q a* h
value (in ring0 only). Values can be manipulated and or changed as well& |, H# e6 r1 |0 @8 R6 b
(clearing BPMs for instance)
( X* `7 ^1 @& d: S" W1 v/ U
. M4 x5 E8 ?0 M8 B( y8 U7 n; V__________________________________________________________________________7 N) q( l5 _$ H4 k8 v$ R+ E& p& ?
8 R. k# `( `9 p: m
Method 11, ]) q3 ~% U6 C, _: b
=========: C( C- l: V% O8 Y& J
4 T# T1 {0 y" @
This method is most known as 'MeltICE' because it has been freely distributed6 z' a$ X+ M2 R" n6 Q9 D" r; O' o. |
via www.winfiles.com. However it was first used by NuMega people to allow0 U8 ?! R. W: A8 E8 j
Symbol Loader to check if SoftICE was active or not (the code is located
7 H/ h; K) }) R1 K" Z3 r2 p3 xinside nmtrans.dll)." e, r3 n, l% M' ^- K& x
) ~$ l, g7 m# `" [' l, _( YThe way it works is very simple:% P7 k$ C+ o) G& ^' K6 c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' S8 ^& @) u/ X6 s
WinNT) with the CreateFileA API.
& k- j0 P7 K& |: |/ r
8 K1 i1 k0 z6 w3 I" O: \Here is a sample (checking for 'SICE'):* V, S, ^" l# s2 {( L" ]
4 L' |* a9 r# _% ABOOL IsSoftIce95Loaded()
; C: t* y( {" m& I- s# _{5 x4 r K8 ]; G; h0 F4 \
HANDLE hFile;
D" D% `3 @$ r8 W; ~/ U+ [$ z' ^ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 U& k! i# U+ }0 A
FILE_SHARE_READ | FILE_SHARE_WRITE,
4 N0 f5 l. e* i NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 v% o. E2 Y5 L# y8 {0 s if( hFile != INVALID_HANDLE_VALUE )$ m1 C9 ^# f4 M( U, _
{
7 ?0 V# x: n$ N4 ~' V CloseHandle(hFile);! d, E# R, E, h1 _+ O7 c. Y
return TRUE;
% l2 {# g/ v1 ^ I }
, i# H2 O5 F9 q- b) K return FALSE;
1 }! I" v3 a6 `, _0 r. J2 R; ]}$ t p) z& a9 J3 d
; Q/ b1 M4 a: W2 N: ? m2 EAlthough this trick calls the CreateFileA function, don't even expect to be
8 z' E) j3 e; u( ?7 [# g" C1 F$ zable to intercept it by installing a IFS hook: it will not work, no way!
, L+ G, E; j9 ]7 y9 P1 qIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
) ]7 O: A; w7 q, _% ^7 _5 }service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* s) U5 }( i( p! [7 O/ D- sand then browse the DDB list until it find the VxD and its DDB_Control_Proc8 J3 ?# V- r2 b( ]! B6 Q
field./ T. _( H* ?5 L. _1 s
In fact, its purpose is not to load/unload VxDs but only to send a & l5 q/ q4 S$ Z& S# c" k
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)' ]" [ Y7 z- f1 Y( q, [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
) o, z) i: |# K$ o5 |to load/unload a non-dynamically loadable driver such as SoftICE ;-).2 W8 y( ~/ Y2 K# {# x6 ?5 p
If the VxD is loaded, it will always clear eax and the Carry flag to allow: _, j2 e9 O$ R2 ~
its handle to be opened and then, will be detected.
5 ?, \6 l' r: I% @! e pYou can check that simply by hooking Winice.exe control proc entry point
: a( K* i2 |) @2 ?while running MeltICE.
. U! Y) Q& M0 G! K3 J# T. R4 u. n1 f# D4 c2 w
G+ \$ L! h, {7 |/ b* N# C) h
00401067: push 00402025 ; \\.\SICE4 T( _: ~0 d) @# i+ |
0040106C: call CreateFileA# }/ f. `6 w" o; o
00401071: cmp eax,-001, @3 V+ u- j* u. _- [- ?+ p ?
00401074: je 00401091
4 Z) K7 b* p5 I$ o5 C8 t0 A, l: A: T8 O0 M) n
6 X) Q" w+ S8 r9 U% OThere could be hundreds of BPX you could use to detect this trick.
( s1 B' {, {! g2 |* e. c' g-The most classical one is:
- E6 O# e7 D+ Z% J# p( o0 ?, g BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
9 A+ ]1 p7 c1 L; @& t *(esp->4+4)=='NTIC'
" I7 i5 l- A5 o! r+ j
( t6 a7 r4 K4 V) O' g7 f-The most exotic ones (could be very slooooow :-(
y: Q1 c! Z6 i" a& j' Z0 p BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) z. l6 g' c6 s; U; e
;will break 3 times :-(3 W) b# R6 \9 e" Q/ s
" V8 S9 d! r$ `) N( l- b' N-or (a bit) faster:
% |, R+ E! a$ t1 r/ O5 i6 I BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- T$ A5 ]0 o1 y1 I! x; ^6 ?+ C4 C/ l& I8 b
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
$ u2 h! u- M; [1 ]$ N: |5 \: w. s ;will break 3 times :-(5 a B9 r/ A7 K7 E- Q! f7 i
; I" R9 Q$ f; ^2 b3 f; e
-Much faster:; C M! K* O. y" a
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' F* u& x" n; Q' W$ {, O
" K* R3 y. I& lNote also that some programs (like AZPR3.00) use de old 16-bit _lopen( A ]5 t* R- M4 a) |
function to do the same job:% t0 K; `( n# q0 B9 y3 l
" [6 j6 G- | {) O+ o }6 S push 00 ; OF_READ
: Q0 J& @+ J* x/ S6 h! ~/ I mov eax,[00656634] ; '\\.\SICE',0
2 G5 p% S) h! X. p4 U- A. E push eax6 [4 [$ \: _9 t& `9 U9 |
call KERNEL32!_lopen
& t2 L ^- Y, W; {# ? inc eax
/ ]1 D) N* |3 d: e2 }+ p4 t jnz 00650589 ; detected
" ^$ q4 [6 D" G: Y push 00 ; OF_READ# G, q4 n/ a. b; a* n7 m
mov eax,[00656638] ; '\\.\SICE'
* _" W5 y$ o" p* B3 e9 h; r push eax* Z8 Q$ W# w$ j* b) [! y4 T
call KERNEL32!_lopen
9 _7 x+ ~1 T* i inc eax# |+ d' J8 v7 {2 h9 J" O
jz 006505ae ; not detected
! B, `4 `' @3 L* ~ d* W6 Q7 X
) W0 V5 P, {8 o3 Y( G }/ l
" ^, R4 r) O6 A; Q* T& N& j1 V- j__________________________________________________________________________
3 Y+ |0 w3 P. C4 f6 c8 \6 |( z5 Y6 A% V! l
Method 12, J( u( }- |; ]9 O
=========% u; I7 \' } B$ X4 j J
& v3 C+ i/ X: V; uThis trick is similar to int41h/4fh Debugger installation check (code 053 V) B+ q# l* L6 w
& 06) but very limited because it's only available for Win95/98 (not NT)
: U% G8 K- T6 p1 |, Das it uses the VxDCall backdoor. This detection was found in Bleem Demo./ i( v1 `3 e4 |
$ d$ j$ n- e% g: `' z" j' ?
push 0000004fh ; function 4fh, a: h) u3 h3 w! t
push 002a002ah ; high word specifies which VxD (VWIN32)
% A0 L; t1 `+ c/ w0 T8 _ ; low word specifies which service
& x6 G* J9 G9 U, k) x) s; | (VWIN32_Int41Dispatch)9 |) K( |3 x! E6 ^) ]6 \
call Kernel32!ORD_001 ; VxdCall
/ h4 q/ N' l# a |. d cmp ax, 0f386h ; magic number returned by system debuggers7 R! T* `. c# s4 @
jz SoftICE_detected
8 U& s* ~, { c0 n: J% [4 O# T# a8 }9 S+ }
Here again, several ways to detect it:! Q$ R, Y- k( O! a o) u
4 C: M2 B* o# w0 K& x5 a
BPINT 41 if ax==4f
6 r" A2 ]3 E9 f2 @8 n9 \
! P3 u. u: x+ @8 |* Y$ S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one6 p6 W- d7 N3 o' G+ P9 v: I) E
4 m6 W, M" {4 e6 ?" z' q2 G. _ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A7 t; B4 _) _: x
( c. x9 }# Z! o6 o1 b0 }. W+ J BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
5 R% y0 O+ O, U8 @
8 W4 x c y) r__________________________________________________________________________0 J- R' G Y3 Y) c
% Q- N" ]) Z0 _
Method 139 \* p) U6 r! v) \0 W: u9 y
=========8 c7 D; z% i. F' k) e3 Y
; \2 t7 S+ ~ Y: e7 E' {) i
Not a real method of detection, but a good way to know if SoftICE is& m- N: o# r3 D: p: X2 O, s
installed on a computer and to locate its installation directory.
; U0 j" Z; ~5 S7 h. }" OIt is used by few softs which access the following registry keys (usually #2) :
7 K( |4 S$ q( q, u5 W1 G/ W
& v8 x1 C& `4 Q5 V* P) l7 W* @& q-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 ^9 `/ ]+ i; [( c$ O% B/ o% A
\Uninstall\SoftICE
$ t0 B+ a% S, ?0 R! p' X-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. l- f! T8 Y& L( \: O3 g
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 F$ q* }! _) a6 K! w\App Paths\Loader32.Exe- P6 K! C: G9 e6 J. U. l" N0 l
1 a w4 S' n f8 v' I. S2 {/ U: y; j, b. C1 M
Note that some nasty apps could then erase all files from SoftICE directory3 ~- _) @9 o# n( h' |8 h! }
(I faced that once :-(
0 x5 j3 y- B! O* n; F' B4 [
% A4 h- h: M, {9 AUseful breakpoint to detect it:% x' Z2 w, K$ z- ^* i! s! V9 s3 B
$ p/ i6 f. ]6 e. m; l* Z
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'& e6 `0 t/ g. J X0 w
4 f# F' z' n I' A
__________________________________________________________________________" ?7 ^/ i6 E& S' I
' z: m) p) H1 E' W4 q
# c+ z) v2 w/ X5 y; m! }Method 14
) r6 K% C6 c- O0 `2 D=========5 r% G, v: ^) q# X( ?
6 }3 @7 Z) H/ D9 SA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ L2 v3 K9 F& x9 U" t" p
is to determines whether a debugger is running on your system (ring0 only).
+ d* O/ W2 Y+ ]4 D8 g2 E* _3 G( X; X# l' r. ` ]2 F& ]
VMMCall Test_Debug_Installed& o4 N+ w# O. `5 q, W: u
je not_installed
+ ^: u7 S5 h' y2 ~
7 o$ {* d9 F+ X* T# OThis service just checks a flag./ N2 b$ ?# }5 b
</PRE></TD></TR></TBODY></TABLE> |