<TABLE width=500>( w1 e* {; F# z( C# T; M2 R
<TBODY>' A( @% ]6 r0 n, i- O [
<TR>
3 d! X! H" {9 t) l* |' S<TD><PRE>Method 01
7 a: x4 P3 g( I, S, \=========/ w1 t/ G7 i7 g9 n/ B0 g3 B/ ~
+ H: |4 X* q) gThis method of detection of SoftICE (as well as the following one) is! u5 p# e, l, ~
used by the majority of packers/encryptors found on Internet.
/ S5 t# B9 F W5 lIt seeks the signature of BoundsChecker in SoftICE9 u' J7 g6 u1 t4 x2 t3 v
2 q+ H3 |8 W+ |/ f- i2 o5 L) v mov ebp, 04243484Bh ; 'BCHK'$ v0 O F" _% U* e
mov ax, 04h1 x3 N4 I2 z1 S9 ?3 k9 j" C: o
int 3 7 R& s' Y; M0 E0 F* |
cmp al,4
N6 n; q/ k7 F8 ^) D$ O jnz SoftICE_Detected
; ~# N' ^; Y3 p2 ~0 m0 u* T2 _8 S: S
S/ @% _2 ^) v5 q0 @8 E___________________________________________________________________________: w6 P, S- w8 G; Y3 k N
: @% S* G& `' @" z+ nMethod 02
4 P# W* o$ L% U! M1 m6 t=========, v; B$ j% z! @ B: Q5 `! T+ E
- r" ~/ x* F C# t( _Still a method very much used (perhaps the most frequent one). It is used
, N3 ]" [/ p. R) g! c3 J3 q' Oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 B: ?' ^+ A3 Kor execute SoftICE commands.../ i G9 m. T, ]
It is also used to crash SoftICE and to force it to execute any commands5 N- X' `) J7 H1 h
(HBOOT...) :-((
3 f- R# S* c& F* ^% l/ o; N' m6 g
3 P q2 L! W/ S Q, F1 Y; j( NHere is a quick description:
( e4 ?7 A9 C$ l0 h" N-AX = 0910h (Display string in SIce windows)7 u. I0 W0 I7 [+ Q; w
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 p$ }9 f: V) N, L) ~-AX = 0912h (Get breakpoint infos)2 b* d' S$ u! ^
-AX = 0913h (Set Sice breakpoints)
3 a8 C& w \+ b& }* q' B( `6 h-AX = 0914h (Remove SIce breakoints)
: J M5 |9 @9 c" d3 z; w: D: C. ]. P% l, M9 r& h4 E
Each time you'll meet this trick, you'll see:
# a, ^" B' k* R' v-SI = 4647h; y6 g. `5 }. s3 o$ l
-DI = 4A4Dh: F8 B( D+ Q& S! f5 U
Which are the 'magic values' used by SoftIce.
7 E9 u1 ]/ b( r/ Z4 {For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 r9 q5 ]% ^/ h$ j3 z% `% T9 ^6 L; s
6 K8 ?' B: U8 K4 eHere is one example from the file "Haspinst.exe" which is the dongle HASP8 Z. F. x' j4 G- y
Envelope utility use to protect DOS applications:
% B% X8 q0 L3 ^
* p1 i0 o8 b6 w- f& U E" ]4 C- B+ k/ |
4C19:0095 MOV AX,0911 ; execute command.- G: U: x/ ~8 P7 n0 Z
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).1 W, ?* j1 A6 p* `0 l
4C19:009A MOV SI,4647 ; 1st magic value.
/ c1 Y/ h3 e, X+ T$ l' [4C19:009D MOV DI,4A4D ; 2nd magic value.1 b3 F ~# U4 Y. i4 Y
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 q7 [5 L) M) I$ l$ w# h7 C4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! e( d. e- {& o( S+ I
4C19:00A4 INC CX4 G. b0 M3 r+ E& s" ]' C
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
( d# N' d) l* I1 k0 b& I4C19:00A8 JB 0095 ; 6 different commands.
: V6 M3 |) c1 C. u( d" o& i4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 C1 H& c1 B+ x: i' C; }; k
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
0 U V; m8 S+ F6 e8 i9 a
6 v$ a {. \) z2 }2 x. Z7 `The program will execute 6 different SIce commands located at ds:dx, which/ C1 X" R3 q& b4 z9 D& k t5 w
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 X/ Z1 X- G* G4 H, q
9 T$ e) P1 |: Q$ @3 A* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.0 f3 N4 C) B& r( E, {% v. f
___________________________________________________________________________
6 M3 `+ k. V: `9 u& k, k- M- s4 q# N
( d5 X( F8 H6 `) v' cMethod 03* s. @! J9 ?2 [5 B- {
=========
% {6 Q; ?) |2 c+ F5 S
* X2 V/ ?( }6 s" u3 ULess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, t& W; q* P. X5 Z6 I, D* q
(API Get entry point)
8 J7 |0 K, q* }, F
~4 b# n/ |( F2 G1 z2 v% H( t
& c) U5 G1 U6 E A xor di,di
. j; n! a. y ~2 N% L mov es,di
2 M& y5 ^' b3 Y4 t, T2 F mov ax, 1684h 4 Q6 Q& H2 Q7 n
mov bx, 0202h ; VxD ID of winice
! ]( Z# G l1 z, H% q int 2Fh
8 N J7 T5 L! |/ ?0 e mov ax, es ; ES:DI -> VxD API entry point
: T0 g( k0 s. H( S( K( M# H4 W add ax, di+ d1 T% u( L7 J0 a3 w) P+ s
test ax,ax
|: h/ F$ Z: g9 y0 B jnz SoftICE_Detected2 U1 v" x' D: v/ d
' x! L$ a1 [+ M& P$ s t5 }
___________________________________________________________________________
0 L$ c( x% f1 o2 [9 ]8 v, c U! |0 q7 R) K* \: x1 _% \" b0 t+ l
Method 04+ z( f U4 m- r( I1 B: B( D
=========+ _+ F6 R, D7 G. I4 O, _
9 K* E! h Z( r c5 B W4 RMethod identical to the preceding one except that it seeks the ID of SoftICE
# I3 u5 M$ Q, C; r0 P' \, `* H0 uGFX VxD.
# L( m5 I/ i1 S% W) t5 }! B& U2 a% z
xor di,di
7 C6 v2 P6 ^/ o, M mov es,di% k; U. [1 ?: J& W) {: j
mov ax, 1684h
! B2 L6 } W; ~" s# M mov bx, 7a5Fh ; VxD ID of SIWVID
8 Q3 h4 F& B" T7 ]( M$ w j int 2fh
3 H! P1 ]4 [, r0 n9 V8 P mov ax, es ; ES:DI -> VxD API entry point
/ y. `+ a5 H: _! { add ax, di9 J0 n/ x1 A+ N d
test ax,ax/ K* U$ f; z* c$ F& k ]9 e" }
jnz SoftICE_Detected
! b: y, t) Q7 Y$ A% g4 |; P4 p/ }7 h: r! I/ n' p' C; `/ _
__________________________________________________________________________
+ D& ~% E7 T4 h: o: y2 l: J7 x% V/ a& n6 d
5 F$ {$ ~8 }1 G( L3 e
Method 058 g3 E J2 y4 o$ e) c/ y
=========7 X9 ~6 P/ d" ]9 n/ Y, K% Y7 u
) i$ |, @' T6 l: L9 m
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 i3 r4 f6 Z# z; {& e6 r# w$ C$ f. Udebugger. It calls the int 41h, function 4Fh.$ ?/ N8 N) ^7 v
There are several alternatives.
$ `9 X# P3 Y% `( a9 G
- u0 ]1 S6 s8 ^2 q* s# @The following one is the simplest:$ k. A5 R5 S9 `% m& N
4 s, W/ X, o& l0 B mov ax,4fh
' ?7 {$ d0 ?, B% Y7 |) n% ^* w int 41h
2 |3 l6 t& i Z7 o, B- U9 i7 N cmp ax, 0F386$ O" d) N6 k& c8 d
jz SoftICE_detected
( m. S7 m( y! V0 m
# d8 l$ y; n! e R8 S6 N n( M: f7 ^
Next method as well as the following one are 2 examples from Stone's
- i2 \: T6 E( T8 ~. L. T, W& c"stn-wid.zip" (www.cracking.net):
3 E0 x* `: q- M% p' o
2 L/ H- P4 q6 Q, I/ x$ B mov bx, cs
. }' b4 |3 J' s4 d: u lea dx, int41handler2, v/ p! W G, `2 K' M3 w
xchg dx, es:[41h*4] a5 S% T, c$ J. ?
xchg bx, es:[41h*4+2] X. K1 E7 w: P5 R9 R9 {& n* R( e# r
mov ax,4fh8 m! D7 I1 Q* X0 u
int 41h4 B0 g/ n# c- x+ P1 m4 A
xchg dx, es:[41h*4]
' D3 i5 s' l9 H# a xchg bx, es:[41h*4+2]8 C' f k+ z# b$ C
cmp ax, 0f386h
$ x. {+ c3 S( z w* L; } jz SoftICE_detected- {5 w5 [8 U. G, P+ d
% N- k l& r( N" A# a3 tint41handler2 PROC8 R/ t+ S" i3 s/ e, v5 g
iret* q& @# Z. @# M$ {7 {2 E# V: C4 x0 U' i
int41handler2 ENDP
% }; T- K, e1 ?" `; H
3 L# f# R p0 o* A3 n/ n) w+ K$ x' U7 X+ n
_________________________________________________________________________; m- ^5 b( R2 z- z: Z5 i9 ]
! |, B$ r( Q( N. E9 |0 X
% a- c9 j& w' ^& D6 _* pMethod 06: G2 W/ C& J4 l6 @& F
=========1 v V- [2 J- K8 n( U9 f
0 l( s- _4 x1 X+ m* y0 N
( `$ X2 C3 X4 o3 ~* l* A6 N; _3 ?: I2nd method similar to the preceding one but more difficult to detect:. f3 [ s5 L! B3 e0 ^ g; z
+ S7 H& |; Z- |% i6 a1 K) Z/ f$ c* P/ U% i& ]6 l, A' Q. C1 u
int41handler PROC' j7 t0 B9 t) H2 i! S# c2 y* I
mov cl,al
! y* T0 {. o/ } D iret
( T2 n; l/ y+ \, ?( ?int41handler ENDP4 l5 F/ G$ t# C/ c: c
; c$ P4 c& k7 ?2 Z, `4 y% w
# `. E- x4 c7 y! ~3 I0 ]& n xor ax,ax* v3 D- _" R8 c. V3 t Z3 b3 O
mov es,ax
% m$ L2 M2 [2 y. c mov bx, cs8 U8 M4 e+ h( Q- ?: ~# o, F( ^
lea dx, int41handler# x& N1 q; Z. o4 I. O
xchg dx, es:[41h*4]
- Y9 ~; X$ L2 O* C7 a- S xchg bx, es:[41h*4+2]
3 \/ z7 X8 N' i8 e2 \ in al, 40h' i8 J4 w4 E" d7 v9 b
xor cx,cx) U/ r1 B- b, L0 Z
int 41h/ J) x' t e" P) A$ r+ I4 ?
xchg dx, es:[41h*4]
- m1 n1 f8 L6 m1 L4 M: s( b; F xchg bx, es:[41h*4+2]* D$ L$ K* H0 K6 g
cmp cl,al
" V% I& Q8 I4 M$ f jnz SoftICE_detected
, N* f5 e& u$ `* ^4 m: Z" R( \
7 z/ [& n5 C; N_________________________________________________________________________" H) v4 X2 L% m- V
' @4 d; h, S3 o& a4 sMethod 073 i; h" M; C$ N- K* y7 Z3 A* G
=========, ]# U- F3 c9 S. y- }3 ]
3 D' H: m4 I# J, z6 n! T, g
Method of detection of the WinICE handler in the int68h (V86)
0 }4 J7 ~, i1 {6 ]' c$ o3 ] c2 W G R: @
mov ah,43h
5 W1 d* {' |& Q% t int 68h9 ^( O- u) b4 y
cmp ax,0F386h
& m) p( Q% k3 l3 n7 {5 c jz SoftICE_Detected
/ A; P: p. Z/ g
4 D: \) P# B5 t
/ i+ K. U' c1 O0 Q=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% w8 z2 D& ^5 T, T" O2 O) Q3 ~ app like this:% ~0 }5 o/ E, ]0 e! q- x6 Q, t7 L
~% T! N4 {0 l$ K [# @! | BPX exec_int if ax==68
5 c* |/ m1 [7 w7 R3 L( j (function called is located at byte ptr [ebp+1Dh] and client eip is+ Z# a7 A2 J% b4 r+ m. _; P
located at [ebp+48h] for 32Bit apps)2 V7 {' I4 k$ s- u* e3 o
__________________________________________________________________________; o: x8 H( K/ M( F6 a
+ e& h- j1 Q0 n$ U* ~2 @* w3 a: D% w$ d$ i
Method 080 j# f! O, ^2 M! U" P4 v
=========( k, o- I' j/ \. J) n) f( S
8 C' K& ~7 q- O' z: q& QIt is not a method of detection of SoftICE but a possibility to crash the
( p/ z; p9 L/ }6 Qsystem by intercepting int 01h and int 03h and redirecting them to another
" y2 x* g/ {: p- I4 h2 droutine.0 m4 K; X9 P% F0 B
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 g3 y- j; U4 {$ M( X
to the new routine to execute (hangs computer...)7 a5 d& p6 C, P* g& P" @
* ]: S$ v) k8 ]
mov ah, 25h
7 g$ p+ {6 o& | \9 T6 B% T mov al, Int_Number (01h or 03h)
" Z! s9 ]5 v" ~1 r8 C+ B( T mov dx, offset New_Int_Routine" R: B( [1 _4 s2 r* J, ^7 i
int 21h
. A2 ^/ F# S9 x$ y) _$ W2 w# X/ E- J/ s' o) Z7 N! {
__________________________________________________________________________
- v/ t! s* `; e N/ s. Y; h+ T
4 u/ {1 s9 p5 e. @$ D1 o# t/ mMethod 09
% g+ |6 }; `5 F* F" r) k1 e=========
/ ^6 H; ~/ M1 ~* E( q, G- s$ I9 Z# ]+ a6 a" W
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( j2 N" ]) s1 V9 p- f6 w) C1 W
performed in ring0 (VxD or a ring3 app using the VxdCall).
. _4 i6 e! v3 T( d* h- L6 r+ D+ B* }The Get_DDB service is used to determine whether or not a VxD is installed9 u3 ~, y# W0 ^0 r
for the specified device and returns a Device Description Block (in ecx) for
7 `4 D6 `% J) gthat device if it is installed.3 Y( Q& }2 r9 O
- z% Z- h4 l% T) B# w mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID# X h/ c1 z6 E9 O
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 q/ M! C' g" N% |4 s: x
VMMCall Get_DDB! T6 s! ?- G3 ` j2 {9 }7 P2 H2 H
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* I) A M& R$ [% a* t! G( U/ H
7 V& M6 V5 q9 Q% o: `' V9 tNote as well that you can easily detect this method with SoftICE:
1 c7 B& I0 t! Z' b" G' r bpx Get_DDB if ax==0202 || ax==7a5fh/ C8 D+ s& `; n5 K% |
* e5 J. t8 o) f: f
__________________________________________________________________________
9 B% M# Z5 X2 H; M$ F
& X+ M4 Z' m/ R8 uMethod 10
& m) V3 b5 \( l' J& \* n+ g" h1 l=========# p- \/ P) l6 L# C" [
1 [, A" O0 w% n% j=>Disable or clear breakpoints before using this feature. DO NOT trace with
3 D, u1 _0 C7 J4 b5 F SoftICE while the option is enable!!
; J4 [# ?. k) M' N
+ r; d% p- H! b4 OThis trick is very efficient:
0 F1 F" u; {6 Q$ k4 uby checking the Debug Registers, you can detect if SoftICE is loaded
$ H2 Y; E: {) S* ](dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 U& T; f! n7 r3 m# z
there are some memory breakpoints set (dr0 to dr3) simply by reading their: N. k; k6 K8 P9 b7 ~3 i6 L
value (in ring0 only). Values can be manipulated and or changed as well5 C* W2 }" l* U% |# Z) m
(clearing BPMs for instance)
) C* Y, O7 S5 C5 _; y! Y7 s" y% f( M, l0 c R
__________________________________________________________________________
9 a8 e S+ }/ v* k+ p
. r! `( {, l# i/ A9 I$ gMethod 11
7 i0 B7 Y2 n* P: s$ R! N=========
( J& e8 V( a) {. l
, s4 h% L" a% g1 x: I* p& RThis method is most known as 'MeltICE' because it has been freely distributed
* V ]$ V5 }- [: r0 fvia www.winfiles.com. However it was first used by NuMega people to allow1 P; G3 L6 q8 _4 _- Q/ [" [* J
Symbol Loader to check if SoftICE was active or not (the code is located, I8 |% O6 S$ e8 _
inside nmtrans.dll).7 V: d6 J$ j" I, X3 U2 f
$ t; i, s% j8 T$ Q, A8 {
The way it works is very simple:
$ h8 V' f- I; ~3 s6 U( iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for: s [' }' g. ` o7 R% w
WinNT) with the CreateFileA API.
% [# i8 a$ Z: r% J6 q8 z, J) t! Q3 X$ q6 L' a( I; {7 j) h
Here is a sample (checking for 'SICE'):
$ C) ^" J* x1 a
7 f3 S0 A. W- B3 L9 i- _' A! o' [" GBOOL IsSoftIce95Loaded()
3 B* }5 w/ v8 _' C{
/ G C6 E& X Q$ a1 i8 z d% @# b HANDLE hFile;
3 {5 s. ]5 q+ k' Y# E6 k( A! j hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 N; v4 [5 ]( z FILE_SHARE_READ | FILE_SHARE_WRITE,
" I8 x3 M# ^) S/ i5 r8 h NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 H$ k9 r% ?% m; c+ Q
if( hFile != INVALID_HANDLE_VALUE ) H& D( }) |/ `( @& k
{
{2 ~7 L5 j0 p3 W( K CloseHandle(hFile);
7 q0 a# s3 H! L return TRUE;4 k% Q$ v |. B- t' @
}( a: l2 } L. L# }: S( F% n. H
return FALSE;
6 c; M+ ~* p) \ y$ a}; z/ Y( F( u* {0 _, J$ `
( y7 b5 g: c( u. g& vAlthough this trick calls the CreateFileA function, don't even expect to be
1 ~6 ?: s e5 Q0 W$ @7 w( rable to intercept it by installing a IFS hook: it will not work, no way!
; k. N: w) }% k2 g( [In fact, after the call to CreateFileA it will get through VWIN32 0x001F
: ~) D" ?% y+ v) E. b4 D) h9 Hservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" {" \( s/ g" V5 aand then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ ^/ }1 r' B; `field.0 L' O$ \+ V5 t4 O. {
In fact, its purpose is not to load/unload VxDs but only to send a 1 Z# I% \ n. f+ P8 \# u
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 W4 V: H+ h9 ?: nto the VxD Control_Dispatch proc (how the hell a shareware soft could try( [9 J/ i1 R/ Y4 V( J
to load/unload a non-dynamically loadable driver such as SoftICE ;-).5 Q0 T+ X0 x7 }) b: a4 F
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 _" @$ q" R$ B4 B0 [4 `) Q V: q+ g5 Mits handle to be opened and then, will be detected.
* C [3 ~$ F1 G* @2 a, [6 ZYou can check that simply by hooking Winice.exe control proc entry point1 a- _% {. _. u# k) M9 L4 ~* r3 Z
while running MeltICE.' R6 U2 x3 F+ R; v4 t' ~/ u* Y' G
2 [+ ?( w9 U: u
\0 ?5 A2 }* [9 ~' h9 C" ?/ f' E, V 00401067: push 00402025 ; \\.\SICE- W: }; S9 F" D3 m
0040106C: call CreateFileA5 Y% H# @7 [' O0 H: N0 ~8 L+ v
00401071: cmp eax,-001
% ~- f1 |1 R: b2 o 00401074: je 00401091
* p& _* A5 f% m
+ t9 \1 W, P/ j& K8 a" x, w }! F' R* t5 n$ `( p
There could be hundreds of BPX you could use to detect this trick.' _/ e( r; |8 X% s$ s: A. T% y( X/ t
-The most classical one is:: F: ^# w6 C8 X
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||0 z# V" N7 \+ E r! z1 ]
*(esp->4+4)=='NTIC', [2 N2 n7 V4 O1 q; p1 Y
5 ~' M7 z: R$ l" ^& i V-The most exotic ones (could be very slooooow :-(
( T s6 V- s: j8 Y3 n BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
5 P1 A+ J2 q9 J2 j: u. F ;will break 3 times :-(' b2 i2 p* A5 ]1 B% u3 I f
" x' Y# U& O& a-or (a bit) faster: , ]; K4 L! R0 r& E
BPINT 30 if (*edi=='SICE' || *edi=='SIWV') W3 k ?2 B. f8 R4 I+ [
6 b& T: a h! } {- V- I) O
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ; w6 T9 q0 i( i1 C2 V: ?
;will break 3 times :-(8 v( |, V6 ]6 r. a3 @1 K
2 G- e; i. w# x: l T6 Q4 @3 H-Much faster:
1 N: z3 ?7 S8 Y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* Y+ J1 Y; I6 n" n$ j+ p2 c, d; z
5 E1 U% ~7 ^( ~ ~( m N) ]) sNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ L9 A# ^! l1 \# i3 Nfunction to do the same job:
6 J0 A- C ~" e4 c
, h1 _, } G' [ a' ? push 00 ; OF_READ0 i$ C5 H, B2 J* }4 J J- H A
mov eax,[00656634] ; '\\.\SICE',0
1 I: z0 {" \1 t. U push eax
6 j3 ~0 G5 i' G; R call KERNEL32!_lopen& F5 N6 {' r, c V
inc eax
- O) W2 ~3 U% l+ X* d; G! c) ~ jnz 00650589 ; detected; G% ?% h1 Z8 s( j4 V! B6 y
push 00 ; OF_READ
; G% ^8 Y' |9 e" m; W8 ? mov eax,[00656638] ; '\\.\SICE'9 |0 g, E& Q; i/ Y& M( w
push eax9 p' d2 F r* ^% @+ e0 K" V' G
call KERNEL32!_lopen
$ f$ m1 C0 t/ }1 O0 b& z0 h, \ inc eax6 n9 w$ d8 o. {' r* M5 U c
jz 006505ae ; not detected
) j K0 O( k& g g! X, I9 \# O: p. K% i" L; a& p$ z3 F
& O! [. @( b" n__________________________________________________________________________
' _8 o* j# _0 p
0 K7 w: o; e2 o# f+ Z6 P _Method 12! T" W* {$ g, T4 v- c5 y% d x
=========
& v. b1 m- [. N( h0 a1 j3 s) l: [* ]% \1 e' c9 }6 m( D/ L8 E
This trick is similar to int41h/4fh Debugger installation check (code 05# o" V4 `% t6 }; y$ p9 o- ]( Y6 u% }
& 06) but very limited because it's only available for Win95/98 (not NT). E$ f* a; U4 f. d. [# V W
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: O/ @9 y4 t& e3 D& [6 ~3 P. m% m% R
push 0000004fh ; function 4fh
0 o8 @! T e e push 002a002ah ; high word specifies which VxD (VWIN32): Q4 |3 _# q3 G% t5 e* I
; low word specifies which service
8 ^8 T% s$ E4 w, _( ~ [ (VWIN32_Int41Dispatch)+ R% ~) J& b; P' [/ n! N% ]+ f% x
call Kernel32!ORD_001 ; VxdCall g5 Z9 O2 z* o' p
cmp ax, 0f386h ; magic number returned by system debuggers+ s/ y! l1 M, k- N" z0 T& n7 M$ P
jz SoftICE_detected
( S7 N0 Q0 m+ s/ ]9 t/ ]# N% b$ ]9 z
Here again, several ways to detect it:2 {/ c4 a7 ] X+ l6 d& T
3 H6 l' h% f8 e0 z4 z BPINT 41 if ax==4f1 Y0 G9 v" f6 w- ^6 L
1 M% `0 q) d3 E6 Z6 g( F6 G9 x BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 d( ]: w5 v9 I& I r) N; X' T
' [' s( z; M0 o BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: r3 T G& {0 @: d; Q t" p% i0 v8 |5 h3 n& Z
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!1 O8 J- G, E% ?! Q
$ g+ o2 [4 b* p5 B& d9 P__________________________________________________________________________1 S) ]2 e( L3 `# t* g8 t
" w( G3 i1 t2 t' v$ V9 aMethod 13
r! x/ D) ?. f8 i2 H( v/ S=========
# l6 K4 R6 n) o: }2 i9 w4 ~
9 B: V5 I8 f! I4 \ Z# W4 g: ^6 tNot a real method of detection, but a good way to know if SoftICE is
) g' Y4 N) h' }installed on a computer and to locate its installation directory.! s" t6 ? b3 D! m- }& a. w
It is used by few softs which access the following registry keys (usually #2) :( b3 A% y& ^7 n1 i5 p; Z/ m+ H
( z/ \# E8 k' d( h. Q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 V) ?* g7 I+ }: L\Uninstall\SoftICE/ ^/ s' ?/ G0 w6 I. @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
, ~+ N' s4 W4 q" ]) r; p6 Q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
n7 T) Z) P$ D+ R' @$ }$ h\App Paths\Loader32.Exe* n. }" a5 |6 C
7 b+ l1 O) D6 M% v
! Y: A3 L: Q1 C& N
Note that some nasty apps could then erase all files from SoftICE directory
2 S4 c& y, m5 J6 C- j6 F" N: f(I faced that once :-(
2 l D |6 l# V7 S
3 o) h: w( ~. u( TUseful breakpoint to detect it:
" m: Q5 q( O. ?& c
+ Q6 `* b! K5 h; A# o+ J BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'5 k% V- f3 X/ c6 p3 V
& t) d8 \) o# f__________________________________________________________________________( Q$ u8 i0 t, Q+ w- T! X( w
4 R Z0 X5 ?. ?; X3 H" b$ M' H- a5 a9 `6 `
Method 14
/ X) W& d' L1 `6 v6 K* r3 ?=========
5 X2 O3 c0 L2 f/ I* P4 O( H8 s$ m' z* B7 T. g: B
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose% S" b) j$ U p% K3 ~: Q
is to determines whether a debugger is running on your system (ring0 only).
8 b; P, _0 \& X6 n) B
' \" S0 L7 k8 V VMMCall Test_Debug_Installed; L t+ h' y/ o- J5 r7 |. y
je not_installed) r2 ?$ j7 F4 L# i
, M+ u% u; l) |" I* S9 _1 n
This service just checks a flag.
$ ^9 p! L1 v/ e# x- E" X0 e</PRE></TD></TR></TBODY></TABLE> |