<TABLE width=500>7 t2 a) ?) S! @' k+ k7 B
<TBODY>8 ]& L# B4 S2 E; y3 N( G
<TR>
( c5 I7 \1 E$ m& m9 q7 B( Y<TD><PRE>Method 01
# `" D6 o8 N7 J% T=========
, ]/ O' q; Z! O' \! f) c; P( b( z7 I/ y- d: J; F
This method of detection of SoftICE (as well as the following one) is
6 C* r7 }/ _: }8 R3 jused by the majority of packers/encryptors found on Internet.7 U* A% ~9 K( k! F/ @
It seeks the signature of BoundsChecker in SoftICE
% v9 G3 q9 B: ]+ Q) B& R+ N- R6 ~% w) w, \4 j3 C' D
mov ebp, 04243484Bh ; 'BCHK'
5 h6 D9 T( ^1 m L& q1 @ mov ax, 04h, D: b+ k$ n( ~1 n
int 3
1 g+ P3 _& S% I" U" k1 M$ I cmp al,4! E0 i. C2 G! B+ Z+ N. ~ c8 S
jnz SoftICE_Detected, c& D$ w T7 l
: ]5 S, b2 H2 C$ R3 Y
___________________________________________________________________________7 x2 ^$ Y( g* i4 \, C
+ h# U0 r t! B# |, @- ~6 `- Z6 ZMethod 02) s _! G: D$ h1 K3 v$ B/ j0 i: j
=========
" q( v: o5 ?1 b: M0 D, ?* T9 R4 G% U% Q' o! }
Still a method very much used (perhaps the most frequent one). It is used9 ~% A+ {# v, f' J
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* ] n8 _0 D0 E5 {or execute SoftICE commands..." T) i1 k w+ y' {! e+ ^! |
It is also used to crash SoftICE and to force it to execute any commands
2 j/ h8 s7 D# L2 S1 e* ?* v5 h(HBOOT...) :-(( # \% _& R' d* C% u) P# u
- N3 U! @$ e: D2 R, ]! \* XHere is a quick description:7 r% h3 Y' T. l' S0 M8 s/ j0 b
-AX = 0910h (Display string in SIce windows)' R" [/ Y& M! ]" U* k
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)! N) ^. Y. ]3 A* Y7 p; X, W. ~
-AX = 0912h (Get breakpoint infos)
2 O X h+ ^9 M6 G-AX = 0913h (Set Sice breakpoints)
; `3 l P8 V$ j1 f$ n* k1 O8 ^-AX = 0914h (Remove SIce breakoints)
1 H. M9 e, T8 j/ f7 W) {: n
- `% B! p2 L5 I2 J% r$ ^Each time you'll meet this trick, you'll see:
' F) l+ u( c, s$ C9 k$ |$ I-SI = 4647h
' u8 u$ A8 b8 y; ]-DI = 4A4Dh* e& Z$ I8 K* h# U* D& x F0 n0 ^% J- I
Which are the 'magic values' used by SoftIce.
) d) x. H. v" y( PFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 X, e7 }2 {: x, e
1 T3 y- v# V- z \1 C% vHere is one example from the file "Haspinst.exe" which is the dongle HASP4 O( B% ^( W7 F0 y. c3 v& w6 d
Envelope utility use to protect DOS applications:; Q5 a9 R: k8 |* a0 @. ^6 Z
- J8 \+ E: I9 t: K( c k& O
1 t# S8 @, V: M: G
4C19:0095 MOV AX,0911 ; execute command.
2 i+ X2 f3 w- [* N6 ~4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 `, A1 M4 y/ ~9 Y, t4C19:009A MOV SI,4647 ; 1st magic value.
4 D+ j+ H8 i! s+ Z1 R4C19:009D MOV DI,4A4D ; 2nd magic value.+ R( l# {- O( W8 r
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ U+ U. P" N+ D+ z& Y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
) l, d$ E* R: h4 k4C19:00A4 INC CX
7 A% r1 U4 U/ b3 @" `2 E4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 P3 c% g+ N& c# O; P, r4C19:00A8 JB 0095 ; 6 different commands.8 Y4 A# [, `, g9 r, ~5 p0 ?
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% A- \2 a A! k! X* K: N4C19:00AD MOV BX,SP ; Good_Guy go ahead :). z g# A3 T* s8 O4 x/ J9 v
( D5 v2 A) I$ @
The program will execute 6 different SIce commands located at ds:dx, which# m! m8 d' ?, m" T" B+ o
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( C/ W1 M# A& F
6 X9 E5 u" K5 n' S% F) Z3 g* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% g9 E! U2 i, Q9 W( m- A5 ` H___________________________________________________________________________
! I6 A' L9 O: x$ R1 C! W
" [- B, U$ g H3 P+ q0 e
% j9 ]: T# R3 X& IMethod 032 J; C4 V/ ]+ u
=========! U. i! i5 s Z4 n
) y3 Z2 L* X" L5 pLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h# J3 G V& |9 s2 F
(API Get entry point)9 h9 N1 a, ?; |# a2 @3 O# L
( h- j3 j! K, @7 M! \3 i# e
8 R( R! G0 o# r xor di,di: P2 s+ v0 p1 T. Q5 q
mov es,di
) U' \- t& v6 c; [% \2 ?* A mov ax, 1684h 7 p$ ]+ M" P( I
mov bx, 0202h ; VxD ID of winice
. f) R1 o `3 W! c2 w2 H int 2Fh I* T# z2 u: c% \
mov ax, es ; ES:DI -> VxD API entry point5 m+ J2 }) y$ ~# H6 Z' f* \" ~
add ax, di
+ ~# P) u3 M; t" I+ H test ax,ax& e' r1 t6 ^6 u+ q3 A" Q
jnz SoftICE_Detected
9 c, z9 O/ V* b& z# t; H$ l/ w" a; Q% [9 D. k
___________________________________________________________________________
. p- g# d% A5 F! _) Q5 ]
# m6 N* a1 L1 o& E1 iMethod 04# l- }/ p; B( K0 p: V0 ]# C8 @+ ^8 }
=========7 ?2 ` U' I9 x$ I9 Q0 w0 u
8 H' ~2 ]. X6 X! q; J
Method identical to the preceding one except that it seeks the ID of SoftICE
0 F$ T# b5 s/ X. G( RGFX VxD.
! h! A, _* z* j
( Z* b8 Z s' S u6 `3 p xor di,di+ f h2 y/ Z7 P- J6 X
mov es,di+ u: m) f6 U; O8 C# e6 @3 b! Y' u% T" ^
mov ax, 1684h
) E/ c0 Z! a% k! }2 P mov bx, 7a5Fh ; VxD ID of SIWVID; {- K( M9 ^6 U5 {8 Z
int 2fh, i1 r& s4 r6 G4 s8 ^
mov ax, es ; ES:DI -> VxD API entry point+ U: A8 [4 y. V! L
add ax, di
9 r; u2 e, l$ @9 R8 s- i0 M test ax,ax
+ t7 _" Q4 U7 F" e" P8 A. J/ B jnz SoftICE_Detected
$ J( T0 |) c4 @& l$ r
5 E0 E- p6 n8 V* {" ~__________________________________________________________________________
$ X7 K4 X: X/ [; H0 I5 f6 f& E6 k- e( r5 _4 H' l7 o$ d$ x; q& w
2 X6 }; q3 f5 F/ aMethod 05
5 m0 J& _: C# |: R=========! r: }; E' D& d' d0 k0 O9 k
* d3 B6 Y; p; q9 o6 }# P$ |: V8 ]
Method seeking the 'magic number' 0F386h returned (in ax) by all system. ^ G6 v- j/ ^+ |1 X
debugger. It calls the int 41h, function 4Fh.8 P2 T7 ~% H! e' j
There are several alternatives. ! L. n2 N6 i% z* j# c J
/ C' C' m- @. }+ m; f: ]2 A* o' v! nThe following one is the simplest:
* j+ E# u5 g8 x% c
0 J9 l5 ]& L2 S mov ax,4fh
( w/ ~8 J; C; {* N, c int 41h
1 y( y7 l( | ~8 U1 o9 ?# R$ U cmp ax, 0F3868 M# S9 \! ?; P4 o' X8 e1 D
jz SoftICE_detected6 @( m+ J" E b3 N+ I
, a' G" C* P) G/ o* ]6 @
1 z9 L) n* c3 w5 W4 z) O
Next method as well as the following one are 2 examples from Stone's
+ P) H# m+ J7 E9 C; K6 T"stn-wid.zip" (www.cracking.net):
, A5 O4 t' z P
$ K, a# Y9 b ^) R mov bx, cs& R9 _6 |) K2 m, l* A' ~2 R
lea dx, int41handler2
8 l+ d# E9 I' @- l2 I/ J+ L xchg dx, es:[41h*4]! ^% J& l4 N# }* F6 X. o/ v
xchg bx, es:[41h*4+2]% T+ _* @* t! W8 l/ K U2 R
mov ax,4fh, F y# b1 I% Z2 G8 W- E Z/ J @
int 41h
" J6 `: @) w/ {# X xchg dx, es:[41h*4]& E8 z3 ^ a. X2 a, l6 t
xchg bx, es:[41h*4+2]' x- q7 k2 S8 B$ [$ B; l0 K
cmp ax, 0f386h6 |! Q1 Q2 {& m4 R8 v# ]( s
jz SoftICE_detected
' \. S* K+ \$ |& O C" Q/ A9 `
( z0 s: L4 q9 F: D8 Nint41handler2 PROC. y$ w7 o7 N8 P9 m% v
iret
. Y* h2 L0 G4 y# P7 `$ U# fint41handler2 ENDP
3 ?8 S& D0 t B$ n5 I
) K- ]& s* o' g% {9 I0 ?' M
9 l3 r8 b# g% P1 U_________________________________________________________________________
& R; z! v& N. r; ~7 m
! H+ m; c" S' I: o( _5 C" J* n* P
I, x \ ~7 t0 K% U, mMethod 06
2 Z) i. C& N5 I6 N. H=========7 {" n8 m7 R8 w2 E, f0 A3 V
" p P! Y/ }. e9 d
& k* K% T8 k: q2 V* x- Q* i2nd method similar to the preceding one but more difficult to detect:
: o4 I- X/ Q1 G3 L% l! L. h4 G% @+ H( c
: L4 [ J: S0 j' x% Sint41handler PROC
7 q$ C4 M; o9 _: V; h X mov cl,al& M- k" p; @. G- Z ]' y1 z
iret
8 ]5 Q1 S: d- ^! T4 h0 Y) o4 D3 v# ^int41handler ENDP
+ u V. b+ W o- G. ?3 T$ W" W: ~* D4 ~8 K7 z% q
; }$ l) r# A9 c% O) P2 L
xor ax,ax
. B: @. D, J4 r$ Q! H9 t mov es,ax
+ g( I% U. ?9 t& N# k: } mov bx, cs" u+ u& s1 A8 }6 L6 g h
lea dx, int41handler: [9 |; `# G8 ?: U! ?
xchg dx, es:[41h*4]7 z6 b# C8 L: ?* X& L7 \- L
xchg bx, es:[41h*4+2]+ c1 h) U. O5 j- R" P- P
in al, 40h# Y+ F' P. s5 x# c
xor cx,cx# t' L( W: O% g3 V" ^! Y
int 41h& R7 @7 j: o& _; c- _" N
xchg dx, es:[41h*4]
5 p- m ?+ N5 P0 s xchg bx, es:[41h*4+2]
- ?! A# g; L- c" m ~+ f cmp cl,al
$ o% N ?# J8 ^9 K jnz SoftICE_detected
$ m8 Z/ U" S) ~; K) X j5 Q
& J" d$ I* A% i5 [) L* ]6 H_________________________________________________________________________
& H2 R( x& H4 L$ A+ T' e1 r$ W& Y7 H- d
Method 07
5 m9 s( i/ @; h( {8 c=========! g! R% b$ _. o6 a1 L k# m. ]! k
+ C7 y) s2 _5 ]. U3 q7 h0 l' N, W9 iMethod of detection of the WinICE handler in the int68h (V86)6 r+ i& X1 F/ K {# C; g( E
; u0 j# Y3 \% X: K- z mov ah,43h* U; D2 i# }% X$ \# x
int 68h
& o e0 {( W9 [) u5 h) c' L. u cmp ax,0F386h7 q/ k A8 g! l9 V
jz SoftICE_Detected
a# W% N- v8 O9 g/ g- u$ h0 W& r1 Y) j! N' k1 `! U
1 v5 c6 t9 L' o. j! k+ e- K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ t# B% e8 w, w) M; ]/ s: r app like this:% `3 G6 w' m8 S2 _3 X
! `1 g& e) C* \; |& u BPX exec_int if ax==68
$ ]- }. `- e9 z9 _% o# ~ (function called is located at byte ptr [ebp+1Dh] and client eip is
H5 k$ @+ B2 P5 C* J% D located at [ebp+48h] for 32Bit apps)* L9 ?4 a3 S) T T( n
__________________________________________________________________________
3 b3 }6 a1 V* c( M+ ~; [4 z. a6 A8 q$ V& ]" D5 E# q& C; U, E
3 o- X2 z7 Q& O+ \( tMethod 08 _) x6 A+ R; Q: p
=========
0 A; J) \9 Q+ m/ g6 m3 S
& N1 D9 l6 B& p$ L# ]It is not a method of detection of SoftICE but a possibility to crash the& C" g5 h. n) `2 X) {7 @
system by intercepting int 01h and int 03h and redirecting them to another
. W4 d. R" _. O5 d6 Mroutine.
5 q4 h4 c6 f" Q5 K6 t; K5 T, cIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
+ s% l5 A- _3 c3 Y4 \% n2 ~to the new routine to execute (hangs computer...)
" ~& ]; g" q8 d" ^" K' y
6 Z. F2 C u! h: K9 }% `$ q, M mov ah, 25h( T4 b7 Q- @. M& _' K+ v5 K* L
mov al, Int_Number (01h or 03h): R+ ]2 c7 V; {8 b* \
mov dx, offset New_Int_Routine9 G, \; ~5 Y* x& @2 M/ t, Y
int 21h
8 \$ G( v8 Z" ^! `
1 E( u* E. G. S5 W) P1 U8 ?# ^__________________________________________________________________________
# T: H3 p- s A2 R7 p6 B
" I4 X% C$ N) `7 AMethod 09
! o$ v) R8 p, L' R3 Z7 Z=========+ u; k- d3 k9 H7 Y
$ H* E8 e% U& w8 _* H. y+ ~$ RThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ ~+ b5 m I3 C$ V: c. Q. @" l2 @
performed in ring0 (VxD or a ring3 app using the VxdCall).
$ R& N( Y# l# g7 }# m( i BThe Get_DDB service is used to determine whether or not a VxD is installed+ z: M, N; v" g. m6 ^, \* T
for the specified device and returns a Device Description Block (in ecx) for
# E) G$ ?: I4 Ythat device if it is installed.+ _0 h8 N; J5 F/ u9 w3 L
9 V" G4 I$ x1 F6 |8 X; r0 } mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: t- P. Y- O2 m0 g4 A mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 w+ b% k! b/ N, r9 H0 w" j3 Y
VMMCall Get_DDB
6 J8 E6 l q& H% w3 R: ?; r: r mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
! Y, M8 o% e) U6 z/ I& ~4 J5 ?
* L. ~" H# v/ f/ r- F5 iNote as well that you can easily detect this method with SoftICE:8 L8 G8 |( J$ _+ W/ q0 g
bpx Get_DDB if ax==0202 || ax==7a5fh
! B0 N, t! W( X4 x+ x8 c8 S3 i- x
) C. \+ Q8 I9 ]$ m5 i+ h6 g__________________________________________________________________________
3 l1 {, ?, |0 I6 p
. M* h, Q8 d% Q4 Z( a+ y' E# YMethod 10
2 i. q* ^( J. K=========
# ?2 C0 F9 h* V6 \
9 L, c: `6 @5 w7 m( \# r=>Disable or clear breakpoints before using this feature. DO NOT trace with$ C: `7 }, P$ K( ?- m
SoftICE while the option is enable!!
$ U f; z( j0 V% j5 d# B0 @7 D
0 L: G# J) C9 N2 ~This trick is very efficient:! [& r9 G6 |, K5 G4 Q) R6 ~- H* v
by checking the Debug Registers, you can detect if SoftICE is loaded
$ \$ s+ n2 r& a; n1 j: j$ z3 C" H4 C(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
~, p8 }5 R) K( Bthere are some memory breakpoints set (dr0 to dr3) simply by reading their: b5 ~9 p% @* d; q
value (in ring0 only). Values can be manipulated and or changed as well3 ]' e& K: J0 e1 P. f3 Q0 H
(clearing BPMs for instance)9 }0 |$ N! a" D3 o
; r; O; ?2 l& }__________________________________________________________________________; g' w0 o) |, @' F
8 U0 O" r9 Q' E/ \: zMethod 11
6 T& l& e1 b8 E3 Q, G=========
5 i* \. P. V u" Y% h/ z
- \ Y, c) f" o; nThis method is most known as 'MeltICE' because it has been freely distributed
& I! r% X( i! ^% a/ ?. zvia www.winfiles.com. However it was first used by NuMega people to allow
) _2 b3 _1 e" w& U/ k" GSymbol Loader to check if SoftICE was active or not (the code is located
( d! N8 {- q. B1 P A2 `inside nmtrans.dll).1 u1 Y/ g0 V/ ~3 M# b4 F
/ Z3 v& @3 m5 O+ q; q3 _ `/ I- uThe way it works is very simple:
4 x+ V+ A; ]: m* XIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: s; w# B: {4 u9 n8 {1 CWinNT) with the CreateFileA API.0 H/ s, y7 k# d$ F8 u
3 k# M. ?* y1 d- Q( }7 W3 V( MHere is a sample (checking for 'SICE'):1 F" h9 D( h' _& z4 c
( F$ `: H( m1 e* o. k9 W5 W
BOOL IsSoftIce95Loaded()
/ A% i" d. O! e, T{
0 J' o0 }% a9 T2 S# `9 G! _ HANDLE hFile; ) V' w7 T a$ S; O$ n6 E0 ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ t6 W' ]9 o5 R! B+ H9 {9 `
FILE_SHARE_READ | FILE_SHARE_WRITE,
6 J, T7 D% G# R" v e0 O NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 C4 |) s3 G! N7 O5 \$ I, p
if( hFile != INVALID_HANDLE_VALUE )
* p. [$ k s* w: I/ G7 ? {
3 X& q( e1 L6 f+ { CloseHandle(hFile);% k( D. N+ x0 K2 ]4 i
return TRUE;
, F2 ~1 s2 \5 s% B9 M+ K$ a T4 a }
; B3 O0 l4 m! U2 M8 ~& H return FALSE;; y7 {6 S% H; o" J( [
}
2 T/ D( E/ K- P& ` e2 j" W& r/ e- Y' D9 J+ A4 m+ X) p t. F
Although this trick calls the CreateFileA function, don't even expect to be
) o7 r4 {7 M( O( K/ e% H# ]able to intercept it by installing a IFS hook: it will not work, no way!
v7 A$ ]5 {$ |! H* Q( o6 YIn fact, after the call to CreateFileA it will get through VWIN32 0x001F# N6 {& O9 m5 [
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' O1 h5 X# f }9 d# s( L& A
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 w ^( E4 c" X; y2 \% u9 [
field.: r5 c' m+ J4 Z5 j& O' ~; z
In fact, its purpose is not to load/unload VxDs but only to send a
T6 I7 p1 `" D. U3 ?2 uW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 C4 K4 y3 R/ K% e# R0 `
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
0 j% m. V0 }( g. _to load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 ~1 G- L5 B, q( c9 {' h8 }1 @+ {. ZIf the VxD is loaded, it will always clear eax and the Carry flag to allow% p. M" ]* G1 \0 I) _
its handle to be opened and then, will be detected.
3 j& a! ^$ z: q3 mYou can check that simply by hooking Winice.exe control proc entry point
/ e" X7 [. z5 n3 cwhile running MeltICE.
' v" M2 _! y: L, J+ [) K
. w) f2 x* A1 j( L
- X) m$ a& |8 r. m9 U( `- E 00401067: push 00402025 ; \\.\SICE
$ q) R* @$ ~# X. I& p6 h 0040106C: call CreateFileA
2 L+ L, H* f3 r) r, R4 Q8 E& u, H 00401071: cmp eax,-001% U+ }; J- @8 Y9 g1 g# r& x7 K
00401074: je 00401091
% I6 C; i# A& Q) i; N% s9 ?, W! N* L( \9 G
) B8 L8 p* Y( t
There could be hundreds of BPX you could use to detect this trick.
8 P5 x; ?5 D9 P; x. z- q-The most classical one is:/ T8 [! B" ^% h* g0 B& m
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ x! G/ x+ K8 q& v" `3 D% I1 h *(esp->4+4)=='NTIC'2 p! T5 h; P x
) a: m; _$ U; \% u6 W u) x! ]% z-The most exotic ones (could be very slooooow :-(2 D7 o# _- O7 f! a4 }
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( d# B1 E; z; ^) {6 r: f
;will break 3 times :-(
( c# g4 T3 ~$ q' j' [
5 x/ x; m, V6 k6 n-or (a bit) faster: $ S) a3 E! e! Y, P& v
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" d- ]/ l0 x& C' }8 B" q. g
+ u, a5 W! m f/ l& z' P Q: d BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
* C2 U" `( m$ D w ;will break 3 times :-(
" q4 u1 Y+ F0 u; G4 z. ~2 a. U
7 m- v' y( I1 G- i5 g/ o-Much faster:; w& }1 w2 t* ?, L9 y( \$ n1 D: m1 n
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
& d9 r# U& T# _: s) q# {# R+ ~ \6 a9 P6 Z/ C3 g" ^
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen& m" z) |7 L% [ p9 X4 y& p _2 D/ Y l
function to do the same job:# n# ?5 n% W: {# s- X2 ^4 H
) p' W) q: a) X8 E. f0 `: |# I
push 00 ; OF_READ
3 e7 B& E" d5 ~& K" A/ B mov eax,[00656634] ; '\\.\SICE',0
6 V; O0 U7 A! z: |# @' Z push eax
+ w4 o W9 \* _! e5 Q# Z call KERNEL32!_lopen- v2 i3 T( k/ v5 W( ?- p0 ` ~
inc eax% w- G1 j+ F4 f* K/ w0 `5 @
jnz 00650589 ; detected" j% o& N* G# O4 p
push 00 ; OF_READ
$ ~ F2 m' @; f& p* A. i) a3 | mov eax,[00656638] ; '\\.\SICE'$ p! Y* \ X6 ]1 _% E. S1 y
push eax
$ H, A/ R% ^6 n8 x$ f- r call KERNEL32!_lopen
+ Z \) }0 M2 j* h: B inc eax
. V2 |2 i+ S: I% c7 x jz 006505ae ; not detected' g: g- c/ I: ]+ f# E" O" \# _! P
- e5 l% o8 N$ g
4 U7 R* Z* T6 W4 B# C__________________________________________________________________________7 V$ ]& i& k$ Y( U! S7 S9 s# }; X% y
0 L; O( n! z k, Y9 _" U1 B- b# gMethod 127 r U7 v, O3 W; i
=========
) K0 o/ v& d: ^" s t0 X# `. i1 m/ d+ b$ k/ f
This trick is similar to int41h/4fh Debugger installation check (code 05: M9 y# z' r5 m. P- i
& 06) but very limited because it's only available for Win95/98 (not NT)& i: W* ]0 [* Z. T
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.! A& l- R* i9 \6 X/ o0 N
( s: C8 `' s- X: E0 X% z1 Q push 0000004fh ; function 4fh
( K" ^" u: p2 y! e, m push 002a002ah ; high word specifies which VxD (VWIN32), s; V* N6 [& P$ p' D
; low word specifies which service
4 ]& x% F% r$ p (VWIN32_Int41Dispatch)
0 C+ S5 a0 u6 |% K6 j3 g call Kernel32!ORD_001 ; VxdCall
( z8 D4 r& E! j1 |3 r7 v/ m cmp ax, 0f386h ; magic number returned by system debuggers
& H( C$ b( V. [/ c) C jz SoftICE_detected- Z0 I' s8 \* h9 h4 s
P# H& b$ K0 I* |& w( ^5 VHere again, several ways to detect it:
5 l, m8 S5 ^: @/ D, P
; u, {$ t0 Q" G. e# \' E5 F BPINT 41 if ax==4f
m& v' z' h6 B' m# i& E& d1 v2 w7 Y
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! k; p. H3 M. I* B7 {) @, U. `
2 a: r1 X! `% d z, ^% q BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ G1 z; F, x6 r
) t- \) q1 h6 x
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!# V- l) W- J& N
0 B4 v; _6 u* [4 ` h l5 W0 ^
__________________________________________________________________________) I) k/ }/ k8 R3 @; B+ [* w( I
h& s$ V$ Y( G3 i
Method 13& W8 ^ o2 L7 i0 W Y; T% V
=========% e- l' j' \8 j1 U/ N
6 k* Z* Y, Y! t6 r& mNot a real method of detection, but a good way to know if SoftICE is6 J* s1 A d- q, g" V8 M C
installed on a computer and to locate its installation directory.
% d; c( N3 M, p' q. N. CIt is used by few softs which access the following registry keys (usually #2) :
* k2 [1 X# b' K; ]$ E
: W! \/ u9 ~9 C r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 V. K8 \% j5 w) l1 l6 h6 Q5 i
\Uninstall\SoftICE( u9 E) p7 {7 z' V8 Q5 t* f+ v- j
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' L1 Y/ @5 M* @1 s-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 C% b+ `* B- i) G( ]5 D7 C\App Paths\Loader32.Exe1 C2 y* a, u* g$ ]2 |6 p" c# S
/ G1 ^ J4 b% x3 n4 S& |) O. \
! \9 X) B5 e: U& A1 D$ E
Note that some nasty apps could then erase all files from SoftICE directory* W* x* N X3 p: M% {- D8 X
(I faced that once :-(
& }& d! a3 H, d4 r1 I! C& V; J/ s
( Q7 ]4 _6 `4 E+ ^) `* p% p- U" RUseful breakpoint to detect it: i% w0 ]2 p4 P
0 ~" x# D: V0 F- j
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 Y- {; S7 o% U- h0 ^
: D7 y( o' r& j6 _" X__________________________________________________________________________
- R7 G4 S/ K( e R8 V, `9 D/ q, m% X5 e, z$ j& Z; f) {! f
* M# C$ i0 t, _7 K( b6 f& jMethod 14 ; L, E* V# f- f" N& u6 h+ Y, h
=========7 I, t6 m* t" F# w# I; [
/ g% C' w" \) s; M& \3 i @
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# b" r5 b1 X% q T+ w* n2 s9 j
is to determines whether a debugger is running on your system (ring0 only).
$ p. q7 d8 K6 c+ S& O
+ u5 x1 j; V1 c }" }# H VMMCall Test_Debug_Installed
6 K0 F" d& _$ T" A" K je not_installed
5 b9 l/ z" o; K# H: g. z' B
7 P2 k( ^0 D9 r$ b; h% v: D4 T. J* BThis service just checks a flag.
0 z' T- O- j* ` d2 ] \( x& U</PRE></TD></TR></TBODY></TABLE> |