<TABLE width=500>
4 T, v# m' ^' a" o$ {<TBODY>
' R; `% y" h9 L9 S- h ]1 G4 n% [$ h<TR>
9 w2 F* _( N. X3 }: v2 r0 @<TD><PRE>Method 01 _( ? c0 Y: J7 @
=========1 q0 I! @' s" c( S$ Q* A
5 p& p6 s, g4 S: Z8 o @% s+ s
This method of detection of SoftICE (as well as the following one) is
7 I& v, D; I* q' m3 V" K2 tused by the majority of packers/encryptors found on Internet.9 K9 M& T" {% X2 ^+ x
It seeks the signature of BoundsChecker in SoftICE" q) X; m5 ~, [7 u
) b0 E- T2 o3 C7 k' @/ ~& C mov ebp, 04243484Bh ; 'BCHK'
+ @+ {6 Z: d* w1 |* \, g+ T mov ax, 04h
; |# }/ p2 M. s8 l' m3 r3 A. T$ t int 3
+ Z1 c! I: G+ q+ s4 a cmp al,4- @5 k# A/ \/ P4 x7 b9 U
jnz SoftICE_Detected7 n( K i" x" ~% L8 t
' l* R+ K% A, S3 L: t$ `7 z* u___________________________________________________________________________5 r! h; U, u1 x& a* v, @
+ L* t8 [ K$ R6 w. D
Method 02
" o. X+ H; q! b! o# v& _, u=========, h- y3 }# F7 N- D! u Z0 k
# m E0 ~) e4 t; I: F% ~Still a method very much used (perhaps the most frequent one). It is used+ J1 Z+ k" Y! p! J y. `# J/ d
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,) B% ~! E3 U1 `) W
or execute SoftICE commands...: a P$ k* {# s$ {; }8 @2 Q* w ]9 n
It is also used to crash SoftICE and to force it to execute any commands
" d& r2 a4 T/ B8 e* t, `2 n9 A( K4 d(HBOOT...) :-(( ' l. v5 d9 }7 W. A) Q" s
5 U) l& F% |. h8 M4 p: S \Here is a quick description:
" @1 t: r7 |3 {% N& H( E( Z-AX = 0910h (Display string in SIce windows)
5 b( u+ y! Y7 Y/ O2 U, ~-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
. C0 v& Z+ {3 H; q( X: {-AX = 0912h (Get breakpoint infos)$ k! \* Z. W3 P6 V1 H4 }
-AX = 0913h (Set Sice breakpoints)
: J) E% @. R& S9 K8 O-AX = 0914h (Remove SIce breakoints)
' C4 f) A9 o- F' L1 ?; H
+ q( a9 K) d8 Z1 NEach time you'll meet this trick, you'll see:0 E$ B y" _3 j- P. w
-SI = 4647h
# H& Z0 Z) A0 I5 x-DI = 4A4Dh, ~8 n2 i7 L' w2 W( j+ n3 U
Which are the 'magic values' used by SoftIce.
* g) V" H: s0 ^5 [For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 z. i; ?# f; i! V" g1 d
% B6 r; E% ?: F4 R- k2 W. dHere is one example from the file "Haspinst.exe" which is the dongle HASP4 \% y0 f: z: E, P) k5 @- F
Envelope utility use to protect DOS applications:) J* _! w' E1 d. H+ O
& ]; s; O' L' h8 A# r2 u9 P$ w" q: |3 h( m: X) C5 ]0 c. s+ h1 i
4C19:0095 MOV AX,0911 ; execute command.$ R# Q) m. f* V& |7 r" }8 ]
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
_+ {* \' |1 _! D7 G* ~& H4C19:009A MOV SI,4647 ; 1st magic value.
4 ?0 Z ?: }( q% V6 i4C19:009D MOV DI,4A4D ; 2nd magic value.
: F; N+ C& S; O7 \4 u4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*); l- H" T, d$ b. p1 L1 W
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 ~. ]' ?! [/ W8 ]/ r) l# g" X4C19:00A4 INC CX& M6 {8 b/ s: y: a- Z
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" |* u- x( A. \, _: M
4C19:00A8 JB 0095 ; 6 different commands." ]1 b9 Z. k$ r
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! d9 u+ [: o" G2 F* R4C19:00AD MOV BX,SP ; Good_Guy go ahead :)2 `$ }# A4 [' J, u
7 x$ @8 J1 z; @1 W
The program will execute 6 different SIce commands located at ds:dx, which4 _: g0 l S& J
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 v0 M+ j/ p0 R/ h1 _$ `
" R: \4 S2 w4 o! e$ R4 [* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; w& k! s4 e9 Q( V: ]' J: y, _, z
___________________________________________________________________________
+ @3 @9 K1 T6 v- r# |2 O" ?, \, d5 K- A: |" z: f7 {3 p
3 l$ A! E# K- z |# Q, M: W
Method 03& i! A: A. [7 ^. y1 ^/ b% ^
=========
/ w' ]) k$ c* @& o- F
* F9 [" c9 V& x- Z% K: P- P- {Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- x. u+ _( o/ W6 H6 S$ e4 ]- U
(API Get entry point)
$ e, g+ Z6 Y2 l) m. C, R
/ Z8 J' ]; e8 S1 c0 p0 f" q
% M! `# I$ H# X) @ xor di,di
! y/ v/ E7 o' }% c% s! U/ s* l mov es,di9 _5 L; k7 F! o1 k+ j
mov ax, 1684h
( K1 s9 O8 d7 O+ G: W+ W mov bx, 0202h ; VxD ID of winice
0 p4 V4 P9 g; a9 R4 }* T. U/ z* } int 2Fh
1 u1 L2 U" g4 }# K; s mov ax, es ; ES:DI -> VxD API entry point
; N% h* C3 T M! E' U add ax, di6 ~9 _- n1 a& h8 `
test ax,ax/ Z: d; c! Y j3 V
jnz SoftICE_Detected
$ z. L" O i2 s+ o& T* o' @$ ]# B7 w! R% J
___________________________________________________________________________% m) i- H3 e8 {
! t# A" Q6 C" wMethod 044 w$ S3 a1 P7 C) P( U9 U! [
=========) o- W( R% t# ?- J5 \- E
9 |1 P, [2 {* J) WMethod identical to the preceding one except that it seeks the ID of SoftICE5 S0 q* N& R2 n0 G9 d) e8 ~; s
GFX VxD.; B* P6 m$ }3 S0 P9 O% o+ T2 C; D1 n8 {0 q
# g) Z5 [5 Q {% Q0 n7 K
xor di,di
- l: x- K/ ~9 L; v mov es,di
D D/ }! P, x' l mov ax, 1684h / K8 n* H* }* c& V# l" c3 k
mov bx, 7a5Fh ; VxD ID of SIWVID. L. |0 N N( ^3 b9 S6 y" J
int 2fh
$ [/ C0 a- d4 W- m2 U8 t. ]% O mov ax, es ; ES:DI -> VxD API entry point
6 ]4 a6 ~. f( z4 ^( z2 E0 r add ax, di
) T' v" \! Q2 v/ P5 x3 Q9 Z test ax,ax
$ \( n( h, i0 @ jnz SoftICE_Detected J' M( K6 l' Q6 Q1 {/ m2 S- ?
5 R+ z0 @5 D! N& n. x& f
__________________________________________________________________________1 r) t! D1 R; R
3 Z% L; E8 u5 x& d' K+ q
! ]5 h. ~) R' O: w: c) }Method 05. V% Z& t1 v% @ {# ]& ]5 {
=========
$ @' a* Z2 [2 o4 g! \& U2 J9 r0 U
3 I$ \, D* T( x0 n3 p9 ?( `Method seeking the 'magic number' 0F386h returned (in ax) by all system( `, M4 [! y" }& P# O
debugger. It calls the int 41h, function 4Fh.
7 A4 d% ]5 ]8 J1 R' |3 J7 S* V. `There are several alternatives.
& J9 t/ B2 `* J# a, k. u2 d# r" |! ]4 M& n5 c4 V) N# ?
The following one is the simplest:
8 H% _( J* x/ K" B5 Z7 o* G
1 s% R: j2 z# l( @. _ mov ax,4fh
3 m8 H0 X( L1 N3 {( o: H int 41h
" c% A. a6 m `# W cmp ax, 0F386
* v5 L; w& P0 h; K: k1 Z; W; D jz SoftICE_detected$ w7 X7 m, X7 z. F
6 l2 A L) Q5 W& ]( {$ r7 g
6 C7 E8 A1 Q+ T i8 qNext method as well as the following one are 2 examples from Stone's
9 f, R- f# t* d7 E1 Y/ J _/ l"stn-wid.zip" (www.cracking.net):
. W e s2 ^* Z7 e& z5 K: n; {% i: v/ J) w3 B3 W
mov bx, cs8 D7 f# H4 t2 d; d3 W' H
lea dx, int41handler2- ^/ K. B& S" k8 c
xchg dx, es:[41h*4]3 ^7 f! E. W6 Y2 B5 J) B
xchg bx, es:[41h*4+2]
6 ?3 s. N! c8 j4 K mov ax,4fh
$ \; m1 D2 G8 Q1 ^4 B3 x int 41h
) K/ Q, T0 R( H! _( k xchg dx, es:[41h*4]
/ g: A' y' \! P4 J$ P xchg bx, es:[41h*4+2]# K" p _9 y7 W. S w6 ?
cmp ax, 0f386h
, v) E+ H% R9 L, ]9 F jz SoftICE_detected
8 \7 K( j' k- f/ q, l/ O4 l( R7 L: v9 s, m- I
int41handler2 PROC6 s/ I* ~9 J- ] ~
iret
4 k1 r2 N7 Z8 Dint41handler2 ENDP
) Q: A9 t0 ?$ G+ O# Z* u" z. C6 A& B9 L1 e2 Q. w
, K' ^+ ]& S7 `; a6 s6 X7 p- q
_________________________________________________________________________
/ z& X, v9 y; t5 a: Q, N( z
) }. J2 K" s% u3 g
1 f& T2 W4 a4 T% S) o# PMethod 06
3 b' q8 E X s7 }. e+ K# ~=========& H- _0 J; P4 V1 V3 X5 b
3 D6 F" Z7 e7 l0 n% R, n: m2 \) A6 q& S! `9 O" D l
2nd method similar to the preceding one but more difficult to detect:
! q l9 d. K8 {2 b3 \1 X; _* ~
2 x1 i' D6 v+ i( K: V
; [/ q3 T, k$ v. X6 N6 F2 `int41handler PROC+ H$ i# e; D: g. L3 J8 @
mov cl,al
6 q6 B- e, D j6 ~1 ` iret3 k q1 y) k% E* Y" e
int41handler ENDP
( b# B; D$ O$ a6 X! e
% b9 _3 J! M4 r
& ^: _, ?' M9 t. t1 _8 ]4 A- @ xor ax,ax
4 g: l5 e3 k# `: ^9 P% _) t mov es,ax
9 Z( Z9 _+ |1 L+ g! J; h* P mov bx, cs
+ U/ [' r8 @2 Z, \4 A5 q lea dx, int41handler0 ?1 b* R% Z) \5 k. r1 s- L
xchg dx, es:[41h*4]7 S4 A+ ^& A$ b2 W# J8 ~* H* `! m, {
xchg bx, es:[41h*4+2]% X5 {# s& v2 f- N+ l1 e* V
in al, 40h
$ i9 @4 @3 H' F9 `3 X xor cx,cx
. k. k% ~3 ~1 T int 41h
( N& b$ `1 @- n% |, i- j xchg dx, es:[41h*4]
9 }, X- n& U5 u6 F7 T2 ]9 m4 b xchg bx, es:[41h*4+2]0 O j2 q" \& P3 v1 T: R: ^
cmp cl,al6 c. P+ A9 a/ r! P4 |' I' A" M
jnz SoftICE_detected
( z* ~% J& M; F- k$ U- `4 `$ P# m" a7 T/ y. z7 f ~1 l
_________________________________________________________________________* x* U/ E: l% B0 R7 `; N8 D3 x+ ?3 E( G
1 {! @* D/ n- f; ^+ y7 Y
Method 07
, f0 R( Z! K i=========
8 P# F' p. @! i: q% I- _7 `6 ]- k. `. j9 N
Method of detection of the WinICE handler in the int68h (V86) U- j, n) J: c0 y/ s k! A
2 l: K( g8 i0 ^+ L" {% W z1 h mov ah,43h
- B) I9 w* W( d. ?5 b, z int 68h
0 x! q; o% u& y% L, |5 I; x cmp ax,0F386h
3 O" a, b* P) @5 m# E& ~* g6 `8 s/ B jz SoftICE_Detected, r$ B: q5 E' {
, g( U: h; t/ b" A! B" }, X3 P1 g3 k/ _, a% e
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ m( a% i" Z6 t# D) s! C( y, m1 Y app like this:/ N, [6 D; O- ^% F, Q e
& Q; h* b$ r3 `: }- w BPX exec_int if ax==68
9 X3 e5 D; q! L- x1 G: f* p. }$ r (function called is located at byte ptr [ebp+1Dh] and client eip is
% P4 c: w# a7 l located at [ebp+48h] for 32Bit apps)
3 |% r6 c1 H: w2 o3 Q__________________________________________________________________________
& f4 H! D \% s* H
5 c$ ?; ~" e$ t! e' c' L4 w, Z5 j' H) l _+ s( q
Method 08
+ \# L e+ h6 O* m4 }6 m=========9 u" R2 A0 y1 [! e: ~
$ D& e7 Z% |6 n8 S: X F" o* q
It is not a method of detection of SoftICE but a possibility to crash the. g. A, k/ S% p; r" @ @8 z8 Q
system by intercepting int 01h and int 03h and redirecting them to another
) U9 X0 @# G, p ]: J1 x$ ^routine.! j2 L6 l# s8 ~3 P" F8 P; ^
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( a( ?; Y H. w V3 kto the new routine to execute (hangs computer...)
5 }) N' b/ w8 |# Z8 _9 h0 T5 N2 ^- _
mov ah, 25h7 G7 v: q7 H5 _ A; v) e% D& G1 r
mov al, Int_Number (01h or 03h)
* Q/ ?- L& R# M2 H mov dx, offset New_Int_Routine" D, e2 U- M* @8 m( C1 _) w
int 21h& }+ H& k5 ]1 ]+ s9 Q) ]# _6 |) y
; G/ R; y3 I( q8 F# f6 u
__________________________________________________________________________
0 c, q9 z F' `6 N2 A! Z- b
5 e* n' P( a2 S) ~8 tMethod 091 ]: K- Y$ c. I
=========8 h' s7 u4 x5 b# b1 P2 `
3 G4 t) I( e6 ^, L+ ?* @. b
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& P! W2 Q% [4 f7 z- x, B% O
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 ^' R4 ?$ n( Y0 M, ?The Get_DDB service is used to determine whether or not a VxD is installed A, |$ D& m* W" }' U
for the specified device and returns a Device Description Block (in ecx) for B4 u1 w5 u. y. }- T l9 @* d0 ]
that device if it is installed., s7 S6 l3 A2 ]* h- [% _* ?
: @4 ^/ Y6 i3 v. u* I mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: j5 u) d- _; ^ M3 r/ e
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) o& ]; @/ K! v+ T. T# R4 X1 W VMMCall Get_DDB
9 [" P# n' h u* F4 m1 m mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed( q2 } [+ |5 t, H+ n" I' m5 T
7 q9 s2 s5 I3 U N9 v' G
Note as well that you can easily detect this method with SoftICE:
! Z! A% j. R6 v5 b8 s bpx Get_DDB if ax==0202 || ax==7a5fh
/ n% j u/ J2 B) {6 j6 }( {) v8 P' v+ r* J" E! a+ I
__________________________________________________________________________7 I/ U. h# C, G; D' m( l) v+ }
/ j' m0 b5 g2 m+ |) M1 p7 nMethod 10
4 W8 P6 W5 k1 q+ _: r) |: |========= v3 z% i# J* D, m
- [* r& J3 h0 O
=>Disable or clear breakpoints before using this feature. DO NOT trace with' r' x: L! N7 r) I7 n7 ?& }
SoftICE while the option is enable!!' j" z# d3 Y @. r7 i! X
5 N$ c+ F+ J! LThis trick is very efficient:
% V6 s% J, Z, S& L0 k Y$ G( I& Dby checking the Debug Registers, you can detect if SoftICE is loaded
& b7 v3 R" p3 g(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( H# ?4 ~0 m' W1 \there are some memory breakpoints set (dr0 to dr3) simply by reading their
- W% E9 Z |* t1 F3 E0 [value (in ring0 only). Values can be manipulated and or changed as well# c M: w& _4 E5 [, |. p( g
(clearing BPMs for instance)5 ?3 t- Z) m( s( l9 S
" l2 ^; A0 P. i( `- G. D3 j) O
__________________________________________________________________________5 S4 J2 a) k w4 v5 i: u! E
& D; ?/ j- a( g0 \9 Q* A* [Method 11, I6 t9 L# j, O8 t# m
=========# Y$ ]1 O6 K3 M# j) j0 b2 l. f! u% {
, v4 X( b# @' \# |9 u! A9 x; LThis method is most known as 'MeltICE' because it has been freely distributed
" y0 v3 G" Y/ ?: g# Pvia www.winfiles.com. However it was first used by NuMega people to allow6 H' p2 U$ |7 B0 b: w" X
Symbol Loader to check if SoftICE was active or not (the code is located7 D! n- h% A% e9 s$ a
inside nmtrans.dll).: v L' B& z6 v
* d' K8 m5 D+ b( sThe way it works is very simple:5 T) L8 V, r4 [3 {7 F+ _3 u, g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
4 b1 h# F* L; E4 rWinNT) with the CreateFileA API. b4 e7 m" M. o- s% ]
5 @8 V& [. G, F9 k' l0 ^# lHere is a sample (checking for 'SICE'):
) O) k' o+ p- Q! }- k
0 [! q; @, |2 U6 |# w* e# TBOOL IsSoftIce95Loaded()
6 Z J* O" @& Z2 Q3 G( @* X{
' d5 H6 I1 O8 [1 L+ u% } HANDLE hFile; , C5 w, i8 l D" u! u4 n
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, s) g7 V# @. Y0 n1 n
FILE_SHARE_READ | FILE_SHARE_WRITE,
1 t' R+ S4 ?+ M+ ~, @" P NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 J2 F5 ]' E: H7 c if( hFile != INVALID_HANDLE_VALUE )2 k, ~3 [3 V/ `4 m
{: z' @. c% {: d% F
CloseHandle(hFile);
7 p( J7 L$ T: a+ d% h, o) ]9 G return TRUE;
. z. @# o( [( G }
; T7 T) A# L/ N+ }! W- G return FALSE;0 M/ w0 |8 Y. ~( }( b5 G
}: N$ w5 x2 Z7 {, j# K6 v% j
; Q" A4 H+ l- b' ]% u* b
Although this trick calls the CreateFileA function, don't even expect to be$ x \% G' ~- Z2 c
able to intercept it by installing a IFS hook: it will not work, no way!
, X( s: H: H+ c" wIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 u; @" o' M' Nservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 X9 q( q! M1 t9 ^4 N- E; m
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
( ^$ F" \9 F/ _$ rfield.2 u3 y0 m/ G( c
In fact, its purpose is not to load/unload VxDs but only to send a
% b) ~; l2 w' ^2 R2 d/ b. ?9 f+ fW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 J. Y0 o* l- B6 v/ L tto the VxD Control_Dispatch proc (how the hell a shareware soft could try) g, b) c8 q/ [; H2 N' d
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
2 n5 F. w, A; c3 {: e- e) m# \If the VxD is loaded, it will always clear eax and the Carry flag to allow) Q; p0 P* @' m6 x" }) |
its handle to be opened and then, will be detected.' x# J3 G* L+ f% }; i" `
You can check that simply by hooking Winice.exe control proc entry point/ v' y8 \; X5 a3 e& Y
while running MeltICE.
& ^1 R4 J7 p! @; v; k
' \6 A) r; `- B+ [" r- u! _9 p) T. n/ p
00401067: push 00402025 ; \\.\SICE" k6 V6 l9 A2 K
0040106C: call CreateFileA% Z" a! u7 U) W, S7 ]8 n1 [
00401071: cmp eax,-001
6 ]! H+ g# }2 N4 S/ j4 P7 b; P. y 00401074: je 00401091- ^0 l! \" k, W5 N& G2 _% i
, `# b$ a# d$ t' A/ O2 h ^/ d
* E+ X1 e) M2 _: UThere could be hundreds of BPX you could use to detect this trick.
# V. q' B5 i* u4 }& N; ]% }) c-The most classical one is:( C8 W6 s' O! T3 J# X( ?
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||. W5 Y9 u: @' } ^( }5 e; m
*(esp->4+4)=='NTIC'6 [, X- c9 F# S$ w8 J- o
' d9 I: k% }( W g" W4 G
-The most exotic ones (could be very slooooow :-(
- J; `9 K2 W i" n1 p5 F5 K BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') / m" U* ]3 v( D# _
;will break 3 times :-(( ` Q1 J8 m; l( U. Y
3 y" V- ]5 [9 b% u" I-or (a bit) faster: % D6 ]5 F& x3 ~. Q' d
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 r8 J* Q R% C/ q; E3 |4 N4 R
: J/ q' c; V/ w* b! g E M2 z/ w BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 Z- K4 G6 C- l! d# O+ X ;will break 3 times :-(
$ s1 X$ H3 x% r* B* k" O4 r) z- j; m& ?! B, O
-Much faster:9 s) k: ]. J. Y* Q, B" j2 M; S9 Y
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
$ \: E3 u6 ]6 x: Q9 F O: d5 f( O' d, s) u8 ~/ n2 ^
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 ]/ Y, H8 s! E0 T. m* q# J) u( ufunction to do the same job:
3 z9 `( Q5 ~' u8 p9 Z, l( R1 S$ {
2 G6 C+ p1 ^- {' j8 Y+ U push 00 ; OF_READ6 }, R0 `6 E$ p, h j# o% H+ M8 U
mov eax,[00656634] ; '\\.\SICE',0' ~' O2 C6 |6 [! K% ?/ I% f, c( z
push eax% \3 N; ^' ^! Z7 T2 p2 K; X
call KERNEL32!_lopen/ G. h3 [' Z7 p# W# Y# x; Y
inc eax. Z$ g; R+ u2 L
jnz 00650589 ; detected- L4 n( F9 Z% |/ h: T% c
push 00 ; OF_READ: b* ]' _8 C1 n; [
mov eax,[00656638] ; '\\.\SICE'
; n3 c: i; j" M1 h5 I$ L push eax: B9 I' o$ `* K5 f8 }8 n# T. K
call KERNEL32!_lopen- D3 B- Y5 L& v6 B8 o0 Q
inc eax
: p# Q5 t9 H t: T9 O7 X jz 006505ae ; not detected E3 P1 {/ V! \, r, n
5 N1 ?7 l# u g
: ?% @0 X- T1 K3 j
__________________________________________________________________________
9 O* X- M- V3 j2 J) k& Z$ Z3 \
' n7 g- x' y5 e/ l4 W& \& DMethod 12
! J6 t' C9 k$ i0 `4 d5 W3 g=========+ g/ L3 _9 T) ~8 Y1 K
# u2 |5 B) D6 w" FThis trick is similar to int41h/4fh Debugger installation check (code 05
$ R* }2 S+ p, Z$ T& 06) but very limited because it's only available for Win95/98 (not NT)" u* q3 a* b/ T$ |" u
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' R' z- y2 z! L# l- Y8 t$ ]" f5 q* Q) @; d! [6 M: `, a& U
push 0000004fh ; function 4fh
5 s* n' G' R+ _$ Q9 T. H5 L push 002a002ah ; high word specifies which VxD (VWIN32)# l! M; e* q' A6 w4 \* O
; low word specifies which service( k* [) j1 H- M$ R
(VWIN32_Int41Dispatch)6 ]$ V# x+ a, y) {: ?9 p7 Q! v, ]
call Kernel32!ORD_001 ; VxdCall: n5 }$ J& A& T m- k8 G
cmp ax, 0f386h ; magic number returned by system debuggers6 u0 E0 ~. [/ a0 J
jz SoftICE_detected
2 z! P9 {& ?9 f5 S7 ]( C, o9 O; X0 @ F5 ^: w2 p
Here again, several ways to detect it:! i* Z* J+ w8 K) m# p
7 X6 o9 m& @6 \3 N1 g
BPINT 41 if ax==4f& E+ O9 Z" {3 g; U8 ~
7 z" m& V* Z* ]. Z$ M. G) I
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
L0 C3 ^& T- w; k
5 g; u& b" f( X BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A4 s: N5 y$ ?8 k' W, k" Y
' R* Q, \8 ^) j; K" k3 u BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 q R: w* s) t) N; N0 u5 c% h* ]4 o, f4 @. R
__________________________________________________________________________3 a' o6 S! K- K; @9 ^
- r% T: D4 v, ^) I( yMethod 13; V* f2 i9 Y7 R* o, J
=========- l9 k8 C0 G7 I: p, @
3 q9 T2 E' U" Y! Y; R( LNot a real method of detection, but a good way to know if SoftICE is
# @. o9 U# ?7 a' }3 u& sinstalled on a computer and to locate its installation directory.1 N* g3 z/ h+ u% i' F
It is used by few softs which access the following registry keys (usually #2) :
; {, b( a$ U; J3 H& F" J' O! x& v2 v+ I0 k' @4 O' q* y- D
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% c; B0 P1 i9 S; Q3 i5 K( v\Uninstall\SoftICE
2 G& k/ H( L [) k* z- N+ k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE& D q$ {: K! h/ s9 ]/ D+ ?
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) Z+ L u$ m1 b+ a5 a
\App Paths\Loader32.Exe) t4 {* o# S6 D3 x2 X: l4 p$ g# @2 d
. c$ X# l2 f- s1 r1 U5 ?( [6 w: N; B( E% c' z
Note that some nasty apps could then erase all files from SoftICE directory& [9 G; |8 r( h- u
(I faced that once :-(
% c; r' M: o; X: R( w( s0 N# {' j! E8 |" A0 E0 h6 N5 P& H4 x
Useful breakpoint to detect it:7 H' F) F- y U" f
9 t- C9 ^. ]2 c BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 g9 s5 S" w; p, ?% _
3 |+ B# y% u! n, \- s/ i1 ] Y; _0 F
__________________________________________________________________________0 B0 ]# a9 s/ y/ g
% Y P2 x4 V2 H% ]0 m4 V
B( ]+ P: p5 W9 I1 ] u: FMethod 14 ! r+ t; S- h$ g/ G* J+ b& Y5 v
=========
! m6 G) b1 D. c$ t3 C/ ~
. Y+ F. k2 t r' R+ _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
3 e( Y2 B* `" x( l2 T4 eis to determines whether a debugger is running on your system (ring0 only).5 o8 k6 V( e$ w" p4 O4 p# s7 ^
" t/ Y }. P# z8 F: c( n2 a
VMMCall Test_Debug_Installed
/ t J) D. G+ v3 X; a3 t l je not_installed
( O9 ]/ G4 v; D$ l/ r- t0 u7 M" L2 l
This service just checks a flag.- X# P$ U0 O6 O& A9 J% t0 P7 _
</PRE></TD></TR></TBODY></TABLE> |