<TABLE width=500>
$ j/ Z% {3 c( _" n3 k% o5 [<TBODY>
6 v; i( O( }+ u6 S/ q- | p<TR>: d ^$ X, l2 K" V+ O
<TD><PRE>Method 01
, ]& P1 z9 I9 P8 {( w=========
! `4 d6 r! V% H- i! ]/ h8 m$ J" z# A: V% w- @
This method of detection of SoftICE (as well as the following one) is
. J% @0 D8 I4 x+ D) l, c' Tused by the majority of packers/encryptors found on Internet.* Z' e. P4 t$ ?1 _9 y; I
It seeks the signature of BoundsChecker in SoftICE( ]* I/ i6 s/ g( ?9 R
# [# ]0 O7 X' q! T+ N* [( w mov ebp, 04243484Bh ; 'BCHK'
& l1 \& { P& O$ {7 T8 K: S3 w* r mov ax, 04h7 J* K0 N- p d% j" P
int 3
% D2 N: [0 n( s5 F6 e( M- H5 y: I cmp al,4" j/ E/ K) A( p$ `) k
jnz SoftICE_Detected
! Q( q9 i$ H4 V& k4 l; l
+ c& ~" w' i) M8 P* j* {* v7 i1 [___________________________________________________________________________
" [' f4 O7 ~) r- K# ]! I! L5 V, Q) t6 z- Y' ~2 n
Method 02& a4 J' \* O3 U6 \# s
=========, t; b% D' @# F L
2 h" g6 f6 O1 v% \5 kStill a method very much used (perhaps the most frequent one). It is used
: d1 k2 f" d# L5 L) bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! U1 w- C1 t- E: r. z" F! E. Sor execute SoftICE commands..., J0 s# A+ S. ?
It is also used to crash SoftICE and to force it to execute any commands& @! k$ i4 y! l
(HBOOT...) :-(( $ P# s0 M) R* D
4 ^+ F# @! Z& f( h( w1 \Here is a quick description:
, l/ y7 [! c2 |' }0 }-AX = 0910h (Display string in SIce windows)
" l3 y/ O' `$ r ?' u3 L7 ]" z-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 v7 C: K4 N2 F7 L7 y( h* ~0 y
-AX = 0912h (Get breakpoint infos) |; ]9 s" ], s/ r' }* `+ b" S
-AX = 0913h (Set Sice breakpoints)
( n9 y9 g6 v A9 V q-AX = 0914h (Remove SIce breakoints)* f+ |) u" _6 O( b. L3 P
/ g0 w3 C4 P# E& U& D4 H) B
Each time you'll meet this trick, you'll see:" ?' E% m2 w6 b: q% a+ u- u
-SI = 4647h
; ^' }% U3 z+ J7 T! K-DI = 4A4Dh
% w2 P0 w$ s( ?5 MWhich are the 'magic values' used by SoftIce.- N/ `6 j& M( _* B2 v- {7 x, V5 N1 t
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 Q: v, a% o6 u5 B! z" l+ { k
+ w+ v7 u; z9 g& w; ?Here is one example from the file "Haspinst.exe" which is the dongle HASP9 ]8 V( A$ r8 L
Envelope utility use to protect DOS applications:
: S+ h& ~* w8 S" x: A0 U* |
/ C* {, {7 y. w& K, t8 `# W
8 t( n1 `* H+ t7 |4C19:0095 MOV AX,0911 ; execute command.2 g% E# c' z' @$ D1 |7 @
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
U* x7 a ^9 n: | [9 l4C19:009A MOV SI,4647 ; 1st magic value.
1 b' w+ ?$ _( d4C19:009D MOV DI,4A4D ; 2nd magic value.
6 C. K, _1 C% d% L+ j/ ?+ ~1 m) e9 ~' a4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*), K( r5 O$ p" p$ Z
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, z8 I8 @: H2 U0 D4C19:00A4 INC CX' [4 R6 ?- a2 j8 N. I% D* o% p) o
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- g5 ?: h2 C# y' O' D4 l4C19:00A8 JB 0095 ; 6 different commands.
. ^* D8 `& y8 z4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* w& @, w% t( ?& x4C19:00AD MOV BX,SP ; Good_Guy go ahead :)! K& p3 D: t- }8 s6 A7 |+ G" M
4 C+ g8 p9 ?" t2 k/ ~- h6 mThe program will execute 6 different SIce commands located at ds:dx, which. \5 K, p% f1 ~) T9 W) c# {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ v; s) }5 U" M+ q2 a! O- a% P
( H8 M& R+ M- o. @' f* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( ]. t, o% G& u- X( B% S, K/ z( g___________________________________________________________________________8 f5 U, |1 ?; O4 O+ r+ P7 f
J9 w8 j9 D5 P9 m% |
& P- a4 `) p! y ~Method 03
" L% |* c h9 i1 V0 O=========% B; e5 Y( e6 H& K& d
2 ~6 Y9 S& @. u; y+ N) ?
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 y3 Z; c! k; r4 `6 ]# f- ^% `1 u(API Get entry point)
$ n: l( P* o, I! P% n% m2 Q9 [ 8 [: _+ j* A9 ~5 B" @
0 O1 k. I- P4 A1 E) @7 E' O xor di,di+ N" [3 j2 l7 {( a# ?1 M" e+ W
mov es,di
9 o* ]. @5 W; j4 U# j% k8 Y. Y mov ax, 1684h
9 d1 o, m7 k5 }; a" s* Q5 g mov bx, 0202h ; VxD ID of winice& t( L; ]3 o$ Q9 q( L8 G
int 2Fh
! U5 C' R! T) R mov ax, es ; ES:DI -> VxD API entry point' x( ?& [5 ]+ H
add ax, di
' F; _7 \ `/ v" Q! J2 j/ ~ test ax,ax
; ]8 D( T0 H9 s$ o8 u! V. E& k- ?" @ jnz SoftICE_Detected6 g7 }# j: x8 D8 |% P
- k# O9 M m$ N, k8 \2 G1 V/ F___________________________________________________________________________: A" h$ k& T2 _, {% b" N' S f
& f; R+ a8 J. \. O9 U
Method 042 I( G- Q6 L" m& ~& W# ]
=========- A7 M% K' J) ^
7 L8 f0 F! U+ w- V4 v( {+ I% P' ]
Method identical to the preceding one except that it seeks the ID of SoftICE
2 i+ j5 f+ c& N0 T7 rGFX VxD.) ~1 O- O9 n) H# g
8 s& U1 D. m/ P" T+ _5 t2 d
xor di,di
: g7 j& N+ f7 ^4 b. ~0 C mov es,di2 V. d. Y( W9 \% R
mov ax, 1684h
5 [! X7 E8 Q# v( Q mov bx, 7a5Fh ; VxD ID of SIWVID
0 ^, H- X2 N9 u7 k" n. { int 2fh) S* t, D/ Y9 A- `% V' [
mov ax, es ; ES:DI -> VxD API entry point
9 T4 L, T0 [2 }5 G add ax, di
& [8 e2 H2 K2 M$ C1 I test ax,ax: v- ]4 b- |% d) c: c/ d
jnz SoftICE_Detected, }6 N4 h& `- g
( e, Z3 s6 N5 }; i( d/ r- H" ^__________________________________________________________________________# U0 G3 ^: a* W6 O( O- X
7 R" ?2 N* i& L8 ]2 F
6 t7 C7 {' S8 f. |) R2 WMethod 05
: b$ n' t3 R+ `4 B- y6 R=========; H( g% s+ S @
8 n2 }1 A5 Z% W/ F( U7 n u7 W
Method seeking the 'magic number' 0F386h returned (in ax) by all system
7 R* v* X' M' l( I* rdebugger. It calls the int 41h, function 4Fh.
7 a* I8 Y* l4 j/ F8 K; R* BThere are several alternatives. ; `7 a- l6 T# t+ M" {( }* E
$ M3 r/ O% V. x. t2 `The following one is the simplest:, f. ~6 @ K( C1 u: S/ ?/ {( ]+ O
5 B3 |* I, h$ I# X9 C/ T* a mov ax,4fh5 Z3 X; m" q# [4 }
int 41h
: I' o' n; w- h, }, ?$ V3 w cmp ax, 0F386
7 f0 n) r" J: G' b3 x jz SoftICE_detected6 I, X3 P4 z& G, |! J. D% w4 A
^! P4 z2 x0 O9 x3 b& n
: I5 ]5 a, g" m9 a" |1 o) i4 @1 iNext method as well as the following one are 2 examples from Stone's
0 N8 w0 o/ U/ V9 [/ s"stn-wid.zip" (www.cracking.net):
( X2 K& R3 j6 c4 K1 s" x' @$ V6 E* |/ c( J; O2 F8 [
mov bx, cs2 {; \. ^) e4 b# p
lea dx, int41handler2
! q# m' c5 p1 ?6 i( Z& I xchg dx, es:[41h*4]1 z# l- E& _+ ^4 M# x7 c
xchg bx, es:[41h*4+2]
1 U5 J; T, Q7 H2 `6 @6 u# ? mov ax,4fh
7 |' j# z. S3 T, u- f int 41h$ J$ k. l1 X5 o6 m+ h- V( T/ i8 {+ e
xchg dx, es:[41h*4]8 N2 O5 [# J2 {7 w- j& M
xchg bx, es:[41h*4+2]; P6 s9 S+ u& N0 |
cmp ax, 0f386h
0 {) t& E+ u4 H1 Y4 Y jz SoftICE_detected
4 E; G5 a+ y) o j5 T
& ]( \: D [) C: E5 Rint41handler2 PROC
: s8 M4 u0 \: ~% P# p# g2 O/ r iret
- G- o! J) j6 H t$ Lint41handler2 ENDP
/ j( K6 G7 k' ?2 E# @: {1 b6 B7 Z6 A5 @! B/ {, u+ x- `/ M8 e& l/ W
2 h8 ?3 F4 O* L0 d
_________________________________________________________________________+ m6 x. ^3 x/ _$ g0 {
8 l ~# p) q0 ?% W8 z: P# z
5 z& a6 t8 h- C9 ~$ JMethod 06: H7 e% N% w) ?0 S
=========6 S S8 E0 J' I% K
0 a. c( G- V5 f% l/ v+ M( o5 g. [) C9 q/ r( }4 Z" `
2nd method similar to the preceding one but more difficult to detect:
! X* D7 _$ k& u6 }% q! l0 n
. h* [/ l, g } K l4 z0 H" \. K# A, O
int41handler PROC
9 o1 S; t, t O1 e5 x mov cl,al( t; I, H7 n f* Q
iret
. q9 y& U6 ?: b- _* U; ^8 ]int41handler ENDP
- o+ u0 `5 z2 k. b+ [* I% ]6 W; ^% J9 R6 [: E" ^
, K) h; d! K% U2 |& \
xor ax,ax, n1 x& H& V, j1 z5 h* w
mov es,ax1 o# d8 x9 z M% }2 s
mov bx, cs
7 _6 K6 {4 H( e" {8 }; w: m7 C) z( w lea dx, int41handler
0 t3 x$ ]# w9 n! Z0 o xchg dx, es:[41h*4]
% X% L2 F2 q* |( u xchg bx, es:[41h*4+2]8 ~+ ^4 e: g7 a, X% `# Q! v
in al, 40h
2 [$ u- n& R7 p( N5 V xor cx,cx
0 l3 o+ |; c8 V' s2 T int 41h6 X5 o/ o# _* I4 K, L; _) c/ ~+ o% S
xchg dx, es:[41h*4]2 A& ?: U! ?1 m$ ]1 Z
xchg bx, es:[41h*4+2]6 N- b# [5 f7 m( a
cmp cl,al
! V5 ~* A4 c- Y& y' h7 y9 v; h jnz SoftICE_detected" S' Q# }( ?7 u- G
5 n) n! m9 b. F7 |6 L
_________________________________________________________________________& U, s. x# [$ D- }7 F+ L2 v9 ~
% a( m) B, E1 ~& y4 o) s
Method 07$ A, [" e* o: b" K9 ~- b( q4 ]$ }
=========# s4 y1 Z' Y8 O
, G3 l- a. G( }$ ~Method of detection of the WinICE handler in the int68h (V86)0 e7 r# r% X8 k& Y5 q9 R
$ F. u/ E$ j/ {/ \' k# v
mov ah,43h
4 T0 v3 f3 R D int 68h6 i! E b$ l- F0 r2 W$ t
cmp ax,0F386h# n* f, Q3 H* _* R
jz SoftICE_Detected
3 j8 D8 K3 e' w- C2 N# d9 d' b5 l5 U% K7 \) f* U; c# g' u( ]
/ |$ A9 I- ?, m: p7 p4 j=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- m! t$ ?5 h, T; I app like this:# K' l6 a* N" B! ~9 F
! d% r, p' E+ _0 ]2 c BPX exec_int if ax==684 p( G. D/ }7 ?
(function called is located at byte ptr [ebp+1Dh] and client eip is
+ {( T' W M. s1 u; v. T: Y2 e/ h located at [ebp+48h] for 32Bit apps)( O+ I2 a' {& |" I/ g! A
__________________________________________________________________________7 ?) y3 x; D1 t$ ]. L) {
4 v7 }5 i% X3 z4 x( ]) S! }. |
* {. @, E d4 i* C' c
Method 08# k7 S- x5 r4 a
=========$ s, P0 j8 j$ O" S ~$ O" P
% z# |# _! n+ j7 Y% bIt is not a method of detection of SoftICE but a possibility to crash the
# Z7 V; [$ F% }" qsystem by intercepting int 01h and int 03h and redirecting them to another
t% [ a8 C2 x. N; D# mroutine.2 ^2 E1 R3 q0 c1 m( Y. ~5 i1 B$ `; }
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# K) F) C& A- g" Q( ^
to the new routine to execute (hangs computer...)
a2 y$ X, k* {; O5 E0 t2 f
. X" k- P- @) I/ s mov ah, 25h, k% m0 x! ]5 P( a
mov al, Int_Number (01h or 03h)
# R4 x1 o, d( X mov dx, offset New_Int_Routine2 |. N* H4 R8 C
int 21h7 v4 h1 l$ T* D- U
! S' j9 M5 I2 K__________________________________________________________________________
o8 \' G- v! ~7 p4 t8 [" F% U; c2 ^) g* {' }! T4 }: \
Method 09
, N& d/ H( P( c6 F=========
. D) F3 U/ v- w9 X( K( B3 Q
7 y4 J2 L$ U" K# b1 z3 i: A* ZThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 W/ `9 ?9 h# f4 I
performed in ring0 (VxD or a ring3 app using the VxdCall).6 `" H1 U& l+ |+ y: X' y5 ]
The Get_DDB service is used to determine whether or not a VxD is installed
. v2 Q' F q9 \" e Q# o' @9 \for the specified device and returns a Device Description Block (in ecx) for
/ ], [; l7 G$ ]% v. pthat device if it is installed.! q" g! T& A! S! g9 W& j- w8 b" H* F# {& v
' n! m5 B8 Z* P6 ]! j
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID; k0 }# Y' z+ X% p- v* [# j- n$ y
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 G& ~5 _7 p. l$ R
VMMCall Get_DDB
, S7 W6 x% f, t1 w5 G mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( l2 m& O- d/ v3 J5 u( n& }
( V. e1 S+ j$ g1 b- ~$ y5 ]Note as well that you can easily detect this method with SoftICE:. h) ~" l; X$ U" `- ?4 O# B
bpx Get_DDB if ax==0202 || ax==7a5fh) o; [7 k. W. E: y0 L/ G' ~( i5 E
+ A Q$ j7 b/ r2 S) T+ F__________________________________________________________________________6 `. x. p! Z6 g! \; k# [
? V* X4 n- d7 N" C" rMethod 10" G2 v& s& r! B6 ^
=========* l4 S1 Z/ T' J# ]' ^; P5 S8 H
; E5 ^. E2 |, z H( m
=>Disable or clear breakpoints before using this feature. DO NOT trace with5 W& l6 _7 P% f4 X
SoftICE while the option is enable!!9 } B, S7 J- L" m# v. w0 n
y- r) n ~% h1 t2 F; ZThis trick is very efficient:
7 L% n/ k. S- j0 H0 N K/ eby checking the Debug Registers, you can detect if SoftICE is loaded w: Y. q4 K0 H) r) p2 H% u
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 |1 P4 W, O% X% e# N- V. T
there are some memory breakpoints set (dr0 to dr3) simply by reading their
1 \! N& a' `* pvalue (in ring0 only). Values can be manipulated and or changed as well
' Q, b0 A+ W2 @(clearing BPMs for instance)6 j9 _6 z1 u4 u( X+ u2 @" q
) ?9 A( ]- t' k7 }' @8 J" P
__________________________________________________________________________) b$ h# ^# F6 }$ W! T* N# j
0 Q: V# Z- R' V* Y( r. R
Method 11- n0 p. H* Z D
=========
& P; m0 o3 M5 s) H4 ^% m! J* X# G6 i0 R% }0 B7 e
This method is most known as 'MeltICE' because it has been freely distributed( M `+ G7 s3 q4 h4 D1 N3 q; `* d
via www.winfiles.com. However it was first used by NuMega people to allow
( m6 A D1 B7 z- M- E$ Z/ _) ]2 sSymbol Loader to check if SoftICE was active or not (the code is located4 f: c" |# P' b
inside nmtrans.dll).
4 |" Y+ `( [3 S4 `9 s9 Z, f
/ T1 ?% i, h5 R8 dThe way it works is very simple:
6 g- G7 A& n8 g7 }% JIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; P* T+ U2 \% H* IWinNT) with the CreateFileA API.' f$ ?' M+ T8 R3 g
E: w( U) P/ T8 c+ r6 n8 I
Here is a sample (checking for 'SICE'):! k3 [1 N7 J8 ^+ R* O( a* H
* J, v7 C' G* |$ }4 dBOOL IsSoftIce95Loaded()8 |9 N1 ?0 P7 T2 ` u
{. G. C+ @! l0 r" Q( T
HANDLE hFile; ! q; h- [. c4 y5 N. ^
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ [( ~' s _7 P' n
FILE_SHARE_READ | FILE_SHARE_WRITE,
3 ?. H* X- Y/ @" X NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* g9 u2 z' V( R! } U: N if( hFile != INVALID_HANDLE_VALUE )! I) R$ p) h9 Q. ]* f8 }+ y% Y
{
; x8 T4 [) O# n6 x( C CloseHandle(hFile);
; V! S. R' ~& d' ?4 v return TRUE;7 [) E6 ^) ?, p' i. l6 u5 g. H
}
$ F2 e, O% j& b" ^( `! w return FALSE;
7 Q% U3 Y. l L}+ K3 z% L* P; I+ F1 A
8 D8 \# u' @- c, W, d
Although this trick calls the CreateFileA function, don't even expect to be
2 \7 g# T' N: H) p+ f% }+ o( ^6 t9 }5 _able to intercept it by installing a IFS hook: it will not work, no way!
6 S" t9 [: D6 f" v5 oIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 m! Z& a) N5 n! xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)" E# e. Y8 I/ d0 ~ ^; b' S: r% |
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 c) b( ]5 L d8 ffield.
; Z5 l: \' r- i- x4 xIn fact, its purpose is not to load/unload VxDs but only to send a % m2 k1 K. e' q( f, p
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ _. O, \. O3 G7 d4 k: I9 B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 @* Q/ k; B7 U, O) F L* n6 h, Xto load/unload a non-dynamically loadable driver such as SoftICE ;-).
# R i* |: {( F( t3 xIf the VxD is loaded, it will always clear eax and the Carry flag to allow1 K! K5 \$ s! i8 ^4 u7 {- Q9 l
its handle to be opened and then, will be detected.
1 n; ]/ n5 ^/ _7 B+ XYou can check that simply by hooking Winice.exe control proc entry point- C! h4 j) l6 K4 q2 Y
while running MeltICE.' k/ d7 o$ V9 ^7 G$ N* g1 [* }
% _, p) M3 D& \( C5 O$ V9 z- v ]- E) b
00401067: push 00402025 ; \\.\SICE
9 O1 A5 B; @2 `3 K8 y 0040106C: call CreateFileA
' N- M" g) }7 I) G/ \+ `4 N2 J3 u5 Z 00401071: cmp eax,-001
& ~4 t2 ]/ J" S1 a+ a 00401074: je 00401091. o3 B/ }9 s$ e
, w! q* [ f7 o* A: G0 o, U. _, | F, Y2 S
There could be hundreds of BPX you could use to detect this trick.
3 Y% F: m+ R, \-The most classical one is:/ r0 A( I; ]$ o: v$ i
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||# B$ K h j/ _ L
*(esp->4+4)=='NTIC' Z |8 r( y1 ?/ }
3 \3 D z' Z. P$ _
-The most exotic ones (could be very slooooow :-(
- C2 y" g0 o. S4 j2 ~ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 t3 Q, {6 e3 z+ X+ t6 R
;will break 3 times :-(
% e- L: {3 Z) z6 J1 {8 w) a# u& C B; ]: F* S5 j
-or (a bit) faster: & d# T! [7 a: `0 B6 r
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' Y- |! [0 b& P) s- S2 F+ Y# L3 O: S1 B" e
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ e: ], X8 |: W; W: V% ~ i$ ` ;will break 3 times :-(4 H2 p" j; \# f, H: b; h
4 o: x; b7 S& S$ T+ v" |% `" f
-Much faster:
5 A0 W8 B( s+ @ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' f! Y; x `; h+ J
2 `; C& a0 ~! ~ z* I% }6 S* I
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! C/ v y) ^- M. Mfunction to do the same job:
# w" U% x- N, Q$ I9 n _; ~% j8 p L
push 00 ; OF_READ1 Q/ y+ ^& v, ?5 b' [
mov eax,[00656634] ; '\\.\SICE',06 O- B! i# ?9 H- T1 @+ L1 W
push eax
, \. |! T. D& z! _/ j+ k call KERNEL32!_lopen L4 L3 R2 r& T
inc eax
" l: A, \4 _+ P* o: k# b jnz 00650589 ; detected. M8 F5 }7 N# s8 g. h
push 00 ; OF_READ
) z k4 b) _4 n mov eax,[00656638] ; '\\.\SICE'
9 q- q' t S9 M push eax. D! m8 V! C1 h% m: F6 i
call KERNEL32!_lopen& n' ?. G: Y' Q- t U
inc eax
- r9 _8 e3 H8 n6 G jz 006505ae ; not detected0 t9 ] C& O1 C8 l1 m& [6 I( T, P, }1 Q
& W4 b8 f# B0 V' z& y
0 N: y# t% ]* z# P0 n" Y
__________________________________________________________________________
; Y0 T( u8 i+ t
1 B/ t; C. J9 kMethod 12, y7 z) e; y3 s5 Z3 B3 o+ k7 ?" u
=========
. P U3 ^1 D7 c) r# E9 A0 b( K7 ]( N0 P( q3 C0 z
This trick is similar to int41h/4fh Debugger installation check (code 05, [; `, G1 b6 Q/ Q
& 06) but very limited because it's only available for Win95/98 (not NT)
; Y: t/ q( h# \. n! {# {as it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 V6 ]% R4 i7 X% f; F6 s& N
( O8 ]0 @* R1 l1 [9 ?4 c. L" E push 0000004fh ; function 4fh! ^; \4 M+ H8 M+ p# l# z0 M( s& B4 a
push 002a002ah ; high word specifies which VxD (VWIN32)
6 ?* K6 [0 ?$ O ; low word specifies which service# J$ u5 p- c( t" ~9 O' K
(VWIN32_Int41Dispatch)5 M# C) Y" u' k. ^
call Kernel32!ORD_001 ; VxdCall
' q5 \. E) ?: J; `) N, | cmp ax, 0f386h ; magic number returned by system debuggers3 w) g) B# D4 S* f( e9 E, b1 `
jz SoftICE_detected
5 n4 \+ b" z3 Z6 s4 E; m4 Z$ O$ d1 a7 x7 h4 R( [
Here again, several ways to detect it:$ ?8 s( ]7 H. I6 C: b3 \4 C& A
* I' A1 O. \' O" D7 X4 A BPINT 41 if ax==4f
0 x; {1 o( b# P
5 w( I# h+ @0 |( l BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one9 }& C! s( m/ u6 T7 S$ I |- O( X
. ^2 {( d7 ]0 l BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 e- P" G; Q4 u: U! p% Y+ C& y1 I
: R, ^: K# _0 x3 m" O' {; R) t BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 m' g U- B/ `# a0 l9 b) j4 N& V9 x+ q9 ~$ g4 ?
__________________________________________________________________________
9 M: L- v, ]: ?6 o2 q6 q7 c3 s( P/ D, g6 J$ o5 W0 }% O
Method 13* o" ?. p% R& C+ f+ i8 W. a9 `$ ]% Z
=========3 q/ q8 Q) \- Q# O3 |% G/ J1 ]
% D s6 i! e9 {6 i
Not a real method of detection, but a good way to know if SoftICE is7 i$ L2 S& d# ~+ T
installed on a computer and to locate its installation directory.
' n* k: m+ q6 g8 a$ f2 UIt is used by few softs which access the following registry keys (usually #2) :* U6 x7 C' T" U. W/ ~
2 _* u9 r; ~; J& k. h
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; W0 ]- F' G7 }2 x\Uninstall\SoftICE7 K; K& B, R, [9 W0 Y& v
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ G9 B! j6 L3 [- j" }6 H-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* o7 G6 D- h% N\App Paths\Loader32.Exe
7 f$ n1 F0 P: |1 T& x2 U# \9 E2 q3 a8 c- Y) |* l) u
9 m) |$ [/ ~( D; m5 V3 `
Note that some nasty apps could then erase all files from SoftICE directory
# g, s! e6 u0 H1 z, @ W% k(I faced that once :-() D4 Y+ T, p% o- \
) E! i8 Q4 U8 Z# J3 g. fUseful breakpoint to detect it:3 k: s' D( ^% @5 U9 y
% A- r/ l3 }- r9 v% T3 {! J$ r0 V BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# Z7 r" J' F* K' a5 o
, ^; B H6 J! L4 |: D
__________________________________________________________________________3 x8 }( v' U# i9 |
( z7 _# {4 h5 T. O4 N+ t( [5 G) i1 q0 D9 y" v5 [
Method 14 ) {7 G, |$ D# J( ]2 S4 z: R
=========5 F! e7 m# i3 }
- C/ n2 C+ Q {! D; S8 a5 e
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
$ }5 g. X6 H) ?( Cis to determines whether a debugger is running on your system (ring0 only).
2 a5 r- s$ S. s1 k: X8 H6 q! C& ]% R& U {' S5 x
VMMCall Test_Debug_Installed& C1 X, b. U8 ], X6 c
je not_installed3 b; M* {0 E$ m; |& n
/ z6 ~) p- x+ B2 _/ B2 \# H1 l! k
This service just checks a flag.
6 {- x- r* _' h1 P</PRE></TD></TR></TBODY></TABLE> |