<TABLE width=500> O) l% j J7 f, M5 B
<TBODY>
8 Y! q+ S; T Y( z3 A2 w& k$ q<TR>) A' D% Z) b+ o1 d
<TD><PRE>Method 01
/ X( G" Q/ v5 F: k% I( ^=========3 _% h+ g: p; Z. X) X& R
5 r. g& O' B3 R" D* {" H
This method of detection of SoftICE (as well as the following one) is
$ l: z5 [2 L9 ?+ aused by the majority of packers/encryptors found on Internet.. m n4 C' q9 k4 K4 k8 N* |) `) B2 O
It seeks the signature of BoundsChecker in SoftICE& |& F/ r0 y M6 l. B
; x3 [0 W5 }7 [0 e$ Q! p
mov ebp, 04243484Bh ; 'BCHK'
4 T* I& M) i7 y" ?. P0 |& W mov ax, 04h
8 M- {' y% J2 V/ U6 o4 y int 3 & y. [8 ?' g9 j0 |4 E. B7 a% L
cmp al,41 Z0 e, i9 P/ V2 a$ p% W
jnz SoftICE_Detected/ b' F" i T/ E" N
% n7 Y- \3 W6 s3 ]# [& b0 K
___________________________________________________________________________: m" c( Y7 s p4 X% u
$ {& r2 Q0 I) l4 Z* ^
Method 02
( X6 ?# Y) |3 }/ U=========! V; l' X. C- g! n, R4 J3 A8 z
) f% [$ X0 [6 c+ fStill a method very much used (perhaps the most frequent one). It is used1 Q- _0 ^$ H( I( }0 n# `7 V
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 `3 v& `; t) Z* K$ X0 v
or execute SoftICE commands...) L+ U: ]- b1 e- y6 X
It is also used to crash SoftICE and to force it to execute any commands: o/ m+ e2 \$ X5 S
(HBOOT...) :-(( 1 c- _+ ]2 \% L5 a( q2 T
# y9 G2 _, u6 G$ }' A% q
Here is a quick description:
~* F E' K. x$ @/ @-AX = 0910h (Display string in SIce windows)
3 Q+ }1 q v! C6 c# w: x-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( t' q/ j) H7 A
-AX = 0912h (Get breakpoint infos)7 M1 O3 d- k! W1 |! J$ @# l6 M
-AX = 0913h (Set Sice breakpoints)2 _' h7 i0 r) h' P0 [
-AX = 0914h (Remove SIce breakoints); v3 Z# M: A+ ]4 `
! \2 b" q# s5 w8 aEach time you'll meet this trick, you'll see:
* [3 [# D7 [# j-SI = 4647h
9 R& r- f/ G4 s" q. F-DI = 4A4Dh. }0 |( n0 \# g0 q& p4 k3 Q5 C
Which are the 'magic values' used by SoftIce.) G: W5 [% j2 Q8 N3 d% R1 ?
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, v& a( x4 ?( f
7 `2 Y/ n5 w. J! ^; y8 qHere is one example from the file "Haspinst.exe" which is the dongle HASP
/ }; j; y0 R" [: SEnvelope utility use to protect DOS applications:
( S6 x$ o$ [+ e; `6 L# m
! |8 \0 I- P/ {, a# J4 A5 @, _& J& A# |: u6 L
4C19:0095 MOV AX,0911 ; execute command.
5 q# E$ D' R& F( E* N+ B4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).$ n7 s& u6 @6 C b% K
4C19:009A MOV SI,4647 ; 1st magic value.
* E- a* B3 d, ]3 D* l. E' t4C19:009D MOV DI,4A4D ; 2nd magic value.
. Q: d' y$ c" z4 t* `4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 S, Q4 @: V+ T7 R+ e f b4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% R4 u- L8 W3 x. d/ s$ a
4C19:00A4 INC CX
# L* q7 f2 ]! D$ @, [1 \: J3 ]4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 j/ u" o, h2 t8 J9 z; j
4C19:00A8 JB 0095 ; 6 different commands.$ K8 C0 c7 |- r N
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
1 p' z% [1 h" h w: x+ A: a4C19:00AD MOV BX,SP ; Good_Guy go ahead :) q7 y: s$ t5 `5 z
, e% n$ E! `; [. i/ s
The program will execute 6 different SIce commands located at ds:dx, which
6 c1 r/ n& V6 e' `are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. K$ @6 Q+ t+ C7 W
* x, C4 n/ k6 {( ]* g
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( M* P* O1 C5 G4 H' T
___________________________________________________________________________0 ?/ w6 V G. G* Z+ B3 M
. Q( W! H e- M/ u
9 h3 t& G2 R/ c1 n; rMethod 03
: _& x4 ?( P# a=========
% r% b3 w/ c/ T" {& o
) ?: ^. V/ `! [* jLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
2 }7 P0 a$ i' Z0 K7 V- ](API Get entry point)" j$ n" p' N0 n. g
2 Y- w+ v9 Q3 T5 U4 W
& U. o' _3 D6 d2 E& B: f3 g5 I
xor di,di
7 d9 m5 V; u& D* M7 ] mov es,di0 j4 x& J% H0 `' b& g3 Q) S
mov ax, 1684h
# Q; U/ d5 v1 h) g mov bx, 0202h ; VxD ID of winice4 k' u3 i; @8 q# ^: T$ ]" E
int 2Fh
$ G& y; V$ W" E r) g mov ax, es ; ES:DI -> VxD API entry point7 j, N4 r, W! X! I) |" j1 {5 h* H
add ax, di3 L* }7 _+ E7 }6 V$ a0 W9 }/ h) z, z+ E
test ax,ax
$ J A2 F b% ^: ~ jnz SoftICE_Detected# O2 a% C9 I) o0 Q* K
1 @ h% j6 d$ g- {
___________________________________________________________________________- \2 g" X6 G6 L) t: E) j5 B
3 ]7 T% B# Q" W- i# w0 `
Method 04
3 m; f. W5 o* ?$ E' E: D' B=========
6 r; `8 M% A0 w+ W3 ` M4 L; t% d! f' d3 e* |2 D5 ?4 G
Method identical to the preceding one except that it seeks the ID of SoftICE
# }& z) E' T n& G* jGFX VxD.
/ B- o( N- K0 j4 s; U$ J* [/ X$ h4 O7 E, S* F/ c$ G) u% s0 x2 p
xor di,di$ j7 ?0 b9 ^5 F4 C1 O- A
mov es,di6 F# {8 B: h) C& Z
mov ax, 1684h R. v8 M1 G( q1 w0 @8 o
mov bx, 7a5Fh ; VxD ID of SIWVID B% R. j) x: A7 i, g; [1 s+ Q5 G
int 2fh# ~& o0 P) K# L3 J
mov ax, es ; ES:DI -> VxD API entry point- g1 C2 L; L2 `' c& S1 k
add ax, di
+ l7 i: E8 j6 @# Z test ax,ax
8 o q! W f/ F, Z! S jnz SoftICE_Detected5 F( H9 k7 Z$ }0 B4 Z% b
( C% q5 `6 H5 j0 _8 Y; c__________________________________________________________________________( J0 L4 N! h( ?1 y8 ~
0 V- T8 u; |. m6 _% k
5 B" M/ v6 ~* E
Method 05
- |2 f3 w( U% [% t( G! q3 e2 \=========
. {( A! J% y# ?& B( }6 ^0 R9 ]' x1 Z8 @! t; Z, m3 Q9 b, Q
Method seeking the 'magic number' 0F386h returned (in ax) by all system
) g, M3 h- p. o7 \: s2 H2 qdebugger. It calls the int 41h, function 4Fh.
3 n' b& v) v) ?9 D' z2 ^There are several alternatives. 8 p7 ~# H* o$ q0 u, F$ G
& N( k' ]! d1 z2 y
The following one is the simplest:9 T3 b* z0 Q3 ~/ p6 c3 M. { \' T
8 N2 V. C( z/ s+ a% o l) h* {- v
mov ax,4fh
! ~9 u! w/ {/ a: [0 m/ V+ x int 41h
% u( ?: C& u& z' ^% ~: I* H cmp ax, 0F386
- @3 w$ Z8 x. _/ l jz SoftICE_detected
) w2 E) p& W$ Y* N! B/ u, c d
* ^5 Z1 O6 ]' V3 c8 i6 L
- T5 s z& n6 O+ yNext method as well as the following one are 2 examples from Stone's ; L/ \; l I: u" O g1 E) ]2 e
"stn-wid.zip" (www.cracking.net):
+ m$ B8 Q) W) x* [+ D8 W. z
: Z3 T( Q$ I* L* o* Z0 F5 b3 L$ l mov bx, cs% R' p& _0 Q' J r5 i0 R
lea dx, int41handler2
( l) F c3 |3 U( N: ]& { xchg dx, es:[41h*4]( i. X, K9 c |) F9 ]: i. k2 x0 ^
xchg bx, es:[41h*4+2]+ h: M2 d! E: Y [: G+ ~
mov ax,4fh
' n- Y0 M- @. n5 B int 41h
: I7 s" Y4 \7 M4 _- r7 G xchg dx, es:[41h*4]1 s; ]( x6 m4 [& k( f1 N% G
xchg bx, es:[41h*4+2]" t8 L' ^3 |! G D4 e
cmp ax, 0f386h9 G! Z+ `9 X8 f, l/ B0 \
jz SoftICE_detected- F; u& B6 I9 c" j8 |
8 G, c! C4 Q" ^. P S
int41handler2 PROC
5 c0 i, W! N8 A0 h% j iret( ]( E5 p$ F9 V* S3 w
int41handler2 ENDP
* d2 w) v. \- Q9 }, c
- c7 h- V6 W x' O# h4 ?; _, M( S
3 X% ~! B- R1 p' i" r! [; e, m_________________________________________________________________________
4 k* q9 q0 S, r9 c) M' Q: W) F$ [
: `/ I f1 l2 ^& _# \$ }7 Q0 ?+ v0 @7 f2 a
Method 06
. p; J8 o, y! m4 ^=========# h# N. |# J% L# w% W9 }& E( l
4 N5 r+ {# J/ o. {5 r5 `6 b3 V
, C0 K1 c/ ~9 U" T/ N0 X
2nd method similar to the preceding one but more difficult to detect:
9 r k6 a& N4 N6 F# Y7 v
7 o9 [6 j4 P m0 C. Q* Y0 w, J. p3 U) A
int41handler PROC- j0 R0 T/ n/ V2 G: X, _. l
mov cl,al: d$ S# d& B" g2 K4 f/ w
iret
( B$ x7 d, h* s, D( c1 W4 ?int41handler ENDP) N: E# i- e. l: f% A. ^1 ^
- K, R4 T, _/ [: K6 j; t. v
! a0 _; f! T' J; M9 k xor ax,ax
1 b5 [( O6 J6 N. f' _ { mov es,ax- M6 ~3 H! s* O7 |4 z
mov bx, cs
7 i- s/ Y8 C0 @) |* W lea dx, int41handler3 r) p0 L; T- `2 k! T- a4 N y
xchg dx, es:[41h*4]
; \, O2 a% L9 [ xchg bx, es:[41h*4+2]
B# O+ N& D$ i7 f% l9 R3 B in al, 40h
& c( S: C: m$ \$ {' O' h xor cx,cx
5 k- N5 N, a8 ]* C) z, O4 R int 41h3 P7 U" P# q- K% l& P8 Y @
xchg dx, es:[41h*4]
6 r. g9 r+ L; k9 X8 P7 u8 ? xchg bx, es:[41h*4+2]
9 v( l8 l% i7 G8 [# S cmp cl,al- X8 r( t# {& w: H7 L* W$ g1 K* t
jnz SoftICE_detected
3 \9 ]! j1 L: j( |
' x& I3 ^' `& m7 z8 l$ U1 n_________________________________________________________________________" b( ~5 r6 R2 S7 \. O, \$ I
8 V* n4 o) u! H) r/ e: v$ g) S
Method 07
% }9 q0 G. _ P4 b=========
! O; J# c0 |# q% r. c1 }( x X8 t0 _ @: D5 |! w
Method of detection of the WinICE handler in the int68h (V86)+ k5 i: i! s c1 X* n( c _" S w
1 g7 q' `" e0 t. k mov ah,43h
7 O s- _& T6 v int 68h5 ?" e: r' |: G( Q3 _6 M& L% t
cmp ax,0F386h3 D4 M X, J- ~" X- S
jz SoftICE_Detected
0 [, ^1 k5 ~1 ]/ k
& _) \! P' ~2 H: A# ^9 z8 s; ^5 m$ n0 D( c! G. e: _2 F
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. N. Y5 }- w; U/ O4 K* h. Q* q app like this:
) C7 S) K% l! R) ^8 m
4 E! N) C2 {- x/ ^8 w, s BPX exec_int if ax==68
% y0 _# N( w; Q! N (function called is located at byte ptr [ebp+1Dh] and client eip is7 S) Q c3 l1 Z& Z" k5 U
located at [ebp+48h] for 32Bit apps), @. M- ~: z& \9 @0 f
__________________________________________________________________________# n' o! @, O# b8 S6 Z2 h2 {+ U
- x' {8 x. L* `8 G9 C2 Z' G
# Q4 m/ V8 E9 M; I) ?5 zMethod 08! i, s1 ]" A% w `; S ~$ X
=========9 a+ s& _% K2 L. _! I' Q
3 _8 J& m: |3 ~! y
It is not a method of detection of SoftICE but a possibility to crash the
2 d% @+ t; k+ Osystem by intercepting int 01h and int 03h and redirecting them to another3 b( n, A( _% U [, T
routine.# Y5 V- \: a2 u! V
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
) Y* e0 T+ `# \; k6 h. ?to the new routine to execute (hangs computer...)( \6 A/ _+ z( H. U+ i
& m! j; g0 c$ T1 I3 [
mov ah, 25h' C% t9 c0 _( y, T0 N5 [
mov al, Int_Number (01h or 03h)+ F/ O$ F( x' c& I' ~# d
mov dx, offset New_Int_Routine
4 G F' Z) v7 p- ^6 d int 21h9 A) U" q5 |( ^# G, A
! @% z# M, n. P* ~0 H; p6 W/ ___________________________________________________________________________
5 I* u1 S( A* s5 P4 g' m$ X! S0 L8 M) s7 b
Method 09
5 [6 d2 [/ I& \=========
& |% J3 a: z& ^7 C j6 D/ y/ i0 Q! W
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" ~8 e, k; r- H- `performed in ring0 (VxD or a ring3 app using the VxdCall)./ h- t" a! f5 e- {& K* p, x: q
The Get_DDB service is used to determine whether or not a VxD is installed0 @, H# s1 y$ c7 S
for the specified device and returns a Device Description Block (in ecx) for0 @$ t, q4 a1 a% k, U8 s: U) u, k0 C
that device if it is installed.3 m3 K9 b- @: t3 J b: K
0 I6 _) m$ S, \$ P; }
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID' h; f4 B9 a( X7 G
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% j/ _* L; y6 B; n" d
VMMCall Get_DDB+ D( f+ S' G2 v: P3 ~8 D* q
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* ^- N, N9 `6 E/ I
) [) f( G" r4 q ], _/ T6 `& J9 O
Note as well that you can easily detect this method with SoftICE:
/ n( T) P: g1 c5 v6 L- q3 T bpx Get_DDB if ax==0202 || ax==7a5fh: h7 w) ]( U# B) n# h/ j
, x& _. \& W% `, ] b
__________________________________________________________________________
r* D- [ H4 W) W& e
4 h5 j- s* c0 O1 }, DMethod 102 d, o8 {2 i* \
=========! K6 I6 z- Q- [% L! X' R5 c
* |/ T& d/ O" q5 @( |8 t* o
=>Disable or clear breakpoints before using this feature. DO NOT trace with: W- \$ b" s3 A, k. p) e) G. ^9 t# u+ t
SoftICE while the option is enable!!7 p: @4 R- ]0 ^; a3 v
; }( F$ C0 R7 Q5 V) HThis trick is very efficient:9 u4 P& Z. J: T4 }: i) q
by checking the Debug Registers, you can detect if SoftICE is loaded
" j3 i. s! T1 p3 `9 S(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 d9 u P' J, @/ a* v
there are some memory breakpoints set (dr0 to dr3) simply by reading their9 h& v, w5 C# T1 I5 o' k
value (in ring0 only). Values can be manipulated and or changed as well+ \+ Z4 w# Z" u6 \$ M7 z1 p
(clearing BPMs for instance)
u9 k: A; d' D0 S$ s; `$ o; N8 k: ]' H* o" ]2 v4 o
__________________________________________________________________________
7 P6 n' `% t8 ]% U( K& `2 J6 v; x# p2 h; X$ d2 x/ F) I% C1 m
Method 11
7 F8 R* P0 d6 k2 x=========7 T8 @* i6 u! m. _
$ B+ }% {; x I4 n( ~ l6 J. q
This method is most known as 'MeltICE' because it has been freely distributed
4 p9 \9 C+ m8 ^; F# Evia www.winfiles.com. However it was first used by NuMega people to allow& a2 t2 }. \ m2 D5 B
Symbol Loader to check if SoftICE was active or not (the code is located/ W- k" h4 O3 Z$ v- f" h8 O/ x K- X
inside nmtrans.dll).! _9 q/ S7 i9 u; |
/ L; @: C- V) q. V9 H* O6 Y5 |
The way it works is very simple:
* M. s5 z0 W" r. x6 k; l4 T: u5 lIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: a; g3 v1 ?; @7 _WinNT) with the CreateFileA API.
" Y6 i* Q1 m; D
, L3 x1 S9 v5 N; Q' h! e* k5 fHere is a sample (checking for 'SICE'):
% h' p/ \1 b9 P- B( ^
# i3 H! f W: [8 f" Y) DBOOL IsSoftIce95Loaded()
- R" ?4 c2 T& h0 ~{
1 ]- O+ c* {$ C8 D( ]' t6 W HANDLE hFile;
0 J9 q- Z0 J7 T/ B; B hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,4 x; @6 Z% F, m v
FILE_SHARE_READ | FILE_SHARE_WRITE,( u( B H) \0 Q4 U5 L) Y
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ y2 I3 M {0 b
if( hFile != INVALID_HANDLE_VALUE ), b# J8 u% {. X% Y# Z
{
+ B; s7 J# F% \0 h2 b8 t. v CloseHandle(hFile);
, @7 D9 T6 o! ?+ b: L5 M. e return TRUE;
! z5 K K) x% R" \$ m- j4 B }
' K+ }' I; I2 ~, D0 E return FALSE;6 ^8 L7 @. M. |9 i9 g) T# R. j
}2 {' [) k, M4 N
6 x% o" O; [& d2 Y0 Q* z3 sAlthough this trick calls the CreateFileA function, don't even expect to be
+ {# t7 o# R. k$ F- d# j# @6 d+ Dable to intercept it by installing a IFS hook: it will not work, no way!
h9 M' N4 S/ C6 m0 X9 WIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
, a+ r/ i( H e/ J9 A+ `; T; yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 W" w' Q* ^( w9 F8 d/ R
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% n0 v( F2 [5 M5 M+ Q3 Qfield. N! m* b; d0 m+ U) r# p( R
In fact, its purpose is not to load/unload VxDs but only to send a 8 B" b" k4 B1 H3 P' z1 m9 b
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- D/ ?+ |! J. I1 f6 \; L
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 ~/ W0 l! p0 k H1 p$ v; L
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* a1 c: ?- F9 O% {
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ ]* ~+ W' K% A7 }6 W
its handle to be opened and then, will be detected.& V6 y) \% ^/ F5 U, k6 l( [
You can check that simply by hooking Winice.exe control proc entry point3 w$ N! R D* ^8 x3 F% Q ]
while running MeltICE.
5 h' R5 N3 B" ~' U6 t, d0 j* y
1 r2 t$ D5 e+ D1 \' X# I, T# w+ O) f Q1 m: U
00401067: push 00402025 ; \\.\SICE
( _7 I8 ~' b1 |+ p$ Q 0040106C: call CreateFileA8 W: G" F# W/ h8 V" y
00401071: cmp eax,-001 g5 V, B. _) ?1 ]3 Y
00401074: je 00401091
) a& v8 N( o* l& E; m& D- p, A6 m! I3 \1 E( z& J- `- y
: ~5 t$ p6 J1 K0 T$ n: w/ m
There could be hundreds of BPX you could use to detect this trick.) I( `- r- j5 c8 G5 n
-The most classical one is:. C; J' w' V1 ^0 B
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 g" y- x ^7 m% | *(esp->4+4)=='NTIC'
, p1 v: y% A5 g3 Y7 p( h/ V8 z2 _$ W6 Z( [- f7 e: X+ N/ ^- _
-The most exotic ones (could be very slooooow :-(
9 J" L6 j( |( b) z6 Q/ q BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') - h9 a: k# `& B) \4 D* c# k
;will break 3 times :-(9 \* {: w; y0 _
+ X* l% F$ `9 @& ?3 o' K
-or (a bit) faster: _3 D! ~9 E( z# D0 p
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% x( |0 |! r0 A5 ^/ ?; J! D. s; a5 p4 ? G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
* K j; @ _* |; N) N ;will break 3 times :-(! J6 a4 ]/ [9 s* u! `1 Q/ x- O
5 }" @1 b1 @/ `% o q-Much faster:( k0 i* q* H. s& k5 \5 @& X! L
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'# k4 q9 h& g) N
4 }& D" a% C$ X, d: y/ T/ sNote also that some programs (like AZPR3.00) use de old 16-bit _lopen# Z" u X- w. C) i4 Q8 u& ?
function to do the same job:+ S \( L. [+ Z2 W5 m" `/ g
+ ] N4 j0 D; F3 Y- p+ V7 b
push 00 ; OF_READ
' n i% {1 q. q0 A1 z8 N mov eax,[00656634] ; '\\.\SICE',0
# G- l8 ^" p9 O, S push eax
+ B( a, _ n8 s4 ]3 S9 O call KERNEL32!_lopen; z& U3 j* [6 e$ c' v' y% ?9 ]
inc eax
( L2 G! b- t5 L, h' z/ p ] jnz 00650589 ; detected5 X, z2 F5 H: r4 A
push 00 ; OF_READ
7 c3 Y; |6 s& N0 x0 P6 O* z/ N mov eax,[00656638] ; '\\.\SICE'( f+ A. Y/ h$ z" j2 @+ e* k; c
push eax8 Z' k! s6 s2 {$ ~8 x
call KERNEL32!_lopen
" v) s( Q, p6 a inc eax" t$ V6 n7 G" i4 z: [1 ]7 w
jz 006505ae ; not detected4 {6 s( t4 g; k: A: J1 b$ ^
1 R* J- i; s# f! c2 A6 f3 k
% z7 I, {9 h9 A- p/ j. D8 J- \__________________________________________________________________________$ I; L# _ e0 ~! a$ K9 K
: _2 e+ T" c* q- u+ F1 g: LMethod 12
: C6 r, U" B1 R8 g6 m7 p=========
. ~/ b9 @$ e/ y$ ^- b6 \: N' B7 C
: _, A* q' A# V4 G( |This trick is similar to int41h/4fh Debugger installation check (code 05
" F2 Y) K/ S& F# L9 E& 06) but very limited because it's only available for Win95/98 (not NT)
$ Y2 F3 }$ i' W, \' r/ B# [as it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 d i3 \1 U9 @$ g8 c3 s
: p; s* K! C6 H5 |6 I J. p1 y
push 0000004fh ; function 4fh
+ {( E$ ^, N5 H8 f! g1 m push 002a002ah ; high word specifies which VxD (VWIN32)
# ?+ l, N- L# i6 H$ T ; low word specifies which service
5 ^$ w$ c$ k/ J0 w9 h (VWIN32_Int41Dispatch)% x1 K" R6 f/ A* q
call Kernel32!ORD_001 ; VxdCall
" x* C) |; j6 l( P: p+ p Q cmp ax, 0f386h ; magic number returned by system debuggers* P( t; H- ^( E
jz SoftICE_detected. X0 w6 Z8 }: s4 y+ ?
' O3 i$ h# Y2 }+ z/ B9 L
Here again, several ways to detect it:
7 Q* ~, Q& [, b* [6 O6 Z
; j9 L( @0 I5 Y$ G" p& u0 c BPINT 41 if ax==4f$ N- l) Y' [6 W' G" c4 j6 E
6 D6 G3 b. @7 h8 Z# g" P9 m
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: t$ C& I. j- [
& A2 ^2 Y0 l: P# T0 ^2 Q. |
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 Z5 k! T- D2 I# X, B
3 a1 e& O/ I& M5 R BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. u# A& e* L* N* }5 E
$ P) M4 \7 G* A l1 A' F
__________________________________________________________________________
2 P; w* Y3 g+ ~) e0 Q3 Y
( A, C2 d1 `8 j! {, XMethod 133 \9 u1 @2 ?, Y
=========
. e1 ^5 r/ n+ _4 k
: R2 V$ x' b9 fNot a real method of detection, but a good way to know if SoftICE is
; ^+ A8 J- T% s, [9 Cinstalled on a computer and to locate its installation directory.
- `0 O; s5 d f1 z+ V, QIt is used by few softs which access the following registry keys (usually #2) :
: G' e+ G! F5 G( ~0 _; J: M( E5 K! e: b& M5 f' Q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! N8 ]! _1 u$ T/ `; |: Y! \3 S
\Uninstall\SoftICE ~8 V7 T6 d) M4 o
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! g2 G, `/ z4 F3 y! e+ F
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 D+ c. D4 A; v# [9 |\App Paths\Loader32.Exe0 ?) C7 I- X* r
% u# y, }1 i- C, }% H' f7 s
+ N8 P+ T7 j. |/ t9 wNote that some nasty apps could then erase all files from SoftICE directory
- S2 N7 q0 n, C& m7 z, z(I faced that once :-(
# |7 v, q+ l! L: }1 Z' d- ?: H* ]- n2 y) @
Useful breakpoint to detect it:6 o6 ?. i6 X# \2 }
# Y+ a/ [+ E- L7 t% U' d+ L
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE') q0 J! G% ]) g# Q
0 J/ ]6 S6 @: C" ?9 s
__________________________________________________________________________% p7 q/ G- I: G; E
5 P) H2 l" f7 A8 q3 g r
, E- i$ n0 U4 d9 C/ S% I1 S# qMethod 14 ; |$ ~8 x( q4 h# I# `
=========+ I& X' M! g9 P6 ]/ s. A1 O
6 U% m! j5 ^3 l# AA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
1 _( P# o2 m1 `9 I; qis to determines whether a debugger is running on your system (ring0 only).
2 y) ]% L9 h0 h: m) e( R
! {! r7 }. o n# G. q L. R VMMCall Test_Debug_Installed
{% F. y" h! ^ je not_installed0 @& q) w7 O4 j1 |! y% X
) g/ G6 f; k7 m/ u4 M: o4 k0 s( }
This service just checks a flag.) f6 g, O8 N7 T* S( [: _# Q2 `
</PRE></TD></TR></TBODY></TABLE> |