<TABLE width=500>
* M/ l" D$ Q5 k4 G8 v5 p<TBODY>
, }7 ~, g1 a; h' G4 @4 a<TR>
; ~% Q! x1 q1 o) r<TD><PRE>Method 01
" L9 J' Z( A4 v6 i3 C: v! ?; P=========
0 a+ ^; p5 q% v* Z/ v& k; }# E8 k' k4 V+ J; A
This method of detection of SoftICE (as well as the following one) is
4 ]1 x; f: m/ \/ l. A& C* @used by the majority of packers/encryptors found on Internet.8 G4 k7 A" |3 M$ [; X
It seeks the signature of BoundsChecker in SoftICE+ y4 T+ }( z0 z6 r
* \7 {. s8 W% ~1 V( U+ p; H3 v
mov ebp, 04243484Bh ; 'BCHK'8 d( o( v) ?: U2 t) G( W6 l2 d% u
mov ax, 04h2 }: R% S. j2 N3 @' p" X: \/ J2 x- Z
int 3
5 ?/ E5 I, `1 D cmp al,4
; f* ~" ~( w! y5 a _0 x jnz SoftICE_Detected
2 Y) e# n2 f: Z6 D4 b V" }; w( I7 e
) J4 | o4 }7 K! F, Z2 \& f___________________________________________________________________________
9 {9 _4 ]0 D- L( ?( b
0 i# h! q# F* J! F) ?Method 02
: a8 Y' a- i" ]* `4 z i8 z( y=========* ^& A& h! T2 r: n: t9 W
1 n9 ^$ c3 R0 a9 b6 O) g
Still a method very much used (perhaps the most frequent one). It is used) q6 x6 c4 n9 ?# e2 O: |8 B5 _: ]/ q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. G: Q8 D, t9 Y- for execute SoftICE commands...
; X( \# J( }. j4 E, s) i2 ?1 C: v* tIt is also used to crash SoftICE and to force it to execute any commands
. e. @! Y3 U; L0 }* d: @(HBOOT...) :-((
& ?- e8 _% s6 f2 B7 ~' q
$ C. M6 x0 r$ x; @- q8 cHere is a quick description:& w: `- ~% X3 y7 E/ o- P
-AX = 0910h (Display string in SIce windows)- W6 a8 z ^# F( n3 F
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' K$ |5 e, D+ R+ a5 [6 r( R
-AX = 0912h (Get breakpoint infos)
9 [) p" O! P- w- A-AX = 0913h (Set Sice breakpoints)3 b, r, a- X5 x0 Q! A0 s, G
-AX = 0914h (Remove SIce breakoints)9 I: D3 p8 Z7 E
- L7 I/ X4 Q0 y6 @0 ]; oEach time you'll meet this trick, you'll see:
N5 o# V" o/ }; S5 a: d; c-SI = 4647h% v% o4 f- N7 K+ h4 r2 L
-DI = 4A4Dh y9 e- t6 S- | z, x3 W
Which are the 'magic values' used by SoftIce.
& \+ ] M( _. J0 O! l; B$ R5 |For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; U8 S/ [4 _% N$ ^6 ]$ h+ p7 Y. b: f6 r% c$ ~
Here is one example from the file "Haspinst.exe" which is the dongle HASP/ s2 T" p/ M$ t3 {( w: ^
Envelope utility use to protect DOS applications:( f2 S2 X/ j; ]1 A' u6 f2 i
. M- q) w2 g' W' F# c* Q6 W
4 y% q' J! G4 W# w
4C19:0095 MOV AX,0911 ; execute command.9 P$ t1 }5 ^$ u& F
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).+ e# c5 U) D( y( m
4C19:009A MOV SI,4647 ; 1st magic value.
) ?, ?, ? Y0 l6 b$ I8 \' k4 M4C19:009D MOV DI,4A4D ; 2nd magic value.
% [7 W6 [# R3 P* K) y5 {# F9 l8 f4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)8 o* W8 Y6 b5 A
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! G' L8 \2 G) y; D ?/ X7 H- S4 U
4C19:00A4 INC CX
, X/ b' v }, H9 W+ Q4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- o2 y w, e; g" E' P8 V: G8 }4C19:00A8 JB 0095 ; 6 different commands.) _# i; I1 x/ r# C+ f$ K
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 k; j: Q* Y8 z( c! n- X4C19:00AD MOV BX,SP ; Good_Guy go ahead :)) f7 i4 e0 W3 c6 r. d0 j$ {
/ S. |8 o+ H |
The program will execute 6 different SIce commands located at ds:dx, which
^9 G% q% w; x+ Oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, \' [1 o' E( I% }( |6 ?0 M( p% ^; K( h& ^7 o: p
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.0 B5 I+ f5 C# M, K! \4 S# ~* u
___________________________________________________________________________) |6 A, r" X( u( a% T# ]
# [) l2 z! @( T9 `# i" G% @% j* ]
8 {( m1 q Y/ D5 ]: Q
Method 03
I0 y$ T9 ~. o# V+ D=========7 U- i& t* L- p5 [* B' S7 \$ R
) E( t2 z; o' Z3 L+ _4 p
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: h$ ~4 U8 I, p4 I' r" F(API Get entry point)
2 i1 e3 p+ }' c! N8 O
4 T2 u* d8 ^* R, k" T, D% [! s2 q9 L- K5 k( I
xor di,di
( H4 G/ m1 W2 ~7 r6 ? mov es,di
) j: t3 r# d$ w7 U0 A7 f mov ax, 1684h
. @3 e2 {2 w! f' v$ b3 I mov bx, 0202h ; VxD ID of winice7 Z% a' O7 h* G& M
int 2Fh6 d) o5 L8 p( n8 e0 n( q
mov ax, es ; ES:DI -> VxD API entry point4 X, B0 R7 D+ i) e% G" ]: m+ z; U T
add ax, di
7 K H* W% V% r8 B test ax,ax! n+ O9 L% R$ s) ?1 y) `
jnz SoftICE_Detected
5 X. \3 V5 b+ `2 V
/ p5 P5 H8 u3 J+ K___________________________________________________________________________5 p: X1 C9 }2 _6 M6 q. _
1 J$ S. T0 n( x9 | S
Method 04
( B* I1 A/ E4 L5 C7 O=========
" n6 X: C. g; v, F3 N
+ B, j @2 e: l0 R; @Method identical to the preceding one except that it seeks the ID of SoftICE! p8 u) J2 L. D5 |
GFX VxD.. y- R2 o- d9 }8 A3 C- j+ d8 @
* _2 |' p, o. `
xor di,di
8 M! w6 G+ k s$ H- E mov es,di
# m$ D [6 Q1 n4 p: ^7 g mov ax, 1684h
6 t' O" l3 f0 _ mov bx, 7a5Fh ; VxD ID of SIWVID2 J+ p9 c+ H! h6 u' C
int 2fh
2 r1 C4 p. M; G( e mov ax, es ; ES:DI -> VxD API entry point
$ h4 j: S; u) ^+ K) \& N2 ^ add ax, di
* I/ D* Y+ Y$ D test ax,ax
' X" S! h/ u! x) O3 M( m jnz SoftICE_Detected* M4 B# H- T7 p& W& Y6 m9 Q3 G0 `
; d( ]; f& d1 f4 s, @7 w+ I/ r__________________________________________________________________________9 a7 q% ]% c, ~% J
+ ` M) o/ H0 q- z% ]
0 s! J2 t7 c$ f( v5 VMethod 05' Y# u. a A% F
=========; O8 v1 x8 R0 f5 d5 ?9 W
+ u( R( p+ E$ C) r7 E t" [3 m8 d7 G
Method seeking the 'magic number' 0F386h returned (in ax) by all system0 H& l2 B! ~! n- j$ H) b& k
debugger. It calls the int 41h, function 4Fh.0 `3 X8 e) p/ [- {4 ^4 m* O
There are several alternatives. " d r! t. ]# I. p* U5 {* ?) Z
* f% n9 T. g0 l5 b# L7 XThe following one is the simplest:! Z c9 S8 l. m; v7 ]
2 p" q' N1 o; D) A! T
mov ax,4fh. n. e0 l+ s# F9 p* }9 P7 f
int 41h( x" `8 P4 e7 [! A- b3 _# S
cmp ax, 0F386, y& O+ f# t0 i/ }( H2 v+ ~8 \
jz SoftICE_detected
) x( }# o, K$ L9 R/ C6 }3 e6 U
A/ _" L( W/ l9 s) O6 ]+ s( _2 [, I" c% J, ?2 s# n
Next method as well as the following one are 2 examples from Stone's ( w: }6 o6 M- l5 i3 l% @. T
"stn-wid.zip" (www.cracking.net):2 m$ ~) i8 V' x% Q
, ~, D: b- e/ R( x2 T( i1 l
mov bx, cs7 C: [' W/ B/ h: t, p: P9 h3 {
lea dx, int41handler24 l! L1 |: k8 j/ \' O2 d* ?
xchg dx, es:[41h*4]
2 ]# d4 ^- n i8 _8 j" L6 F xchg bx, es:[41h*4+2]
+ v& S8 K' U. T6 t6 P mov ax,4fh, c2 D1 Z+ e* [; W* X
int 41h: b% ~* R, L' Q, \; F
xchg dx, es:[41h*4]
" e# J) y7 P" ?6 ^) G/ g8 q0 @0 L xchg bx, es:[41h*4+2]
; v; L- E" u2 ^" X0 d cmp ax, 0f386h
* |8 r/ m/ H1 E$ H, M9 x7 C jz SoftICE_detected2 O# v0 p' V( U- E: b9 x0 D8 T
6 E9 @/ [/ y- j0 E$ yint41handler2 PROC, Z, h" F) T3 T8 ^$ h, }; p3 O
iret
4 Z# D% q. s; K- p: S; O6 Gint41handler2 ENDP
# h( @0 E# G, F1 `& D( T9 v0 V q4 e& c( J0 q) w* a
% L- R' r2 i* n# W+ k, c4 T9 l
_________________________________________________________________________
$ h3 H" z2 y" c# m- ?' K+ Q/ k3 A$ P
( z7 A- v! K. _, E% W6 wMethod 06$ Q# {1 E3 W6 K
=========
$ Z7 c& k. X0 N& N: H) Y [/ [1 x. p5 h% O
5 G. ~4 O% M P- c2nd method similar to the preceding one but more difficult to detect:# x2 O1 r# `' J$ s4 ~
$ t8 N6 Q( t1 \2 c# N9 n
7 `: h q O/ @: n9 Sint41handler PROC7 w3 P* ~( |5 c! ~
mov cl,al
2 u7 M' e) `) @; Q1 i$ ^ iret9 z/ e! T" s$ Q1 P( C& ^. ~
int41handler ENDP
: P2 K! L% B! @2 U( Z" K+ @
4 A# Y% n; o' J: l5 r
" b7 D' t$ S7 g" T- a/ w& X xor ax,ax7 a8 N' k3 J+ x3 @% T% ]8 u
mov es,ax2 y S9 p5 e* h a j
mov bx, cs! N! h& n6 H5 ^7 i k
lea dx, int41handler r4 w. u! C F0 B/ \. _% a
xchg dx, es:[41h*4]
3 k3 r8 O: W4 A2 E8 u( D xchg bx, es:[41h*4+2]& L# X. {& j' }6 }2 @: C0 {
in al, 40h( X# G8 e$ w6 n: x6 P+ F3 [. ~
xor cx,cx
# p9 z0 @" e" e: P4 G int 41h
" o* ]6 @; k) P/ B5 Q. M( B f5 R+ x xchg dx, es:[41h*4]
( I- @$ F& [; a! p( T5 ?' { xchg bx, es:[41h*4+2]1 m+ u9 h% _5 o( J9 T. q4 Z
cmp cl,al+ \* K+ q6 T' B( E1 V4 A
jnz SoftICE_detected2 i2 u0 o- Z% M
; A }& y. [/ |; {9 B3 M* n_________________________________________________________________________
5 v$ ]3 P' Y0 x1 g9 @' p, ~5 _/ i6 @5 Y* J/ W: g& I
Method 07
' M) f8 A9 x/ O=========4 G, Q0 k; e; O$ Z C" p' m
6 [ |2 F$ }0 L! C3 o0 BMethod of detection of the WinICE handler in the int68h (V86)4 k6 n! g5 [5 h, {2 N8 n
. }9 P4 B3 E. V mov ah,43h
! Y- h( P! ]) D9 @7 D( e/ s3 F int 68h0 V2 i* W: `* I6 h7 M6 Q* \
cmp ax,0F386h
, u& Y% V) f" r4 | jz SoftICE_Detected1 ~# z8 `' e& q9 m4 x, e
* b0 \ L& @, i) J: R q
% y, }# W: m7 ?) j. n8 F
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ ~: u* U) j% R6 G, _6 h) Y
app like this:
3 v- [2 J9 j8 M7 U- b0 x0 M& M7 X" l# {7 L* X7 W# ^5 A
BPX exec_int if ax==681 n2 f3 Z* Q5 @: c) o9 z
(function called is located at byte ptr [ebp+1Dh] and client eip is
# l( F6 ^! \# j7 g4 z. j located at [ebp+48h] for 32Bit apps)8 _# y( c; t' w9 `" ?5 `& N- D* w& K
__________________________________________________________________________
+ q; K5 ]0 |+ W, G" L, @ |1 a3 B
s! O5 S5 U8 }) Z' B
Method 08, a5 M7 N; C N0 G% J t
=========
% |1 E. S( A9 c
- d9 a4 |% S/ j$ d. v5 ~It is not a method of detection of SoftICE but a possibility to crash the# E" j6 |, o+ q4 p2 U- G
system by intercepting int 01h and int 03h and redirecting them to another0 n/ K( ~; S/ b8 C6 K9 D; x# R6 M
routine. R, S$ z) x7 |
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points& ^% h8 c D: \+ B2 ^7 T
to the new routine to execute (hangs computer...)* C- x7 p5 M# ~+ G( d4 @# Y' G: @ C
% X1 i' W6 J$ h% z; n3 l mov ah, 25h
% G: f+ p. M2 x% F6 q mov al, Int_Number (01h or 03h)
+ f7 c: \3 }& g% q' K9 e mov dx, offset New_Int_Routine5 B7 l6 U. C. h C0 {
int 21h1 P1 A8 b% F" D" ?! U6 r0 {
; B3 b7 l" l2 z1 G- [/ S$ R9 b3 f! Y
__________________________________________________________________________
4 _# G* l5 J1 V T
6 F! w1 V2 l, o( `! TMethod 09
/ v; h% V( Q; x) x% v W=========
2 A K8 h5 X7 f0 m5 C. Y2 w% m1 o
* ^" b9 G7 W8 L2 K8 G" {# S: V0 WThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, @/ R4 p) H' c1 m
performed in ring0 (VxD or a ring3 app using the VxdCall).! }: h3 J; `/ x2 o
The Get_DDB service is used to determine whether or not a VxD is installed
; G# ~# N; V+ X! |4 V$ I: Lfor the specified device and returns a Device Description Block (in ecx) for7 Z5 ^5 _9 v/ m1 i6 f
that device if it is installed.
2 s e" n# R& A. q N6 E2 Z4 X, q5 ?5 d/ e7 u8 Y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID* j+ l7 e- y$ o, Q# e' v
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 m- i, ~; l3 u" i6 r( a, c" |# e VMMCall Get_DDB
. A" `& B9 D4 I) E. N3 V ` mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- T) P/ q. g3 _" R8 W% ]
; `4 L( A/ c, ?Note as well that you can easily detect this method with SoftICE:- T1 K8 w6 Y* u t0 {. Z
bpx Get_DDB if ax==0202 || ax==7a5fh- Y' k! v2 T1 _8 w; h, O( }( a
# m6 |0 R7 e0 R/ I__________________________________________________________________________" Y& s, z1 S) c v3 d! T
2 u' r! D9 o8 T, GMethod 108 x4 G# z5 n+ G" G: X- y/ I
=========2 y; V* Q+ }& W- `1 Y7 e2 U4 a' p
3 B, n1 T! b# Q- f; W/ t
=>Disable or clear breakpoints before using this feature. DO NOT trace with7 J% z2 B) f3 w& A2 S3 \
SoftICE while the option is enable!!
, b- @) W/ g; z
& ^6 ?9 ?9 f. Y8 }* ^ n. U0 d& oThis trick is very efficient:& A( c9 R3 U) {6 b1 v' Z
by checking the Debug Registers, you can detect if SoftICE is loaded
! j3 B, b5 C+ o% j7 ^7 L9 ?6 J; L(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; `" l. C! b& X+ g r
there are some memory breakpoints set (dr0 to dr3) simply by reading their
( d& C" D, g! X6 gvalue (in ring0 only). Values can be manipulated and or changed as well
6 h, U7 r* E8 [! f' W. `! Z8 O/ m(clearing BPMs for instance)9 A: E. q$ @. z3 J' B
0 l4 L9 s1 Y; `6 |__________________________________________________________________________) n8 H$ ~$ b& ~5 u1 r7 w
; y) C% ]5 L0 Z8 Q
Method 11) `4 ~1 C) x" O3 a
=========
5 ~, Z" x' r* Q4 n6 o. m1 v7 |, h# B4 P1 j! x# B1 Z9 {& b. K
This method is most known as 'MeltICE' because it has been freely distributed7 t; a7 z1 A/ {9 e7 y, k, H
via www.winfiles.com. However it was first used by NuMega people to allow$ e$ }9 C5 L/ M9 U* M+ [9 [
Symbol Loader to check if SoftICE was active or not (the code is located# ~ R' H$ T# G( z, G( w4 }6 V# i6 u+ q
inside nmtrans.dll).- M3 g" D3 S$ a- _- C
; s y9 r; _; ]3 q) W$ {The way it works is very simple:0 i2 D C ^! s4 o( J7 {+ N
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for. }! U6 b" G/ ]
WinNT) with the CreateFileA API.! W5 t/ S1 y) |; N# i& i1 @
1 R# U$ s2 E" [+ S3 u8 OHere is a sample (checking for 'SICE'):
) ?1 N1 a }. z' ^
/ b: P+ `8 R2 U( G4 k9 ^BOOL IsSoftIce95Loaded()
4 b; |5 f2 t8 o% l! X9 r, y4 b{) H; s1 k3 h% c4 Q
HANDLE hFile; . X/ p1 W; K" g7 D) d4 h& V) m1 ]) `! _
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
/ D |1 `# m n4 {- x D8 v4 S# u FILE_SHARE_READ | FILE_SHARE_WRITE,, d7 ^- A% Q9 L1 Q: Q
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 p7 N' F/ b# N
if( hFile != INVALID_HANDLE_VALUE )% c3 s" |& U7 d
{
: O6 P4 o; t9 p, s7 t5 ~1 p CloseHandle(hFile);$ v o8 N N; _* x: c$ J
return TRUE;3 u2 {" X# p+ l- J0 d+ o( P
}
2 M' b. t3 }1 [; P8 o return FALSE;
. O! A7 i9 V1 w}1 K+ x0 c) M+ p- B
$ H, F6 R9 x; o) Z9 Q! a6 z7 S
Although this trick calls the CreateFileA function, don't even expect to be
3 G4 \. V1 n9 o6 O4 S+ t& Aable to intercept it by installing a IFS hook: it will not work, no way!* d" d C# j5 w, e) o$ P1 X
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
) H w+ p; T. n! Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) n+ n1 ], W4 ~! L& \2 g( T
and then browse the DDB list until it find the VxD and its DDB_Control_Proc ]7 g4 v! _/ K( n4 D5 D! y! e
field.
1 r) v1 B. B$ H6 C% GIn fact, its purpose is not to load/unload VxDs but only to send a
+ ]' n2 ^* P7 a) yW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# V- J( E$ i0 y" t: a f
to the VxD Control_Dispatch proc (how the hell a shareware soft could try* T. w+ u& l. d4 ~, v9 ]) s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
! d& v! [- P; xIf the VxD is loaded, it will always clear eax and the Carry flag to allow9 Y" L8 O& q3 n
its handle to be opened and then, will be detected.
# f% i2 G" M' A+ K" \1 w, }+ JYou can check that simply by hooking Winice.exe control proc entry point. {- ~1 x( p4 r1 e& Y( \
while running MeltICE.% q3 ^3 y8 L3 ]# G
0 B* m; \4 m* l$ l
+ q/ a( ^) N9 v. Y+ `& W3 Z 00401067: push 00402025 ; \\.\SICE
6 Z" }9 I) _6 u% ~2 ?" G" @9 v 0040106C: call CreateFileA
- r9 H0 H7 g: ]6 { X 00401071: cmp eax,-001
/ ?0 ` Q! M1 l7 s2 ` 00401074: je 00401091
: \/ L$ r+ |" B8 x, {, b0 Z8 G N, Q8 k7 U6 p4 R5 M* w
6 u! n6 g$ q6 g! P: ]. qThere could be hundreds of BPX you could use to detect this trick./ H1 m6 ]7 F& z/ k } C& p h! ?
-The most classical one is:: W o$ x! S( ]4 v& l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ F" _) W; }2 t6 W *(esp->4+4)=='NTIC'9 c* b+ a8 m2 v$ J. f
; x- w% e7 B/ `9 Q0 n-The most exotic ones (could be very slooooow :-(
" c- N. E" t9 q5 A9 O5 V+ F7 h BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 p/ m) }3 S* @1 T ;will break 3 times :-(; n$ `) y: i9 J- H: ~8 Z ?
0 h$ H" A J' @3 n-or (a bit) faster:
" P# J) i, {+ U: G6 |/ m BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 _3 e2 I4 K* y- G7 s* V. \
& F% l; K5 K/ v8 N5 n# K BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : i; }; [$ l' W7 X1 m4 z
;will break 3 times :-(
' H0 e6 m0 _- D, F$ u6 W) h
5 y- V! g: c" v& R, k9 `-Much faster:
6 k& B5 \1 U$ {5 U) n+ N BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'# `' B, d) [( Q" }$ I v6 U
1 z Q6 \& G; `, F( J0 b w0 E3 j( xNote also that some programs (like AZPR3.00) use de old 16-bit _lopen5 w0 c" g3 a; q
function to do the same job:
, Q% U5 J% I: V5 R- y: a: u2 O5 a2 ] e' Y
push 00 ; OF_READ
4 ^9 P+ X! |4 N7 w mov eax,[00656634] ; '\\.\SICE',0
* _# D% A) N0 e" O, V3 p5 F ~ push eax
6 W+ C; e6 w4 h* T' C! l call KERNEL32!_lopen
" L* v% k% x- [& T H inc eax5 Z# E- h* `2 E% i0 I/ D
jnz 00650589 ; detected4 V! X5 I4 a1 K& B, O9 H
push 00 ; OF_READ
{% |4 ~2 p3 A7 O5 { mov eax,[00656638] ; '\\.\SICE'/ T9 z0 o" y. u4 S7 C8 N) m& Y
push eax3 {# s( {6 x" P- H% P- d0 I
call KERNEL32!_lopen' ]! [2 |6 W4 }$ y) T6 f
inc eax
U' L6 D# y- i/ L3 Y jz 006505ae ; not detected& ], u0 o* [1 _- H4 q$ _ U
$ O b V( N, @
& J8 E9 a! D- N__________________________________________________________________________
' ]0 B x) a3 w( y2 D
3 X/ W5 Q% a K% w( v7 n( e/ z* kMethod 12
O' h/ O9 y% q=========
1 Z) ]2 p. b: Z9 E
- I5 |! R0 H3 v: O& WThis trick is similar to int41h/4fh Debugger installation check (code 05
4 M8 ^/ L5 Z' q5 C& e& 06) but very limited because it's only available for Win95/98 (not NT)$ R8 @7 G' X* w7 J) c
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* {/ c7 ^- w" w/ J ^' ~
/ W7 `6 N" z! z" p' H+ a push 0000004fh ; function 4fh
. C0 i! w& t9 `5 _ S push 002a002ah ; high word specifies which VxD (VWIN32)
3 z# k# x# S# @! _- { ; low word specifies which service9 s5 D+ Q* {. m# Q
(VWIN32_Int41Dispatch)
! { F& m: R0 e3 A3 t call Kernel32!ORD_001 ; VxdCall; ?* Z' F9 @. _; Q% O* J x# N* f
cmp ax, 0f386h ; magic number returned by system debuggers
! \# L# y. p' e5 k: g+ F jz SoftICE_detected
( S- b" V' ]# ~8 L1 A7 T5 J" |! M+ b$ W. p
Here again, several ways to detect it:7 `0 u F' _& y6 u" U; }' X
9 M$ P( y- J6 O1 J- i& o% g
BPINT 41 if ax==4f
x+ c, y3 [7 e& D1 d
' W. `9 C7 _8 n' y' Q5 G BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
- x" r1 A$ L) m( ^5 C+ X9 @: Y; J. }: t$ O9 }& V
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 Z" h% H% \5 H4 E" C+ y# r: C
, \" y( w F' p0 m) O
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
o9 l/ z7 B0 }8 s6 w* u4 V( Z
* c- f& X4 b- _1 W# d__________________________________________________________________________2 |% \/ U6 \' [( Y
" }6 { t0 C* t1 V( L: y7 L! l
Method 13
4 B Q _. N6 m- `9 m/ J=========
h* l! o" ?) V
: I X; @& T, l" ANot a real method of detection, but a good way to know if SoftICE is
' z" T1 _- ~1 A% xinstalled on a computer and to locate its installation directory.: `! D7 x8 i& ]0 z. F6 ~ q
It is used by few softs which access the following registry keys (usually #2) :3 p7 I4 v0 D: Y- ^- d4 G
3 ]2 z; y& U% _$ T8 Q, ]' j+ @-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion e$ n* A- Q9 b* x$ s; t5 D
\Uninstall\SoftICE9 b C: {; x( }+ Y- u
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 _* |0 h% ~: ]2 z5 Y' }( u
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ L7 G b1 l" G. y+ N% `. B\App Paths\Loader32.Exe5 J( D- Y/ c7 Z D! H8 N
. o" G! P. U; h; a
8 g' q3 T' S/ N: I% T8 i' }
Note that some nasty apps could then erase all files from SoftICE directory
/ M, G7 U5 N' f: G2 L$ c, K(I faced that once :-(5 C* C+ U' t% H* e' ^
& O m& k* a" j( B. A$ d- b ]
Useful breakpoint to detect it:* ?/ x1 i8 j" D1 x( {# x4 c
# J# ?3 F- c' a8 \* w5 k- H BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
/ B; |0 d& K* E- }) l& r+ v4 b$ H" d7 G+ j9 n. o% w9 b
__________________________________________________________________________: z- @& m9 Y% h. n' N/ N2 @. ^
% a4 p% O, s5 j9 X" s8 A( X. d' m. E( h- |* Z$ v! |8 A3 ]" T
Method 14
% e2 j L) a# e=========. _ D% G$ L4 T
$ B& Q) g8 o2 [4 r3 i# Q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
1 t6 y+ U7 i0 p8 X* k1 i% tis to determines whether a debugger is running on your system (ring0 only).
7 d! F7 C, w$ Z- _, U( g2 D" k+ o5 `, s) X j! D. ~/ k
VMMCall Test_Debug_Installed" Y* Z. ~( q1 S3 c
je not_installed) _" `! S3 P5 I0 r6 D4 A
* n: ^. p% ?7 d" \3 @8 ], N
This service just checks a flag.
( L$ T4 ?9 l' ]4 u- {! ?- N$ |</PRE></TD></TR></TBODY></TABLE> |