<TABLE width=500>( N# B) J7 W% E; [! w6 ^
<TBODY>
& w. G9 O0 z, z3 m% {" F- O% g* N<TR>3 U4 }" M) {& L& g0 y
<TD><PRE>Method 01 - g! P% y9 d' s: q
=========
' [% ^8 ~# l* L" ]) B
4 t! n/ [& C+ e# I' z! y6 mThis method of detection of SoftICE (as well as the following one) is/ J; D$ {% f+ C$ a8 M* D
used by the majority of packers/encryptors found on Internet.) Q. @* \ d# C
It seeks the signature of BoundsChecker in SoftICE& Z- a: U& `1 x( a. U7 r) \ J
% \9 ?: T' J& T! {" D mov ebp, 04243484Bh ; 'BCHK'$ Q: o- [5 R1 N! F3 R6 X
mov ax, 04h& m, F% a) d) [' L; g5 d* a; n7 q# f% H! K
int 3 0 g1 l% E( X, I3 }# K+ ^# Q7 |
cmp al,46 c% w0 v9 v7 y0 C
jnz SoftICE_Detected
& m. }# i4 h& }( I, R$ C8 g
# H6 w3 H7 n" F5 c3 ` D2 x2 @$ F___________________________________________________________________________
: d4 U0 a S) W4 M4 \# ^" o- Q f/ J
Method 023 S- i4 l9 w/ A, o/ {
=========5 W5 }9 H9 ?* q8 D4 g
4 Z. i: z6 Q; ~3 W* P K0 y
Still a method very much used (perhaps the most frequent one). It is used; ^; G" Y+ _+ e% Q6 i% C1 a
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
0 p) |) x' o( e: b$ mor execute SoftICE commands...
1 U6 X. b: B% x7 I* QIt is also used to crash SoftICE and to force it to execute any commands2 N9 u+ w7 E( O$ t$ X' x4 A
(HBOOT...) :-((
2 e2 P4 T& f2 U1 R. X& L" `
! l2 R2 `# N6 D5 ]: r+ nHere is a quick description:2 Q. I5 [$ y- P0 N4 X/ F' ^' ^
-AX = 0910h (Display string in SIce windows)
4 c' P3 t, s( u6 I7 i p: K-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)9 L0 q! `" p" v+ S' F
-AX = 0912h (Get breakpoint infos)
* |: y3 ^6 [( s/ Z8 C' V-AX = 0913h (Set Sice breakpoints)
) Y8 u4 M, D1 \3 K G S8 @-AX = 0914h (Remove SIce breakoints)1 a) {# J8 s' L: b) d. Q+ s
$ V2 x3 d' x2 hEach time you'll meet this trick, you'll see:
! h z7 @. n3 L8 L. R- S8 m-SI = 4647h
8 m8 t$ @, S- f+ Q-DI = 4A4Dh+ d. ~# P) F2 S* u
Which are the 'magic values' used by SoftIce.1 Y4 }0 `" l; c2 m6 t5 A$ W# n
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
7 `: \! m5 ~9 m* u! A; I! V( `5 s& C& ^1 |8 ]
Here is one example from the file "Haspinst.exe" which is the dongle HASP
' r; W8 `% } V% a( P8 e. p: yEnvelope utility use to protect DOS applications:# f! Z' e( E4 K y$ `% ]; a
# S6 y* j1 J% _$ w5 M [
- a; u( R0 J4 n+ y) g
4C19:0095 MOV AX,0911 ; execute command.
5 f: [5 e4 {4 u3 y4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).. d W" e0 B p1 S5 H
4C19:009A MOV SI,4647 ; 1st magic value.! v1 W/ P5 ?8 z" a
4C19:009D MOV DI,4A4D ; 2nd magic value.
C, P* b; P9 t2 d1 O4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 ~2 O! S" Y2 Q* W8 K0 b2 a4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 f. W4 c2 d$ A* v0 I% ^! Q6 N- A
4C19:00A4 INC CX. V, P" x; G3 R/ _
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 `8 S. N9 _' S& V% G% S
4C19:00A8 JB 0095 ; 6 different commands.! F* E* g1 C ~
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: h1 T+ \& Y6 B" |; Y4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
) i5 X. o2 {9 t9 n+ U5 Y* ?- u- x$ z& u5 E& [+ ?% F* {6 s* h
The program will execute 6 different SIce commands located at ds:dx, which
q d* u2 X* @" L5 S U" |are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ P+ g% r5 k& n9 x
/ @5 _: V% _; Q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- H" R# c3 \/ m+ W: Z
___________________________________________________________________________9 _4 v* O( o* t0 W7 y' ^5 b
* u8 t( l% `* V* T8 U+ f2 W0 h
/ P5 [8 x2 X5 Q9 lMethod 03. v1 b# R: n. s" U# ^4 |
=========
9 Q) `: t# Q- N% w. X$ O( r' ]2 X Z; i( x5 ^! D' R3 K
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h `( x$ t' G3 P
(API Get entry point)
6 k* k( R- j* q2 Y. @ z) w0 t: g, Z9 e3 R. v0 d: T% v
; Y( K1 R) g) P xor di,di
4 p) d$ ], Q) l% o9 o8 E x mov es,di
/ T9 t" ]& N. R% g! m mov ax, 1684h : n- ]! F4 z1 i& {) b1 L: _6 K
mov bx, 0202h ; VxD ID of winice/ b# A& |9 q9 B9 d4 ?% ~
int 2Fh& ^- ]$ }- O! f w6 r
mov ax, es ; ES:DI -> VxD API entry point
! \- w8 X' n: O( m; y; _5 D add ax, di0 N* }8 C; M- G8 N: j f3 [- S! Q
test ax,ax
4 R' n {' o; H" K3 e jnz SoftICE_Detected8 a" o d& b$ i, g
, |4 P5 s1 D" D7 W( H___________________________________________________________________________! K0 x Q1 `4 w' \" M) P
: c H8 }! t8 F" ~Method 04. w) Z/ e) F6 k q
=========
# K6 S8 d; c( M; X* t7 ]8 l1 S$ F7 \7 u% }8 Q! O- W1 ~
Method identical to the preceding one except that it seeks the ID of SoftICE3 N' X% a" |% i& |) A( {6 [5 H: Y
GFX VxD., n! N: P3 w. H4 R4 S9 U/ i9 |
9 _% v- I+ @& f$ Q3 Y% t
xor di,di# g+ O! s) u" ^# u! n
mov es,di
* x, K4 F/ O% O mov ax, 1684h
3 M* K: v3 [, S' Y7 d/ l4 U! {# } mov bx, 7a5Fh ; VxD ID of SIWVID
3 T- R+ C! Y4 ^ int 2fh$ L3 \; k0 Y# \5 Z- ^
mov ax, es ; ES:DI -> VxD API entry point+ E; y1 u W' P: e
add ax, di9 [2 B+ I7 i* m9 M" b- z
test ax,ax
- N( }$ ~1 I4 b0 \% {- @! m# N jnz SoftICE_Detected
) k( r! L7 s3 {4 }4 B! N2 @- ^$ Z
__________________________________________________________________________
' @6 Z0 A( A) d0 g
) o! L+ p2 N" T4 ~! ~1 ~' ^
! v; C) `. `% p& N$ E9 U7 BMethod 050 r+ S* o3 c' J: I& K" a3 l
=========
! ? ]2 b1 b1 [+ c" ~. Z1 F% T+ a
- t, I1 H; w0 f8 i: O, f* {Method seeking the 'magic number' 0F386h returned (in ax) by all system
0 m0 P4 E5 R/ C5 @( K- X4 z* h: Rdebugger. It calls the int 41h, function 4Fh.
{6 _/ f/ E) `/ B' r+ o% YThere are several alternatives.
, p0 x1 Z, `& J; s1 y& J
% r) y/ a O! b# K& s/ gThe following one is the simplest:( K% a7 s( O' ~( R9 @% n0 T
% {6 I3 o$ u& b+ X" H
mov ax,4fh
4 G% w- S/ X8 a( D0 K! e int 41h, Z. q6 X/ Z+ b5 h
cmp ax, 0F3863 E' p$ {1 ?7 r. E, _5 C, V
jz SoftICE_detected* G: e1 s1 q/ o1 ?
5 \! T0 @& w/ l
7 {5 p+ \% [6 ~& E! RNext method as well as the following one are 2 examples from Stone's ' S* W. q5 O2 m' T( u2 I6 m
"stn-wid.zip" (www.cracking.net):" [) Q1 I# A d- Q( @
' p* Y' ^, H( V% T/ Y m8 F8 h mov bx, cs/ h4 I1 s& V2 ~6 {4 D
lea dx, int41handler2, ]. g& y$ {7 j" `' I
xchg dx, es:[41h*4]' Z' b9 H8 d: `$ [# ~3 p! k: i
xchg bx, es:[41h*4+2]
1 A/ [8 V% a' D* D J5 E3 H" E mov ax,4fh' m% O- ~5 k* f% n! ]5 x" `$ G
int 41h( Z }' _. V2 r3 O! S
xchg dx, es:[41h*4]
6 E$ G5 e! C. l: `8 r xchg bx, es:[41h*4+2]0 ]* W/ N2 t' k, k+ T
cmp ax, 0f386h" G4 i2 m) n' v: R4 F( x9 Y
jz SoftICE_detected
8 p) \2 @% M! R* m. ]8 Q4 S6 g
/ b7 N3 _% X- C; g8 ^int41handler2 PROC
9 h2 Z6 Q" U7 d( r$ h2 o iret* B# G' N$ ?, J5 G
int41handler2 ENDP
0 N! Z# L, B: P5 f, V4 F
; A2 h+ B ~5 b- J* l* _9 o/ ]+ T5 `+ g% p, S; k0 R
_________________________________________________________________________, B: E0 k3 q8 v* J) J/ A7 w& o/ E) i$ s
" E% W8 ~0 H0 b8 p0 M8 c8 ?6 D3 W) R
Method 06; j, M3 ?6 V1 H* ]- o
=========
0 N8 Z- n3 Q- g' `9 h* X7 [, X, B9 l& C# H* m
* j" x( ]; b; G9 c2nd method similar to the preceding one but more difficult to detect:
# x/ M! f) c; d% }; X/ g. T+ h2 Y
1 U4 A0 K" f) s$ F a/ z& g+ Bint41handler PROC9 J. k% K5 R0 \
mov cl,al
9 k, A6 f& [# U. F, k iret
$ d5 r# v! X9 t8 ]* b; eint41handler ENDP8 d3 i. D# T ^4 j* N
/ P+ M& q _% O! E- _/ Y: J7 p% V
; Y0 }* o4 @+ y1 |: F
xor ax,ax# v4 Q- g6 S5 a' D' z$ Z+ j
mov es,ax# ~5 _2 a2 b- v8 Z8 M. K+ F- E
mov bx, cs5 Z! @1 c0 w: j$ G. a( `, o1 ~
lea dx, int41handler- i% I7 q0 k! u: `# T- ?6 v
xchg dx, es:[41h*4]4 G/ h4 i$ [2 y1 D u
xchg bx, es:[41h*4+2]
% a g' ^2 \, |6 F/ w0 \ in al, 40h
+ @' ~+ c l- D( W2 u xor cx,cx/ e& n% M$ F! ?5 b! G
int 41h
4 ?1 n' d; W9 u" I8 P/ P xchg dx, es:[41h*4]3 x( v" t, y3 w- _! W% Y
xchg bx, es:[41h*4+2]
! p( @8 K6 X. \# J1 j cmp cl,al
# ^ i8 U2 Y7 k7 h5 f jnz SoftICE_detected" o' e0 B$ F5 G$ F8 ] T% A+ o
: X. U" G' A+ }/ I$ v2 F
_________________________________________________________________________. ?2 l" w' ~1 f7 o
: ?, U ~8 p* M# {Method 071 L1 l' q. u% k E. d+ [, [7 j
=========
5 S7 _$ m9 d7 c' v4 j) M- N/ S: z. |& z: H+ E
Method of detection of the WinICE handler in the int68h (V86) ` ?& Y$ _" g% ]5 y! ?. Z: B
( e s. e: H% U mov ah,43h2 `" z1 T! z! F8 k& ]" U
int 68h
1 N4 j! E+ K6 B0 X cmp ax,0F386h
1 L5 N+ V, Q7 U8 _& T7 G6 c% `/ C jz SoftICE_Detected+ O/ C) O5 ~+ j. b+ K' ~, f) x
% P1 w* e; F4 ~1 Y* i
5 H- [ U/ H$ ]: r. M" Q
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: I( _3 U. Z$ q app like this:3 o8 P A4 I; t( V! ^
8 q0 j1 ~+ q$ G: e: D
BPX exec_int if ax==68
; ]- V, Z: B* d7 ]% n6 x (function called is located at byte ptr [ebp+1Dh] and client eip is
: l" m3 x: |* Y- Y located at [ebp+48h] for 32Bit apps)
" Y8 A9 B, I7 M J T$ @__________________________________________________________________________
" l# [- R8 b/ `3 @3 `6 J* n* e9 `4 o; o* j" a
" H; I; O4 ?' D+ {: RMethod 081 W9 H4 b$ s5 ~" Q
=========, I3 w- b& T$ G
' Z% ?8 |# G- G/ Y7 ?" D
It is not a method of detection of SoftICE but a possibility to crash the
% f8 @% d1 ?% W1 Ysystem by intercepting int 01h and int 03h and redirecting them to another% m. x/ y. B7 I5 X
routine.
, U Z, ]5 \, `3 S# `0 ^It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 L+ _. M* g* L0 \
to the new routine to execute (hangs computer...)1 ^: T1 d6 z) S2 Y0 ^
" c" E# M% x8 f0 M
mov ah, 25h' B& ]3 H* {9 D- i e5 h6 w
mov al, Int_Number (01h or 03h)
" L: L2 ]4 B6 r3 K4 W mov dx, offset New_Int_Routine7 \" V, I+ B, o! `
int 21h
# Y6 [$ U5 w. B7 J& M4 U0 Z1 J8 r! D5 S* [' h, k$ j
__________________________________________________________________________2 }8 h6 o8 [7 h+ A' N
: A% _ b' `1 @, R, [; v
Method 09
1 c3 b/ ]. N5 s9 b, t9 a=========
* p3 N" X" H1 e; A7 C& q* y5 Q3 P
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ ] G! Y6 j: E# e" S i" S
performed in ring0 (VxD or a ring3 app using the VxdCall).% O+ S$ F5 S H9 D- a
The Get_DDB service is used to determine whether or not a VxD is installed
5 ~) t; o& w6 Mfor the specified device and returns a Device Description Block (in ecx) for8 x* Z; O, {. m6 q/ T; a- y% n2 M
that device if it is installed., P4 n8 A% X) r# x" _# A. V! N/ C
8 d% b$ L& `- O9 J! F: Z mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ K1 f* G( l" U: A$ X {) c mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
8 c* `9 W( d% e$ b VMMCall Get_DDB
) s3 ` k6 R; j mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 s- W. @ a( P% X. g; S0 h s" J3 q
Note as well that you can easily detect this method with SoftICE:
, r0 a/ q `6 u4 }9 U8 _3 R l( }0 O bpx Get_DDB if ax==0202 || ax==7a5fh
9 S3 p# O! q: F: |* C! N6 s8 B0 V3 T& e z6 a: \. h M l; g
__________________________________________________________________________8 p5 W& @7 I4 }! @4 t
, T1 m% f) F: x. q9 X9 i7 p3 h6 g
Method 10
( g8 C# l6 }# ^6 R=========4 a" e: R9 i6 Q6 U. I
6 T f, j; p7 _) U1 |2 m=>Disable or clear breakpoints before using this feature. DO NOT trace with& D1 N% G" l3 k& n& y- x
SoftICE while the option is enable!!2 X& L' X! `' H3 a
2 M9 m# S' C0 S. i
This trick is very efficient:* x( I' `8 @3 K( L/ j
by checking the Debug Registers, you can detect if SoftICE is loaded4 x7 |" ^/ z% z7 }9 L- s& b4 l8 z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ ]$ Q7 p3 G' }
there are some memory breakpoints set (dr0 to dr3) simply by reading their
+ [( p0 h3 ]: I7 a* Rvalue (in ring0 only). Values can be manipulated and or changed as well
( e/ S" l- ]+ @" u/ k(clearing BPMs for instance)( Q+ k5 l2 _) D4 f9 x/ ?1 S
- {, l8 O* N! z; W: E6 `( b7 V; [
__________________________________________________________________________
% d* g$ ]( f' o9 k, s2 V r9 g( s/ \# R0 H6 U
Method 11# g% E' C6 n& n3 D/ b1 h: I
=========
0 d6 y6 T" a5 V3 p' p( C; W- V Y2 A! B/ p
This method is most known as 'MeltICE' because it has been freely distributed& z; o& x' y6 ^! v
via www.winfiles.com. However it was first used by NuMega people to allow ?, Q& [/ ^, B/ x% L4 B
Symbol Loader to check if SoftICE was active or not (the code is located
" C! d- ~2 I( E( t+ a/ u3 Sinside nmtrans.dll).
5 u# M) w8 \, [. I9 j( B. ~4 c6 |8 ?
The way it works is very simple:. P! }4 R- _2 D, k7 @" c1 L) i' H
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( S$ [2 P9 R( B$ f! a9 ^9 W% g( r- PWinNT) with the CreateFileA API.( c5 h1 u5 _/ M: U+ n: d
2 n7 y2 V) S7 [; I5 H9 @Here is a sample (checking for 'SICE'):
+ j8 f7 ^9 d! c& Q; ? I- D5 r6 I' ?* `$ t0 ^. k
BOOL IsSoftIce95Loaded()/ Z9 }5 p# z8 {5 M* p. y% `9 V4 R
{
4 P) W+ c1 |3 v H/ K HANDLE hFile;
: z% _$ E4 M, `. n" E i hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,8 A3 W8 x4 o* J. v( t% T5 m. U
FILE_SHARE_READ | FILE_SHARE_WRITE,. d& H$ S1 J, a6 p; S
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
9 N+ Y K! v3 R1 _6 W if( hFile != INVALID_HANDLE_VALUE )2 u! w4 \3 ~, b3 K0 Y
{9 r3 }- c$ i/ f X$ x/ C4 J- H& v2 c
CloseHandle(hFile);
) R X$ c) b8 W! Y; K4 I return TRUE;
4 ~; U' F4 T' J' H }
" l5 W' \7 [8 h, |% b return FALSE;
, W! I( A. C# T0 K! W& v* ^}
% m6 I+ I! |" N1 q, G3 Q) W! H0 J; ]% J0 h3 q* G
Although this trick calls the CreateFileA function, don't even expect to be( O/ O# }6 |% M
able to intercept it by installing a IFS hook: it will not work, no way!
/ ?# P* }3 c# E" r; V* X3 QIn fact, after the call to CreateFileA it will get through VWIN32 0x001F, k* ~( q0 n" r) K
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" r$ p8 G2 O8 @and then browse the DDB list until it find the VxD and its DDB_Control_Proc
4 _2 V( S" j% f5 T* G9 ?* k/ f$ C3 T" {7 Hfield.( I l8 d# o8 R. X& w3 j" B& ?
In fact, its purpose is not to load/unload VxDs but only to send a 1 U$ J2 U3 }# o0 y( @2 u, @8 U- V
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- d( e4 {6 d$ {% F
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 q2 q" L. W6 d/ A7 vto load/unload a non-dynamically loadable driver such as SoftICE ;-).' T6 n( B, ], h! X. [4 T V
If the VxD is loaded, it will always clear eax and the Carry flag to allow" `1 d3 e6 F ~6 d. p, d
its handle to be opened and then, will be detected.
8 F5 e8 m; K. @5 {6 YYou can check that simply by hooking Winice.exe control proc entry point" d% f' G- O/ ?. X8 A" e( h2 ]( K
while running MeltICE.( g2 P% H+ I; F1 E5 x
5 |- R! s; n7 V2 |9 J. ~4 E
- J, G2 b9 ]+ w- z2 G- X
00401067: push 00402025 ; \\.\SICE
* D- d }/ J/ j 0040106C: call CreateFileA
3 o+ e- v* Y0 V5 O% \2 y) e$ v$ M 00401071: cmp eax,-001% F4 r. Y, h$ f6 g
00401074: je 00401091
9 k- G% z3 J' f& X/ j p: w
9 N) B0 Q& }4 l4 i. ^ W& C1 G4 V, }; m# i, o: H- n
There could be hundreds of BPX you could use to detect this trick.
+ {5 X9 z2 P) `3 Z+ L- `-The most classical one is:
; _( D! L; u* s+ r, U% f3 {, q0 T BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
; t) ^/ e, @/ _2 N0 z+ p" A *(esp->4+4)=='NTIC'
( f: [5 x* R j/ I7 ~' _
" I' F: L6 o+ J: r9 ~2 W, G7 s" R5 b-The most exotic ones (could be very slooooow :-(
& p a/ x' ?; j X- n) K BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 2 a- |5 }* g) Q( {" |2 _( v
;will break 3 times :-(
) t- V( `$ I W3 f( |
' a6 Q+ @* @, I7 e! \-or (a bit) faster:
" m- Y6 L& b. q# ^- o# K/ a BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 M ]: O) ^/ [) y1 y+ V
) C' k, @ R$ X Z$ R2 n, P; I S: b BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 i+ U/ E8 S# K- l- A$ F" X
;will break 3 times :-(
4 e" i+ e5 d9 M8 @' k% W9 `* Y( Z# o& x; v- J. P; u. z& O
-Much faster:
* \+ B* I- U8 f8 U) T+ j BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# F/ B0 `4 }/ |5 U( G8 H
) X! n6 ~& H; x+ M3 s/ {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ z3 `9 c7 i% I% b( Tfunction to do the same job:/ N3 J2 {) f. T- C
, V# T1 j% e B push 00 ; OF_READ
2 q2 k8 F' _- R6 L: ] v, I mov eax,[00656634] ; '\\.\SICE',0
: B- L9 h6 o, U" F push eax
: [0 {/ Z( ~9 U4 V' p call KERNEL32!_lopen0 j7 z4 u3 r4 H t) g" z" [
inc eax! C; R- I2 L/ C4 q5 o0 S# b, e
jnz 00650589 ; detected
$ O3 J4 ]4 _5 Y- }+ Y$ j push 00 ; OF_READ
* I- k$ V# N) r( z2 [5 E( j mov eax,[00656638] ; '\\.\SICE' ^9 G) {8 i* d9 k1 c+ i! u$ d+ P
push eax* f: b- `! X1 I! t% |' b% {5 a$ |
call KERNEL32!_lopen
( x0 \ l# A/ s9 |' O w inc eax* ~1 Y$ I, d- G5 Y
jz 006505ae ; not detected- \/ F9 I$ }" [1 I- L' [* R2 }; U
3 I' p5 o& a& K$ \, }5 }
) Z& H* k3 D+ v) k3 c& N$ a4 U
__________________________________________________________________________
0 j( Z5 a8 O) B# g' F
5 I% v9 d3 R, n. j) @; w" U: b4 rMethod 12$ ^2 q8 P3 c0 [# N) x7 P V
=========
. R5 g0 C( {) c2 X0 n- R7 B0 P& _8 z6 W
This trick is similar to int41h/4fh Debugger installation check (code 05
" J( z4 ?4 y! d- c! B% o& 06) but very limited because it's only available for Win95/98 (not NT)
1 a! n7 L# {3 Z) b2 Y7 i& M& uas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 X: V7 V) s1 A: p( b; c# D: p2 V% r* G% {3 l; O
push 0000004fh ; function 4fh; A q# C/ ]0 v! ~
push 002a002ah ; high word specifies which VxD (VWIN32)0 ^* E3 O3 a0 i% K
; low word specifies which service9 I( ]3 S4 _* v$ |
(VWIN32_Int41Dispatch)
/ t; `( `) J5 w$ G: ] call Kernel32!ORD_001 ; VxdCall4 Z% @' I% I3 j1 z0 ^1 [2 {9 y
cmp ax, 0f386h ; magic number returned by system debuggers, u+ P4 r" {% i, L0 n y$ i6 V
jz SoftICE_detected
" D, e! P' H- k3 w5 `" _' X
. n1 n4 e8 E3 Y4 b/ p: q8 ?Here again, several ways to detect it:' t. E7 j5 C) Z4 r- L$ j0 E
& _7 X& ^7 `: K) i- [- T. ?
BPINT 41 if ax==4f7 k- G; @: c- P E) _
0 B/ q/ x/ M& v/ b, L BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
' Y) @ ~/ b" A" C' G `; `' j( K* u. ?) k% k2 |1 C
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A, h( F! O. M" y
: d( W) ~+ q& z$ y1 @
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!& s' R8 _" R0 Y0 [
& t7 R) f8 |$ k3 B__________________________________________________________________________
; E. d5 w1 k/ A1 j/ Q! @6 C) J& [1 O* H2 l5 h& Z5 g; T
Method 137 T, q8 c# \" R' |
=========
% j' [ t% T0 c# q4 Y8 ? k( m8 X" P: N( u- n# f: ~! u* g/ Q6 t
Not a real method of detection, but a good way to know if SoftICE is
" K! Q; r0 w- j' e1 einstalled on a computer and to locate its installation directory.
2 S$ g# U, e& d5 J: gIt is used by few softs which access the following registry keys (usually #2) :) [& z3 X" r) { R" n2 q
4 M! y D* L! a2 }" T8 U: O2 P7 t& j-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: q7 x X! Q: M
\Uninstall\SoftICE
5 V0 g' |4 R, r0 B( {7 ?8 J! r-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
. G5 f- V6 Y. v-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 n: n/ K0 u" \" A' b
\App Paths\Loader32.Exe! Y; A. i( M: y2 D2 G
/ ?5 v: @$ w L+ q; `, v" H
8 X2 _5 x8 K. ANote that some nasty apps could then erase all files from SoftICE directory
: Q c/ N. n1 G5 l8 \(I faced that once :-(5 p5 m0 X1 @* ^+ j
5 m4 E8 G4 @7 r" Y; RUseful breakpoint to detect it:2 J# b' a6 G, B6 D1 z. q" j
4 i! B: S1 u6 T' U0 \4 ~2 K' p
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
, W- o0 R; j. t* |, a
) X" H, ], R9 S6 G__________________________________________________________________________: E0 ?( Q& D, }* F2 N, h& X5 j; {" R0 w
8 O: b: T* w( x, Z! F
* B5 u, s2 p) _! q0 A' ?
Method 14
# M, y# x7 g4 a N$ o* R" r=========
+ p! q* O2 V$ Y/ t+ A" p$ n, G' ~
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* w; K" S! m4 c( P* K3 pis to determines whether a debugger is running on your system (ring0 only)." x- X+ ~' n0 m# _- J; j1 O8 l6 P
/ X; u& O" ^. L- A5 U$ ?
VMMCall Test_Debug_Installed1 H p: p/ `5 V: T
je not_installed5 _- d5 W; w( b- H# E1 V7 g
* X1 K7 V9 A# A' s% F$ M9 F5 CThis service just checks a flag.
- u2 _$ K% _/ ?' u1 ]& v9 m9 c</PRE></TD></TR></TBODY></TABLE> |