<TABLE width=500>6 w' L' H1 n. G7 h. B' Y
<TBODY>
4 [/ C! q& H# }- \8 \1 a<TR>$ y& a# Q& Y' n# K5 x
<TD><PRE>Method 01
& a2 \4 F8 Z) c$ K1 y0 L% J( `; z=========
$ K6 C3 f) h( u' [- X" V
$ n; Y4 h( G( k+ S: {) z, Z# BThis method of detection of SoftICE (as well as the following one) is h! h: i/ y4 N- |$ n0 x4 z) |, g$ \: A
used by the majority of packers/encryptors found on Internet.$ |* ?* {, U2 i' G7 E1 q
It seeks the signature of BoundsChecker in SoftICE
; g" [' A" p$ J: f: w
+ X8 k- A# b7 ^6 V {2 O s mov ebp, 04243484Bh ; 'BCHK'4 s0 g1 G x6 D( m; U/ _; \
mov ax, 04h
$ m* ^/ k6 v4 [8 Z( u7 h int 3
( x+ x/ ~9 |) Y7 A( W cmp al,4
# o+ ]+ D$ D4 J0 F% m' W# T$ w) u9 n jnz SoftICE_Detected
1 K. D( |) l6 b7 a% B( Z
" b& `; |' W5 M/ k___________________________________________________________________________
/ c3 Q# e# |- B2 L! }3 ^& ^' {3 u; f3 D# L7 @
Method 02 \. I, `& Z/ z& i* {$ K! v
=========: m' v$ Y, q- r; U3 l" c
# O$ ?5 t1 M! ?# H2 y: EStill a method very much used (perhaps the most frequent one). It is used
: `- S4 c$ M5 _6 \, O# c- Bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,. Y- b% q# k7 {6 ?+ T
or execute SoftICE commands...; C8 u- U+ P, l
It is also used to crash SoftICE and to force it to execute any commands
8 ]2 Q. N2 j$ @0 ^( L- }2 D6 Q) U+ K(HBOOT...) :-(( , J( l9 [. H4 Z8 c* @
4 m! N. ~* P1 F
Here is a quick description:
6 O" ` ^7 o" f-AX = 0910h (Display string in SIce windows)0 J6 W/ V5 h( U
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
8 A7 [( x G) T& ~: Q5 z- p-AX = 0912h (Get breakpoint infos)
! _) I& e0 e; v! q-AX = 0913h (Set Sice breakpoints)4 d) X3 d6 z4 I: T- o
-AX = 0914h (Remove SIce breakoints)
" x( f- I8 u% \8 v8 k1 |
% Z) z& U* W2 m2 TEach time you'll meet this trick, you'll see:% ?9 C6 {% g2 n1 h" |+ w! g" S
-SI = 4647h) o8 K4 i! {8 e* @ }
-DI = 4A4Dh
! m- k, R7 O/ w @/ T5 `Which are the 'magic values' used by SoftIce.% ]$ r# V6 c2 |# ?* d
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ h, j- P4 D( l7 ]5 n! G( \
& @" H+ Z5 T; p8 FHere is one example from the file "Haspinst.exe" which is the dongle HASP
- s# l2 }1 r) V" e% [* C5 c2 r0 XEnvelope utility use to protect DOS applications:
: w- S M% t2 d6 E) r' q! l
/ c" ?/ w, {& Z, }
* n; b0 ~* }) h4C19:0095 MOV AX,0911 ; execute command.
5 b' a! D7 c$ t( c2 Q2 \4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 a- g8 \2 R5 l. D+ R4C19:009A MOV SI,4647 ; 1st magic value.: M9 }: h: L! K: P
4C19:009D MOV DI,4A4D ; 2nd magic value./ Z2 o1 P( }7 g
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' \# Z. g" N! J: `
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute$ p- @; @* K- C2 Y/ S* C0 l. d
4C19:00A4 INC CX# i, }( H" V! }2 \4 [% d& i
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' ]6 h3 R1 x/ N* I7 x4C19:00A8 JB 0095 ; 6 different commands.
' ]8 C W9 ~/ T" e5 ~) j- R: v4C19:00AA JMP 0002 ; Bad_Guy jmp back.% i* t' @3 m* ~
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% f/ Q& {" f% Q2 A1 r: Q
( {) [7 A5 I7 e& t
The program will execute 6 different SIce commands located at ds:dx, which, L5 }2 a& E: _, ]* d% l- u
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" m; x @$ b8 y% S
7 T o( O7 J+ a6 Y1 b* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 D9 `- w% |( h }
___________________________________________________________________________
9 H: q2 m2 M* v8 e6 |& B; S* O& [. C0 v: d m6 I+ ?
& ]# s% o; _6 t- N* m- n0 S
Method 039 ^6 ^5 _" K" l, G) n d
=========
4 Q) U* r+ W% H- d' i* F8 m; G8 G( v/ A& T( O3 ^4 y
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- z" ^% c/ C8 E0 a' a: w1 s( |4 g(API Get entry point)- a8 a4 {2 m9 P# N7 `
8 q* I! d3 }) E) g) r ]0 f$ l( f% @/ a B1 R# Z
xor di,di
$ W( g. ~$ ]3 n7 W3 L B mov es,di+ A* u+ I: v1 o7 T) l4 p4 q
mov ax, 1684h * o3 h! f! m0 f u; B1 o
mov bx, 0202h ; VxD ID of winice
1 s# o3 O7 g( s$ d& e& ^5 w int 2Fh
! o. X2 ?6 D. f$ c mov ax, es ; ES:DI -> VxD API entry point2 b; U: e7 s. U
add ax, di
; w6 @/ Y* l9 o1 x, c6 [7 g test ax,ax
3 \/ n8 ]- A$ v0 x4 b1 F. {7 _ O jnz SoftICE_Detected! J6 Q$ U6 j/ m7 o! r
6 c a0 y6 a8 f/ m. \$ h
___________________________________________________________________________* j( q; |6 X3 d: Q( j; C
, y6 c6 V0 F1 l5 n, U) X. O$ e
Method 04
# P9 I! P9 c3 |! Z1 \=========
2 ~3 l9 ?# @+ T3 b+ S) v& Z: N/ _& }! v1 d" X0 \8 ^% y9 [
Method identical to the preceding one except that it seeks the ID of SoftICE
* i, r! w+ H. M& vGFX VxD.7 g- h' t( j9 }
5 \8 O/ `2 L, h. x! L% b$ Z! F
xor di,di
5 o) q4 B8 u# A9 c" D) y+ R mov es,di
. a: d7 v) L3 Q8 }7 B0 e mov ax, 1684h
- q2 K) d. w, n5 E mov bx, 7a5Fh ; VxD ID of SIWVID
# z; d3 C0 }; A" A5 M6 i. J+ I1 ~ int 2fh
. _( s1 I+ ~ t% ` mov ax, es ; ES:DI -> VxD API entry point
, }% o: n5 H' C% N add ax, di
1 ^+ C1 k3 N2 S1 \# V# s9 S8 d test ax,ax
6 f" g7 r1 G# m2 p% J0 E jnz SoftICE_Detected4 T3 X2 w+ |/ T/ S- a
5 h) F) s @9 Y0 R. q2 l3 e: Q__________________________________________________________________________
: p" j) p" U* K
. l$ O5 {9 J N' i$ u6 W0 r: }/ ~9 e( E @9 y1 U% I: j4 X
Method 051 w0 L* h6 u5 C) C7 n* \
=========# y4 J* k) k$ c3 c
0 Y) l& w# }/ O
Method seeking the 'magic number' 0F386h returned (in ax) by all system
3 R$ [8 W" ]- I& f# R8 t3 @/ Mdebugger. It calls the int 41h, function 4Fh.: Y; P, ?$ l5 b u9 h$ c
There are several alternatives. $ z K9 c4 k( Q2 j
1 q0 F6 u ]% R% O5 [0 @( x5 w' H" J
The following one is the simplest:6 t; J9 h3 q) k* B0 b% g* S% w
8 B; A! i$ o. i4 m8 j- c, v. e7 | mov ax,4fh! {: V) G: Q7 _
int 41h4 e8 P) M; \' q2 N0 ?
cmp ax, 0F386
. h: n& K- l* c jz SoftICE_detected9 P: k1 B9 m7 ^# l% Z" k# D* N l. _
* C3 v$ T$ b9 p. [ Y/ r
( {7 m) v$ S- W0 F5 F& s3 X
Next method as well as the following one are 2 examples from Stone's 5 x2 l3 M9 B' x$ ?3 N1 g
"stn-wid.zip" (www.cracking.net):
+ u& h: g! N$ g+ X \4 C. E6 H9 W8 p+ [ p) j+ T2 ^: q
mov bx, cs$ z9 q, n6 @, I
lea dx, int41handler2$ B* \. X+ A' Q) {5 k3 s
xchg dx, es:[41h*4]
6 P8 Q+ j9 I7 R9 p xchg bx, es:[41h*4+2]
% v) |) i3 K1 b4 r7 L5 c1 D8 x2 |6 x mov ax,4fh
/ K% p: m, d/ Y int 41h$ l k- ]/ T( U; I
xchg dx, es:[41h*4]* A/ M' _) _: s) i: w: e
xchg bx, es:[41h*4+2]
1 k0 b2 u8 L9 A. s4 w1 h cmp ax, 0f386h
, @$ R1 c1 b8 i/ _" r jz SoftICE_detected: T, ^$ A. {$ j4 ]$ O6 t8 `
" b$ L& V. }0 z4 c) q
int41handler2 PROC( y+ J0 r$ |( Z3 [
iret
( p) _5 G' g7 Q: D- L4 Z E* ~int41handler2 ENDP
4 c+ H1 t* A2 J1 X1 b( q' ^- s# j9 k% I* p- l, L4 @& K
5 n+ l; `) m+ ~' L$ d_________________________________________________________________________
* D. q+ H, @3 H' u1 B6 Y( O: ^# s
- c5 P/ ?1 `0 W/ U
Method 06
% H; F6 ?& R4 ]6 i( e6 k& G0 g2 ~=========
9 \& ]/ b* A2 o
+ A/ e3 q9 x+ ` F2 `3 ^2 \0 f# d8 t& d
2nd method similar to the preceding one but more difficult to detect:" v8 z8 g# F! l" G; Q4 K0 A+ p+ J
/ v/ t9 S! V8 A: |* |4 G5 {
' _' c# O$ g' o
int41handler PROC/ H7 P' F4 f N/ Z8 c
mov cl,al0 Y1 _- J3 I1 F# U, ^ Z
iret
% N: X: y ]& Q0 r3 tint41handler ENDP5 c3 W7 C; Z& r0 V7 r# _
4 }3 I6 g0 V0 K( |, C1 B
2 z2 b5 B8 A+ I/ ]1 P xor ax,ax9 @- I, ]$ U( m' N6 B3 U/ p
mov es,ax3 f% N. N4 y' |8 A3 d5 j2 G
mov bx, cs
. L( b) H( _5 i3 d: g lea dx, int41handler
& ]: {7 F: \* ?$ } xchg dx, es:[41h*4]8 n- E$ i. l% i0 _% C
xchg bx, es:[41h*4+2]( w& z) X6 F' G) x( e0 W
in al, 40h
; c5 s4 Q+ f9 G; H; f xor cx,cx* k, a+ i7 G" t& m" |( G- d' t- Q* N
int 41h5 w3 `' p9 m$ N9 b- U$ r% L
xchg dx, es:[41h*4]7 {; r# ^9 U n
xchg bx, es:[41h*4+2]
9 a# c/ S4 F2 R8 d cmp cl,al
9 ~3 |# O# Z- w9 \. n jnz SoftICE_detected
% ^/ A" A- P0 V, s
4 }4 k9 N2 u5 D. J* r- A_________________________________________________________________________9 |2 O2 T! {) i2 f9 e( L
" Y. u2 G! U" z$ E6 ]
Method 07 y2 m T4 B% L5 g+ w7 I
========= v4 R3 ]) ?+ h' t3 I# S' r# O& R
- ^! }3 F" X# |% G- `
Method of detection of the WinICE handler in the int68h (V86)
* N* E2 z# W# j( _& f& D& D& V* d$ F3 Z) z. m8 k
mov ah,43h+ n/ f3 r0 w- C2 }
int 68h* e ^* w2 z; J7 d
cmp ax,0F386h) _5 c* d' C4 ~, A0 F0 n
jz SoftICE_Detected
3 f, k" K& e/ v3 S7 e( `; v: l- {) e) C0 o7 a! U% s! N
& z: {% A' R8 @8 _2 _
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
3 A2 ^7 r1 s+ l5 L, Y app like this:
1 S1 x2 p( Q9 {* K
* ?8 n5 ]* R" \3 A7 t BPX exec_int if ax==68. x; U0 q, g: a" w. r* k
(function called is located at byte ptr [ebp+1Dh] and client eip is! A; T( x3 S9 B/ |: l( e: f
located at [ebp+48h] for 32Bit apps)
- [* M X4 L1 M# B__________________________________________________________________________4 G, m, }1 ~* s3 D0 {
/ ^0 @5 F3 l6 }: K3 p% ]9 Z# O- V- ~1 _ m$ R$ ~, d# b
Method 08
# ?. [/ V* d _! a) o=========
1 A3 C( q, d8 G. b" A' U' {) p; C0 x6 p+ @" ?2 o ^
It is not a method of detection of SoftICE but a possibility to crash the; { A! J0 D$ }/ y% g" M' D6 X
system by intercepting int 01h and int 03h and redirecting them to another* s5 [% _- k9 j1 w, N" K: x
routine.& Q# B* a* ^% a: X
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 u x+ s3 C3 ?: T1 I: r* m6 Y
to the new routine to execute (hangs computer...)% P% ^- v7 O. a6 k, R: K
H7 X) o4 ]+ r0 p
mov ah, 25h
/ T. y, x3 \3 W' i. Y" G5 A1 d mov al, Int_Number (01h or 03h)
9 |: a$ x2 {& C$ e mov dx, offset New_Int_Routine
2 i/ F! W4 b% Q/ X* C" z int 21h
9 p9 z% j6 {- ]6 x
" n4 C- W# Z# j$ r7 l8 ?: r__________________________________________________________________________
( O& `3 K1 Z& X* z2 E; z. E1 c
" ~8 i+ f$ S E; K2 F0 {Method 092 s* e% c/ f, h) t+ H V
=========
; s( Z2 B& p" M: `
9 v) f r& X: q; hThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 p5 d4 _ K- o* }
performed in ring0 (VxD or a ring3 app using the VxdCall).- F1 f5 v7 O5 o& m$ o% ~# w2 K' h$ R
The Get_DDB service is used to determine whether or not a VxD is installed
^0 x/ B o1 ]$ p& g9 E+ Cfor the specified device and returns a Device Description Block (in ecx) for. |" D* N" v! \
that device if it is installed.0 e/ m u* D& ?+ K, c' y5 K/ E! C
7 |# A" s# E3 r0 t! U mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
5 j6 p% a+ d( J; c9 B) a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 K/ y _' z' Y1 ]; L! K VMMCall Get_DDB
" |3 c. ~& P, S) C) N# J% t1 L mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; c2 L$ @' V5 z4 }8 |
; s* y7 @# f }- bNote as well that you can easily detect this method with SoftICE:
9 Z3 f$ i5 M1 y, k1 ^$ p: E bpx Get_DDB if ax==0202 || ax==7a5fh
3 n1 z$ U9 b$ Z2 l& p. r! ^0 e$ m8 z* n3 _( I. |8 R9 e
__________________________________________________________________________+ \9 s) ?' J) `* o$ }
8 T: t! | ]5 p Z6 l
Method 10
9 l1 s0 l3 _; v8 n9 v2 ?. g* n=========5 S, ?. k* J2 R8 m2 u* h- h) \
) g- m* ]# i1 z, N
=>Disable or clear breakpoints before using this feature. DO NOT trace with$ o2 W) @ _% F$ C: q
SoftICE while the option is enable!!
% }, A# [8 W) L9 j
* E N: J- k$ ^This trick is very efficient:
3 g1 k7 l% t7 e& _6 I. Dby checking the Debug Registers, you can detect if SoftICE is loaded! h) K# k; F# h' K: H
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 ?! `# `; n; A- \7 N# Xthere are some memory breakpoints set (dr0 to dr3) simply by reading their/ v8 z) \6 [5 N" T, j- k& _
value (in ring0 only). Values can be manipulated and or changed as well
: U6 }! l4 v' |! q(clearing BPMs for instance)3 z0 ^* R0 m. \1 F5 l$ e( r4 T
; _4 C* [& x6 k8 b2 n# F__________________________________________________________________________
4 N0 z! D5 ~/ n# s8 W1 n% c
& L' H+ ^% Z" a$ r$ zMethod 11( ~* l6 _) P! D& Q' K g, f3 C) Q9 {$ k
=========
+ o! r4 d# W \5 {8 C
9 z7 G" a) d6 M. J+ i+ M4 v, s* b& OThis method is most known as 'MeltICE' because it has been freely distributed% \: N0 w. L* B8 }# B) j& B: y. Y2 m
via www.winfiles.com. However it was first used by NuMega people to allow
\" j3 O G, m8 iSymbol Loader to check if SoftICE was active or not (the code is located
2 B# m4 X5 q2 F- r1 }3 Vinside nmtrans.dll).
# P1 g* z, ^2 N; Z9 B- T9 v" |+ `. f. p$ _$ B
The way it works is very simple:' ]8 ~* H/ @; C3 J/ ]% w
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" v( d! Z! p L# L5 D. S) AWinNT) with the CreateFileA API.
! ~. ]# f9 L- `+ Q. u6 a7 T5 P, H$ X- Z4 I( r. f
Here is a sample (checking for 'SICE'):
/ K1 k4 ]+ c) c8 n" g
+ d7 s7 y+ B7 r' { p- y8 oBOOL IsSoftIce95Loaded()
; Y( a* M# I+ `: Y5 g{* e8 f! s) {4 G2 R N
HANDLE hFile; % u( |' p4 g) c* n) Z
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE," r; T! G0 D" [
FILE_SHARE_READ | FILE_SHARE_WRITE,
5 B6 j1 m, B0 |) |* V4 n NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 F$ U0 x* P6 o! @! C- A6 V if( hFile != INVALID_HANDLE_VALUE )
4 e* q' T3 a6 X+ X) {) ~, I5 j {: v4 u# s) d8 D- Z
CloseHandle(hFile);1 s. Q! q9 T4 u1 a& g$ H
return TRUE;& e0 P3 n: e [) D/ q& ?
}
& ?/ ?( y5 w( \. i5 h return FALSE;3 a4 p, ~1 N4 @" ]" {
}
: t0 {8 x; j, a6 a4 y; g9 E3 ?/ i4 Y0 [' j; E
Although this trick calls the CreateFileA function, don't even expect to be3 d- v& L' z$ H, F; v5 N+ a
able to intercept it by installing a IFS hook: it will not work, no way!
( X% L/ Q; a( p% ]' ?# UIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 d( ~9 |- p( ~% d( i( R y6 A' Cservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( h$ t' p1 _1 t: o1 } s) Xand then browse the DDB list until it find the VxD and its DDB_Control_Proc
$ o, Z6 `* U- b `field.
8 ]! y: s' B0 x4 C1 V7 P8 rIn fact, its purpose is not to load/unload VxDs but only to send a 0 p. ?; m& y# n3 [- P3 L( r
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) {8 q/ ~, a3 t7 z- _; F
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; N: p# ` X' L; f% c( l' R. O( z1 lto load/unload a non-dynamically loadable driver such as SoftICE ;-).
' K6 D8 D2 y4 ~* l+ uIf the VxD is loaded, it will always clear eax and the Carry flag to allow
4 I$ ?( ]* w$ S; }3 L# D( uits handle to be opened and then, will be detected.; L* a" q, B6 L5 V' T/ i
You can check that simply by hooking Winice.exe control proc entry point
) \) V5 |& }& s6 L' Bwhile running MeltICE.& G/ ]' g: F( e3 R6 Q- Q5 ~0 }( i
^ T! c- E$ y' Q
9 T: T8 x5 U9 }4 v9 w0 U6 V 00401067: push 00402025 ; \\.\SICE9 H2 ^2 i) S6 c5 @. g; X5 E" [9 l) p
0040106C: call CreateFileA
* S0 [* l0 A$ G& i8 ]; W j7 R 00401071: cmp eax,-001
4 o: F3 B2 Y4 U/ ^5 D% t4 A 00401074: je 00401091" q2 s! P# u2 n) p
; D. D) \. Y1 O; Y! w i9 a: t5 n5 _; R
There could be hundreds of BPX you could use to detect this trick.2 y1 Z4 Q/ T" G" a3 u% ]
-The most classical one is:
/ S, ?9 C+ y3 k8 K0 _/ \8 o# a BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" v( Y- l1 q: J1 d
*(esp->4+4)=='NTIC'
k8 N6 x( U1 ?% D! m0 ?- J7 X6 R5 s2 r
8 U$ K0 C6 S9 { z2 \3 x, _0 E, Z1 ]-The most exotic ones (could be very slooooow :-(4 d( ]# O) E4 e6 k, E1 h
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') # s; Z! y K9 l7 ]7 T& T
;will break 3 times :-(8 J' k6 | Z7 Y1 w5 r( m' [& K0 C
5 m$ a8 d3 Y' P6 ^ G3 R
-or (a bit) faster:
) Z9 _! K; O- C4 X" s BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 G j% Y w2 e: l
2 R2 }- v8 r' c0 Y* `% f) ?
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 3 T# ?) t1 `$ b( T% b/ r
;will break 3 times :-(% m) A9 K- f9 w. t9 K( m
* J0 _$ {1 @% b% A& i, U1 D7 T/ H0 u-Much faster:: R$ [7 v8 h4 O+ I! H1 y& Z: K6 B9 |
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
4 [. g0 L! I3 j9 R0 R: s
4 O, Y- M, z; Q. GNote also that some programs (like AZPR3.00) use de old 16-bit _lopen) R' o. N# i ?8 ~6 k/ X
function to do the same job:
$ D& r; H% j# U: k4 b5 I6 E4 ^
3 [& o( F9 `- b0 s5 B3 Z push 00 ; OF_READ5 _9 Y) y% t6 [, p5 v2 `9 Z
mov eax,[00656634] ; '\\.\SICE',0
/ Z. h( o8 }, O! b: _$ ]/ }/ U push eax
! A+ B9 b* L' q7 w3 E* ] call KERNEL32!_lopen
3 D% o: J5 ?/ m) m$ f S! M5 {0 g inc eax
/ J4 w I# l' ` jnz 00650589 ; detected
/ B4 N* E0 ^. O; ]" b B3 B, O push 00 ; OF_READ
g6 ~+ I" Q: N6 \' V5 v mov eax,[00656638] ; '\\.\SICE'
i# G9 @0 J( t; X2 E: E push eax0 O3 Y* C( |0 n- Z3 Q) u5 g
call KERNEL32!_lopen/ k" W# j: A& }
inc eax
+ y9 t" G1 g" H jz 006505ae ; not detected
: L4 z! j9 Z9 f) N d$ c) V9 ]# }! z+ h! S6 w
& R" w7 x; M1 Q Q: N' j__________________________________________________________________________7 L! X9 M0 W) a' R
, O8 ^4 K7 O/ H1 }
Method 12
, N$ t8 l- r0 L5 `3 Z6 Q# H) {=========
$ e% Z R* \8 a( Z- `
2 d+ P2 |4 ] e- l+ c/ q cThis trick is similar to int41h/4fh Debugger installation check (code 05
" W; Y1 I( v- ?2 L8 k& 06) but very limited because it's only available for Win95/98 (not NT)2 P: g" U6 _! n
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.; k% {; m! ~6 D9 D! b4 Y
5 a# K9 ~" o* `! r3 u push 0000004fh ; function 4fh" A% M, H# g( k7 ?1 g& D+ C! F
push 002a002ah ; high word specifies which VxD (VWIN32)6 L2 B$ R2 V0 S" C5 N) T
; low word specifies which service7 Z, Q2 O! Y" M3 D/ K
(VWIN32_Int41Dispatch)
0 O2 N0 U- c$ g) ? call Kernel32!ORD_001 ; VxdCall
7 Z, W2 G: q# w5 E* W; _ cmp ax, 0f386h ; magic number returned by system debuggers
% d! ~3 c7 V) l5 N; x5 r jz SoftICE_detected, Y3 H$ f4 a9 @5 d% o, [( l' B7 G
: N% W: \+ \% f# v+ b7 iHere again, several ways to detect it:
% w4 Z- W# b2 [6 R) H- I
" _( C+ W: A7 P$ V% _ BPINT 41 if ax==4f) E! h3 A1 b) W, E% r
2 ?' V( V& X( H, Q* @/ V7 l BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one' i; K" C: Z/ R+ r; ^
! o7 r& }$ a$ T/ ~( Y7 b$ o BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
% Z# ^- K- `, q# A, U. E, r4 i' w9 x% e: F
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 ?+ W @/ h! I# F' x0 i. Q/ r0 Z
6 p* E: D. h5 R% ?0 s
__________________________________________________________________________2 y( H6 {, G2 c/ A/ U; ?- _
8 x h2 _0 Z* x- o
Method 13
+ G! U3 o+ u$ x" f j=========
+ E; x6 [2 T5 z K$ [# p. |+ U
$ s5 N/ |7 e" I+ P( ?Not a real method of detection, but a good way to know if SoftICE is. \ _" C9 l5 @6 u' A
installed on a computer and to locate its installation directory.& V& K, h3 A, M: Q" w7 K7 C. z
It is used by few softs which access the following registry keys (usually #2) :
+ r& u f. l( J1 B* p0 A( V0 G
+ c* X6 Z: f u% R4 N) t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( A7 X' j7 {, b
\Uninstall\SoftICE
( C3 {2 k1 x1 p! N* S-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 H3 C* a; c) r, @/ ~! a; v-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
C Z3 k U" ~& A\App Paths\Loader32.Exe% R" m2 T; f l9 N: L; N1 q$ \
7 v8 r+ u$ u" V5 i* ?- E; @1 W: n
8 W: E/ r6 k w d, n* b, ?8 h
Note that some nasty apps could then erase all files from SoftICE directory
0 o$ q- W' z4 R(I faced that once :-(1 }/ v b' n' R" q T M
& v1 A, b; n3 o+ X% }" N! h: x
Useful breakpoint to detect it:
" f, G. C& V6 A& h( q9 u+ w/ u# V4 e" g+ o8 @; n
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
- z Y3 Y8 I3 |; }" p/ o" J2 Y* ?1 F/ ^! y& z) a9 J
__________________________________________________________________________
( b+ F0 d* v; O0 d5 R3 O" Q$ k! R* c$ F# I
2 J. P) c0 D) g# R; i
Method 14 1 D% K% T, E: `4 s3 H4 Z
=========! I p2 V) g9 @
7 o* o4 G& D% | h! i' z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: o6 a0 y& H# B! X/ A3 zis to determines whether a debugger is running on your system (ring0 only).$ y8 |" n* m- a" a, p: r
1 c( n' E# l- P VMMCall Test_Debug_Installed
! l; k# P' P( O# Z5 I7 C je not_installed7 ~3 Q9 h. c; J* X8 ]
* x$ f* o, S& i/ l( {! ^This service just checks a flag./ b1 d$ V/ R' l9 w( I6 p9 o1 J
</PRE></TD></TR></TBODY></TABLE> |