<TABLE width=500>, c$ y& |& A" Z; J, ]
<TBODY>
/ f3 h" h2 O# Q6 o A<TR>. a* Q, A2 Z9 V) |! k' w$ E
<TD><PRE>Method 01 : m4 L& a2 Z4 D* C: y
=========; G6 E1 `0 }6 d; e
, G3 D5 ]/ V+ lThis method of detection of SoftICE (as well as the following one) is
+ Y! @4 p2 V& A0 U% eused by the majority of packers/encryptors found on Internet.
/ p6 L7 @0 h2 ]' B7 _It seeks the signature of BoundsChecker in SoftICE; i) ^. O1 W& C- ~! t* x, c' [) q$ a
) M' P7 l" X% C0 y1 v B
mov ebp, 04243484Bh ; 'BCHK'7 J+ h% A7 X$ w7 O8 C: o* y
mov ax, 04h
5 }: b& ?' u6 z( Y+ i! {* _ int 3
# e1 R- K* x% y cmp al,4: v7 @2 q7 R1 g5 p+ j7 y) o) h7 X/ }
jnz SoftICE_Detected
) Z3 k8 u e) F& S% Y9 k F& \
% D# m% g) Q0 X( I* u ~___________________________________________________________________________8 Y1 O" h: Q, O4 o1 m: t! I3 H, N
8 [( B# X M/ m Q3 H# N1 PMethod 02
. J: _7 u6 g* N# P=========
& x9 E7 s" }+ L" ]4 C8 J% x3 p! P+ k0 E8 Z" _
Still a method very much used (perhaps the most frequent one). It is used; t. R) b! a% g* H. m
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) |: T; C" U N+ b( b' por execute SoftICE commands...6 h5 a( g" E0 M* k; x
It is also used to crash SoftICE and to force it to execute any commands* w. u8 ^5 z3 q
(HBOOT...) :-((
* Y; y' A! i' @
/ d3 o$ X: _! m5 I7 h9 H& y+ ]: |Here is a quick description:
% i; T# ^$ E* q-AX = 0910h (Display string in SIce windows): |; W" x' W; M$ f7 a
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ @& F0 k+ k% e1 r( h" W/ f) y-AX = 0912h (Get breakpoint infos)- i7 x5 M5 Q' K" i+ e! i: Q$ ^) k
-AX = 0913h (Set Sice breakpoints)0 n' U3 r5 a- j
-AX = 0914h (Remove SIce breakoints)
6 F( f3 x: Q/ o7 w! B1 H& x3 ?
0 r2 t- P4 _; w/ B% H( w, L; }8 T9 WEach time you'll meet this trick, you'll see:. O% g' T" T3 v- \' s7 C
-SI = 4647h4 K! x8 X/ y! z! p" I w2 V
-DI = 4A4Dh
7 M' z0 y8 }- {* iWhich are the 'magic values' used by SoftIce.9 ?5 B+ g# k( k& @ P: B, j
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 b1 A Q9 _6 o$ e
; y! H& O+ D4 D) E( o: Z1 eHere is one example from the file "Haspinst.exe" which is the dongle HASP
- q' P% r# K' C1 _Envelope utility use to protect DOS applications:
% e9 r0 L4 L0 y& `. b, _9 g$ T6 r& h4 P4 a( v' y
; Q' b' o) ]- f. `8 A$ U2 z) U
4C19:0095 MOV AX,0911 ; execute command.
v/ T3 f R5 `( o L+ |; K4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 S0 H6 D6 A- ~' a4C19:009A MOV SI,4647 ; 1st magic value.5 Z k8 e8 Q: d
4C19:009D MOV DI,4A4D ; 2nd magic value.' L, @& R1 ]0 u5 O, `& Y% ^# [/ R
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*). ^) l- }' U% e3 v
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
* i5 z/ K' A$ w6 }; N( `+ ?4C19:00A4 INC CX
' U& h1 K7 D* M5 x Y8 ~4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, V/ o0 b" G5 {9 [- O( W
4C19:00A8 JB 0095 ; 6 different commands.
6 h! Z' J+ \6 J8 ^4C19:00AA JMP 0002 ; Bad_Guy jmp back.; V" a6 W3 @8 k! K5 g: U
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" B2 R" `6 ^; s$ V2 @
0 z" A- u0 w# y5 O7 O( y6 v; ~The program will execute 6 different SIce commands located at ds:dx, which7 v2 A9 n& O3 J R* I- U' e
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" H/ X: U5 r+ L# j
J/ K5 V/ j$ N1 S3 o0 y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.9 l, F5 u/ Q0 K( w7 [8 s7 i
___________________________________________________________________________% q- U) {/ K# L) F0 C
1 v4 u/ i9 T( W5 [$ A! t
' W* x& I! C) }1 gMethod 03) \5 }% H7 Q+ P( }
=========) U/ X/ U) y/ c- z# k
k2 q. n4 `" K) x I9 l& @
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! V: t2 x% c/ b0 x m3 E
(API Get entry point)3 ?# v3 F) t8 s, F3 \ F; ^
7 j5 W; t( V/ C. E4 T; w3 e) v) F# m6 q' |
xor di,di
) e* S8 E3 N. Z, _0 R8 ^ mov es,di
' a; ~% f! M# L: x" ?: D5 O0 ^ mov ax, 1684h 2 f0 [/ [. z' m) M5 V) s
mov bx, 0202h ; VxD ID of winice
# y+ D( P5 x3 a1 I) v int 2Fh; C1 ~4 ]( m. v$ a5 ]/ o% M, @5 N, W$ q5 w
mov ax, es ; ES:DI -> VxD API entry point
* N; C7 ]5 F" O7 Y6 r add ax, di
+ Y/ P8 @1 K5 ?( _. d3 J test ax,ax6 f& @$ { c; B/ Z# J" m
jnz SoftICE_Detected
9 o) k! F% t0 n% [9 v( t7 v* K2 K: Z! a" G( ?7 j
___________________________________________________________________________2 L( {$ M+ Z* ?; [: X6 [3 Q* q
) H V/ V; k+ LMethod 04
% z/ e$ k; i/ W=========' T! B c* d* i5 ]1 q2 H
+ |( c& i3 B; {9 ?; p
Method identical to the preceding one except that it seeks the ID of SoftICE, I; y9 T# Y6 e; H* d# R+ e* W; H
GFX VxD./ C4 U, d" w, G
0 I1 |' |, O9 d, l
xor di,di
9 ~! |( K; ~* d4 | mov es,di
% R+ p) V3 p" ?% h9 D* f mov ax, 1684h
\( S! i, R" R4 z% x mov bx, 7a5Fh ; VxD ID of SIWVID5 o, w0 ?. s5 u% X+ z" y% ~- j
int 2fh" n5 ^( z2 O; N1 C; o6 E7 }
mov ax, es ; ES:DI -> VxD API entry point
8 d* J, o/ b4 d9 ~ add ax, di+ w0 X; K( _$ E/ m) O8 `+ ?. H
test ax,ax* |( {# b, f1 ~, t+ z9 ^
jnz SoftICE_Detected
: h9 t; t% h7 ]5 o8 W9 W. a- d$ Q
__________________________________________________________________________1 H" \, S6 N O' j
7 o* L. s7 \% u3 A R/ u; D: ?8 |4 T( K
Method 05
: \% R) q# o7 m/ b=========
/ P) y2 M- m5 W$ a- H
5 i6 o. H8 L i& BMethod seeking the 'magic number' 0F386h returned (in ax) by all system1 C2 K! T' p: X$ }
debugger. It calls the int 41h, function 4Fh.% {9 E2 H% J" s- |
There are several alternatives.
b$ f3 g d. ]; C# G0 J+ g' H" {- C# F" T
The following one is the simplest:3 X1 e4 r) @3 P: a1 D2 D9 y6 t7 f
$ r* y+ ^0 L6 b* x( N
mov ax,4fh
6 h0 G: ^1 e! S" l+ u0 I int 41h' X: u! o1 p2 P: B& P: W k
cmp ax, 0F3866 P0 ?/ A, n1 Y9 J8 g
jz SoftICE_detected
0 K' G* X0 n- {' {: r8 u1 u, m s8 O3 G z1 \" r8 g
& T6 u% u) Q! V$ o; W( L7 \
Next method as well as the following one are 2 examples from Stone's
) }# M0 `/ t* h9 O) _0 \"stn-wid.zip" (www.cracking.net):& {5 [7 {/ r4 D' W! k& k2 @
) Q: u2 }) g% Y5 _. O y mov bx, cs- p# a+ O4 ]9 F$ D7 ~' |
lea dx, int41handler2
6 e4 S6 ~" `( L5 l, ^% q xchg dx, es:[41h*4]; R6 n! v e4 @7 \2 l; X0 Q. ~! `9 U( t& @! @
xchg bx, es:[41h*4+2]
: E8 W9 H% ^* b5 x8 n2 F( F: \ mov ax,4fh
6 Q8 A. Q- o1 S0 v7 w( t6 ]! \ int 41h
/ [$ D7 u& X" K& i- S xchg dx, es:[41h*4]
' I* D5 F/ B( x' t( z7 V xchg bx, es:[41h*4+2]
' v* x. ^ ^6 M4 l$ h' _( Q3 F cmp ax, 0f386h1 x4 i d! U [
jz SoftICE_detected
. t! t* |. ^9 J6 U
+ B- e8 L! A c4 I4 n; h, Zint41handler2 PROC6 g c6 L( [- T6 b
iret) a3 j: a5 D9 x" `+ z" H
int41handler2 ENDP
+ ~" r! h! H0 T& ]2 c
& Y4 Q+ Q3 r: F% d f
( Q, m9 r6 Z5 d- N_________________________________________________________________________
) v' r1 ~- G; i% ~+ Q% T
0 {& ^6 F- U% \% G p
9 V9 S+ R% @, [( R+ `" CMethod 06
; C7 P$ H8 n! @9 D: m$ R& F=========* Z5 }- P$ |3 I: v; ?, ?- w
0 K. Y: x/ l- U0 |( w6 H/ V! F% [, t
2nd method similar to the preceding one but more difficult to detect:
' p2 P9 [1 g; v/ H4 F3 m+ D$ g9 p1 o5 ]$ q% e* t0 L3 A
. q3 w4 o* ~7 i0 l4 I
int41handler PROC
, M1 K* u! J1 V: ?! P mov cl,al5 x) j$ W& c5 p, N0 H/ O
iret
* J* n3 e$ b/ ~" aint41handler ENDP# C$ Q: v0 f1 s3 t# }
6 `, w8 V# I4 @9 t
6 N- X# U- o5 N& z [$ k+ ` xor ax,ax
, l+ M* X4 t' j0 z mov es,ax& T) S. y6 M% O1 _3 Y. t" W
mov bx, cs
& ^( ^6 }& j+ h$ O% B* N; Y lea dx, int41handler+ P6 K" d, B0 e1 B( a
xchg dx, es:[41h*4]; }/ M$ w& U1 O' j
xchg bx, es:[41h*4+2]- |- n+ e( e' X- a# j& Q
in al, 40h
V7 q/ J: ~2 B5 b& m; i; B xor cx,cx
4 n* f( y7 s: K: O' `7 Y% ? int 41h- X+ _, ]' q! W
xchg dx, es:[41h*4]
" H ^( r/ i) T4 k/ Y6 w! A6 f7 L xchg bx, es:[41h*4+2]
& g6 i8 |' u" [* ^5 n4 t3 @0 m cmp cl,al8 \) j5 y8 Z3 J) F, Z ^# _ T
jnz SoftICE_detected1 X" H4 l' I, |% H7 U# R
. K: o5 k. B# O: G1 z% V
_________________________________________________________________________
0 \% U2 h$ D* O _2 k* D, y; ]) Z5 T3 e8 }4 ?* g2 t9 j" ]
Method 07
a! s/ A9 P6 M2 \* h3 P0 p4 V1 B Y* a=========8 R0 Z- e6 Z. L5 J& q0 ^# @
3 k ]2 Y# s9 w" @Method of detection of the WinICE handler in the int68h (V86)4 x% A+ c2 ~$ O$ N4 e; U3 H
' b! C$ d- u% s! n0 Y mov ah,43h' ~, L1 N4 F5 H' A2 C4 q, j2 p
int 68h
+ `9 C: s3 N+ h V9 ]( J0 u cmp ax,0F386h
% n8 h+ S- t u. B' ]8 V; @ jz SoftICE_Detected" j* |' d# v: K9 F7 w- r
0 Y6 `; z, K. {; H
. x# A5 L8 {3 l/ `% V=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% j1 G. w( g* r# g3 v
app like this:
) e6 v* [* ~3 E) c) l) L+ `! A" _7 q2 |
BPX exec_int if ax==68. T, _: O0 h/ p" P+ Y, J; I' h
(function called is located at byte ptr [ebp+1Dh] and client eip is7 M& h9 I6 `3 C( Z7 ~ w4 `+ `$ m- {* m
located at [ebp+48h] for 32Bit apps)
5 Q6 y c7 A0 R0 w__________________________________________________________________________1 S% o2 X! g1 d$ S5 K
8 p2 M6 i2 R; b" r
: k% J# Z- Q' A( s3 s0 RMethod 08
& T! t# E# ]' q3 j M0 E o=========
% w, i) F' K) Y5 I
! _; ?8 ~5 `! i/ d4 C% }It is not a method of detection of SoftICE but a possibility to crash the9 o3 L F# ~" {. Z
system by intercepting int 01h and int 03h and redirecting them to another* r7 P3 t+ G( [8 N" T7 }9 M
routine.' g- L$ Q+ J# |2 y1 ~" l" Y3 {+ q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, f. K: {# r0 {- v, l: }) k
to the new routine to execute (hangs computer...)3 ?6 h* ]( I3 X+ G0 k# Y- m
; w/ ~$ t; x% v; N/ |
mov ah, 25h
% |5 Q8 C0 l5 N mov al, Int_Number (01h or 03h)' W, U4 N9 ~* \$ b6 Q* @
mov dx, offset New_Int_Routine# d# T+ c1 N+ n. A. H0 W
int 21h
) Y }" U3 D7 \# f" N3 U
, }, H/ W1 Z" r( Q+ g* u" l% H- p- W3 H__________________________________________________________________________
$ \6 _) q: b7 u7 v8 P4 K( Z7 j# Z) {# s* e6 T, ]. ~3 h, w/ d1 U+ ]
Method 09
! w0 N$ R1 J2 J4 N=========& c1 \% \5 R7 I: {) C9 g
$ ?: w& N* G: _3 y& }5 h: UThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ N3 D7 b% ^, {. t8 n
performed in ring0 (VxD or a ring3 app using the VxdCall).' y' D5 ]1 z2 C, P5 h2 h. H& ]
The Get_DDB service is used to determine whether or not a VxD is installed8 o3 p/ ^" g. P, Q
for the specified device and returns a Device Description Block (in ecx) for
! {9 J; o& q3 ^5 l4 ^9 M( z. Pthat device if it is installed.* X; \( \0 Y( j1 `* N- ]
4 _# T$ n* P. A0 S- F5 K/ [ S
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; \% @" H! ]% o3 q mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ P3 `1 Q$ y+ j q# Y( B' H VMMCall Get_DDB
7 U2 g( ?" n! l; Y. f mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ ^# s) \1 U3 J. U$ D" v2 M2 p/ X1 n( k; W+ V& c! p
Note as well that you can easily detect this method with SoftICE:2 t9 u* Q4 x a' e
bpx Get_DDB if ax==0202 || ax==7a5fh% _. a' r$ F- G- R7 O5 H
: P- z3 `1 N) q1 m: _1 a$ Y2 n__________________________________________________________________________
. ?& E5 v: K& Y8 ~$ l, R# r8 R! l
/ p7 U* K; y+ H3 t1 g' V0 KMethod 105 @8 \' Y) g8 T# D/ d& |+ F, N
=========! u4 S Q# T4 Q( m; ]
! F4 g& L( w* V* _; c3 I" J=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 k+ m U8 {" {5 \5 `: V& Y SoftICE while the option is enable!!$ g8 n. V7 |# H
8 r8 S! \8 y& s: `) G0 d5 Y0 TThis trick is very efficient:
" r! X- @3 f7 e+ L, f& u! e+ wby checking the Debug Registers, you can detect if SoftICE is loaded
2 k/ t5 O* p6 p: |$ N. @4 U- o7 L(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 ]* ?& [- T: I& r# V$ R- U$ o
there are some memory breakpoints set (dr0 to dr3) simply by reading their
, v" U' Q0 s. l& c$ t: Ivalue (in ring0 only). Values can be manipulated and or changed as well
0 [) P9 V0 v. `) g6 C/ t. ]2 F(clearing BPMs for instance)5 l5 j+ F+ p# `4 s. u# z
! e$ N1 Y8 J" ~. C8 w9 U__________________________________________________________________________
% j" g+ L* x4 E4 A& {' K7 ?4 X1 @" a% @9 x3 j2 E
Method 11
% v, c* J- o& K1 x=========
* _( p$ k- ?1 t8 N& f3 X1 k
1 p; w6 S3 H) ?! ]3 AThis method is most known as 'MeltICE' because it has been freely distributed" H0 X, H2 f; p' h
via www.winfiles.com. However it was first used by NuMega people to allow
8 d& J2 ]- J& `* u7 c. q. q4 z* D9 cSymbol Loader to check if SoftICE was active or not (the code is located9 }1 e0 L9 |+ b. f1 Z
inside nmtrans.dll)./ V& g. o4 p7 e0 S! F! p7 ^6 K: m
; A( A5 S, w2 L' [3 L+ o0 l' T! A
The way it works is very simple:: s6 O2 {$ Q0 [3 E+ b
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 t! g3 `8 [. M, h$ iWinNT) with the CreateFileA API.
; @$ c6 O: B3 y) Y# \" M+ J( C; S6 G7 d4 t. r
Here is a sample (checking for 'SICE'):
4 D1 l Y0 U0 J. F8 ?) K) R0 [3 A- l) |
BOOL IsSoftIce95Loaded()5 r, `/ ~% V2 [$ n( u6 Y2 a/ V
{( m+ `" c( d3 }6 X( Q( N* ?
HANDLE hFile; " O) i8 U, ^6 C# _! z+ r% u
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. ^2 _, W, W# x* g
FILE_SHARE_READ | FILE_SHARE_WRITE,0 z8 t8 [# ^- w, c8 }- H
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
, R8 Y0 e/ e9 q2 Z: { if( hFile != INVALID_HANDLE_VALUE )% I' u0 L5 e) G4 z
{: d! r+ [$ m& a( t+ C
CloseHandle(hFile);4 Y D; ?7 P& M4 B1 m' F
return TRUE;) Q8 w& ]8 P3 S9 I- \# _' Q7 D
}7 j- n6 l, _3 L; I2 n3 P
return FALSE;1 g& t8 G+ ?6 `5 N. ?
}* a1 a6 b2 y" r, \" O; z0 R
! |5 I8 Z: f4 l# B& a
Although this trick calls the CreateFileA function, don't even expect to be7 B! Y( s; f/ o3 B
able to intercept it by installing a IFS hook: it will not work, no way!5 l9 |! S8 G4 Y0 D
In fact, after the call to CreateFileA it will get through VWIN32 0x001F+ d6 P# y J! R7 T. L, G8 d% \/ O
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ |& m) D, z& S: N. T- h; k4 s) hand then browse the DDB list until it find the VxD and its DDB_Control_Proc! ?: c- ?+ f3 B8 l; l+ T; g
field., J) K3 j( H7 N; I
In fact, its purpose is not to load/unload VxDs but only to send a
; n( f }8 I2 _8 P% m6 B- C: IW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) `; _0 k' i, y6 q2 n
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
, g6 D/ ?) X' w& D' f% ito load/unload a non-dynamically loadable driver such as SoftICE ;-).
' C" v9 H& e0 t. {& k: }3 IIf the VxD is loaded, it will always clear eax and the Carry flag to allow
1 G1 g: V& B0 c( J5 ]% Lits handle to be opened and then, will be detected.5 ]& H) A, T2 K
You can check that simply by hooking Winice.exe control proc entry point
0 F# ~+ v2 W9 q) C0 kwhile running MeltICE.
* n* b+ T& Z$ e0 Y* ?/ `
- G' M: k7 A J l5 T2 y: }7 }' v( H7 H: V0 m* k
00401067: push 00402025 ; \\.\SICE3 n% Z3 c m. C
0040106C: call CreateFileA
7 [$ w6 a" n+ H! ` 00401071: cmp eax,-001
, y( h% _0 m6 A m0 J2 l 00401074: je 00401091
4 }2 o: u6 P: x3 D0 F- p9 |" s& L, J8 G8 i4 f
( E$ l& i# ~9 N! _: h' xThere could be hundreds of BPX you could use to detect this trick.) o4 Q0 d, ]2 p. A1 S
-The most classical one is:/ m7 _$ k* u" d, I
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! F+ ]) @* A: w7 v' p4 E; s$ p0 a *(esp->4+4)=='NTIC'2 l, p' f" j r- o P. H3 L a4 i
) v# @* z: l0 ]6 I& i
-The most exotic ones (could be very slooooow :-(' G* p. A+ B( c3 O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
5 m9 A- H+ ~. D( P& s5 a% J ;will break 3 times :-(
: I. g% w6 Z' M- ^$ |# g4 f' d1 z; _7 G
-or (a bit) faster:
* Z+ d3 s) |: ~9 k: a: ?: i& i& \+ ~ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 M% K$ Q( \) D p3 U7 T6 d9 B+ Y4 L# t
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' # s Q6 F% h7 J) [' e% c4 ]
;will break 3 times :-(1 l' |1 L. S2 w0 C1 _" d4 r$ _, \
: I' E5 a4 e6 ]4 x-Much faster:
. Z, D h! |! d BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'- S" p& `2 D; ]' y4 v0 _: R
7 d. q( e3 N2 [, Q5 k% D4 G, C$ c& XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen' ]9 b5 q8 l4 S8 V; y
function to do the same job:
8 F( Q3 ^! a$ m) ] h' X4 W! w6 \1 W* |, t
push 00 ; OF_READ$ a$ ~0 {2 ], p7 V
mov eax,[00656634] ; '\\.\SICE',0
2 V5 Z9 p+ ?4 _ push eax2 y& D) Y+ ^& K, Z& a) }
call KERNEL32!_lopen+ v1 M- M2 B5 r: |* e+ I$ `7 w8 A V
inc eax
$ }. u. e- ], i3 N" L jnz 00650589 ; detected/ C0 T% ~/ d2 w0 `% P* r
push 00 ; OF_READ
+ N" O3 f& S+ q# j }) C; A7 U mov eax,[00656638] ; '\\.\SICE'& O" _4 b f9 q1 _ d" @
push eax
# f0 S/ G+ w6 e1 u. w call KERNEL32!_lopen) v9 F+ p3 z$ Y7 W+ Z9 r% N) }
inc eax
$ x6 @9 {' h @" D jz 006505ae ; not detected
, s2 }- q, b1 \1 R' K" `
( {0 v2 x6 {; ]: h+ p! f! g# o% Y2 ~$ [( w* ~8 T$ W/ U7 B" L6 `; b
__________________________________________________________________________
" P+ M" |4 T, Q3 Q8 x/ a# @
& a" ], e1 g1 ~& d5 H0 rMethod 120 h5 C7 m7 F. N( C/ _; d7 k+ X
=========
+ Q: `, D0 n. ]$ {
4 \* T! K/ ]4 n! VThis trick is similar to int41h/4fh Debugger installation check (code 05
% `$ R8 G4 j7 y8 S i& 06) but very limited because it's only available for Win95/98 (not NT)# F3 g7 P- U5 ^4 [4 o. U6 A
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' r2 H; q. p5 } ~0 H5 q0 M2 f: b5 K' Q. ]) ]
push 0000004fh ; function 4fh, S8 s- ^3 r, w p# Y7 D
push 002a002ah ; high word specifies which VxD (VWIN32); z) O7 W& v" a# [
; low word specifies which service
7 c* d7 d3 ^# C) m# D9 n+ Q (VWIN32_Int41Dispatch)* n+ ]7 B, U0 D1 G* d
call Kernel32!ORD_001 ; VxdCall C. {- b# V H" q+ ?& d
cmp ax, 0f386h ; magic number returned by system debuggers- [2 X2 i" {4 \! }1 m: w7 t
jz SoftICE_detected
. ~) u2 ~) J: C) N' ~- v5 P! ~( }8 K- f3 n* S
Here again, several ways to detect it:7 K* t( D( b5 W* P
& d7 C/ t; F7 f0 T. E3 B% h" w
BPINT 41 if ax==4f. Q4 z7 w+ q" B& U) P' i- x( _6 L
9 a; ]" w* X& U7 [% c BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one- W7 n9 u7 X! W$ `& X
* d& `5 z1 n* u7 `, F- T$ D; D
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A) U/ b6 I8 T1 E/ C7 J
5 G9 S1 J0 B: X. L3 h BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 R7 y9 b( o, j- W& x% F! V
* @5 E1 O0 O9 n* L4 ^7 |8 \$ X__________________________________________________________________________
3 Z2 X7 O" q% w: m) a: h' j8 c7 G, K O$ S" |. \0 L* @/ m9 a
Method 139 R* D4 a& ?7 G! c! l3 @' c
=========
. z6 y; a6 U/ L7 [3 u! _& E- T8 `: r7 j0 f9 D6 e5 C8 r" c( U
Not a real method of detection, but a good way to know if SoftICE is7 z8 T# g, p% Z. N7 ^. E7 d* Q
installed on a computer and to locate its installation directory.
1 l- J0 o& A3 P n/ Y! r; I6 `It is used by few softs which access the following registry keys (usually #2) :' Y4 ?1 G- f0 Y0 g8 n1 \8 O- \
: e% K' s" k; O. h+ H
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 D0 Y ~& y% u1 e8 r
\Uninstall\SoftICE' w$ A4 Q+ t" \$ w! R
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- j( l, y6 W5 i. M. N: S8 x-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 ]5 M# S! ~( c' g! R ?% @\App Paths\Loader32.Exe
$ b' x. {8 r2 ~$ b
$ \0 B- B/ ?6 S# p, Q
8 L$ f! k2 M+ [- M4 dNote that some nasty apps could then erase all files from SoftICE directory0 u9 R6 S! { a% ^8 l+ c( Q
(I faced that once :-(
0 z. k9 k. k! G! y2 d- J0 I% m$ P" ~2 V |
Useful breakpoint to detect it:
; x6 {5 b. c9 {& D1 u }0 `7 v G, |! ?# Q! r- O0 c9 h. R( F! w& ~8 p
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
; c# T' d3 Y8 V
; a J5 c j" a5 l__________________________________________________________________________! C8 ]$ E3 x' ]: R
! g2 U! S6 D* E4 T
, B1 ? `: E: g1 o8 M4 }Method 14 . H3 e" Q. [2 R
=========
( L! ^8 a/ Q8 J8 \ q6 e7 O8 o9 }+ _/ K/ N( e: F/ [& I
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose( Y: g# e0 z* e% V4 _# O- H
is to determines whether a debugger is running on your system (ring0 only).4 }; y" P4 p7 b9 D; V! v% e1 c1 q
5 q+ `1 f% C6 W$ ]/ V! q* U& o9 Q. G9 }
VMMCall Test_Debug_Installed
0 U' W( D) s; X je not_installed8 G0 o- F o. [' j7 A
( j; i* \$ C( k0 d8 P6 E" I4 ~
This service just checks a flag., n' r8 i i3 b7 {# k
</PRE></TD></TR></TBODY></TABLE> |