<TABLE width=500>9 E7 i/ k/ w$ J( q8 U/ e3 p
<TBODY> | m! b# m( c' S, j/ [
<TR>- o2 h7 l3 U! z. W
<TD><PRE>Method 01 ! _: T1 E! c! L9 D9 u$ u" A4 @- p
=========
: O; V8 J' O1 Q: L$ t! N# E" o; U! @- e1 a+ b
This method of detection of SoftICE (as well as the following one) is
; F& ^1 z6 C+ N- ]9 dused by the majority of packers/encryptors found on Internet.
8 j0 S- G& [, K4 ~& v7 ZIt seeks the signature of BoundsChecker in SoftICE! @- o! u- n0 u, B+ ? I
) X$ V Y0 N) e9 Q* j
mov ebp, 04243484Bh ; 'BCHK'
q' h* K$ @6 {+ q mov ax, 04h0 `' r3 p, K7 e& P3 x
int 3
5 |! K$ x- K& @" z3 g6 v cmp al,4
7 j. X0 t6 C! Q jnz SoftICE_Detected' \- J1 i/ b. [
/ @8 T* k2 p5 g A
___________________________________________________________________________ q( w3 a; A2 Z* c2 ~
# ^8 N+ u: M% n: S4 Y% O1 BMethod 02
) k Y$ M# R v7 `+ ?=========5 V, T8 Q2 x$ B& X
2 K) E0 |. f# l! t4 Q `, SStill a method very much used (perhaps the most frequent one). It is used
1 f: H# O: `% Q/ f0 E- @- x" v3 xto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" _5 S1 U( j" |or execute SoftICE commands...0 W' u+ g$ O/ d R9 X5 e* t) i: D* S
It is also used to crash SoftICE and to force it to execute any commands
3 Y/ m$ V+ s/ h. w+ B! z1 }! l9 U(HBOOT...) :-(( % ]& l& {7 F$ R0 z1 m* P
. ]$ |8 M( R* M8 }' RHere is a quick description:) R$ ^) w' C* D; ~
-AX = 0910h (Display string in SIce windows)( t+ R1 z: c2 K8 }0 b! p0 ~
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; d7 o& u5 u& A& y7 l2 {-AX = 0912h (Get breakpoint infos)
' }1 A6 z* i @7 E4 h8 a9 i; C-AX = 0913h (Set Sice breakpoints); H8 o4 Z& o2 y; @2 o5 z
-AX = 0914h (Remove SIce breakoints)
2 |5 \4 `/ W' g! U) W7 l1 V8 m; Y/ t
Each time you'll meet this trick, you'll see:; w9 w t/ P( l5 V# o
-SI = 4647h l3 Q1 i9 a( _! [6 `, u+ Z
-DI = 4A4Dh5 ?. T2 k& A& L4 G
Which are the 'magic values' used by SoftIce.& S9 a' H( e, e7 I- @* v
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 @5 l; b7 ~( h' t" H
" x' \& i5 `' U- b& i; V1 GHere is one example from the file "Haspinst.exe" which is the dongle HASP
3 c, y# @+ o6 T7 L& ]% J3 VEnvelope utility use to protect DOS applications:
" p- x; s- |. C, R
& V" b2 D4 S1 c2 w
' r% r) f! W% w6 b9 U: X4C19:0095 MOV AX,0911 ; execute command.# L% j5 w! y- R
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 m! f( Q( T, R# V4C19:009A MOV SI,4647 ; 1st magic value.
2 C- n; s1 W* Z* g& q, Q- f5 L0 M4C19:009D MOV DI,4A4D ; 2nd magic value.
% d2 m/ m) W% z/ [8 j9 }8 L! i4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ J# J' Y2 A' v4 e2 _4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
p7 E! }* Q; {# x" I4C19:00A4 INC CX; Q- ^! @# t5 P: Q0 W
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' C6 r2 R# ?$ I$ F8 D) I
4C19:00A8 JB 0095 ; 6 different commands.; b* V- P: @' s: z! l0 [
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 s5 O" a. W6 t! q" c- Q4C19:00AD MOV BX,SP ; Good_Guy go ahead :)0 I! T% t( T2 d2 y U! [
+ n% l& }, K4 x! `: u& f/ t3 V
The program will execute 6 different SIce commands located at ds:dx, which5 b5 G2 s) m9 ?# K
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 J7 B, {& Y5 \ z
, C9 X' o. B3 B. t, [/ B' u3 T2 [* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 o1 @( f9 T! H2 J e
___________________________________________________________________________2 x/ E& l4 [' v
, W3 ]. z1 h8 {+ P# S5 f8 O9 y& Z- o* A+ d% Y, x
Method 03
- s8 F4 N$ L1 [0 o$ `/ t=========
" x4 {4 {5 ?) j" v+ ~' t& G) K6 n- N# U
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 N. h7 B6 O( x+ ?(API Get entry point)6 m/ p. \6 Q7 a% O5 r+ ~
8 x1 c/ ]# }$ H# H5 @& A! q
) M2 |' _6 Z/ q- S- W9 \& \ xor di,di
' ? n: x0 t, g0 ]- h4 n y mov es,di
' T" p* F4 U3 T+ j mov ax, 1684h $ u3 q' Z& N- P9 Q/ w
mov bx, 0202h ; VxD ID of winice: v' A& N8 W a) g; A# u
int 2Fh
- ^7 `7 Z3 \: D5 U: v( A3 | mov ax, es ; ES:DI -> VxD API entry point
2 E' M' a- [) c$ H" F- Y add ax, di
7 ~; L! E, m" s* e test ax,ax9 D1 ]3 O E! c- G
jnz SoftICE_Detected1 q1 c5 w& C& x; v3 T6 {
1 n- z [; {) n5 W% A% j: k2 c/ w___________________________________________________________________________
. E5 t3 s: g @1 g8 U# Y; ]2 r
0 c1 e. z1 W6 p, t( O- qMethod 04
8 l# _1 C* O" N+ e=========& a# @% V Y3 f3 T0 }
4 n2 s7 A9 W6 u1 \# @
Method identical to the preceding one except that it seeks the ID of SoftICE
7 A* N0 O. J* J. s$ q* j2 xGFX VxD.- G8 D3 D( t) W& U) ~1 l
! E6 P$ q5 _% {# t& k6 E" M& ~- A xor di,di2 z4 g2 [2 f; O- o, E+ u% L
mov es,di
4 i; [3 M$ D# @ mov ax, 1684h 5 L' u& s0 _: y9 j7 O7 ^
mov bx, 7a5Fh ; VxD ID of SIWVID
( [ O+ A. n! D7 [) { v int 2fh
; a1 ^% n, y9 X mov ax, es ; ES:DI -> VxD API entry point
" m& V5 X5 d n) X* v add ax, di
4 r- l, G/ \; a0 E6 r7 `& Y* Q% s test ax,ax
+ Y3 m: B' T5 J$ _4 k8 z jnz SoftICE_Detected
$ X' b3 T; E3 i$ S. F0 _; |& R M$ O0 c' S3 Q
__________________________________________________________________________6 \* C- F/ a: b: N! J! l5 b
: c }- y2 u4 Y3 ?' k) S% b9 _) V2 d6 ?: \ j' Z
Method 05 A3 u" M' o& p" m% N9 h
=========0 w& V, g) y1 n& M# o0 `& N
7 v, q- N: H `; {
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 q: _% m( a0 g' g0 Pdebugger. It calls the int 41h, function 4Fh.
% o. a% c7 O: [* w+ O6 ]% lThere are several alternatives. : R7 C8 n3 _, E; z, n7 T
1 w6 a0 z. h$ EThe following one is the simplest:4 p: v ]9 v; ~6 c/ [
- Y& e; S2 _# f* ^
mov ax,4fh
' I0 V& o' Y) p9 e+ e k int 41h4 B' J( n; ~% U% W8 t _- n E4 h4 I
cmp ax, 0F386
' T2 }$ s; L5 W jz SoftICE_detected4 k- _; v2 a: _; P7 J: e
" m* D: s/ f8 c" }
' p4 w$ }0 X" A) b8 kNext method as well as the following one are 2 examples from Stone's
% b2 U) K) I4 g"stn-wid.zip" (www.cracking.net):
3 B; G' D; K1 ?: A- ~, {, d6 `4 R- P3 U. b6 I) G5 d5 P
mov bx, cs2 ?; }9 U+ @2 @/ W1 d
lea dx, int41handler2) `& m% ?7 i6 T- X
xchg dx, es:[41h*4]
# Z: v/ P! \, ?; x* S6 z" D0 t/ w xchg bx, es:[41h*4+2]
: L, t; ]7 K/ D( N. ]$ N8 A mov ax,4fh& C* d$ d, y9 b* O( C
int 41h8 |5 d. T/ c- ] f! q3 r, p a: b
xchg dx, es:[41h*4]
* w& f7 D( G, Z l+ Q xchg bx, es:[41h*4+2]' n, {& i2 Q; T' y+ l
cmp ax, 0f386h
# D H4 A7 U4 V' n* c: U jz SoftICE_detected' L3 P+ ?( _/ j' f
+ A8 t5 R5 P- [, G6 m
int41handler2 PROC
. ~1 Q, a' t: F' {0 a1 s iret& r6 j3 M- e$ i- z
int41handler2 ENDP
( z1 h+ I: z8 m# A+ H: }
5 X0 ~' N3 G& {/ K: s. G5 G7 c
3 k4 e2 @- H: n2 E: K3 P_________________________________________________________________________) T3 p* k4 z, c) _
" M$ M' `% r" ` r" i; L
1 l5 {9 x4 u* R( B# fMethod 06
, [3 N& n, h* P* b @1 D=========
# Q- i8 W( I) Z ?& z! `, i1 [9 h( g% t
8 ~" L+ l- d5 D/ |- D" ^: r. Z2nd method similar to the preceding one but more difficult to detect:
* G2 g' ?. ?0 @. r; C
+ C. z1 B2 Q$ j, _ d2 O5 K
: F) x3 K$ F4 J3 G' p! xint41handler PROC: R/ O* P% f2 i) R; F8 w) `6 k; X
mov cl,al6 ?: l2 G, o! ]
iret
: R1 @: Q" ?+ h! y% kint41handler ENDP
$ ]7 F* H6 C$ f G4 @
; @$ _3 Q- |4 A- }
" d0 q0 f T# Y! ^( S xor ax,ax: ]: |5 O5 P% H2 A$ i& O
mov es,ax( e5 K) T0 j- j1 c3 O
mov bx, cs# Z5 m7 O$ P% d- h$ G F& m' j
lea dx, int41handler2 K) O: K0 w0 ]7 d# W: ?' G
xchg dx, es:[41h*4]% z- y0 [4 L+ X a4 e# J2 a- R
xchg bx, es:[41h*4+2]
8 G6 S( b3 }$ F3 O6 ?9 ] b3 F3 u in al, 40h
0 _; D# f+ z# o xor cx,cx
0 A7 D2 s2 N: |' A4 v int 41h# D$ U- D; m1 e
xchg dx, es:[41h*4]
! |: K" |, a+ W3 x; A& V2 S, f xchg bx, es:[41h*4+2]
+ [ E: }# j+ u" f5 w/ e+ Q cmp cl,al+ Q3 ^ c% [$ o8 e
jnz SoftICE_detected
' z9 S4 R) }1 c
4 T: {# x K# n3 W4 d_________________________________________________________________________& ~( y- j3 g) m
& i7 k7 w) f u- f
Method 07) X4 R6 ?$ i# Y- D) W8 `
=========! K, r9 I n* P; x) |" F
" M" W" P* S: I2 {Method of detection of the WinICE handler in the int68h (V86)
- D9 P4 @! m; r- c
& `- H5 m/ |$ Y$ }' h) m+ I& o9 P mov ah,43h
6 t% l/ N, m2 P0 D+ a1 V5 Z int 68h
) |/ J o. w2 d9 J' d/ p: s cmp ax,0F386h
3 E7 O0 [5 p4 {; g" R- S jz SoftICE_Detected
$ {6 [1 e% ]" U( [
* h: M3 W5 |' z
( S, [ d1 v( f2 g8 k=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 N) k) k! v- S. E( w app like this:
3 U4 V6 ]6 z n" j$ J( t) O
/ a' z# W+ ~ A% f4 K+ j BPX exec_int if ax==68
* m) k. k1 M7 U U& I (function called is located at byte ptr [ebp+1Dh] and client eip is
) y4 A2 g7 P9 D0 P8 n) q7 r located at [ebp+48h] for 32Bit apps)
1 U0 v2 ~/ K5 z0 d6 O__________________________________________________________________________
3 l, N; ?8 \3 ]% u
6 Z# _9 a2 U p0 L/ C( d" K5 B. f2 g+ T0 u# ?5 S- |
Method 08% z$ l% `$ e6 k4 Z2 |
=========: h/ b* b0 G- P) N" n5 D+ j, A
2 t0 O; S. K nIt is not a method of detection of SoftICE but a possibility to crash the
, X& L: X" V/ k% z: Qsystem by intercepting int 01h and int 03h and redirecting them to another8 ?9 p5 q5 \* U W; r! G8 x
routine.9 q6 I1 o3 g' `9 d( C% o
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! G: s" [2 Y: s, A* `. kto the new routine to execute (hangs computer...)0 x7 B7 G) F+ i$ j$ J
* d$ x7 z: v" e5 u0 Q- D/ q
mov ah, 25h( a% {1 R2 k6 _6 s: @4 G
mov al, Int_Number (01h or 03h), F. L z8 S5 b& \" G- P L) J
mov dx, offset New_Int_Routine0 K7 s9 S9 E6 a) B1 O
int 21h* y! b" V* r8 a5 p- d0 \) L
! o$ ^8 r7 e: A__________________________________________________________________________
" d6 x+ A o W4 D$ k* J( ~6 W j1 w/ ^! V2 N) J* s
Method 09
" S. `1 G3 J/ ?3 r9 n! g=========
h5 ^7 Z3 k3 e2 B* Z# j2 b
9 y; e4 U$ R! g+ JThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ a. E0 |" I s, Fperformed in ring0 (VxD or a ring3 app using the VxdCall).
) m# L; [7 \) S. v1 |; `! i2 kThe Get_DDB service is used to determine whether or not a VxD is installed8 N5 l& N6 h- V7 V/ c
for the specified device and returns a Device Description Block (in ecx) for
' B* P i4 @+ e+ ~3 \3 ^* Qthat device if it is installed.& M7 V, u9 L2 [; l" `
" T( t2 H1 H' u6 @ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
. ]$ d0 p" ? a) c( r, X mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- W* R: G1 F) e& q: l8 \
VMMCall Get_DDB$ _6 g. `) m& l
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 P1 X! A* n! W+ q3 _( E5 B& Z& P4 j7 v
Note as well that you can easily detect this method with SoftICE:$ U; j7 ?4 g. T# w- m" u/ @2 u
bpx Get_DDB if ax==0202 || ax==7a5fh
" I. E* k3 d3 r
( O9 @5 W0 x( F6 H% a! j5 G$ T__________________________________________________________________________
) s# m$ o4 M0 A* |& V" Z8 T8 i8 ^$ ~5 [$ U' @$ K
Method 10, y- t. d7 n2 i6 ]% _
=========
; f6 g: k9 Z4 P$ }$ l6 I& q |5 z7 N) y6 y
=>Disable or clear breakpoints before using this feature. DO NOT trace with
2 ?3 H) J; A5 p: ~ SoftICE while the option is enable!!5 u& G% Y. D# r+ o
, |5 w3 j" x4 ~" W" ^
This trick is very efficient:& j1 C8 G0 L2 u8 J
by checking the Debug Registers, you can detect if SoftICE is loaded+ Q) T/ @% q2 D; b9 P
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
0 _0 g8 D, q2 z: R' zthere are some memory breakpoints set (dr0 to dr3) simply by reading their X/ s0 q: l f% T& i5 @
value (in ring0 only). Values can be manipulated and or changed as well
6 k+ A4 f5 ?1 v, a(clearing BPMs for instance)
( H/ }5 _ [# Q! s7 p. E( J# p) r& q- S
__________________________________________________________________________6 ^9 d- _/ u( c8 ~3 {3 F) l( w
) C0 t* Z- f" G) e( J& E: x
Method 11
* s& {1 d7 @2 }3 a% ?4 ^5 F) n0 }=========
- u) p1 j+ V/ V. C. S9 ^( P$ \) Y: J" m- {" |( h3 }% A* w; L
This method is most known as 'MeltICE' because it has been freely distributed0 h; N0 K% ^0 u+ F F2 ^/ Z3 I/ z/ X
via www.winfiles.com. However it was first used by NuMega people to allow- w% p2 P6 {8 p4 o, b0 }' I! h
Symbol Loader to check if SoftICE was active or not (the code is located+ Z% j" S6 x+ z
inside nmtrans.dll).* J9 i- y& M9 K1 a2 E/ ~
; u8 m% T# k5 l) {2 d, I& j5 ~
The way it works is very simple:
; Y. p! ^6 S% N/ P+ PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# c, ? ^6 w6 M- W: K* e( Y6 PWinNT) with the CreateFileA API.
% h: d k. v8 ^' P' |7 b% ]: f) f0 n+ V$ i4 M
Here is a sample (checking for 'SICE'):
+ @; H. n( F; y/ @$ _3 y# u8 w; j+ }2 P! ]: e
BOOL IsSoftIce95Loaded()
" y8 R- P- K q4 I @1 _: u{
% I- b: v9 q l% u! i. p HANDLE hFile;
2 Z, w$ e* p o1 n hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ R& E$ A) ~/ e* `
FILE_SHARE_READ | FILE_SHARE_WRITE,, H6 A6 w6 a, B% t. U
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 D. o& \7 K; H% ?* _- j, ]# Y! i
if( hFile != INVALID_HANDLE_VALUE )% p ?: U2 x9 M1 _& W- f
{
t$ l3 c2 v& B# x. i CloseHandle(hFile);( L) z8 e+ J; u5 Q Z Q( {& D% U9 f
return TRUE;
/ b# Y. _8 X& O$ g3 @) T# r, q; b }5 z6 N D0 d O& W1 P
return FALSE;
& _+ q& @7 z: h' L* ]9 F}
5 t- l" J# e- ~9 F0 V6 n$ Y1 C% r) u6 @4 Z' F) P$ u9 i$ e
Although this trick calls the CreateFileA function, don't even expect to be
+ G7 C/ Y* A0 Xable to intercept it by installing a IFS hook: it will not work, no way!3 J3 K' {" w$ y0 }/ ?% H8 E) j
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
# d D5 K+ K4 v3 [service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 j. n' k ~1 e \
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 Z8 w: `- ~1 l. I
field.6 r! T7 ^3 X4 m& h, @% @- D
In fact, its purpose is not to load/unload VxDs but only to send a ( ~ m$ e* o! j3 {
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 z/ I8 E; j, E1 y4 Rto the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 m6 l+ p5 P, z7 Z) eto load/unload a non-dynamically loadable driver such as SoftICE ;-).
- T8 L5 x: S! r# C* d% R- MIf the VxD is loaded, it will always clear eax and the Carry flag to allow0 h4 x9 } M* ~9 N V$ L7 Z. ^0 c
its handle to be opened and then, will be detected.
" `9 |- r$ m. R! Z# T2 fYou can check that simply by hooking Winice.exe control proc entry point$ c$ T+ x1 b) \4 `8 A: }2 u% q
while running MeltICE.
/ X3 k, Z8 y/ r5 f, L" F2 M
- O) w1 x& X8 A( J8 ~% @6 w* B& A$ l
( v: z3 K5 \# I) x% n" r 00401067: push 00402025 ; \\.\SICE9 z- k! Q/ @$ P
0040106C: call CreateFileA
0 n* L; h, t/ ], O% o/ I: s 00401071: cmp eax,-0013 C; Y! O+ K) f3 M
00401074: je 00401091
9 W+ |0 F- W$ s9 `7 l# ^& { @2 K+ ?1 k9 V3 v: E* w8 R
5 P4 u: R6 @/ Q1 _9 Z& \! mThere could be hundreds of BPX you could use to detect this trick.8 \* n/ e+ D `
-The most classical one is:1 J( z m: f0 T
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
0 i' _# [" K* z% D9 R *(esp->4+4)=='NTIC'
, M" V6 I: u2 s Y/ n; I. F8 v+ Y9 s- }* N% A
-The most exotic ones (could be very slooooow :-(
/ a/ @8 p7 R2 R9 R1 C BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') & i# Z& E3 w+ X- H0 _
;will break 3 times :-(
9 j6 D' `' w. i& T7 [. m- ^( Q* Y2 n$ ~8 P9 l- @ `$ q6 E- g/ f% r
-or (a bit) faster:
3 e" A) H9 M i; H2 H; O BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
8 ^+ E# v: Y; Z8 ~1 Q S. ~3 W: o' ?: I. N' M8 G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - X; n9 A8 n5 j
;will break 3 times :-(
1 M4 `4 r A. c- ?, }" X% Z' t$ A8 v" K7 Z9 Q Q
-Much faster:0 i9 V0 _1 K5 ~: ]" f
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 z3 P) L5 Y; q* d0 a9 U6 c) i
/ [; A# m) l) p* w( YNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
. [% i4 }$ H$ N1 c7 K# ?function to do the same job:: m6 u" ]6 b7 e1 f( {) S2 H
# c2 R: _: {: s# O push 00 ; OF_READ
2 o4 j7 |0 |* _# |: d mov eax,[00656634] ; '\\.\SICE',05 h0 z& k" P2 @3 }" `) I5 N
push eax# F8 E; {: b2 }' v6 }! a3 [
call KERNEL32!_lopen4 _5 ]% D5 m+ v6 f- @4 p: ]
inc eax
7 R8 J6 G; N: `! i2 H3 ~2 L& ]# q jnz 00650589 ; detected- V' v, [8 ?; B4 g
push 00 ; OF_READ
; r# q O- N$ J; [ mov eax,[00656638] ; '\\.\SICE'* d1 Z6 I+ z3 K% x& z! a5 Z5 s% A; D+ h
push eax
; F8 Y0 y1 [5 W- l9 f" o call KERNEL32!_lopen+ K+ C* W' H9 f9 U8 h+ O" x" j3 {
inc eax
! t1 A# e5 U8 w& i' o jz 006505ae ; not detected
! O% D' p) C# h% }) Q
* | D' O0 F. V* _# n/ v* @1 P! _0 s, ^/ A6 l# Y
__________________________________________________________________________2 D, n; k% ?5 Y' q
6 d# l( P$ Y7 d
Method 12
. Z" z* g5 x" B) n& S4 G/ R=========) k$ u( i0 [6 | S9 C! f! K8 M
) ~* S) x0 ?' G1 H+ P0 e; K* sThis trick is similar to int41h/4fh Debugger installation check (code 05
* z/ w% V" z" v/ ~ q% _; A& 06) but very limited because it's only available for Win95/98 (not NT)2 q& N( r% t9 [7 z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 a2 ^& O& R; a/ U$ h3 f. N, z8 p& s j6 F" g/ n
push 0000004fh ; function 4fh- k! j6 V0 A- n8 }9 ~! F+ i
push 002a002ah ; high word specifies which VxD (VWIN32). d. b0 k: Q. t- r! Q. Z
; low word specifies which service
1 z6 B3 L1 F( `" }; V (VWIN32_Int41Dispatch)8 `% q6 b6 @& Y8 K% W- ]' G+ ?
call Kernel32!ORD_001 ; VxdCall0 x% \% }& }& H2 b0 g0 l- N
cmp ax, 0f386h ; magic number returned by system debuggers: t" ~! x: p2 U+ g$ `
jz SoftICE_detected$ ?1 A( `# K/ h; F; w8 X4 @
# j4 {; ]. f0 M J
Here again, several ways to detect it:
& y) z% X2 q9 k! Q, d) s+ f! Q/ }& ~8 @% z
BPINT 41 if ax==4f
+ }6 M& u- @6 S! h& o) S3 c z9 k, u% {9 c# }
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one& H8 I: T9 ^- t" i' q
$ r ?* ^3 O4 r! S( n BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
% e9 V! Z9 ]7 l2 q2 U8 E5 k5 K# [$ }% z: L- P
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!4 h8 N! a) [+ f Z% v4 U( k7 s
' h# T5 a z& l, ]- l. L__________________________________________________________________________
. j+ P o8 H* n1 A; O2 ~! T7 z0 q1 k9 B8 j
Method 13
/ p! G( s9 m- h+ _2 O* x; E=========
6 z! j* I6 ~) \: G, h% y- Z- m/ L
# [# `# K9 z+ J, Z0 V) UNot a real method of detection, but a good way to know if SoftICE is9 U4 ]2 N( D) u, X8 A- X" n
installed on a computer and to locate its installation directory.$ a7 Q$ }6 k3 Q4 U, f
It is used by few softs which access the following registry keys (usually #2) :
* {. | N3 j* `/ R" }
7 _/ H5 Z6 {9 v-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, u8 n8 d0 F4 s5 a
\Uninstall\SoftICE
8 M4 u# o1 ?5 W( ~-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 `. Q+ x4 s4 \-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' `& |. [3 |9 T- [3 X! v
\App Paths\Loader32.Exe
& E7 M* E/ g7 F/ L, D! j
3 X0 ]3 ^- _! u8 u" ?! s, g2 b* K0 n. \9 O3 B* u
Note that some nasty apps could then erase all files from SoftICE directory
/ G& {/ H, `9 M* o2 d3 E& @# @(I faced that once :-(
F4 |! h3 N8 @
3 }3 Y. z3 a) ^3 [Useful breakpoint to detect it:
% V4 f9 _5 l4 h% c$ L# R, M* ?* @- a
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" B: b# v& f5 N0 S
% w9 {* U9 [7 Q& R# b9 L5 ]__________________________________________________________________________
W$ @0 s+ Z$ B+ I% e
$ _6 l, }6 m7 c) v3 {
6 {) ], m- o9 M3 o" D- a; K9 S+ } v: PMethod 14
0 _6 n6 [7 g: \) s" V2 j3 N- a=========
' g0 K: H v; h4 e2 N
+ M8 s, W* p6 P+ b% s; cA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) N) P6 f# e- @5 F5 ]& sis to determines whether a debugger is running on your system (ring0 only).
4 L6 q- L( ?0 |: Q, m" X8 Z$ w' k" } a+ V( A) q
VMMCall Test_Debug_Installed! E# {4 a) ~# L9 L6 ~% E3 ~
je not_installed( k' p" A3 }' I
% w+ N0 s) s3 v* r5 D+ i0 ^3 bThis service just checks a flag.
) j! P( U1 q }3 \% R1 t4 |2 i# X</PRE></TD></TR></TBODY></TABLE> |