<TABLE width=500>0 a3 F, ^/ [& s, a$ e
<TBODY>
' W7 x( E8 E5 v$ a) `8 v2 H& [% J* l<TR>) D$ |: b! `5 F7 g6 L2 O
<TD><PRE>Method 01
/ e% L8 n. s7 Q2 t=========) E$ f$ l- h9 D# j( @1 G
/ _/ Z( L" |* Y A' u- gThis method of detection of SoftICE (as well as the following one) is
5 x/ R- t: ]: F. S6 e8 m* L# Oused by the majority of packers/encryptors found on Internet.5 f7 ~; ?. Y/ f4 d% C
It seeks the signature of BoundsChecker in SoftICE
# i- c- f' m" @; a+ Y( t; U* |
) {0 \% i7 ]" ?' Z# ~ mov ebp, 04243484Bh ; 'BCHK'
/ H6 C, I- f$ }) O" w! N7 Q mov ax, 04h4 b2 K" I0 F2 w' \
int 3 - l+ L: D- P0 z# b# M8 A L( d
cmp al,48 N/ D& Q) ~( b
jnz SoftICE_Detected% q D* ~, X& T9 u
, f4 r5 r: n( k4 q___________________________________________________________________________) i( t, l4 H I6 \7 X) b9 ~1 j
9 H8 L* v |% O/ l+ S
Method 021 _+ l& l* v5 u* |+ l
=========: c2 n/ N) z! a
) j8 q0 s3 Y9 f' ?
Still a method very much used (perhaps the most frequent one). It is used8 T! ~2 ]8 a9 e' d) q. E$ C
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- Z4 `# E1 u* d4 d1 ?" o
or execute SoftICE commands...3 J0 [' n) _: y, u* S8 W% F
It is also used to crash SoftICE and to force it to execute any commands
. k2 p, H8 V8 R6 v: [" I" H7 ^(HBOOT...) :-(( + v! W& ]1 Q- H
$ \8 z; Z( E% P' K$ F% |% @* UHere is a quick description:
) h9 ?. n( n* N: p+ V2 D-AX = 0910h (Display string in SIce windows)' ]4 v9 c& `) f' V5 c; F; }
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
4 e9 f3 P! o. i-AX = 0912h (Get breakpoint infos)
: E7 _0 t) Q0 [: H-AX = 0913h (Set Sice breakpoints)& M& l: `1 S8 V) ]& o" l
-AX = 0914h (Remove SIce breakoints)
1 f$ S% S1 C4 }. a
, N2 b8 ^8 G; u* sEach time you'll meet this trick, you'll see:
$ a) l3 N, t( y7 f9 R+ A-SI = 4647h
: r9 r+ f3 \) C% C$ C-DI = 4A4Dh
! B9 Y( V6 d9 w2 GWhich are the 'magic values' used by SoftIce.& B2 q! l1 B7 N5 F9 u m% s
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& O1 \/ P4 `' E* V
; E! e% J6 Z4 S7 c# s' U% d' |Here is one example from the file "Haspinst.exe" which is the dongle HASP
1 s& ]* i+ a6 w' WEnvelope utility use to protect DOS applications:7 k8 \& F7 A7 x% w9 }
/ {& l+ Z: Q5 K- Y5 V
8 B. y2 m2 v* K, w4C19:0095 MOV AX,0911 ; execute command.
, y9 D" g5 W$ G% H: E8 u7 \4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
# M- T# f" L# l! ]& v0 o; x0 }4C19:009A MOV SI,4647 ; 1st magic value.
6 Z5 c$ z, m5 \* s0 ?) P4C19:009D MOV DI,4A4D ; 2nd magic value. ?2 s; g% c, x/ `: [4 }3 j
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ I9 M& K8 }6 Q8 {4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
" L- F: ^3 {' {" B4C19:00A4 INC CX# U) K" q1 L0 F% E) @
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 S1 m; h7 b* a, r% e4C19:00A8 JB 0095 ; 6 different commands.
& O' I9 A0 A8 e' v/ j: `4C19:00AA JMP 0002 ; Bad_Guy jmp back.
7 v* Q- V/ n6 i3 f4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: T) \6 v9 G$ M9 y) B( m6 T( R; f3 {5 ~+ J8 L8 [
The program will execute 6 different SIce commands located at ds:dx, which- p! P4 k) `# b5 B, A9 t, E
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 D' M. g2 H' |6 u; c9 F
+ O9 f4 w% w% y- T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& {( D/ k% F5 [6 ]' \
___________________________________________________________________________
5 L! u, i7 ~4 x" f4 h( y* `/ r
& D& n' j" K* f2 M& l
' Z, j3 [8 _0 I5 P8 X2 Q% ]) G$ @Method 03
7 o. Z- S1 t( p1 |: U+ F=========
O9 K6 y0 ~, T# g9 Y6 H# i* V$ x' H0 Z$ z
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 P; Q( Q* w/ @ h" g* t' u, W(API Get entry point)" R8 J( S& n' q! k6 W) K2 l
( C1 {; l$ Y. u/ P% k ~ {' H3 G- R" N
xor di,di- c1 ^& Y+ x, `) `; A& Q
mov es,di8 w! U( R: Z1 Q/ `4 K; {! ]* D
mov ax, 1684h & \8 m" n2 Q6 J2 ~
mov bx, 0202h ; VxD ID of winice) C- G+ p' f0 B
int 2Fh
6 O; z: Y" a6 D& q% U0 Y mov ax, es ; ES:DI -> VxD API entry point# ]' l5 H; U2 e: z
add ax, di
8 e+ A9 O1 G; Y& l test ax,ax% h- a# P/ M+ P
jnz SoftICE_Detected
( N b; v( U! r9 j) `6 r' h
' _' a9 B+ P! d! w+ D' E___________________________________________________________________________2 ?/ W. g; j2 W% ~4 H
& `8 F, k7 y5 E0 N
Method 04- F1 p$ x; ~( }7 n; T3 S% g
=========* \9 N# o! D3 r f+ t- C- L
' y! X) l6 e7 v5 D g* g" O
Method identical to the preceding one except that it seeks the ID of SoftICE
& q: t0 k1 O& U0 _GFX VxD.
! B, U; L2 P x3 p# G) b: D2 X
! | X! R7 K& [8 t xor di,di2 U1 @8 E% y- A8 q' L. W# r( [. i5 p8 }
mov es,di
; O. y ]& a' Y- P: ^2 ]2 T mov ax, 1684h " b( i2 T s }" T# b# t9 @
mov bx, 7a5Fh ; VxD ID of SIWVID
: T. G l" G. E9 N- [ int 2fh' b# i# o. V1 ^" b
mov ax, es ; ES:DI -> VxD API entry point6 S" T, _- S- w8 X
add ax, di
' w! b0 E" z6 \ test ax,ax
* g2 _3 W* v" |9 f. z jnz SoftICE_Detected; x: N" g D1 L% P
' G5 Q. j( C* y$ @) W x5 U1 o__________________________________________________________________________9 I g( [6 i- e$ t9 J7 a, R
9 u& W# U8 C6 M9 Q( _
0 u+ X) u; u" S4 B$ L7 j9 V
Method 05
+ @7 B! j0 F1 U' x+ @- g# R4 X=========7 S5 Y& Q$ i* |0 P- G0 ~
& U/ s& x2 W% |0 v
Method seeking the 'magic number' 0F386h returned (in ax) by all system" P4 g9 `1 D" m- G \' i
debugger. It calls the int 41h, function 4Fh.9 v. [3 ]8 @& S- ?3 n2 c
There are several alternatives.
?6 M% R L0 t! I$ l& h/ \% h. |. B0 G/ A1 x7 X' B- g
The following one is the simplest:
7 M- g0 r) J7 c8 m% v" k' E8 W" }& }3 X5 P9 g# D5 R& ]& [5 s
mov ax,4fh
' ]) I3 W+ d' } int 41h
' k7 y. g/ l# r cmp ax, 0F386
5 }; `) p; M3 J6 o2 v jz SoftICE_detected/ @+ ?, ^% [" i, [
" K( D. f: U3 S) x O% H f( k
) y5 e, p0 T" |# P
Next method as well as the following one are 2 examples from Stone's & `' D! e$ @7 S& t3 i
"stn-wid.zip" (www.cracking.net):! }3 e1 F* T' K4 E# g4 i
& O3 x1 G1 V4 V
mov bx, cs, C: d, {, S. [6 C- ^0 E: C& q
lea dx, int41handler2" L1 g0 n7 Y: B1 L8 z
xchg dx, es:[41h*4]
- s) Q3 B$ I+ f5 V xchg bx, es:[41h*4+2]/ B5 N0 N" B( ^$ @# J
mov ax,4fh
, C" @) |* x' t5 [/ ` int 41h: e/ R+ W4 z6 B9 L1 v4 v
xchg dx, es:[41h*4]
5 p' y, D& @4 U2 ]) r xchg bx, es:[41h*4+2]2 x- d5 C# Z% ~8 { A$ m
cmp ax, 0f386h
2 s0 y2 A6 c @# l3 ]- Q0 ^! K jz SoftICE_detected
3 x2 ]2 c1 p& a/ Q M8 q
3 b1 o% G. h+ B- wint41handler2 PROC
' Z8 d: K( o5 A6 h, H- \1 ^4 [7 T iret' y" O1 R' g* W
int41handler2 ENDP
- {: \7 h0 T. J+ [+ C& O9 W5 }* `- z! ^: S5 k: D/ |; ^
" O+ Y+ T) ~9 s+ w_________________________________________________________________________
" n: E- o2 n) f f f0 Q/ U( Z7 {" c
7 R3 \0 \* x2 e: i+ c0 A, I" f$ l4 S" d0 C6 i7 A6 b% M
Method 06; S2 J- ^# I! m, J+ x2 q( c, O
=========+ R X3 t- ~" {% w. ?# q: l1 b" C1 b
; A& U* i/ F% P' y5 G P) X
0 R# D5 a u- N
2nd method similar to the preceding one but more difficult to detect:
! R5 o4 i/ p# k6 X* O) c7 n$ @
3 D- u" j0 M" k( O# P1 O5 u
; a' Z) j3 K! a2 K+ k/ Iint41handler PROC! X, T w8 J; W- o" q/ V
mov cl,al
) F8 ]: ?1 G) I# G iret- a1 L9 a. p" |4 P% r9 X; Z9 J
int41handler ENDP
7 t% }! ^ G( O- Y+ K
0 Y/ [8 t# H7 S$ X" R" ]) v T: f( o9 S) B
xor ax,ax: t/ n- q* t3 W6 h6 F0 ?6 O/ n
mov es,ax
+ }0 Y. g/ R" A v# @ mov bx, cs
6 S9 @' b6 n m& G' X2 G% `, g lea dx, int41handler- x7 r# [* ?" y. B5 w
xchg dx, es:[41h*4]
; f/ \9 q5 D( R' F xchg bx, es:[41h*4+2]
8 h5 {+ }1 r- { in al, 40h
' d6 C: S' ~ h1 [8 Z/ p; V xor cx,cx
0 M* x: p0 _" Q4 z, `' e int 41h
9 C! ]% n( e, [1 z1 }) B xchg dx, es:[41h*4]
f( ]+ q$ J/ s* j V xchg bx, es:[41h*4+2]
8 O+ A V! o9 x6 N/ M- u cmp cl,al: w7 E3 D' G$ i8 l" W8 [+ H5 m2 f
jnz SoftICE_detected
: l$ W1 Z# E1 G0 X2 n
6 @* d* Y9 z' z' ]; A8 C! x f_________________________________________________________________________
& o! @+ U' |+ ? y" ?9 F( j- d
/ F( N4 n" ~4 o$ q- MMethod 07
' |% @' `8 }# F G! j# y. U* A9 [' l=========* y- A# m, n. W+ b
* Q1 H- s4 | K5 B6 |2 l2 `: O
Method of detection of the WinICE handler in the int68h (V86)
. d9 J& h. y! L# d2 u! B# t
1 u; K. v3 ]6 \" S0 q F6 q" ~ mov ah,43h# x( L/ f3 f' W! |" O
int 68h
! d3 A4 k. U% R: n3 q) o cmp ax,0F386h) o6 Q$ j% ]$ O4 O. m
jz SoftICE_Detected
' k" ]. M* [' v& a/ z" e. s
( X/ a2 S; N( S
0 v* }! p5 \, V9 ]# [8 [# a=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" Z& c1 Q: i( v& A2 R app like this:7 o8 ~/ I2 }2 V! d( F
1 h/ h/ X% d t BPX exec_int if ax==68
: X; R7 D) n7 z; y; z. e( U (function called is located at byte ptr [ebp+1Dh] and client eip is7 w8 r- a3 e: }. }
located at [ebp+48h] for 32Bit apps)% G6 V' U# B" \
__________________________________________________________________________0 T4 B& h* Y" }* |0 E. e
+ k5 X) T& r( Y$ |
$ @" Y+ u. e5 E7 b+ y3 B: BMethod 08% z( @( h3 A* K
=========
7 l4 v0 h$ I' l) Y3 ^
5 [% P1 A* l! j2 s- g+ yIt is not a method of detection of SoftICE but a possibility to crash the# _7 R7 s \5 f, G! S; f7 J p
system by intercepting int 01h and int 03h and redirecting them to another/ B- `% i+ R N$ s3 m- K
routine.
8 t! w4 N- Q! zIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ U P2 q+ y; Z q
to the new routine to execute (hangs computer...)
" ~& v- o! _4 ]/ Z8 N
) b( ] J# m4 o! k: R/ g F, [4 D9 l mov ah, 25h
3 T- v, |2 s0 O$ x; ^( K2 S mov al, Int_Number (01h or 03h)
: G7 S; ^8 X1 \% i8 y% _8 V mov dx, offset New_Int_Routine# i& Q: Q# T8 V1 b* y. m
int 21h" b& b5 ~1 S- c! R8 A! p
# n: }, t% _# b1 k1 ?__________________________________________________________________________7 v h1 w9 F- W4 D) r, b
/ G4 {3 s6 g9 x! s& `+ \3 OMethod 09
7 {7 q' n" b) P. y6 s=========
( O4 q# w4 g+ |1 M2 o* e- |& t$ S( ~2 ?5 G6 Z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' A* Q2 ^/ Q$ p1 X, G- ]2 D# T' X
performed in ring0 (VxD or a ring3 app using the VxdCall).1 g! h5 U, `3 O5 D
The Get_DDB service is used to determine whether or not a VxD is installed, G) J& N& H# A, d; l. J
for the specified device and returns a Device Description Block (in ecx) for l# H0 I- @1 W" n" d( u
that device if it is installed.
9 h0 {, N6 a; J, v- P P% S7 U8 z
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID& V M3 Q5 V( F3 H; W9 I! j$ u
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- r' h! W2 Q9 L- f+ |* ?& ^ VMMCall Get_DDB
8 o# _# N7 j8 d3 C- r9 k mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& G+ p, S- ~+ i9 y
& h& v4 n, n5 j2 e. {: i" r; U
Note as well that you can easily detect this method with SoftICE:
3 B% L4 ^4 I& H0 J bpx Get_DDB if ax==0202 || ax==7a5fh
) f5 |5 ~: U* G/ G0 D( V: g, e- i# X0 r( K
__________________________________________________________________________- R! t; H$ `' k3 m. @7 V! v/ R0 b) Y
/ a9 @! J" n( Q' B. T' x3 p+ x
Method 10# d6 \* _( V3 K" Q$ [, o0 z! P4 O
=========
! D8 j1 q- n$ T. u2 }3 i* `* [% J% C$ h0 S3 R! r$ T
=>Disable or clear breakpoints before using this feature. DO NOT trace with( w6 E8 {) j# B# r1 x
SoftICE while the option is enable!!* y) a& U7 P# m, D- B3 ]9 }& h
0 D( d, j& ?) U4 h N6 W
This trick is very efficient:
1 `, |! n% Y! e+ tby checking the Debug Registers, you can detect if SoftICE is loaded$ R& D0 Q2 H( ?3 L2 v
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& p" ~: Q- A2 {, E3 I! Gthere are some memory breakpoints set (dr0 to dr3) simply by reading their
B% [. }) \/ E2 j! vvalue (in ring0 only). Values can be manipulated and or changed as well
9 |8 W' j& T6 J: O(clearing BPMs for instance)
7 o$ e. p. y; @' v7 u6 L2 _: n- @' Z" ]
__________________________________________________________________________
S% k9 g$ c _) ~: q m0 p: C% f, m, a
Method 11. _5 b w! V' q
=========
& ]9 i7 B* C8 [1 p5 M5 ^% X/ k7 m0 C# Z& w6 ~* k5 E7 D0 o
This method is most known as 'MeltICE' because it has been freely distributed
% E6 G, o9 Y; P' b4 W4 w, \3 ~' ivia www.winfiles.com. However it was first used by NuMega people to allow y3 a: f" n# a% H E; U4 T; M
Symbol Loader to check if SoftICE was active or not (the code is located
4 R+ {. R; K1 v8 }2 A1 Rinside nmtrans.dll).
. V$ a, l2 t: Q: q
; e+ S3 W5 M, N, c, O9 r- eThe way it works is very simple:
- Q* [: h1 m/ c3 A1 h B! MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 R9 h8 |5 e7 r, C
WinNT) with the CreateFileA API.
9 {4 I3 P+ U" s# x8 \+ j) g
: R. n2 K3 \* W7 _8 EHere is a sample (checking for 'SICE'):
- l [) j& c$ e' g& F2 c. a6 A# G/ W1 Z2 B$ H* p8 l, e( s
BOOL IsSoftIce95Loaded()/ {+ ]8 v" ]. Y# E% ]& e1 O1 g. x. H
{9 _2 }1 d; m) ^
HANDLE hFile; # W5 |) e( p# h. h
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 V i G/ V/ \/ H- u y2 T FILE_SHARE_READ | FILE_SHARE_WRITE,
" C( G( N/ `0 ~2 o! ? NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) i( R/ e$ w2 k* P! l if( hFile != INVALID_HANDLE_VALUE )7 D( e; f* c) E% m, g" U0 t( Y+ n
{
* f! {) T- e- L& n. O8 G: t# k CloseHandle(hFile);9 |1 C6 {5 R" H: ^! }
return TRUE;
2 K3 a C8 C" V) `- u }8 ?# n/ r" k' Q$ c% L5 |
return FALSE;
6 m0 @' b6 g- v1 y}
) P6 P7 j* v2 ^9 t7 X% a$ x) G7 W5 Z- W% w
Although this trick calls the CreateFileA function, don't even expect to be# ~9 r( J3 Y z; S3 ^1 d% b
able to intercept it by installing a IFS hook: it will not work, no way!5 @4 U. r* |2 a5 ?4 \+ Q8 |
In fact, after the call to CreateFileA it will get through VWIN32 0x001F* ~* {0 C0 | t0 c
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( A" W$ C* D* e0 M& t1 A5 g# A
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
N. ?5 j# L o$ Z& a" lfield.1 ?: R v! \. Z+ y a! s5 }
In fact, its purpose is not to load/unload VxDs but only to send a 6 \+ J& I7 }2 I5 q$ M* v3 l
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 \# f3 l# T% I* E) Y, xto the VxD Control_Dispatch proc (how the hell a shareware soft could try8 N2 a6 i) E+ E8 s" \
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
' A% |& M8 K o1 ~: h% O3 \& U! @If the VxD is loaded, it will always clear eax and the Carry flag to allow
: F7 W0 t% G) E, c9 @! lits handle to be opened and then, will be detected.$ c3 H$ f6 }6 r9 v7 D( y9 U
You can check that simply by hooking Winice.exe control proc entry point: R- j% U( X6 V* |# ^
while running MeltICE.
, S+ r9 l7 @1 w# Y; ?# F; r2 H. m6 g5 F
; a* y' K' {& Y! D- X0 w3 z: X$ i 00401067: push 00402025 ; \\.\SICE
4 F7 c0 l$ a7 S7 r5 I! R 0040106C: call CreateFileA4 V8 Z. R9 y# G( P4 {3 P, u o
00401071: cmp eax,-001
, e1 p: o# H; k/ C; W" ^ 00401074: je 00401091$ T$ Z! l3 M) W8 D- u$ u$ P0 u
( h$ K, A. B7 C2 z. I$ W
+ J9 o/ }# a6 c: r3 m6 {" z
There could be hundreds of BPX you could use to detect this trick.
; O* q, |! _3 w3 \' O-The most classical one is:. @ R1 i1 o# q5 ~
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 W- M/ [: F H+ H *(esp->4+4)=='NTIC'
6 Z" J, }6 P5 C, X0 S3 g6 x9 w$ `7 z3 C) v( U2 w
-The most exotic ones (could be very slooooow :-(
' i; c* v4 N$ O% u8 z7 Y' b BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
, g, S9 y- ? R4 ^" y- W ;will break 3 times :-(% p6 f6 P3 ~6 D
- \# |3 X: f# p Z-or (a bit) faster:
4 B2 i/ V3 K/ ^. `0 M; V BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 N. Q% g2 s3 U; w% @
f% @5 _: F' `5 u BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
0 C, ^7 w2 h* r& L x ;will break 3 times :-(
- v1 A& b$ T5 C/ `9 f1 S* F4 h. W( x2 {+ x. \6 P% n
-Much faster:$ u) P" t3 h0 @ v& f: b
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'2 s0 t: u0 B; b0 L" I1 c
6 C6 |4 z' l: x B" q$ M- l. ?3 T
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen* Q2 Q: x! m/ `
function to do the same job:
. \9 I, [7 f# v+ r# u) Q J7 ^3 v6 E* u
push 00 ; OF_READ
8 f& v! I2 L0 W$ x4 { mov eax,[00656634] ; '\\.\SICE',08 J& n& W g1 A; [5 a. k, W
push eax' z5 Z4 { z* X$ v2 q
call KERNEL32!_lopen& E$ U6 C; I: U+ b s( L' Q' j' y' z8 z7 h
inc eax
* R; A: y$ c+ p. ^. l1 X jnz 00650589 ; detected% G2 ?/ B) E x
push 00 ; OF_READ4 V2 v+ w) A: E8 |2 `
mov eax,[00656638] ; '\\.\SICE'8 Y+ l( I( G$ g# X) Q. |8 c1 P
push eax
& v- R i1 v7 l# h$ P) G7 J2 ^ call KERNEL32!_lopen* \" s% J. ?0 G
inc eax) p; [9 k, X! ^9 K/ F
jz 006505ae ; not detected* h# }0 c. `5 V1 u0 g: P" n
4 ^- w$ o$ E+ z
+ f& Q$ i# @7 U7 n__________________________________________________________________________
5 Y; r9 G C/ Y& q- q, G' M& h" k \" g1 W, q& y& l6 @
Method 12; H4 y: L9 X8 _# J8 t0 M% ^
=========
1 `# ?8 c, N7 h: V! w2 m
2 S/ A8 n" B/ E$ ]6 O9 c) |This trick is similar to int41h/4fh Debugger installation check (code 05! G# U, u1 G" f9 {- J6 l7 S( x
& 06) but very limited because it's only available for Win95/98 (not NT); ^0 r, K( }# ]* N0 _; J
as it uses the VxDCall backdoor. This detection was found in Bleem Demo." H1 Z6 @2 H" ~4 K/ Z
" O5 G; V1 d8 [' y, Y( b6 X: n push 0000004fh ; function 4fh
6 u. @7 ] j' l4 x push 002a002ah ; high word specifies which VxD (VWIN32)- o5 ]' c a- p" S
; low word specifies which service Z* r, Z6 T. b
(VWIN32_Int41Dispatch)
2 M, f# q# x2 P call Kernel32!ORD_001 ; VxdCall& s0 @+ |1 v: [1 G6 {: ^
cmp ax, 0f386h ; magic number returned by system debuggers- d/ {6 `- T9 Z4 O3 S
jz SoftICE_detected
+ g. l9 |; q, x" ]# O6 u$ `# d1 Y/ W5 W& ~" h* D9 V
Here again, several ways to detect it:4 M0 h. h, ]& Z' w' [! M) m
v Y; ^1 |) [# n% z8 r, D1 ]
BPINT 41 if ax==4f& c2 A, C; m) q: Y, g. v
, F! X' H" I2 T) Y. h
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 V8 Q& D# D: s' J7 T3 x5 L% N
2 ~/ Q4 a5 p& ~" g BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. g' U' ]5 z: [$ Z
& V `- x. Y! r4 I- w9 r BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!+ X Z- a+ Y1 U, ?! E4 [
0 U* I0 U: V/ q: t7 |* Y8 Z8 E# a
__________________________________________________________________________* |, B3 e; x. t" d$ u2 b
4 d: X' I/ K& e6 C1 ] NMethod 136 X. B5 \* X. o) G
=========
) y7 h1 _: M3 u, D5 A+ X
5 z2 W; \+ O2 {# F. CNot a real method of detection, but a good way to know if SoftICE is, C( ^4 v4 K1 u; O
installed on a computer and to locate its installation directory.9 M X& d) n$ k. z5 w0 x
It is used by few softs which access the following registry keys (usually #2) :
/ x1 P2 P/ R. \" [; k2 W& I4 n. i+ p
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 A6 h( |/ E x1 y! O# Q) W\Uninstall\SoftICE/ q: e A: o2 z! M) _: ?
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, O8 \- h: }, a+ r: @' B, Y4 w) z7 m
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& J, `3 u& c) c2 f
\App Paths\Loader32.Exe! @' J, Q: Z: F3 g$ R- @
9 g+ F$ _2 h Q i
. P4 Z4 W; Y9 gNote that some nasty apps could then erase all files from SoftICE directory
# S- C& y6 |5 n& U) b* c(I faced that once :-(: P. U7 i9 W a% F6 s$ |4 v
" W* e* p; B) ~' N3 x8 W6 U$ K
Useful breakpoint to detect it:
, ]8 m8 u) Z T$ V/ T" R; R) _$ L
9 R0 v2 V3 {7 ~! U BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
1 Z4 k# _7 s* \# x0 V, f% w4 ^. w0 j2 K$ ?! R+ l
__________________________________________________________________________
9 d# o! Q6 k2 o+ q. J' N3 p) X# r& T8 N; g
@5 s) o" ~' Y5 i' t3 X, ]
Method 14
# Q- d5 d) C" J=========8 s! `' m; t9 u, d' F- [
$ N* X$ e1 Y4 Z' c+ hA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose9 ^ F* e m( ?( a! l, o
is to determines whether a debugger is running on your system (ring0 only).! X' t3 ^6 a% j1 `- p) Y1 V
1 g' _. P5 }" V8 P! O
VMMCall Test_Debug_Installed
: p0 a8 ^$ J H0 F! G je not_installed
! O9 ?# N$ q2 h8 j) n# J$ P8 g' o5 {* k9 X6 a
This service just checks a flag.) Z* L' z0 g% l
</PRE></TD></TR></TBODY></TABLE> |