<TABLE width=500>1 w {2 n: Y- ~, J
<TBODY>
# G" z) B; V/ x1 K9 G" L0 R# |<TR>
+ g& C/ K7 R, O' z- b m/ n( E<TD><PRE>Method 01 0 F" b, z5 ]4 T8 H2 Y% @- V
=========9 L3 R1 u# b4 n! L
) c0 P4 }5 g3 A3 Y: v! l6 r
This method of detection of SoftICE (as well as the following one) is7 ?3 F9 x$ p# S7 z$ ]+ [
used by the majority of packers/encryptors found on Internet.
8 g7 x- s6 f" ?# N8 C% @6 ZIt seeks the signature of BoundsChecker in SoftICE) E6 x D% v2 n$ I
- D m7 j5 S O" x0 Z! b) ^ mov ebp, 04243484Bh ; 'BCHK'
9 P5 Y0 U g/ q O4 d mov ax, 04h
; N) Q6 N9 P( A int 3
9 H6 ]- z; B3 e0 e cmp al,4
$ c: |% Y3 t% e6 v0 K# q jnz SoftICE_Detected
/ `% O/ W d! x) x7 t5 w3 [8 c- [; o$ N; E
___________________________________________________________________________. V C- y6 i$ ] Y9 [
# n( l( @ S5 M- d2 p9 ]
Method 029 g9 Q1 l' D5 u ~
=========8 u/ R- m& |4 e+ |% K+ Z' Y: U) }2 j7 h
! X) M1 `' b2 U Q2 C
Still a method very much used (perhaps the most frequent one). It is used
x9 f3 q9 L! c: g8 i6 g0 u6 l p3 l- @to get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ j0 c5 h7 n# h7 ~
or execute SoftICE commands...) l" f- h6 w4 X5 H( }# M0 k U
It is also used to crash SoftICE and to force it to execute any commands
' T8 T8 [! J+ U7 O" `# G(HBOOT...) :-(( . u" R! R/ Z3 ]
7 d. d2 z2 p# k% ]Here is a quick description:, p7 X1 r( ], n! y9 u: V1 p# x# C
-AX = 0910h (Display string in SIce windows)
- }! N% t0 N/ M/ n: S# Z8 R-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 y" O* F2 s+ V R, B
-AX = 0912h (Get breakpoint infos)
3 ^7 V0 y* U+ k) T: V3 ]-AX = 0913h (Set Sice breakpoints)
% ~: i/ K: h7 }$ j; c( F-AX = 0914h (Remove SIce breakoints) T' b5 v8 ~% h: I$ {( a
( L( b6 v: p3 ?0 Q0 \
Each time you'll meet this trick, you'll see:
* y- [1 i1 ` \ w: A-SI = 4647h# q1 R) N1 A1 k: |& y! M
-DI = 4A4Dh
; z! X& j/ j+ I aWhich are the 'magic values' used by SoftIce.
, L; ]% H h8 `6 R; M, b6 _For more informations, see "Ralf Brown Interrupt list" chapter int 03h.9 v1 Q' F6 b6 b) v
8 i, A% [) e1 z' O5 @
Here is one example from the file "Haspinst.exe" which is the dongle HASP. ], i+ m) H; _( E; P z) k
Envelope utility use to protect DOS applications:- M) x7 ], U5 \ V; T1 k" c) n' T
3 A" `. I' w/ Y8 |
: |: k5 S& C1 t' H4C19:0095 MOV AX,0911 ; execute command.
# m! }0 c8 K' x( I" x, V# T4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
, e; D9 r+ W9 j" Y+ I* O4C19:009A MOV SI,4647 ; 1st magic value.8 q) u3 v/ L8 q
4C19:009D MOV DI,4A4D ; 2nd magic value.# d, y5 J2 P0 u$ M+ i3 t
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; U h9 [( ^; u! a) _' y' E7 E4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
) ?, ~+ O5 T3 V3 Z1 x7 G3 ?4 `3 a4C19:00A4 INC CX$ G/ z2 `0 y1 M: d7 W& W
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 s( q0 c/ c: d! N! D
4C19:00A8 JB 0095 ; 6 different commands.5 ]1 S/ f0 Z- p* V
4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 q4 N: N/ I7 `2 ?+ a* z
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)0 U2 w" j3 s5 z! s1 Z
( K1 f1 n g+ oThe program will execute 6 different SIce commands located at ds:dx, which
0 f( u! _9 T5 [1 z: ]" e& |are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; f$ D/ x' Z; M
8 H& s' f; s9 P+ ]: [- T, T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& R; l* U: }+ _. V% i
___________________________________________________________________________
8 z* A0 d9 E- K
* _/ P( f) a4 z6 l* `0 ?, U# k3 f" W6 p% Z' t/ N l
Method 03
0 J; b: ~$ }, i- g5 V: c=========
6 O/ F y& i# ^3 z( }, R& ~- Q7 |( w( F/ F- N+ k+ e; W
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
, d ?: Q9 l" J8 r) k, c(API Get entry point)
1 w, O% y, n3 Y% f- S: n8 x : \( H* x# G- ?$ \
- `! t7 Y2 G: [5 D5 v9 V4 N xor di,di
9 S" |4 x2 k2 F; J0 r9 N mov es,di
" }0 B ?. F8 e+ n& I; W; Y0 P# y mov ax, 1684h ! v' l* Z) D7 l" I
mov bx, 0202h ; VxD ID of winice8 n2 I9 P5 ^7 k+ o
int 2Fh8 L2 E% n2 \3 f3 b3 V
mov ax, es ; ES:DI -> VxD API entry point
$ u. z) S4 i. E3 G+ s/ X1 J add ax, di B! y6 c, O1 G6 `7 }% u1 y
test ax,ax/ q1 ^: f# L/ y0 e7 R$ S. P J
jnz SoftICE_Detected: x5 p- E4 T1 |
+ t: R1 v. s" ~- c3 a; L
___________________________________________________________________________
- U0 N* g4 V2 [+ |
9 V( t- x4 {. x3 F9 ?9 LMethod 044 A+ M, s# M9 j* O
=========. A3 J: s$ b; }; c# b) j
- W& c" N; g# I) Q/ jMethod identical to the preceding one except that it seeks the ID of SoftICE
( w( m7 T$ b' B" h0 H" kGFX VxD.+ X ]0 w7 R3 r) c; y, s
$ z" Y% P2 ~& E( E
xor di,di, P$ g' ?8 ~; l* T( J7 I3 x
mov es,di% O* g% W6 F* n1 h
mov ax, 1684h
A9 \7 K7 V) D mov bx, 7a5Fh ; VxD ID of SIWVID
4 B t/ p) w" o* J/ J6 A2 \2 I" e int 2fh
1 m5 ^' y" |- q* Q2 \2 A8 m mov ax, es ; ES:DI -> VxD API entry point
% [4 a. A: ]3 ]# r& ] add ax, di
( K1 k3 D2 t( y7 E6 o test ax,ax
4 Y+ R0 I: ^/ F V0 w+ ?8 {/ g jnz SoftICE_Detected, r" K4 R% W9 | g+ H) G- g( A" v$ D
, C0 z5 q: R3 P' f6 D1 I6 K__________________________________________________________________________
3 B* n0 u: T: v4 P0 {; H! ^5 R6 |- E% Z+ n' ~
9 U9 S; _& [. }/ a' A1 j
Method 05! L- F; y+ @' R! `
=========+ u( A4 J! `; j; ^6 n6 `2 ?& B
9 A; E/ j, Z7 |! _/ T" B: T! ?
Method seeking the 'magic number' 0F386h returned (in ax) by all system
$ R$ b# o$ a/ mdebugger. It calls the int 41h, function 4Fh.$ ], e k X3 |5 ?7 M
There are several alternatives.
* _" m) m9 E/ C
% k V: a0 g7 kThe following one is the simplest:
: V1 ~- F/ C+ Q7 W5 N/ D4 f* ]0 H# U$ }, k0 x& i' S: j! r$ A
mov ax,4fh2 E) ]" X: Z) t [
int 41h
& [9 W2 F3 h* Z+ \! o cmp ax, 0F386
: M0 t0 c: V: R5 x" |/ l jz SoftICE_detected
. |! R; `8 ]5 r4 k
* Y+ g3 ^# u+ W$ [. E8 D3 p0 A: |. ?8 j; l+ L; o6 A5 D1 E' M
Next method as well as the following one are 2 examples from Stone's
, O5 Q$ c, l/ `" n, V: F"stn-wid.zip" (www.cracking.net):
* \8 R {, I( B9 c
$ Y: h4 N, |# g0 E- x7 | mov bx, cs: d8 P" h+ t3 t1 V
lea dx, int41handler2
5 t! W4 s- [- V! Y xchg dx, es:[41h*4]/ Y. X2 v, z3 @! a& H7 v
xchg bx, es:[41h*4+2]" J: o7 O; U: b3 x) z
mov ax,4fh
7 r# ~) D/ `; v1 b8 w int 41h
2 |5 ^5 ~; P' L2 l xchg dx, es:[41h*4]' g9 H1 W: V% _- u
xchg bx, es:[41h*4+2]+ M# n9 B$ q/ {6 K: U+ p8 V2 a
cmp ax, 0f386h
$ [ Y( }% b& A* [) S2 {: { jz SoftICE_detected5 c7 N3 O' g. e7 O! M3 p; p
1 l' _5 Y& a% Y5 K# nint41handler2 PROC+ O7 ~* l, W6 d1 I9 |. Y6 `; D+ {
iret
' Q5 Y* [& {2 n4 q( \. |int41handler2 ENDP
3 n# d9 d# `7 `/ Z8 \; \" ]% c% g1 Q1 q9 `) x2 D. G0 g/ D
+ ^6 w' Q) k: Z3 \& U
_________________________________________________________________________8 A0 S! [4 y6 b/ k9 v6 `
. _2 C+ [) Y2 d7 v3 ?5 ]" d
( n( ]- |# N, k+ d0 B3 T- R% @Method 06
, `( X- _ u# [4 L9 H( A8 t- y% W=========
4 r% U t1 b+ m
+ p- v* W4 ~9 K- f
5 q- E, i& P) Q1 s1 y; ?2nd method similar to the preceding one but more difficult to detect:$ x g$ G/ _; M' h4 S, `
9 f7 B* p; x3 V
- c3 ]; J7 s5 A( z7 P# Sint41handler PROC# U" i, N8 D+ k7 \
mov cl,al | r9 {3 |4 u
iret) e) F* D, I! A# W, P2 ~
int41handler ENDP
" b5 [0 S: f; a, d9 }& p3 s: A& ~. \9 S$ {$ U5 |& f% h j+ d: q4 _
, _/ ?# f5 c- g" Q6 {
xor ax,ax9 B) y3 O& g5 D X& [& n, Y
mov es,ax& Y, T* O! T) E( M% W* Q4 C, a9 _4 f
mov bx, cs9 ?, [* w, N4 _1 g$ |) @
lea dx, int41handler
. N7 q) ~; }9 D; T xchg dx, es:[41h*4]: J. u8 E7 ]5 q
xchg bx, es:[41h*4+2]
6 a5 m3 P% q, J { in al, 40h' R& o$ w# |% M) X. U, }
xor cx,cx/ G+ @# e* ^5 v( ]' @2 a
int 41h
+ k; c0 t3 ]+ o. z+ ?4 w! i xchg dx, es:[41h*4]3 W c9 c; c- E; P) Q) U j% o
xchg bx, es:[41h*4+2]! C5 |* S' P7 S' c% y, T- P) k
cmp cl,al
7 a# g$ e! T) p1 p) O jnz SoftICE_detected
& i( p: I# c' k$ `2 o4 c a. [' I( m, u; K- H* {$ l+ E( C
_________________________________________________________________________0 T- p# P( L! G3 W' f% T
! Q. S Q3 M: SMethod 07. ~7 f$ b5 o& n5 q; K" ]
=========' d; e0 s2 m( X
; F/ }5 M' \. n$ a) CMethod of detection of the WinICE handler in the int68h (V86)
& d5 q/ I4 @- `! {0 Q E7 Z* b" b5 `- m$ K9 Y! {+ e
mov ah,43h) o: f- @ C' I- F. S$ l
int 68h9 `7 }$ d4 X q1 Z5 q& n
cmp ax,0F386h
: A/ `6 j: r X6 g* q8 } jz SoftICE_Detected
5 X! y+ I; m# Q4 X- H8 k: P/ O+ [
3 i. n5 v$ R4 Q. h3 l9 ~! j! z
' |: N* s ~9 y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 H, p1 U- { ? app like this:1 ]( f9 w; c) [ Z9 z9 ^
7 h( y! Z4 j5 q) ?, Q/ {
BPX exec_int if ax==68# {. B' w* \, h9 q
(function called is located at byte ptr [ebp+1Dh] and client eip is* c' L, Q! G7 f! q
located at [ebp+48h] for 32Bit apps). W6 C; V5 S8 i+ @
__________________________________________________________________________9 Q4 K3 N# I4 T! O$ b1 a; V; M
H+ {# k+ v1 ~, O- x# L" b% n9 I* _/ r) `% z
Method 08* i% b- D; d3 T9 X! L
=========
9 E. ]' y. h8 v' k: z+ o6 B
/ v: a" n9 i; |2 p* u) c' F' n4 HIt is not a method of detection of SoftICE but a possibility to crash the. B3 w8 Y: W- w5 s2 g
system by intercepting int 01h and int 03h and redirecting them to another6 Q* j; t, ^ j. _6 E* [2 w
routine.8 V$ N6 r! M4 S& y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 U% ]1 N0 J* N5 H1 }+ fto the new routine to execute (hangs computer...)4 r$ @* m/ C6 J* T. \8 w
3 A+ ?4 O. P/ i! P; \. j { mov ah, 25h
6 w* |1 o2 g: [5 x mov al, Int_Number (01h or 03h)
U" v% Q1 {' ?4 d mov dx, offset New_Int_Routine
4 V- m9 ^$ S% ?4 ]5 F& E int 21h
0 K: g: `) X$ W7 B6 y- U% M+ k' S" ]' v
__________________________________________________________________________4 [- w9 l5 d) p$ f" f H
5 }& h5 o f, l5 b
Method 09
. I. z% k, n, k5 M- b2 r=========5 t+ W5 S' u& ?4 G( b
7 f% y, V6 N: O! H7 iThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ a) f/ [/ E! t8 U I7 yperformed in ring0 (VxD or a ring3 app using the VxdCall).. b4 B) ^+ j4 x" B6 P* I7 y% `8 d
The Get_DDB service is used to determine whether or not a VxD is installed; D0 E) J8 E7 J8 H& K1 h
for the specified device and returns a Device Description Block (in ecx) for' V( J6 [8 i- p3 Q2 K- z+ B9 h
that device if it is installed.' N7 n, L% b! S! H4 B1 U+ W8 H
- x7 X( c3 N7 Q" C mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: @5 A+ k3 e9 |7 H mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( q; E1 L6 u6 `, E' O VMMCall Get_DDB
% F @# S" {' b0 b( d5 j mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
1 Q- v6 M' o# Y: _6 ~2 F' h5 f: w- r- V
Note as well that you can easily detect this method with SoftICE:+ c% x' w3 e9 ~
bpx Get_DDB if ax==0202 || ax==7a5fh
) q, L5 B0 g' Z* k4 |. W/ X' |- w5 l, g; M. e7 N3 I
__________________________________________________________________________+ w. E* @& u9 |
( }6 n0 o8 L n5 F$ M
Method 10' _/ Y% x$ d3 e* q# e. j2 ^
=========
: I; x$ y' {" z4 B
) e3 d# I* G9 c: j2 B# i=>Disable or clear breakpoints before using this feature. DO NOT trace with
$ Z& u6 F! C' ^! u+ c: \0 C SoftICE while the option is enable!!
- S+ `) e- |6 h6 A1 y: y
8 B Z, y) {; H$ u1 G* @2 a, c$ sThis trick is very efficient:
; P) v i" j3 ^3 k0 S+ cby checking the Debug Registers, you can detect if SoftICE is loaded+ g/ V8 Y' Y( d- \1 }' A
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" B4 v& F( C& a3 g# U: Q% U& [6 E4 sthere are some memory breakpoints set (dr0 to dr3) simply by reading their+ s' D8 l/ l% ~9 U) ]* b' `
value (in ring0 only). Values can be manipulated and or changed as well
7 a- A+ C8 d3 X- M(clearing BPMs for instance)* G* H0 H9 S( @ a0 t1 U8 g
2 Z, Z6 O" D! k" k Y: o
__________________________________________________________________________) i& r* c) o; x0 D
6 w ]2 x" F6 Z9 ^# S$ QMethod 11
7 X4 V# e: X% {, h# m# n$ p=========
8 ]/ v3 e0 M7 y: A8 V* O! q% N! R
This method is most known as 'MeltICE' because it has been freely distributed
" g$ I$ O5 g0 R1 H5 Xvia www.winfiles.com. However it was first used by NuMega people to allow
5 n+ ^. j6 c1 d0 ZSymbol Loader to check if SoftICE was active or not (the code is located
. ?& W, ]( \2 u( E/ j' Ginside nmtrans.dll).
$ |# z `* s: U6 i8 V
$ O/ c% W3 m, h$ X6 SThe way it works is very simple:
F( F b! i6 F, R @0 c* u/ w8 k6 ?It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( V l3 d5 i9 a. dWinNT) with the CreateFileA API., O' i7 V. {* L+ `: ]
% h' ^7 ^+ u9 T. |Here is a sample (checking for 'SICE'):/ E& e0 [7 F. t
3 B2 J7 J* t: M5 G6 W
BOOL IsSoftIce95Loaded()
1 V A! c6 `' }( r6 Q7 x. p7 V# D7 p{6 p9 k+ j! p; @0 c
HANDLE hFile; 4 ]" a. Z9 @* H5 K: H( r3 b4 {) N. A
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 t# ^; _3 D! E2 U* m2 R; Y$ l- o& a FILE_SHARE_READ | FILE_SHARE_WRITE,
9 ~( }2 ^# s3 ?3 z9 c) f NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 R+ C6 M0 M- J0 J+ {4 C% k
if( hFile != INVALID_HANDLE_VALUE ), M+ _3 f8 K& Y, C- m* Q
{# E% F4 o$ N. G6 J4 ~9 B( V
CloseHandle(hFile);
- K. N% j$ m$ J7 ^: A3 p return TRUE;. z/ G& P2 x, R: ]6 ]
}+ ~5 ^; b3 p4 F" p# K
return FALSE;
& A# M" ~" l1 E3 a$ p}" _8 t" X7 y3 y6 Q4 ?$ D
1 g5 k( `$ D; M8 f! {7 CAlthough this trick calls the CreateFileA function, don't even expect to be m- j$ d+ f9 x
able to intercept it by installing a IFS hook: it will not work, no way!3 d# K3 `( ?* l/ k; V! j% z) |5 k# z. _
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 O/ H9 W( U! k7 G/ C/ Kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% d- ]# s3 V7 c9 n" S7 O4 q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
. t/ s- r; r4 _2 m9 v1 h# lfield.
9 d! |$ w* q: H+ QIn fact, its purpose is not to load/unload VxDs but only to send a - q7 K* B7 ?6 P
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
& j9 E) t$ }% _, m: H/ l1 U0 n# C$ ?* eto the VxD Control_Dispatch proc (how the hell a shareware soft could try
" A# N6 y" o- @, Q3 \! j# e4 Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).& f$ [3 z4 I$ S/ p# ]7 a( W
If the VxD is loaded, it will always clear eax and the Carry flag to allow& w4 |5 K, N$ H8 _0 o
its handle to be opened and then, will be detected.% ^) t* [* v) T
You can check that simply by hooking Winice.exe control proc entry point
( }. \# H7 K% }7 z" s, N5 Ewhile running MeltICE.
/ i# ?2 E+ ^* p) W8 [
9 J' D( x. i8 ^, F5 F
$ A: R! a8 X0 q% @# G% ^. C 00401067: push 00402025 ; \\.\SICE/ Y7 ?9 @- y! z( T# T
0040106C: call CreateFileA: s& N {) ?% v# V7 W
00401071: cmp eax,-001 x3 ~, D# T& W4 i' e
00401074: je 00401091) ~& g; h9 v. {8 M
3 d% b* g8 r9 s" ^
' _$ e6 `6 H2 CThere could be hundreds of BPX you could use to detect this trick.
! ~3 c! Q' @5 m6 v& p-The most classical one is:
- |. s4 Z+ t% q) C' d( |) y BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
: x& }/ y4 ?5 {4 e5 ^2 @$ Y/ M! p *(esp->4+4)=='NTIC'
$ U; R. R. {! x# m9 `6 ~! P' q" }; ^9 q8 A1 f
-The most exotic ones (could be very slooooow :-(% w0 o3 }$ O& s9 r+ W
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 I4 f2 n' W7 s. l
;will break 3 times :-(4 `; C3 ?$ P& _' v3 A1 F( x# _
& O4 U" @# g8 g8 T, w% [-or (a bit) faster: 1 P1 m' P1 S$ z/ v, X
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 R$ ?( D7 T9 a
/ n" V: P/ v F+ L
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 7 e% c; n2 z* C& [, v; B! V" K0 O
;will break 3 times :-(: S8 A1 p, z' v! H' T4 j
* X! B9 j4 i4 b: k0 E
-Much faster:- [! o. v8 @: \6 ?1 V s/ e
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! s0 M/ {; o( {7 L' K) }! Z+ M
7 v7 g! o7 F! F3 h) t5 Y$ ANote also that some programs (like AZPR3.00) use de old 16-bit _lopen
( d* [2 [$ p0 e+ A' {function to do the same job:
. V3 r4 L8 O1 _9 [6 @0 q" R+ R& E% \2 {6 Z' z- E3 h0 T. u
push 00 ; OF_READ' s; E. R) e% x: X7 M: I1 |
mov eax,[00656634] ; '\\.\SICE',0
|( G( V* [' m( b push eax
/ M' t& A6 s6 x0 x- C/ r call KERNEL32!_lopen8 `" N6 e& A3 ?
inc eax& m) [6 ^' t" R7 z9 H: z2 j
jnz 00650589 ; detected7 c* s' Q$ F1 |4 ?1 H0 i# e3 n8 c
push 00 ; OF_READ
3 G& I, ~8 ?# |( j mov eax,[00656638] ; '\\.\SICE'
8 E6 C1 q+ L+ @; y4 G5 l6 p push eax
, @$ N# S* P2 ^3 I5 L call KERNEL32!_lopen
% M. a" p6 C8 z inc eax7 N. t8 I' L v) { T6 M
jz 006505ae ; not detected
. n( k& L ^% l: G' }
) x( ^1 V7 n) I
1 l5 W( r3 {; [3 X__________________________________________________________________________
' w/ B/ f+ a6 K @7 W4 p& h, I v3 O( N0 r
Method 12
, z2 ~; t" f' v% J' Q6 D=========
- q! c& X, ?1 g4 j, D% F# B* }3 z- I: ^" ?1 ^. v2 a
This trick is similar to int41h/4fh Debugger installation check (code 056 ~/ z" f) e m0 ]6 t
& 06) but very limited because it's only available for Win95/98 (not NT)
1 v) B; w0 r4 ?6 }; Yas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& a; u) h& z( g3 P
) j4 q D) P# ~" Z push 0000004fh ; function 4fh0 s: I1 N0 @+ f7 s& c! ?
push 002a002ah ; high word specifies which VxD (VWIN32)
0 O7 H: o" d$ U/ D' o ; low word specifies which service$ O6 @) v; b7 {, K. d
(VWIN32_Int41Dispatch)
6 d( W* K0 m5 N9 | call Kernel32!ORD_001 ; VxdCall
! j) m/ ?. ^2 `- ~5 S | cmp ax, 0f386h ; magic number returned by system debuggers
. E; a D( |$ a, j' B jz SoftICE_detected
. G! x+ H; E% n3 O" Q t ?. c
: d0 ~% e" D7 i) Y# K3 |. iHere again, several ways to detect it:; w; ~+ g( {* [6 f8 R/ r$ W2 ^# {
% P8 n8 ^1 `- w6 |% T
BPINT 41 if ax==4f
2 `) ?: \; Q" q
- X5 s5 I7 L4 M) a6 u BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
' H$ o! k1 o7 M2 y! O4 C! a% C2 H1 \$ ~+ `
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
- e. v; U+ }4 j# ]; Z( [! V. _# h1 z
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
* ]6 p# Y. i3 @; y" g5 e. d- R
$ k, E: U) Y1 u7 }__________________________________________________________________________
8 H4 y& R( L, K: ?: d* k `! |) \$ W5 w- B% l
Method 138 ^1 n! Y* L# H! V
=========
7 V7 q7 H) x5 T- ]7 W+ W7 g4 }% l! A1 n5 W+ g. S7 n
Not a real method of detection, but a good way to know if SoftICE is
2 t5 j# w+ o% D# }7 x2 Uinstalled on a computer and to locate its installation directory./ e0 o! j0 j1 W! J2 ~
It is used by few softs which access the following registry keys (usually #2) :
. d/ c( }$ F* C/ M* Y
' r+ E$ C* n2 o, E; d-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 r6 ~/ Z8 A. i1 E9 K1 U\Uninstall\SoftICE) o$ C% P5 z E( L$ @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
( s+ i! c0 e0 ^5 E- ]-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# v# b9 y5 [- h; ~+ ^5 n g
\App Paths\Loader32.Exe3 i5 ]- L. E1 l9 h, A" v4 \( K1 i
, h, Q$ _5 g* B6 d* b$ E' K: x8 p& [) f* n6 M: @5 d
Note that some nasty apps could then erase all files from SoftICE directory
% D I6 {; E) b4 e* [ K(I faced that once :-(
8 D' E2 B9 Z1 Y7 v/ w6 n* w( ^# `5 |, ]; ?8 ?# ~/ U* n2 i& {: h
Useful breakpoint to detect it:
' r' a+ i/ g! |) M# s) w( ^7 a2 M6 r, L
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
) A1 ^- F! g4 ~# v- p( C/ l% _( q& O6 I2 G
__________________________________________________________________________3 s+ c9 f' f- J
/ A( R; W7 S. y9 ~* p9 t1 E' W# \- c( N6 e9 P; ]3 S
Method 14
: p: Z) C: o$ U- S( @# c=========/ h4 _* j2 ~. B& a
$ t" S$ O# m. f: W5 d) s4 ]# TA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
+ [ m2 B. z3 ~( Bis to determines whether a debugger is running on your system (ring0 only).6 r) ^6 j) `5 a' L6 c9 L0 s
8 j1 }. ^+ T7 p; Z( V VMMCall Test_Debug_Installed V5 [: w) b) z5 ^( c. a4 q0 t6 T
je not_installed$ {! N$ Z+ G5 c& N" L1 j4 a9 V) p- ~3 C
2 O' K7 J% t. _' @: V& W' yThis service just checks a flag.
* \1 {- c4 p# ~3 C9 r</PRE></TD></TR></TBODY></TABLE> |