<TABLE width=500>" P3 j( k) @5 A' `
<TBODY>( C( n0 P- t3 `5 X: m
<TR>" A* i' B, q S% Q
<TD><PRE>Method 01 1 k: |# U; A9 Z$ [6 c
=========
* G1 Q% K2 q* J% m1 I& g( B
! w% n( p! f( d) {* t. WThis method of detection of SoftICE (as well as the following one) is
& s2 f4 G5 C2 F& w3 p" t7 H$ cused by the majority of packers/encryptors found on Internet.
1 @3 A- j* F# v- c& O# mIt seeks the signature of BoundsChecker in SoftICE
u9 k! [, E% T: @5 Z3 o) f! y" J3 A' M$ G. v/ Q1 k
mov ebp, 04243484Bh ; 'BCHK', y8 e7 {! y6 Y, ~* j: W
mov ax, 04h
+ D) \, D8 R$ F I int 3 8 J5 p( {( Y2 F1 ^% }
cmp al,40 u/ ~$ ?: u+ t) O
jnz SoftICE_Detected8 q2 U( A/ X- `* X" A# w
0 e6 _: t8 t" O# H( q___________________________________________________________________________
8 l4 d, D, ^. r: J
5 b! F x" `/ n/ v( F3 ?( rMethod 028 A! b) ?& z( `& u: p+ {
=========& h3 y4 P9 ~9 A5 Y8 G
. ]* {8 j1 X5 |9 b; NStill a method very much used (perhaps the most frequent one). It is used
' D# D9 q+ g7 e# `) ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,: {1 }* i0 k( m
or execute SoftICE commands...
3 V' }2 a- k( g! f2 z$ `4 uIt is also used to crash SoftICE and to force it to execute any commands
& v9 G" g; ^3 b; }! X; D(HBOOT...) :-((
; D) u+ V S) M' z& p# Y/ G/ {
- d# \0 h0 s" l) {" yHere is a quick description:
0 A. H' [4 a& a0 B- a-AX = 0910h (Display string in SIce windows)
% g' t# x% C. P$ K/ z-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 X6 @0 x6 d4 p# z-AX = 0912h (Get breakpoint infos)
7 h _, n1 h; @-AX = 0913h (Set Sice breakpoints)
0 O$ M% Q0 V6 u( |) U-AX = 0914h (Remove SIce breakoints)4 O- W* e, w4 l' I
- G" Y6 r+ ]* S( LEach time you'll meet this trick, you'll see:: l9 W) S5 A& ~: c: H3 Y6 ]- t& [
-SI = 4647h
( ^; ^5 O7 `$ P3 \3 ?7 `1 L! ]) _$ i-DI = 4A4Dh
5 U% `$ L i7 Z6 f* \8 A& j, PWhich are the 'magic values' used by SoftIce.
" h! \! ]6 K" V6 W5 y0 MFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ j" s- H" m( N5 I P% i
: U* h4 r7 ^, w; w9 F4 `
Here is one example from the file "Haspinst.exe" which is the dongle HASP% X- E5 U0 V0 A8 b, E. ~
Envelope utility use to protect DOS applications:
: w6 r3 K5 \' y U. ^5 y3 k$ K% S+ S A
1 B# A; ]& Z/ H/ T2 k# e
4C19:0095 MOV AX,0911 ; execute command." L Z- J/ d9 R# K! h8 ~
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., b; }6 y4 X6 M; r. ]5 a
4C19:009A MOV SI,4647 ; 1st magic value.( {& S$ H$ ?# f7 F* F' w
4C19:009D MOV DI,4A4D ; 2nd magic value.
- Y% k0 ? f% d' O5 d- D4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 ?1 ?: z) R2 d- ]4 T4 z4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute6 O: q0 b+ t, ?) x+ r f$ r/ S
4C19:00A4 INC CX# b# r6 j8 M! h$ \: ]3 a4 S
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' B+ B! J, I: D3 G1 `0 D6 e4C19:00A8 JB 0095 ; 6 different commands.4 ^. K+ t7 }' ^4 s S5 a
4C19:00AA JMP 0002 ; Bad_Guy jmp back./ N; X2 u7 f3 n
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
1 _% l& m, W% R1 T) g7 _6 O. C- I! x/ X7 w' |6 |! H( C Z
The program will execute 6 different SIce commands located at ds:dx, which) t& t/ c7 ^, t- | _ G
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT. D4 h% j: v* y2 `* C7 u
6 V, E4 m% _, H- V9 a( g8 f+ b& B9 Q. N* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 A$ t4 G- K# V* ?
___________________________________________________________________________
* `! S% B" j" q" I6 C' W1 I9 ^; a v& `
: L% o- N/ A) [. o; A+ j) hMethod 03: C1 R; U! ?& B8 b- f* M3 s
=========, ~, ~* n: w/ z5 y- O# e
% l# g, Q9 [% D B
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- O7 n) [; C9 \0 T- Q y
(API Get entry point)
$ v" `/ o, I2 H3 Y1 u. E5 D8 _
$ K* U5 I& p2 R& s0 K& \, Z% K9 j+ T8 f6 C: E6 e# a, L& u
xor di,di
( e) L, b9 z% j( B mov es,di
' k' J0 ~. T2 x# a# B, B mov ax, 1684h
6 o/ u. i4 t% r; {5 C- j2 ? mov bx, 0202h ; VxD ID of winice0 m7 j4 m) J0 z; s
int 2Fh
& k5 x/ N$ c: s. }/ L G4 |/ o mov ax, es ; ES:DI -> VxD API entry point
% {* t( I& E! N+ r* B add ax, di
2 A# W8 E" S- k2 `8 m! W test ax,ax I# k% _4 l: {: I6 V; K2 B4 u
jnz SoftICE_Detected/ B) ` K0 T! Q
8 k: |# \" H/ j& _3 M7 z___________________________________________________________________________3 ]+ g: Y7 M4 J9 q) T* t
l6 M, ]4 {1 v
Method 040 n% A8 |1 {7 }# s% L, f4 _" l
=========
7 M+ N, @! b) Z/ r! p6 s5 p' @' g7 B7 P1 ~
Method identical to the preceding one except that it seeks the ID of SoftICE
. L% T. J+ @* f8 o4 ^* p& ^3 G7 XGFX VxD.5 s9 |; D9 k$ W) V1 m! @0 C8 ]$ o. A
4 r1 q3 J, W5 J
xor di,di0 Z* ]/ v3 D" s5 ]( A' d+ h5 n
mov es,di
$ o$ M$ t" j1 Z! t- E mov ax, 1684h
! \5 \( q* [+ V0 e mov bx, 7a5Fh ; VxD ID of SIWVID. p! ]# r. f5 f5 e% M
int 2fh4 e2 e, M7 Z! g8 }/ w( |' V+ n; e
mov ax, es ; ES:DI -> VxD API entry point
) R5 l# {) n6 {, y add ax, di, m) f- `2 V3 ^/ y) H
test ax,ax& D* i2 j4 S7 V
jnz SoftICE_Detected
- L! V/ G: t4 \( O& V! |8 A' u& ]4 f# n
__________________________________________________________________________
1 `7 A% Y- P, g3 B, e3 p# b4 @/ D7 c6 {
6 Y5 b r! }- B, ~Method 05
( l; Q% d( M4 z* M1 A5 n/ R; f( W=========
& i: i$ T; g$ \. ?6 f' _+ S( C% j+ r" M: [# j
Method seeking the 'magic number' 0F386h returned (in ax) by all system
8 u3 v7 @2 y- a4 Tdebugger. It calls the int 41h, function 4Fh.( X5 D* a/ x$ M& n
There are several alternatives.
' m4 N* d6 ]% t/ c3 c, E- M* G. F0 E0 c. X. A( E( }! e/ p
The following one is the simplest:, i& G& n# q( x, e
# f8 Z4 ^, L$ u6 L
mov ax,4fh
. x4 l0 j {6 O0 r int 41h1 k) _- O1 n3 O" R5 k, t8 A
cmp ax, 0F386
6 \% ?( K0 W& u/ X7 x jz SoftICE_detected
! Y" ?+ u3 y( B, l3 i- s" w4 e3 s7 v0 T" B
$ w/ N1 g9 i: l* Q9 F- P) p
# \/ G( a4 K+ r7 u0 g2 P$ y1 P" iNext method as well as the following one are 2 examples from Stone's K. x( q: C* f! G2 K3 D
"stn-wid.zip" (www.cracking.net):
( t3 b9 b& D3 x& H* S
# k& O, B0 l" z- l* N mov bx, cs
4 t4 J/ d4 b% |' M( ]. Q/ D lea dx, int41handler23 q% t) y# _, \6 R! n6 o) ^
xchg dx, es:[41h*4]2 I2 \/ u( X( M M- J% V" y) @
xchg bx, es:[41h*4+2]
# I- Y9 Q$ }7 }. x2 ]) h, m7 j mov ax,4fh) D2 C, @4 V) Q9 ]2 f- g
int 41h
9 n* S2 [0 L- R U1 l$ n% E xchg dx, es:[41h*4]9 w. }+ K) N. j1 H
xchg bx, es:[41h*4+2]6 B/ W" s5 I* m2 ~. g" g
cmp ax, 0f386h+ u$ E& B0 e3 H9 Q8 J4 z! x
jz SoftICE_detected% b* A0 }# Q2 B- l! t7 d
$ [/ _: e. c$ e4 e$ l/ {int41handler2 PROC+ B+ n, Q7 T3 z+ \5 J
iret
/ }6 U+ g. @* y1 l4 N/ T% aint41handler2 ENDP
k- B3 _$ N. r) }
! ^, \- m3 X2 [; y, D4 g
1 S& i; N4 b0 K6 M_________________________________________________________________________
, X9 {1 r+ `0 \6 s8 z
' u* b+ @4 u/ L
! l h' `$ x% Q) [% e! ^Method 06. {( l2 _# m8 W, u: [; i+ T
=========
. i4 ~( n4 _8 J5 C6 i2 u. Z5 [6 z2 x. @! X
6 k6 r. g8 ~: X3 W4 w
2nd method similar to the preceding one but more difficult to detect:/ o6 }7 L' c+ o/ s Z" I: r
# |& I. S! H. U% n0 e# p5 T7 I( J& B
$ ^6 k! D1 a# C: J. e% v
int41handler PROC7 b p+ A' b: f6 Q
mov cl,al
! F% l) c0 `+ |- n5 H iret$ c, [# l% H' M& ^, R. n" u
int41handler ENDP' {# Q4 C6 b4 a* e1 o
" }6 `2 m$ B9 _1 N
4 i" D7 H8 v' l) x' [& X
xor ax,ax# K2 H) S8 r8 n* I
mov es,ax7 z; C- i; J2 B; y; L) K7 N) k
mov bx, cs+ q1 a5 I$ G$ [2 u; F. R( g
lea dx, int41handler' _2 i. T# b! x) g+ L% S& w
xchg dx, es:[41h*4]% e4 U* ~; M- l' u
xchg bx, es:[41h*4+2]. t3 @7 I8 _, J, v4 l( m
in al, 40h
7 I9 r# v% M7 Y H% N xor cx,cx$ M1 T* @; @ p$ E! ^) _2 F1 z; ?8 l$ r
int 41h8 Q/ k1 l. K5 o) _, |1 s
xchg dx, es:[41h*4]
9 {! e: p1 u3 G( Q7 s# @ xchg bx, es:[41h*4+2]
" s/ X6 F5 o2 K8 I% Z- S: t cmp cl,al
' A8 d2 ?* j0 N# w% \ jnz SoftICE_detected) b: G! E, O) R1 d% B7 c/ C! Y
: |! C/ x* M) S7 K6 w! q2 s- Y_________________________________________________________________________
: j7 g2 G. M# Z2 d( T6 H K! d
) g9 i8 G" _4 x) W2 h+ PMethod 07; y9 {. [ c3 }: U' G4 M+ z2 d& Q
=========" t5 g9 |- J; Q0 m
$ D% K s- S4 T- c; J$ X4 v* x+ k
Method of detection of the WinICE handler in the int68h (V86)
- K3 o: W3 r9 |" E; @1 G
6 F6 k- q r% U L4 ^# ~' h9 j- O mov ah,43h
" L; `4 p7 K* ?4 B int 68h
% g3 x. \+ @/ U; w2 p& @) R5 b cmp ax,0F386h
: Z0 @2 E, m a jz SoftICE_Detected0 J: D3 e: T8 O u) V/ y
) h4 r" l/ }6 b( ^: J: v* a* K6 K9 i; `1 g1 Q
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
/ d0 I! C3 b) S" A$ E2 F& D app like this:
( u' t; U% w, |7 T3 g$ ~5 C; N) e" g$ f" Y3 i
BPX exec_int if ax==68
7 m& `" h1 l! l+ K# i (function called is located at byte ptr [ebp+1Dh] and client eip is& B8 `$ C V1 X' s3 u, o
located at [ebp+48h] for 32Bit apps)- S, ]( j. Z% A
__________________________________________________________________________3 d) d8 p) m0 \/ P
9 {) C6 c. C+ N6 w) T
2 W) T( C7 \) ~- |4 `" iMethod 084 B) U- w* C" A. U. @1 D
=========
9 p- r* i( l, [: H
9 h; K/ x' D, M0 M# ?It is not a method of detection of SoftICE but a possibility to crash the% ]0 w4 n; s* k- S+ \
system by intercepting int 01h and int 03h and redirecting them to another% f8 F/ e7 l& T2 l
routine.) M9 o# e6 S! R- L# `8 X. s
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ a9 f- L) }. f2 m5 L
to the new routine to execute (hangs computer...)" M# [3 [4 P0 H/ { f/ t" h
, g1 |1 t3 H$ W: u7 v4 j# w! G
mov ah, 25h$ G# N1 `1 B& N3 ^
mov al, Int_Number (01h or 03h)
. H+ W6 E0 p' x6 J- W, D8 S) h$ b mov dx, offset New_Int_Routine
, r5 j3 R0 R6 T int 21h
4 \( W+ w- }+ B
8 p8 Y+ w& s" F__________________________________________________________________________4 u$ r6 f- F# G, |. o- K
7 u7 E3 v5 ^7 l
Method 09
7 K! d8 X( v) R) ?2 H& R========= L3 W# V* L* e8 w
$ Z+ V& u8 r8 e3 OThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 R% v- r6 F- G5 [. P9 Z! Rperformed in ring0 (VxD or a ring3 app using the VxdCall).
6 h i9 F0 h( e- tThe Get_DDB service is used to determine whether or not a VxD is installed6 d# w: R& Y6 B: ?
for the specified device and returns a Device Description Block (in ecx) for
1 H2 ~- @. t0 ythat device if it is installed.& I0 {- M u" Y% G8 N- Z! P
6 `; V, Z$ q3 @! n$ {
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' c) \) ^2 k; u, |. N7 } mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 M% F! O! Y- ~7 F$ D
VMMCall Get_DDB6 b8 m( @5 E: t& r
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
; u& t2 ^+ |) V1 \+ I6 ~9 X
& i' V7 T: ?% Q9 S/ e! aNote as well that you can easily detect this method with SoftICE:
% g. L0 t! r0 e( K; U, ?1 S bpx Get_DDB if ax==0202 || ax==7a5fh% \* T3 v- Z1 E3 T' z1 t) |0 w
- T8 M: f' M* P0 Q2 }. `; @: D
__________________________________________________________________________& C9 U5 b+ U' w+ i! }2 K
0 W9 Q, ~1 @4 ?$ x! ^
Method 103 q" w# E9 Y4 V* C [. B# f6 E. T! Q
=========
) z5 g, } P: ~- S
, K1 Y7 u6 _$ [! J P=>Disable or clear breakpoints before using this feature. DO NOT trace with
$ x5 J& I& a; j5 O6 A" f SoftICE while the option is enable!!
M0 J' W5 D5 o# r5 i9 [, K$ V/ f2 ]8 y. m( X& a/ W( c; C
This trick is very efficient:! p ?. O1 j- x* A- Q' L. I
by checking the Debug Registers, you can detect if SoftICE is loaded
2 S- r1 T' [' B) W. ~(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- j, B) U d) V% t( ithere are some memory breakpoints set (dr0 to dr3) simply by reading their
9 m4 Y3 Z7 d9 l$ k" Zvalue (in ring0 only). Values can be manipulated and or changed as well
% `: k8 @5 t0 ?(clearing BPMs for instance): d# s8 ?( t9 Z3 G: ^% r
2 o9 Q0 ]7 V6 x
__________________________________________________________________________
0 X8 p! [6 Q% [) z9 C
+ g; @9 I: m' ]" U; MMethod 11
8 h% m( Q& Z9 U* [7 O6 R, X0 j# G5 S=========
$ _6 T8 v: D& X3 H3 u# u4 h* F+ D2 F m
This method is most known as 'MeltICE' because it has been freely distributed
6 \2 H6 F$ d! d9 N% y4 U9 zvia www.winfiles.com. However it was first used by NuMega people to allow
c& W; s2 r1 r8 M' a. |- N; }8 rSymbol Loader to check if SoftICE was active or not (the code is located
' ^' y0 l; z+ @' o5 N% Minside nmtrans.dll).
* d: j' @ @7 `+ ?4 d. E6 q
8 a- p3 ?6 i5 U% F0 aThe way it works is very simple:: k. @5 |7 L) L0 n( I
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
1 F+ y' H9 O* NWinNT) with the CreateFileA API.; `' U/ u# @8 W b) T. ]( r5 j7 L
e6 \+ l" f) y2 ]) q! WHere is a sample (checking for 'SICE'):
/ I/ `" F1 [$ m/ x# Q# F- g6 k: y" F8 k# c( Y
BOOL IsSoftIce95Loaded()
/ E+ ^2 Q" K3 b3 o7 C X{2 I8 C- D; j# S2 I& {) S6 n1 m. e, i
HANDLE hFile; - m' `* O; g D0 ?7 D
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
+ T: x8 J+ }1 t$ L; g3 T- z' z FILE_SHARE_READ | FILE_SHARE_WRITE,
- |* p+ I3 \, M6 s( R0 H NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
7 H. e! e+ g$ f1 l' q9 j0 n if( hFile != INVALID_HANDLE_VALUE )
+ u' N4 p; u1 a$ B5 [, W& a) U {
& S; [0 Q# }* r1 W- ` CloseHandle(hFile);; ~: `& G6 X M4 Z6 q4 `
return TRUE;
* _8 g( f' }$ r' q/ d4 e% \ }
3 j1 x. p- ~: M Q7 T9 L return FALSE;2 a# M. ~$ z7 O( M/ U
}
B; B) Y, }9 i8 e9 v$ }3 J2 b
: L. C. ]7 o5 o0 h+ ], L: p5 i( wAlthough this trick calls the CreateFileA function, don't even expect to be( T- J8 O) Q' C( y; W; v; ]
able to intercept it by installing a IFS hook: it will not work, no way!
7 B% d% v" i; M vIn fact, after the call to CreateFileA it will get through VWIN32 0x001F7 Y1 C2 j' ]) _! t# X) A8 g
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- r1 L% {% S8 c) J$ V. L; `2 A
and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ d3 M8 R+ W! f+ Y3 X
field.- O3 D7 y- O0 j& H. y
In fact, its purpose is not to load/unload VxDs but only to send a
/ a- G, U( ^: C5 K( ~# nW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* U! L3 T2 O% x8 X7 I& p$ N: Ito the VxD Control_Dispatch proc (how the hell a shareware soft could try" x7 z* {9 ?- u' V5 ^0 v- u+ W* j
to load/unload a non-dynamically loadable driver such as SoftICE ;-).9 x6 Q: N5 @: s8 h7 i8 N0 ^+ h9 U
If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ M/ I% \4 S% aits handle to be opened and then, will be detected.
$ l. d+ F( |! y4 o& [You can check that simply by hooking Winice.exe control proc entry point' d+ l9 M) a2 ~" n0 S: J4 K
while running MeltICE., x# o/ O2 z7 }/ ]* p4 Y% _
3 V- c6 J5 V2 `" _
! {8 ?4 U- z$ U, |9 H7 w; A 00401067: push 00402025 ; \\.\SICE
, @7 z$ |5 d2 m8 K 0040106C: call CreateFileA
5 p7 g2 h% ]8 C4 U# f( [( P4 y 00401071: cmp eax,-0018 p# b1 I1 t. L/ e- H5 {
00401074: je 00401091
5 A4 y: A3 i4 C* v/ W1 ~; z: n G3 t+ V1 e2 U$ v
0 K* f7 |- d5 x# \There could be hundreds of BPX you could use to detect this trick.
g7 }# X1 U3 \( B-The most classical one is:& v+ j& r6 J) b# g, |
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ A2 s- j/ G4 { n+ p *(esp->4+4)=='NTIC'2 F9 t( B" {4 g! k
: k$ L! a r8 q* i2 z
-The most exotic ones (could be very slooooow :-(; O5 O V# X& V' u
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ! N/ C0 [9 i# o; m; B- K
;will break 3 times :-(% s; }$ i' b# [. i* f
: [1 U& @4 H7 e0 a5 S
-or (a bit) faster: ) J0 I8 \5 y6 u* J3 ^- H
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 \1 ]# |! Q& q; X7 q. ]
$ A9 I9 d; h# ^ I. n; c7 ^ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - ~: ?7 T' |. F" N, t
;will break 3 times :-(9 u) P t7 z. O4 g7 D; r
8 x) q2 |+ p7 @8 a& z0 m( o-Much faster:
2 @1 Z* i, I$ @) q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'& X" B. O: G# r$ D
9 W0 }& X7 B4 A* y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 e" @$ ~* d" Y/ ]
function to do the same job:/ G: n) u# {8 \/ o: ~
$ n: b5 S/ B5 W; j0 Q8 [; b
push 00 ; OF_READ
: B- @% N( m7 a$ I+ r" C mov eax,[00656634] ; '\\.\SICE',07 q9 L* X- D. J7 h/ _ p! C
push eax
+ C _, o* A2 u$ O6 g/ B call KERNEL32!_lopen$ }# k3 C% {% a u/ d' E' T
inc eax
) k2 l3 J" C' M& p( p jnz 00650589 ; detected% ]- ?" L$ x* N, I' k
push 00 ; OF_READ
4 N: v, e% b: y! _/ i mov eax,[00656638] ; '\\.\SICE'8 Q! C8 A+ Q1 p8 k* X- Q
push eax
0 L- Q9 t' C, K" O: R) L9 U6 T0 J call KERNEL32!_lopen
G+ I2 m- p' |# I7 E4 Q inc eax0 x) k& v" B. b; m" J/ N
jz 006505ae ; not detected
6 H) }- \ Y0 ^, Q, G, B
( V6 ]2 R" S- G* a6 E% K
( w5 f/ z2 C ]: @: Z- E__________________________________________________________________________) h& |3 P+ m D" }
' \; Z, u2 B* ~' s, D6 S4 ^2 TMethod 12
+ ?* X+ o# U% E. L9 }=========7 E* w0 o0 j a
0 F- F2 a7 z' i7 m1 G3 v# dThis trick is similar to int41h/4fh Debugger installation check (code 05
3 y) t! O5 [+ }4 o' Y& 06) but very limited because it's only available for Win95/98 (not NT)- ~% H4 v7 \: _4 Y; ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* E& P+ B7 J. R5 y8 X( _* u5 {$ {; |) y
push 0000004fh ; function 4fh: O2 ?4 C/ P( j; o% R1 b
push 002a002ah ; high word specifies which VxD (VWIN32)3 }: C8 p9 m% J4 E
; low word specifies which service
( y2 W1 O' s' S7 d5 t9 q# _ (VWIN32_Int41Dispatch)
9 g: e" ?* V, z" x+ ? Z! s call Kernel32!ORD_001 ; VxdCall% a# N+ J; m' d# ]: H
cmp ax, 0f386h ; magic number returned by system debuggers
1 E. k7 ~9 R& [6 b* f1 e& K( ` jz SoftICE_detected
. _! c' L; B9 [4 F8 j. q& j- X0 C$ N) M5 @
Here again, several ways to detect it:; D! K& G* N7 r' g( y8 t/ S
- _2 p# N5 _# ?# l
BPINT 41 if ax==4f
0 }0 e8 Q6 E D1 E: C- l% Z
* A. @' @' c; `9 \1 ] BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 z/ |! _7 W I1 ^$ H
P1 [" X0 o) y% @1 S: j/ d. B, p
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A: E$ @7 U( v* |' I7 Q
3 R! S5 {% x: a/ W) n# h6 D1 K
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!+ f9 J% Y) y* k- M2 B5 \
9 T8 U& s. u' n D l% M0 e8 C4 b# }__________________________________________________________________________
; T Q7 C; T8 O+ L! f
9 {5 [ ^$ ] c1 `Method 13. C9 R( a" U5 F* I% L
=========$ W/ C4 G$ s+ G
|) S, a6 X/ U ]( p
Not a real method of detection, but a good way to know if SoftICE is K' L" q% S. T+ _9 J8 p/ |" \
installed on a computer and to locate its installation directory.
0 v( k& ~" q" ?4 z% ~It is used by few softs which access the following registry keys (usually #2) :
2 @# N7 g8 X2 C9 k" c2 d5 o/ T
# j8 ?3 `" O4 f' a9 |-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 g: F. u8 ^5 Q) B" x. _
\Uninstall\SoftICE
& P: V( F; L+ \# }. u-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
~8 u5 `: _/ n0 Z( c: T; S-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 b. z1 ~: h% j; }- \5 S
\App Paths\Loader32.Exe: G# L9 k3 X9 I' d# N. O2 E \
% Z7 L) ~9 {. p! P! b& ~, Y
6 }' j/ R, w: g" YNote that some nasty apps could then erase all files from SoftICE directory1 r* |2 y+ \! {
(I faced that once :-(
1 P9 W! }: p' d/ t9 @* I
- a; a0 v2 e& \* eUseful breakpoint to detect it:
4 j9 {7 S0 R$ ^3 Z8 y8 s7 i7 V
9 p2 B/ x) D0 _ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
# w# \, r# f, F5 ]! v) v8 W2 v& D# n: V$ n/ P
__________________________________________________________________________ `. ^5 d" b& c" q( C+ W
3 G- o) e! Y0 i( @ n }4 q$ {0 ?2 d4 }/ Y7 b' R% ]6 a+ e8 P, H8 r; ]
Method 14 % @. W* y; X; {. j7 h, R
=========
- @. s5 N% _! m& a$ I7 _6 ^& t- u0 Q# m- }# s$ \
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. {" f% d5 C: }( i0 H, \* e
is to determines whether a debugger is running on your system (ring0 only).
( B: r4 V. z4 \. N4 x- y/ _. @8 V7 z
VMMCall Test_Debug_Installed i0 |1 A0 d8 L- F: ^, H
je not_installed
O: I; ?" U. Y1 E# `
# F8 d6 _2 g3 h( @& LThis service just checks a flag.
, ]+ {' _* s. Q/ B</PRE></TD></TR></TBODY></TABLE> |