<TABLE width=500>& t5 O2 g# i3 D$ M' S x
<TBODY>
* t7 j) u$ I7 V$ t2 @) C( P6 X6 g) u<TR>
) _7 }- m* A$ A7 r5 v5 {<TD><PRE>Method 01
5 o( v+ O4 k- ~, _" u=========$ Y# ]1 p( M% q3 `8 ^' R' j8 A
/ d+ r. \8 S3 |6 V6 [) ]This method of detection of SoftICE (as well as the following one) is
# Y" ] K8 r0 j! e9 Z. f3 Iused by the majority of packers/encryptors found on Internet.
2 [' D1 B# |! C2 i# I. W2 Y8 b" w) [It seeks the signature of BoundsChecker in SoftICE( n% p+ Z; Y6 l7 ?- P5 E% d
1 U9 V/ y5 T# I3 H# M0 u
mov ebp, 04243484Bh ; 'BCHK'
! s5 T9 x. S. r9 L" b, g7 W! ?% [ mov ax, 04h
1 r8 x! d0 y5 |7 b4 |) L int 3 9 ]; m& `/ l2 k2 p; u
cmp al,4
2 c( K$ ?5 J* M8 ^ c; z% C" n- [ jnz SoftICE_Detected
; e; m* A1 @. T5 l+ m1 h% V; F
- ?6 i3 f- c; J1 U$ z& O2 W" [___________________________________________________________________________- `* c; \' O& a6 d
/ u& ]; \- a$ P, H6 |Method 02
% A+ S9 U5 }" a9 ?* `2 t& |=========+ h. W+ Y, E% c
( }( P( N# O: M) b) c) EStill a method very much used (perhaps the most frequent one). It is used
2 l5 A8 U5 ^! Qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 M% _2 m0 ^( x
or execute SoftICE commands...9 l" Q7 J9 J: J, _
It is also used to crash SoftICE and to force it to execute any commands
( K- x4 p4 M1 r6 Q: M(HBOOT...) :-(( 5 j# b4 P7 Q5 ?' K; W
- W* X% ], x& ^0 |& W* J
Here is a quick description:
- O [$ S- a7 `-AX = 0910h (Display string in SIce windows); C: b3 i* h- ]5 q* q
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
2 k5 T' Z+ r w! S-AX = 0912h (Get breakpoint infos)
]( A! w# ]- _- p-AX = 0913h (Set Sice breakpoints)
$ p" i4 Q: _8 F2 q-AX = 0914h (Remove SIce breakoints)3 G* ~. _; M) N4 \# I& r
: ?% F. ?8 }/ y+ h" h6 C5 M5 G3 bEach time you'll meet this trick, you'll see:' J6 n; c6 p% q# \4 E3 e
-SI = 4647h
1 c X' z. E$ S9 l-DI = 4A4Dh" C Y& o' F2 ]/ q; q% J! D3 E/ X
Which are the 'magic values' used by SoftIce.
3 M( h( i3 w8 w7 u* z) EFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& e( f) c# j2 N& E
/ p9 c( u& Z t9 {4 M; oHere is one example from the file "Haspinst.exe" which is the dongle HASP! a' { O8 b! i2 X$ p' o1 |/ }. K
Envelope utility use to protect DOS applications:. O, }3 o) T- }- q6 W; i" X
5 _" c+ \; p3 k; I* a* i1 r9 U7 p3 ^8 s7 p o' t# Q3 `
4C19:0095 MOV AX,0911 ; execute command.
% f# K$ u) M; H6 Z z! n; {+ ~4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).$ {+ c+ r- H$ k
4C19:009A MOV SI,4647 ; 1st magic value.
. T; e" k T) S4C19:009D MOV DI,4A4D ; 2nd magic value.* F* _0 X0 D5 J9 [' g% P
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( `3 F6 G! }( f* X) W! b4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, u9 `" v9 d }4C19:00A4 INC CX
! |- T4 H8 _! ]* g& [4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
$ M9 J6 z H6 ?4C19:00A8 JB 0095 ; 6 different commands./ K& R& e% Y- Z, i8 w( c. ~. n$ y* H
4C19:00AA JMP 0002 ; Bad_Guy jmp back." Q5 ?% ^, l5 U% Q6 _6 m/ r1 ] @; `
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)8 q% a9 ?( n* t% F( W
; z5 E, X7 T& ~4 i c# K
The program will execute 6 different SIce commands located at ds:dx, which: c& L1 _# y9 Y7 Z+ c$ N
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. I. D8 a2 x9 k& m+ U) _+ \
7 E0 o2 Z; f9 u! |
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.# O1 M6 l3 |- J' [
___________________________________________________________________________
( C# @! `) c `8 X- j3 J+ V: h
: w# j8 M3 {0 A9 u7 k% p: |- b# f* R( c& [
$ L$ [% K; K- x3 _( h3 _* w. AMethod 03
@ e/ o% |" ]+ n* m& f. D=========8 Y+ Z' E# F0 q" p6 T
( ^6 s4 n7 @" P; D( i6 pLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- o1 {3 s M; ?(API Get entry point)
6 K. [. b2 e- F0 d7 g
4 h" V1 ]+ G9 Y- H( _+ H; D
6 q& c; c9 e) V xor di,di
6 C: _6 T5 e1 d! `9 i- F mov es,di
" I. z0 k6 F! T+ y! t% q* l% h mov ax, 1684h 7 `5 F, }) a1 \# d2 L" }. |: p
mov bx, 0202h ; VxD ID of winice
* P+ m% @3 R% D# G9 q7 K, } int 2Fh
. ^5 w3 g4 j3 o4 y mov ax, es ; ES:DI -> VxD API entry point
7 b% B" S$ ]! c2 L( j; G+ b add ax, di/ _, L/ O. g2 g. ^$ V/ O- ]
test ax,ax
! O% z* o o3 @ jnz SoftICE_Detected7 c4 Y! f+ @. R9 z) f8 r' x
1 W5 `- d0 a( S( S* N& Y8 B5 N8 [, z___________________________________________________________________________
% A0 G _8 y! a7 k5 w2 M
* O! `8 Q: f2 o' B9 ~6 d. k p1 JMethod 041 U0 u. O+ T8 z! M( v" r% e* s
=========7 d; ] R0 p# T# D* |% l% U
# |( r" X6 ], k6 hMethod identical to the preceding one except that it seeks the ID of SoftICE
, x' b* k S* G; VGFX VxD." R8 k n" A5 q9 I8 a' q. l0 E
) A) ]. G8 P* ]) _/ D# `) [5 J
xor di,di
9 x7 z( P, o$ v/ ]! x9 Q mov es,di
6 P' {* j9 h4 Z6 D4 C mov ax, 1684h - ? ^: |# ]- J4 X' b3 d7 S. }# I
mov bx, 7a5Fh ; VxD ID of SIWVID
5 |: ] {$ D7 y' p$ U/ x int 2fh
! w# Y: v6 ?6 M2 P6 x b+ v mov ax, es ; ES:DI -> VxD API entry point9 l% W1 N1 D+ t3 b0 O
add ax, di
, T7 [( m8 D. x6 m0 }) l# X test ax,ax4 E- `; r; e% ~7 X3 U& M
jnz SoftICE_Detected
. y. a) P* J' O4 {. K. w
9 E w' j" H( ?8 D__________________________________________________________________________0 [' `5 |* Z1 Z T
; V1 X1 {- @% J
. b ^3 Q4 U1 Z+ n$ \5 W! EMethod 05
0 m; K. d! Z6 y M, l=========3 ?. B( R9 C4 Z
V; e8 w6 O2 f0 w& W5 C @" Z U5 ^Method seeking the 'magic number' 0F386h returned (in ax) by all system
5 m& ] E; X. Cdebugger. It calls the int 41h, function 4Fh.
5 y* s; J! t: X* _& _There are several alternatives. ) d e, f0 V8 m$ e8 [6 u8 e
' a( j1 B/ ], C6 H! H: ?
The following one is the simplest:
2 g" H" n& d, R3 s
0 l+ ~/ g$ J3 z4 Y0 c; u mov ax,4fh
* c/ W* @/ Z; q" S int 41h9 j, J3 h3 A3 i* j% ?
cmp ax, 0F386
3 p. u; @8 U+ W& @ jz SoftICE_detected' h8 e) X- Y# B
. e) j5 w: q# ~" b# N
( f+ Y( w, r0 f' B- LNext method as well as the following one are 2 examples from Stone's 7 q, a2 A& `% z; `: b# m2 h
"stn-wid.zip" (www.cracking.net):
* |. o! G3 D5 v( S
& o$ ~" Y- g6 I- O6 c mov bx, cs
4 p2 w3 e n2 l lea dx, int41handler2
/ s9 y) ]7 C6 s* m xchg dx, es:[41h*4]
2 |$ e; [( F3 [# M- ? xchg bx, es:[41h*4+2]
+ {! Q+ y6 y l" _3 J* c4 j7 F mov ax,4fh
0 |( S9 M8 s, x0 i" Z5 X- I& R int 41h, t7 _9 ]3 v1 z' m
xchg dx, es:[41h*4]9 B# _1 X& M8 B0 {8 H
xchg bx, es:[41h*4+2], D) \' S0 E0 g' ]4 X: i
cmp ax, 0f386h) d( s6 U$ N) R, Z
jz SoftICE_detected9 ?3 i' p% x3 n
# c0 C; L E# B( I% |
int41handler2 PROC& C+ _# q: ?$ z* i
iret
+ g6 v6 U: ?. N, p8 L7 aint41handler2 ENDP4 o' t" @# t1 o( {1 I
( z# b# r' ~+ w3 G d2 I E6 [) a" _1 ]+ T% ?% V" o
_________________________________________________________________________
) k$ F" A* d' E( K- U
# l$ f2 s! R- ?5 d2 Y5 ]& `6 A+ Z# { c2 U8 ?
Method 066 T9 l! z( ~! k& h
=========% `! ~( g) W; q. [$ s [
# S' r* Q0 h. H1 p. j; [/ B9 q, Q$ b
* {& h8 Q2 ]+ G2nd method similar to the preceding one but more difficult to detect:
% i; ?* J6 R9 o/ D% b
( Z* e* A, {( `# A* F( z* `/ \1 c6 {; F$ A
int41handler PROC. S5 Q& y2 |9 F' Q% H
mov cl,al
2 ^" \2 l; k; r iret( g( M/ `2 c: U
int41handler ENDP
1 w5 m; n! m/ I6 W! b& ~
# H' O4 K. h! R
! a: J9 u* V9 y" u; c2 D: Y xor ax,ax% M& g* {$ f% U
mov es,ax
0 G0 A0 [5 [+ y7 @$ e! x e7 | mov bx, cs- R4 _( `% E3 R. y1 F$ j( n# w
lea dx, int41handler
, ]. `( K# y' N5 c8 W: K xchg dx, es:[41h*4]
! p7 K2 @% |5 k- m xchg bx, es:[41h*4+2]
, ~; m, d7 g7 E E# c in al, 40h% S1 }1 o, B1 M: j( G
xor cx,cx! y1 }; M1 o8 m3 w( Q1 w5 z5 g4 u, t
int 41h
0 G7 E: ^+ m0 K0 Y7 Z xchg dx, es:[41h*4]
5 p- r7 @7 |2 A+ r xchg bx, es:[41h*4+2]# d8 Z: v+ Q* R- z3 q* Q! M
cmp cl,al3 p$ ?( B8 W3 P! b
jnz SoftICE_detected
& x8 ]3 r* [' A+ ~# \9 c& ]
% b! P( w& h( n- O' L! d7 b! m_________________________________________________________________________1 r( g7 ~% ?0 j$ N- }
; C u% G6 m. f( c3 @' C( f8 YMethod 072 Q5 A% `2 ]! }/ R" V5 n
=========/ E$ {$ V8 I4 G6 o7 w/ o
8 B, j+ \4 _" r2 I3 rMethod of detection of the WinICE handler in the int68h (V86)7 f/ G. @4 R2 B8 W
& O/ Q7 z* `) ^. d: U" p mov ah,43h
$ e) z6 D$ g4 E4 f# }! P int 68h
/ F) m4 [! \- Y$ Y9 ^% g cmp ax,0F386h) N1 z/ `8 \/ C. U0 X: z: Z
jz SoftICE_Detected1 _) t* L! E( J$ Y
2 q3 W% } I. E' r% E
! d; W; ? }: q7 D3 W=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit4 ~ ?2 f8 }% }: x* u
app like this:/ S+ i5 \7 m) ^% K4 M
* k. ~3 X% Z+ h) J* U BPX exec_int if ax==68- e( ~' C5 t Q5 F
(function called is located at byte ptr [ebp+1Dh] and client eip is4 @2 Y; m9 ?7 P) P
located at [ebp+48h] for 32Bit apps)
7 d/ R5 q, c) E# I3 v+ t3 n1 K__________________________________________________________________________; ` @) u |7 n2 `" J. d
! S+ D9 ~ H( H- k0 a
9 J2 U n O* sMethod 08
/ U; P5 S! X; z=========/ e9 R3 b. N3 M a# h. _! i
5 S, O. G7 a& r; x
It is not a method of detection of SoftICE but a possibility to crash the
& `) G) C: M- K% X- ?system by intercepting int 01h and int 03h and redirecting them to another
$ y3 |3 \6 p( g4 l7 `routine. X. f0 I' ]/ k, Z$ R
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' e2 W0 w' ~0 y
to the new routine to execute (hangs computer...)& I" y* E" m9 u7 p5 p4 F6 m, p
& i+ H4 i: ~) E mov ah, 25h
+ l+ r* b# J: J mov al, Int_Number (01h or 03h): g$ s- g( U$ M7 c. Z
mov dx, offset New_Int_Routine
: g T7 R. S5 L; N4 P# b5 X+ p int 21h) F/ d0 j3 V) W2 Q5 u! Y4 n) C1 K
3 e$ e: n6 m M
__________________________________________________________________________
3 i7 b0 {# I5 @% h/ N0 q% }$ r/ V4 B& U; j3 X/ t
Method 09
- r7 l4 L- Q! h( F1 l) _ {=========* K# f/ H7 e" {& ~% L/ A
: L1 O# K6 |# @2 vThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ c7 B6 u1 p3 Q; g
performed in ring0 (VxD or a ring3 app using the VxdCall).( E1 o( q' C0 S% C! f- T
The Get_DDB service is used to determine whether or not a VxD is installed
% U' M. Z2 [+ _for the specified device and returns a Device Description Block (in ecx) for1 s7 r2 g9 x# C" _$ K
that device if it is installed.
/ [ n( T9 R, M/ f! F
7 k- T" L5 L0 U3 ^- l mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 b a X. X) a( u6 `' E mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)4 u# R* k5 b o2 _8 i- }$ L0 i
VMMCall Get_DDB
& c; U; b/ p# u# s7 [$ ~$ V. ^ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' f5 l8 }6 C5 D z, ~/ \
) u' u7 u9 H7 ~
Note as well that you can easily detect this method with SoftICE:
1 ]" N* u* J( x; J bpx Get_DDB if ax==0202 || ax==7a5fh4 J) p+ d& E, O4 ~" D
% s& Q! [5 u# m0 l
__________________________________________________________________________8 p. N% z$ C& ^$ H
+ H2 o) f% L2 V4 y- ^6 BMethod 10
" c, G7 B/ U" @+ j2 `7 l L3 A=========
% ]- u4 @' A( }9 X/ y/ c O
3 X+ i( n7 B; ]! h% a# G0 q% ]=>Disable or clear breakpoints before using this feature. DO NOT trace with
5 A; i# x+ @- S# A' `7 V+ I$ L SoftICE while the option is enable!!
8 @! r b; H8 a
- h* R0 k4 g b) `* ]0 I' [0 `! NThis trick is very efficient:! L5 o& ?6 U( R0 s8 H
by checking the Debug Registers, you can detect if SoftICE is loaded
9 j6 i5 `# _! |7 J6 |# e(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
3 M% S9 @6 A" S' t Y5 \1 d5 |& Ythere are some memory breakpoints set (dr0 to dr3) simply by reading their
: R# r$ Y; n% l' kvalue (in ring0 only). Values can be manipulated and or changed as well
# L1 J) u4 a2 P) K(clearing BPMs for instance)' m2 Z7 ^$ m$ z
# I+ ]2 x1 ~& n# z8 i5 c+ Z
__________________________________________________________________________
; K$ a7 A+ O3 a" [2 X8 |9 l3 C3 `$ {2 A, M0 q" x) \, F: i6 {5 m
Method 11
& ~9 `+ }# T, t0 ~7 m=========
* Y" m( {; O$ U2 c8 l. Z
: M# r/ l% r# B, L {: T, O% FThis method is most known as 'MeltICE' because it has been freely distributed
# P- D# o0 v+ G' _via www.winfiles.com. However it was first used by NuMega people to allow; A0 _1 ?1 d% [$ f$ Z$ _' B
Symbol Loader to check if SoftICE was active or not (the code is located+ `# R' g9 a7 \. {+ T9 R6 a
inside nmtrans.dll).
: _/ g1 o4 A2 a3 l) B3 x! u" g5 x0 B% [. |+ y
The way it works is very simple:
4 G# O# Z+ l4 ?It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& Z$ S/ f9 B J' [! m
WinNT) with the CreateFileA API.8 V7 \3 l4 t8 G% E) A( R
/ i; A4 C/ e/ M6 e& DHere is a sample (checking for 'SICE'):( h$ H5 Y4 E Z2 L8 M( W
8 R) U4 k5 ~$ ^6 X" ^BOOL IsSoftIce95Loaded(), s# N: m# o* J2 v9 l2 L
{
; X( e" v$ I, V. \) g1 P6 [; g HANDLE hFile; ( { K; e/ u. @2 K. q5 ?/ C
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ h. o/ T3 |/ _4 N3 F: d FILE_SHARE_READ | FILE_SHARE_WRITE, O* ~9 B8 o/ d0 J8 t
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 t! h6 ~. @3 Y6 x' Y9 q
if( hFile != INVALID_HANDLE_VALUE )) d# ?7 w9 Z7 |/ ?8 }" B: l0 `
{- A: j" K/ M6 f7 ?' M7 ~
CloseHandle(hFile);
" `! Z4 I- P% \' V/ o3 H8 Y. m0 l return TRUE;0 C5 o, o; D N7 p
}
8 L, \7 H. {) e- P8 m return FALSE;
4 E6 p- {+ u, O0 k: O}7 ~1 }/ V' w% I0 O& K+ V* u
9 A; e- B. x3 v `1 c; yAlthough this trick calls the CreateFileA function, don't even expect to be
) h- `: y9 O3 ~able to intercept it by installing a IFS hook: it will not work, no way!
0 P5 \# n/ ~% e: T M8 \In fact, after the call to CreateFileA it will get through VWIN32 0x001F
c# c5 t E) `' R* y' o" T- E% {service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! [$ q% r6 k, {9 z; I6 {* \' Y
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; X, P' G; n, Q+ A+ u1 _! [& K+ Ufield.3 Z/ ]$ J. |6 H- {8 Q: Y4 W5 ^
In fact, its purpose is not to load/unload VxDs but only to send a
0 }, L2 m: x, [6 ?% a* L8 n X: OW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 T0 j7 f, U9 h5 @5 W6 k, u
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 H, r( S/ O# [- k; u, cto load/unload a non-dynamically loadable driver such as SoftICE ;-).
9 T: H. p& o/ Y' oIf the VxD is loaded, it will always clear eax and the Carry flag to allow- c3 [# [! H$ v
its handle to be opened and then, will be detected., e9 l1 N+ R; Y' V
You can check that simply by hooking Winice.exe control proc entry point6 C; [8 h8 w/ u6 b
while running MeltICE.
/ n+ J% r/ ^" A3 s& p5 E0 {7 w# v( W# U
: T/ n9 k3 z) `; l
00401067: push 00402025 ; \\.\SICE5 k; |8 i4 e' ^! M' _" o
0040106C: call CreateFileA+ b$ m0 ^4 C" W" y. i- `) q
00401071: cmp eax,-001) W$ p" M: L x% @0 Q. O5 \
00401074: je 00401091$ d3 y/ W$ Q" T* v3 m' ]
6 F' `$ L( S1 B0 N
7 ?: r9 {+ s; yThere could be hundreds of BPX you could use to detect this trick.
( ]) h4 w7 N; M1 \8 Y-The most classical one is:/ f& L: l2 E3 m( n+ \7 A. T
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* P6 U; v% ?0 G1 D( u' _9 f0 e; E *(esp->4+4)=='NTIC'# j. K7 a4 Z7 `3 S! R2 u7 W. G
' C3 z. ~1 J* v
-The most exotic ones (could be very slooooow :-($ M/ W2 }8 M2 A8 o* _: G
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') $ |& M# |! T; H
;will break 3 times :-(
3 z3 p( [1 v6 J& P- H0 e, y
2 }+ ^% y: n/ q4 X3 H-or (a bit) faster: 4 A; J3 i2 C! O7 @( A6 w4 v
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 G" x$ t5 _' g4 N- l% g
# o2 R8 i' B5 ^/ Y# O) H6 G a- _5 U BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + n3 c6 R, n9 A( L. X% P4 D
;will break 3 times :-(
( }* L0 W9 Y: R6 s
8 W0 V6 k# F; E, x-Much faster:# }$ M+ p/ z+ k, E: F! V
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'$ I" K/ {7 M7 x' u9 W8 F
; z/ r7 t* h9 y; B7 n! }3 }; MNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 ?) L; s, V0 O& G/ ^9 u; G' U" ^2 Mfunction to do the same job: I7 Q- H1 ^& Q
r- Z9 g+ c% W& k0 V
push 00 ; OF_READ5 {; t, q2 A9 p* A- T
mov eax,[00656634] ; '\\.\SICE',0
* S1 d7 E) x$ R. x8 e. F* i1 G push eax
0 `2 z$ O" ^2 g6 G9 l( q: l, m( g call KERNEL32!_lopen
7 t5 }- D% l% J inc eax
8 b2 ?2 W% T0 P; I, t3 N jnz 00650589 ; detected( q' x4 T9 b# q& Z8 G
push 00 ; OF_READ9 J; J# X7 W+ R( t
mov eax,[00656638] ; '\\.\SICE'! i; E' @9 y" f' I
push eax
$ d$ Z% ]* T/ i8 i$ ` Y) z. ?: W call KERNEL32!_lopen
3 E8 z( Z6 N# F2 u, p5 l9 y inc eax# F& O! o: b) M, W$ E& f% R
jz 006505ae ; not detected
4 r9 D: p( l% N$ H1 D& ?' R' F' y1 Z
/ M* l$ h% C0 w' u$ k: C
__________________________________________________________________________
- p o1 W, a& h3 A* u/ B- W$ m! u3 h, v
Method 12
9 |/ @5 n ]! I2 ^7 Z) G' ]=========: K b+ n( \* I* R6 v" l F
( ~4 o! G% N, xThis trick is similar to int41h/4fh Debugger installation check (code 05
E I( T& R9 Y! C5 ^5 E& 06) but very limited because it's only available for Win95/98 (not NT)
* M! S. e& u2 f2 j' y. b kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.: n9 `1 L7 c1 l/ o
: S% r; C8 Z0 f- o push 0000004fh ; function 4fh9 n, g$ P* v+ M3 W5 D3 a! a! V) j
push 002a002ah ; high word specifies which VxD (VWIN32). _, W1 ]' Y5 t
; low word specifies which service
* w. c3 A4 d/ ~ O7 O+ O% D0 V (VWIN32_Int41Dispatch)4 R- r* p1 u# m) Y0 W( g
call Kernel32!ORD_001 ; VxdCall3 C" F$ s7 x$ K! r; K% e: r
cmp ax, 0f386h ; magic number returned by system debuggers- m, k8 ]. X0 N7 N: L2 Y. W/ b$ Y
jz SoftICE_detected) Z O. ~- w/ S
z+ f4 G6 B' c# wHere again, several ways to detect it:
8 y% s% W k5 B! I2 z6 P, P1 ]3 Q7 B4 P# B9 g3 Z) ~
BPINT 41 if ax==4f+ f4 S% {/ I$ \
- w. Q6 H3 X7 M; Y BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
4 }* s* O1 {+ {7 \7 O1 ]5 ]% z4 u, H, O
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# r0 T! A1 V* \: W9 }
8 K. j2 d1 c* N
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!' k+ q1 D' _2 x% m% c5 R: b4 p
: c, L6 j( Z4 m1 O__________________________________________________________________________# [" U* X5 ?8 Z
+ r2 M0 u7 w7 v" V" A% W/ |- I
Method 13( E: k \8 n: |; z0 @$ z
=========
5 H2 h. R( l# }) `* I+ D5 @ z& m5 o* F) i
Not a real method of detection, but a good way to know if SoftICE is5 ^; f" g- w0 M o
installed on a computer and to locate its installation directory.
7 E- `7 T8 v5 `/ X% }; H0 F$ HIt is used by few softs which access the following registry keys (usually #2) :
+ m6 [, y# m! G* r/ [6 ?: B- U; ] c) M- |( ^$ e. M* ~
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 U9 F* p7 o. t& m& U
\Uninstall\SoftICE
* h9 y3 t- o8 W8 p4 e-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 K- f% N' W7 n$ u- G# p+ k
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, b8 P, ]4 d y$ e- t8 R- R3 v\App Paths\Loader32.Exe. Q* r# |$ O9 }: `; ?
6 T% u+ ?/ r: V3 [
. k4 g$ @+ O9 g- n4 J0 \Note that some nasty apps could then erase all files from SoftICE directory
3 f* K$ T$ C* e" Q5 P0 Z2 h: v; M& u(I faced that once :-(
! `3 T' p1 O A7 ~8 T$ ~ n" O ]. N
+ {) z+ a, w) I& W& H- p! BUseful breakpoint to detect it:
+ Y$ {0 A2 h- K
9 s2 |6 b6 E' c BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
5 D6 P6 Q2 d$ i) {9 Q' B1 q* K3 b% G, }0 w+ g- L
__________________________________________________________________________6 o: A8 f+ l+ i- Q& Y
+ \4 w" d9 r6 R* ^3 }6 t, M& {- h# c- I; Q1 S1 [3 J7 f
Method 14 F! i: k- N9 o/ ~+ X7 {) X a6 V
=========
. R3 z9 ^" B# ^5 \* M! V
6 J& k2 c) { ?& S5 W4 l: w3 QA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 W# z. I2 d) I9 ]. u, N1 n
is to determines whether a debugger is running on your system (ring0 only).0 o u7 v: W! H' ~: d! U5 ?# l& q
& g- h9 X v% e- n VMMCall Test_Debug_Installed
# o3 O4 A+ U3 @6 i je not_installed3 k* K1 q2 G* q$ g3 [& c
$ ?/ x" u% p+ o7 I$ G* v7 o
This service just checks a flag., i- R. z: y2 I( H/ r
</PRE></TD></TR></TBODY></TABLE> |