<TABLE width=500>2 g7 D) |9 k. y
<TBODY>4 e* F# i8 d8 @7 \% A
<TR>& P$ ^1 w1 s, A
<TD><PRE>Method 01
; d V; o1 C) y8 s2 o=========9 D) I2 t: n1 p8 q6 n8 T0 p
# R2 M9 t) @% d& h$ hThis method of detection of SoftICE (as well as the following one) is
& A! A: y/ \1 `& o! @& m P% yused by the majority of packers/encryptors found on Internet.
. a0 n# {2 o7 fIt seeks the signature of BoundsChecker in SoftICE* D- U" t5 Z W4 E2 H% W
. y4 m t# B' v( U1 _/ t. ^
mov ebp, 04243484Bh ; 'BCHK'
. `+ ^4 T) d4 f) O1 k mov ax, 04h, R" K1 k9 a- P' c
int 3
( s1 t4 ^: C, \ cmp al,4& N! d1 U: g5 v
jnz SoftICE_Detected7 r& _! [( X# I2 T
- {' q) ]3 _! s7 f- [" |6 q
___________________________________________________________________________
4 K4 h) t! a: g; l
9 A7 d v, H1 y" ~Method 02
0 [6 ]9 ?4 ]& j% o4 [6 J=========
& E# n+ Q3 k7 {7 ?0 N# t; _* l# O5 g' t- r9 \$ G7 u
Still a method very much used (perhaps the most frequent one). It is used
- w. Y8 O4 z3 r0 A3 R% T4 P3 Ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,) x3 L1 B" Y& K s6 ]
or execute SoftICE commands.... S" z% ~$ O* @1 J
It is also used to crash SoftICE and to force it to execute any commands
4 b" I+ ?8 p" O2 m5 y(HBOOT...) :-((
6 @8 T/ O" H _$ G
7 K$ U5 T2 G! G5 O/ _ MHere is a quick description:9 {: Y4 h8 r/ t0 X% R
-AX = 0910h (Display string in SIce windows)' k( b' M9 H; @* q* _+ F
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
4 ~3 [! C0 X# ~3 H& D7 z5 ]# q-AX = 0912h (Get breakpoint infos)- M" `% ^% x, F$ P
-AX = 0913h (Set Sice breakpoints)
8 m. K( m- a, p0 V-AX = 0914h (Remove SIce breakoints)$ H( l: W. f- X/ J5 j
( j& ]* f, u3 r2 p. kEach time you'll meet this trick, you'll see:
* Q* F( h2 s3 p8 a& M$ T: z; w& c-SI = 4647h8 a6 C/ d7 }; ^7 r/ m
-DI = 4A4Dh
9 Z) c9 r+ Y6 Q; MWhich are the 'magic values' used by SoftIce.
2 ^- L8 n; Q" ]: i7 l/ j7 dFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 w: J0 N! h) R( K/ k( m
' K4 j! G6 J4 u7 f2 THere is one example from the file "Haspinst.exe" which is the dongle HASP+ W; `" T( R: R3 I) F. Y3 }
Envelope utility use to protect DOS applications:
7 a" f. h9 u2 s, C: |. ?) T1 k$ {+ m
! r3 V3 j) n2 R: l* }! ~4C19:0095 MOV AX,0911 ; execute command.
0 ~- G w( c0 c5 S% e4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).8 F1 o; j0 n$ u0 O( Y
4C19:009A MOV SI,4647 ; 1st magic value.
$ Y2 W" g& f4 ^7 O0 O4C19:009D MOV DI,4A4D ; 2nd magic value.
, Y' J' t# q/ ?7 A0 `# r4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
" U4 J* A# D* S1 x4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute6 p9 \- w% Q. t ^: |, O
4C19:00A4 INC CX4 J3 k) N8 W+ _- K/ V( r
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute) }4 R9 S7 @& E* F, \+ F
4C19:00A8 JB 0095 ; 6 different commands.) k9 V7 z) B& J% _: { G' W% [
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ H# G$ O% P" b5 l4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ j' L5 R- \' Y q# R* J% f# Z/ [6 b
+ d3 L+ y2 f+ v' I1 `The program will execute 6 different SIce commands located at ds:dx, which; S) F# q7 d, ?+ K% X4 J
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# H1 T' E& j. v; |3 U
6 H2 Z3 j a# b8 E: L' Y" n* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ {8 A( g6 w4 e
___________________________________________________________________________
8 _7 d1 W) Y# T' V. j7 u
! L: X; b: h: A3 K
4 Z& [1 p& b$ T4 n6 qMethod 03) h3 D( ]4 \1 |: P4 c" h" K9 y' B- Z
=========
3 g! p; _+ ]+ m* i( G* k. ?: J) ]2 m& F) V/ b4 _
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 _. \4 j% j7 s+ v# [1 k" _
(API Get entry point)
. o, C% j, k9 ?! ~ " H: y- c0 `/ M4 W
# Q: \( \) b$ N- D+ i4 [ xor di,di) K. B0 X' [( o' e) M/ A3 L
mov es,di2 \; O( R. Y& p+ N1 ]
mov ax, 1684h 0 d Y. u" O, J0 o2 c, P
mov bx, 0202h ; VxD ID of winice$ c( P- ~( Y5 b5 }3 K9 ]$ K# d9 n
int 2Fh
% q0 L6 L& p* ]% p& A: l) x mov ax, es ; ES:DI -> VxD API entry point4 o9 c. l; B1 X$ ?
add ax, di
- Y! E! x5 @4 `/ @" U1 L# y test ax,ax
/ [, Z- ?& w }/ T' L2 z/ I2 |; Q6 J jnz SoftICE_Detected* r# A% g5 z" L
* K I- h h! ~; A2 @& z
___________________________________________________________________________
: G, U( m" G, H& B- P* Y1 P& A7 b" i5 s+ o) V
Method 04
9 e7 y# I9 l' y5 d" C=========
" Z- G. \/ s3 J" ^
6 u# j+ j w! b& y7 EMethod identical to the preceding one except that it seeks the ID of SoftICE8 }" U% x$ N0 R2 }6 w5 t" y
GFX VxD.
1 ]3 \1 m) J) R9 a! f/ t: N
8 Y0 {& N5 I: c( ^ xor di,di
, A( p+ g7 j8 N2 C% k mov es,di
( ?( e0 P, S; @% i mov ax, 1684h 5 K: R L% \0 Y R1 e& e/ R
mov bx, 7a5Fh ; VxD ID of SIWVID% N/ d/ p) R/ j( O# i
int 2fh
; w% t3 Q# L; U+ ]* N8 F mov ax, es ; ES:DI -> VxD API entry point# Q# @/ i" e/ K1 p* x z
add ax, di0 ]$ V: C- p) r( A) Q3 t
test ax,ax% F" p3 v2 R' H5 p/ R3 t
jnz SoftICE_Detected
. ?3 {' N. v: E, ?1 f9 B! c, J' V8 G0 k/ s5 D( q8 i
__________________________________________________________________________
1 U' I5 Q- i$ ^+ T5 q L3 w
% e# @/ X, R" Q- x( ~7 ^
: W* m! R# w8 u8 O' s3 sMethod 05! ]) ~0 h# {% k! @% {) S; N
=========
! C0 _! P1 a/ @" v/ L* H0 \ z6 D9 {$ J$ n9 f
Method seeking the 'magic number' 0F386h returned (in ax) by all system
+ b+ R/ O2 @$ f/ O0 H/ P: c' Zdebugger. It calls the int 41h, function 4Fh.
6 ]% {7 f) m# W( h; vThere are several alternatives.
5 ]2 t& G- N) O$ l: c% v5 M) D1 I1 l$ ?3 n6 V
The following one is the simplest:. v; h/ w% i3 U, B
6 w! d# S3 ]9 d6 d$ O mov ax,4fh
: D! o2 q! [7 c$ G int 41h
, C" R3 ?9 ? G! w% G cmp ax, 0F386+ u: M# ~+ y9 k. P
jz SoftICE_detected
- B. n( i; N9 T" s2 P4 L. o9 q/ m5 D
( e, O5 `) L2 j) B7 Y/ L* I6 s# S
6 T0 Z; _' a2 c& a( B3 vNext method as well as the following one are 2 examples from Stone's
4 {! s8 d" U3 P( P: ^( v"stn-wid.zip" (www.cracking.net):
$ t" i6 U5 e/ ~5 h; I# h) z8 _( P8 h( o9 _! j' e
mov bx, cs
$ G- P% t0 k6 O lea dx, int41handler2
6 E' S! W" P0 F- x4 c* @ xchg dx, es:[41h*4]7 X9 |1 y2 X$ P7 Z- a) |# ^7 @( o
xchg bx, es:[41h*4+2]
0 t' ~; T2 o, E0 X1 G mov ax,4fh2 h# P2 G+ s$ J0 c
int 41h
$ |' j* \$ u" J, `$ Z+ @/ o% }6 s xchg dx, es:[41h*4]6 f2 @7 g! C. |- {# R: M$ M
xchg bx, es:[41h*4+2]0 T+ G$ n7 j9 e! H& `
cmp ax, 0f386h; u& O, y4 T) _7 a9 q1 m, c9 C
jz SoftICE_detected; x, d- c' z) t4 D( P8 R, |
4 |, H3 D& N- K0 k
int41handler2 PROC( s$ _2 X0 h) @8 X. R" b7 B- _
iret
" n& r9 L# Z: h/ O) Y* Pint41handler2 ENDP& }3 |* D5 r! P; o* ~
/ Z0 y7 n& ^8 Q& i" v' e
) _- e0 w- ^# q% u_________________________________________________________________________3 h3 e7 x) A2 ?9 t4 q( {2 R/ `7 T
, ]. k# e, }0 t0 K" j: w3 A1 A# o/ x: h! n
Method 069 L$ r% Z$ B3 U8 J& Y2 }- H
=========" s7 j7 ]! @# A
& q. c: ?% b I; f# Q; R
$ U9 J3 e' m7 k9 l' T0 Q: z6 x2 j
2nd method similar to the preceding one but more difficult to detect:2 n) e3 A! r& W2 D/ r1 r/ @" E
$ M j" ~, p) C4 v: \" p# O+ ^# Y. J+ o; S0 V/ a# ], Y' i! R
int41handler PROC1 u1 [& F% y3 j6 T8 ?/ m! O7 P2 S
mov cl,al( U7 W) U* W: \6 o. g) Z4 P0 n% `6 @# j
iret2 K9 _$ J" x) f9 A0 r1 c( w+ C+ C
int41handler ENDP. V8 p: \. Y# m5 a
/ O+ Q' X& G- _$ W" {) h; c; T
' S. X/ \% P8 j
xor ax,ax
" M- k5 q! S3 b' v1 I mov es,ax
9 F& ~4 L5 s" A4 H! L8 M$ ~. Y mov bx, cs" |/ U, D; f6 b9 r( b+ d9 Z
lea dx, int41handler
/ P3 ]. I" e) |7 I3 d xchg dx, es:[41h*4]
, n: w3 q* M8 A# _. a: ]' h xchg bx, es:[41h*4+2]
+ E; d R0 f) D; D in al, 40h
3 J& j7 Z5 r$ R+ X" y xor cx,cx
# m0 |: K! g5 }+ j int 41h- Q: {+ i4 l% c2 Q4 Y
xchg dx, es:[41h*4]
* }+ u8 _# A* L5 S' v" G xchg bx, es:[41h*4+2]% H: K! b; J0 @. N" @
cmp cl,al
1 [$ R! w/ n# C( J4 T5 \ jnz SoftICE_detected
0 D* J5 @: c$ c4 u2 I3 W$ |. ]8 h1 r( z9 N( Z7 h, Y+ L6 Z
_________________________________________________________________________+ R* ^6 c3 f7 c% w. [5 u; F
$ R( B4 @4 F" _6 Y
Method 07, U; m8 u- Z2 e, d
=========
9 w3 S3 P. b) Y5 z% d$ O. m3 E3 o! G0 y: ]3 G4 S
Method of detection of the WinICE handler in the int68h (V86)
7 J9 I5 r2 F; R8 n( ^: L) ]5 g
B- ]/ {8 v3 y8 u. ?; T! [5 S mov ah,43h
^" C0 Z5 q, u. p1 |. ~, X int 68h
& R& a8 T' @! V cmp ax,0F386h4 W1 p; h Y/ E1 g+ p6 C
jz SoftICE_Detected* j& K2 W* E) r- F4 h F! ^
- a# V" G8 P7 I/ z& F7 Z; I( |# Z0 `2 O/ a/ r- s S
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ j+ A: @. s7 @7 F! ]' d* V) b app like this:9 r1 ~; d2 D; C4 v2 K( p7 g! T5 U
" S5 {6 p6 r( v$ ?
BPX exec_int if ax==68
& R' Z. E; \$ V; `3 }7 X. U (function called is located at byte ptr [ebp+1Dh] and client eip is
5 o; @" ]# [, q located at [ebp+48h] for 32Bit apps)8 I0 E* J+ h5 Y) l
__________________________________________________________________________+ K% t8 K) J. I& Z
, M: h# w: }+ J! u* L
' M# T# O# u$ Y
Method 08
6 ^/ h2 H& ~/ b% e1 l5 ]0 ?+ E=========# h2 z' k- ~; g& N% w# Z, _
9 ]" R' l4 i+ E& C. a/ {It is not a method of detection of SoftICE but a possibility to crash the
* E. i' [; b3 w! M0 ssystem by intercepting int 01h and int 03h and redirecting them to another# c( r# z( c7 C- o3 ]
routine.! X2 e! W: N2 n: x) Y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 j' R" R! _' Y1 Z6 G) r
to the new routine to execute (hangs computer...)
2 C3 o: H* {* w
6 k; D7 C. {& l( b& W mov ah, 25h2 d9 }' g4 h9 g) J9 w% D1 d
mov al, Int_Number (01h or 03h)
1 P- s2 l/ F& i8 I& [5 ` mov dx, offset New_Int_Routine
; r6 r3 v6 N1 h# @0 J. j int 21h
+ r( w# y# @9 C, z4 e
" ?" A' F# L3 ]' P4 e__________________________________________________________________________
Q1 a) L, D e" P9 u9 ` X! k5 Z9 C6 x6 \' V0 q
Method 09
, C9 U/ y9 k4 `, Z5 E% v=========( C- J) L7 k. {
2 u7 h) O$ ]) K
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ }, F" Q" V7 h9 K8 a {( o9 j$ lperformed in ring0 (VxD or a ring3 app using the VxdCall).* d( @: b ~1 \" r
The Get_DDB service is used to determine whether or not a VxD is installed
. d/ P3 |" y0 ]for the specified device and returns a Device Description Block (in ecx) for
4 A5 g: [. C+ L, I9 }that device if it is installed.
& ~) R0 k i0 g7 E+ f8 t$ d8 b- F8 \! H: m
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# B, I3 }7 n, y; q7 h mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-) w5 C2 h& z+ w: m6 S* F! L
VMMCall Get_DDB* U6 C' c+ G4 C Z
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed4 `( i2 L) r) v8 ^9 L0 `4 a
# L# v8 o3 k5 S5 @" J- @
Note as well that you can easily detect this method with SoftICE:7 X' Y1 ^8 F% {
bpx Get_DDB if ax==0202 || ax==7a5fh
+ ~9 y$ d# T- X+ z6 R' A
; l2 E3 R; G* I- C. M! t; s/ \__________________________________________________________________________
' l: X4 M v; u
7 l0 d8 h9 t* ~3 r3 [Method 10
n) S3 L: g) G |, _; K6 z=========
( O. }9 P; O2 d! j0 G1 o/ d/ \' C1 J+ I3 t& x+ }( P; B
=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 O4 d$ X8 t* F6 @, J% ~# e SoftICE while the option is enable!!
& u# N, _. X! S; G7 J! M4 D+ D+ x( T: W0 ]/ \, U' h" Y' U
This trick is very efficient:
! I3 Q" C p1 ^7 a. c$ ]. n5 i! @2 ^by checking the Debug Registers, you can detect if SoftICE is loaded0 `6 G0 O3 y5 R: `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if# C0 T- U* y Z4 T6 c0 U
there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 H. Q" Y' ~. rvalue (in ring0 only). Values can be manipulated and or changed as well9 R' }* Y1 r' a0 u
(clearing BPMs for instance)
0 K% R1 v+ e! ^$ {/ h% G/ I% @* b9 e: r* Y" r2 Y2 f- t9 `2 r
__________________________________________________________________________' N7 ]3 S- F& V8 \ E ]) O
0 t9 B1 n G/ p, ~Method 11 |0 L) j3 X( O
=========! b+ i+ L) @/ P7 p$ f( ^- P: Q
# X: q2 `7 o' ?8 p7 Y
This method is most known as 'MeltICE' because it has been freely distributed
; ? x" X6 O" X/ Avia www.winfiles.com. However it was first used by NuMega people to allow
1 p7 Y0 _; [; F; q- }Symbol Loader to check if SoftICE was active or not (the code is located B# B$ J, H7 ]- g$ L2 Q5 e
inside nmtrans.dll).
/ l( n* [3 m6 k' z* `; y/ o
; E9 w( I- `5 s5 _; }The way it works is very simple: _: Y) Y' e! d1 |4 ?; ?6 k
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
4 @5 p. S' k% C( N/ AWinNT) with the CreateFileA API.
6 Z) u3 i" ?7 o
8 O. ^- c& m: g' w; C! zHere is a sample (checking for 'SICE'):
+ I& ]+ j" B0 R
" J! p5 S. O3 R2 zBOOL IsSoftIce95Loaded()$ |3 {1 h3 j" h' \6 j( f* G3 C; a. W
{
8 s( F* }! Q2 @8 L HANDLE hFile; # ^2 T7 A3 a" H- E( ^4 L1 E
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; U; Y9 V0 k' d
FILE_SHARE_READ | FILE_SHARE_WRITE,
, C- u# P6 g7 W+ }; n NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, N% k* @2 k5 a6 O# z9 j6 z
if( hFile != INVALID_HANDLE_VALUE )
+ ?/ Z5 |% G- \! G% M# b& [" | {, D4 C5 Y5 w/ z/ |7 p1 @6 q4 y0 s. y) b
CloseHandle(hFile);
+ }' ?6 f0 B0 F3 \- R5 ~ return TRUE;! x/ c; n: V( c* B9 ^
}
" D+ k5 o- N+ H2 H; o2 K return FALSE;% }6 C9 ~9 [. L# t% a N
}3 i% O4 o/ k9 S+ k1 _/ P8 H( K1 ]
9 Z; w. _* [, v% OAlthough this trick calls the CreateFileA function, don't even expect to be
" A$ I# }. e& Sable to intercept it by installing a IFS hook: it will not work, no way!
" {4 {% U, h7 |; VIn fact, after the call to CreateFileA it will get through VWIN32 0x001F+ ]. j* ]$ B; S- C
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! r6 M& @- w! T& G
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; X# G" k( q* O% ffield.
2 I6 v$ \" I: \: A7 o8 ZIn fact, its purpose is not to load/unload VxDs but only to send a ! G7 e9 H0 W4 y0 j: R! A/ i# r
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
% x7 ?2 L! I- ^) W& \. t B6 Vto the VxD Control_Dispatch proc (how the hell a shareware soft could try9 S+ y2 b8 N3 @1 ~4 M
to load/unload a non-dynamically loadable driver such as SoftICE ;-).7 S8 w+ H. N1 O# p: H7 \* V
If the VxD is loaded, it will always clear eax and the Carry flag to allow
% a6 x: X* U4 W2 ?* kits handle to be opened and then, will be detected.# c1 Q2 D0 }0 l7 D. s
You can check that simply by hooking Winice.exe control proc entry point& d; B2 l. V# F0 \( ]; S2 g5 U9 g
while running MeltICE.
5 W& H, ]& C# E3 i0 {% l) n) F; `5 E( S2 _% T2 H: j3 l' v
, L9 B6 f' g' ?
00401067: push 00402025 ; \\.\SICE4 `& Q, a3 C, E# {
0040106C: call CreateFileA
* t* _. m. v0 N/ ]2 N7 U$ l, P 00401071: cmp eax,-001
' t0 v) d/ T3 f* o) V( F 00401074: je 004010918 M: _3 }% e1 w- R1 @" j6 |( A5 D
: G$ B8 I3 F6 |5 s4 k7 ]* \" T' {# C+ l0 c2 T5 g
There could be hundreds of BPX you could use to detect this trick.0 X4 W5 x! e8 |3 w! e
-The most classical one is:
' u- A( W1 T' [ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 b# c7 S/ l4 c/ l: B8 |, D4 o
*(esp->4+4)=='NTIC'
& \# f( W( {8 Z( G, M1 P; O) l
G( V) h; [) O3 ~2 x-The most exotic ones (could be very slooooow :-(
* q: F/ O: k! ]) h; E BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" n0 C) Q6 u8 O2 j+ x ;will break 3 times :-( I2 W4 \" M' {9 N7 L; t
$ F* y8 i- S5 ]* i j, I
-or (a bit) faster:
, m* y5 j: ]2 N+ X BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 T2 k( q7 ^3 i$ g
0 g9 b& x& z- L8 b
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
2 k/ Z; k' s* v& ?4 [ ;will break 3 times :-(2 {6 i( n- `; l8 H" b" z7 s& P6 x) @7 @
1 b% R2 h4 ~( ~& {& w, k8 p: k; X-Much faster:+ p( Q% u" j- n0 f4 E
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
/ R6 M# c8 _2 j. W, A/ _
& e) G0 r- V4 jNote also that some programs (like AZPR3.00) use de old 16-bit _lopen( S0 D6 q% p8 E4 d: X+ z8 C
function to do the same job:, A* W8 `9 r3 y" l4 ~/ V) H
$ H0 O8 U& I8 {. @. s' b! e
push 00 ; OF_READ
" }9 R4 t# R( H% S: m0 P% m- ^ mov eax,[00656634] ; '\\.\SICE',0
* t# n$ A% r' [# d3 v push eax
6 K+ S9 t& Z/ S3 N# M( `4 O call KERNEL32!_lopen3 y9 `& M+ ]/ w# L
inc eax
% D/ P7 T, }$ B6 u: O! b; y jnz 00650589 ; detected/ a+ V: e+ s+ J: t5 |: C: ~
push 00 ; OF_READ$ J5 N4 V9 @0 H* a% O9 [
mov eax,[00656638] ; '\\.\SICE'
' t% Y) t8 X- Q' U; m push eax u+ Q4 \; M; C* X* j
call KERNEL32!_lopen
0 y8 T. n# H' O0 s8 X. T# w7 P inc eax
3 m: [! P4 l5 l, V3 Q jz 006505ae ; not detected1 K. R4 v8 w( i1 W7 Y, @
6 N* R: c- Y. i7 j; D; o/ C+ R
8 `& ], d- d. R, j__________________________________________________________________________' f H) I6 x: d* X H) D
. L/ g) c; P7 Z7 b8 ?
Method 121 L8 h V" [( u8 C2 j9 Q7 l8 d
=========
7 Z- z9 @" ~. a0 v) `# _4 L, t
) u7 G+ p. j; f% x* u0 XThis trick is similar to int41h/4fh Debugger installation check (code 05
- b4 ^& r8 {7 M8 K- G( z& R" X" K& 06) but very limited because it's only available for Win95/98 (not NT)/ L# K" [+ c8 b' h8 |! T
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 j' @$ E3 D# W- R, [( r
/ o% [1 y& Z) }" L0 J push 0000004fh ; function 4fh
" j* u( K! ?3 F, J% T8 h push 002a002ah ; high word specifies which VxD (VWIN32)
R0 y# z" F/ L( P9 H' | ; low word specifies which service
. y( N* d- l1 v* a (VWIN32_Int41Dispatch)9 w. |! m9 y5 B( u9 I2 j
call Kernel32!ORD_001 ; VxdCall
0 \! X) L; k- @1 w3 g; i6 A8 E# E cmp ax, 0f386h ; magic number returned by system debuggers# i. i0 u! e0 j; [& [/ T6 L
jz SoftICE_detected1 x2 H4 f4 g& J w4 L6 u/ B' I, R
# x7 M8 v5 w) L3 r# c# R+ S
Here again, several ways to detect it:
- i" W; n( r7 ]2 \" F/ @8 H1 l& r7 y
BPINT 41 if ax==4f
! F% }" d( J" c" R: A0 A
5 h0 ?) @: s8 q& }. r; u& S: I; S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
1 x0 v* V! A$ a' c! n
& {2 h4 B1 B8 L7 u! u BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A1 k+ H" K6 [3 ]: Z
3 ]1 u% s) _9 X/ e BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) e4 H, `0 f( O- E
* ?3 W% b- v" O__________________________________________________________________________& y, K; ^# b0 A& e! f m+ r
0 M- N q6 z# w! ?
Method 13
5 m2 h* O) H: m, N9 x4 v=========
. C! G3 ^/ g! ?& V+ r: e/ x
. _ h" Z% _. H1 v+ M: U, c# CNot a real method of detection, but a good way to know if SoftICE is
$ ?. _( j9 @- j; G7 D& Einstalled on a computer and to locate its installation directory.) ?9 Y [" j N9 [
It is used by few softs which access the following registry keys (usually #2) :
5 V5 {- N; X l# d+ V
- L' `1 B/ u% `/ P9 T! ^: B5 M1 O/ v-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" ~$ q) w2 O' V$ d; o2 K- L
\Uninstall\SoftICE
7 Y: E( g2 i d, }4 k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE b+ _- |8 G& g
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- E$ F# i4 w8 m& V! |\App Paths\Loader32.Exe
4 v" t1 z ~4 X: m3 p/ R6 [9 o7 Y- m- b
4 B5 o/ Y. U5 BNote that some nasty apps could then erase all files from SoftICE directory# a8 v) X2 M( y* J
(I faced that once :-(
. Y Z$ h: A5 F" z4 h0 I( p) R
! R* x' H; }. ~5 X4 g! IUseful breakpoint to detect it:/ Z$ h5 O8 a: K3 Z% w' M& a1 ?
5 I* V) ]' X; Y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
' B% \( P. c9 \) y) l( c( O+ R/ a- L! E: h+ w/ p$ v/ q
__________________________________________________________________________+ j K' ]. t' e4 u
& a- Q) s* Q+ u% |5 |- D
% i4 t5 U' t, R: }
Method 14
. y9 S# |2 g9 h8 `' n' O' K=========
/ M" o( D$ U: V7 B6 ^6 h2 ?
3 A- r# a5 d* e1 y4 hA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& Z8 U! i, X$ o' i/ M
is to determines whether a debugger is running on your system (ring0 only).
" C W* \& y; T# Q. [: P2 e- d3 V! D* t5 p" d
VMMCall Test_Debug_Installed- j! R% j, @) S
je not_installed
! C; W9 ~" p& }- Y1 @# _
! j, v) F) f1 E% i7 l) HThis service just checks a flag.
+ ]& ^9 o5 t' K3 M+ D- D</PRE></TD></TR></TBODY></TABLE> |