<TABLE width=500>. _' }9 Z1 p# i2 W
<TBODY>
; z/ |, P* M% R- h, Q3 U; e<TR>
8 _4 ?1 X7 C$ _<TD><PRE>Method 01
* u. T# I' ^7 I0 c=========
$ A! [) R; f7 O7 `+ U) o
V3 W- Y/ d3 J) V, O2 aThis method of detection of SoftICE (as well as the following one) is
4 }6 x5 `2 z6 r* F6 R1 p+ gused by the majority of packers/encryptors found on Internet.: f: V7 ~0 G1 D: C: M
It seeks the signature of BoundsChecker in SoftICE# @7 Q* @, `% S) E9 l8 Z
: U# ~/ y b9 Y: j0 {: K, c5 L* x$ s mov ebp, 04243484Bh ; 'BCHK'
) z# r" _* D. @1 Y, ]( j mov ax, 04h
" x* \: z: e+ W5 F0 M d6 I/ ` int 3
6 H" t+ Q+ e0 V5 m3 f7 W cmp al,4
6 x( j: ?( S; N% b9 |) a jnz SoftICE_Detected S O- G! C: g6 p6 W$ U
3 U5 r+ W* ]) X; ~! O
___________________________________________________________________________
- A( i C6 D1 Z# d- H; |2 N
' ]+ t7 c# y* ZMethod 02
" q0 H9 o7 H* Q9 u* A* E% g1 Z=========
6 x. j! ~, e p/ f) w
8 j9 a5 [* o8 p9 h! gStill a method very much used (perhaps the most frequent one). It is used
u) z# m+ _( oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,( t" Z0 u2 W" D1 h( ]& T
or execute SoftICE commands...3 a w( T* [4 E$ p( b5 T2 \
It is also used to crash SoftICE and to force it to execute any commands
* I2 s" a! ]. N. s3 W g(HBOOT...) :-(( # a! L7 P5 z. L5 O. y; a
1 P) N1 \7 t8 r% B: ^Here is a quick description:- r! p- L K2 n* T6 ?8 _: E! ^
-AX = 0910h (Display string in SIce windows)2 j6 `/ X/ J( D+ s4 ]
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 s& F N9 I% Z4 n
-AX = 0912h (Get breakpoint infos)
8 N# T D6 Z+ ^0 A-AX = 0913h (Set Sice breakpoints)
$ k8 `6 Z5 u. K9 @) l9 S" b-AX = 0914h (Remove SIce breakoints)0 A. P* b+ s% b4 N% x3 Z
+ s- \* w# z/ Y
Each time you'll meet this trick, you'll see:1 f7 f i5 a# L# V
-SI = 4647h
- V2 I* M. N/ ~0 H; p-DI = 4A4Dh; o! u9 J4 H; U4 E5 t; O2 W3 x& R
Which are the 'magic values' used by SoftIce.
z$ c. E2 k4 Q9 E7 N! ZFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; h& o% {+ a5 T. g& l
% n. X8 F9 K. I0 h/ D0 i% IHere is one example from the file "Haspinst.exe" which is the dongle HASP
8 a* c' l" `* B" V4 j. ^: [2 kEnvelope utility use to protect DOS applications:
. {! H- ~, ?# I5 H( Z
( P) ?$ J* |3 `! I
; d& W4 K1 o8 b6 I R* [, v+ }4C19:0095 MOV AX,0911 ; execute command.
/ y+ t! p, F3 b/ M0 }- c4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 q3 q' v4 ?4 z! c# A4C19:009A MOV SI,4647 ; 1st magic value.+ W+ f) X* i3 T6 I
4C19:009D MOV DI,4A4D ; 2nd magic value.
3 u" b8 d" v9 Z/ ?+ s" k" x2 x4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ N. s# B) \' ~0 M9 M; c
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
$ |# ]1 {2 Z: S8 M& Q. o) V L4C19:00A4 INC CX
0 v* X2 {9 T6 Y4 a$ O4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, ~; ?: y2 }; L# B3 |- g2 J
4C19:00A8 JB 0095 ; 6 different commands.6 e3 x q& O \7 T4 c- A
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
7 c9 G0 E! R3 t' A* @. N4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: k2 T+ H; A8 r1 }* ?0 w& i5 O d1 Q6 g4 E( `4 D7 V7 P
The program will execute 6 different SIce commands located at ds:dx, which5 `3 d) T+ `$ U/ _. m5 G
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
k6 O! [( J4 K, _. S E" @1 n
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 N2 z# v- I& j
___________________________________________________________________________
& P' P7 B; f3 q4 |4 d2 T4 E, B% ]4 Z" k7 ~/ N0 a* T- C* b. Q
( N& z5 l; c; E0 N! t, h: h2 f
Method 03
" v3 u- R3 o. ?! i========= v4 e% n }$ Y7 P# O
+ Y* p' m6 R7 q1 C; Z
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' o5 r; T! v1 C9 _; l/ V2 D(API Get entry point)- ]+ S( f$ @. M$ t
0 _4 o9 \. F+ K' e g- `
/ o# t4 @, X6 m1 G5 H8 Z8 S
xor di,di
' X3 p1 u* @* L" o mov es,di, q6 @+ k; y; T! {. Y
mov ax, 1684h " p. v* J2 _! T0 i- M4 A" q
mov bx, 0202h ; VxD ID of winice/ E! O4 a# T( n$ i* ]; O' q
int 2Fh- a) }. c1 o6 @& L$ D6 y
mov ax, es ; ES:DI -> VxD API entry point% S) v1 Z& l4 x
add ax, di
' O: X) G9 ?# D3 R5 g' D6 V test ax,ax6 W4 q3 O r f" L' r- Z7 Z
jnz SoftICE_Detected
4 D5 t: W- o+ P
+ D# x) x; b7 w H9 t___________________________________________________________________________8 [) Z! A; ]0 {
% q/ ^5 Q& @7 J, i/ D. O
Method 04
% r" D V( g* `4 R=========( p( x* t/ k6 q& C5 e
- B; Y# v& C& p5 z _4 J
Method identical to the preceding one except that it seeks the ID of SoftICE
3 y( I- {7 v- Q5 c s$ w* S, tGFX VxD.
' W* j* j" {, J! r; ~0 D
4 ?# S4 T9 k; L% d xor di,di6 e- j! y: P( h$ ]( j8 _! b# E
mov es,di
$ m8 F$ R9 g! i' ~2 N* u mov ax, 1684h . s7 ?% ^( w$ H; \% i, [) q. X8 G
mov bx, 7a5Fh ; VxD ID of SIWVID( W( [) T( m y& n. W4 B# k' C
int 2fh- t/ r/ v2 f6 X+ j
mov ax, es ; ES:DI -> VxD API entry point
3 I6 P1 _% Q9 w5 ? add ax, di3 V: c E+ V6 m$ B- T/ Y
test ax,ax
" r% \9 [9 |3 z5 \$ N' A u jnz SoftICE_Detected6 h, M6 [. O! u+ l- I$ N# {* F
. ?( Z& r) t! H' D& u U1 `__________________________________________________________________________
# m; c3 `6 E8 p; p/ i/ n, O
7 C" P1 C/ c: Y; i
6 u, I7 R) D8 d2 [$ E( f) [/ DMethod 05
& B6 |" M6 _( M/ r9 b. {5 F7 G' v=========
% Q8 L$ ]* E( M7 \) v" `% Q3 t2 e
) L$ ?& c0 _/ \, [Method seeking the 'magic number' 0F386h returned (in ax) by all system* ^) q# M: P! X' Z
debugger. It calls the int 41h, function 4Fh.1 ?0 F( J: |' H6 {3 Z2 K1 G6 {
There are several alternatives. $ \8 p- i- m7 r
, F8 }( v1 d/ m- Z5 ^- s$ E4 C) o
The following one is the simplest:
, ]# l, _+ @! P- S- _
; I; H: V5 h; h. l8 H C! g mov ax,4fh
R# i3 J3 W3 u6 ? int 41h7 W( E( C( b/ p( i: B% I8 u
cmp ax, 0F386( O9 h& `- }$ a: n# o
jz SoftICE_detected
' Y/ \, E, y1 v
& r& e [( }7 R0 |& d w- v- q6 O
5 I3 K; O6 a e6 N0 INext method as well as the following one are 2 examples from Stone's . e. f( h. b4 O" [7 V3 f
"stn-wid.zip" (www.cracking.net):
: [$ M9 H) S3 _* Q y& Y4 u
" c. i u& u! J" L- |! S mov bx, cs
8 B* A- u0 m' ~ lea dx, int41handler21 D- _: E$ z6 ~& b! T4 Q; F+ \6 l# [/ u
xchg dx, es:[41h*4], v" f' f: D9 ?& w& l3 l
xchg bx, es:[41h*4+2]( I7 }' \* Q& ], Y8 |% }2 b* K0 Q
mov ax,4fh1 h* Q( U$ h9 T4 R
int 41h5 G$ S. E( q" l+ Z8 U, r' p
xchg dx, es:[41h*4]
6 g3 \- C) ]2 o: { xchg bx, es:[41h*4+2]* o6 g7 q6 a5 u3 G/ B
cmp ax, 0f386h
4 w* K6 ?6 {% ]5 O1 C jz SoftICE_detected0 m5 E9 n- P5 D, X* b
8 ]3 p0 y, O3 I" I! A3 l
int41handler2 PROC( ]7 k h0 e) O% ?7 a
iret+ i* x2 Z: A' s4 `$ J" U
int41handler2 ENDP
* N7 t3 o7 k0 G- Z9 B/ T8 W' o2 q5 h- n& a, \/ j& s7 }0 n. e# ~
4 T& K' \- A6 s* ^ _
_________________________________________________________________________
. T$ f. ~* ]$ Q
* K# j8 k/ g9 O7 ?+ G6 ^% ~4 u6 Q5 O7 u* T
Method 06# U. G U& S( P
=========8 @1 e8 ~. h9 Z' e
$ r- Y/ D: d8 F' y
& |3 l6 c" ^/ ?9 f8 B, x; I2nd method similar to the preceding one but more difficult to detect:4 b4 G* X6 Q9 A6 S# z
- z7 X/ G' r: @5 P8 Z% `. K
Q' W, l P# D, jint41handler PROC8 s" t% C @) {6 r: d" @% k' P& ?
mov cl,al
& z% h, [7 m9 j5 s' v' O iret8 f/ z0 {' C/ ~$ F% O- A/ Y
int41handler ENDP, F t2 r& b7 f/ C
2 H$ S) @3 o9 B) x
6 T, Q* W0 u. U4 m; j
xor ax,ax
: f$ G# S; q3 P" ?0 q. m$ K3 `! G+ D mov es,ax2 |' M( J* `5 U& `8 [( i
mov bx, cs
/ p- ~ A7 e% b/ n$ I2 c1 C6 { p lea dx, int41handler
3 @8 {5 ]9 t/ B6 m; ^0 F xchg dx, es:[41h*4]3 D! j. z# L2 ]5 H0 f) p
xchg bx, es:[41h*4+2]8 o- Z: Z1 R% [+ e
in al, 40h
& K& U* l' Y3 x- F, n7 [, } xor cx,cx% }( e- b6 o4 [* R; J
int 41h' X! d% k! F* z6 W5 @3 X
xchg dx, es:[41h*4]5 n8 L4 t* d# n
xchg bx, es:[41h*4+2]
9 y& o& m. T1 p( T' F/ a cmp cl,al$ @8 `2 d" @) R& K! t0 T6 |
jnz SoftICE_detected. u7 p& @' z6 Z, Y
9 r2 O4 z/ J: h/ T/ g% l_________________________________________________________________________2 B% R( ?# x: G
! z+ H$ p0 M+ r9 f" Q/ ^9 o: YMethod 07
. _9 N5 p* q# b3 J=========
6 S/ F2 {7 X$ a. V/ U/ a0 |6 D
% n7 s/ o0 V. C' U. H. JMethod of detection of the WinICE handler in the int68h (V86)
: X+ I5 v, C/ O9 x2 c/ O; X1 l4 F! e8 w B* q1 l
mov ah,43h
8 G) A) X; l5 u* K7 m int 68h
/ G* q2 ^# v7 N, X cmp ax,0F386h
; S4 Y* u2 R5 x9 O% M. [1 S6 s& l, w" @# F jz SoftICE_Detected
6 y; d; s1 z6 k& z) K* }) Y: L
( `' W* |: P+ | H. Z6 I) t=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% {. e+ \/ [* R1 i( v& X app like this:8 v4 i' s8 m/ E! r
. Z7 ^- _' m7 b3 y4 j% P2 r
BPX exec_int if ax==68+ d9 I; ]: T( m1 }
(function called is located at byte ptr [ebp+1Dh] and client eip is5 a) A! [5 S; H, I+ S
located at [ebp+48h] for 32Bit apps)
8 H4 Q4 O8 b, S5 o7 m__________________________________________________________________________
+ K5 |& w6 ]7 c( |9 G$ e/ C2 C0 s s6 u; c1 `& ?# {
9 b7 o+ p2 x+ R! BMethod 08
! s5 \3 o9 E( Y# X- B$ [=========
( Q& O, n3 Y3 S& i/ \4 }( j/ x0 ?7 b D, v! W- n4 Q) n2 K
It is not a method of detection of SoftICE but a possibility to crash the* c5 h+ n1 j' C0 R" o
system by intercepting int 01h and int 03h and redirecting them to another8 ?+ ~4 s8 y; z4 H6 d. I. k) r/ Z. Y
routine.
) t0 K' c2 g+ g3 QIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points2 X. ~; S8 h2 U, {4 l6 l- a
to the new routine to execute (hangs computer...)
% L" r y K: v! i
' ?) \* y) n, K8 X mov ah, 25h/ @! u- O5 w% }+ a3 z% z0 K7 U p) z
mov al, Int_Number (01h or 03h)
6 h: G& i" L9 W6 S mov dx, offset New_Int_Routine! F9 ^/ O" f6 A H: l
int 21h
* b+ t# n. z* x0 t* ?5 _1 Z# C: V! |7 R* e5 g2 z. @
__________________________________________________________________________
% Y2 s- Q2 E) {, J$ B0 Q
% y. b, w; j/ h0 QMethod 09" Z3 z9 U; X5 |2 A* h3 r8 U. S0 O
=========
% s& w5 Q3 R0 ^' p0 D' a
! o% q: ]3 D h7 h- m, nThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, t" E% ^- [0 Yperformed in ring0 (VxD or a ring3 app using the VxdCall).7 m ?7 x/ G) N, B% |& N4 B- i
The Get_DDB service is used to determine whether or not a VxD is installed( F8 K1 B' q0 n" s# b. u
for the specified device and returns a Device Description Block (in ecx) for- {6 _. T* Z0 s; `* O5 s
that device if it is installed.5 t/ t# m, `$ k" @
% k( `$ J# K! t, y6 h. o3 p/ f mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 x2 X3 ^. ~, | mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- U0 G5 ^) D1 z$ B6 o VMMCall Get_DDB" L% J% h, H8 C6 n' R
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 @; k# u* Z7 @5 J7 V& \9 _' a& z9 i
Note as well that you can easily detect this method with SoftICE:
* E0 _' }3 m( J8 I1 A+ j5 d- i% @ bpx Get_DDB if ax==0202 || ax==7a5fh
+ k& P) c+ C9 O A: a# G4 A/ y* C& a3 S2 @/ y u
__________________________________________________________________________ F3 t+ z& K5 ?4 S- J" ^/ X
* x7 D4 E' c& Y- VMethod 10/ R% v6 J4 F2 e2 X( j7 Z- Z* z
=========
3 R$ C- U# Y! m; N3 Z' M0 S& O% r5 P) g+ p& g
=>Disable or clear breakpoints before using this feature. DO NOT trace with2 b9 ?4 i0 R7 O5 c; n; O# Y
SoftICE while the option is enable!!
6 w2 Y( U0 T- q6 c' Z- L$ J2 {/ I$ o6 t9 B) _% Z+ n& ~8 E
This trick is very efficient:
5 j. J% [- Q/ d* Wby checking the Debug Registers, you can detect if SoftICE is loaded
( s2 H1 f- \* P- v- v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. |, D+ |8 ~4 }there are some memory breakpoints set (dr0 to dr3) simply by reading their
* {! P, Q7 t. Tvalue (in ring0 only). Values can be manipulated and or changed as well
2 j: r. u7 ~7 ? ] z(clearing BPMs for instance)
: Q3 X( _- w. M' H- s+ p' B2 q; U- l1 ]9 d( |
__________________________________________________________________________
3 G6 |1 |/ }- | [8 [# ~+ X! w+ D# S, [" @) k6 S4 C) h# E
Method 11: h# X Q4 D+ P1 M8 N: H, O2 N+ f
=========
6 l. {) M: D" l& n- @) P) I8 M
" v& O8 Q6 F' f# vThis method is most known as 'MeltICE' because it has been freely distributed0 G+ }( P. B0 y2 c8 N
via www.winfiles.com. However it was first used by NuMega people to allow* f! D% l' Z( r5 \% ^7 q
Symbol Loader to check if SoftICE was active or not (the code is located+ D1 r# Z0 E# A3 ^; c( z1 d
inside nmtrans.dll).
1 H. i& W8 w1 m/ @; g) T( t
; @5 }% F8 d* k/ x/ bThe way it works is very simple:
: ~# N+ v- ~% {/ RIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 a0 C( B2 {, m2 [; L& @" |
WinNT) with the CreateFileA API.
( P5 ~: `1 ^9 F7 l2 f( S _
2 |3 @6 |6 s: Q. E" sHere is a sample (checking for 'SICE'):5 ^5 Z6 x2 v5 T$ ?* X
$ }/ C6 ?9 |: a; }' S* `: b+ i
BOOL IsSoftIce95Loaded()
! X7 D. V: v2 q N{/ s$ Y3 U% M. `8 e
HANDLE hFile; 1 G! c+ ?: K/ q! y4 u
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* r: P D* a5 H; a( I, a. N2 W8 ^
FILE_SHARE_READ | FILE_SHARE_WRITE,
2 ?! \+ @/ U- n NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ r+ D9 c5 @1 O
if( hFile != INVALID_HANDLE_VALUE )
0 Z c, R- k# }4 ^# @" N5 r {
% _( x3 |& h: h& @ CloseHandle(hFile); o& E' a* n+ {* D% G1 k
return TRUE;
6 O+ B8 `5 D6 B( t }
, ]! E+ x+ ~( {# s4 v return FALSE;
) y7 M& w5 X" ~1 v}
0 q9 O/ h' [ k0 ]. O2 n( s
* V, \9 e$ _. z0 e: ?5 xAlthough this trick calls the CreateFileA function, don't even expect to be3 J o6 R& u1 Z
able to intercept it by installing a IFS hook: it will not work, no way!8 G: B% E2 r! S$ Q% J9 Q$ v, o
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
" F0 [( h! F5 ?service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ g; B! W& _$ _9 @. Q" n( ?
and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 u) N0 B3 K0 J& G
field.7 y7 R3 J: J8 c" V* }7 ]) B' K
In fact, its purpose is not to load/unload VxDs but only to send a
2 C; F& Z. Z0 u9 O/ r. S- SW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( g6 C8 S! W* Q2 f- Wto the VxD Control_Dispatch proc (how the hell a shareware soft could try
$ I, S" a3 K" j7 P# wto load/unload a non-dynamically loadable driver such as SoftICE ;-).0 T2 X0 s N2 K2 P1 D
If the VxD is loaded, it will always clear eax and the Carry flag to allow% {1 L( y3 o7 k/ f
its handle to be opened and then, will be detected.( G3 d+ V$ ^" ~" I. H) l
You can check that simply by hooking Winice.exe control proc entry point. j5 f9 |6 d' e7 ^2 v, K ~, [; a4 }
while running MeltICE.
9 u: G i# r, \ H$ s m% a! W8 U! P' ]* S$ k
# Y1 _- ], A: ~' l6 s& {2 y4 }
00401067: push 00402025 ; \\.\SICE" [7 E' U0 Q7 h9 H) L
0040106C: call CreateFileA0 g1 |$ I# E5 b6 r/ }% _
00401071: cmp eax,-001/ _6 j. h% c/ U; @& R
00401074: je 00401091
" B& H" U9 _/ q- y& ]
5 \" z: q, ~. b' d# x3 i- @3 d
4 Y" q* P: S* s n) f jThere could be hundreds of BPX you could use to detect this trick.
* `1 O6 l. F a* m5 R-The most classical one is:( | f k1 G9 I. G' h5 N
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ y% q. j9 ~( |' g3 X6 Q( w *(esp->4+4)=='NTIC'1 g! K; W7 ]; g
7 o5 f# O7 K. F-The most exotic ones (could be very slooooow :-(
1 P4 g1 U4 L+ X& Z, H4 ~% o BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
@% w4 _1 @, b; ?- t. b% ~. H ;will break 3 times :-(
- q" r7 n% u9 G1 _+ F1 }. M' Q# Q3 F4 S" p1 g
-or (a bit) faster: 2 M7 i/ U5 l; y" n$ b& z
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& k+ d n8 _9 u$ \" h# z
: i2 |* x6 g- \
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
! l5 y( U6 I3 Z; I ;will break 3 times :-(* r6 Q$ B* A3 [/ M" C5 I
- T& W7 L" _4 k9 {- p% a' _' {; }-Much faster:
8 @- P+ K% J) l; F8 E6 n& ?$ c8 O BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'1 H# e6 Y6 ?; U+ G
) y2 W; }) v* \! u' V% fNote also that some programs (like AZPR3.00) use de old 16-bit _lopen! m$ n4 _% e# W3 W& Y- |# G$ \
function to do the same job:, P! ^# ?, B& {) P; [3 t
" g* m/ e4 o- R$ w, D" H9 C( h push 00 ; OF_READ1 N8 ?: l* U3 ~: N0 X4 O4 t8 B+ d. f
mov eax,[00656634] ; '\\.\SICE',0$ e+ H: b3 O# @3 i' I. |
push eax
: }/ e# P0 M. m- X* E' z call KERNEL32!_lopen$ Y* u/ `# X5 B; k
inc eax+ P8 z. g+ o% i; h9 l6 T
jnz 00650589 ; detected
0 L4 ?" ~" S8 ] push 00 ; OF_READ* ^: O8 ] W/ ~& |% y
mov eax,[00656638] ; '\\.\SICE'
; Z/ V( I: _+ P/ h/ w+ X0 s# l3 r push eax+ A1 Q! A" q" H
call KERNEL32!_lopen
3 k. m7 {) D$ z" M; `$ K2 p5 | inc eax
/ I/ O! N6 h1 L2 d6 K; J( g& \$ @% B jz 006505ae ; not detected
' h( K3 s0 m- d% l) G: `, G6 }; |9 R/ ^/ o* B3 Y
/ D1 [4 c: d# {9 f
__________________________________________________________________________: {' t3 b2 s/ h8 |( I
' v4 B7 |( Y+ [ L4 s* O( N- v. ~4 YMethod 12
( u3 C3 v3 }# ?6 P9 B=========( K( B+ G, C6 ?. c0 S2 w
/ O" R" |8 T. W7 PThis trick is similar to int41h/4fh Debugger installation check (code 05
. ]# }6 ?: x: V& 06) but very limited because it's only available for Win95/98 (not NT)" t! n9 W4 _& E: m3 o
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 h7 `) R: _8 E2 k$ o+ C, [8 s
/ `0 I% Y; v0 ~+ v% L3 B! [. o push 0000004fh ; function 4fh5 [ R* `" ^1 ?
push 002a002ah ; high word specifies which VxD (VWIN32)( h+ S2 s/ d/ U) h
; low word specifies which service3 ]2 c. i j& [' Z
(VWIN32_Int41Dispatch)
. d8 U7 k+ |( T2 @ call Kernel32!ORD_001 ; VxdCall
3 N0 `1 x) G3 @1 { cmp ax, 0f386h ; magic number returned by system debuggers d# t( |+ j# @$ O9 d6 x; I* E7 V$ r
jz SoftICE_detected% |) i4 ~0 h5 x) q
$ N# \& G ~0 B1 ^( r- }
Here again, several ways to detect it:
! s/ \5 c. b# q- k; l
4 w) F) S! n4 v& {) F' w b. Z# e BPINT 41 if ax==4f! ^( E( j% s+ w: T. H
X- p7 m. W; R2 R8 A4 w8 v
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! H; M4 D7 b. J" y. W' h
3 m% H* x3 b8 e1 W8 l' Y
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A, l0 D) O: R. d% W% r: z' p
3 |; ~. [8 Q: X" S( k1 L' i
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 ~$ A. q5 Z( x- F3 q+ X/ ^+ T
$ i# n( i2 ^! z" K8 _3 e. @__________________________________________________________________________& B: r7 N0 J/ a3 b5 }
9 F p/ k3 [1 QMethod 13
I) O3 I- `7 L$ Z- H# ]=========" C, E! A6 O" u& A
8 C6 i W) K, H4 F# z l1 L- ONot a real method of detection, but a good way to know if SoftICE is& H) s( k$ |% ^) |5 M2 Z
installed on a computer and to locate its installation directory.2 ]' M) h8 D' t( [& f
It is used by few softs which access the following registry keys (usually #2) :. Q) y! }( b/ r) [# r2 g
1 |1 D' x2 D% Q6 k
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) _; J3 p: W# T& w4 y6 O
\Uninstall\SoftICE
+ H. S% f, k% m0 m4 O% E |-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' v, H, T: A3 w) Q! f8 \. R
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 j0 U% Q# {) r$ c& R ]2 P\App Paths\Loader32.Exe" Z$ r' U% {9 N
( H8 p2 s/ V) N1 f4 L+ |
6 V; b! g& C1 V0 K( J0 I% p9 i$ mNote that some nasty apps could then erase all files from SoftICE directory
% Y+ q& D% G) C& G) Y) d, j+ ]/ s. h(I faced that once :-(- d9 X7 |9 V# ?2 v8 s
& j) f0 \1 i; i3 N4 jUseful breakpoint to detect it:
: @' R1 d- R- O
# {3 f; Z) P, m9 p& }) A BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'% C6 p) I9 H8 I! L2 S. y
. Y' T5 p+ O4 q5 @3 o. y: E# ~( K
__________________________________________________________________________
0 M0 ]0 N% s3 u# w& I( _; x8 f/ o2 h) p' g" @6 k. Q2 l; e
2 S. n0 |( z4 B- b) K; I; S K7 g
Method 14
( m r& y# f e: ?=========' _* u& V+ m8 d" d& `5 z- y S" h
. t. s0 W. O, [/ G5 X; M. I
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& y- O; ~0 H3 }0 W( p8 `is to determines whether a debugger is running on your system (ring0 only).0 b+ P, B/ p+ ?, v
: }- Z4 N, q$ o, G5 O$ q VMMCall Test_Debug_Installed
8 X1 w9 }0 n0 z& ]: M" O je not_installed( o% ~) h. [" o1 L7 e3 V
1 S% S. t# N' C( g: W v e: j& GThis service just checks a flag.+ j/ s7 T( d7 Z
</PRE></TD></TR></TBODY></TABLE> |