<TABLE width=500>
2 ]0 W' Q" R( G/ I$ R5 E D<TBODY>3 O+ r5 O% S) S
<TR>
- N2 J# t+ H$ P3 M3 W1 r<TD><PRE>Method 01 3 l( Y+ K2 I; T" `
=========
* s! G# |. x$ a! E( m% y" ]; c
( t! P4 \! y$ l$ ]* UThis method of detection of SoftICE (as well as the following one) is3 P* z, K4 E) g! |
used by the majority of packers/encryptors found on Internet.4 h$ Y" w8 a) R; k# b+ q
It seeks the signature of BoundsChecker in SoftICE
( M& H% U. T! Q* e0 y" }; T
2 z& o* c4 A# w% K4 m7 w) |9 L' j! u mov ebp, 04243484Bh ; 'BCHK'* k- I9 B) v+ E: t) W
mov ax, 04h
2 M- _7 I3 m N( p% P( o! T$ g int 3 1 S1 E2 b' M; o; p2 `% {
cmp al,4* _8 N! x% I5 a. W- q4 Q
jnz SoftICE_Detected
$ y; X1 _/ s- i3 N* A8 {/ g+ G! `- Z+ _: y1 I o4 S
___________________________________________________________________________
3 C6 F: N# A' d. R$ _6 v
# Z. _: O8 h& d) Q+ TMethod 02
5 m* {& Y5 g2 w5 O; |========= q! w0 c) T, k' h; l6 Q+ S
) t+ y3 I) u0 b c7 F8 dStill a method very much used (perhaps the most frequent one). It is used
& j1 B( y r% U0 P) l1 Uto get SoftICE 'Back Door commands' which gives infos on Breakpoints,, V8 L; i9 A. g. h8 [! j
or execute SoftICE commands...0 w$ e- }8 q4 H: Z, U# @
It is also used to crash SoftICE and to force it to execute any commands2 c. a! Y" a- P: w1 y6 N
(HBOOT...) :-((
( R W9 i. L! Q" V8 V. O8 M1 T4 l T. E- j# G$ ~: S; c: I
Here is a quick description:
! @& E7 ?- F Q3 o2 d-AX = 0910h (Display string in SIce windows)$ a5 E! [# e3 @( j* N% R
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
- n8 o6 P" }/ ?+ H/ l-AX = 0912h (Get breakpoint infos): n$ l+ P7 ~8 N# b2 G
-AX = 0913h (Set Sice breakpoints)# s7 I9 M }3 O
-AX = 0914h (Remove SIce breakoints)0 \0 N+ U8 p4 v* s. ^: h0 j3 P2 I
# c- P7 y+ i3 J( v( q
Each time you'll meet this trick, you'll see:
. {. f! h3 d- O-SI = 4647h2 ~# y8 v1 q" ?9 y* x
-DI = 4A4Dh
" f& |5 v7 {2 X3 Y; V( p. I7 EWhich are the 'magic values' used by SoftIce.! u# F' i! I) c% ^( ^
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 e% J. l- ~5 N- d: d8 c& U
" u# F2 o% N5 {2 PHere is one example from the file "Haspinst.exe" which is the dongle HASP# L" [# W# o+ w/ [" T1 f5 {
Envelope utility use to protect DOS applications:) ? o; \! z: [6 \2 o m9 J1 f
* s& y2 q, d, l5 F8 Y5 E
+ h K2 v4 g/ M. r& @4C19:0095 MOV AX,0911 ; execute command., b" a; M i3 A/ ]( e2 l" f, h
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; N! \# g' c# ^( X! ^4C19:009A MOV SI,4647 ; 1st magic value.
7 b0 }0 H* o1 ~4C19:009D MOV DI,4A4D ; 2nd magic value.
. d( \) D7 @+ @8 g+ M- H' N4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)6 I* W& R: m Y1 j* B
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 p: h, } p4 Y& Q/ T) m2 M" y4C19:00A4 INC CX
. x& \7 u$ ]; J. R( @5 k P' ^4C19:00A5 CMP CX,06 ; Repeat 6 times to execute5 F( T w4 m% S% i9 {5 m
4C19:00A8 JB 0095 ; 6 different commands.- ^: a& ~1 p; Y& g' {. \8 b; O
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! a. u$ k7 Q; p$ }7 _% }4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# l8 C1 b/ h }$ z# z8 U& a1 t2 b! J, h3 n; S& s
The program will execute 6 different SIce commands located at ds:dx, which; F$ F P8 c2 ~$ S5 @7 n) ^5 e
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 s) K: \( V( F0 F2 ~/ l
3 G H; i9 H y6 I4 c
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 Z4 I, v8 {4 k ?. b8 C! f
___________________________________________________________________________
\4 b. r2 a9 v& c
; s! K& \9 Z X F8 e. X! l H6 W9 H' `# X) g% X4 f. J% X b, m
Method 03% C9 h, U* u4 @
=========3 C: m: Q/ v3 |# i
' D* ?( C- W# y8 m1 x* W" lLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 q& |8 F- Y2 B$ z1 P
(API Get entry point)
# _; I0 ?" q# `; _+ y: }4 R, s' G
; \+ S) [" G* Z! w% N! q: ?/ E0 F/ V& y; A# y, D
xor di,di. Q6 d) n% t+ |1 y/ @1 u' e- M2 F8 t
mov es,di- _- T9 y! i* B- A
mov ax, 1684h $ b2 h( N& j% f: q' M$ X a$ W
mov bx, 0202h ; VxD ID of winice5 C V" F* \& q( f% h7 C2 Z
int 2Fh
' L; _( ^4 \7 ` z mov ax, es ; ES:DI -> VxD API entry point0 \ W0 |& H! f9 o
add ax, di
. y8 o+ d/ X: q. x/ I test ax,ax! a3 N0 F1 e$ g6 i
jnz SoftICE_Detected
' o7 V' Y# M: u& ?) X7 H6 J
6 `( k9 b: }1 V___________________________________________________________________________
6 `# h$ E8 f' p3 F9 @5 {+ }6 V: I% b; W# p, B# b" r
Method 043 W! C% j) z7 i* u- v6 m5 g6 y
=========
( }0 Z- @% T/ H y3 _- X% e" S n" ?6 ?: |1 H
Method identical to the preceding one except that it seeks the ID of SoftICE% y; \% j5 i1 V) ?- P+ ?3 e
GFX VxD.
1 }2 |; N. Y% \# c: \
$ E) k$ @# T4 P4 h3 U$ R- v( \ xor di,di6 m/ ?2 K" z) b+ o
mov es,di* Y& v1 U+ g7 d9 a
mov ax, 1684h
$ x/ E1 h B! q( J! u9 l$ j mov bx, 7a5Fh ; VxD ID of SIWVID6 C7 |, G% v" ]$ R- e' X1 q1 |
int 2fh
+ f. b# u5 \8 s mov ax, es ; ES:DI -> VxD API entry point
5 S( W" \( ~4 r9 ~: \: F add ax, di/ m! q8 B' f. T% x: f
test ax,ax
' y, Q$ b9 n: `; P" _% ~. a jnz SoftICE_Detected6 b& r$ }$ z4 g& R* q
2 z( M$ J) K0 j6 b
__________________________________________________________________________
1 M% @8 v* @ K! V- Y$ Q$ B
: R. |- \5 N3 ~" C1 ~* }/ B" W2 Z2 t. {+ d6 A
Method 05: v0 @+ T' }0 Z1 | u
=========6 g- y! o6 @7 V H
% L$ X r: U& iMethod seeking the 'magic number' 0F386h returned (in ax) by all system& ~6 c s% s( @6 g" l1 c6 f- {
debugger. It calls the int 41h, function 4Fh.6 c8 `6 A) ]+ E) m) [
There are several alternatives.
2 r0 ~, ?- O3 Q- n9 k: o4 V2 ~( q5 Q$ o9 _5 ?; V+ v
The following one is the simplest:
$ Q+ ]" F; ~' l. R1 z. n4 v
5 _: E- s: v2 @# y% g/ F mov ax,4fh; q8 P6 r) n. o+ P
int 41h
7 {5 f$ d6 y% D6 S cmp ax, 0F386
8 r T6 R {/ n8 }* K" Q jz SoftICE_detected& p8 L) O" R0 B+ @4 R- l
+ F0 q/ Q! q$ k' l
/ k$ Y" ~6 f5 F" ^2 U# }+ g' WNext method as well as the following one are 2 examples from Stone's
+ X! B: h' z9 R: ?# c7 X6 ?"stn-wid.zip" (www.cracking.net):- o/ H$ Y& K6 {/ F
# Q9 D" Z& S% O
mov bx, cs- w+ S" ~8 Y( T3 `# U* p* a
lea dx, int41handler2
J) ~5 o5 A" P& k xchg dx, es:[41h*4]
# f/ j0 |/ P- r5 s+ k+ C xchg bx, es:[41h*4+2]- Q. Z% b$ d, R/ q4 X
mov ax,4fh8 J0 h% P1 I* d, f$ }6 }
int 41h+ n) d# Y/ z1 ]. R
xchg dx, es:[41h*4]
) h4 [; t) r" H4 V0 u xchg bx, es:[41h*4+2]
8 v' l' I) c* d2 T) } cmp ax, 0f386h
5 c8 i# i8 r. w5 L jz SoftICE_detected
( f8 m* U8 @) h. e; @) }) o, f$ |; v6 W, g0 G6 A- A3 ^1 B
int41handler2 PROC
( B" ~0 C$ t7 h8 G5 \: f$ I+ M iret+ W8 T4 r) f) m4 A2 ?0 i
int41handler2 ENDP
. f) y9 D8 Y, y- q( H' w6 v1 Y* \7 r* D, K6 V* l
6 | K+ R" |! r1 o' F
_________________________________________________________________________
# W$ D" c/ [# ^& q9 e C6 p; c' q3 ~4 s# q# q& s9 i) o
) b# b4 W4 r* j8 Q. P; ^- gMethod 06
/ f1 J! m1 z5 Y1 a9 g. G4 @" p=========
% J/ |6 t- C* ^$ w/ @
, F) u. {! }- v) W; P* G
2 K: c0 h; {- f0 S6 M" M! `2nd method similar to the preceding one but more difficult to detect:& `( r& V# U; y$ ~ f0 O# R
' Q' _' ~* I2 H1 \# M6 e$ ~) j$ g; s, c9 Y. w. m X1 S
int41handler PROC" Y* ?: W% _+ c+ D3 _* E
mov cl,al5 R* K- M) \9 y: t
iret/ r" y* [& r' I {: |) _5 l' V
int41handler ENDP
! n# T- q. L$ ~; A. Z. [9 ? g. L B* I( A* A3 N8 W
1 R- x5 Z4 X: U
xor ax,ax9 s) Z) N/ r6 t! B. J1 s4 V
mov es,ax; v! U/ M. l) b8 b+ @, J9 Z8 D
mov bx, cs' N3 Z! D- i6 ?5 j2 E& A# l
lea dx, int41handler, X- E. k0 ]- [( z9 ~
xchg dx, es:[41h*4]1 k9 Y8 D: t2 ?' _
xchg bx, es:[41h*4+2]
! h+ t# B0 }; r9 P- H5 p) K in al, 40h
% P# H$ {+ J9 W, _' E6 C u: J xor cx,cx
8 m6 z% d. u: Y& }; l2 W int 41h# P- y# S: X; E% |! m% o- j/ {! E
xchg dx, es:[41h*4]
O3 {9 I) i, C: Z2 s xchg bx, es:[41h*4+2]
! d& n. z- G' ^& I2 f# ]4 ^/ F2 m cmp cl,al( d. j$ A" p+ E/ B N
jnz SoftICE_detected" s3 @/ @4 q8 W0 @8 J$ _3 L
; I8 j% e. D* u' U0 f0 O0 B2 c_________________________________________________________________________# N8 T' f3 ?/ b! B# O
& B- l" l$ N; O- A$ v8 k# k
Method 07
& V+ A/ T) \3 f# o @% H! m: Z=========. a7 ~" i. I; e$ b2 Y
& t; g k8 G$ S6 b4 ?1 |2 YMethod of detection of the WinICE handler in the int68h (V86)0 J& n& v& L) F3 w9 L3 L7 Y
/ G9 K6 P! T4 m5 N% l$ v) S7 T mov ah,43h0 t. ]4 }6 t7 i
int 68h& @6 _; N. A6 t7 k
cmp ax,0F386h
9 C! H, L; D6 q4 m" p jz SoftICE_Detected
2 g8 ]: Y) q) |; v$ y" ?
" ?% q0 J6 O% n6 k& O% d: K% d# N. `5 T- Q6 Z: h
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( G4 c8 G2 `* t; v5 d7 B* | app like this:
! r. r# g# [6 C$ {' M7 D, r" J( ~( K+ {0 ^& Q) k
BPX exec_int if ax==68
3 j8 b M% F3 C. X J (function called is located at byte ptr [ebp+1Dh] and client eip is! A e/ q9 X1 e" S( D$ h% c
located at [ebp+48h] for 32Bit apps)7 K0 C4 s" J: F& y7 J4 ?
__________________________________________________________________________
1 O; q; [+ V$ V7 m% ]0 D) n' W" W3 o/ u' b+ |; O( t
7 t x, I6 K9 W! v; U6 G' ]0 Z' l
Method 08, F0 h7 H ]$ X9 w z* Q: b- s4 g; n
=========5 A5 Z8 R L3 ?
7 } C7 q6 t& n+ R7 |7 SIt is not a method of detection of SoftICE but a possibility to crash the
4 N6 D' a7 m: g7 nsystem by intercepting int 01h and int 03h and redirecting them to another
1 B' X+ d! \; L xroutine.% o3 ~1 w* B) x) u
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
/ n" x$ S7 }6 _2 ito the new routine to execute (hangs computer...)
3 v4 N& x& E7 ^) ~4 a
+ D) R2 \# f- }7 ~6 M1 I" \ mov ah, 25h. { P9 M* w- b
mov al, Int_Number (01h or 03h)
4 L- ?& n+ {& N* Y% a8 X1 J5 u mov dx, offset New_Int_Routine
, _* n% n: @' X( D: | int 21h0 L# I8 X5 k% ?# q
; x& w& {8 G6 J ]8 }3 j p( B2 G
__________________________________________________________________________
, E, a& R. K/ u' T9 R8 D7 d9 Y. `3 m; |9 {: l. Z
Method 09
1 \, M1 E1 M/ I% |) u5 H=========0 u: f7 }4 j5 D/ A
; P* k+ ]/ @; ~This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 s& _6 l1 Z7 d" L$ S; Hperformed in ring0 (VxD or a ring3 app using the VxdCall).: m9 q2 U3 G, ^- ~2 _4 h( \0 e. e
The Get_DDB service is used to determine whether or not a VxD is installed, m& J6 i, G5 t1 U& @
for the specified device and returns a Device Description Block (in ecx) for
% W0 p+ O: d. Nthat device if it is installed." v( t7 V+ d; s `$ R- v& q' j0 k9 K
( c) ^" L" {9 x. \2 M( C( I, s mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID' Y; J( k. G+ K" U* t
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 `5 F2 d$ K# B; W3 ~( W: ^; Q, E VMMCall Get_DDB: L9 L' Y3 \) { t
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& D. F) c. W6 A( x3 m& F
- n9 t3 f% Y: s7 k; M/ P4 x
Note as well that you can easily detect this method with SoftICE:
6 L3 x& Z* W) m% F% ~" [) H4 T bpx Get_DDB if ax==0202 || ax==7a5fh
6 c# d/ k8 w- i/ z- ^( L- z+ ]* {) c. }/ {( S E
__________________________________________________________________________
8 m* v9 ]* ^1 Q" D
' D) Z! T, u: k r& ]Method 10
7 P' I! f4 X* p8 ~6 f# d( E=========5 U0 ?) A( l& f
; }+ I3 E: }% H9 w$ A
=>Disable or clear breakpoints before using this feature. DO NOT trace with
6 u7 A6 U1 b; p/ D8 X4 \/ Y4 x6 Z0 u% g SoftICE while the option is enable!!
`# D2 V8 m7 r: b) O; E+ \& t5 X3 r! Z1 F% j8 L
This trick is very efficient:# T( n* l' T" j& X& b2 @; u; \
by checking the Debug Registers, you can detect if SoftICE is loaded4 _4 Y K2 d: [$ F2 A7 R
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- o( a( A* I9 R, b# W6 l
there are some memory breakpoints set (dr0 to dr3) simply by reading their# p# b, d' B# o
value (in ring0 only). Values can be manipulated and or changed as well
9 Y' d+ u, @7 {" p* N0 n(clearing BPMs for instance)
8 z. @ c; R; L3 S, H1 e B: ^1 j5 X6 A& y
__________________________________________________________________________
6 z& ^( t; y: [5 V- R
$ B4 W" d- t: C. D! C1 cMethod 11
" b+ w4 ^6 ?+ a========= e! H- I! [/ I( m
5 D9 Z* s2 N: ?/ H0 N% @; x2 P$ g
This method is most known as 'MeltICE' because it has been freely distributed
: @$ w' Z( K' z" s5 g" ?via www.winfiles.com. However it was first used by NuMega people to allow
2 f: Z& R* e) b0 vSymbol Loader to check if SoftICE was active or not (the code is located, D: H. P. f& ~" Q4 w0 @- s
inside nmtrans.dll).
! n& D1 Y: E) u7 A
5 h% c! g ^' ^& ^( _/ gThe way it works is very simple:
( H+ a( J1 G- d& m, M7 b) k2 JIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; ] z$ o& _& ]0 C& o6 | KWinNT) with the CreateFileA API.
5 D4 @5 x$ u: P* R" ]7 V3 I. C3 ]4 l3 u s
Here is a sample (checking for 'SICE'):
7 |; @3 U8 t7 J
( S; y3 ?7 {2 g) V2 a" iBOOL IsSoftIce95Loaded()( u' H. H. ^4 p/ J& \
{
7 B: v p; F- g6 Y9 c HANDLE hFile; 4 G& e( z' {: k6 ]" r% {
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 N. {' c& _& Y5 z7 t: H$ @ FILE_SHARE_READ | FILE_SHARE_WRITE,. a4 B/ m) x7 y7 Z2 z5 b# e
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);& h. Z: c: w* X- N' T
if( hFile != INVALID_HANDLE_VALUE )
: s' b- s- x) w; P2 O {
; x/ I, X5 [! V CloseHandle(hFile);
- B4 ]" i0 k% Z5 w1 k1 A return TRUE;$ r3 n$ ?! v/ B! F2 p
}6 ~9 H* a# d% l e. F: z$ @
return FALSE;
! M8 s- ~6 u1 k}
7 ^" i) f! k1 I- N0 N, G, x
s/ i( T1 j* E4 SAlthough this trick calls the CreateFileA function, don't even expect to be6 Z/ s- Q% T& G
able to intercept it by installing a IFS hook: it will not work, no way!
1 S# B H+ e8 ~9 R5 p, y YIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ P# a# y- b" a+ iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) Y; w6 ~) z$ {' Iand then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 q% g- a; ?" A( Ufield.9 X1 e: o, |" m+ b1 t
In fact, its purpose is not to load/unload VxDs but only to send a 1 l* N+ _) q! Q2 o* \2 s% [
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) l! Q" ~" j. P# H# ^6 k& `+ M: c
to the VxD Control_Dispatch proc (how the hell a shareware soft could try( c; U: l; Y* s4 F$ u! \
to load/unload a non-dynamically loadable driver such as SoftICE ;-).1 {8 B. y4 J. Z6 K9 T A0 H W
If the VxD is loaded, it will always clear eax and the Carry flag to allow. t5 F8 ~& @7 w& }
its handle to be opened and then, will be detected.
: I6 j- L- l$ P* H4 wYou can check that simply by hooking Winice.exe control proc entry point) n { A% m1 S- l
while running MeltICE.
* F, L) V1 ~! \
* i9 G* E. W; f: ^% A$ s1 C( ~2 d
7 ?+ a( K6 u/ }& h2 U. d 00401067: push 00402025 ; \\.\SICE
7 s+ Y; H. Q3 d9 I: | 0040106C: call CreateFileA& b" _) p- A3 \. W' K( i
00401071: cmp eax,-0013 q# @7 }9 z% \
00401074: je 004010910 Z+ j* O9 Y5 {) U* v7 f
4 S5 a0 n) ?& {( k5 Y; k* k5 T0 j" Y- V8 N
There could be hundreds of BPX you could use to detect this trick." @( t2 E, b W, Z4 Y9 D
-The most classical one is:& ~; p+ _5 t6 e8 B' F7 K* _3 C
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ I4 k2 T- }6 S2 c+ f, P9 l: V *(esp->4+4)=='NTIC'" d; b% A! p6 ?' m
! F) V4 b0 O- O/ D& L6 N+ ], b-The most exotic ones (could be very slooooow :-(3 j& O( o Z- {6 |
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: \/ I: w* ~3 j ;will break 3 times :-(
( T& F* y e. b& E1 N: T, h/ S: k5 V- p
-or (a bit) faster: : x, J: R0 h+ Q( q S& M3 l; t
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
. l; g7 x; z- a o
: ~- [' v* A, G" |: `( _ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
9 C5 G( D+ } v4 F8 I K4 t) | ;will break 3 times :-(' o) ~3 B; s: g- A9 ~# o! `8 t
& x; ?4 c* B- L0 A
-Much faster:9 u4 \0 e' c- E$ p) d# l
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV': U1 g3 \2 h7 D
- J2 f( e, s+ y# a- I% C4 f9 C
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 X% {: l& s& ^- c$ ?6 Y; Yfunction to do the same job:
; Z; b1 W4 W- m4 k' ~$ Q# u
* d# V" n9 r2 _* E9 y! { push 00 ; OF_READ
# l) B4 y4 X# t( C5 R# `, F mov eax,[00656634] ; '\\.\SICE',07 @" s9 m6 ^/ j
push eax
! u2 b+ i% n' ]- e% c4 {( @% | call KERNEL32!_lopen, `" J' [6 y' B
inc eax/ Z& B% b* K3 X& U2 |4 Q6 F' O! D
jnz 00650589 ; detected
4 }; { H0 g3 K6 a) D push 00 ; OF_READ
+ f# Y5 O7 [7 T' S( ]: j. t$ L mov eax,[00656638] ; '\\.\SICE' ~3 c7 U8 Z3 D+ x+ B x! C0 @
push eax( V! `' A$ n6 B7 U, v/ I
call KERNEL32!_lopen6 p2 k* @6 i! H7 e( a; \+ w
inc eax* r, a& H4 i, O, o/ V
jz 006505ae ; not detected
1 S+ w: k4 g! R6 r' d4 O4 s" K4 e( X. f/ f$ f8 E$ z( L6 K
$ A. G% b" @& }' a5 b/ {: E__________________________________________________________________________
& I( }. T" k! Q- w7 z9 I+ i2 }: r: e5 ?0 B3 n$ A
Method 12
" Z; E( A4 Q3 D; p" D" P/ [ r7 h=========
8 Y8 y9 U4 g' C+ Q# T W' g
3 X3 H$ @" E( i# g. ]! cThis trick is similar to int41h/4fh Debugger installation check (code 05; H) z) S( |6 h( }6 b
& 06) but very limited because it's only available for Win95/98 (not NT)
2 k9 e4 m0 f1 _as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
! J. D1 n' F, @3 e) P' M( z0 d! t! F4 U% f
push 0000004fh ; function 4fh
7 K5 g5 H) z4 j6 r! P; S, \ push 002a002ah ; high word specifies which VxD (VWIN32), a7 G5 C1 j2 j3 Y% P6 t
; low word specifies which service8 \# |6 L- p# q( \# J
(VWIN32_Int41Dispatch)" Q' i4 o( o! @/ \$ ? Z4 z0 N
call Kernel32!ORD_001 ; VxdCall
* Z" l% Y2 a; u, {! f cmp ax, 0f386h ; magic number returned by system debuggers
; W# |" G" u/ C+ G# D& k jz SoftICE_detected
' Z1 w0 Y7 O A3 ]' ?
! c9 s9 {- W( p( I( [6 WHere again, several ways to detect it: X9 e4 Q% _# l6 ?
2 J- R$ C/ ?4 }7 i% m8 g1 K+ ^ BPINT 41 if ax==4f2 G/ s8 n9 i" T0 Q4 ^, s/ G" J/ s! y
. W8 y3 S: j7 Q9 Y( }$ P; }: ^
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
& Z {3 Q% |: @, m* x2 J$ }+ J$ `. q/ q' e9 j' p( r6 c
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' i) |) i. F% `. k0 D' `4 q; w6 b' j4 ?
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 T- } h& L# t* G# [2 y8 F
" K: T6 I& ^ t( ^__________________________________________________________________________, P) p' [4 _" C8 {) Q% f
& @; L) m- z6 |3 J+ GMethod 13
; p, u9 P; n7 B4 P=========) r d" E- {8 j3 b
8 L! L% `. D; b, C* P3 x: ~2 m
Not a real method of detection, but a good way to know if SoftICE is5 v* i$ S; ]9 b, ]* f
installed on a computer and to locate its installation directory.
/ R: f: Q% J+ `It is used by few softs which access the following registry keys (usually #2) :/ ]& |% P# J! j4 e! `
- p( B) N2 _ e4 @9 I) z2 n
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ R6 e. _ p- I\Uninstall\SoftICE
( s W9 T, P/ j9 C-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% W# t% \1 n( p( P' ^
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 m6 C8 i: U) p
\App Paths\Loader32.Exe
# S1 T. I4 A" C; P6 O! A
9 J2 P) c. O9 c- g4 `7 \
1 Y0 V( B* C; x& F9 qNote that some nasty apps could then erase all files from SoftICE directory
9 g: C3 L3 U' |& H(I faced that once :-(5 S' e/ x" L* T, b9 q2 v1 M# S& ]/ ]1 m: h
* ]; X& K. H) \* C
Useful breakpoint to detect it:
" V9 v4 w3 v5 R) K( i8 Q
, r5 R9 @" d8 N( k1 \/ b, M `; } BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 }3 q( | Q" x' N
( l0 S7 M. Y" s3 {
__________________________________________________________________________
J# u8 s. c8 d/ S3 o" X0 h8 p, ?6 L6 B& C# S" [
6 d6 T( ?& v; n* u1 }
Method 14
9 Z T8 T$ H; v t1 m; m=========- O! D9 |9 Z& ~6 ^
8 W: p& L Y) |- N+ JA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! B5 t# i c* l' S
is to determines whether a debugger is running on your system (ring0 only).
/ x0 ` k& V6 @, ?1 W
" [( a: j1 K& P; [9 z VMMCall Test_Debug_Installed
. D4 O9 N9 w: ?1 H6 ] je not_installed4 ~& U+ ?2 N% {7 [* J( p
9 a( E3 r) ^& `2 b. O CThis service just checks a flag.
+ C/ A" t2 U1 H" }, r</PRE></TD></TR></TBODY></TABLE> |