<TABLE width=500>. B/ H6 F, E+ I- t3 f7 M0 W
<TBODY>
/ x9 r& n9 U5 O( B5 k. ~+ L<TR>* ^2 D- K* r W* J
<TD><PRE>Method 01 " F Q' e) p; U2 `# Z2 Z1 ^) |- i
=========
3 E6 h7 W% p- f4 H) E* f: W) r* s+ o4 E5 O& K& h: }% d
This method of detection of SoftICE (as well as the following one) is
+ Y9 _4 M3 I2 h* \1 x5 z4 lused by the majority of packers/encryptors found on Internet.
1 E, x+ E" o: o c2 }: q# D9 wIt seeks the signature of BoundsChecker in SoftICE
8 v1 w; u3 L! I) l5 S B2 u- w+ D* _3 T6 c% U) q$ \& E" m$ ^! ^
mov ebp, 04243484Bh ; 'BCHK'
8 [; _: A; c; I0 ^1 g mov ax, 04h p( o7 U! r% c s# e. y. R# W
int 3
% B$ g) W. X+ P- W* S ]3 W% q/ F% t" @ cmp al,4
" c# R# @( R! z9 O jnz SoftICE_Detected
3 `) Y9 l6 r! L1 h
4 b1 ~' U( I3 l6 q___________________________________________________________________________+ @5 L$ E! y1 N. T6 N. z& G
; B+ X9 v9 A7 I: k
Method 02
; [2 O! w' k; C. x# ]7 k: I1 k=========
/ z% C n3 m+ P# C7 `* f3 t% Z- Q. ?- ?
Still a method very much used (perhaps the most frequent one). It is used
2 c3 u! W0 _+ ^to get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 X: R; W3 t! n7 h/ v: e8 p
or execute SoftICE commands..., Y3 a6 D) s& ^- n m
It is also used to crash SoftICE and to force it to execute any commands
2 Z8 M0 b# U C' C& s(HBOOT...) :-((
& J% E7 @9 H7 P7 x/ Q5 S o
8 i/ G: m' }5 g0 JHere is a quick description:% m) Y R- _9 C/ k! f' T1 S
-AX = 0910h (Display string in SIce windows)
5 v4 |; o) v& S: r-AX = 0911h (Execute SIce commands -command is displayed is ds:dx); j& o: x7 q6 c- L5 T U7 K% O
-AX = 0912h (Get breakpoint infos)
/ n; V5 A1 Z1 q, U) Q7 h-AX = 0913h (Set Sice breakpoints)
. l3 C# B3 {2 _! H0 P7 {-AX = 0914h (Remove SIce breakoints)
- }5 X x7 q/ `+ l/ `
u+ ~: S/ R9 MEach time you'll meet this trick, you'll see:
. D2 D9 D& Q' \2 R-SI = 4647h. D/ e& n& v& X) u/ d* _* O4 m3 p
-DI = 4A4Dh
: Y: E" n0 L: K9 l3 FWhich are the 'magic values' used by SoftIce.! C" V6 q0 h, d2 Y1 V4 b3 g3 \
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ H3 g7 j7 @2 Y& l9 c- `
( D( I p+ p9 ?* s [' UHere is one example from the file "Haspinst.exe" which is the dongle HASP
* i1 K% S) Z; A% |( M( R) SEnvelope utility use to protect DOS applications:9 X4 A" v4 e' F( Q& m
4 H5 l) D5 e$ g
% r+ X$ `% Q4 h8 F, ~
4C19:0095 MOV AX,0911 ; execute command.0 _/ k' N) w9 u7 B1 S
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% W& y$ n. {; r5 ~/ T# A
4C19:009A MOV SI,4647 ; 1st magic value. o1 S$ Q {' [6 R& n, I, W
4C19:009D MOV DI,4A4D ; 2nd magic value.; v5 s4 c8 E+ }) j: ~
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 r0 n- i$ p! u/ ]
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
! `' t& {' u9 m" s" C: |% L4C19:00A4 INC CX8 u; m9 g7 P) c* J1 ]7 [4 {
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
+ W, i4 M5 R% k( y' }4C19:00A8 JB 0095 ; 6 different commands.0 @( ?) U9 I+ T" |$ I/ n
4C19:00AA JMP 0002 ; Bad_Guy jmp back.9 u& B% s1 G1 j- H& W- ~
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* n9 G8 |+ r" s( O! u
8 W* p. i, |+ d) O L& dThe program will execute 6 different SIce commands located at ds:dx, which2 N. N& T4 f, u8 c5 j& n3 k( X
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% { g7 p% H# d" |$ a
' d- [7 Z c' {- k! }* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 r/ p0 W$ s- Z. G
___________________________________________________________________________4 d0 z* D$ _' {1 g2 p) }. [) i
4 m8 E/ ^0 [3 U4 ~1 C9 h
; G9 K+ l7 e2 c* ~8 ZMethod 03
/ W2 U6 ? B- o! Z=========( }# y. J6 a4 j( K% I4 H: Q9 x
! z+ T* _2 T; L
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
; I- s. ^2 _7 k# ?(API Get entry point); @* L* q, x6 ~( Y0 a
9 n2 h. E6 \/ k. D8 t
; M6 {% e! Y3 u, D7 ~, I
xor di,di |9 S+ H. `' @; O+ |# X
mov es,di
2 g$ {! f' W) Z7 c4 E0 j0 I. D5 m4 Q mov ax, 1684h ) T X8 o; r* s5 E7 X1 k! r: ~ g
mov bx, 0202h ; VxD ID of winice) b5 a/ J" S% e* F7 u4 |/ A
int 2Fh
F# x$ q9 l( u2 j mov ax, es ; ES:DI -> VxD API entry point) ]! K' u+ O9 k3 r% ^8 X2 q
add ax, di
, V d3 ?# l7 e1 S! |5 f" d/ N& D test ax,ax% y; D$ H( Q9 U
jnz SoftICE_Detected
- h( w+ i( D3 Y% n- v. O
; w4 w3 v7 Q5 x3 Z___________________________________________________________________________! q$ [: D. I; Z7 t/ X2 f1 L& w; ]: y
9 I/ S6 y: }, y; |3 @+ n# j
Method 04
, f8 W; Y0 h" B: R$ S=========
2 s1 r5 H; [/ l( G& O. \6 O1 C! ^ ]: ~. E4 S
Method identical to the preceding one except that it seeks the ID of SoftICE! R! b' N! c3 Y9 A0 T
GFX VxD.
' E$ q& K: U5 h2 \- \9 ] T6 y& [$ I# Y3 p$ b
xor di,di- k/ v A/ g% ~/ |4 ^
mov es,di
% P# `1 N" D$ F4 Z4 ^2 ^4 H mov ax, 1684h 6 Q6 t( l' z6 G0 G: l/ {
mov bx, 7a5Fh ; VxD ID of SIWVID |0 c% n9 j3 E6 W
int 2fh, w4 n4 r" O4 G4 c8 D9 f/ r
mov ax, es ; ES:DI -> VxD API entry point
8 _( G3 u4 y" r" H add ax, di9 \, U* u4 \1 n) r$ g( v! X
test ax,ax
2 k* d5 N; W" W2 O jnz SoftICE_Detected
2 }1 k) M S% m5 W9 ^+ Z3 d* I* v8 n
__________________________________________________________________________ d7 i3 h2 v, O Z. y! C
+ r5 G2 U) R% B3 i4 ]/ L# o( ~7 F
' d) M0 [0 Z" |+ V
Method 055 M+ N" N% |) c5 N L
=========9 q0 \/ r. B5 t: W* \7 F; O
- U2 A5 y# z( Z2 @3 X; d0 e: U% _Method seeking the 'magic number' 0F386h returned (in ax) by all system4 ]) A2 Q3 l T
debugger. It calls the int 41h, function 4Fh.& D( ]4 s: q- c& {
There are several alternatives.
. ]9 c1 z, w L8 M [ i; H9 i. D1 S/ o: h) _' q/ ?; X8 r4 m
The following one is the simplest:
0 {$ R6 ]+ X: {. m) R1 Q6 z8 i
& S# t% }. d K$ E# V; R3 U mov ax,4fh4 c% G. p9 _0 I
int 41h3 Z4 D, B2 w1 X2 I& X4 K
cmp ax, 0F386
$ O* |$ A' @5 f4 x; |- ?3 T0 J jz SoftICE_detected
, ~4 e7 k$ y& A, M1 P6 S+ d. o( a: z
" k \5 V' H; j( e/ J0 a/ M1 n6 Z: S) L) H
Next method as well as the following one are 2 examples from Stone's
9 U6 s! @( N. F/ u"stn-wid.zip" (www.cracking.net):2 |- }6 z8 ~% ~
! L7 n! j- k: _' V @. n- o2 w
mov bx, cs
/ M2 U3 Q" }6 D+ ^1 w lea dx, int41handler2$ u3 P$ Y+ \; l) [
xchg dx, es:[41h*4]8 O- b& A0 {8 v$ @& v/ g$ e
xchg bx, es:[41h*4+2] H( X0 j& n) B* ^- W- |, j
mov ax,4fh7 X9 i- r0 _5 c7 A0 [1 P* ^ y/ V' N
int 41h5 K3 p% F$ b' ]% H2 v' u; d
xchg dx, es:[41h*4]
v" I+ C9 i6 r% q% w* P xchg bx, es:[41h*4+2]2 g6 b0 q7 y, K, a! a. b
cmp ax, 0f386h$ q. h- u" x9 `8 |, o& ^; m' e
jz SoftICE_detected9 p% F( l; p7 _* n
. q0 Q. g' n4 d; Oint41handler2 PROC- | s6 E5 f' j9 b" K5 `" m
iret# }& {# ^) j& [; i6 p, ]- D% C
int41handler2 ENDP9 h+ r9 R! a/ k8 j$ w
, @( w5 j2 v8 ]9 L5 h$ X
. j9 v1 L& F9 H6 h. @9 ~_________________________________________________________________________4 `" m6 r( V& I& X
6 r( B! M. z, _7 v
3 W; l" N- w9 w0 x, q7 v, qMethod 06
/ }2 j2 u" R L6 j5 Q3 I% G$ Y2 I=========. ~, s/ N/ J8 V9 K$ o
- W+ N P, t% V H0 y/ y9 K
/ h0 G7 i. s% D! ~( z2nd method similar to the preceding one but more difficult to detect:
- B3 a$ K- g$ r9 b/ m
2 g8 x! G! G1 h) M
8 t, N% l6 C9 N9 V8 w nint41handler PROC
! f' I; Z) c* I+ q' _1 H mov cl,al
! |. [6 B( J% E% Q; u iret T0 l5 R9 L% K+ b7 T X1 D
int41handler ENDP
( b" |, ~% x5 S& ~, A4 ^0 V" _5 ?! ~: N% d+ X0 E
. p' A+ N' [$ w
xor ax,ax
9 d( J' o( O. ~2 z) y mov es,ax
' ~! w* d7 S0 k4 R) } mov bx, cs, {2 P! S. v5 I9 X5 d# R
lea dx, int41handler
$ r/ H8 W" e0 D1 O xchg dx, es:[41h*4]
" v8 C( c9 @/ T+ U& O+ N1 o xchg bx, es:[41h*4+2]
, g3 ~" W) B* { u# b in al, 40h8 t6 x. \1 K* o: y3 g
xor cx,cx3 j& v+ s% [6 N8 |: G
int 41h
0 Y, E$ `& ?; l1 A xchg dx, es:[41h*4]
% ]( ?8 Y2 U, k5 x" v1 e xchg bx, es:[41h*4+2]* H. B: A/ g6 [9 j1 D7 f" f
cmp cl,al
1 q9 U8 [/ c" p9 i jnz SoftICE_detected }; F0 k( W M8 ~7 a/ b* G
/ U, j0 c/ Q/ \3 r. T& S8 o_________________________________________________________________________
$ x9 p# W7 P* J/ _! J
P5 O l O1 G) T2 MMethod 07
8 i8 L: v3 E) F% R=========
+ T0 ]" G8 u4 r- O
! f3 R: q8 o( n7 S; ]% yMethod of detection of the WinICE handler in the int68h (V86)5 y9 {" a1 h' e2 y5 s
! s- X! V" H# h2 n1 ?
mov ah,43h
9 T+ y8 S% H e8 W" z6 L9 e int 68h
7 J, C( J4 p% Y- c2 S; @6 f7 J: Q cmp ax,0F386h! I; w$ o2 B2 U2 C. ], A! P; f
jz SoftICE_Detected2 `% w1 m% b0 P. v+ N3 p. E/ V
) P: M9 I" h) o# V7 t6 v
% D: |$ Q6 a K. k* a' R. T=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ A4 B) H3 `) t
app like this:0 n+ D# {, s0 d8 |' H. [" U( {
- O9 k6 p1 ^+ o3 l
BPX exec_int if ax==68
+ b A. ~ d: M: N: ]$ } (function called is located at byte ptr [ebp+1Dh] and client eip is( B" }) }" w F X1 w7 b: v( H; ?1 ^
located at [ebp+48h] for 32Bit apps)& A3 M! ^3 ?; v, ?4 I7 Q* T
__________________________________________________________________________
; T5 q* E+ ~; G( \6 Z
4 d6 @( w3 @# O& h" |7 @3 x+ R+ m, `' d; D9 m0 n
Method 08; f7 I5 ^1 H9 m o; \* P
=========* b% L0 H2 V/ E% R3 T
( ?/ i9 p: r- n6 J
It is not a method of detection of SoftICE but a possibility to crash the
6 @ g) X( L+ t3 B$ Dsystem by intercepting int 01h and int 03h and redirecting them to another$ X# j2 V9 y3 j5 R1 z/ C
routine.
2 a5 H2 I/ C" n7 WIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, p# t1 ^$ M" p% `
to the new routine to execute (hangs computer...): t% t7 P( [2 P
- S' d" b9 Y- I$ h
mov ah, 25h
: ]8 i0 R$ u) a) w' ?8 _" p mov al, Int_Number (01h or 03h): t9 Z$ t6 v! R; k$ y3 f+ P3 n
mov dx, offset New_Int_Routine- D; D' q5 [& v* Q7 F
int 21h
1 q! n% O8 M9 b( n: j
5 f) \+ S$ y) J& ^# f__________________________________________________________________________
' g: r5 s0 e8 f, v, ?" a2 p; D! X. Z# C
Method 09
( s" E! O0 I9 f4 T" Z3 K! s=========! b' D! a$ g* _' d& T- ^ y
2 U: h _, M6 n
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. w/ X/ Y9 b) | F4 c# Z
performed in ring0 (VxD or a ring3 app using the VxdCall).- [! K: |, l m' t9 l* @
The Get_DDB service is used to determine whether or not a VxD is installed$ i3 b+ P. U# \' m. p4 X
for the specified device and returns a Device Description Block (in ecx) for
$ M" U' m8 x. n# M" L9 u3 f/ Nthat device if it is installed.# Y- S- S, s( @$ q
# [5 F) ~, v4 V2 q' n
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ [3 X* _1 R; q1 G mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' O; t" A: R1 W( d% c
VMMCall Get_DDB
: V; i4 w& V7 X. u0 O2 w mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed( p. p/ F: v" \/ n% i: L, q: g" K
, c$ h) ]+ Q- c/ J& ^7 |Note as well that you can easily detect this method with SoftICE:( P) X4 @! l3 r+ M% e3 ?
bpx Get_DDB if ax==0202 || ax==7a5fh4 Y, @9 s7 b) o
- O8 z" T: u: C2 ^2 z4 S+ }
__________________________________________________________________________
* |* J$ p0 F" c: e. u, L% t- F+ B
& K: |+ w8 J% pMethod 10
; G% A$ w7 O# c+ x H# q5 N9 z=========( ~0 [) J3 f3 x3 {. _! b3 J; |1 p. j) S
3 E+ K9 |* ]' J4 P=>Disable or clear breakpoints before using this feature. DO NOT trace with) q0 G5 P" `+ T
SoftICE while the option is enable!!
0 a) L% c) s, \4 ~/ d( R' a5 b8 z/ S$ i0 `
This trick is very efficient:: a ?" R4 S$ x. s9 j
by checking the Debug Registers, you can detect if SoftICE is loaded
" W- n* W. C8 p& e' x) J2 V9 d(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
5 {! `0 @% \$ `: s- z% U2 b: kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ z9 R8 x- h1 Z9 @( M; ]value (in ring0 only). Values can be manipulated and or changed as well% V8 `2 t6 u9 y$ [0 l; p+ c
(clearing BPMs for instance)- @* A2 H2 \) V9 Q) z
7 N4 w l8 P- n( W4 ~) e2 o6 L4 l__________________________________________________________________________
$ Y( \ V3 ]4 W" d! i- V
6 ~: [$ Y/ ~, G' y4 rMethod 119 D0 `' w, C1 ^) C O8 o
=========
3 s0 ^! ?8 z+ g3 m/ p, I% C) E; h$ o0 [# H* g$ G+ S
This method is most known as 'MeltICE' because it has been freely distributed$ Z& G1 M) c, a6 F
via www.winfiles.com. However it was first used by NuMega people to allow4 z! E# _' W* r+ n' A1 A) R5 L6 b9 A
Symbol Loader to check if SoftICE was active or not (the code is located
: ?$ M' e" x0 d: q* i8 u vinside nmtrans.dll).
; W. L# W5 b$ N. Y1 G& {. U
2 \1 K# B- ]" @ w5 n2 ZThe way it works is very simple:/ T/ ^. q5 D6 ?# O# U4 F( d% A
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" [8 G4 m1 O h) F% Z5 c! uWinNT) with the CreateFileA API.
* E1 A( m8 M9 a! c
J {! e# l8 G4 {3 F; o! ?Here is a sample (checking for 'SICE'):* [5 Y' R i$ |) D( I" b7 v
/ `- ^4 a3 z0 k3 G7 ^" Z1 u% d
BOOL IsSoftIce95Loaded()
- l3 m `) O0 B- }2 ~9 Z$ W{
% v% Z+ P9 D$ o$ e HANDLE hFile; ; v$ I# I0 R) V# B- P
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 [2 l( C5 U& ?3 q2 ^( D
FILE_SHARE_READ | FILE_SHARE_WRITE,
7 U# |3 n( x# V ]) l+ { NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# o8 y6 J8 w6 |( i1 Y1 b! s
if( hFile != INVALID_HANDLE_VALUE ) k& X8 ]' j7 u9 L$ E: K. F8 \
{
" a# F: @- U4 Z CloseHandle(hFile);
( P9 q6 X2 x7 ?* v return TRUE;
# G7 {4 h$ y6 c% b1 n }- z0 ^8 }! i0 ~& R. l/ `
return FALSE;: ~8 l# N: O# x0 a
}* K8 s0 v. \. e4 r% k1 o" Y# t2 m- M, p
0 H) V0 H8 |2 Y9 @7 QAlthough this trick calls the CreateFileA function, don't even expect to be) K* H* k, G) x! v, [, k9 R
able to intercept it by installing a IFS hook: it will not work, no way!
2 s' p" @! k; DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
) Y, }' B5 c; {$ `$ Pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. d( s F8 P. s! v3 Eand then browse the DDB list until it find the VxD and its DDB_Control_Proc [" m) W* s; }! X+ F) C
field.( v" T+ r8 Z1 L C+ `
In fact, its purpose is not to load/unload VxDs but only to send a
- p+ G: @- F% K0 }6 lW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 N: o8 }5 h% \3 A. |to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 T& G7 Z) S$ Dto load/unload a non-dynamically loadable driver such as SoftICE ;-).
# g2 J5 l0 V5 B+ M/ {2 CIf the VxD is loaded, it will always clear eax and the Carry flag to allow
* U. Y {* A, v/ o4 {its handle to be opened and then, will be detected.
% y* ?9 i$ V% Q lYou can check that simply by hooking Winice.exe control proc entry point# X8 w5 ^: m$ S: s5 V4 @5 P" A! {' B
while running MeltICE.
5 L1 Q0 ]% | i$ P0 [
B! s0 W$ R0 ?9 w9 w& `- J" s- Q) C2 q
00401067: push 00402025 ; \\.\SICE
8 T' Q& i9 e o 0040106C: call CreateFileA3 z, |0 [+ @+ A( Y9 F
00401071: cmp eax,-001
& y$ b9 K; M8 x2 l 00401074: je 00401091
3 Q7 w: `' L' d
) }! ~5 ~9 d, U, D% J" ?3 z
- b* X; g9 r Y) F8 G. }There could be hundreds of BPX you could use to detect this trick.) V Z* o' D5 H4 m f4 g% r a
-The most classical one is:
" O7 K2 ^7 _+ V3 r5 t2 E BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; D9 b! l7 _* U6 ?" ~8 T1 |% a
*(esp->4+4)=='NTIC'* {$ x7 Y% c3 g2 [6 K2 ]% P
: @0 L8 W0 X i) I- o" `
-The most exotic ones (could be very slooooow :-(
- V% W4 y% z" Z. A) E4 n& x BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') $ t" x* r, V' }" q+ Q
;will break 3 times :-(" C8 J, l8 }/ o, F7 R
3 L. G: h7 r* q-or (a bit) faster:
E$ a5 G- F4 k6 B% k BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 \% c" I# A1 T, c
( R7 p; R5 N+ J) G0 | BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( w" U) G& D- t; e6 e+ B ;will break 3 times :-(6 p- b3 O& [, `: f
1 C+ B# Z# N3 v3 }7 _
-Much faster:( J5 ]$ ^+ w7 R# L8 p7 k- {
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' c# x# j% V, e. ]1 h# w
" [+ j; L! V, [- t S9 r2 E# ENote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& U R, q0 E0 ?2 x1 tfunction to do the same job:
" E6 \/ U& `0 v: d" J3 d, {; U& H+ p) N3 o
push 00 ; OF_READ
: @# e/ W6 W7 O, V2 K6 ? mov eax,[00656634] ; '\\.\SICE',0
. M+ ]: Q' K4 g, {5 ^6 T5 o- s push eax, l" X! `% I& g" i1 S' D
call KERNEL32!_lopen! F/ o1 D4 w$ a/ Q. m, A
inc eax
- y* g+ D% `( G* ^+ A% h4 P jnz 00650589 ; detected
( B4 p. S, C" H push 00 ; OF_READ2 a2 k/ d2 {; q2 u
mov eax,[00656638] ; '\\.\SICE'
+ v) n) }% x- K push eax: G1 I7 }. z+ N# x
call KERNEL32!_lopen8 o2 G& ?: n$ N* }- v6 y0 K$ \
inc eax
) o! C6 `! }0 |2 I) n' ]( V jz 006505ae ; not detected Y& q2 j& J, b! R7 \+ m3 v5 a
' N7 L! l2 D# I8 q! ~) g% a4 S; N$ E* w. Y
__________________________________________________________________________" s* ~6 f- W$ k: S4 |: {
& ?! z4 j* z0 F+ nMethod 12
" \' k5 S, c: N* {& d=========; m$ \/ y" z" m! r! D1 S
. K, c$ H, z# v q3 NThis trick is similar to int41h/4fh Debugger installation check (code 05
' B5 s$ ]) K2 O) m% g) m; l& 06) but very limited because it's only available for Win95/98 (not NT)
7 v; l# I8 Z7 s" @/ \as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 |( g' p. Q! m) @% [
5 T% ]7 R& f) V6 B push 0000004fh ; function 4fh
) q0 {+ u2 r+ x/ | push 002a002ah ; high word specifies which VxD (VWIN32)2 Y+ Q0 j/ Y5 `) w
; low word specifies which service
+ H' ~. f" f3 @+ `- L (VWIN32_Int41Dispatch)- P x; j0 O' R' G* {
call Kernel32!ORD_001 ; VxdCall2 y# G" N( E* n p1 A0 t, N
cmp ax, 0f386h ; magic number returned by system debuggers
* E, { @0 K2 }6 [" a9 { jz SoftICE_detected
9 I1 {7 b6 _' y/ B9 ^1 u. K' R& [5 k. H( ~
Here again, several ways to detect it:
+ x* M5 V! x; ]) |' g" M3 A# T. N7 o* K& n/ X u: s* X6 {
BPINT 41 if ax==4f
( S9 k: y3 z# H7 k! e# D5 \) ?$ O+ ^# j( _2 R- }$ U
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
$ _5 }* K1 V# ~ Q8 L" z5 M5 e/ S; ~2 `( h( \/ g. F- @
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A. C* a& [2 a9 Z: S' b3 `
0 X5 |8 _* i1 B
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
1 p2 \; c& e k1 j; a9 r& o/ h" v9 e- O, f! H, K% U
__________________________________________________________________________9 z2 @ g' |- k9 _
$ _8 T s) `* }4 G% @2 yMethod 13# L8 o: j/ Z. J
=========
3 M- B: Y P* M- o" ~6 F, Y0 i$ a( n2 ~7 y) x
Not a real method of detection, but a good way to know if SoftICE is
9 ]5 ^* Y. u: n$ U6 Einstalled on a computer and to locate its installation directory.5 }$ |% Z$ F. T/ R: L
It is used by few softs which access the following registry keys (usually #2) :. _! q/ X, W( [8 Z; `8 {
. k7 n4 h5 ~7 G* Y& k. R-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& I. f# |; ` a; z" _
\Uninstall\SoftICE
6 Z9 e& ]; l7 H+ t-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- N. I3 o _, d
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 S2 J% ^4 x% R7 E- f$ _* ?
\App Paths\Loader32.Exe; g9 f1 a' |8 I; [$ N Y, Z
" x. t [+ Z% P1 p$ ~4 D: g" f( c% B% P9 x1 u8 z1 B2 d
Note that some nasty apps could then erase all files from SoftICE directory
m7 P* w2 M" H( n3 {' C(I faced that once :-(
7 q; h- f+ E& ]
- k l/ _; E6 }* @* aUseful breakpoint to detect it:
+ \# l% p- v4 h+ ?" g' F
1 n+ @4 F+ P: x* A" u BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
], n( y6 [3 V- p: o [8 p3 f8 J$ T
__________________________________________________________________________- v! j G* y, F- F
) Z/ ?1 Y r Z4 H/ Q1 T( L) [- m% c F+ H: i$ `+ \
Method 14 ! S+ S) o& v, b6 l: H
=========3 k3 \8 V3 \, k
- I) D: m5 `0 N- ^% P
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& S$ s7 R- L+ @) Q) L4 {is to determines whether a debugger is running on your system (ring0 only)., r _! j/ S) U' a" z
6 t/ e% q+ t9 ^; Y3 N VMMCall Test_Debug_Installed
) O# a3 D5 ~) l0 P je not_installed
+ \6 l0 i8 R4 K
2 u9 }' ~$ J# g2 a$ u0 iThis service just checks a flag.4 b6 }2 C! ^6 t6 o
</PRE></TD></TR></TBODY></TABLE> |