<TABLE width=500>+ M9 v4 C8 R- p. W
<TBODY>' V [6 W8 h. k5 z% P
<TR>
8 ]2 W% F/ \5 Z: V3 p<TD><PRE>Method 01
p* p! E3 k6 u6 Z=========: O' f# D @5 Q+ k0 M' R1 T
) X2 w/ R' Y$ p: m3 H
This method of detection of SoftICE (as well as the following one) is# h# V3 U* C- U6 s" ]3 f' _
used by the majority of packers/encryptors found on Internet.2 v& x4 n- {; }2 B' w
It seeks the signature of BoundsChecker in SoftICE
3 y0 [0 m6 Q$ Z+ l' u8 z2 j0 u3 T% {4 B+ E
mov ebp, 04243484Bh ; 'BCHK'
( s+ J+ F `# X. f1 r mov ax, 04h
! S1 H2 P- S5 K! U' G6 J1 Y int 3
& c- ~! U6 z- ^) D# x cmp al,4
1 \1 W/ L; j3 o1 Q( [5 Q jnz SoftICE_Detected3 S: h0 }; Y' k: x$ n
. G# k0 _( d5 C2 _& k___________________________________________________________________________$ J# x9 R2 e+ [5 f, {, [3 {
1 u3 e @2 k* q, ~
Method 02
! f, n" {$ |" i. N9 j7 p: {3 h=========
* ?7 m* v. a; G$ o, c& t8 G0 r
0 ]$ U0 Q8 ?* N; K5 n3 _+ oStill a method very much used (perhaps the most frequent one). It is used
K' u( x3 A5 j9 k4 vto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ R- U9 H5 @1 J+ Lor execute SoftICE commands...
4 I0 _, P" C" D/ c L) S$ H8 bIt is also used to crash SoftICE and to force it to execute any commands+ l0 U( s$ Z' J0 L' U
(HBOOT...) :-((
& Z6 S2 N. e9 Z) \ v4 C8 P$ z
^6 Q7 \3 o0 m3 o- T: O8 YHere is a quick description:
, C3 A! m+ v( a( e3 e- s2 s/ L0 _-AX = 0910h (Display string in SIce windows)
4 d/ F% o# _6 T; ~-AX = 0911h (Execute SIce commands -command is displayed is ds:dx); \5 g/ X+ R% L9 c' ~- @. R9 P
-AX = 0912h (Get breakpoint infos)
9 C. ^. m0 ?, F-AX = 0913h (Set Sice breakpoints)( w( Y# I+ m3 R7 S# _) S9 ^
-AX = 0914h (Remove SIce breakoints) n5 V) J8 b$ {
7 O k H& F5 K7 { a3 L/ xEach time you'll meet this trick, you'll see:+ f3 `. }. p* }% q, }
-SI = 4647h6 M' E2 D$ r. j" t3 b5 M
-DI = 4A4Dh
; Z: z- Y; ?4 \) {8 O8 `6 ~0 VWhich are the 'magic values' used by SoftIce.2 r" @$ |) ?8 a
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: ?! ?) ]9 q* M% r" e
) L3 Q4 V' e5 T% RHere is one example from the file "Haspinst.exe" which is the dongle HASP0 [+ N P1 e; r q4 {$ k2 s
Envelope utility use to protect DOS applications:
+ f! x* e5 m; Q7 Q0 w1 N) j* i8 g5 P
4 d- A3 g$ X0 Y, ~
4C19:0095 MOV AX,0911 ; execute command.* B: U9 z- E8 P( T5 _
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).3 o$ J2 {5 X9 W7 @. n+ Y
4C19:009A MOV SI,4647 ; 1st magic value.
- A7 i- @# L7 U- K4C19:009D MOV DI,4A4D ; 2nd magic value.
" j+ J9 O/ @" ^ v4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& a( K( H3 f7 C6 H
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 C: ^# N0 t7 X* K. |$ V0 h4C19:00A4 INC CX
2 Z3 m9 r% Q# c: D4 c5 O8 t4C19:00A5 CMP CX,06 ; Repeat 6 times to execute3 G0 n; O8 a% x
4C19:00A8 JB 0095 ; 6 different commands.. }) \" ]! I7 D& t+ w
4C19:00AA JMP 0002 ; Bad_Guy jmp back./ D/ u6 ?$ L$ ~) X
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* l1 b5 Y! s% L' |% W: h0 v. T' I2 E
# ^* b2 [1 h' C# mThe program will execute 6 different SIce commands located at ds:dx, which
Y/ Y& i( P1 O5 P& @# Mare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
: C) Q# x7 f: J
, V. I( z9 d8 ^. l6 q# Z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
2 K4 S, O# M% X" l___________________________________________________________________________( b, b1 q8 T/ N# Q/ ]' q; |
" A, `% Q2 e" e% H
2 l% G9 ]; G( g; G1 r* V) oMethod 038 [0 F* \+ T2 p
=========7 ]$ o2 P- k6 H1 \" ~, u5 n8 a
' W% W: D5 U% N4 |
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h( \/ a2 ?! r4 ?2 [" w& M1 q
(API Get entry point)7 X( ]7 A9 M/ k' l
/ J3 i7 u/ f* I6 r! B) M% }: _
; z' A: p8 \, y9 c3 R9 [ xor di,di
( g/ B1 ?7 F3 |- f: ^ mov es,di, C% B5 Q, v' u& s" U+ T
mov ax, 1684h
# ]6 {# O4 m: d# c mov bx, 0202h ; VxD ID of winice
$ `) ?6 U* T$ f int 2Fh+ v: |' d* P; P; f2 W7 T) s
mov ax, es ; ES:DI -> VxD API entry point
; }8 c# Z7 d5 X4 f |1 X add ax, di
3 R+ I, |) m- a, N# b; I test ax,ax+ F5 I0 @4 W* ~( G: N6 _
jnz SoftICE_Detected
0 i& A2 K$ c" w; i! q6 J
# y; l- L/ w% K! O___________________________________________________________________________
% J# ?5 P. O7 ]! u- @ S
! e2 H; d, @1 [0 V; S8 o9 f8 GMethod 04
: u) L% z: A% I& I=========0 i4 I, e5 ?! H2 j% V
c- B3 e$ Z) G: dMethod identical to the preceding one except that it seeks the ID of SoftICE7 K Q- H \# a- @3 x) Y. W* S
GFX VxD.3 B0 D6 F' ?: V( D* P. Z" c
" Y" ] E% T0 Q& R
xor di,di- e& U1 r p+ g) @6 x
mov es,di9 x( w4 Y) z: x, l- ?; R; \
mov ax, 1684h 2 m: `9 A) t& A% q: |
mov bx, 7a5Fh ; VxD ID of SIWVID
. n* B% f7 j: K6 ~( z7 H2 I1 B int 2fh
' @, q! N0 ~0 Z; r" ]3 `& h4 ^, a: s. R mov ax, es ; ES:DI -> VxD API entry point+ E1 f$ r7 K6 W/ N) N! r. j
add ax, di
) {4 I! I N; v$ h" w9 F' z test ax,ax
7 `; `7 b- |* S+ j6 I, A jnz SoftICE_Detected; J. d+ o" J/ @6 j6 C, Y9 I: j" {
0 h) s: ?6 l& _7 U& S0 [__________________________________________________________________________6 U1 i- T# W/ i9 E4 ]6 q
7 y3 M* E0 O" J3 l3 s9 z
% K! _1 w/ ~ ?. Z# a1 QMethod 057 C6 v4 }' ?! I7 c/ a+ C
=========: z* R7 K* e8 D
( C# u6 z3 z; S0 Y1 X6 n( w7 P+ EMethod seeking the 'magic number' 0F386h returned (in ax) by all system; m8 @- e- ^/ }! X7 P( M4 D
debugger. It calls the int 41h, function 4Fh.# P( D# A( v3 W. h) G
There are several alternatives. ! B' i; P4 ^8 h% G& J/ U
: Y8 I2 u$ X! Y; y
The following one is the simplest:
* p) `6 J' B' p
- t1 {1 J9 U" _! w0 t& } mov ax,4fh
& W' S9 I$ r' {. v8 J, j/ p int 41h8 T: z: U3 e1 {0 A: W% T
cmp ax, 0F386. m, R6 d4 P, F% x1 ~/ M/ c+ z
jz SoftICE_detected
# ~' _7 v" U; E; a) Z8 e( r2 k, u) j5 O# j+ u0 o
N+ s9 B# }) Z3 I9 G. n8 u" i
Next method as well as the following one are 2 examples from Stone's ' s7 V W! V) c5 y# [ R, Y7 M
"stn-wid.zip" (www.cracking.net):
4 S! p$ i* `' y5 Y4 r& |6 C; R7 {3 ]) P; z
mov bx, cs
! o' ], _8 {! y% [$ O$ S lea dx, int41handler2
6 l- d% v- Y& U- o: n6 B xchg dx, es:[41h*4]; U: X o3 x" p8 U- J. U0 T' A
xchg bx, es:[41h*4+2]
* _) E' n! Q4 @ mov ax,4fh
$ S7 {6 B" u) M9 c2 y int 41h8 ?! ]7 R. J; [) G2 ?: w6 _
xchg dx, es:[41h*4]
2 L& C, C- b6 J xchg bx, es:[41h*4+2]9 `/ t- D! G6 }- Y
cmp ax, 0f386h- \# w* U5 ?% D
jz SoftICE_detected
5 z% X' i* x" @& R9 z) A7 ?' l' e7 J9 Y, m; Z! w: ~1 \; l
int41handler2 PROC& g+ v! J; j1 T
iret
) U' f6 @7 P9 jint41handler2 ENDP* f5 k1 P6 {+ r, J
( u" t8 n5 d4 x; T6 }* y9 [0 g1 P2 A ]7 A$ l
_________________________________________________________________________% Q& ?0 _) H; f) }3 [5 V
! K" C& `3 }6 I* q- d
3 d I/ ]: ?2 d$ GMethod 06
v; j% B) U" @& K, b: z=========
8 A5 s6 L+ |2 p8 c1 n
, a/ n ^' J6 V1 n; m. M( V5 R0 }5 y3 F+ O- j, j) E' I
2nd method similar to the preceding one but more difficult to detect:
% D2 [9 x8 x6 T6 W2 I; R6 ?2 M" y% a
" h. N' J. U: U1 y5 w
int41handler PROC
" V, N/ e1 ]& }! M mov cl,al
+ C$ v' q, N3 A# j( {& D iret
: y" M( k2 b2 Y2 w5 z0 sint41handler ENDP
' f1 d5 l$ `" O" e/ i7 Q5 u3 U; w* ?/ v8 w3 S& \8 `1 s
+ N d/ v6 r3 l
xor ax,ax
G- M: \# V: y, B, g mov es,ax
$ m7 O6 j R5 [% D' d3 ] mov bx, cs+ p& V7 d: r' F) g4 d
lea dx, int41handler8 M2 u' ~! k6 [) b7 ]
xchg dx, es:[41h*4]* J8 r% E# X `: n5 h/ a
xchg bx, es:[41h*4+2], k8 I9 F- W/ J) ]' O+ ?8 M
in al, 40h
1 ]5 E' J$ S, w! j l& N xor cx,cx& K/ o# u" J- W) k# {) k
int 41h2 J' e d; h& z1 {1 Z; d2 f" Q: s: E4 u
xchg dx, es:[41h*4]3 ?2 A/ G# B1 M! l! F5 d5 T3 R
xchg bx, es:[41h*4+2]) h2 A1 t- ~/ T4 `3 M
cmp cl,al
/ U! r& ^' b' w3 [- b; I( j( j jnz SoftICE_detected! N. M- j# d; `# ]) ~, Y5 {- \
5 U( m3 \) X) ^3 f" m7 A) r1 S
_________________________________________________________________________4 ~0 I$ J1 p7 ]3 Q/ B% {$ h, J
1 d0 A% P8 w$ ? jMethod 079 O! j( z' M8 \" c, i# a
=========
; X b4 B9 @; q% l/ o$ W# z% F6 b) e9 u3 I, T1 B/ M) Y$ L
Method of detection of the WinICE handler in the int68h (V86)% A# p" j* s$ W' X9 F" v' f; J: \
% P$ _" h6 m% x; d! Y. i: n/ \
mov ah,43h1 X: K' A' G* u! A! A
int 68h
; P# ]: L; ]9 ]; q# ?% l2 N1 v. r cmp ax,0F386h+ r0 q' s* [+ R6 I" j$ n
jz SoftICE_Detected% L2 U! \- L8 Z
2 u" X1 W. L% y( ~; t v. x
* u% i9 U6 W& v, t. ]=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit" c# v, U, J8 T$ N& V
app like this:
. |$ q0 @ k3 S7 C/ M
w( T# \" L, B) ^ BPX exec_int if ax==68+ _7 D) Q$ t- q* A; @1 U9 A
(function called is located at byte ptr [ebp+1Dh] and client eip is
" M, v+ n3 i( J located at [ebp+48h] for 32Bit apps), ]+ s7 \/ V( Q7 ]4 X
__________________________________________________________________________
* Q! s( B$ ^8 P" }7 D6 ]
+ W0 g+ J% H4 T( r: j l
% q- n' g1 B: [9 D9 [Method 08! q" y/ E3 @, S W; h2 z6 ~( H
=========) ^3 s+ z/ S/ `
& T+ k% D/ L6 oIt is not a method of detection of SoftICE but a possibility to crash the
: G2 B* L8 C: S3 ssystem by intercepting int 01h and int 03h and redirecting them to another% K l% d2 v' ~# K+ a
routine.
- V) E; m5 @2 g0 w! v$ S* Y% cIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! y# {3 ]2 f, F! ^5 J* v y
to the new routine to execute (hangs computer...)
9 R! A. F* X4 `+ Y7 Q$ v Q3 ^5 t7 X. d" z, ] h/ E0 |
mov ah, 25h' T/ d6 r$ v5 Z' I: p
mov al, Int_Number (01h or 03h)$ {4 M* B$ N: L& V, W/ M l( m
mov dx, offset New_Int_Routine# F) b; k0 ^) _5 m* Y
int 21h5 j7 o$ F# v% x! o& I+ F8 w
; ^( p4 |! T0 ?: k' f
__________________________________________________________________________
8 C$ Q3 v" W# N& M! r6 j7 k& C
: }6 z- @0 O; ] z' d0 n+ j/ O# OMethod 09
" Z' h' c/ l. [7 g" ^4 D=========
& v3 j* l. W g
! T/ i- N9 [7 d$ _( B2 `3 B6 M& g! d3 KThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ |) V) E% Q8 V: s8 Q% h
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ |( ?+ h- U" t- YThe Get_DDB service is used to determine whether or not a VxD is installed
# C/ ^# P. {9 s: M( [1 Kfor the specified device and returns a Device Description Block (in ecx) for' [. l6 J! B2 H6 j2 g
that device if it is installed.0 h2 _) V0 ^ |: A8 a5 \
, V. U: R2 L, B
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* d. P& n9 S- D1 T4 d mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)4 J& J/ f$ T2 Q# o
VMMCall Get_DDB
, Z5 @, s5 ?, U8 m- Q+ T mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* i' `1 s4 { ? [, g
j4 `2 A/ I* S j# [( XNote as well that you can easily detect this method with SoftICE:
0 q, M' o G( {; O8 f5 r, ^* J bpx Get_DDB if ax==0202 || ax==7a5fh
7 X7 I2 |% w- A; y$ n) Z& T" B/ d
( Y8 N2 a7 H6 A- Z% n__________________________________________________________________________
7 f' U [3 j4 u E" C- R" W
/ B5 a/ F2 @3 G( Y. MMethod 10 i) Q& m: h; ?; {+ F
=========
$ F/ C" y' f" X
0 m6 L \+ U" G9 R=>Disable or clear breakpoints before using this feature. DO NOT trace with# a$ N" |8 L0 z0 A
SoftICE while the option is enable!!5 Y$ T- ~' R$ C1 ^, q
, ], J; J* o$ t" |) ?* U; \This trick is very efficient:/ z% ]) l U- P# J* J' u" z7 Z
by checking the Debug Registers, you can detect if SoftICE is loaded
' ^' d! ^9 l2 |6 `8 M(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 E0 N- L( k2 Q% Z, k3 X' V: i% X
there are some memory breakpoints set (dr0 to dr3) simply by reading their* L; W! b# N4 J( J2 i6 v! C
value (in ring0 only). Values can be manipulated and or changed as well$ O' b) ?* f- @$ s8 S4 A4 e
(clearing BPMs for instance)
# J" y' }$ A- k3 h8 y, T* f( [( p7 z7 n8 P0 l2 h
__________________________________________________________________________' D$ J. R( W, n- w4 n
+ Q+ o6 s8 r/ `1 O8 z# aMethod 11
. C1 L d# X2 T; t=========* G2 a) S! L! l0 D' Z; ~9 K0 y
/ S- A3 y0 Z ^( F* v
This method is most known as 'MeltICE' because it has been freely distributed+ H& l* O! O8 `5 f* z; E: h
via www.winfiles.com. However it was first used by NuMega people to allow$ Z' O! ]2 Y+ t4 u) N
Symbol Loader to check if SoftICE was active or not (the code is located" h! C$ t3 t' E6 a8 d |" g5 p! [
inside nmtrans.dll).
# }0 I9 m/ @% l/ f) H+ f+ G2 l
The way it works is very simple:
2 H4 W; Z- m MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 j O9 @( ?8 T: D% N& y
WinNT) with the CreateFileA API.
! i" Q5 @) U. w. w6 i5 G" A' I4 Q* A) l6 Q6 o2 I
Here is a sample (checking for 'SICE'):% W- F! Q7 |8 v# c j
# E- l' L" @' c
BOOL IsSoftIce95Loaded()
) i* n9 E6 H1 ~+ K{2 ^ Q0 \: f8 H( Z5 C. e; E
HANDLE hFile;
: k; F' a* L% r( a1 U hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. [* R7 u; b& }+ g3 A4 j8 K
FILE_SHARE_READ | FILE_SHARE_WRITE,
8 R/ s' E2 Y: {' v' Z# _# b NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
T+ l1 H$ v, d( `! I' |6 A if( hFile != INVALID_HANDLE_VALUE )
% `( }9 |& @6 X' D2 w9 U3 G {
$ J6 v/ x4 K: j4 O5 h1 W CloseHandle(hFile);) I9 X) a1 Q4 R6 V& u4 v. ?
return TRUE;
^ f; \# D B7 y) z4 p }
1 t7 t9 v& P& C# [8 f5 L% Z3 h return FALSE;
% Y( z$ n! D5 _}( t& w# D+ t( O2 T' w! n' x
; h- f7 J" L! @3 U# N
Although this trick calls the CreateFileA function, don't even expect to be. P* E o. z! h+ @
able to intercept it by installing a IFS hook: it will not work, no way!
: j+ A# Y, H8 Y( r' ~In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 e @# a9 ]/ V9 s
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ p5 x$ E1 G- Gand then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 O5 [9 V% |0 r9 f9 F1 ifield.$ C# G- F" s( n5 y! N
In fact, its purpose is not to load/unload VxDs but only to send a * J8 O' O' Z4 `$ u& j
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& j* Y5 ]- O! }0 H/ u9 ?, d& ]
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; P/ y' `( B- n ?" T* Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ g; E: \ @/ A9 ]. ~% U! R6 l% g; CIf the VxD is loaded, it will always clear eax and the Carry flag to allow3 _ Q+ X& C( j( U( ?) @
its handle to be opened and then, will be detected.
) d2 f6 w1 r& A* S) \You can check that simply by hooking Winice.exe control proc entry point ` r. e' \! _5 r: f5 D
while running MeltICE.8 l7 W- I1 Q& p% ]
+ a3 L4 G7 ~. \3 B4 s- r$ {
; g5 Z% ]. q- F) e. C6 q# _ [1 r
00401067: push 00402025 ; \\.\SICE
5 w+ E: V# h* E: ~: T) d6 \/ a# C) e: Q, Q 0040106C: call CreateFileA
" z! \9 N: O" l7 B$ x# f! U 00401071: cmp eax,-001% v1 k, q% C/ x% O# U+ M, F, d
00401074: je 00401091, X7 B0 x) n3 f+ h
' d" J4 l! M. I7 J
9 Q) t& \8 a( }5 g% gThere could be hundreds of BPX you could use to detect this trick.
2 { F O! q% s- x% B! F0 q0 O-The most classical one is:
9 a5 m: k3 _& c1 ]' `5 f( z5 L BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||6 r% K) x# C6 _; R$ u' o
*(esp->4+4)=='NTIC'
1 `9 c+ M B1 R N, o4 V5 x) w6 Q# h; D6 Z& ^
-The most exotic ones (could be very slooooow :-(% d! @! s) f+ w( d% N
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( N g: u- K3 O) R
;will break 3 times :-(
; b3 T' o1 v' O) Q3 H# |, T2 d! f0 K% A
-or (a bit) faster:
; E) Y: a, k1 a. x1 v, U' Y( S+ ^* [ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 o( i) s; ]6 m1 X9 }9 b8 K( m
* U \. t( n, H8 V8 ?# V' s% `
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' / W# o+ S" O) [% o, g7 ]; S
;will break 3 times :-( {2 J7 L. \3 ~5 y/ _) h
$ q5 T& i' ~3 J5 W8 R
-Much faster:# w" O" f" g6 K5 [4 n
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 c* Q) P+ q3 m6 \
1 d* c: {2 u2 o2 B
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" T- C p) X* Tfunction to do the same job:
; D4 G( p/ X5 x2 s3 Z+ G! F" S7 [6 ~9 f! C! Z- }
push 00 ; OF_READ; z" P& e4 F2 r" _/ z6 A% P, B
mov eax,[00656634] ; '\\.\SICE',0
8 L- o+ P. V7 r/ _ push eax w) n! a) u, ]
call KERNEL32!_lopen
/ ?2 E5 o4 g% J$ l# r5 V inc eax- z3 y" k9 \* c$ e& K/ I( x' }
jnz 00650589 ; detected
# _9 x8 Q, y& u- c' C' Y push 00 ; OF_READ
O b& _9 k* S# | mov eax,[00656638] ; '\\.\SICE'
* H Q, `# u( p push eax9 _9 }% N7 n' i3 e& F9 k
call KERNEL32!_lopen
8 @& a% N. r7 U! K& d inc eax
; [8 k, e" ?! P8 L) I4 F, A jz 006505ae ; not detected! M1 E5 P% L1 n/ G" Y6 ~1 i
1 S, i3 u1 e0 T3 a7 e- s j+ q2 I- \! K: V- d
__________________________________________________________________________- ?' n- J; {0 _% Z6 `
" C- s* ^( T& i7 uMethod 128 H& c ]( n7 v8 q) c8 ?
=========! ^& F: i5 ? H) [6 b4 _$ R& T
3 ^& \/ W" d! oThis trick is similar to int41h/4fh Debugger installation check (code 05: A$ A, [ m! \1 S, A+ @
& 06) but very limited because it's only available for Win95/98 (not NT)
; M2 n8 S& ~" h; Y6 @as it uses the VxDCall backdoor. This detection was found in Bleem Demo.+ R- r$ m$ @- D" I
& m8 t$ @2 c# _ push 0000004fh ; function 4fh
/ p2 _* M: ~! d1 W0 U push 002a002ah ; high word specifies which VxD (VWIN32)
3 M5 \4 o$ k. Q+ J4 C) S ; low word specifies which service% k2 _* @# E2 m
(VWIN32_Int41Dispatch)3 v' P& e8 A& n% h3 {& k
call Kernel32!ORD_001 ; VxdCall
6 o+ ?! d! l# F3 c! k, X' y cmp ax, 0f386h ; magic number returned by system debuggers9 U7 ?7 s" \' {# A7 j' U: D: r+ [
jz SoftICE_detected
/ K4 N5 M# b7 W/ g
; z3 M1 \& l8 n! E- p8 FHere again, several ways to detect it:
' a0 s7 v0 H- c& E0 }) w9 O1 X+ |5 X
BPINT 41 if ax==4f: @" |; _: W0 K1 h% z
: W, b& h4 C$ n! v+ r BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one3 n4 a0 Z' u( E- T3 V7 v, K8 X* b
0 n; U5 }9 o2 S% T0 x BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 B# }3 A! z1 y- J. G, R# ]" K$ q: I. |
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
/ [1 R( e' ~0 H
& ~; t+ u% c( b, P__________________________________________________________________________
) ^# W3 w7 G8 p" x% K8 n- d5 O( Z. T8 C3 R9 }3 d9 l" h5 ~
Method 13
" P6 O3 `8 L0 l0 Q=========
+ e- V3 d: i" \3 j { x" c0 Y& a: d; O1 J7 E; ]* ]7 {8 l
Not a real method of detection, but a good way to know if SoftICE is9 z; c9 S) w* C- P( Z
installed on a computer and to locate its installation directory.& e0 ~6 O$ {7 x0 C* h2 i; T* a+ e0 ^
It is used by few softs which access the following registry keys (usually #2) :
. M1 N. r+ |' A* ^4 s
) l$ y2 B1 q2 t: F-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; T5 N) u4 V8 o- r
\Uninstall\SoftICE9 }) q3 b) D7 k8 v6 M/ \/ s" j
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
7 t! n7 P8 \0 w! O. ]-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 j* M; C4 L" U7 S- }( Z\App Paths\Loader32.Exe
1 Y" E1 y1 k# _: b- z( g4 s# y9 E2 {( }: G$ H1 O0 F
8 \2 L5 j- K# y8 o5 P/ A. s' c
Note that some nasty apps could then erase all files from SoftICE directory
0 z! h# m5 _. h(I faced that once :-(5 A( }" x7 Z( z% v+ l3 G% x& l
: \4 P4 q& h! y! g; m) }/ }
Useful breakpoint to detect it:
# `* r4 c1 E$ q8 L3 ?5 ^
. O/ a1 v/ c$ ? BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 `1 G$ I6 K7 _: b" A! g
7 l+ w9 c- [* U+ U r, ]- h__________________________________________________________________________
0 l: v/ o7 {- O9 p
+ ?4 ~' T& T- v4 \ N$ p$ S+ D$ F/ V9 p2 i! g! u, q/ R
Method 14
% W g! Z- f6 |" V=========- q1 Z a1 T. r
6 l/ X f( e. e `" i* ?6 ~
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! L8 I* n& o+ O
is to determines whether a debugger is running on your system (ring0 only).; w0 G# T1 t5 D k5 O
( M) @ y4 j+ m, X6 d
VMMCall Test_Debug_Installed* X5 V, h' ~0 c5 i- w9 a
je not_installed F0 I5 I5 [3 d" v
- _- q. ?# P9 ^* C' H$ N+ G
This service just checks a flag.- Y9 o6 J* B2 \" z% y' {
</PRE></TD></TR></TBODY></TABLE> |