<TABLE width=500>2 w; y8 j7 S2 ~7 y
<TBODY>% b: {2 @5 j; n: V6 @9 V
<TR>" O" Q* j7 B V0 ^; V! @$ p
<TD><PRE>Method 01
2 u' j# Q" `/ A=========
. d- v7 X' i D8 P5 [5 x3 v s- C# O9 z' m, \; D! K( |7 N
This method of detection of SoftICE (as well as the following one) is
' U6 t0 r7 @: x( Fused by the majority of packers/encryptors found on Internet.
4 X' A8 I6 ]8 Z% jIt seeks the signature of BoundsChecker in SoftICE/ W' d- h) C1 _. i; |: I
0 @0 ^3 M! }1 p7 K Z$ C. j4 T
mov ebp, 04243484Bh ; 'BCHK'
9 G- |6 B5 Z( w X, ~ mov ax, 04h0 Q' H5 N& R$ A4 K- m, g2 F
int 3 5 i6 N. V. Z. z* a$ k5 [3 S+ m
cmp al,4; x! T& X1 D* q+ B
jnz SoftICE_Detected
) [) B( z/ ]$ I x* f) }3 t' ?- o$ Y2 p
___________________________________________________________________________1 {* d3 ]: y2 P' G
* P' H* C* u" B/ w/ D0 O, uMethod 02
5 L e q# ~! Y, j: ^' k=========
7 E6 F/ q y& p
/ Q, `9 E, @0 i/ p9 ~+ @1 K% i% RStill a method very much used (perhaps the most frequent one). It is used
* l) c" D2 o9 @to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* N9 `! O: ?7 y& C7 z, F" e5 p/ ^or execute SoftICE commands...( Q8 o+ L! `& _ ?6 B" s
It is also used to crash SoftICE and to force it to execute any commands' M/ f1 h% p: U2 y# ~
(HBOOT...) :-((
3 @6 [ C" z* F4 n( g/ z# \! F9 c& w6 I" b
Here is a quick description:. C7 M1 N' u& q4 f
-AX = 0910h (Display string in SIce windows)9 C7 m- ]4 H8 R# A' q" `* z
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) T* o- w; W. @! U8 N-AX = 0912h (Get breakpoint infos)
1 U% R6 e4 J5 N1 F F! y" q-AX = 0913h (Set Sice breakpoints): b7 G% T2 Z0 I' E5 _# C7 Q" n h
-AX = 0914h (Remove SIce breakoints)
, _( q4 Z u! b7 {' x. n$ z1 Z1 @4 T8 }
Each time you'll meet this trick, you'll see:( [5 @0 ?6 }6 j7 y4 T; Y1 n" E5 A
-SI = 4647h
8 U/ d4 L( ]. W; C# Z-DI = 4A4Dh N& h" ]' \( d2 C( i, i7 V9 R; ]. N, g
Which are the 'magic values' used by SoftIce.0 l. n) [* P& |8 ^
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 q2 a/ q! j7 u0 H/ J1 t* ^; D- b
# A D* o- O, n: D- B* [Here is one example from the file "Haspinst.exe" which is the dongle HASP
& S) e+ D" |0 q' sEnvelope utility use to protect DOS applications:; Z$ D4 r5 a, B) q2 y1 K+ c H1 ]
5 u t( c l- @* K
& z g, G/ s0 m+ g2 ^& {( T4C19:0095 MOV AX,0911 ; execute command.
% o3 r2 x5 ?: `! e9 Z4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; `/ @- G2 }9 [+ n) E7 M5 G- Z4C19:009A MOV SI,4647 ; 1st magic value.% _; |, o# j# v! M* | Z* |
4C19:009D MOV DI,4A4D ; 2nd magic value.
3 G j4 \& k; E4 N% M# `/ s% u+ K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*). n& W( U" i* M
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
. d$ e8 \+ C$ M; ^' N9 c7 E5 G4C19:00A4 INC CX& v! K+ _2 r& v5 S
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
/ \& {% L. |4 M9 p* a1 U4C19:00A8 JB 0095 ; 6 different commands.
! n& B1 ^4 C/ X4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! |: G! G9 X( J/ O! R7 }- S4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; T: S$ ~% F( X4 v* Z8 B) w) \$ N# A' Q/ J1 h8 @3 P
The program will execute 6 different SIce commands located at ds:dx, which
5 [+ S5 H2 z- K1 X) Y7 k- j7 bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 g: }& K& `- d/ O! @
) y7 j/ z3 G* D! C; ~4 W
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
0 ~6 K. ^5 m1 T# N/ @___________________________________________________________________________+ Y; S' G; }' X
. I* W, M0 d7 o/ ~ z
5 p9 x' I2 S* ~6 ]0 |- ?/ }+ HMethod 03
: m/ W u# e+ |1 w6 O7 r=========3 L3 ~9 t6 l, M& w3 I! j
4 {4 N/ N9 l0 @+ F' s2 A
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 f# q* I9 S u5 j0 S& q( t(API Get entry point)
& V" _# E# D8 G2 u
) N, l: D( b) Q: A! `& X' O6 r. d+ S
xor di,di
A R3 Z g9 `2 I. P6 l mov es,di1 D" T4 A# ?: l! ]2 ~# G& Z
mov ax, 1684h / n2 k3 c7 d9 ?2 p5 t
mov bx, 0202h ; VxD ID of winice
' C7 M8 k- } r' b6 H int 2Fh
/ |" V4 p: b* r# ]& W mov ax, es ; ES:DI -> VxD API entry point
0 z! X4 P V1 g$ j" j add ax, di
, e5 }' n9 s. I( q8 F; I' [; K% R test ax,ax+ ]2 l4 t Z' `9 m! \4 z
jnz SoftICE_Detected
( F, y2 G0 a6 k' _
( e; A# ] P9 b. A___________________________________________________________________________9 N2 j5 P* O6 o- J y
3 J! k1 s$ {+ Z( O
Method 046 {+ | e* H7 |5 i9 h+ x9 [5 o
=========
* i' w/ |1 }0 P3 e7 ?# n5 @+ a6 s9 t
( }# a% Y3 x0 G9 M$ v: V, V% `- g# FMethod identical to the preceding one except that it seeks the ID of SoftICE
" d& q4 e" c9 a& DGFX VxD. Z; v2 G0 W3 }' Y
. f9 k% F& {- ]4 N7 C- [- E xor di,di: Z J0 Z0 u) L
mov es,di
: Y* M' b( Q4 v2 c* g7 T# Q2 R. P mov ax, 1684h 2 N" j) n' i3 ~3 \/ y) n
mov bx, 7a5Fh ; VxD ID of SIWVID% ~4 F X4 ?7 N' ?. j' X7 n
int 2fh
7 N# i, F& H1 T, M) `& C# d- ^5 V mov ax, es ; ES:DI -> VxD API entry point8 R. q, P, {' \: C; m$ ?: c( c: [
add ax, di* i, e9 M. T/ X7 ] K! ^
test ax,ax' y- r% \6 a6 C0 K0 c
jnz SoftICE_Detected* y8 {0 v+ f+ P! @! L
! t- H1 P2 Q2 X( Y3 Z T__________________________________________________________________________
5 b5 Y; e. ~7 ?) A! r" n- x2 q/ P4 v
& c* ^- ~1 A/ a9 z
Method 056 [, I# c" i' S" t% }
=========
* a+ @) h0 |; w* z
+ y$ `: o& K3 t8 c# T' {5 G; NMethod seeking the 'magic number' 0F386h returned (in ax) by all system
& n! S! k' I% c$ d4 }debugger. It calls the int 41h, function 4Fh.+ b: T) T" x. I* C
There are several alternatives.
- L* ^; ~4 A; d, w5 E/ A3 p& C# W$ ^- H# V
The following one is the simplest:" L& {8 l+ A! R# c/ ?" w/ z4 j* i
6 f) @9 u5 Y. H- {( v& ` mov ax,4fh
: ` Y) t, f/ Y1 L int 41h
/ R$ G- y: c6 }: K3 H, o' z cmp ax, 0F386
! }5 X2 m9 W |( C, B jz SoftICE_detected. f' ]" i6 b7 ^$ _ D5 _" h
1 U* }& t5 n, ?" t8 k
8 O' F3 i, }% QNext method as well as the following one are 2 examples from Stone's * e+ I: y+ w W& C- [
"stn-wid.zip" (www.cracking.net):( d% X) A& O) H5 q0 g2 r" q
) o( v9 s2 a4 X' U* b- h& S/ q mov bx, cs9 S3 [9 }/ ^( I+ k0 F9 M, z! m @
lea dx, int41handler2
! ?% @: \0 Z$ @) c7 ]8 z xchg dx, es:[41h*4]( P: |% {' h4 l0 @, R( L
xchg bx, es:[41h*4+2]
% c4 Z7 s. [$ J4 d* M mov ax,4fh) A% b& Y- i5 Y* k& `/ b
int 41h& N) B! N7 {5 t" S/ N6 K
xchg dx, es:[41h*4]' E/ t4 |4 L' @/ t. q
xchg bx, es:[41h*4+2]
" l) M0 K6 a( B6 }* W cmp ax, 0f386h! N# @* h# \* z" L7 h R/ H
jz SoftICE_detected
4 N/ n' C# _ u) o& e& A2 m, A& v, @7 o ?! E9 k) `0 A J
int41handler2 PROC d" u* M. F/ U) y; X9 s4 G- v
iret
& s% }$ g- S h& d; c/ Gint41handler2 ENDP2 ~# x3 |5 n- S+ J" A+ v/ h1 @
* @! _" L/ J; B" L) e% @
- o% F) `7 l/ ]5 D* b: u_________________________________________________________________________
2 C% s7 ?/ p0 ], @3 w& A+ j" c7 ~2 u! L
( ~1 x* b/ w H5 u9 wMethod 06
- R& v* b* O, ^8 i* Q. r8 [& t=========6 ~+ Z' O+ F+ E0 H! A/ P
1 ]( O) \4 W$ _3 k2 Y% R
2 Q& X3 }- q. g2nd method similar to the preceding one but more difficult to detect:
) I' N4 S4 v9 ^0 G
# C' H i' _8 b% r7 @# R% r; p: ^% B/ X* {5 H0 p, X# l
int41handler PROC" x2 E: K5 \: _# F# b
mov cl,al
$ j8 Z; S0 n8 x! v4 S4 K7 m iret
, \5 K* O# t$ d0 L. O0 }int41handler ENDP ~& o' e) X. T. O8 k
; U+ |! P) o* N; ?) @# f
" D; n% ~' ?& z( L5 n6 D xor ax,ax
" N0 V6 O' N" _: r: W/ V mov es,ax/ ~5 [$ ]1 O& h
mov bx, cs
$ z# e. l- ~* P( \+ a) x4 d lea dx, int41handler
. n1 `" V3 s* C, x* s, l3 C$ Z4 F0 b xchg dx, es:[41h*4]! m: u0 C- N& {8 {& w( f7 V& D
xchg bx, es:[41h*4+2]# s, y6 w! @4 G9 |( e x& O6 c
in al, 40h& S3 l! W' w# {& O( ~' S, ]
xor cx,cx
/ ?7 k, M) J8 d, Q! G int 41h
4 p! q# `& `6 _" a* Y8 }) ~4 u% X. {1 C: l xchg dx, es:[41h*4]1 S! w- \/ t7 n1 ^1 V; h6 X5 z3 N
xchg bx, es:[41h*4+2]/ @" V/ p; I! P& | B1 |
cmp cl,al" F; f6 \8 e0 i9 K5 u" H" i
jnz SoftICE_detected
; x( p& f7 I( c" L5 q
0 o& \2 K; {, R: h. P6 s_________________________________________________________________________8 N) _9 X: o9 q0 i8 w+ F/ g
# n7 X) ]6 o& r* S2 I% w
Method 072 C r% Q; h- [; v: w
=========0 u9 U: G+ E$ W* U h
+ R' P2 r. W- ^5 \+ [
Method of detection of the WinICE handler in the int68h (V86)/ l% m* M* G F1 j9 N) _! `, `
* G8 \/ m' W- ~% G H% F mov ah,43h
$ P: `( y/ I9 a1 c int 68h0 D) L4 ]( G- y- j, V* N2 f$ }, V
cmp ax,0F386h
: q+ L# H# c0 e0 w8 N k jz SoftICE_Detected
, L/ b) G7 C2 A# @- g1 Q9 I( _2 w8 r$ V. S" I
* ], B( l. h, t0 f( C=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit8 U2 f9 Z0 n/ E! u" \
app like this:( U* c' B+ y4 O" }+ M
6 N3 o$ `: P0 A* F; ]+ I/ I: a
BPX exec_int if ax==68, T/ H1 F; ?1 j* ^% {
(function called is located at byte ptr [ebp+1Dh] and client eip is
3 A0 u$ R& W3 G u) q located at [ebp+48h] for 32Bit apps)( P8 }$ O+ Y2 U! Z+ ]6 m! q8 b
__________________________________________________________________________1 _! H9 v8 \0 M/ y# B
# d0 r: q& j4 ~) _& N3 `4 d
% ^" w+ X& p7 Z1 x9 Y i7 aMethod 081 g0 R3 w, D7 U9 t3 U
=========5 B E/ W4 _9 N5 `. t0 W' `" J
8 Y8 u( ?. R- a4 L
It is not a method of detection of SoftICE but a possibility to crash the7 V1 @6 h' l- K) q( \ z
system by intercepting int 01h and int 03h and redirecting them to another( r- Q- n8 _2 _
routine.0 p7 y0 f8 f* v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# U% o/ A/ x+ I3 n1 Z7 Y1 n X: c# v
to the new routine to execute (hangs computer...)0 K/ g. M9 B+ Q5 X& k9 K
8 ^% z% D& _. I5 \- ^* R( D
mov ah, 25h
! r9 u1 B ?% t- r3 ~ mov al, Int_Number (01h or 03h)% _) }; f! ?2 Q1 ]2 l
mov dx, offset New_Int_Routine
: B/ D( q% e; \1 z1 V/ U+ U int 21h8 u7 Z; E* b" p* S) |5 L
3 E% V* E4 |! W__________________________________________________________________________
6 y0 i3 g1 ~3 `9 o+ K6 j, ?
* [5 Z3 t' L# V( m0 I8 ~% fMethod 091 l, m; S) C7 {+ m
=========% @3 Q0 X b/ A4 O) v- F& k" i
: \3 G$ j. N9 f! z# b9 e
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: p' c* Y! v5 Z3 G. E' v; |performed in ring0 (VxD or a ring3 app using the VxdCall).! B l9 B* Y/ Y) g6 F8 I9 v
The Get_DDB service is used to determine whether or not a VxD is installed. V0 O% S- @% W2 ^1 C7 d
for the specified device and returns a Device Description Block (in ecx) for
. S! P# E, y( L& X% {/ b7 Nthat device if it is installed.$ R, {1 n4 Y$ V8 S% f
& C; _$ D' y+ K% J. e! b; {6 j# J mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID* R/ b. h) F) ~, ]" X# @
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-): }# {8 N& a+ O" F7 e3 M# r# W5 {
VMMCall Get_DDB
+ W/ z& h( K( x7 w& H- }; B mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed" l2 S& d+ t" F+ B
0 s4 n! Y4 {& v% }Note as well that you can easily detect this method with SoftICE:
# P/ o- A; g% I bpx Get_DDB if ax==0202 || ax==7a5fh3 }# F2 g3 X% B( w9 ]
) V7 y1 y( \1 j0 s9 n9 T$ K! C__________________________________________________________________________
/ R4 {2 F; j+ \- m6 V: d2 I3 k. F
Method 10
* ~6 ^4 {5 T7 d2 ?6 r' @4 C=========8 J( u* H8 O2 `7 x
$ q( |$ B' x9 d, j; C- |=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 l& L6 |/ c- d& f/ |1 f SoftICE while the option is enable!!
1 }1 v( p- E" U% p$ Y1 N0 d; T) S0 k8 u
This trick is very efficient:* F% g& X( E! G7 U$ K f7 K
by checking the Debug Registers, you can detect if SoftICE is loaded" ]7 R$ R X$ Z6 n& L' e; i
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" S/ E+ S3 M% I: B) |there are some memory breakpoints set (dr0 to dr3) simply by reading their l+ b* |7 z& i5 g4 h
value (in ring0 only). Values can be manipulated and or changed as well
h7 G/ a) r" u5 S# P(clearing BPMs for instance)( e# X4 N0 L, Q) k+ w
. a% d% I B/ f
__________________________________________________________________________8 p& l: P3 O+ ~9 g2 K1 _( I: E: o5 i, ~
( W3 y) P; E4 n1 E9 yMethod 11( _, T6 Q- z3 @0 g' W
=========
' l4 v4 F a! m. t; S
4 o6 ^- a3 I( l3 I5 i! ~3 u7 tThis method is most known as 'MeltICE' because it has been freely distributed
- ]! ^, \$ L% B5 k3 Dvia www.winfiles.com. However it was first used by NuMega people to allow
, a& g0 }/ C8 n2 E1 x' _2 @Symbol Loader to check if SoftICE was active or not (the code is located9 u+ C3 v9 y; |! u
inside nmtrans.dll).
( A+ |: G8 q; W! }" P- v( l: R: h X/ b- c
The way it works is very simple:
7 T5 H. h8 {% P! vIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- ^3 L+ s$ E6 JWinNT) with the CreateFileA API.+ h( _1 P& D) U$ s' L
- C7 _0 H/ n4 O$ z; m
Here is a sample (checking for 'SICE'):
5 M; F6 V; E8 Z/ j, `& k0 A& p3 D& Q5 Y: C
BOOL IsSoftIce95Loaded()
9 o4 f! R2 g0 D- D{
9 j' a4 ]0 `" b* L/ e' x% h3 D HANDLE hFile; ' v* W9 E2 S. }: R' `7 C
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 w( s# K" d1 t" e3 }- `2 m FILE_SHARE_READ | FILE_SHARE_WRITE,
% o% p7 }" X2 o2 m NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
8 c' ]; |$ Y: F! L$ q) x) j' K6 ]& h1 \ if( hFile != INVALID_HANDLE_VALUE )6 i. N2 W1 U# T5 q# Z
{/ L( n8 ^, u1 l; W3 G0 x3 b( [
CloseHandle(hFile);
2 a- s# A% S6 B/ u0 ^+ U( y return TRUE;
( g- S; d/ y7 R2 ?# x6 ]7 i2 I }
5 {- J) e& |, O" N) u return FALSE;
" S! Z- |$ t& i- \% b$ B2 [}
8 B' Y) E, u% P" n; I& l. M# @% P4 h# `- ?1 f! I+ s
Although this trick calls the CreateFileA function, don't even expect to be' E$ N1 J/ B. O
able to intercept it by installing a IFS hook: it will not work, no way!
! |; R {* l; A* L% C% a3 tIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
- K# C+ q) W2 p1 o1 {+ eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ l+ u$ L! B" {+ g9 D5 i
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* X2 H& ^" E( L5 Dfield.
- r4 }& G# M- vIn fact, its purpose is not to load/unload VxDs but only to send a : E+ Y3 x9 V& q& _; q9 Y' x
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 r3 v: V# v: V4 Z, l! Yto the VxD Control_Dispatch proc (how the hell a shareware soft could try
" R, Q2 f- |6 E. M4 Ato load/unload a non-dynamically loadable driver such as SoftICE ;-).6 Y1 [2 @2 l+ R. I0 ]
If the VxD is loaded, it will always clear eax and the Carry flag to allow
- J& ~- A- i: G5 }its handle to be opened and then, will be detected.
" q0 `! K; o- V* JYou can check that simply by hooking Winice.exe control proc entry point
3 m- N# w3 |, g( u. n5 ` e5 w9 Y1 Q. dwhile running MeltICE.
2 P. n0 s+ D8 z$ P( L! ], J! |: n J) Q0 i
% B/ H* K' ^/ y# T 00401067: push 00402025 ; \\.\SICE. w/ d3 ]7 z8 t' o
0040106C: call CreateFileA, t0 l0 D5 K" A
00401071: cmp eax,-001
5 n* w( \9 c# P/ V+ N) B7 V' ] 00401074: je 004010913 g* Y9 ^' p8 C0 l8 p9 k/ W& h
# ]( T. n+ _7 |3 R- ?* U
/ {% `+ Q9 O+ l; _* s5 K. ~- BThere could be hundreds of BPX you could use to detect this trick.7 ^3 e$ ~, Y) y. k4 Y, R
-The most classical one is:
8 M% B. f2 x. K8 P& c: J4 ` BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' || r; `# R; `! y
*(esp->4+4)=='NTIC'
' m' L8 y/ ^ o0 v' Q4 r, m0 Y' ^* V- y" v, p" w
-The most exotic ones (could be very slooooow :-(6 Y5 T+ u8 N# y% D0 d: Y
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 c; l4 G4 ]" @$ P# G- U
;will break 3 times :-(
[5 S: k8 P! x8 F6 D' a, @5 n1 |+ N: Q; s1 o! V0 |6 l
-or (a bit) faster:
0 y8 I# W& u; ` BPINT 30 if (*edi=='SICE' || *edi=='SIWV')- V: b# o" j8 a' J
. {( J# H0 _: y6 p5 a
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' . j0 p* d; _% ~6 l2 w: m4 z( |
;will break 3 times :-(
/ Z+ P# z$ G @ z4 B) C, D$ R9 F
, p' |. x5 `' U y5 Y4 @-Much faster:8 M. m, h. N: A: ?" K
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
. F6 _; |) N2 m4 ?( v$ @4 I: ?% d0 j8 Y3 y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen8 w/ Y, L4 X- @$ x, Q+ ~' m
function to do the same job:1 f1 t/ h$ L( }6 G1 C
; n$ D: s8 E& {! _2 k$ q" x
push 00 ; OF_READ" \0 ^# _4 W, V5 x) q. a6 T
mov eax,[00656634] ; '\\.\SICE',0* [" C( P3 S" {& J
push eax( X( M0 T+ G! t0 m) |
call KERNEL32!_lopen8 l D' H7 Q1 m( M% D
inc eax
$ {$ b9 V0 p* G) r% n( s jnz 00650589 ; detected
# a$ B( w- K! J' e# ~! H push 00 ; OF_READ% s9 A& n; o3 n& o0 K1 m
mov eax,[00656638] ; '\\.\SICE'
3 x0 r7 \ r! @+ `9 Y9 Z5 [) j: b push eax
}, o8 _- r6 E8 j/ l call KERNEL32!_lopen* u3 I! ?% f8 H1 Q& E7 v9 o
inc eax! ]( v. n0 Z9 _) k- a& g% Z, G1 I6 r
jz 006505ae ; not detected: \& T% U3 W9 x! w5 t
5 o' C Q" q: ?1 i" A S) ^5 O% J c8 T/ Z j3 D& d
__________________________________________________________________________
+ d. Z: y% X- J- Z% R
, h8 ]. k& P* lMethod 12
5 I7 f. Z; ], x8 c=========
, m2 O( C+ m; T- B$ A& i! f% D! G, v2 I* R: E
This trick is similar to int41h/4fh Debugger installation check (code 052 Z8 A( u) p! A2 E# t* R5 ~9 k% Y
& 06) but very limited because it's only available for Win95/98 (not NT)
0 e% X4 C# n5 Cas it uses the VxDCall backdoor. This detection was found in Bleem Demo." S+ P5 W* K% O
# u/ O5 x2 V, d* b% K b1 V5 T7 _2 ?
push 0000004fh ; function 4fh
9 z- x4 O3 X/ F" h push 002a002ah ; high word specifies which VxD (VWIN32)
0 Q" L, _+ _ ~0 r5 S) o# { ; low word specifies which service% c: u2 ?/ S; u: I4 g
(VWIN32_Int41Dispatch)4 O3 b* \/ R1 H
call Kernel32!ORD_001 ; VxdCall
; u% ^1 T0 _0 T" P+ R cmp ax, 0f386h ; magic number returned by system debuggers ]' r6 \9 U2 @5 U2 j! }* e3 F
jz SoftICE_detected
4 W$ {# m; x" c) i# w7 v9 |# q1 y, n; |: B6 ~0 D# l; ]; D
Here again, several ways to detect it:7 V' O/ W( t5 v3 e
* F! @. k6 m. ?- S
BPINT 41 if ax==4f
4 M" N8 x5 p3 x* c, }
+ h$ h, Z1 @) e BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one# J. L! l* ~: e; `+ _
2 p+ @% E9 Z. z BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. ^2 K6 ^2 U w; z; g
8 C9 S q. v& h1 {) R1 N# j BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!, B1 S1 v# i; o
* a8 G7 t! I3 j
__________________________________________________________________________
/ E+ A* o1 k- D0 v* i$ p
8 V; v9 D) F1 d, ]" U" V! zMethod 13+ _6 [! d$ ~, O7 ^' [! c2 y, m8 o
=========: v& v1 ]' L+ D% j6 e- U; {# K; I) n
8 g) e7 B- z! j) W2 zNot a real method of detection, but a good way to know if SoftICE is) e7 p8 L. x/ N0 S% @! A3 p
installed on a computer and to locate its installation directory.1 z* z& a8 T4 C; E3 U0 r
It is used by few softs which access the following registry keys (usually #2) :" z) q7 Y* B2 h3 p
# d3 Q8 S% D2 C% B/ |
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ S5 H$ _- D+ U# V\Uninstall\SoftICE
/ G! I( m0 y3 C# j! P5 H2 ]) {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
0 u2 _. O, ~! ?6 ]: c5 l-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 f; j9 Y7 q6 h% P: o! D\App Paths\Loader32.Exe
9 G/ r. z7 T2 n8 r1 \
( n8 Q4 S7 R7 k3 }' b) h& o1 ~+ Z6 m( c. A
Note that some nasty apps could then erase all files from SoftICE directory
; [0 ?% m. w I5 [. a8 s(I faced that once :-(
, I- x3 a7 s/ u$ f: z6 M, N5 X# s2 }' i
Useful breakpoint to detect it:
$ W3 P+ u* t3 R5 q% L% d$ Z/ }* O# L) |+ I5 o; h0 Z; b, @# W
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 R/ w8 @8 S q1 [7 X& s/ I/ }
$ L1 K4 x& X# F# V4 g
__________________________________________________________________________7 N# W$ ?( _, H9 D) \
. d/ V/ v7 B4 k# {8 E5 R4 u
3 Y/ w1 L% Z3 k: N4 m$ N( FMethod 14
$ f- i9 d. @0 G0 R `; e: t=========
8 r# @+ W8 Y) I& |/ a% @ j2 d
& |( F! y8 q5 [ C. w4 A3 sA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: ~( u* x& u8 u+ R+ z. a' y/ Nis to determines whether a debugger is running on your system (ring0 only).
0 u8 b+ P8 a$ O# ^+ ~
# G2 g- R* j% ]* U4 b2 e; \ VMMCall Test_Debug_Installed
3 x- N$ H# O" R" b6 x5 A, [ je not_installed
0 P: S! ^0 u" D8 |* s- F g8 ^
+ R0 y- `4 f3 Q& w2 X0 U( O9 s, r: N) wThis service just checks a flag." c: E& x" ?/ x3 l8 U# T
</PRE></TD></TR></TBODY></TABLE> |