<TABLE width=500>
; ?6 z$ m5 m9 P8 Q- E c<TBODY>: R \+ |/ X; K& h/ a/ u
<TR>
6 p, X0 x' W5 r$ W<TD><PRE>Method 01
& Q- e, l+ B A0 y4 |# @" F5 x=========. ^& }$ D% |" k2 ?1 i0 k% d: F
' J0 V- P0 [, |$ W- gThis method of detection of SoftICE (as well as the following one) is2 W( `7 i2 x9 u& C/ `- Q
used by the majority of packers/encryptors found on Internet.
& X% X& e9 g0 M* J$ M: mIt seeks the signature of BoundsChecker in SoftICE0 U) t% g1 ?( s$ z
& O% e: M5 k5 {' x* Y! n9 x mov ebp, 04243484Bh ; 'BCHK'5 Z9 i1 Y3 I& l4 G/ A
mov ax, 04h$ w; r9 a, K- m; |; x7 A: y( X
int 3
1 E2 u$ ^8 a7 |. o1 S6 s& l cmp al,4
1 e" q* n, @2 A0 c5 d/ V jnz SoftICE_Detected4 D" I. b# y1 i
( f. `- O# w1 m' b3 y" a# A* A* o
___________________________________________________________________________
# B& C6 T. _5 z s. ~( z- L) `9 w& z! z5 G- _
Method 021 h# }9 D9 l& s6 a. E
=========
+ ^ M/ \3 b; q/ j" d
& c" L+ Y5 c3 ?$ MStill a method very much used (perhaps the most frequent one). It is used+ b: S: d7 S7 H$ W, v! n0 S: m
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 Q" {: L# z: x% V$ H
or execute SoftICE commands...& X& K7 e3 W- u7 l8 a( J5 A
It is also used to crash SoftICE and to force it to execute any commands. {! \' s9 ^8 s
(HBOOT...) :-(( # \+ n) m1 q) `" I
+ K2 d8 t( M- C v3 q' w! X( j
Here is a quick description:
9 J2 Z1 o/ e' F4 }, {/ X& \-AX = 0910h (Display string in SIce windows)2 J3 m B3 E5 u2 b% r
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 X7 e1 B2 t+ t; l1 Q, j, ^-AX = 0912h (Get breakpoint infos)
a2 R0 i8 K6 z0 i! u( j0 v-AX = 0913h (Set Sice breakpoints)8 g% @, V" H$ Y l: i: Z5 p& z! ?! R H
-AX = 0914h (Remove SIce breakoints)
}" j! L! ]* `* S: T% v; f7 j8 v0 |, f$ ^
Each time you'll meet this trick, you'll see:
# Z6 x+ u- j0 H-SI = 4647h
0 s2 l4 B8 {# P# M% m5 ~# u-DI = 4A4Dh
1 S# C4 @" c: KWhich are the 'magic values' used by SoftIce.! O- Q( I3 B; L* f6 Y) S* q- Y
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.; H* C: j8 l) T6 Y0 ]
3 M) Q* R" L# L, y. h6 h
Here is one example from the file "Haspinst.exe" which is the dongle HASP: X% Y: l* d6 t) s+ Q
Envelope utility use to protect DOS applications:8 M0 ]' b% X! K: `% ]# |/ y# @
- q% |3 v" v# i% }: s
+ R. H. [5 [5 J
4C19:0095 MOV AX,0911 ; execute command.
' K7 s3 d+ c7 P, @4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 f3 ]4 g9 N' F+ W4 V2 `. U# X+ w( Q4C19:009A MOV SI,4647 ; 1st magic value.
, H; w! V1 [# T9 A; F$ X/ ]* U4C19:009D MOV DI,4A4D ; 2nd magic value.
1 ~3 k1 [2 }& J7 c8 j' F9 K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( H: e! |$ Y& j. ]0 L4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. a( q6 W \% ^! c
4C19:00A4 INC CX" q1 C g' l5 @) C. f" E4 V
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
! W: J( y0 s- s" `! n4C19:00A8 JB 0095 ; 6 different commands.9 d9 I# b2 I `0 G" V: ^# [ t
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! u( n3 T2 x, {8 E1 i; C4C19:00AD MOV BX,SP ; Good_Guy go ahead :)3 g c" X1 y; T3 B9 u
. \4 z) _& u9 O- h7 c
The program will execute 6 different SIce commands located at ds:dx, which
% p2 m( g' }9 ^. ^' Q4 ~are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" O! u7 d3 F' Q& W( m% D
. K6 a, t2 N; | U' H4 ~* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 |7 C& R# c4 {( \" o0 h9 V
___________________________________________________________________________
8 `( z) I0 `" |, c6 U
( I+ W6 K0 E* G( F4 [5 R8 }
% V0 I& u& j$ R. O/ t- b# V1 bMethod 03% L# U5 l! Y- C. q. Y0 v/ f+ R: @# s, m
=========
% r. R9 i" i- f9 y& _7 R' Y; W4 I% t' j' R9 `& e
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- R4 L# p6 ^. G% a- Y+ h- y5 \
(API Get entry point)
* G/ {$ s, L" D0 ^ 9 `8 Y( t, u- g& L4 k" z7 Y% \ \- D# r
! Q% M' ~7 i- a" r8 k% b5 b
xor di,di
9 Z9 a4 \" Y: P mov es,di7 @& ?% V# E4 ?/ X
mov ax, 1684h 1 @; ?( q. k) h
mov bx, 0202h ; VxD ID of winice
5 q% _7 q& a2 Z" e z! x int 2Fh; K' J) d3 z1 Z' ~3 y
mov ax, es ; ES:DI -> VxD API entry point: m% ~) Q; B7 p: U5 P& @
add ax, di( `; c6 B, Z0 O: `+ z2 Y/ p
test ax,ax
+ A1 `* M3 L& _7 o! a% v jnz SoftICE_Detected0 m+ i* E8 J# P) y! `# p5 E$ q
# ?1 n/ c. T L! X# |; v4 m6 v
___________________________________________________________________________
* s2 X7 r! ~: y7 Z3 X' R5 ?
0 _( b( k1 q% s/ g8 DMethod 04; F( M% X$ A/ F8 z4 s/ c
=========& a! a0 e- V6 ^% c! v# W6 k; o
a2 I+ h8 V$ q; {' i2 ?
Method identical to the preceding one except that it seeks the ID of SoftICE
! t/ T" J" {1 HGFX VxD." J# i. v' R8 U
0 j( X/ D2 E7 D) ?5 P xor di,di$ P6 ~: O5 j3 _% e% P' s
mov es,di
* M) [* {/ c2 m. i+ l8 J L; @- l mov ax, 1684h
4 j3 F5 v% V' Y, _0 q( P mov bx, 7a5Fh ; VxD ID of SIWVID9 h7 o: a) q7 ~$ k U& k: a) Y
int 2fh
7 q* q% M8 k. a5 Y" u6 [( V mov ax, es ; ES:DI -> VxD API entry point0 h% e. ?, x6 Q T
add ax, di
]3 L0 c, T6 q8 G1 j test ax,ax
0 n/ C4 Q1 O* L) T9 L; j jnz SoftICE_Detected
C8 c7 v8 w) b. k6 s6 `! D7 ^
) m& c" e9 h4 v3 J# E__________________________________________________________________________ {- D: s2 d% A0 r
2 B4 E: ^4 P3 o3 f
/ c. P2 g; z( g7 ~Method 05- b0 f- T1 U* E' }
=========
/ j5 O. s7 W" U& k0 B6 e* [) u8 r# L. W6 O1 ?
Method seeking the 'magic number' 0F386h returned (in ax) by all system& [/ ?' P- q8 b. C
debugger. It calls the int 41h, function 4Fh.+ y% Z& A* T7 _* j/ Z T/ q# r1 k+ b
There are several alternatives. 5 g0 T( h7 i; X6 Z1 w- o# x) _
* W7 ~/ s5 z% NThe following one is the simplest:
f ~" |8 F2 @0 U( |+ ?& G; X- G! m: V1 l- [
mov ax,4fh
) M5 ]4 u( {5 Z5 }9 w int 41h& V2 i$ B' _& ~
cmp ax, 0F386) z/ k1 g- P3 Q, @3 d) D, u
jz SoftICE_detected. d; R4 W) K5 a, m/ ?& {
* U' s6 b7 y3 m3 x/ Q, J; O( B" j1 k3 d5 X4 Z4 |' G# l4 n8 b
Next method as well as the following one are 2 examples from Stone's 9 V1 K/ Z+ i! j1 {* w
"stn-wid.zip" (www.cracking.net):6 t3 Q4 L& n$ a0 m
# `: h6 f; M7 x mov bx, cs* }; Q0 }; n" b. G0 f7 s
lea dx, int41handler2- O f2 C1 e7 d1 f, l- {# c$ ?
xchg dx, es:[41h*4]4 s! T( P% H0 @1 M- e; i
xchg bx, es:[41h*4+2]) V/ F4 W: S) t" i2 W! k
mov ax,4fh
7 [; G: O! ?: U7 e; L# A int 41h0 I8 G `6 X% k& K) ~" K1 f. m6 L. p
xchg dx, es:[41h*4]! B, d% a% ?, t: u+ ~' P* @
xchg bx, es:[41h*4+2]5 z8 E( }% Y2 S! _) v9 H9 y3 n
cmp ax, 0f386h: D" A `. p& Y
jz SoftICE_detected
0 c& _5 F& a. Y7 Q
% Z9 z5 P& T6 T, t. T4 Aint41handler2 PROC
2 V3 }6 o l) y- j2 ]0 D iret
) J# |2 v8 K9 e oint41handler2 ENDP
: p% Y4 G( _6 q- @, E9 d* k8 N1 n! l# M$ ?9 }+ r4 h
5 Y8 `0 T- G1 j# S2 E! }5 l3 z_________________________________________________________________________
& M4 M; r+ _$ E; H$ T! T; L- Q H/ ~2 i! C0 ^8 _
8 `! u% a/ p; E% D! P
Method 064 ?4 a% e2 }5 k! `# A) M
=========
g% I2 {6 @. n2 P1 R7 t
2 }; |. M* r8 ?" v/ L4 Q
! `5 v/ D8 D$ V4 o$ y0 E: D6 D2nd method similar to the preceding one but more difficult to detect:
) I* |& z- O( H1 G: F) Y
! Z# ^$ ^9 y l# j& U
5 B3 N( b# d, Z$ o7 Bint41handler PROC
: U0 F \) Y5 t4 V9 N3 l: I mov cl,al2 X7 z+ _" T6 n' ?( S
iret
; t4 G2 d* D3 L% zint41handler ENDP
2 c- b. X x, S
$ r& W- g% v4 @3 z7 @; V2 [" r: \' c8 Y8 Q1 z5 n# N7 g2 y
xor ax,ax
9 A5 p! T& N$ K2 {4 l4 e5 a; g+ n% A' _ mov es,ax
4 G. E- a0 a4 k3 D- a% c, @ mov bx, cs5 s2 |: \7 t* f. m& J% T8 C9 j
lea dx, int41handler: u0 G$ i2 l+ N" }) ]
xchg dx, es:[41h*4]7 e5 u+ @4 T+ {1 h* {& \
xchg bx, es:[41h*4+2]
! ?* L# g. i+ x4 q6 `- n in al, 40h: z2 j# x7 C+ `. M
xor cx,cx" G- J, x' U) c
int 41h7 }" o- D! J4 ]
xchg dx, es:[41h*4]
( o; g4 K8 }' X3 @; k/ |% l d; J2 B xchg bx, es:[41h*4+2]
' w, J7 |1 N9 E/ h, t4 K5 h- i cmp cl,al
2 @$ A- e" G3 \: G1 R jnz SoftICE_detected
, H- x& W2 j$ T# y' P( c+ E% C
: `2 x- B3 L- ?; Y; [_________________________________________________________________________3 C( ]9 G8 g( c
8 C: I$ R% N6 E# x+ rMethod 07, d: m4 _$ v: u5 t) Q- j ?
=========6 s8 x7 A) f$ w" i
5 m5 C$ ^$ U+ X# ~Method of detection of the WinICE handler in the int68h (V86)+ C- Y1 E; J% l6 A
/ x8 C" H2 V+ N: j& D
mov ah,43h
/ K8 h$ k3 [" ]! I4 U int 68h
* g( ]$ [ N% C! d/ S! y# K8 h cmp ax,0F386h' ~2 @: f# v) e+ u
jz SoftICE_Detected. j' `, J! V5 X7 Q1 |
+ m2 x2 a: B) l# e
+ w, b" M5 l$ b5 k6 B=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit8 X" S/ ~7 @$ B4 D% Q! e% Z
app like this:! }# X8 W" B4 Q0 S# `
" `0 C3 {/ _( O2 x9 {" @/ h
BPX exec_int if ax==68+ Y& Q8 t. `& S7 p
(function called is located at byte ptr [ebp+1Dh] and client eip is# p* t4 `2 E+ P' I
located at [ebp+48h] for 32Bit apps)6 G( v0 M/ R, K: o$ v2 c! O# ?
__________________________________________________________________________
# {: e8 t ^2 ? G+ i: g% P1 y+ Q0 H' T$ H% h# v( U$ l6 v
3 l4 C, n5 x- { E! ~& W
Method 086 H( T( e0 {6 h( Z8 T$ K
=========) e6 W6 |/ S2 }( c/ W( p2 S
) ]) x4 ]( P# \) i! l- P
It is not a method of detection of SoftICE but a possibility to crash the" d3 y+ O! c, v0 P
system by intercepting int 01h and int 03h and redirecting them to another
1 F! f4 m# F& `1 N4 A: Proutine.
: p# ^% r" ^( b% L: x7 v) B' [It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( i3 e* y/ E, _. i! g2 T
to the new routine to execute (hangs computer...)
: ^8 w7 l' a6 b
! o% Z8 ^5 W P" e% h. [+ l mov ah, 25h& {( u5 w3 Z! d2 I2 j/ n
mov al, Int_Number (01h or 03h)
# v# w9 m; e/ b2 ?: f mov dx, offset New_Int_Routine5 C; u1 t m5 ^/ r8 X
int 21h/ e K: N% l" Q1 x: P4 Q
; U# f3 G8 z1 Q8 s5 y9 {6 d__________________________________________________________________________
- Q- R4 |+ p# ?2 [8 d* _1 x1 L, _* H- f3 Z
Method 09$ j8 H3 f" L% t7 T% B
=========8 X$ J0 \/ Y) a
; o5 p8 ^6 Y' F; }5 _This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ s/ ~; V0 N t8 R( |6 k. F, }performed in ring0 (VxD or a ring3 app using the VxdCall).( [' x" z7 w' {& L; `5 c! S
The Get_DDB service is used to determine whether or not a VxD is installed* e( E2 N' N7 |8 h
for the specified device and returns a Device Description Block (in ecx) for& ^; `" g. x7 r3 E$ @( k' H7 L
that device if it is installed. Y: f& Q: n% {8 G2 r& B# I
" { i- W' b3 o- D ^7 J! ~! @ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID8 u9 p/ T0 V/ x3 a, z6 Y
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 X5 b1 m7 I# K8 f }- Z' q, s2 q VMMCall Get_DDB
( @, S5 f6 C8 W, \1 [7 S) x5 K/ Y mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
) `* V& ^3 ^6 [/ J5 c5 I# ~0 u. q1 J; M5 o- H8 J
Note as well that you can easily detect this method with SoftICE:( k9 Y, m8 ?! L1 d6 d% n+ B
bpx Get_DDB if ax==0202 || ax==7a5fh5 t T0 l% O- O9 K0 \. W
3 L% t3 R* F9 `9 R8 D' ~% G
__________________________________________________________________________
# d- P# L( z! P- j0 y+ n, m* V9 R' n, h" |% W& J4 G2 l, o' W
Method 10 \( w! Y+ d8 c8 w2 {0 P
=========
. M& n5 _: A! t( T3 `3 C
0 ^; p0 \+ d9 Q/ V' d, K5 y=>Disable or clear breakpoints before using this feature. DO NOT trace with0 H: t% l4 l m3 S# H/ ` A" z
SoftICE while the option is enable!!
& W; v4 R5 N2 f" h
4 F, g8 g/ p4 ]4 KThis trick is very efficient:3 P& M" @# U8 D$ U* P
by checking the Debug Registers, you can detect if SoftICE is loaded( G; ~: Z8 m0 f$ D6 m6 [
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if$ m1 @% U4 I( h) Y
there are some memory breakpoints set (dr0 to dr3) simply by reading their
- H+ d8 l2 C) w4 [value (in ring0 only). Values can be manipulated and or changed as well; \2 p$ c8 J+ x/ l D& I
(clearing BPMs for instance)
2 @( V* Z4 l3 b# C
t" ^# {. R+ h__________________________________________________________________________' }! \6 g; g0 _4 F2 w2 ~: J
* i) L5 a5 ? S) n( zMethod 110 |+ @5 E& q, k: T( ?8 e
=========
+ K- h6 Z" L W* z" D$ w
, v# C2 }$ v4 e+ J0 ]6 v. T: s1 D6 r9 dThis method is most known as 'MeltICE' because it has been freely distributed: r0 P) B- W" E* T8 _* D7 u/ D7 V
via www.winfiles.com. However it was first used by NuMega people to allow( K8 p, B: u, f9 \) w- c0 i3 ~. O
Symbol Loader to check if SoftICE was active or not (the code is located
! z K$ h% M( p- @ oinside nmtrans.dll).
: C# J6 Z0 g# w
7 @( ?" Y6 J- Q: wThe way it works is very simple:
$ g* X5 f2 ^. W% TIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, h7 a) r- d N+ f. C) B' v0 h
WinNT) with the CreateFileA API.
% u1 F0 w/ ]; ?% c: Y+ \/ C) A4 r5 |- O3 J
Here is a sample (checking for 'SICE'):4 V5 \4 ]# H/ H0 \( I) |
1 `/ K1 ~2 I' L* n1 V7 X$ F
BOOL IsSoftIce95Loaded()4 Q, ~$ }2 q! I6 N0 E; w( _: d
{' f) m e+ p8 b8 l& d3 u# v4 P
HANDLE hFile;
7 g: _" d3 l7 h- A& \ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 O$ Q1 Q; m7 J FILE_SHARE_READ | FILE_SHARE_WRITE,. T* ]& @5 [! [# d, E C: a- I7 W Q
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 x+ D3 q( F; q" ]! d7 G0 C5 A
if( hFile != INVALID_HANDLE_VALUE )
+ Y* Y |6 _( _: g( G {6 w9 y7 Y& H- r( p+ c' [
CloseHandle(hFile);) ?) ^% N3 {, q
return TRUE;+ t8 e% p* C( ]! ~9 D! Q9 ^' }) n
}0 k }2 C. l* C P! V0 D9 D
return FALSE;
% r2 z1 ?- ^. g3 C4 D}
+ u/ O0 a; V( T; @/ r5 Z" Z2 E) }" l0 |. V
Although this trick calls the CreateFileA function, don't even expect to be
5 a6 l/ x1 \+ c! [6 r* Cable to intercept it by installing a IFS hook: it will not work, no way!" H" ~7 ^/ R' o6 _- p5 a# \
In fact, after the call to CreateFileA it will get through VWIN32 0x001F# w- ~6 D+ S; P$ G
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)" F7 V- F3 r. E( V
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 a( K7 r ~. N8 u0 `* _5 a2 `field.
. w+ [1 A" A" I7 c% F/ E5 U0 fIn fact, its purpose is not to load/unload VxDs but only to send a
6 F* @! V0 z! b# j g/ RW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 c7 R& F, x- | @; U# v/ O I G
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
. t! e8 m% q% ]6 L. c0 R( cto load/unload a non-dynamically loadable driver such as SoftICE ;-).; b7 k" @" S. g$ ` W1 m4 e* I
If the VxD is loaded, it will always clear eax and the Carry flag to allow
" \. @' z# B" N% {its handle to be opened and then, will be detected.
% V' B( O8 V' C1 E* MYou can check that simply by hooking Winice.exe control proc entry point
$ O8 C: k( p B4 Owhile running MeltICE.
, {$ m$ W! u# y4 g6 [ l* k+ t4 O' Q1 J7 i+ N! k; w' I
" }2 l2 A/ B) k, k/ q. r B 00401067: push 00402025 ; \\.\SICE3 a U9 R7 V# P
0040106C: call CreateFileA
( P4 D9 |8 U6 h 00401071: cmp eax,-001 I; @/ o% o1 L9 k4 O
00401074: je 00401091
3 p# x- ^1 s# t1 T; D+ L0 _' N2 C, W) ]/ g" ]7 F
. w4 v2 J5 P2 S; f3 G7 |# OThere could be hundreds of BPX you could use to detect this trick.
) f- A% p0 F/ Z6 p7 I-The most classical one is:3 @8 c, X5 T' E7 C
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
& Q' W. |6 J1 N, C/ F3 Z *(esp->4+4)=='NTIC'! C0 Y+ F! ^% C2 e2 @8 u. J# D# H7 t
- g5 L1 w1 Y; e, A
-The most exotic ones (could be very slooooow :-(
7 R/ w! a- W) b- d: x" | BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
; Q( y+ Q8 d, ]* `: I( j ;will break 3 times :-(
3 q8 Y" B! }. O' p, x7 B9 `9 q2 l2 k+ Z
-or (a bit) faster:
- x( k4 `8 J) V' [. n0 t* a; j BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 X; K0 S3 D1 m0 _) _. z
. ^$ G; L/ Z1 L% Y% o- p BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
5 M. x) [! ~. V1 d* r2 K6 U: |% T ;will break 3 times :-(
5 O3 j( R9 H; z$ ^8 i2 V
8 |5 k' Q9 f" b# Z* E. _-Much faster:
& C5 r, C' v" v/ D }- p4 a, _4 f BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. c8 j. u- t& x5 w( X
1 Q# F6 z2 s8 t2 pNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
. \# a3 ~$ I2 r0 Wfunction to do the same job:$ m; u" r: {7 w ?
/ K7 V4 u, a6 U, o) ^ push 00 ; OF_READ+ f' R0 w# X5 v$ p. L8 m2 q; G
mov eax,[00656634] ; '\\.\SICE',0
3 I# Q1 ?( J# a0 O4 o( P push eax
4 ?% E, g( c7 i7 b) B2 I call KERNEL32!_lopen
2 s/ ~6 u8 b: p1 w% p+ e" U inc eax
/ ?# |' e5 R8 P6 Z jnz 00650589 ; detected/ m- d/ B' ?' T8 F- C6 Q' Y3 R; v
push 00 ; OF_READ
4 `# n, T4 W7 [( w- ~- y mov eax,[00656638] ; '\\.\SICE'
) |" }* K- u- P: T: o9 b push eax9 R0 g$ B( X" o$ _
call KERNEL32!_lopen. x2 K$ A$ d) \. j3 V
inc eax
- y0 F; W9 [/ I; s5 R jz 006505ae ; not detected
: X. d& d% q( M. b7 {4 V0 n3 G5 j# G1 m2 Y$ B& f+ s1 {5 ?! o
) e: `2 [/ \* b5 [) e, N__________________________________________________________________________7 G9 J! d' |: L8 f R
/ s9 }0 H! |7 u* S7 a
Method 12- B0 \ B/ M9 Q8 \- v
=========
) j* a. z: P4 }& Z& t
7 K" e5 V/ f7 B9 z. r% PThis trick is similar to int41h/4fh Debugger installation check (code 058 ?$ S( O9 T$ N, H
& 06) but very limited because it's only available for Win95/98 (not NT)! a. N; x! T5 B6 _9 M( f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 A- ]$ `* y" [5 E' t9 k% C/ p2 h
j( X" Y+ y( ?# H+ q push 0000004fh ; function 4fh3 j8 w# E+ {5 t) y1 r5 V! k
push 002a002ah ; high word specifies which VxD (VWIN32)
/ X3 c F; K6 [" h! _, N ; low word specifies which service) }! T7 X9 `# i9 i& e, D: \# W
(VWIN32_Int41Dispatch)) x+ r/ d x: K; Y& |& g
call Kernel32!ORD_001 ; VxdCall0 V# ?1 E3 D! g3 S: l8 \7 Y
cmp ax, 0f386h ; magic number returned by system debuggers
/ C2 n0 a, j2 P2 N, x5 K+ R2 g/ s jz SoftICE_detected
" A; k9 ~7 u i6 |. o1 J4 X: [* _3 D$ x0 C: p; v
Here again, several ways to detect it:
* m4 \3 U q! P5 \$ q8 E5 t+ z# ~/ Z/ s0 b2 H ~
BPINT 41 if ax==4f: J' e) D3 k0 a) W, C7 E7 f3 N/ S
* p2 |# h' U5 q9 q% f% B BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; M+ U9 F- ?6 |. N6 g! F$ t5 s
# @+ u% `1 g+ I4 Q+ J BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. l! M/ G: C8 y$ G* ~9 A
& L# V) x% h# N5 U/ [ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!/ C) e5 f9 H- e# a
& A0 o: C/ z7 {2 h0 J
__________________________________________________________________________& F8 W0 j, O) x: {1 o9 g+ n
* l+ c3 c) G3 x% H: ?Method 137 D& K4 c, r- @5 G
=========3 b6 x( J$ `' q- y% \
6 f0 k3 b/ d& h3 x& q! iNot a real method of detection, but a good way to know if SoftICE is
3 g! b2 H2 g: {. Minstalled on a computer and to locate its installation directory.# s. u+ H% ?2 S ]6 t9 Q
It is used by few softs which access the following registry keys (usually #2) :
$ z4 W' m4 i$ ]1 s+ m
) i( @+ }3 c- C4 ^5 x2 Z-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion M. Z2 g) D! O+ _, U @+ f2 s
\Uninstall\SoftICE" h. K0 t. B: [% @4 O0 o* o) e
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 x R m3 {5 X( e: w
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" ]1 e+ i& k) K, f! J
\App Paths\Loader32.Exe
0 s2 ~5 R% _: ? [" c! n3 N/ I' E2 y8 c! V! y. t
4 u5 f# I, R% k! G# ^; ?Note that some nasty apps could then erase all files from SoftICE directory& X' ]( n9 `: S1 N% c5 r; P
(I faced that once :-(0 D; K% G7 v/ M6 Z* K8 m0 r* M0 y8 }
! ^" g% c9 W+ S9 O( |* q
Useful breakpoint to detect it:: f" N0 W/ l+ b* V8 O2 o/ p* H# \0 s/ G
) C$ J; d! w" y4 w0 C# ^$ Q& v# t& q/ p; Y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
1 h: G; C% U- ~$ h# j. s6 E/ r u5 J4 ?
__________________________________________________________________________
( S2 o# e9 U2 {3 U, s
7 Z7 ]: c' c }; C" ^ R+ O3 ~. I8 A# E8 O: ?
Method 14 & W7 x6 G9 d# J
=========
$ Y8 Q+ M7 B9 L* H8 l$ D9 ]0 w2 ^. e6 i- A
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% e Z$ S5 C$ X1 z2 ^! r- G9 Kis to determines whether a debugger is running on your system (ring0 only).4 Q! z! P) a2 Q) R) }
2 p2 K* A: v" }
VMMCall Test_Debug_Installed6 V$ `( z4 A, @+ i, `" t
je not_installed
3 Z( h! k; O3 ^) ?# x; T/ `6 s9 y& r- Q+ u! H
This service just checks a flag.7 W0 @- k8 { Y- c$ A/ t9 X
</PRE></TD></TR></TBODY></TABLE> |