<TABLE width=500>1 X) |- W. V7 ]
<TBODY>, v6 ~, V+ G* x9 E) v7 [' y
<TR>
]/ [7 I" r9 T; {<TD><PRE>Method 01 5 z) s4 }* P: \. K
=========# O5 d5 W; X M/ m! P! U
; N, Y* g5 }8 q* t/ ], N) X7 t
This method of detection of SoftICE (as well as the following one) is
; { O0 J9 J, p) dused by the majority of packers/encryptors found on Internet.
9 m" U0 Q2 X' A: s: QIt seeks the signature of BoundsChecker in SoftICE
! p, ]5 k* S. G; ^& Z- V% y" x- w2 `$ v4 q9 i9 u* D
mov ebp, 04243484Bh ; 'BCHK'
, y( ^. R" }8 b) x8 [ mov ax, 04h
' {# [4 O9 g0 o! T+ C- Y int 3 / h# V! V2 X: t- B; ~+ @! }
cmp al,49 Z' R4 f: y9 \1 f7 o, m
jnz SoftICE_Detected
9 Z+ ^( Q" z& \9 O) l, S
% s. z) F9 R6 a. K1 _' c___________________________________________________________________________
P3 J6 Y: l% G7 m
7 ~6 t, o {; H( _ j/ s( cMethod 02: q1 W* K. W7 X0 e" g
=========+ I; r8 L3 t; Q4 b; k' [
+ n& A) \" n4 g" p& O; oStill a method very much used (perhaps the most frequent one). It is used
/ R' j @+ j1 H" a1 S" N: zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 h! n, i/ P9 b
or execute SoftICE commands...
+ T1 I9 d5 ^3 o* q lIt is also used to crash SoftICE and to force it to execute any commands3 W' r# ]9 ?( C$ X% V/ _
(HBOOT...) :-((
5 j9 R u3 F6 s0 K! D$ `, g0 X
6 N% v' U7 @9 f% |/ sHere is a quick description:" ^, G1 p) L' c4 e: _! {
-AX = 0910h (Display string in SIce windows)
7 H7 e/ v w { N5 m+ ~9 T# F-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
2 w' R3 \: i+ E( k$ N" T-AX = 0912h (Get breakpoint infos)# ~$ X _1 T" T, M# k' p) ^
-AX = 0913h (Set Sice breakpoints)
: S. A; B7 C! a7 h1 N; i-AX = 0914h (Remove SIce breakoints)7 x' X# }1 u- s4 t* y% A
1 g5 k5 G* w, F& }( E7 `Each time you'll meet this trick, you'll see:
/ e0 H3 O3 h- S8 {" g! Q-SI = 4647h0 r) x+ F, F7 `
-DI = 4A4Dh
! [8 l% R, G# F- y! nWhich are the 'magic values' used by SoftIce.
; a4 k8 w3 {, MFor more informations, see "Ralf Brown Interrupt list" chapter int 03h." \- a6 R% Y; F2 T1 c
* N+ U! D! V! w1 k# Z
Here is one example from the file "Haspinst.exe" which is the dongle HASP
$ M9 ]% E2 \/ ^0 T, r8 u9 TEnvelope utility use to protect DOS applications:
+ O# R; M/ R, B$ p" X7 J# w
! u. O6 X2 v% m2 K% Y
% {- L* } `4 S3 w4C19:0095 MOV AX,0911 ; execute command." ~: c( R& I7 W4 Y& {& o+ x
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." {+ k2 l0 A3 U. N- {8 p
4C19:009A MOV SI,4647 ; 1st magic value.0 O0 q- \& ~7 t, i0 ?% `1 J1 m
4C19:009D MOV DI,4A4D ; 2nd magic value.
5 q# J- @7 B+ D% C$ H4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 W% q: O" Z* D' N: A! b- G4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
# m8 k9 [2 W2 [! t$ }4C19:00A4 INC CX' J) v) W% |' }$ ?
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; `6 |1 D3 T: e/ S4C19:00A8 JB 0095 ; 6 different commands.
5 _% p: `; ]; P0 U$ Y4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! i x% y; U$ ]4 M- C4C19:00AD MOV BX,SP ; Good_Guy go ahead :)/ K& u2 Q# k5 T
8 f" f2 o' B V' W
The program will execute 6 different SIce commands located at ds:dx, which
l; `. d: V& u% p4 t) E& Mare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 g. N) u$ ] Z
( l: L1 ]7 o. N1 C! i+ k. k2 ~7 j6 M, y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
, u" U/ P: M) Z' V C2 W___________________________________________________________________________/ V3 E0 {4 g8 o, Z: P
' f4 s9 }* z* u8 R5 u
6 U# T0 j7 C" I' ~Method 03) g9 g( \, M# g5 f/ M8 @
=========9 q1 q$ o# M2 Q5 `1 C' Q
, F; I# \; J9 m3 @% ^Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 h$ }2 e, s W, y" }$ C(API Get entry point)6 J9 ]2 @& O0 e8 G
5 S# b b; T( [, C5 h7 S
! J- [8 O3 S) E2 _2 B3 B9 h& v xor di,di
; G1 D/ p4 A* u& y mov es,di
. {1 {& Q: g: m- ~, Q) W mov ax, 1684h
, z7 g8 d7 U5 z3 R8 Z$ o- e mov bx, 0202h ; VxD ID of winice
* U( o4 {0 y0 r L h" ^4 B int 2Fh# L/ g: y0 }, i' n3 D2 h: B: `
mov ax, es ; ES:DI -> VxD API entry point
- z! n& _& i. } add ax, di3 }8 ] ]" A- D# `6 b: T
test ax,ax
3 u( d U) `. n jnz SoftICE_Detected
* j: M6 W+ r) c) i a, m/ I6 M1 S, O) W& x/ v4 P/ q+ N1 r
___________________________________________________________________________1 j# }) t4 @$ c! k! R
; ?7 y; j/ Z, n ]( r$ t
Method 043 H- j, D4 Q& S0 B- Z$ c* M2 h4 Y
=========; f2 K4 C% m( d3 s, f
$ z" Q% \3 h* p% ]Method identical to the preceding one except that it seeks the ID of SoftICE7 |% Y3 _2 Y* d8 ]" _. Q4 M- m1 M
GFX VxD.5 _$ U: @, H; u5 W: ]
) w- t+ @" V) `5 M
xor di,di5 j& W b1 r$ [2 {
mov es,di
+ I! B6 Q+ c B# b mov ax, 1684h 8 |' |2 }- d6 b
mov bx, 7a5Fh ; VxD ID of SIWVID
+ s) W5 H0 Q1 K1 |2 y int 2fh; P' r1 P# U* }) N1 s8 |
mov ax, es ; ES:DI -> VxD API entry point
F2 l, b8 v: v& ? add ax, di# r( J8 U' ~. i! B3 s3 d* d5 i
test ax,ax
2 c% K$ {4 y; l( {' `& P0 B jnz SoftICE_Detected
% K" @- F$ A! R! G2 T, ?! u7 L
2 J: G: K3 ]8 ~/ _' a( H- r, w__________________________________________________________________________ c i2 q" p+ a4 B4 R, q5 {. G. I9 g
* h5 ?5 k4 a- \/ P4 b9 q1 A
3 l' [7 n: v5 t4 G- D# fMethod 05$ n" g# @: ?, ~1 T
=========
0 m! S- m0 n. m, l" c! S( ^: G$ J" S; H% v N+ x
Method seeking the 'magic number' 0F386h returned (in ax) by all system
: Z: o8 Q. z4 Mdebugger. It calls the int 41h, function 4Fh.5 m9 p8 f8 N- Q7 e1 Y* z! y4 Q) I
There are several alternatives.
3 R) m% Z7 H, m
' Z @: N2 C* P# v1 I0 nThe following one is the simplest:
H0 A1 Y+ ]$ E7 f' D+ k$ a: v
+ ?9 b X/ ?* Z6 }; c4 w' F mov ax,4fh
! M; t$ z1 H, N D/ f1 P3 R int 41h0 D1 A, h+ [4 y0 U, T
cmp ax, 0F386
' B$ ]" R5 Z, _6 n5 _ jz SoftICE_detected" _! _9 N& J; n5 K
0 v/ | M, V7 ^6 ?: g
3 |7 [4 f! @4 D4 s0 v* iNext method as well as the following one are 2 examples from Stone's 6 O+ _8 v! p d! r3 j
"stn-wid.zip" (www.cracking.net):6 ~8 u7 q( ~) F2 f8 k4 f5 |: z
( X2 b1 S( j- a/ k' y! G8 L mov bx, cs
0 Z, i5 I' c# Z) x1 V7 g lea dx, int41handler2
' n2 R$ h! R$ Q xchg dx, es:[41h*4]! n! n, i! S0 X% r2 U
xchg bx, es:[41h*4+2]
9 l5 ?- v M+ g- i/ c mov ax,4fh
$ X1 P/ s1 y0 K( J5 L) h% p int 41h
~3 i6 e/ t) l- _) S- i c xchg dx, es:[41h*4]
0 a6 v. e# \2 j5 @1 i" o xchg bx, es:[41h*4+2]
A: m" x9 ~6 m1 x; N% I cmp ax, 0f386h
, y" h6 |0 B8 O& X( g+ {5 B% z jz SoftICE_detected; X0 P' X/ C I
* x2 w* Q7 _2 Y& c8 ~
int41handler2 PROC* V& \5 o: T( S& k$ x9 _; ?
iret8 M1 k" ~( v' m( ~' \$ p' ~# @: i
int41handler2 ENDP
* T$ d( R2 k/ M$ a- u2 _ g* b6 u' j
( l" m- o, E R, W) [_________________________________________________________________________
# i* O" W& p* l& E3 B
$ T( o% g2 M) {2 Z I( ~$ j
( ]/ w/ n7 t5 e# ?Method 06
* Q8 j& A0 ^0 M* A9 u=========, n' j/ S* x" s9 |6 | M6 g+ S
. R4 X/ Y! e- y6 t# Z
x$ y9 }9 ~% f
2nd method similar to the preceding one but more difficult to detect:
2 K& M: L0 w- A. K3 W1 J1 Y+ j3 \2 Q6 u- U
$ t- W' |; D g) x1 l9 Q$ Z2 b: a2 ?int41handler PROC, c' O$ Q; ]7 Y z+ p2 C
mov cl,al
m, S7 j' Z4 A: j, l* m iret
* J, ^& d- }+ Q9 tint41handler ENDP
! A. G+ i, N- ` ]8 v: |
3 t. [4 ?" ^. k
6 D2 ?' c/ c& ] xor ax,ax
) V% c5 k* F7 i2 u7 ` N [8 ], ^) n4 c mov es,ax- W( V- F% ^8 z% @- N1 Y- V. L9 G
mov bx, cs
/ ^2 U! v1 N3 H lea dx, int41handler' v* G" {, M8 b+ L4 t
xchg dx, es:[41h*4]
( r& l: y c" \2 c6 V/ K xchg bx, es:[41h*4+2]; R; \; ^( p) w8 o1 A
in al, 40h
9 S; C" S( }- z) J* K/ B xor cx,cx( ~) `7 d! H* E$ f
int 41h
3 Q, u8 J$ x, \" K- f3 w xchg dx, es:[41h*4]
* M4 ?3 z6 }, L: W3 O1 j9 P xchg bx, es:[41h*4+2]
# L4 i2 o% ~) I J9 v3 a0 Q cmp cl,al
% n f% z2 D. Q) C3 [ jnz SoftICE_detected
" {( x; y( ]( v0 B/ `8 E3 ?; |- W2 s/ D
_________________________________________________________________________7 y$ h {9 ]6 k& L
' _1 q$ G @# L4 [; X5 N8 M
Method 07
. ?% A8 e( t& N& ?! l4 Q2 S=========
, I( x [; W2 ~! ]
) f: a) g; W5 `Method of detection of the WinICE handler in the int68h (V86)! ?. I, P2 _* O
, E- ?+ p. [* U. l, [
mov ah,43h+ C8 O8 M+ ?) ?3 ~$ V# q
int 68h$ K. o1 ^, R' C5 A b# B" y$ Z1 [. X* o. j
cmp ax,0F386h
+ J! }- \9 x; u( M# ^# X2 x9 X jz SoftICE_Detected7 q+ H. D/ Z* x, M
! T- @# X$ `+ C# Y+ p" d" `8 b( k0 L. k S
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit* R2 b3 s k" z
app like this:
8 E9 _& y4 U( f0 a v; o6 c* j& S. q( w1 S% Z
BPX exec_int if ax==68
0 W! ?8 o1 e; S0 u3 D+ |- L2 } (function called is located at byte ptr [ebp+1Dh] and client eip is
( w. r1 { `( C- B located at [ebp+48h] for 32Bit apps)
2 N/ r- m* U8 P, A7 |__________________________________________________________________________# C, ` n. E5 e# T. y
! Q f! O' W& \* S7 G# w
! c0 X% O: C L2 |- {( }' V! c# IMethod 088 G0 h8 R4 [& t% O( M2 b! V
=========4 O: a. j5 v# S% K+ q# P2 X6 Y: k- @
2 H% w. _" q5 @( }7 z% m! m
It is not a method of detection of SoftICE but a possibility to crash the+ w1 a3 z3 O; k& D3 v9 l" a8 n) @/ B7 M
system by intercepting int 01h and int 03h and redirecting them to another
8 L @3 {7 @- l, Q. e. Jroutine.
: E+ }; k H' j$ oIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# P d" ]" a& L5 r' o2 {) ato the new routine to execute (hangs computer...); a5 Y, I. m; C3 r; e L' b
7 F, ^1 `: A9 _6 n$ Y" z" B' h# } mov ah, 25h
5 H+ T1 q i2 [% P, b0 g: g; v mov al, Int_Number (01h or 03h)
; w3 s- K. ?: A. d6 z2 i" b mov dx, offset New_Int_Routine
/ i/ x0 h6 g6 i+ P int 21h) X7 p$ ~* D9 d& ~2 d
7 n, v, P M! A* D0 G: ~! ]5 h
__________________________________________________________________________$ @( W' _! p2 E% f: v2 ~" ]& w
/ [0 ~. H# l+ |1 aMethod 09* z( q' Y, Z+ p% b; A& ?
=========
) U1 k" u" ^0 C: C
. y$ L. C* h* N7 xThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only f9 ^: W" m" A
performed in ring0 (VxD or a ring3 app using the VxdCall).
3 A- C2 A) x7 n6 ?The Get_DDB service is used to determine whether or not a VxD is installed8 P- Z: W' L% S4 J' m" l9 f1 D
for the specified device and returns a Device Description Block (in ecx) for; V8 F N, L! W' ~; q" ~
that device if it is installed.+ p4 W5 i, |1 p
0 h1 d9 |! b5 k0 R2 V! [, e mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 w5 i$ @' L8 T# p D! @- |
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( v' {& ]2 B& O5 [+ Q3 U VMMCall Get_DDB
6 \9 M% E) |& C! p/ I" h mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ v' k2 J8 O2 c. u0 a( V
6 h8 W) P% q+ p) z2 `$ ?; j0 D' n% ]Note as well that you can easily detect this method with SoftICE:
- X: I" W& W9 q bpx Get_DDB if ax==0202 || ax==7a5fh4 k$ @2 N# E' Q8 }5 s
! l8 e8 [1 a9 W% }5 ^& A8 S3 h__________________________________________________________________________
2 Y; N6 a# n) g2 x) s. Z$ |4 L
5 L6 ?9 m9 C0 DMethod 106 `) Z" E: D* ?- u3 a7 l2 w
=========
6 v9 n/ l. i& F: _; B& c% w) B" ~( k
5 x" e$ g+ P% Q' y6 U* J=>Disable or clear breakpoints before using this feature. DO NOT trace with
( Q) e6 A( ?8 K$ k SoftICE while the option is enable!!* ^: {6 q0 W2 `
! G/ x0 g% p( A- W& JThis trick is very efficient:
& d W, `/ K; A& ~& O1 sby checking the Debug Registers, you can detect if SoftICE is loaded- c6 i9 ?/ P- Z% e% G
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ i( |( z6 V5 x; Uthere are some memory breakpoints set (dr0 to dr3) simply by reading their( l: H! a4 ^( p6 W& E
value (in ring0 only). Values can be manipulated and or changed as well
/ l# S& Z* U- J% e2 W" Q$ B* ]# K, J) }(clearing BPMs for instance)
I7 ]" k. s, a k2 \
+ c" B& o+ i$ L2 [. l( V__________________________________________________________________________
; t+ G0 e" C6 }: {, q5 P2 x& T4 J) R
. Q4 q9 P9 Y: |Method 113 k. d9 }! w% I# E
=========, K4 x8 b, V- m+ {: }
' J2 O" |1 |! j) ?2 a9 P7 _This method is most known as 'MeltICE' because it has been freely distributed
: _. p" F, p# J3 w$ gvia www.winfiles.com. However it was first used by NuMega people to allow4 g4 m7 Q; i% t& {# l4 m$ ~. ~
Symbol Loader to check if SoftICE was active or not (the code is located5 _. l) ~& a/ v: n
inside nmtrans.dll).
0 H( F7 [% I+ B; y' C w: `/ }$ a# E0 n" f; I, e, ?+ K
The way it works is very simple:
- R6 s( E/ G! E& l3 K1 I% LIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- W( }: ?2 x$ Y. YWinNT) with the CreateFileA API.
$ p$ d/ e5 o% q1 n! e
+ W2 `6 X, r# b" {) U3 NHere is a sample (checking for 'SICE'):! f$ H3 W/ W( V1 z
: p/ R2 z" [3 E/ I
BOOL IsSoftIce95Loaded()
7 W* V5 K# d6 ^6 P; ?% S: C{1 ?& |8 c+ {9 F5 [5 A( \. m
HANDLE hFile; + k5 V5 T& d: e3 Z# W) ~
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 y9 n- n( @0 E2 { FILE_SHARE_READ | FILE_SHARE_WRITE,
7 ^$ o; p2 x6 J/ o8 I NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! }! p: C m" ^, t( o2 E if( hFile != INVALID_HANDLE_VALUE )& @. B5 n2 y0 ~! q6 w/ P% A2 E
{
. L, A5 v- b6 M/ @5 U! _ CloseHandle(hFile);0 l/ u" Q$ Q6 _- r/ t, f
return TRUE;
; w# F1 z' n; p' E: ?" n }
/ v: y+ O R0 j, T return FALSE;
8 `$ _9 J/ `% v( N) E. L. h}
. M6 N. L. h0 z- J) ^, M& `& _2 U" p9 ~( p
Although this trick calls the CreateFileA function, don't even expect to be
% j' x: X9 s$ ]$ B9 f. Hable to intercept it by installing a IFS hook: it will not work, no way!
; m4 @; f7 ]/ i u) W- H3 OIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
`% Q2 x0 a' J/ R* \( u# W( z9 vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
# P( \4 H$ D! \) ?( I: Gand then browse the DDB list until it find the VxD and its DDB_Control_Proc7 w9 V4 G. v7 l& F3 B
field.% r7 M5 z, H7 p t' g" M2 V
In fact, its purpose is not to load/unload VxDs but only to send a : Q/ R$ h1 @3 [1 V+ Y z9 V
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# l# w6 x3 \, p+ S1 ~9 [' p3 N8 w
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 e' h2 V- W" J5 Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).( R/ i: K! D5 @
If the VxD is loaded, it will always clear eax and the Carry flag to allow2 Z0 r% z$ h# s/ Y
its handle to be opened and then, will be detected.
3 s- z0 M0 ^+ \# bYou can check that simply by hooking Winice.exe control proc entry point
$ k, r* t r3 Bwhile running MeltICE.
7 D0 |& h& g! A' G: q' _
6 }+ }% q+ _( O" F5 k) y
4 V) v2 _ U/ S, i5 D s 00401067: push 00402025 ; \\.\SICE( [3 v' o$ k; X. r, J! d0 ^
0040106C: call CreateFileA
1 R$ J( a7 Q+ o$ U% n" O 00401071: cmp eax,-0012 A2 A2 \. {* @( `) W+ U* m
00401074: je 00401091 I1 }, x% Z& y9 o5 T, I. L! \
& C) d4 P) B& I! J* H. M4 f$ N& `3 c- i: U
There could be hundreds of BPX you could use to detect this trick.
5 A' h% T& \/ j# E$ r7 v: s( \( w-The most classical one is:- N# W& f$ H% j' V
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||+ O& \+ d7 w* I( a2 `
*(esp->4+4)=='NTIC'& o% H( e: F$ _
- z8 U$ ?, i; a4 e-The most exotic ones (could be very slooooow :-(
( E" n5 o' q$ M3 ~2 _0 r, \# M! ` BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') $ [& e: |# s l" Z7 }5 K
;will break 3 times :-(& M- M) Q! `$ D f) E$ Y- O. l
0 {! @. ]; h' J; c-or (a bit) faster: 3 i) x" b- x( |* f) Y6 D( m) n
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')6 e/ j. q0 o- \9 Z3 e# ~
- G, K+ \/ E( P4 R$ F4 I: K BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) v- c4 Q( P3 k3 r: H
;will break 3 times :-(( v5 K: x! s$ c# Y2 r) {
0 C% X4 h0 M$ K2 B, o0 v6 k
-Much faster:
# X7 K' V4 u5 `+ S2 m BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' W1 ]. u; R/ y" L) k; Z0 R) U8 N& {' N( _# d' Q9 t! v
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" `7 {3 x$ N4 y: v" N0 xfunction to do the same job:
: ~; ` D" e! C. G. J
, g/ v) [ V: S+ _. m! N1 m push 00 ; OF_READ* C4 h" V9 L Y4 o; N
mov eax,[00656634] ; '\\.\SICE',0
. ^' D6 q2 o" I: F; N/ } push eax% R. u$ k# @* H, F% n
call KERNEL32!_lopen' H$ N& Z7 \; F4 f! B
inc eax
' G* }! I, {0 W( P! `! g jnz 00650589 ; detected
, D) F9 E2 ?) Y2 I# x; r) S push 00 ; OF_READ
# [* m+ q% u2 u: D mov eax,[00656638] ; '\\.\SICE'
( n0 ]; ]7 s3 S1 } i push eax
( v% a ?0 K2 Y) q( U- S# A call KERNEL32!_lopen
5 M ]8 l! L6 y6 N L! ?% t- W inc eax
, h. d: e) a5 C jz 006505ae ; not detected' |' j# [: M8 H0 B
: _- R0 _( R" H" [: A3 ^" K0 x2 E) X9 _" i$ P
__________________________________________________________________________0 y7 x% @8 U/ s: F
6 Q4 V. g7 H, L3 C* M; `# SMethod 127 b* G: L. L% |( i
=========
) P3 w; L" t1 k8 e* Q8 p! M Y6 \# i* a) U) ?- P* W0 J( M
This trick is similar to int41h/4fh Debugger installation check (code 05+ g5 `/ Z& m" {( O. }; s# S$ |4 O
& 06) but very limited because it's only available for Win95/98 (not NT)
+ Y. X% [0 i- m% o" h; d% P! Eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
7 q% _, I% a7 K8 |5 D* ?" W4 {( i2 F& N
push 0000004fh ; function 4fh3 S+ A+ J2 t2 [
push 002a002ah ; high word specifies which VxD (VWIN32)5 q( M+ \' h- v0 p$ q
; low word specifies which service
/ O( X$ L9 Q6 b6 o (VWIN32_Int41Dispatch)$ G3 M/ @8 w0 [) e7 j6 D
call Kernel32!ORD_001 ; VxdCall; H$ a1 [+ a9 N, R& A/ s8 w
cmp ax, 0f386h ; magic number returned by system debuggers6 F/ K) t7 K* L: C% g" s
jz SoftICE_detected$ |" ~" X9 ~& J. \1 _; `4 n
- Q, O, C' m5 U* Z$ K
Here again, several ways to detect it:
* g; W/ m3 r8 w- u6 F! v7 ]& ?6 f* V- g. G) Y: {* T+ N
BPINT 41 if ax==4f
7 f2 y" F4 V" X, _+ M
2 w" I8 j5 ^+ [ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
- |4 p+ F( T+ T: B2 l; k; G( q4 _
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
; X( m0 h& `/ w! E' P" s, d& e
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ c0 t( L) A/ e( F$ c1 D
9 ~: j5 H- B$ c& h) H! D__________________________________________________________________________8 C6 M, o) }4 G# n8 t+ P
* A) b$ G4 U2 k ~' I+ JMethod 13
$ |: e" ~5 o3 }( H=========
$ P- _( f7 o( z1 a. }. w5 |0 X# g$ K7 x6 g7 y; D' e
Not a real method of detection, but a good way to know if SoftICE is# [; d% l, H& V
installed on a computer and to locate its installation directory.' i& K* h- i9 ?0 i4 x
It is used by few softs which access the following registry keys (usually #2) :) A# V- @. F8 E, S5 F* M
, L# U/ o' W6 d' `
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 y2 A) S! L1 L# U6 h X* I+ n R\Uninstall\SoftICE/ t5 g7 v- P U E: @* o8 u
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- _6 c7 l9 V( Z' d-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 z; \- g# M* Y* ?( i; A\App Paths\Loader32.Exe b C4 d+ ~$ i- ~
+ C; `2 ?: S( b2 H& f2 _1 D
2 J- p) S: ^& c W& h% [0 c$ }Note that some nasty apps could then erase all files from SoftICE directory
j/ I r) X h. J! h3 R9 c# k(I faced that once :-(
& r& F7 b$ N6 P/ M5 |6 l* O% p, k: |# b$ h7 j" z" @- }& f
Useful breakpoint to detect it:. ^! r0 f5 W0 E! z" h6 p2 y) M
* `2 A0 u8 X- k+ |2 j9 q: O BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'& F# k# a2 X- t9 ~9 m0 M
, X1 |8 m# N: V__________________________________________________________________________7 \: P1 R6 W' l6 B0 @7 ~# R
: R6 l. c* O5 ]( a8 z
& ^9 H$ N1 [- d {. [
Method 14
4 u8 q4 o7 ]- L# J6 A+ }7 L=========- o. H( B/ x# E' e9 a/ K) _9 G
: g1 p m( E1 n8 H3 H5 j$ N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 @/ B4 z" F" ?8 S" L2 |2 q% A/ I5 A/ e
is to determines whether a debugger is running on your system (ring0 only).
) f {6 J5 W. N `/ k' J$ }" h1 B( s3 _: T: [4 T7 G
VMMCall Test_Debug_Installed
9 C( r' y' Z8 K& O( I- Y2 \, x. Q je not_installed
, d+ f$ F d! w; L6 F! C0 Q
/ x: S# e, p9 y5 QThis service just checks a flag.3 K1 b: A' h' z# B2 m# m3 w. `
</PRE></TD></TR></TBODY></TABLE> |