<TABLE width=500>) @7 q" |' K7 P% E9 j: T. p
<TBODY>' b5 W, |; N$ h% i
<TR>
! z# Q% D; J) ?; H<TD><PRE>Method 01 / l3 w. d7 s0 y# q9 f) T* s- s
=========
8 w2 z1 J( |9 o$ U: [
+ e# }+ \' v3 ?This method of detection of SoftICE (as well as the following one) is" t& J% a9 P4 O4 _( q o9 b! e
used by the majority of packers/encryptors found on Internet.
5 S' O' A# t% A" B8 E# @. X+ DIt seeks the signature of BoundsChecker in SoftICE
" I0 G' X" ^' @) l- B3 z
2 C9 f: \" L5 O6 |* e mov ebp, 04243484Bh ; 'BCHK'% W; c6 _& t; R# ] C# x
mov ax, 04h
$ W+ d: [; d% b9 c/ y int 3 # m; N) P7 X: H: U) V# x, h& W
cmp al,48 }& q M$ m: g& y: f/ Y
jnz SoftICE_Detected
8 s3 N3 q9 s0 H9 u z, u8 g5 c i1 @7 V3 H2 E
___________________________________________________________________________
" J; {, g/ ]- G+ P$ u: N6 i! W; F" ] Q4 y2 {1 y" j
Method 02. D" [8 X% D- ]; S! B7 S! p
=========; `* D V3 ?( |8 e
& t! R0 S3 C0 u0 \) [( l, D
Still a method very much used (perhaps the most frequent one). It is used' t1 Q E9 p* u9 q/ l
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
- S8 |& Q9 H2 q& jor execute SoftICE commands...
$ L+ m3 }: s3 A E, I; u5 Z* NIt is also used to crash SoftICE and to force it to execute any commands! W$ w$ T' i M3 g5 h
(HBOOT...) :-(( ' n8 u5 o; B! D/ E1 O1 m
- v+ m: |1 o; l ?/ q9 s
Here is a quick description:
2 m0 M1 j. J) P6 Q4 b1 \) `/ k-AX = 0910h (Display string in SIce windows)* g/ Y- H1 y6 w- T
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 a& m2 {0 w5 e- w# b' t) f9 _/ Y-AX = 0912h (Get breakpoint infos)
; C; |' C4 [) U* }1 t-AX = 0913h (Set Sice breakpoints)
8 d9 F* O% s* t: R5 J, d$ Z! p-AX = 0914h (Remove SIce breakoints)
' g8 b4 H y% }5 T8 {' M8 F( M. X! s6 w; v: `6 f( P9 N; x
Each time you'll meet this trick, you'll see:, z. V4 O" h/ I1 H, I
-SI = 4647h
0 Q1 g+ f% I1 b3 Y6 {-DI = 4A4Dh
, I% T/ ?: i5 R$ J" _Which are the 'magic values' used by SoftIce.2 b0 f n; A0 R5 f* i
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 E$ N" p% r7 ^! D8 C7 g2 H% V
' r; [+ _. r4 Y. P, @! ^
Here is one example from the file "Haspinst.exe" which is the dongle HASP8 I' q% \" S/ r- c; I
Envelope utility use to protect DOS applications:. S2 ?7 n9 d* L$ Z' H$ p
5 `7 J5 b' l0 F" G2 Y! R) u2 Z
" c4 t- o' I8 I) Q- [4C19:0095 MOV AX,0911 ; execute command.
* @. {; e8 M3 F1 y$ E* {" F9 f4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% N. D6 D" f& ?) I
4C19:009A MOV SI,4647 ; 1st magic value.
' x( e" n4 ^4 ~4C19:009D MOV DI,4A4D ; 2nd magic value.
1 I$ J# }) G8 m4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*). P4 p, \$ M& y4 ^( J7 I
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 X. {) c/ _& Z& x8 f2 t2 Z4C19:00A4 INC CX
X1 V9 G: S# \; M9 {4 V3 F3 U+ E) _/ F4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. ]) E% l; l7 @# ~0 s& k
4C19:00A8 JB 0095 ; 6 different commands.7 i: c% Z8 D) G' p: Z" h2 |
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: i Z4 _9 \& v4C19:00AD MOV BX,SP ; Good_Guy go ahead :)1 e2 \! w D5 a* u) Z
" P% B( [8 {/ V8 Q/ T6 DThe program will execute 6 different SIce commands located at ds:dx, which: C4 i! K# E% o5 B0 R' X/ U8 j
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" I9 e+ ^7 h# U; n6 z
3 S2 s( c1 x! z0 i+ ~. s* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% J1 e& ?2 O) A; m___________________________________________________________________________
; b, V) n; o9 e6 ?8 K* m
, N! ~3 j, v1 g3 Z4 t5 U" M5 A; r
Method 03
% f4 t) m0 _: h+ @* p1 E R" {=========; U3 _7 a* R, ^: ~
9 |% A1 z( _* k. g4 B
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 m, i9 V% B( |6 g( j Z& X
(API Get entry point)
6 `% x r* Y4 `4 N+ _9 \ 9 j O- L* ?1 h( d
6 y0 x: r5 W3 o% d* S xor di,di
1 R) I; h# L% R, ~7 w+ N, X mov es,di8 e+ w+ B3 R) o4 V8 E/ |7 m
mov ax, 1684h 4 V2 Z) P6 n# j/ Z5 c
mov bx, 0202h ; VxD ID of winice3 `( z: L" d3 F. |2 y+ d
int 2Fh0 s8 j$ Y& q( D. z) V: f
mov ax, es ; ES:DI -> VxD API entry point
" W! h! U; @+ V# [0 n" F0 \( L add ax, di$ U# F& P( w. [7 d
test ax,ax
) W/ _# C; Z! J6 {& `; [4 l* _ jnz SoftICE_Detected
! ?9 @2 H) _) x$ u' o: }) H* N% s2 d% n2 B6 [# c% G$ }' {+ n( S
___________________________________________________________________________$ h+ q# l2 n* \) _3 o& E
: x; G! Y2 V& W" L& k
Method 041 q+ m1 l* y! C1 N, Y( q- J9 Q
=========
1 _ N; }/ S/ x! p- n9 e
% i6 D5 J2 m, KMethod identical to the preceding one except that it seeks the ID of SoftICE
2 ? E9 I5 S7 c, |8 Q" ^GFX VxD.
9 n$ ^8 ~# \# @. F, n6 \" k
# b9 U) ` N! [' u xor di,di/ M. R# A! G7 J( ~
mov es,di. q) }9 c. s; B* d0 Q( w' T4 I
mov ax, 1684h & W, i5 G+ A+ b
mov bx, 7a5Fh ; VxD ID of SIWVID
4 |6 W3 l) b; |3 C, O7 x( @& Z9 { int 2fh
% ]0 J+ [+ k5 ~ mov ax, es ; ES:DI -> VxD API entry point2 {0 s" d2 U( n& P
add ax, di
" N- s8 R* P( }1 g0 ^ T& p test ax,ax
8 z$ l( _% B8 H+ W jnz SoftICE_Detected
& K, J. ^% t) L/ t" c1 y
: l% ]' z# o7 k8 p) M8 U7 h__________________________________________________________________________
: o" U- _- `* H
0 b$ U$ o6 B: X/ T* }* T. n4 H. Q% X$ h i7 q2 |( @- C( H9 N1 k$ A" A
Method 05% v- l" y. b5 `- W5 K
=========
- G; v9 c) e1 `: T7 q
3 `& c# X( ]2 C6 m: x0 NMethod seeking the 'magic number' 0F386h returned (in ax) by all system9 ~1 Y6 [7 \6 p: f! N
debugger. It calls the int 41h, function 4Fh.9 e; G/ s7 x+ A: Q+ `
There are several alternatives.
6 r( |& u% M5 z( y" Z! p* w$ S/ ?% `* s+ F. t) L) q
The following one is the simplest:: p% n& r6 ^" I9 L9 u7 c
/ C6 l c: ^5 A- T mov ax,4fh/ X6 V3 J) Q2 l% [2 K
int 41h( W6 @1 K4 R( ~7 v7 U4 L" ~, T
cmp ax, 0F3869 A9 F. \$ ?5 _# I3 G
jz SoftICE_detected) G, z' f% Q4 P
- x# q4 u9 @2 H* u3 h4 x l+ @: a3 p* S d4 P
Next method as well as the following one are 2 examples from Stone's % s; |$ i: f* A' F8 E/ E3 Y3 m
"stn-wid.zip" (www.cracking.net):
7 P- l& R `4 B6 L
c$ u7 s: {) }2 Q F mov bx, cs
6 z# g9 z; a( h |! P lea dx, int41handler2
/ |. Z! m3 T S5 D) P) V; F. ~ xchg dx, es:[41h*4]
/ A- q5 i9 b& b* a* t' `1 k. G& o xchg bx, es:[41h*4+2]7 l6 e3 d1 U B& D) L/ _# j* L4 S
mov ax,4fh+ L6 u- u% s8 k
int 41h
: x' T' T7 t, f, l xchg dx, es:[41h*4]
$ r& l$ G. y. Z0 s: G) C xchg bx, es:[41h*4+2]+ e& U3 v% R6 D2 w+ O
cmp ax, 0f386h! v, x. F$ }! B; h6 A5 x
jz SoftICE_detected
- d) P8 q2 l# k, h5 K5 n$ `. Y0 i4 Q4 r* W
3 Y9 P. D) o8 ?6 ]1 {int41handler2 PROC
2 B8 O% @% }8 O! ~# i2 N. ?- m" W iret
4 b3 w- J" N! u$ {int41handler2 ENDP
5 K4 v1 E# e1 K4 `: v% e. A
* W/ H, |3 v# f
" }+ }6 w' A' H% o" I$ _. s_________________________________________________________________________2 V- W0 w# \/ ]% A6 |% {( `
" p4 P% t9 [( k
; ], a. t0 `4 a8 q5 b3 UMethod 06
- C$ L% P7 E4 n5 T% p! |' B5 o {=========* p1 Q! Q1 Z' e6 @
4 m+ q/ s3 P: m3 G) _
7 |* b* B' z- \! Q& @2nd method similar to the preceding one but more difficult to detect:4 y- t i% h$ ?) s
9 o. \' a8 C3 O% e) m
# ]4 w) L; e5 lint41handler PROC1 `7 ]: @, ^" ~/ d
mov cl,al
; H. D, X4 e9 o D; a iret
1 H e- X% g7 L0 ?; Tint41handler ENDP
; s5 a1 C% g; s: G$ L( P0 [
; b; F- y) m9 P+ a3 L& y$ T* u
! O: U; ]" v p: N) ?; L' y( R1 ^ xor ax,ax
5 T3 C* B9 F8 \$ J, x4 o mov es,ax
4 O1 N h+ ^2 s. y( o; j# E: \9 o mov bx, cs
$ i1 Q; g9 f2 s5 T lea dx, int41handler
" R. y9 t3 n+ V& ? xchg dx, es:[41h*4]/ n; X/ B% d8 |2 m+ Z5 Q6 ?3 q, o; A
xchg bx, es:[41h*4+2]
1 W8 A7 N. P- }5 s in al, 40h
t0 v9 r5 k- Z/ k& U xor cx,cx1 E o2 l5 _* Z
int 41h8 [4 \3 a- {1 X% h T2 i) @
xchg dx, es:[41h*4]6 a" U2 x* W" ?! k% v
xchg bx, es:[41h*4+2]
( k% n" ~" L! k5 Z3 J' e$ A$ Z3 Z cmp cl,al
! m, R T' f, n$ F. ^/ _; n jnz SoftICE_detected [/ v' [: \* T9 f& A l* M6 i
! G! ^. g; D: ?% k_________________________________________________________________________, _9 Q+ t' S4 {1 o
7 G! T2 I+ _* J% _4 g* qMethod 07
3 o7 B2 {/ ?+ g& f) Q=========
$ T$ } T) ^$ e0 b) u# T: b
1 O7 g) N, z* {& T% k, MMethod of detection of the WinICE handler in the int68h (V86)% x( S+ k1 q$ {. q9 V
" s' _5 I' C/ v" R& r mov ah,43h
& V& e( w4 i& H& U- h" o1 q int 68h! L9 }* _8 f# p4 ^/ H
cmp ax,0F386h5 Z }( N1 S0 P+ {
jz SoftICE_Detected
+ W" w* _9 a; U6 i
. d4 o7 [. u4 M a( m, Y/ E, R% B% i( x9 `* E: C9 T `
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- |0 z* u: X4 G9 T& r app like this:
# c: i; W1 N: n' ~
) |7 m- K. R* T, m! G- Z* ]+ O9 g# t BPX exec_int if ax==68
, Z U, v8 q; | {/ z$ ? (function called is located at byte ptr [ebp+1Dh] and client eip is
) L7 O0 i0 i/ n9 n5 ^* G located at [ebp+48h] for 32Bit apps)0 K9 \% |0 N+ w" B1 }$ Q! s
__________________________________________________________________________% S# x1 w& f3 X+ o
$ L5 }! z: A: ^- E' f
8 M/ O* [+ R9 W6 u' |7 c# @
Method 08
* W0 ^7 H; ^2 S: ^=========
! K& p# U" h, Z9 t- U1 q
8 u; A1 s: L. Y( A- zIt is not a method of detection of SoftICE but a possibility to crash the& k: e: V; R' @9 H
system by intercepting int 01h and int 03h and redirecting them to another# U" j2 T2 \0 n8 T6 u4 S( U% D! _
routine.5 N2 Q/ G. h7 e' c, u! [
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: H' S' A2 e5 @4 O. D7 pto the new routine to execute (hangs computer...)
9 m. m" d* k3 h+ W' `- e7 m" P) i$ g% _
mov ah, 25h1 U" e. E2 ~; o" X* r& m2 a, C0 T/ s
mov al, Int_Number (01h or 03h)6 r7 W, o( f* P- o$ }
mov dx, offset New_Int_Routine
9 p) C& F+ k) d) _8 m int 21h
# H4 `) {$ h/ a( w- r
9 X/ x! p" p) S__________________________________________________________________________
6 l0 ?4 d( Z5 D* C* C9 l$ X" D( |7 [+ |; C# c2 ~- ]
Method 090 N( m) Z, `+ [
=========
0 f! B. g+ i% f) G
% [- o1 W: _* W5 z, ]* nThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
1 M* U$ B) w" @1 Tperformed in ring0 (VxD or a ring3 app using the VxdCall).) Z+ |( j- X( X: C
The Get_DDB service is used to determine whether or not a VxD is installed
1 n8 d* ?. l) J: X: I4 Pfor the specified device and returns a Device Description Block (in ecx) for3 @ ^! E( @4 }$ t
that device if it is installed.
1 a8 t) B5 q& B- ^& z+ M) Y! I9 j8 u/ L8 n0 S! }9 }, x
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
|; E3 y( e8 S: f mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: A. ?' [; t% a/ @ VMMCall Get_DDB4 T4 h/ K( s c
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
. X" R& @2 L* w" z& Q: R: e2 C4 p3 s: D2 ~' c2 `
Note as well that you can easily detect this method with SoftICE:
/ k, o p0 H; h1 X* k bpx Get_DDB if ax==0202 || ax==7a5fh
% z" {: x8 ]0 ]. t; [: N' _8 t
( Q4 T: Q5 V1 L% b: G__________________________________________________________________________
3 H) l8 ` F0 ]) X9 ]4 X/ N0 L
6 |8 ]# U* s( y8 o0 cMethod 10
' t6 v2 _/ D$ h2 ~=========
3 Y4 U) f+ b) R7 e6 k8 p7 J8 ]5 M3 k! Y3 ^3 R, A/ J$ U8 S1 B) g
=>Disable or clear breakpoints before using this feature. DO NOT trace with- |7 a! T$ q% N& i; i
SoftICE while the option is enable!!
1 o$ Q' q! o6 j( y
) D/ e# d* v& [& d2 G/ L" aThis trick is very efficient:$ z9 h) i5 c j1 d# O0 z
by checking the Debug Registers, you can detect if SoftICE is loaded
$ ^" P" `3 a% @2 j(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. l ^9 }' J7 `: D2 ]; Nthere are some memory breakpoints set (dr0 to dr3) simply by reading their+ O0 N5 N0 w2 }/ Y1 g- p3 W S
value (in ring0 only). Values can be manipulated and or changed as well6 {, d5 w1 X" j% M0 |* ?5 L
(clearing BPMs for instance)+ l5 U* O+ s9 o9 t7 b
9 L2 a- c5 Z, n__________________________________________________________________________* c, z1 k ]# ~& x; M4 w* R4 ]( R
1 e" }4 [5 M; A& @1 L( ~
Method 11 _ j$ }. N, t3 m. O' U
=========
" A- g3 u) `5 D' [% o' o# |. L) D; s1 i
This method is most known as 'MeltICE' because it has been freely distributed# N/ T/ x4 H% s# I* L) _- R3 V9 W
via www.winfiles.com. However it was first used by NuMega people to allow; M" A6 X3 A7 `+ a
Symbol Loader to check if SoftICE was active or not (the code is located
3 N' ]. l! w2 ?6 o& i8 cinside nmtrans.dll).( ~8 [- i! i0 I( _# D, \7 j
8 M$ P+ n7 M7 o7 w, ~The way it works is very simple:4 C6 V2 U. }6 @' ~' ]
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* E; b U+ G4 o6 u7 H" XWinNT) with the CreateFileA API.
) R( `( M: |5 k3 n: a" g
) X9 M4 B* O' j2 J. DHere is a sample (checking for 'SICE'):
; u7 t5 ^9 r5 G' f+ c) v# a, y4 R5 u4 U& O$ F9 Y4 ?
BOOL IsSoftIce95Loaded()
7 j8 \+ G7 c# j# m) d+ T% R r{, |. O9 N4 j8 |2 `
HANDLE hFile;
% I9 L1 i% A" t* m hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ u( @4 ?" w9 }2 N6 w
FILE_SHARE_READ | FILE_SHARE_WRITE,4 y7 g$ j/ M: B
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ j, K1 l8 |' t8 D* t% U) ?( l
if( hFile != INVALID_HANDLE_VALUE )! M! A0 }3 d/ o% A
{
. F8 ^2 h9 N1 m CloseHandle(hFile);% D$ ~& I5 a8 s( h$ r$ R
return TRUE;1 P, V' X7 u" t [, [* v. d
}
! ~3 t. N m+ `# u, t" f return FALSE;5 y1 h& e# K, X1 F% k
}: Y* E: k- [) A- Q ~
8 d/ d' r3 t# x& P. m
Although this trick calls the CreateFileA function, don't even expect to be
( {1 o& S" a& lable to intercept it by installing a IFS hook: it will not work, no way!
8 I& ?, ]) B7 i2 t& ZIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
' i1 u. _, ^3 @service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) `* Y$ s1 D* k; s4 ]! E
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ @& P" o- e3 h' d, s
field.
# j8 T/ w, C1 D+ |8 Z3 iIn fact, its purpose is not to load/unload VxDs but only to send a
1 C/ | A$ V2 c! K: w! hW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' l" B- d0 ^% s# T" ^to the VxD Control_Dispatch proc (how the hell a shareware soft could try- F+ g/ ]1 d- r" q) C
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
: d) d: X* f m. E+ Z& {If the VxD is loaded, it will always clear eax and the Carry flag to allow: ~: s2 x% ^$ A
its handle to be opened and then, will be detected.
4 _8 o3 k! ~) j; l# ^You can check that simply by hooking Winice.exe control proc entry point
6 A2 s: g/ t2 l* T% |while running MeltICE.: y0 M* u1 x4 R9 w5 M' L# X& Z' W; \
0 N7 ~" H# P& f) {8 x v& q X1 q
4 Z) g8 Y+ k J9 x* K! d 00401067: push 00402025 ; \\.\SICE
% l" l' {! T0 C/ {9 `; U, D 0040106C: call CreateFileA- Y4 ]% a; @2 u# j3 W
00401071: cmp eax,-001
4 A3 [* {- q: ]8 w 00401074: je 00401091+ [1 j, [/ t1 V, W6 {+ V9 Q% g
# G: R9 L) p! |3 S
. g0 N. T; d8 ?+ o) r. S1 AThere could be hundreds of BPX you could use to detect this trick.' W6 A v) e# P1 Z+ H, ~
-The most classical one is:9 M, E+ J+ ?4 r- T) {
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
. H T- Z( j3 {! z% ? *(esp->4+4)=='NTIC'" R7 o+ [* ~. w
3 v9 x% g$ E& e' m8 B-The most exotic ones (could be very slooooow :-(
) C8 R) q8 ?7 W& f3 z/ H' {0 R BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 ~( z- o' c* z( t/ R! {
;will break 3 times :-(
x3 k, ?, Q/ }4 T
! o _8 g* M6 B* w1 h4 Y-or (a bit) faster: / F- v3 V, ?# |+ N) w4 l) R
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 V2 z+ m0 X$ M# G; q
/ k1 B W; M! A, _ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 z; A" @8 [ u$ ^ ;will break 3 times :-(
" W( K- \1 b$ P' ~, X
4 o8 ^5 x# ]3 `' V$ |-Much faster:
8 O4 b) K4 q. [ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
$ E9 F$ h k. I' C7 H& `# x) n9 c) ^" [! A R* R8 }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 ?: d. j A: @/ T4 Y6 T2 efunction to do the same job:- ]3 \ E* J9 F% r
3 B/ I. g' G5 ]% n
push 00 ; OF_READ
5 k8 w/ c# B6 {# Z mov eax,[00656634] ; '\\.\SICE',0
# B( J( P0 m& A push eax
$ p0 Q" t7 k" Q* W. I5 | call KERNEL32!_lopen2 ^0 q3 K1 I) P+ N3 ]; C( F
inc eax- o3 e7 t9 A" `- V& }2 F
jnz 00650589 ; detected
7 W! [* o/ U1 v0 s( g5 h push 00 ; OF_READ" p) v( G3 B- b, H
mov eax,[00656638] ; '\\.\SICE'
( t' H7 L5 J: ~/ X$ [% j push eax
4 b6 d2 H7 e. E6 d! Z+ H call KERNEL32!_lopen8 x' n$ k' S4 T) ^
inc eax
8 a) {6 B0 O& s; h! J$ [+ V jz 006505ae ; not detected4 v, l' T m1 Q9 E7 A# `( L
, I: v+ Z$ B, h7 m0 G
; q/ l* m6 _% k3 ]5 `, |
__________________________________________________________________________& }3 u0 \3 g; B/ |% L
( w! G$ J' h9 D! U8 A$ a
Method 12
9 Z+ a: P8 i) e2 ?, |* q=========+ q; X% d; s; H9 Y2 l7 q/ ~0 C2 |
: x& n; M( U* g5 m
This trick is similar to int41h/4fh Debugger installation check (code 05
- b+ L+ M9 g1 E J& 06) but very limited because it's only available for Win95/98 (not NT)6 C6 c& T( k4 E% X1 {, `6 Y# C
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ h" \: k3 X$ D# H
* ]4 a* N. R \* G& ]3 k: B4 s push 0000004fh ; function 4fh
5 ?8 c. {3 W$ Y/ O2 L0 ^/ J! A" f push 002a002ah ; high word specifies which VxD (VWIN32)
- G& G5 }) E! O- t# b$ Z ; low word specifies which service
' f' e3 u* T% R9 u4 X (VWIN32_Int41Dispatch)
0 @ `; x+ O- ?, V3 z call Kernel32!ORD_001 ; VxdCall
# N: Y$ E3 T' {6 K$ R8 Z: ^$ W9 Q1 B3 E cmp ax, 0f386h ; magic number returned by system debuggers# P' i* l7 j/ e/ [7 G, n# W% r/ F
jz SoftICE_detected
) r$ ^# E4 b/ ?6 s$ j3 i# s1 b/ A! I/ m9 W2 ]% B; P7 A: `" c
Here again, several ways to detect it:* C2 L# n0 @, `7 b6 ?& V3 @ `
4 G% k" \( H& c. a2 I7 ?
BPINT 41 if ax==4f
2 @( _) y" T6 e9 R* l3 i0 U
8 S+ `2 b; q# `7 G) O# {2 S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
4 z; j7 z2 y( K
6 b/ ?9 ^, D) ^5 q) u" u BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: Y! d C7 N9 s& T8 ?/ x! X' u$ w1 O9 p% `2 j
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!' J" v D! o1 K4 z; W
. X" G0 o; D7 H9 b9 i
__________________________________________________________________________
4 e/ o4 c' q$ f2 ^8 b. o3 i
) ~, T7 f; {; vMethod 13
3 P% V5 @/ E. w4 d2 |=========
% d& d4 S! P, }; C: e( Z/ K1 I! n
' w- x1 H7 K1 ANot a real method of detection, but a good way to know if SoftICE is
2 T% Q8 J/ w8 |0 p8 I, Y+ ]installed on a computer and to locate its installation directory.- m) s; Y: J8 @: T5 O9 o5 D
It is used by few softs which access the following registry keys (usually #2) :
9 |8 h% f2 p4 o; i
+ ?9 @+ ~0 Y# ]8 M6 r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! V6 ?" u. M$ W3 q1 }* E! ?\Uninstall\SoftICE; t* R8 F# F, P/ W
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE n) B* C8 Z+ h7 ~4 t1 O
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" v- i* w4 v" ?6 F\App Paths\Loader32.Exe' J' Q* j1 O5 c* u
) N+ h7 S0 M6 e4 G
4 G* u& Q9 |$ j- K) O
Note that some nasty apps could then erase all files from SoftICE directory
# t& v3 R! o( `7 O(I faced that once :-(8 I+ J/ M; r! M \
7 \& Q+ {. z& c H- s! P
Useful breakpoint to detect it:/ ~& W2 Y I) |4 T. j& ?& r
. ~' R) m# D7 ^* F. c4 z8 _
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
! h2 f4 B! M4 `/ Y7 \( W; B- I6 A& F- H. G, c2 {1 f- v
__________________________________________________________________________. M) C* C& G9 F' x
% c7 N. z; @0 L( v9 o4 p; _9 K: T( x6 ]- y/ ~! r0 d& J4 v0 ]$ H
Method 14
, _* ^" g1 j0 C0 L. ]=========1 ~0 E& O5 z% C% m
3 y; N: U$ I+ b2 J, ]A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; k- Y* @) ~( y- C
is to determines whether a debugger is running on your system (ring0 only).
0 t& Z( C+ P4 m* m. M
9 K8 v9 Z0 [$ P VMMCall Test_Debug_Installed
; N9 h% {" Q# a& v" A je not_installed
9 f7 [9 p1 x" ^0 c4 C% n; o. X) w, d9 m5 r
This service just checks a flag.0 N$ |( Z$ S/ x2 @
</PRE></TD></TR></TBODY></TABLE> |