<TABLE width=500>
+ Z& c$ U( |+ V! U<TBODY>
0 v7 E: p- B m3 L | b<TR>
9 Q% q; e+ z+ U. p6 ~) T<TD><PRE>Method 01 % h( p D! R( ]
=========
! A8 |4 m8 i' e* F7 l0 z/ @; ^; c. p) r9 C1 K( N2 t
This method of detection of SoftICE (as well as the following one) is
$ j- S$ U. f1 [, e# a' I. |used by the majority of packers/encryptors found on Internet.2 z2 L7 T* u) ~9 c9 E/ i6 H! j
It seeks the signature of BoundsChecker in SoftICE) T+ ]* y f9 j
W1 M' ~" i: H* e6 L
mov ebp, 04243484Bh ; 'BCHK'
4 k( S1 ?) @; c mov ax, 04h
5 w d- B8 N. w& m) s M u int 3
6 e4 h3 J5 h, Y+ G+ `( A u cmp al,4% D5 J7 X3 T( k& ^& S) ]+ y4 x
jnz SoftICE_Detected6 a( j8 [( n1 ]* j
) i% S0 o1 m$ z) J1 Z___________________________________________________________________________( o+ z2 y' |1 f _' k! S1 X& |
8 a- T& l' [# l1 w4 @
Method 02+ \' o( _2 k$ r9 n* m) H. k7 w& Q
=========
! `: j2 }# V( G- s# r* k. G1 A! r2 P8 E+ M9 I
Still a method very much used (perhaps the most frequent one). It is used
* R7 |/ W9 G, {; B" Wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 p; h5 P( Y$ v0 a4 kor execute SoftICE commands...( P3 u' n* v2 U1 W( L0 i, ?
It is also used to crash SoftICE and to force it to execute any commands
0 s: T8 j; w9 i6 G# n u5 f(HBOOT...) :-(( . y' R0 z; E" H
; C# Y: P1 e- U+ z0 |
Here is a quick description:; T1 S$ O% d0 j& ?+ r0 G. z
-AX = 0910h (Display string in SIce windows)- v0 f& E. r) x2 {: c
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 B, ~- E2 J& B) v X3 t, v* B
-AX = 0912h (Get breakpoint infos)
9 B. {* i5 j2 s3 W# \" P-AX = 0913h (Set Sice breakpoints)) Y! z1 e9 Q/ z0 Q9 k' B
-AX = 0914h (Remove SIce breakoints)
, ~- P, V. I; d( \3 l: ^2 [% A7 ]
2 T& B: Z0 _# D E$ T5 UEach time you'll meet this trick, you'll see:- A D+ Y9 m# K o/ E
-SI = 4647h9 j" i( h* L* B) C
-DI = 4A4Dh
" j* n0 s1 L: ^7 C& E: ?Which are the 'magic values' used by SoftIce.
3 O2 Z2 ?' o% l" vFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! g' I" d, N0 c6 e3 @
1 B4 v4 y& q0 h1 w2 @" {. UHere is one example from the file "Haspinst.exe" which is the dongle HASP6 a) y0 F6 i+ o9 n9 {+ X* O4 W
Envelope utility use to protect DOS applications:
4 K' j( n/ a1 g% u
- C7 L, t L I" k' N2 |4 B! _. P$ y! M$ P6 p2 c
4C19:0095 MOV AX,0911 ; execute command.
# O4 m3 n/ M" U4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
f- n% \8 n2 H4C19:009A MOV SI,4647 ; 1st magic value.4 S `4 z' q: Q f# z
4C19:009D MOV DI,4A4D ; 2nd magic value.: y4 e" C% w3 o+ |2 o2 W. h
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 g! r3 v+ a& \) s+ S4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute( k. o# k# S0 ^5 K9 O
4C19:00A4 INC CX
9 p4 C) `' h" t4C19:00A5 CMP CX,06 ; Repeat 6 times to execute( }% G) F" i6 S6 H: l
4C19:00A8 JB 0095 ; 6 different commands.
& B: R; O& u2 w: ?1 d) Y% r9 S4C19:00AA JMP 0002 ; Bad_Guy jmp back.9 j% b) |" R, Q: P' M
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)$ X& b: c( q" G
; l- u" v$ J4 x" k- t6 eThe program will execute 6 different SIce commands located at ds:dx, which
5 b5 y9 V" C( V$ gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 T# f8 N4 j1 D D& N! D
2 t+ g9 V5 g: d% d; i: Y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! r5 Q$ C6 H+ Y/ F5 z; q8 I. X___________________________________________________________________________) L) U0 u) r$ r! N+ C( I! N
8 y, K7 u( t% T4 N3 Y) V9 S$ R
& U9 E6 u& t3 O0 kMethod 03
% g+ h/ V& ~$ _. S, C=========. Y" {' x* s+ a1 X; i: A. n
- T7 S, T7 z/ D5 Y3 f9 c' N/ }$ @
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! o8 F- x2 Q; B, X(API Get entry point)
6 M1 M: t) y# Z. O+ l , D8 r. u: w9 S6 U; i
. L i& b/ a5 I/ U xor di,di
- G! \4 W% m0 \ mov es,di
/ g" |/ k* G* j' W mov ax, 1684h 0 M, O! U( t8 P$ I4 f) |
mov bx, 0202h ; VxD ID of winice
- a. Z. o7 ^$ F int 2Fh
! x% F7 t& s. A+ R/ n5 v mov ax, es ; ES:DI -> VxD API entry point0 x% U2 [2 c; l) ^
add ax, di
. a/ f" o# o9 u# R test ax,ax1 f* v( S) r j5 |
jnz SoftICE_Detected, J8 ]9 v: L# Z$ m- a
$ l$ H8 V2 y- L; e9 _0 E; _$ n___________________________________________________________________________
7 k# O8 j/ h5 {; Q
, x7 x: C4 W$ I7 }1 d6 R0 M" mMethod 04( n$ J" x- V3 y1 u2 t) c! E
=========* l: Z. Q0 L' Z' ?7 m; ^
* W5 M; ]. ^/ ?+ n3 c: t+ dMethod identical to the preceding one except that it seeks the ID of SoftICE
) L/ A9 [ c0 o- L, b, [& _! d4 \- ^GFX VxD.+ m* K% o# p5 }( @8 P
: d" [' s5 Z2 \$ d ^2 w& R# r; Z
xor di,di
: a# |! G. K/ f3 ^ mov es,di
, j# m! I+ C3 M) A- J1 W mov ax, 1684h
+ d) T" G, W& ` ?; \; H: B mov bx, 7a5Fh ; VxD ID of SIWVID
& C3 C5 r6 X" q+ } int 2fh. U* }6 [ ~6 ?" M7 j5 D- I0 \
mov ax, es ; ES:DI -> VxD API entry point
) D; n8 i! X) d( x' c' D add ax, di) \& P/ ^0 |$ S! z; ^+ [
test ax,ax O0 n+ I0 ^# B& X3 Z! K
jnz SoftICE_Detected3 a. X: i+ B6 g- Y7 u$ {
T% r1 F9 x1 U. L M9 R
__________________________________________________________________________( k& F6 J" }* c% a1 n
: X" G0 B8 I; S) O3 d' O# T* t% ~
5 O' T- I! A3 \+ w9 q3 E# o2 y! L8 Z
Method 05
5 d9 w. K% c! Z2 G/ t* L=========) G& _7 O/ K4 [7 G |6 Q* M9 Q
2 H+ Q. n9 @8 P. s+ yMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ `; C/ u) N8 _
debugger. It calls the int 41h, function 4Fh./ A4 i6 b- e' a4 X) l
There are several alternatives. . o4 D% Q$ k1 |8 P0 X
. R" ?5 q3 Y2 G% E" rThe following one is the simplest:
9 g7 }; `" ]6 t' X
/ d8 t; e$ h( Z mov ax,4fh7 R$ ?/ g$ j9 G. H/ O+ Z
int 41h
1 A' W7 h& |5 _ \ cmp ax, 0F386
]5 h2 N+ `, a- X jz SoftICE_detected
3 J( ]4 W1 x4 V) Q* s9 ?9 ^
8 h) L6 i1 B9 t0 \8 f/ l; a3 F+ O$ n
Next method as well as the following one are 2 examples from Stone's
; V$ i7 [8 u) F+ _: p"stn-wid.zip" (www.cracking.net):
% j3 C" \2 g( e( x# o/ m+ L1 U# u% d* T$ Z2 x! g9 g" O8 w
mov bx, cs ]+ h' D! ?$ h( o
lea dx, int41handler2
' z# i5 K3 \+ D% O xchg dx, es:[41h*4]
1 d0 ^ N+ x- c; b a& [9 r xchg bx, es:[41h*4+2]
5 [# V. X% D3 r* w) y+ H mov ax,4fh
/ v0 j. e5 x9 Z: J7 ~/ Z9 U int 41h# P) O! V% x9 A( `, W+ C2 Y
xchg dx, es:[41h*4]
$ ]4 v! f: P6 b& J) }1 u Q xchg bx, es:[41h*4+2]
: F, J4 h2 f2 C6 y! c' a cmp ax, 0f386h
! c. E+ ^* T+ u/ Y jz SoftICE_detected: o3 ~7 Y9 F0 ] l
R0 ?* H6 A* e$ k
int41handler2 PROC' C- @/ Q5 B. l# k' W) |8 S3 o( g( r
iret8 ?" F5 @2 V3 ~9 b7 P% X2 P
int41handler2 ENDP
, F! L# Z9 r- h+ c6 U
+ d/ J+ J9 s \, M/ e! ?5 F* a: {. ] Y9 F' c
_________________________________________________________________________
( ~5 O2 y/ o3 E
R( P; o) Z+ `6 O% N- E! _2 E) F) {( i# e7 r7 h
Method 06
, `; O( b0 b. ~=========
$ N+ J Q5 l* \8 O, P
! t/ H2 n, l+ V9 [0 X: ]' Q3 C6 {' ^/ Z; }
2nd method similar to the preceding one but more difficult to detect:
9 [& F/ Y* _, w5 V0 a. v" v4 f& \' i' X+ _0 u
8 X5 B1 E* M9 N8 H7 f
int41handler PROC
9 O: |7 u0 Y# Q0 Q9 r& s; J mov cl,al
% |. S. E+ ^2 z iret; o. X5 k1 }9 X& I8 a$ D2 Y2 w
int41handler ENDP
- O9 i6 Y3 f7 t: u% C9 ~8 r9 i; J/ q4 s# T
0 U: Q( a! Q- B$ H: P% T1 M* ]
xor ax,ax/ a7 N3 d% d9 r! q% [ y
mov es,ax
0 P7 V0 X" o* l) H& z mov bx, cs
5 U0 Q! f# O) ^6 c5 ]& V7 b lea dx, int41handler
8 Y& [) U( L- ^3 B4 R1 V xchg dx, es:[41h*4]# ^" |( C( ~0 V% _/ R3 z7 L0 `& z
xchg bx, es:[41h*4+2]
5 R! P3 S6 L) ?: c$ Y3 E in al, 40h5 `, U( U* m6 x5 E; ]8 f- @
xor cx,cx p& p/ N. L5 x9 P
int 41h E/ a5 ?6 {1 H2 D
xchg dx, es:[41h*4]
3 G1 u8 i m4 T4 x0 r& ?5 r xchg bx, es:[41h*4+2]& \3 w& {2 b: I! C, w/ Y. f9 u
cmp cl,al
! j2 f2 B& T9 y9 L9 x4 `( i# |9 b jnz SoftICE_detected
$ G5 B. H |9 S. O) a: T! r1 f
. A& ^9 T- Q) @8 q8 M% \_________________________________________________________________________8 A6 d. r6 y! ]! u# u0 N' r, H: I
5 e; {2 I% x$ r0 `
Method 077 f F; J5 I6 h& L
=========7 s c" M$ v# Z+ [) _+ s
. {' G4 M0 O* U; J
Method of detection of the WinICE handler in the int68h (V86)) Z4 |8 V, P* p- C0 {; w
/ \+ Q& o. S9 y6 g) f% o% u
mov ah,43h% X; m t: V/ J! y" O
int 68h
" e t' Z& E0 }4 |3 x cmp ax,0F386h
" d0 b6 |% ?. D8 @% t9 M2 D. q) P jz SoftICE_Detected+ g( a7 s- N7 v: q
( e! C: S" G6 a
0 c4 D. |% O0 B3 p7 i=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit2 x" ~3 D" s$ ~5 W3 Z9 ]
app like this:
g) H6 T* S8 c+ _2 h; R7 X( j7 s+ p3 ~$ N
BPX exec_int if ax==68
6 O1 n+ Q2 c- r. U7 o' a (function called is located at byte ptr [ebp+1Dh] and client eip is
- \ p4 K, F$ n6 h3 u$ P) p2 X located at [ebp+48h] for 32Bit apps)
; C2 ?# y3 F7 f* [8 F0 x6 J__________________________________________________________________________
. L; C5 y& y4 W* W6 Y3 k7 N; f
7 u6 @: U) U7 h" l9 t% O4 F- C4 |0 ]1 U
Method 08
, v0 q: h6 q+ b N- @/ }=========6 g- ]4 {( w: i+ n; P3 |
- E4 m: ?. p- SIt is not a method of detection of SoftICE but a possibility to crash the
L7 s( y- V9 P8 Y! [' O5 gsystem by intercepting int 01h and int 03h and redirecting them to another
* k3 y) {* t6 h2 L' t/ K% J. mroutine.* n2 C8 \) [4 J+ e% `# B
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! o5 v) _( K6 f8 A" \; e! t* u
to the new routine to execute (hangs computer...)0 h1 c- M' [9 T v0 O; L
* u8 e8 o4 Y6 D+ i0 ?; }. f5 V
mov ah, 25h
& B* ~4 T! h0 e6 z8 s0 `/ ^7 `1 y4 ` mov al, Int_Number (01h or 03h)
9 e5 h) L! ?. d5 d6 t; I mov dx, offset New_Int_Routine
* g7 Q1 h6 B9 [9 m int 21h
3 A8 ^( ~. [# a$ o, w; Q1 D* C+ D$ M: o) _( l+ y9 t O- C" ?; w
__________________________________________________________________________4 |5 T9 Q- A0 O. [
; j6 L) o% q' a4 S* p. E9 {Method 09
9 h" A. p S l$ g3 [9 T=========
+ P/ F! l) u4 [* Y) g+ v1 D' E% a; _3 `( a$ w. d
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only3 e7 X$ v$ F w
performed in ring0 (VxD or a ring3 app using the VxdCall).: e2 q3 X8 y. g6 Y
The Get_DDB service is used to determine whether or not a VxD is installed
2 L6 u* v0 z$ R0 H& M$ w- ]( ?for the specified device and returns a Device Description Block (in ecx) for
7 t- i- }& z) {' w, ~' G0 Mthat device if it is installed.
5 Z( c1 W8 v+ A( _7 [! j
4 i# W, ^& x3 _. }) R, `: L1 B mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# h% B: u, r2 C6 u% Y0 M* t. u mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 w/ m& u0 |' D
VMMCall Get_DDB" q |. |- ~# t( D3 o
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
) |2 A! V. |. R: H {- a$ o9 E$ n5 n; y4 s
Note as well that you can easily detect this method with SoftICE:
- f. k% _5 v* q2 Q" G3 u3 h) k* e, n2 ~ bpx Get_DDB if ax==0202 || ax==7a5fh
$ }9 B5 c( y. o# b2 e7 k, d) ^! k2 G- E2 Z* r" ?/ \* n3 s
__________________________________________________________________________
% x" i4 k5 D% M& @* @; N
6 q: H# h0 e) V5 ~4 `( |Method 10
m/ L8 e8 s( q" x. Q# d3 [=========0 ?1 p2 A' d1 P, k5 d0 K
. ]5 S9 Z8 u! ]' @# L/ [
=>Disable or clear breakpoints before using this feature. DO NOT trace with
( K# [( ~( w, B$ \& T SoftICE while the option is enable!!' \: W2 J4 r8 u, v. T) I) E* K
' n- o' H. w6 A$ r! l5 E* ~; q
This trick is very efficient:
% j1 d) \( I9 ^8 s6 z- B: bby checking the Debug Registers, you can detect if SoftICE is loaded3 K {3 k% a- k4 n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if& i t( ^% d4 c8 h) g
there are some memory breakpoints set (dr0 to dr3) simply by reading their; }. a9 a* j% [4 J, V5 w
value (in ring0 only). Values can be manipulated and or changed as well
- a8 ^% y; T3 {, @* `5 q+ y(clearing BPMs for instance)
0 r# a( M$ c/ B6 D2 h- M+ P- q* D% X5 B3 j. ?3 {. i
__________________________________________________________________________
. m' R& Y1 Z/ P; d9 O/ a
2 O A P4 I/ }$ i2 y3 GMethod 11: f2 U3 c6 O- K/ `6 Z! Y4 p8 T
=========
- z" d8 B/ f& z( }: i& ~1 x
3 B- [ S; y. {: z1 \This method is most known as 'MeltICE' because it has been freely distributed
, z/ I& @0 G3 H% \ kvia www.winfiles.com. However it was first used by NuMega people to allow0 r9 f8 s8 {9 [
Symbol Loader to check if SoftICE was active or not (the code is located3 L9 T# m( f& h) c- b: l* W
inside nmtrans.dll).
: m! c2 B4 U8 b# C7 _& h6 ~ N
The way it works is very simple:
4 V( a. }6 @- Z0 r J+ ^4 yIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% l' L0 I; f% }3 u+ H& U! P oWinNT) with the CreateFileA API.
6 h( n+ N/ @5 o- X- X- y4 u
6 x7 n- {" |5 d7 h! bHere is a sample (checking for 'SICE'):7 M7 h5 l. ^, z( }" Y
& m& e, d9 u. q( i5 M$ `BOOL IsSoftIce95Loaded()
. R4 j' N7 ?8 E{7 Z) a1 Z5 i9 c' N H
HANDLE hFile; ( F7 s) U" x! U" n7 C* R
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( {8 Z S/ B1 Y& p/ c4 p. ^( s% J
FILE_SHARE_READ | FILE_SHARE_WRITE,) v! A9 \3 o2 U8 ~! J: P6 r5 _5 D" k
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 S% b0 { z) E5 f7 H5 @* M( ?0 N if( hFile != INVALID_HANDLE_VALUE )
% G' m- d4 e! b5 m1 v$ k; l9 F {
/ {7 _& K' a, a! F- s CloseHandle(hFile);
' S; k5 H3 O( D- n1 Y return TRUE;
: f) T4 @; Y. }8 H }; x7 g6 Q& x! f9 u9 Z' V
return FALSE;% V3 j% @3 p* `/ m4 b* f* R9 K
}
) [4 a% ~( c, N6 a# V3 K4 S" _* K, D+ Z9 {4 ^- U4 V
Although this trick calls the CreateFileA function, don't even expect to be" ?& S) g4 T; S# z. i) H
able to intercept it by installing a IFS hook: it will not work, no way!
8 L4 V& L- C' D" J( OIn fact, after the call to CreateFileA it will get through VWIN32 0x001F" l; i4 w. I' s& O% }9 t
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
! f; t+ d2 x- w3 h* A- vand then browse the DDB list until it find the VxD and its DDB_Control_Proc# ^, U1 t4 E) C* `( Z$ P- K3 f
field.7 _9 m! N. l+ ^1 L; v2 |' c8 b* L
In fact, its purpose is not to load/unload VxDs but only to send a
7 r5 `, ]* W! kW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
- o& q, T: h- g7 Bto the VxD Control_Dispatch proc (how the hell a shareware soft could try
5 ?! X8 K" ?! ^) Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
, u; D( Z9 X/ G; ]# I* {If the VxD is loaded, it will always clear eax and the Carry flag to allow! L% @0 V, i% t& |6 A4 a2 G5 Q
its handle to be opened and then, will be detected.
6 m. I1 n8 u" q. P- F# ZYou can check that simply by hooking Winice.exe control proc entry point
0 _8 `9 g: F; _5 d% Jwhile running MeltICE.$ r: X5 V0 Z+ C5 L- @
; H+ X# \% q/ ^ ]
' D- W( i! F6 |" x* D$ o5 j: y 00401067: push 00402025 ; \\.\SICE; z2 d1 E. Y! t
0040106C: call CreateFileA6 v6 s0 [# F; x: B! e' n- u
00401071: cmp eax,-001' m. c+ s$ C4 y5 O2 R# I
00401074: je 00401091
6 H9 _' g$ n3 ?7 a& r; a. W; P4 e1 J; h# e; c& ]0 D8 R/ ^
6 j& N5 T1 N- A/ E( }1 ]0 }
There could be hundreds of BPX you could use to detect this trick.
~7 C* ^& M* ?: E% I0 r-The most classical one is:" n3 r+ p9 S* ]% W6 O& n& r9 L
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 @, U- O: Y! d7 Q! a
*(esp->4+4)=='NTIC'
6 [, @6 Q% D5 e) A# t1 c8 p' Z
- ]& d& q( v7 X7 l-The most exotic ones (could be very slooooow :-(
3 u$ ^ S$ G$ O; x6 w1 t$ z( d0 c BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 R# h2 ]. m& \; I) d- Z5 J
;will break 3 times :-(/ j' _/ G; y. o
( U; a2 ?5 D n5 P-or (a bit) faster: * x5 r$ y6 ~- n7 _$ ~! O# ~6 Q* A# ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& U2 e/ P/ Z8 Y6 d) X" N) n/ R
$ X E( N7 h& o8 C2 Z; u/ _1 n
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
/ o6 h3 A5 ~2 z T& p1 v; |+ o+ n# w ;will break 3 times :-(
k, T/ h; e3 @. S$ s1 c5 X; b7 _ k# L7 S0 W
-Much faster:; F/ [3 v: a' S3 d
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! P6 @1 j' k% Q) S* e2 a
" _6 u( A3 l( u) {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen3 y" x+ ?, ^* S+ g
function to do the same job:
) C! H* z0 u; s% X$ X* ~5 A7 `: t0 Q9 x' d$ H! V$ Z: P" l
push 00 ; OF_READ% R, L9 x' [3 A; i
mov eax,[00656634] ; '\\.\SICE',0
" W0 A0 i& w8 V# \. s push eax
" Y5 ?3 j5 Y( B( j call KERNEL32!_lopen1 K" r* V, D7 Y& @6 L$ P! U w9 f
inc eax' i: K/ g, u& d' J/ G/ s2 z+ |
jnz 00650589 ; detected
& ^) B6 @6 S; J) k* Q: } K+ t push 00 ; OF_READ. s1 Y" g v% E! O6 B7 k
mov eax,[00656638] ; '\\.\SICE'% @6 b% P* I* C* d+ {( L
push eax! E8 V- r+ |% K- Z8 }9 Z; h& R
call KERNEL32!_lopen) B* q; C0 H! f' z8 O. @' y6 b' q
inc eax2 M' g% i* ]3 U( g! \$ H7 F
jz 006505ae ; not detected) m4 b! b$ E$ F( {2 }$ Q8 U
' i- H. w* ?+ p% c9 q$ M
z2 P5 {; D( x__________________________________________________________________________6 e: J8 Z+ @. q. b+ b( a* r9 Y
: p# h3 Y% E' o; \4 Z+ i$ [Method 12# n( d4 ^! f0 P: D1 S0 A# y
=========
# t! D# K6 x9 G( s
+ b% c4 `& w- M( `# a) _5 e( wThis trick is similar to int41h/4fh Debugger installation check (code 05
' V- K1 Y( s. _5 D* E8 i& 06) but very limited because it's only available for Win95/98 (not NT)
5 ?- A W Z5 Y% d" d2 B( Ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.2 D$ ^4 q! I; r; g" A/ l+ b
6 N- A$ y3 y, {0 o9 D9 A
push 0000004fh ; function 4fh
( U3 P! {2 O" ^1 G. l push 002a002ah ; high word specifies which VxD (VWIN32)9 b4 r2 g9 o! d2 C' t/ T) @
; low word specifies which service- i8 M! _8 v, g4 v- \$ D
(VWIN32_Int41Dispatch)
8 B( y$ A/ r- Y$ {* S( ^% f- }$ r* ` call Kernel32!ORD_001 ; VxdCall8 }$ d; E" r+ o
cmp ax, 0f386h ; magic number returned by system debuggers
* {5 D6 i% ] N4 H4 f jz SoftICE_detected
1 ?! d* P0 }% v% r* b7 U2 H
7 ` Z7 J* J$ r. h+ v+ y$ j' kHere again, several ways to detect it:
% P0 G% l6 g! a7 j4 W0 g& K
o# ]* x( h, ` BPINT 41 if ax==4f) _* w0 l' X/ Y+ U
" m2 @( j h3 o8 N8 Y( ]/ N6 W2 h1 {
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 D" p" a) j0 R+ K8 D7 x
0 @7 }/ S( t1 S5 V BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) a$ d8 @7 n* O" E
) p$ ~1 i: E+ T. ]! ?5 g& W BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!/ L* J7 T& R3 E; a/ z+ K
, T3 A6 }+ A, k2 Z
__________________________________________________________________________# y' Y% O9 Y& R5 Z3 G- B4 z
& H& \' t- a8 N( y2 XMethod 13
$ z* J" D2 b+ J5 F! }9 E=========: ]$ P8 Y- S3 E) y! J
% t7 Q5 F% S( o2 u, I
Not a real method of detection, but a good way to know if SoftICE is
! s8 J% A( X! S) L: S& j2 v0 G' cinstalled on a computer and to locate its installation directory.: I- m8 M5 ^) ]4 u2 L
It is used by few softs which access the following registry keys (usually #2) :, N7 o( ^3 D4 w* p( _4 d3 o& O
$ K" B3 J1 m7 k3 Z-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% R) _3 k+ S8 C
\Uninstall\SoftICE
& G0 V. K z: D5 `( U0 g-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* ]6 k' l, R/ {, [ l. i/ q. }0 |
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" ]1 Q/ ]2 B: c6 v+ D
\App Paths\Loader32.Exe2 z* o u2 h: O( E; [
# n% @- @* N4 V& Q2 Q# V ~1 k
; d9 T# n' e# ?( i1 qNote that some nasty apps could then erase all files from SoftICE directory
; S) H( p, D( b9 B2 Y(I faced that once :-(
1 _* {4 y H, o; i
' o2 {) L; `+ n! {Useful breakpoint to detect it:9 u) m& V$ e5 G: E
1 q) d: P" c2 Y+ K8 S BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 Y' a; r; I$ Z! ?: q$ _1 l2 S; g# y
__________________________________________________________________________
) w/ u( Z3 D3 S, j0 z7 u9 [3 J& f; D+ B! @% |
1 T+ ^# }- b; l! V% KMethod 14
" s( j1 F' c% X# `2 f9 P! ^=========
5 L/ g& _9 M0 ^3 ~- h* e! {; q9 _6 G q [- t0 v
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' m* y$ p! d+ q. H, s+ c- }: p- Z9 lis to determines whether a debugger is running on your system (ring0 only).$ d! {; E5 C7 l- r. F! y( L
, ]2 \; K! V6 L; p VMMCall Test_Debug_Installed y, U/ i r( @4 v5 Y
je not_installed5 i9 X% l* c7 h6 Y. c+ ]0 ]3 i/ T: k
# n3 |! j- B YThis service just checks a flag.% ]$ b) V, T/ S, f: V
</PRE></TD></TR></TBODY></TABLE> |