<TABLE width=500>' b% ~6 o* J4 g$ k6 p2 y2 I
<TBODY>
+ L8 ^) g( \/ ?# `+ x7 n<TR>
0 E) K7 Q5 o( `* q<TD><PRE>Method 01 * \% E) G! I! t7 z5 b
=========
$ J1 {9 P0 y( @9 F% t* _/ i9 j9 g/ h$ J, [& V" q1 S# ]* q
This method of detection of SoftICE (as well as the following one) is1 u/ g% l* R: ?; _/ v8 C G; v+ ^
used by the majority of packers/encryptors found on Internet.; l5 v v: ^+ n" F- n3 E1 ^% t( P& _
It seeks the signature of BoundsChecker in SoftICE7 N( D' f" _; ] m1 M' o7 K
7 ?( }3 ]' U! X% B( }# N* u
mov ebp, 04243484Bh ; 'BCHK'3 g- p2 S9 t( E+ t5 q5 a) c
mov ax, 04h
$ Z/ ~+ c2 y( T4 {3 w! X! ~7 M0 O int 3
' Q [$ T% R+ y$ M1 L) w& A cmp al,4
+ B/ o& u( m1 `8 H jnz SoftICE_Detected/ O" r7 Y& i* p+ T4 K( \
- l- b& K$ P: {. }___________________________________________________________________________6 Q" ^0 e+ H- h/ i' C
( E0 l0 \1 L! s: e5 Z ~, q
Method 02$ _1 h! H5 n3 q+ D; ?0 g
=========4 N5 T1 |! X/ j" S
8 t9 c- y) ^' H8 B8 z8 KStill a method very much used (perhaps the most frequent one). It is used2 |' w! U' o" ] P' _ L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,% m; \) O7 h2 c; w+ V, }
or execute SoftICE commands...
, e! C/ {6 v8 G% {. m& UIt is also used to crash SoftICE and to force it to execute any commands
" z# C# e' G- z; R9 a(HBOOT...) :-((
. j: ]; f# C1 B* Q/ ~
- U( i q+ j& s, DHere is a quick description:! J* K- Y6 n- ]0 {# r2 k
-AX = 0910h (Display string in SIce windows); ^; t& c. e4 D4 C# _; h
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
" M m) Y. U' R-AX = 0912h (Get breakpoint infos)
1 u( [ `4 d8 j, U5 v/ j-AX = 0913h (Set Sice breakpoints): j8 T" x9 m; o) f
-AX = 0914h (Remove SIce breakoints)
9 J5 Z6 W5 K1 g+ C
) i0 C3 Z- b, VEach time you'll meet this trick, you'll see:3 R5 Y( { i% t' K, [) w
-SI = 4647h" E: i1 {8 Q* H& o8 r
-DI = 4A4Dh4 @+ |. ?$ `) u( \. H& f' {) D% r
Which are the 'magic values' used by SoftIce.
( |: t+ F+ B/ @' ?4 C2 iFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
0 H$ i, n7 [( a
2 z- L: ?. B: ]Here is one example from the file "Haspinst.exe" which is the dongle HASP' K. P$ e, ]+ A. f
Envelope utility use to protect DOS applications:
3 c4 E$ |4 F( i0 I% }$ d% L6 N. d# R) `! C( I
) g2 t! U8 C# d" u6 w4 `8 L7 c4C19:0095 MOV AX,0911 ; execute command.: H7 K0 V- C0 { F/ }. @
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).1 | J2 D0 L( E( |
4C19:009A MOV SI,4647 ; 1st magic value.; C& V1 V, L8 \7 Z
4C19:009D MOV DI,4A4D ; 2nd magic value.' b8 j+ s. i9 K/ q+ R7 h: I0 @
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)% ]0 t# o3 `# V
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% h) ?( h5 g: M9 x; G# _
4C19:00A4 INC CX# `9 W2 p' I9 ]1 \* l
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- `% Q: o/ ^4 f2 k& L
4C19:00A8 JB 0095 ; 6 different commands.
$ s& m1 u4 m) ]& [. R ^6 j4C19:00AA JMP 0002 ; Bad_Guy jmp back.9 ^; l$ `. B2 C
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- |2 \0 M$ r+ U+ B6 X, R# D+ t& _# H6 @& k/ d9 Y% g
The program will execute 6 different SIce commands located at ds:dx, which
1 L/ q$ H( p1 L$ c4 y+ d a" E8 N1 bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 v) b( [, j+ D) n
' {% q2 k; A' [$ J: J# K, E* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& l$ v z" U1 Y4 E( ~- W8 c3 `- N
___________________________________________________________________________
; _7 I8 O7 a1 b' r E$ ?' A- G% N: `6 X2 Y
6 C' T7 Q$ s6 y9 ]2 gMethod 03
1 E* D* k# L- X: F; J8 P+ H" \=========0 G; g: p! K2 E. r/ i
6 T @$ Y) d) r
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: T; v8 \( h0 G! D% b(API Get entry point)& t9 f; P2 \1 V- d, I
6 G) u5 u' |8 a# k7 A2 V
# F- p0 `& C) A. B; z$ E, R/ c xor di,di1 r* p/ {5 t' o% n
mov es,di
+ g6 h6 F9 a0 c% |9 @ mov ax, 1684h
& `8 r& p8 b; A# e, s: Q( z: ^ mov bx, 0202h ; VxD ID of winice7 S1 s4 [0 P1 d; @
int 2Fh
$ g8 ^3 A% ]5 k5 c! R mov ax, es ; ES:DI -> VxD API entry point
6 o7 M! k( C3 O0 ? q/ n, u2 a: b add ax, di
& i* [5 M6 [& L7 D2 |$ p- Y, D test ax,ax
" ?2 d- J. c7 V8 |( g+ l3 h jnz SoftICE_Detected3 ~1 q( _5 W) b- j: t4 Q
2 E* a4 h+ J/ w% D" [0 E
___________________________________________________________________________1 l) Y7 ]% n6 C+ y
# F& t' S; N+ x+ d; m8 U4 g7 o0 X& A
Method 04) X8 A/ J, h& Z6 y, l1 m1 o
=========
- F5 w* U# D- s. h9 S( `9 |* A9 K# X' Y) n: e0 X! d1 I
Method identical to the preceding one except that it seeks the ID of SoftICE5 r/ o2 r. M# ~/ |4 ?( M6 Z
GFX VxD.
% N$ y, N8 k& C5 \' z) h' V5 c
" k# C- G4 t2 N' C" W xor di,di
* q! T1 g7 Q4 S% T! P2 _. T- E mov es,di4 c8 h2 R" o) m$ a' T2 n' U
mov ax, 1684h
3 ]5 [" _( e, m/ K0 L6 c mov bx, 7a5Fh ; VxD ID of SIWVID
: ^% j; D3 Z+ q5 o int 2fh
; u0 |, q$ A) i mov ax, es ; ES:DI -> VxD API entry point8 Z; [4 A7 n& A# x
add ax, di/ i" {! F7 {, y
test ax,ax
/ d+ Q( E3 ~4 O9 Y% U) i; l1 h5 i jnz SoftICE_Detected' a2 H# p! ?2 v& y7 Q, L
1 A/ G' z/ ^. m$ V3 h) T) ]- M__________________________________________________________________________
, [* k# F& m% Q
- H p; f8 A* I" U) U5 [8 x. f- J' ]& g; H2 T" t3 ?
Method 05% ?' K/ S6 K1 s: B% C) F
=========" Z) [0 r. A7 g5 M( }# l
5 J# P `4 j# Z
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ [2 W- C% F7 c# ]; A1 n
debugger. It calls the int 41h, function 4Fh.
6 r& n' A- L7 e5 {, A( I+ s8 F. TThere are several alternatives.
7 ^8 }# B" t& y% |+ c8 z- u |" A3 x; g& z: x/ f
The following one is the simplest:5 y0 h9 n" l+ W. D( k
: \ _4 F }! G2 o; }; w* N
mov ax,4fh. w/ P1 i% O" {; U" Y, {
int 41h
- ^- J9 W$ J9 p) s, l+ n* G cmp ax, 0F386+ V/ \0 ~: x# I! j5 z% ~
jz SoftICE_detected
' L6 |( u. _0 ?! D
, L- w+ _* u1 [# u
1 ?( R3 E0 b% }+ a& T& J! n4 ^Next method as well as the following one are 2 examples from Stone's
' X; v! p7 a7 H! g"stn-wid.zip" (www.cracking.net):
1 _; p8 h: U. C! M1 u/ e. K: F% v/ T' Q: Y' ?3 X! Z1 j$ g% e
mov bx, cs
( R) Z/ y+ S" r9 E lea dx, int41handler2
2 V; M% G& |9 _ xchg dx, es:[41h*4]
; D5 j) S; A2 ~% R xchg bx, es:[41h*4+2]+ y9 m+ A% _- R& B
mov ax,4fh3 \/ C5 T3 R( Q
int 41h
8 { q! W/ P# j. n# T xchg dx, es:[41h*4]0 l" N! C/ e# F$ i( o; |6 Q4 Q
xchg bx, es:[41h*4+2]. v8 x1 ?9 i2 D: ^* e. j
cmp ax, 0f386h/ h6 B/ L" I2 y( e9 _& d- H
jz SoftICE_detected
- m& ?8 [ s2 n' N$ e9 O3 @( ^
8 B: H' {1 O2 K9 t* @" F1 F/ sint41handler2 PROC2 i: q7 \) n/ o8 N
iret3 x* p; y; j: Z- J3 K4 }
int41handler2 ENDP# t9 V# V6 ?, k+ k/ V
/ |! V9 K% G4 c5 U2 G/ R
8 d' J1 M: O; {3 |5 F
_________________________________________________________________________
/ q. X" s# U& P K2 t$ y- p `7 Z6 J6 g! j& G# v; b
8 i4 U% L- k7 LMethod 06
5 h/ E3 d3 D) X; j( Q=========+ F2 s2 M b0 R$ p. |. W. m A
* x1 ^" p; _0 b7 u! n/ Y- S$ t/ `/ n' y
2nd method similar to the preceding one but more difficult to detect:
/ `5 a& ^/ f) S6 r9 u0 @- Z. T4 t5 z* ]* A) z) D: w
P( f& \$ W( T, k" U& | x& B
int41handler PROC3 _- J5 w9 A0 }, h6 U1 }
mov cl,al
& T( V/ R/ f; h- ]& I8 Q6 n" e iret } {/ G0 q! f* P$ c$ A
int41handler ENDP. q4 d9 v( h4 G9 }( a" d
# S0 Q3 l' Q7 g3 [+ k1 H/ C
6 {) g: h: c k' B: L. C1 R xor ax,ax
# f; ^0 p2 V" \. b, c2 q% c mov es,ax
% q- @* a I7 W5 ^. }4 g& W mov bx, cs
/ v6 I- _- D& X' ]5 Q lea dx, int41handler! j6 `! e7 u0 T, i0 D" B9 B# k0 d6 W
xchg dx, es:[41h*4]
+ G- i8 |6 ~: s- b/ c1 l( ? xchg bx, es:[41h*4+2]% i4 G3 h0 K e) u. y- \8 d4 K$ j4 Q1 j
in al, 40h
* @$ _/ _" u. W$ M xor cx,cx
$ I" R$ v& I4 V$ E int 41h& P% z7 Z, K1 U( F3 ~
xchg dx, es:[41h*4]; |7 {2 }% e, b: V
xchg bx, es:[41h*4+2]
8 H7 p8 ~0 w" d- I A2 O cmp cl,al
+ u5 N& E% \, l- m jnz SoftICE_detected1 T2 M% j. n* @; d" G8 i' G' a9 D
/ h- O8 U: f" p) K( K_________________________________________________________________________
( S7 I/ c3 X6 B/ k( b3 Y7 w5 ?' l7 [: F" P
Method 07
. p- p2 ], Z6 z8 k4 t; I5 b=========
0 n2 s D+ W5 t
7 ]0 b" ~ P* |. i6 d$ wMethod of detection of the WinICE handler in the int68h (V86)3 m7 @ o+ l0 M$ G4 {8 r, a& w9 E
7 _, e/ n5 V x8 M. u- ] mov ah,43h% i3 z) V# z1 V3 A- v9 L3 K. H
int 68h$ L8 g5 A5 S* A5 T" q; u I3 `
cmp ax,0F386h: \, v' c! ?+ A) _
jz SoftICE_Detected* t$ B- p! w1 T& _& m7 j
" i8 |6 t! N. e( P8 K
6 v2 f. }* A k1 C1 t* Y" u2 h
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 x" e" ] V' }) R- g' K! ? app like this:, h2 k$ C0 f7 E5 R1 e
1 w: O: I$ L! s) f7 s9 Q# ?$ v BPX exec_int if ax==68
5 H# G: G3 `) h) O2 T( h0 b (function called is located at byte ptr [ebp+1Dh] and client eip is9 }: `# L( d/ \$ x3 s5 Z
located at [ebp+48h] for 32Bit apps)3 Y9 g) O( B- y5 F% d
__________________________________________________________________________3 T2 q) ~! Q# B; N! v. u9 w
2 C6 |& E- [' g* ~- O# Z0 Z1 g# f1 o5 r0 a K
Method 08, H7 M' [! H2 }, m1 {. h+ h5 B
=========3 }5 o8 j9 C+ Y+ i1 c- @$ [
. D8 r# b9 j5 W4 F& z7 \) ]
It is not a method of detection of SoftICE but a possibility to crash the
5 Q) Q7 q) W# C$ N" T ^system by intercepting int 01h and int 03h and redirecting them to another
9 W5 H" j1 p+ n- E5 Qroutine.( b( k: w/ [, o' ~7 m% t0 C) ]2 U3 J& U
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, g |8 T; I* j4 v
to the new routine to execute (hangs computer...)8 m6 f! M. r! K: _9 j2 j
# e$ n) Y7 D/ U4 `2 W8 C mov ah, 25h
3 k8 p& p/ y5 T) Z9 z mov al, Int_Number (01h or 03h)! X' `, f9 N! l" y* B+ d
mov dx, offset New_Int_Routine
" T. G2 x( a1 I% r int 21h
: x* W$ g' A: O8 u0 ~* m
# @% {9 r. r2 o__________________________________________________________________________& | R' L% [; i7 J+ l- L; Y$ \. d2 E
( {4 c6 |' w$ |0 q
Method 09
! Y' u! D* R# \# d& ]% t=========8 G" t- @5 S Q- O
( G- b& O6 ]( r4 B# f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* |, }5 w# b! j! o7 y- ~
performed in ring0 (VxD or a ring3 app using the VxdCall).
! T. J. F# d$ {& }. E1 k0 HThe Get_DDB service is used to determine whether or not a VxD is installed
( R6 `# k* D! e6 l* Zfor the specified device and returns a Device Description Block (in ecx) for
; `% Z* s3 V# D- U. O5 Ythat device if it is installed.* N- p/ S5 V8 e4 v' }3 v
7 l1 f% I& b. z% X
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID P: R- z& a1 A5 z) M1 K2 ]
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( Z) c- o7 J: Q, u% j' b
VMMCall Get_DDB" P9 E* r8 g( x- p f
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
6 a6 i: W* `8 m q
/ {* W3 T7 f0 \& L" ONote as well that you can easily detect this method with SoftICE:# r1 f: e& F. Y$ E! v4 A
bpx Get_DDB if ax==0202 || ax==7a5fh
% @% P* C. \# [* F6 \
. n" F+ P( v4 \6 G: ~5 b$ Y__________________________________________________________________________
0 W+ a0 z) Y% T7 c- C5 Y4 {* N: m7 Z* `$ Z7 B- `0 B
Method 10
: v, H' A( H5 o5 j* |=========# @$ @/ y7 H* Y/ M% J
' X$ J( ]. h. p3 f9 e1 c Y3 `=>Disable or clear breakpoints before using this feature. DO NOT trace with, Q+ O8 \* ~7 r: w2 d$ O
SoftICE while the option is enable!!( ?7 r; j) d9 D& k1 F: g9 x+ Z
" R+ l/ a3 K8 y+ v( S t; _This trick is very efficient:' n0 {8 S% ?3 a! ^+ L
by checking the Debug Registers, you can detect if SoftICE is loaded
* ~7 }% U; r( z8 _(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 ^' g& [0 X0 Z4 K) r" }. Y
there are some memory breakpoints set (dr0 to dr3) simply by reading their V: i; x' J L9 d
value (in ring0 only). Values can be manipulated and or changed as well+ B/ Z& q9 X9 O7 N" D; k* S
(clearing BPMs for instance)
( N3 t k+ U& {; f: W4 A/ J
1 D- q5 O9 Y6 J: V__________________________________________________________________________
# X! o* a0 \, n2 Y% {
& F1 Y' G. M+ W+ T0 E. AMethod 11
- Y0 b5 J5 j" ~6 y! C8 t=========
; ^/ _2 }/ w- `7 \' M U
7 | @: U4 { J/ l: Z% h! }This method is most known as 'MeltICE' because it has been freely distributed
/ R. O2 A( W" Y4 j) F; c. `% @% zvia www.winfiles.com. However it was first used by NuMega people to allow
7 j1 i8 [, ^9 l) x& j" D7 d1 W3 `Symbol Loader to check if SoftICE was active or not (the code is located
' ~ I+ j# I- w1 Kinside nmtrans.dll).
; {5 p$ p! P1 U6 x* G
" Z. _5 ?, S1 p5 ^The way it works is very simple:
2 W2 D$ ^; @ f9 ~7 v! z4 }% ~It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for U" \$ G8 L& V; Z+ P/ Y! k8 _
WinNT) with the CreateFileA API.2 U2 h5 N2 G7 Y; _. {
0 W4 x, q' O E; [Here is a sample (checking for 'SICE'):
$ I9 \6 a9 y& N* i0 G3 W* U* E. w, q( P/ B: p
BOOL IsSoftIce95Loaded()
$ |! \! R3 Q; {0 `: ^7 G5 d2 V5 Z+ J{- k2 T- J, K8 \8 q3 ^' A' }( T5 h1 m& B
HANDLE hFile; ( `) k; o& G% s4 Z$ D5 O K) j) W1 ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 {% l* _. s7 X FILE_SHARE_READ | FILE_SHARE_WRITE,( ?: G! J( q! G: L. Q
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 |. r0 h7 {9 h# k+ T
if( hFile != INVALID_HANDLE_VALUE )9 V. A3 i% p; `+ m- @
{
8 C' Y9 p7 x4 s5 h/ e8 z" C* q CloseHandle(hFile);! r/ d0 I: I3 i1 y& s
return TRUE;6 G$ }1 A, a0 c! {
}
' ?, z3 P" s5 V5 k3 } return FALSE;$ |: R7 @% ~+ y- p( [! D
}
" g, o( K9 }' e: _: k6 V* X- {1 d3 k: X% \
Although this trick calls the CreateFileA function, don't even expect to be
8 B* B; }5 F- P; ]3 Z$ Q0 j1 |: qable to intercept it by installing a IFS hook: it will not work, no way!$ J& l9 I0 \ y6 e3 K! e0 i
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
- ?& P; d! ?$ y: L5 ]8 Rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 g- ^- q& X6 n( W
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ ^' P5 X9 f" F' Ufield.
8 b1 N& [8 K4 fIn fact, its purpose is not to load/unload VxDs but only to send a 6 i" t7 n Y2 g
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 a, i. o( l. C; A. m- z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' L" I5 P; h' j$ M, X1 J* M
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
) n. s/ l) ~# a0 JIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ ^& B* X4 l; X0 ]% n1 Oits handle to be opened and then, will be detected.% q- b0 N6 |% \8 w5 l5 m
You can check that simply by hooking Winice.exe control proc entry point
7 Z5 ?. m7 R6 ?& z; @- b& m+ Qwhile running MeltICE.
3 R$ K* t/ A+ o- _) C" X/ R/ K% y' ]. z
% l7 V1 O. n- d7 N& h9 A+ N 00401067: push 00402025 ; \\.\SICE8 d; c R! k9 g0 k$ N0 S
0040106C: call CreateFileA) r- {/ b9 Y2 j4 a; N
00401071: cmp eax,-001
2 @ P! ]9 ]; W0 w8 y& p 00401074: je 00401091
9 \% S( @& N( k6 u# z
" Z" \2 O" n' m1 W7 S+ C& Q
, _% r, V. ]/ mThere could be hundreds of BPX you could use to detect this trick.& Y6 u# s6 }$ _: i E& b- S
-The most classical one is:
/ p! r5 x+ U" N. q8 i ] z BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
/ H2 B& H1 S, I. J *(esp->4+4)=='NTIC'3 x0 L9 G$ J6 n, W- \8 {* ^2 n
e; A- U& Z4 K: q: _9 N-The most exotic ones (could be very slooooow :-() \; F" i! x9 Z( s
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' K& h7 c4 M7 P! }$ ~$ w ;will break 3 times :-(
! x9 {! f- z8 N/ ?% i2 g6 O% C) E9 a' d
-or (a bit) faster:
# w3 e9 X' @) I. G' e BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
m' f+ Y* B: c9 ~$ C- s
! n/ Z1 Z" ~, ~4 H' W BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
x* ^% Y4 H0 z4 p% i' c6 X ;will break 3 times :-(
8 }) }# o0 a0 L- }/ ?( W- X5 C1 c% F, ^
-Much faster:
* Y( v' \; v+ Z# d. G! W BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) d! X, Y, G" ~. p8 t0 ~
8 I$ j- H$ \9 |; X% [7 pNote also that some programs (like AZPR3.00) use de old 16-bit _lopen" Y( j5 Q7 G* L2 T; x6 H
function to do the same job:
6 Q. r) }) ?! Z5 n; n2 [
7 g. ^1 v" y0 h+ e* i$ C* f# ] push 00 ; OF_READ
5 a" n! i5 m0 C3 ]6 t" T/ S mov eax,[00656634] ; '\\.\SICE',0/ s8 X0 P6 Q/ M+ V# v
push eax
3 f* u. d6 ?; V/ y. W7 H( { call KERNEL32!_lopen/ W% i* e" }2 y. K3 U
inc eax K$ r3 d7 F% v9 z" p3 [$ ~
jnz 00650589 ; detected3 X" N3 x. ~3 n
push 00 ; OF_READ* x/ p/ {& y! C
mov eax,[00656638] ; '\\.\SICE'
7 B5 B4 Z$ \# l push eax
. }" r! @2 i' C% p" N call KERNEL32!_lopen9 ~! ]& S2 k& ~5 J% {
inc eax
- z2 J4 L' f6 b4 c* Y jz 006505ae ; not detected" B' t0 G4 J7 ?$ d2 `1 T8 T, d
. U4 u/ d' O8 W1 M; I4 z: }+ P, a* p! A8 S) A
__________________________________________________________________________
+ n# j- a- {7 C" m+ j$ K' ~0 _ L
1 b" Q. ?& |/ j9 Y* c8 bMethod 122 H: b+ U& F5 o- m
=========
8 P8 I. M9 P0 }8 C% Q
! {/ P: P2 S% s$ s% l9 w4 ^This trick is similar to int41h/4fh Debugger installation check (code 05
3 n7 U+ _6 s9 v1 ?( g3 ?* v2 e* U& 06) but very limited because it's only available for Win95/98 (not NT)5 |! ^, |! {! f2 \4 g g) @/ N
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.2 C2 i* L# @) A: o
& G+ v# I# O" x9 y( o3 ~- y- t push 0000004fh ; function 4fh( J+ p. c. ^9 v" W- ]1 b! F+ u
push 002a002ah ; high word specifies which VxD (VWIN32)
+ R+ O. g4 Z9 `$ { ; low word specifies which service
% N) m7 {1 p1 W4 j' ?( I (VWIN32_Int41Dispatch)
# @% |/ B' X! i1 {, E call Kernel32!ORD_001 ; VxdCall
/ s7 Y4 ]* ?+ x4 W% v& x2 { cmp ax, 0f386h ; magic number returned by system debuggers3 L2 H/ N7 \( C
jz SoftICE_detected
- \0 Q3 @9 T) B1 ?. P- E! h
4 W% p8 k+ ~6 ] p3 CHere again, several ways to detect it:
! f+ J: E/ B' Y. |' x& J' r8 `6 c: M9 x) {. L) Q. N
BPINT 41 if ax==4f
* @. g! t- a8 @, j. V6 _6 x
2 ]. \9 C9 o/ S9 D3 c0 H BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, _/ s- U3 P- Z
% K3 m3 l1 I8 D$ `
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A4 |8 k) V; ^) a5 {( g5 Y% Z) d
) u2 Z% w! `# w
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
* l: I& e8 Y1 H* x2 J$ C3 }
7 g; |7 Q) w* T7 T/ ^+ B__________________________________________________________________________
5 v+ m! A9 F" P1 ]+ Q I6 h' w& p0 b1 Y
Method 13& x6 o3 [0 _2 u
=========
) k9 b$ B6 p( \3 q2 e6 s m
; \3 ~" ^) @7 D" n. D$ u% eNot a real method of detection, but a good way to know if SoftICE is& y3 S! @2 n8 O7 \
installed on a computer and to locate its installation directory.
2 h* [3 ~5 l( N% p% tIt is used by few softs which access the following registry keys (usually #2) :/ x: @( s4 p1 ?$ F2 A& W
( [/ L7 S# N8 w1 n-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: S/ f2 a" f& Y1 Q! _2 Y5 j
\Uninstall\SoftICE
! X3 g$ K) u8 Z E' v-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 H1 j/ F0 {9 `" _-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# Q5 m- Q \. n7 u5 E" f1 w- G
\App Paths\Loader32.Exe
$ M8 r y. A) N4 L
8 p5 i2 r- F3 U
5 n) o% x1 l4 x$ j; B% E$ aNote that some nasty apps could then erase all files from SoftICE directory9 X8 Y( T! |" N9 A( j( v
(I faced that once :-(
1 H. x3 a" l4 c, c* X
( {( n$ x. S2 `" s3 m5 sUseful breakpoint to detect it:
$ I2 G+ `/ v# u/ w
) n6 K( o4 \5 q! A+ q J BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
m% K ]3 G P \0 E: v2 R7 u& m( D: C5 p* p# M0 T- ?
__________________________________________________________________________- a2 i( D9 o& U1 ?7 |# W
2 P; G+ ^" j/ h4 C6 c* c$ V W
?& {# w: O* D# ?9 g3 }Method 14
) c J- R3 ^3 x4 w( K=========
0 u# k4 ]+ j: G, F, C0 C6 d6 y! I7 o6 n }
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. a. Y; Z: D" ^2 `3 @) v8 Y3 l, K
is to determines whether a debugger is running on your system (ring0 only).
7 T+ k( ~( _/ m' f# T' C. O) _
2 M8 z, J; `* ?" e; |% @) o0 A: A& g VMMCall Test_Debug_Installed; Y, ?- v4 r. X9 B( [2 k. C: b2 @
je not_installed
, Z2 ^3 O6 h! e& u* E& o, h3 Z
1 W, g9 n% R% W% n0 DThis service just checks a flag.
6 F! N6 V5 X+ V; w. d( p) ~</PRE></TD></TR></TBODY></TABLE> |