<TABLE width=500>' h x% R! \0 f) A' |7 ]+ r8 ^0 a
<TBODY>
8 H2 s+ M: B% ^' p! n" W8 b5 ?<TR>
" S' R5 D) W3 F6 i B. O2 P<TD><PRE>Method 01 4 B" D9 e, [/ Y! b. D6 u
=========
! U4 ^2 O$ _& Y3 V- g b2 n& Z1 t2 a, T
3 N6 o! N' p+ ]7 V5 F) _, YThis method of detection of SoftICE (as well as the following one) is
' S$ B5 I+ h; j- B5 N6 Sused by the majority of packers/encryptors found on Internet.
+ F/ Z" t. R! G, Y3 `) ?It seeks the signature of BoundsChecker in SoftICE
8 Z9 {4 X$ c, N7 q( V6 A" U# y$ X' f4 |; ^3 F
mov ebp, 04243484Bh ; 'BCHK'/ d1 N3 m2 d P+ P% a0 P2 p
mov ax, 04h) k/ D, a Z7 W: T: ?1 Q) _) r. v B
int 3
8 | X, |% W, h; ]0 a cmp al,48 y& f. R9 w3 j% W" }8 j
jnz SoftICE_Detected
% Z6 B$ ~0 l! \% N# v B& l
: l2 G4 t _5 s2 r___________________________________________________________________________8 ~ k) c3 I y4 H0 J" i
2 j" c: B0 f/ I, {& o
Method 02
* ~$ m, b: X; l5 g=========, `) M) H7 n6 ^1 R( H- E
# ^; `% U6 E8 ~3 A: u& lStill a method very much used (perhaps the most frequent one). It is used P8 V3 p6 ^3 A3 k% p7 y, c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,0 P, ^" W1 M: I1 B/ o
or execute SoftICE commands...( T1 l5 |+ I O. {
It is also used to crash SoftICE and to force it to execute any commands, G0 a8 P( ^; E! T
(HBOOT...) :-(( : w ~0 D- l: R, `# P" b
. c% j6 U! s* i6 L, c# O
Here is a quick description:" N. }( z+ Y9 u& t2 \! `$ R
-AX = 0910h (Display string in SIce windows)
) A! f2 t: e$ k7 R9 G-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 N5 r) ^9 N% E, e. X. J
-AX = 0912h (Get breakpoint infos)- i; G; G" N( P
-AX = 0913h (Set Sice breakpoints)
7 Y& M7 |4 d, n; U r- I-AX = 0914h (Remove SIce breakoints). t6 V- |7 o) k( i% ?1 B7 K
5 l# G* M! M; T. Z; R/ {2 v# kEach time you'll meet this trick, you'll see:
) G! Y1 k9 i9 e# m/ `/ @-SI = 4647h0 @2 V$ a6 i c- Y# w" i
-DI = 4A4Dh5 N7 Q0 \* p8 S* G# K2 U, C# m `
Which are the 'magic values' used by SoftIce.9 s' O) C: o: |5 j8 W
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ J& W9 A4 ]' b6 M/ }3 ~0 w( g3 L0 e" d4 y8 A
Here is one example from the file "Haspinst.exe" which is the dongle HASP
- M) i! T _9 g/ C% _; w( k* `Envelope utility use to protect DOS applications:; F1 a4 V& P1 b) \( O
; [& l# m! j6 d' F" j6 c
% {. x6 a/ z$ M( w+ T4C19:0095 MOV AX,0911 ; execute command.- Z9 m, i3 V$ b% A2 q
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).3 |3 T6 R* \3 p$ M% Z3 o
4C19:009A MOV SI,4647 ; 1st magic value.
5 g* Z0 E t* V" w3 i4C19:009D MOV DI,4A4D ; 2nd magic value.
7 _% ~$ g# l7 ], N% b i: ]* Q4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; |8 c/ c! {' S& T: U: K4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute/ y: \. ?9 e7 P
4C19:00A4 INC CX) q7 a' @! n5 p5 z
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
+ B( _; r' E8 j7 P( k' T4C19:00A8 JB 0095 ; 6 different commands.
; c" }2 x1 c/ |4C19:00AA JMP 0002 ; Bad_Guy jmp back.
8 a* y% f3 o( |2 @6 Q/ C" k4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ d2 u m" n) L- K/ f9 j
4 V' |9 T" H1 p, X! z. q+ xThe program will execute 6 different SIce commands located at ds:dx, which: Y! U8 h8 [) B' I$ u
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ e o4 i8 P+ q8 H- Z0 }7 @; F
' P, e4 F% P, I0 b7 Y3 h2 X8 C* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ O1 \7 V+ c N7 W/ i# j5 N
___________________________________________________________________________# g0 F6 R0 _' W- s8 W
+ x! t0 E2 ?1 S$ o' E/ s5 R" @
$ ~9 ]7 r# r) s) ?Method 03
0 n6 p1 y, [+ b: b1 _=========. h- C: _% i0 _3 Q9 r, n$ X9 n7 f
4 a0 O6 |" q9 d0 p3 hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! I L: g' _- [5 c(API Get entry point)2 @3 H q) M* n- c+ F
/ ^" I. J( n- `. u7 T" K+ i9 g2 m& ~+ c+ I
xor di,di& g0 I1 d |% @6 e
mov es,di
1 Y# `' R3 ^7 w& p mov ax, 1684h
" ]2 t' K- s, e( N0 t mov bx, 0202h ; VxD ID of winice
) R- r# k7 y+ _! O& Q* q6 Q int 2Fh. u- f6 V- J" M: t9 V( {7 g6 b
mov ax, es ; ES:DI -> VxD API entry point
4 Y! W; p+ v3 Y6 R4 e add ax, di9 E8 D9 B; [/ n1 R: E! {* h
test ax,ax; Z; [3 W& \% ]* v* |# b% e2 K' _7 E
jnz SoftICE_Detected9 c# U2 {* |( c6 D
% b* R" f: K; r. w9 a. x6 Y___________________________________________________________________________
, e+ ~. c4 M# r9 Y! _, m p' u, P y1 U! O
Method 04
. ]# h! Y8 Q1 r- M" i% I=========0 B$ M, N d4 ]) J
0 s5 n3 E: [0 d8 \9 j
Method identical to the preceding one except that it seeks the ID of SoftICE! t3 D; }5 Z8 W8 m; g
GFX VxD.
" b& g. q9 }9 j6 K) m
" _$ ]; Q F, |6 y5 Z' [ xor di,di
( O6 o. o+ K& b6 D3 c5 ? mov es,di
7 C, v; @6 k# Q% [8 x5 z mov ax, 1684h ; W8 S7 G- u+ E
mov bx, 7a5Fh ; VxD ID of SIWVID
% Z0 ~; ^ |% |4 O8 R6 f int 2fh
' ~& J, n) T/ \) c mov ax, es ; ES:DI -> VxD API entry point
0 K7 t2 L( N* `8 ^7 a' n y add ax, di" ?; k" c8 s# }4 d2 c' W
test ax,ax
4 I% Z2 G0 {5 A3 Q3 {5 ]8 J9 t* C jnz SoftICE_Detected0 V( r; Z3 W5 W6 f6 ^% t8 x! S
% v6 z( Q& @/ `5 }1 g% b__________________________________________________________________________5 r' R% a8 s. P! m1 e! a
3 I" L, s. { i& v
& `9 s# L4 s% h
Method 05: c4 X6 r7 ~ ^" g- O7 e" T2 b2 J. ^
=========
6 w6 D, i) u: r, ^; T. ~% S1 a* ~$ p& F8 l2 _# ?: T
Method seeking the 'magic number' 0F386h returned (in ax) by all system- x, H% x- y5 b" T
debugger. It calls the int 41h, function 4Fh.
1 W5 y; B+ Y7 G4 R4 GThere are several alternatives.
% |( [7 l5 p3 t, C, Z: j& p$ o* m0 F _+ T7 I8 H$ Y9 v
The following one is the simplest:6 j: b5 ?4 E+ @, t& ] X
( ]$ M% r5 R" M: r mov ax,4fh
3 o5 e8 i' x& F" p$ y int 41h
: B2 U* E4 H, [& O* d# \# T cmp ax, 0F386
6 K7 ?) K( J! ^2 N% e9 T jz SoftICE_detected
( D% m+ @8 ?' H" x; R
; g/ M0 B6 ?! D$ T' y. Z7 ^1 E9 @% P1 A6 m4 g" @2 n- Z
Next method as well as the following one are 2 examples from Stone's 7 }0 k6 J+ z+ ~: l0 e0 Y
"stn-wid.zip" (www.cracking.net):
, y) _- h+ h; w6 l: O
5 B9 [' n$ m1 Y% n+ y mov bx, cs
1 J/ P7 ?+ m1 ]6 P lea dx, int41handler2
4 N9 _* M2 }1 U7 y3 m xchg dx, es:[41h*4]$ N. G* n1 m9 s' b/ Q6 _
xchg bx, es:[41h*4+2]8 Z2 q9 _6 ?; P) Y2 L
mov ax,4fh2 Q3 }6 s5 k$ O+ L" k$ x
int 41h* @' }4 y3 t8 }! \/ x. Z5 y
xchg dx, es:[41h*4]
9 J! I! c1 J g# V xchg bx, es:[41h*4+2]
/ v' P, _8 g1 V3 Q5 X cmp ax, 0f386h
- Z, r, T9 a) O6 J0 t+ @6 h" m8 D jz SoftICE_detected
+ X% `# `- p( j9 e2 _7 i( z/ [2 ~% F1 E% I# G
int41handler2 PROC# T: x' t& O' m$ i- E- A
iret( M3 }" P3 s) p6 G
int41handler2 ENDP2 u4 D0 J; d# ~6 T: @2 {
G8 L; J( L4 S9 Z
) z& y- Y" @0 z5 z5 h, u
_________________________________________________________________________
" `$ g- u! E P* H9 [3 |$ x- f$ C& f3 s9 @: Z1 w( @! S& b
) z; I) Y; b, @6 H) s& e8 n* ]
Method 06
' m$ \6 j3 M8 q" _( q% k1 e g=========
( V4 S: d) q) m
7 \- X! V7 Q/ k; M8 S
L1 o( p; o2 u8 ~1 r- r$ N2nd method similar to the preceding one but more difficult to detect:
4 G& z7 T6 ]6 ?. f1 Z
# f4 c) G. [) ?! L C! M3 ?' v! ^. i
int41handler PROC
7 U5 i! a& K6 k* n mov cl,al: Z) B# T$ M# r! t% o% o4 j
iret/ S& [( A% Y A8 O& y
int41handler ENDP
( c s' J, `0 | a: k+ c% p* w/ \: A! _* n8 R, L( ^. @% r
) Z5 I1 I7 h- Q xor ax,ax
" `- h z+ ?, r$ J0 Z1 ? mov es,ax
! i% P2 {# k; C& @: ]) Y0 ` mov bx, cs" \- O, N6 W7 @/ ?% v; o4 J
lea dx, int41handler* W( ~" t" h% J
xchg dx, es:[41h*4]% e8 x: n7 ]5 G9 a p
xchg bx, es:[41h*4+2]
, h& b& h( T1 [ in al, 40h. J2 _; R2 D, y4 T7 ]
xor cx,cx, @. C; b) F/ a) s, |
int 41h
# ]2 v. j, \( h0 N | xchg dx, es:[41h*4]
% g1 B* H* @! Q7 g; Z& s( @, y xchg bx, es:[41h*4+2]
; i) M1 V& s# i5 r cmp cl,al/ P0 u7 w% ^" C6 R
jnz SoftICE_detected: }& [1 s% S0 w7 l8 c
1 ^% X* |+ ]. |2 _( c$ S+ m_________________________________________________________________________
- a8 K# u7 F" O( f$ F; t0 ?& s- ]# `$ g1 D3 T
Method 077 x5 ^1 {/ B s) v+ N
=========
' ]7 I& b- A% r' h' T
) X/ n, T' R" i- fMethod of detection of the WinICE handler in the int68h (V86)
0 m- o0 u$ g( {7 C/ A x \: Q2 r( ?
mov ah,43h
3 H2 g0 F$ [. g1 Q3 x8 _ int 68h; v6 \; z% N8 f6 B- I6 i
cmp ax,0F386h
1 i. ]* S5 p# P8 H- d: ^" x8 y jz SoftICE_Detected
& }& W& C+ l5 Y+ P$ C6 R, V0 q5 j
; h7 U) b9 V5 {' u; }7 W( `- k m
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 T8 K$ x7 d( _& u$ I$ t! u app like this:
]6 V2 Q5 x6 ^; f
8 ^6 Y) _7 `$ G* G' _. | BPX exec_int if ax==68; r! r; C& C) h6 M& F+ y" {
(function called is located at byte ptr [ebp+1Dh] and client eip is
3 ^$ q1 i8 w: l$ Q4 L located at [ebp+48h] for 32Bit apps): {6 C& r7 [) A9 t5 a
__________________________________________________________________________
5 s! x! {: u: O* d; c) n
: s+ V, I, u! M
, ]0 L! [1 W* h ?. ~7 _ W- E9 GMethod 081 E# [- @& {/ L! y
=========
- d6 G8 g, E$ k' L* g" T5 r: J/ p( z: N% B0 W, K
It is not a method of detection of SoftICE but a possibility to crash the3 b1 y! x0 Q5 E9 ?: j$ M
system by intercepting int 01h and int 03h and redirecting them to another
* s$ O$ n9 v) T' C! O2 ?9 d/ sroutine.: h1 _' w: G6 d1 P$ @* T% U5 Q, m5 F" L
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: ?% f8 K6 p. H$ dto the new routine to execute (hangs computer...)
+ o& C7 y' K3 \$ w, p' A5 M
( M% n# f4 k, `/ o9 w9 s mov ah, 25h: t8 A! `4 {, W6 p$ [: @
mov al, Int_Number (01h or 03h)
k* d3 r# s% N/ A3 J mov dx, offset New_Int_Routine" y( M6 C+ J. ^3 d, c2 \
int 21h0 F' g8 ~1 N& N) W" S# P
0 I, J; G# B$ w6 s8 d+ u A__________________________________________________________________________0 B Q. T, B4 n7 D
& [: k- I) n. Z4 [2 ZMethod 09
& x* S# }9 I' w=========8 T( e+ B) j8 \. t- ^. M
0 x1 B" x0 R& U$ i9 b$ mThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ C" l7 q/ D* D# Yperformed in ring0 (VxD or a ring3 app using the VxdCall).$ V/ P6 [9 n( D4 L
The Get_DDB service is used to determine whether or not a VxD is installed
' `. D' m! i8 h4 r# f- jfor the specified device and returns a Device Description Block (in ecx) for, ?1 e2 P" \7 b3 e
that device if it is installed.
: D, P5 N* O! B( Z# o, j G6 ^! f- B, R& e. s7 o
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 {+ u% ^2 O' X1 m' I2 r% N# C" B
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
8 A. J& Q. T ^2 Z: a VMMCall Get_DDB
$ P5 s3 f7 _2 V/ d, @ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
7 ]; Z- N: ]' ]3 ^9 _& Y* j4 R) ?& x0 }1 z0 ]/ [0 O- y
Note as well that you can easily detect this method with SoftICE:
; q+ U9 [' ]3 X8 G bpx Get_DDB if ax==0202 || ax==7a5fh7 e3 Y$ F% L& K
' g. u2 p: R' c5 C+ O
__________________________________________________________________________$ ^& @) ^: K. v/ ]8 D3 U/ p+ Y5 l4 R
0 s% k! I2 Q0 ^; Y' |- g% ^$ WMethod 10; ^5 [0 G3 f1 D* T7 T
=========
" z4 a6 o( q; t" G- V. m0 K
& ]+ Z: H# n* \- e$ F1 e. P=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 i2 ~* M' O, \3 W8 s SoftICE while the option is enable!!
7 K0 b# _6 h. c# r3 U$ Z+ `7 J, u1 T1 [& P
This trick is very efficient:0 N) z- `( j9 f4 K# p @2 [ U; q2 E
by checking the Debug Registers, you can detect if SoftICE is loaded
+ |$ R% B {- U0 \(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: U* C' |5 Q& |' Xthere are some memory breakpoints set (dr0 to dr3) simply by reading their9 o9 c& |8 V8 @
value (in ring0 only). Values can be manipulated and or changed as well5 ?7 r0 p8 S; ?* Y8 i- S$ p) B3 w
(clearing BPMs for instance)! b3 u' ~0 _0 z( d# Y
4 R0 e/ D5 v% M1 o! W4 w- G4 E
__________________________________________________________________________
' `! a9 ]7 q* z/ l) q
- Q5 y8 M1 ^: B* wMethod 11$ t% k7 p! g a* z6 d- C
=========
) I# `3 k. O0 c" Z s. K
Y) {3 E0 s2 F1 B; FThis method is most known as 'MeltICE' because it has been freely distributed
1 B/ o, s: n) T4 O$ q7 q+ ?via www.winfiles.com. However it was first used by NuMega people to allow8 n+ b; z/ q% l7 f9 w; Y- W; M
Symbol Loader to check if SoftICE was active or not (the code is located! [: n4 l: m; k; x3 w4 t9 ^
inside nmtrans.dll).
/ J$ _; x& x& X! Z: ] B2 k4 D1 y( q. i' _0 d! o& L
The way it works is very simple:
' s8 R6 N; Z8 u% h; D" r2 IIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" N/ c. x/ |- ?WinNT) with the CreateFileA API.
3 Z# X8 o& z2 R1 A% a# y0 g( ]( q4 r/ v' a
Here is a sample (checking for 'SICE'):
. `5 M1 o. b) T" _2 D- h, N f+ s3 {7 a$ j9 x& H1 p
BOOL IsSoftIce95Loaded()
" H" R7 p' ~6 W$ M0 i3 G{
% x' i) z$ f6 H5 D HANDLE hFile; ; }% U7 ]! W t
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. f& Z( i& q9 E6 B s
FILE_SHARE_READ | FILE_SHARE_WRITE,
0 K. U Z$ [4 l- K ] NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
& J: B# w# P, f9 T. ?6 y: {8 f8 c if( hFile != INVALID_HANDLE_VALUE )
5 ^. L) Q. R, q3 g {6 C1 ?7 o! P9 I$ w
CloseHandle(hFile);* h. [0 E! f+ X& T6 _; P" j
return TRUE;
6 w2 g$ i# R* G7 D }5 y0 p' j% F3 X" t; e( c
return FALSE;4 s7 v* R" _1 Q! C
}
& x0 `* k) O2 ^4 r: [) }4 W# ~1 Q) e7 G. ~3 v0 [
Although this trick calls the CreateFileA function, don't even expect to be
4 i5 L5 b* |; H, H* Y, R- fable to intercept it by installing a IFS hook: it will not work, no way!$ F! \4 ]6 o& M! y
In fact, after the call to CreateFileA it will get through VWIN32 0x001F! Q( k6 E0 z- c" d8 [, P: `
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 `& H6 { L" ]6 [! g7 w8 M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
" w' Q: s) N C9 _4 Ifield.
/ R% y2 y7 a0 w: T7 V# ^- HIn fact, its purpose is not to load/unload VxDs but only to send a
& O* k9 ]7 J- P* h- x4 KW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* f: G' O2 i! K4 D2 `& a
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 ?4 R/ N# O' k5 q3 n+ W. S8 j/ t3 U! fto load/unload a non-dynamically loadable driver such as SoftICE ;-).
p6 a: W# V3 [9 N& V. WIf the VxD is loaded, it will always clear eax and the Carry flag to allow, ~$ r! l5 ~" s+ Z* Y( c
its handle to be opened and then, will be detected.& n. T% u. m# g9 Y! I: s _) q9 [
You can check that simply by hooking Winice.exe control proc entry point' w9 u( ]% F, l$ ?3 y
while running MeltICE.
/ k- O+ z; e8 w( f! y! b2 l' L+ E# o0 V
( w% G3 D1 V: ~1 j; x
00401067: push 00402025 ; \\.\SICE
1 Q# m; H5 h; B! ~7 v, l% b" k 0040106C: call CreateFileA! j6 |2 _+ z) }* Q: i6 J
00401071: cmp eax,-001
9 P8 i& u# t; i- h$ W 00401074: je 00401091
+ f6 |9 _. H1 y, ~+ D# w: [( |5 o! A4 y4 q! T
! ]/ z! i4 G# d$ U) U5 c) m% V
There could be hundreds of BPX you could use to detect this trick.3 ?! r$ ]+ W/ n+ a& b. [
-The most classical one is:! L' R1 y3 n* _2 B( L# b6 s @
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||! D3 Q" Y1 v. Z" V/ S
*(esp->4+4)=='NTIC'
5 K! E w9 H) O
. I$ N9 |" S2 [, l-The most exotic ones (could be very slooooow :-(2 c4 K+ t8 ]- C* C X! F R" e0 z
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : a2 ^' O# [& ?0 P' D/ B; T# |
;will break 3 times :-(8 F: C2 T; _0 N& T9 l0 L
8 c/ _7 ^' R/ M0 y3 l$ P
-or (a bit) faster:
& Q9 [) x" V0 j# i* n! j, U8 w BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! P( Q2 k' b/ O" [% q( E* u5 L$ V% Y2 I, A% k& _
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
# X6 W0 U& V; V4 R# P/ j# e ;will break 3 times :-() z5 Q0 u( v/ g$ c
- X* m0 n0 [. \6 G% w3 [-Much faster:
' u, U) Q1 ]% X" t8 ^+ ]! d BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 V$ K: X6 ~: k7 p
8 ?2 J9 {8 }% s( P2 QNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
: ^7 P1 C& Y9 Hfunction to do the same job:
6 ^: v# Y" M, ?% k! I# e
. N/ ~% V" r0 `1 f push 00 ; OF_READ# P: Z! d1 } R% |2 i. d
mov eax,[00656634] ; '\\.\SICE',0
6 j5 |8 b* p- v' p* {8 v \' g* j push eax3 [( ~/ [6 f6 P" |; D$ E. J1 M
call KERNEL32!_lopen
* Q' D& ?7 J& D inc eax
% m" y" j+ }' T8 w+ ~ F, u7 x0 U jnz 00650589 ; detected
3 t0 y- ?. J! u, Q% ^8 U C push 00 ; OF_READ) D1 U/ W# ?1 {' [3 R
mov eax,[00656638] ; '\\.\SICE'! c/ C1 i6 r! E3 t
push eax& N, ]+ {$ `6 F' _6 Z& t+ s
call KERNEL32!_lopen
& {& s- Z: q' \2 {$ [6 ?; \ inc eax
4 D1 Q: Y* \$ }/ E* { jz 006505ae ; not detected& C& \3 Z( E# X( y/ ^; k1 [, J+ B% Y
0 T9 l' ]6 i7 `, Q' [4 k' U6 y
/ [9 P( R, [& T( s% |, `__________________________________________________________________________
6 I( G) T5 N# Q3 V& b7 j
' z4 Y J' T4 Z" V3 w/ ^Method 12# p- m+ i5 Q. ]* D. V# ~
=========
* x; C- Z! Q- [; \& ^/ a- Q2 j6 T
6 S7 T: H2 X& T& S: l& y4 g9 |& P5 zThis trick is similar to int41h/4fh Debugger installation check (code 051 [: ]8 q% k2 U6 v
& 06) but very limited because it's only available for Win95/98 (not NT)' `' e, C) a3 R
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; ^; y% [' c7 P7 ]( ?* A
' a$ Z/ J2 E" ^- e* \1 P6 ` push 0000004fh ; function 4fh& M2 k0 S, ^* `1 a7 J
push 002a002ah ; high word specifies which VxD (VWIN32)
' ? x* X1 P# h; Y/ B- o+ W ; low word specifies which service! z. s% J# j. j; R, c9 O* B0 s
(VWIN32_Int41Dispatch)9 U- K, E, ~. N' b1 J) F( k
call Kernel32!ORD_001 ; VxdCall
& L4 H* d* n; e" i: \ cmp ax, 0f386h ; magic number returned by system debuggers
& b# S: X" g) R( f$ D/ ]; P- x% z! L jz SoftICE_detected
$ Z8 ^3 M. R- B0 P9 @0 z# v+ l+ }
Here again, several ways to detect it:3 U F1 _5 v: k6 X9 C
# F' d: L" Y, _& p, j( ]# h: n BPINT 41 if ax==4f7 a( J9 p! X6 \) m, Q
7 A: X8 u5 Y# Q- m& v( z. S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; b+ e$ B% f5 Q; D
) r' c1 f; [, J! Y# o BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 `: t: x$ P# ~% I7 q/ \: o$ O+ T, ?2 D/ f7 w/ W7 ]
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 e5 t+ Y) {" H. ^# P/ _3 H* `
__________________________________________________________________________
7 U; X# c+ i5 i( i
X5 N8 c' G4 N$ AMethod 13# I% [* d; k/ K: i: r. \4 N
=========
8 ]5 m3 e& x0 @) e9 _
+ t" j- n- C1 P) j* @Not a real method of detection, but a good way to know if SoftICE is
3 `# q/ H) j5 k8 b( `4 d) \; ~installed on a computer and to locate its installation directory.
% V" D- p$ j: [8 ]. FIt is used by few softs which access the following registry keys (usually #2) :) e8 |* F9 R+ E. n+ ]# H7 f
" M0 a, D0 W+ ~( X. u3 `
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; p4 f. r! [" J5 S- K
\Uninstall\SoftICE# Q# d/ |1 [& u& A5 K/ @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 m8 C' |" b: e9 U4 {( p* S5 i7 ~
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion f+ W4 Y, R3 J7 ~( S- W- A
\App Paths\Loader32.Exe6 [0 Q4 _! \* N$ U/ ]4 K" y
/ m* L- z; Y$ k8 d" n6 m }+ ^8 M
Note that some nasty apps could then erase all files from SoftICE directory
6 U0 l u* u3 k+ |9 b(I faced that once :-(5 X- A3 g; o* |# p: t
1 l% g# G. j4 {, V. x, s" \Useful breakpoint to detect it:& ?3 t9 c8 w3 I! v5 |, G) ?: L
0 R/ `" t: C+ E BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# K. \6 H Y: {4 f- c
* z# Y2 k% Z2 N. F- I" [, K: z__________________________________________________________________________% |% x. \6 @9 m- O/ k
# \% ?; F. i, m5 Q
L; c" S F; bMethod 14 0 K+ [$ ^' }: `: P% P
=========
0 I. E: g) X6 i' w
i* \7 W5 a/ Y4 j8 UA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. @* O5 E+ J& c3 a9 A3 tis to determines whether a debugger is running on your system (ring0 only).
" G" a( }5 F' x) @( p3 j
_2 ^1 r+ R) a" u$ ]" h* n0 k VMMCall Test_Debug_Installed
/ T" e: }, M4 b je not_installed
g/ r* p; E8 z. l
2 z4 [& [8 ] YThis service just checks a flag.
; I9 D9 A) P5 ]" X</PRE></TD></TR></TBODY></TABLE> |