<TABLE width=500>
. k- ^6 n( E; n" n<TBODY>+ N2 n4 F b; g) @
<TR>
( F5 N' [7 n9 G) ~, g" ~<TD><PRE>Method 01 " r! H: e- |/ \4 J% s
=========
2 E, D# L9 J& @9 A$ D) ?* u% B" z( o( i; E
This method of detection of SoftICE (as well as the following one) is7 {# M/ o) S0 C$ t$ X& n
used by the majority of packers/encryptors found on Internet.7 }& k2 o& j& a, o( Y- O2 Z+ [
It seeks the signature of BoundsChecker in SoftICE; H0 C1 l6 n# ~4 t
/ [$ u# B4 _/ K2 ^/ N# D2 ~1 v* q1 U
mov ebp, 04243484Bh ; 'BCHK'
5 A/ K( u" b H5 f mov ax, 04h, R- U) y, \9 ^) c- N
int 3
+ k$ L2 \% E& S* I( C cmp al,45 _! p1 O- m* _. U/ W' R3 ]
jnz SoftICE_Detected
7 S6 Z2 i& W" Y$ c
2 q2 k% Y, z2 K1 l5 D; m- Z___________________________________________________________________________3 u+ u3 P; C% p+ }( `0 v& W
9 p. w9 d" @9 K9 u' M9 b( C; g
Method 02
! _# Y+ q5 F* S6 M* l+ l=========8 @! G, L5 ], r% D$ C8 j. r
+ M4 o1 [( p# X9 S# L, ^" c8 `
Still a method very much used (perhaps the most frequent one). It is used) V1 q8 ?5 S' o. }( j$ e3 g' Y0 M! R
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* S/ d3 p2 }! b4 q. Y' _or execute SoftICE commands..." K" o4 s, S5 H4 V8 v% ^
It is also used to crash SoftICE and to force it to execute any commands# i* S& S0 o3 ?% t3 n2 B0 r+ s
(HBOOT...) :-(( - d8 f, Q6 B2 a: ]2 U! L3 D' p
M1 k' \6 n) ^2 |' w! FHere is a quick description:, u1 {3 b6 S: C
-AX = 0910h (Display string in SIce windows)
, R% B4 ?& {! X" g-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' n! D w4 s0 r: j' K-AX = 0912h (Get breakpoint infos)
6 C$ U' k2 F0 M( H+ E- y9 g1 I-AX = 0913h (Set Sice breakpoints)
0 x7 r$ W: F1 G' A6 H: h9 A( \-AX = 0914h (Remove SIce breakoints)
3 E+ G5 [% }# l; k% ^" E
+ ]+ y3 z$ }, H: s/ S$ `Each time you'll meet this trick, you'll see:4 M+ C y; D2 ^6 r: {$ w
-SI = 4647h5 K R% Q4 R6 L# q
-DI = 4A4Dh" U& k% a" W1 C" Z$ K L
Which are the 'magic values' used by SoftIce.
! Y7 t7 K# x3 g( OFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 o3 E5 E& q' |4 E- T
$ o% R& X& e2 x! V: |4 ^
Here is one example from the file "Haspinst.exe" which is the dongle HASP0 k5 u* |0 q$ ? H& B: Z3 m# V
Envelope utility use to protect DOS applications:, [- i- F5 U' a+ Z" m l+ h4 Y
' E m( \8 U6 S5 V+ q
1 P' K8 D; c- v i% r
4C19:0095 MOV AX,0911 ; execute command.4 _8 h: \3 s" |; r) F( G. K1 _8 }9 A: o
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." G4 k+ o7 ?1 l1 Q. i( x6 @& Z
4C19:009A MOV SI,4647 ; 1st magic value." a" l' c, ~4 u
4C19:009D MOV DI,4A4D ; 2nd magic value.$ [) ?5 V# h1 X& F' t* w0 o5 ]& n: w
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 v2 u, r3 w b0 J7 @4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
6 t$ r- ]; ^7 [, B# r5 j' }4C19:00A4 INC CX& c( b2 Q& B8 x
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ @2 g* N( e' N3 _: `9 g
4C19:00A8 JB 0095 ; 6 different commands.
/ a8 R# q q, ?" Y4 s' N- _/ O4C19:00AA JMP 0002 ; Bad_Guy jmp back.
; g! d. \% J! }4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
m% Y- g) M8 ?6 ?* y: M# z" y* G
The program will execute 6 different SIce commands located at ds:dx, which
+ i2 M8 V0 W' g, S4 Hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 y3 s6 K; y v/ k: J
( |# H$ A8 d# E1 `* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ O( c; h. U! @& T, u: {) Y2 R% u___________________________________________________________________________% j% u4 E! ~& h
- {1 d: \9 C J8 x3 k+ T
}- Y T; _' z5 N+ @, `6 HMethod 032 w& I4 V3 A$ e; a0 `; I7 `
=========
8 E; r3 V7 F5 }3 {3 F' D4 j3 l3 }5 m1 d2 f
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 t! F6 O5 i. e4 J3 {
(API Get entry point)3 }, Q) B: U q
9 c! U( x. W0 o& `# p! q& |3 U5 q; \2 a( ?- g
xor di,di
a3 a: I7 m2 p0 ]5 c5 T8 Z- h) k mov es,di
' q' t7 i) _4 e: I/ Y4 K7 T0 j mov ax, 1684h
; t2 K9 B% Z- _1 I! g/ Q J$ J mov bx, 0202h ; VxD ID of winice
2 h8 K' N) |% q( C$ D int 2Fh
! C k, h: H3 M% ?3 w. u mov ax, es ; ES:DI -> VxD API entry point6 J; Z' }4 o& X& L
add ax, di
4 A+ F5 G5 P, V/ B test ax,ax
) f' M$ h& v& o1 k2 B u% y jnz SoftICE_Detected
* d# i5 z4 L- d3 I7 C* v
F; W/ ^; A( M___________________________________________________________________________! r4 s6 N8 J4 Y2 J! D) I
# S9 w/ \0 g0 E2 H- }
Method 04
; f3 e$ N3 {1 M% J, y2 v( A=========
$ J2 p. q2 `3 I n8 y) F* q! s& t7 s! c
Method identical to the preceding one except that it seeks the ID of SoftICE
1 i' h. p6 o) j/ o; W1 ]% u) B/ TGFX VxD.& j' C* Y0 {- u2 k2 I
+ O& O. I/ {4 e# x( W xor di,di' G" f& S6 K e, S. [( z% e! S
mov es,di
. A, H7 ?9 J; |2 K% G* m mov ax, 1684h 3 |/ S i! ~, e2 g8 y# j7 }* [5 d
mov bx, 7a5Fh ; VxD ID of SIWVID
$ X5 K6 y7 l' a8 T" f int 2fh
- B# q/ N. h' Z mov ax, es ; ES:DI -> VxD API entry point1 M/ Y; o1 t' A2 T# l' L: c& D3 s
add ax, di7 b- @1 s) i1 ~9 y8 _" m' G0 ~
test ax,ax0 w# w$ q6 {/ E5 o* P
jnz SoftICE_Detected
1 I. T2 y5 M( y1 E8 z1 ~9 N. r* K( c: f: v* I- @" y1 ^! ^0 ~
__________________________________________________________________________
( |7 Z2 C7 N$ h b. a0 v8 h* R7 F/ g
, x8 o% x- [' b+ L
8 Z! [3 Q# N* y p5 _- ^- QMethod 05
5 s0 J, B9 B- r+ r0 u3 N2 o% L* |=========
, S2 D; M6 D5 X1 C' S) J" ]
p7 f% h( ^2 L6 Q7 }, u. Z% l- |% TMethod seeking the 'magic number' 0F386h returned (in ax) by all system
1 [4 D1 n0 j$ w( Y( Vdebugger. It calls the int 41h, function 4Fh.- i; [9 ~8 c' f! N
There are several alternatives.
, F7 n* c# S. ^9 @2 N
0 S! v& t; [) b# f3 W2 WThe following one is the simplest:
, A7 C+ [0 G0 _5 C- O' f% F4 g3 [; J4 \4 d! w% v; Q
mov ax,4fh
. u) N& e& t2 |( j* ?9 O( t+ ^ int 41h- l M- J; U) P8 ?
cmp ax, 0F386
$ z9 z. G# _! I& n& D+ z& K# j( H jz SoftICE_detected
0 n8 ?9 f8 {- K$ C! ^. U2 E% i( S* q( o# {) Q
: m5 q/ I+ y" W& p
Next method as well as the following one are 2 examples from Stone's 4 J( @6 C! c0 A/ R2 _# _
"stn-wid.zip" (www.cracking.net):
4 B. \: {& B! G* \
2 E! A1 e% b. v: k' _ mov bx, cs
( v2 ?' B" k# v( ^! T lea dx, int41handler28 R6 \! W- v# D) V3 p+ n
xchg dx, es:[41h*4]$ c$ h$ d6 f. P! v, w2 l6 d
xchg bx, es:[41h*4+2]
& G. B& T4 B) t' R mov ax,4fh' N- `0 d8 ?3 @. f W- B
int 41h1 ?; O% m" F- x' _
xchg dx, es:[41h*4]
* _4 T# e$ O3 ^4 t; I! Z4 g+ u0 ~ xchg bx, es:[41h*4+2]
& c) N5 e/ ?8 S! q$ ]1 w cmp ax, 0f386h% ^; [/ c- d+ b& P
jz SoftICE_detected, L& m+ ^0 @0 F# h. {9 C5 c6 t) O# H: C
" e' `. L2 e) M9 z0 Q" E/ N( A
int41handler2 PROC
# b7 O* |1 }! ^ iret
4 S: t9 k, F& O7 [8 W8 e/ X* r4 }int41handler2 ENDP
5 h' A1 _- a* S' h
8 @1 ]! b/ k5 _7 e, g" x( K6 m
5 A) W# }+ }! f/ n. ^9 K% t_________________________________________________________________________
6 C- c$ Z/ P. O1 A, F9 V2 m3 q8 e/ D9 Z3 E7 z- M9 g. Y+ T/ E: d# U
' g# h. Q8 s5 z; ]) W0 }! K" p9 W6 eMethod 06- \7 D! e+ b3 N/ O9 H
=========4 T- Y5 y% M3 c0 I: W; I
* B; `' t9 a+ a& u
5 n2 U. ^& w/ ]0 Y
2nd method similar to the preceding one but more difficult to detect:
) b* n% B1 m. z0 f
. B' U# L3 e% p6 z. c7 N( ^. S5 S8 Q2 Q2 N5 `4 t
int41handler PROC
) f! Z2 H$ H( J# N, m mov cl,al
W- Z& o; r8 x) q) R& W; m iret
# J r/ X3 {$ j4 `9 O) A' H( wint41handler ENDP
8 P R5 C. |$ t3 Z7 D
6 i& G+ V$ ?$ p L% z- r! N0 c' E P2 f8 n' n: i6 i
xor ax,ax/ f& x5 j) Y( k
mov es,ax
8 q; x J1 d4 K! L- ^& U mov bx, cs/ Y8 u1 a" X) \2 r. p
lea dx, int41handler2 G! v l* l* t" ?# C: K
xchg dx, es:[41h*4]6 w# V' A8 ]0 p6 W2 z
xchg bx, es:[41h*4+2]( n) X: [5 E8 d
in al, 40h
; i. B, i) p; F. C# ^! I xor cx,cx& u9 j$ ]" o) B) i
int 41h
7 h- h; t8 T* M( X xchg dx, es:[41h*4]6 P; U- M1 ?5 J# q+ ]
xchg bx, es:[41h*4+2]
/ O* e0 G$ E# e cmp cl,al) I d, S# u9 U' S/ m. t g
jnz SoftICE_detected
& A& Y6 l5 P5 Q3 `
: P" i# e! T) ?. d( ~7 n5 }_________________________________________________________________________' P. m4 K2 g) ] L/ {
6 ~) J% d* j4 q2 u w: O4 F
Method 07/ T. k3 `: r" N. _: R" g
=========
/ {9 Q( V9 R: h" h8 b/ Q7 H3 g' E5 P6 a4 F! ]# h6 l) S
Method of detection of the WinICE handler in the int68h (V86)3 J, s' _# O4 K4 R+ X
/ l/ R( [: p4 M! q& r1 ~0 k) Z: d
mov ah,43h" @; d* j7 e/ d6 |/ L
int 68h, B' I* r6 L' \/ G- z
cmp ax,0F386h
+ [! J* j6 Z6 f$ M) m jz SoftICE_Detected/ @ }( w1 v1 B1 f+ P& N7 ]
( @. h. q, O3 d$ g- I$ }$ O8 S5 I
& ~0 |1 [* O, H0 l; s5 C0 x- P=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& d# n+ S- T% X2 m) K5 G2 ^
app like this:4 Q* }3 W# Q. z, w5 G
8 l, ]; F" l& i& }, ~# C/ C4 `0 s
BPX exec_int if ax==682 L0 W. `# a2 Q$ `3 K
(function called is located at byte ptr [ebp+1Dh] and client eip is3 U# M0 p3 @" y1 q
located at [ebp+48h] for 32Bit apps)
% j: o8 L- \5 I6 z# W$ Q" t g__________________________________________________________________________: P- U& `* b6 \8 `3 e/ p v1 t
2 _" \9 s; A% p9 s3 q5 x$ D% K% @5 [* T: p5 s% V _4 A7 c
Method 08( i F6 {! T( i5 U7 e) i
=========
% }9 j- t/ B& W3 ^# O% V( L9 x* e8 F# ]+ s& g- W, y
It is not a method of detection of SoftICE but a possibility to crash the
7 ?7 T6 @! n, \system by intercepting int 01h and int 03h and redirecting them to another6 F* Y% z3 A, A# j6 K) ~
routine.
! _- H& }5 {; U mIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: ]' C2 X! O/ w% k: n1 h% B/ nto the new routine to execute (hangs computer...)
5 G! o( F# h: }3 }7 b$ h; @ M9 V
, \6 |& J1 p+ S5 w' ~4 Q' D mov ah, 25h" {* _9 @3 U/ L3 Z
mov al, Int_Number (01h or 03h)+ }! M* B4 q) W. ^8 `; f! u
mov dx, offset New_Int_Routine
9 w" R: i' Y+ h: b; l int 21h
, S. R+ A1 X3 R- l
5 S3 k" u7 h' G3 A x- N__________________________________________________________________________
6 D6 x$ ~. ~ {$ s1 M6 ~- N4 ` @7 X: J3 N* Y- O$ M- `9 T, V
Method 098 n* [: ^) _8 a
=========
* T. P) u- }. O% D& F/ Y8 P7 z& g4 T9 S, v, a
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 d! \8 q9 D+ }5 ], p4 }( w" R: lperformed in ring0 (VxD or a ring3 app using the VxdCall).* w) `/ _3 }' X7 A
The Get_DDB service is used to determine whether or not a VxD is installed
6 K2 `! K! y Mfor the specified device and returns a Device Description Block (in ecx) for
6 f' s5 T0 x5 t8 h( t5 n( p1 Xthat device if it is installed.6 G2 r- S5 B8 D2 o1 c! q; o
9 k: ?7 W4 `4 m mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 n8 x2 v2 D0 M5 m$ g7 Z4 u. h
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)1 |8 J7 v, g5 u: o
VMMCall Get_DDB
" Z( ^; E3 |; W, V. G1 _. E mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed8 h- t! m O4 x$ }# v4 K0 |
' o- V( O4 L" V* `
Note as well that you can easily detect this method with SoftICE:
% Q* x4 f& ~3 \/ l$ T2 |( X( _$ q bpx Get_DDB if ax==0202 || ax==7a5fh0 a {9 B) y9 n3 {
2 q% Z4 P; ~1 F( f% P
__________________________________________________________________________
) w" B& G8 Y! {- n. V. n) J: r: {& B
V: R* T4 T# ?& t% EMethod 10
% @7 j5 g4 o# f) O( T& _. ]=========
( j7 K( a1 m: j' A( u% @8 o% w2 g+ B8 ~% M0 a
=>Disable or clear breakpoints before using this feature. DO NOT trace with3 C& }. {. Y7 @& T% k
SoftICE while the option is enable!!
5 u+ `/ H0 V2 g, _
) W! k& n3 \ N, \! l& O- |+ f4 _ bThis trick is very efficient:* G( }- P& k$ z; C+ Y# Y# l
by checking the Debug Registers, you can detect if SoftICE is loaded8 n# b$ f. w. E) z0 R5 p
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: `* v! @! Q8 }* Ythere are some memory breakpoints set (dr0 to dr3) simply by reading their
" C$ ~1 a* K9 r' Yvalue (in ring0 only). Values can be manipulated and or changed as well( p8 Q* a- o6 a1 ~9 M2 D( m
(clearing BPMs for instance)
. C+ h) F4 [& V0 E% L9 R+ C0 ^* m; V* ?! L
__________________________________________________________________________4 S. i# `/ V& i# U) P- a
1 K: R& _' B" W/ R8 q
Method 11' @3 ]& S! @" l* _. T3 B* m- X! |2 ~
=========
& A) k9 N$ k* P
* W# y3 d+ D, C. Y) bThis method is most known as 'MeltICE' because it has been freely distributed& z2 d4 g4 k, H8 @
via www.winfiles.com. However it was first used by NuMega people to allow2 A5 O' }, G& Q" b" h' n# k
Symbol Loader to check if SoftICE was active or not (the code is located7 f; `# m: p# @6 ^( P9 K+ j( @, J
inside nmtrans.dll).* Q/ Z: J! L/ l: O( u* R) C/ I: A
* j; a- u! p+ R* B" ~$ d
The way it works is very simple:
9 U: x. ?2 J6 a& V, E4 e6 PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 m5 |* u6 K, x. E U. O k+ r# KWinNT) with the CreateFileA API.
^1 @$ f; M2 u/ ^, r6 H. z7 J
) w8 `2 O9 k1 D, f3 `Here is a sample (checking for 'SICE'):4 J& C( C+ C2 R6 e4 E* C
0 O2 V5 A/ D/ _
BOOL IsSoftIce95Loaded()4 l0 Q, a# M8 R5 V; r2 b+ y# I* c
{5 T3 h% X5 `4 L! F v, z0 H
HANDLE hFile;
. Z! Y+ f4 b5 y% \' |5 O hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 b3 `9 l9 {3 ~' s6 c4 q9 U$ s8 V FILE_SHARE_READ | FILE_SHARE_WRITE,& @3 n$ r( B, T# }" W6 x) a8 w
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 w Y. O0 x% D9 a5 x if( hFile != INVALID_HANDLE_VALUE )
2 e% f) Z5 S4 r) @; w {* J' _ v* b0 R* x- M
CloseHandle(hFile);
, o; f4 u0 R8 b% D; V6 l. g return TRUE; ]" t/ g. C& x
}
1 N8 c7 q7 n, ?' F! n" P k8 Y return FALSE;% Z h9 B" P3 y1 p
}
+ ~2 X3 s/ w7 b& b7 K, B5 h* B% e; z6 x9 g4 a
Although this trick calls the CreateFileA function, don't even expect to be: R% ]; p! F$ a
able to intercept it by installing a IFS hook: it will not work, no way!
2 d; F0 j5 r( B0 s: LIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
- J) M- V5 z5 B: d4 wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" y6 I- D# n8 V- D& kand then browse the DDB list until it find the VxD and its DDB_Control_Proc) K, O1 U0 D% R. s$ r- d) y; @
field.
" {2 j3 h. a$ G4 v0 ^/ XIn fact, its purpose is not to load/unload VxDs but only to send a $ W/ F4 g5 M2 ~; c3 c
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 a4 M1 b4 z& [5 b9 T' Tto the VxD Control_Dispatch proc (how the hell a shareware soft could try/ B/ K) O- w+ F& F* [
to load/unload a non-dynamically loadable driver such as SoftICE ;-).7 p! U- i: k e
If the VxD is loaded, it will always clear eax and the Carry flag to allow
" j o8 Q8 ~3 u% Qits handle to be opened and then, will be detected.
* B2 Q! X. n1 P2 QYou can check that simply by hooking Winice.exe control proc entry point
' }1 o, `0 W! O0 Q- owhile running MeltICE.
$ c `2 Y3 F1 I* A: h, P- I+ L( I. M* H! J4 m/ n1 P, X/ z
0 {/ x% z3 }: z, w7 l/ k 00401067: push 00402025 ; \\.\SICE
, k z- r) [# v" T' L. E( \( i 0040106C: call CreateFileA
8 I* o; X- y/ v; K 00401071: cmp eax,-001
* d8 p+ w! Z# G- j& _7 q 00401074: je 00401091
2 v+ T+ j" {0 u# r$ `; V% u
) y( b) n5 l9 U, t* ?% P* t9 |3 d! c m2 U
There could be hundreds of BPX you could use to detect this trick.% ~7 |$ J# X5 a
-The most classical one is:+ W0 h. I: u; v+ y, n0 g. B6 b
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
5 y/ ]" b8 F+ t: d *(esp->4+4)=='NTIC'
7 ]2 C3 u5 k- l5 B" ^+ N0 Y1 y
3 k, {# V6 e/ w) A9 p# P-The most exotic ones (could be very slooooow :-(
2 `" y( u7 g: b) e BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 2 Z; }, p& p4 \" A8 `, I$ a
;will break 3 times :-(, n; r5 ~, r5 O- v
5 w* v" I5 u; _ N4 l
-or (a bit) faster:
. ]# f# t( R/ f$ m6 g4 m BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% Y5 g) }) A9 O7 [
$ v* }$ _" ^% H7 i( D1 J4 P' w BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
- c# V! y. {) R3 @9 Z ;will break 3 times :-(; O- D( @! b, W: a. U) ]) W b
* @4 X; c3 s: ]( A-Much faster:
" q0 ?# ]& D9 A4 b. Y- M BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
D) c* l3 |, S% i1 y4 c
; N/ X! {9 X" d5 l3 R" ~' M! ~Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ S h# C0 u- V! \$ Vfunction to do the same job:
# Z- T' B8 R8 m% u% g3 L! Y6 {' M% ]) j; Z
push 00 ; OF_READ
# [) a% Y0 I" k% i mov eax,[00656634] ; '\\.\SICE',0
' a! ~5 ^6 U( I, e push eax7 U& a& W$ p5 W( t
call KERNEL32!_lopen
( |6 T6 I2 K# Z. L, N7 O inc eax
" k9 z/ Z6 t8 w ]6 n jnz 00650589 ; detected+ S6 f: W6 G3 C, _
push 00 ; OF_READ
6 j$ x S3 |( l$ p3 b mov eax,[00656638] ; '\\.\SICE'9 L/ j6 N8 f2 P' y
push eax5 |* l' ^" K* c* S2 z0 y
call KERNEL32!_lopen
! Q. K! i" ^$ |* y" Z- s inc eax
+ F# R+ [6 |; h' z: \ jz 006505ae ; not detected/ V6 ]0 Z& b8 e; D
+ i# q5 P$ T6 a
* c3 D$ U& t4 _0 w4 ?__________________________________________________________________________
2 r& P# h) j- M: Y( {& A3 Y) ?! `
& P C( k8 P5 O7 n( p+ |1 OMethod 122 N7 z* R& v; g5 r0 K t
=========' @; j3 K' g" s! B* ^. v- v9 j
5 g3 w0 W/ R2 ^* E0 m; K3 g& t; FThis trick is similar to int41h/4fh Debugger installation check (code 05. R) I( A; w' ^4 l7 V
& 06) but very limited because it's only available for Win95/98 (not NT)
6 Q& L1 b# \2 ]! m- a; fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# Z- F* A# Q+ `3 t/ j) m! F5 E% p. X" ~
push 0000004fh ; function 4fh8 b2 z- T A0 k0 k i3 x9 ?) C
push 002a002ah ; high word specifies which VxD (VWIN32)2 @5 z& S3 a4 a1 q+ @* X% ~
; low word specifies which service
( U" H9 Z9 H# ^: f8 e (VWIN32_Int41Dispatch)
/ S" |, a# h7 [7 n. o' v0 r% R call Kernel32!ORD_001 ; VxdCall
1 X: K% A4 G L. n$ _ cmp ax, 0f386h ; magic number returned by system debuggers. z. y0 Y0 t& H- J. Q
jz SoftICE_detected: Q& f, B8 N- O
. W" w7 f# `! |) J$ VHere again, several ways to detect it:
v3 S3 X4 h; _' z
0 `' ^7 j* u4 } BPINT 41 if ax==4f! E! I! @- Q7 x6 V! ~' `% {, n
5 o% r1 O4 c. ?- a u) a( p BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
1 D: H6 i& j5 n: x$ t4 H
' h9 G, K5 Y$ m: y J! U0 v BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A, }( f$ m1 X1 N
- d) d* q- H U K, V- P BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
) j- ~ u! _; c$ ^+ o
8 R! y# X( C4 |; R4 s* t__________________________________________________________________________
w+ i( U3 n7 S
; z3 ~6 ~. ~, `7 e s! M% ]Method 13# Q5 {6 l/ R) r7 v- j: v( s
=========" b! U9 H3 T' n# m4 ^$ s
8 Q" W, {$ s9 E, p( yNot a real method of detection, but a good way to know if SoftICE is
) Q6 f6 ?$ V" s* I& ^2 uinstalled on a computer and to locate its installation directory.
- g5 N5 O6 `3 K; B! MIt is used by few softs which access the following registry keys (usually #2) :9 m! T: w" K: d% m
- o. v1 d9 k, p8 v4 U/ o- n: h% g3 i-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& |9 }; N: T" j* ~7 l* b6 l( F
\Uninstall\SoftICE
$ Y8 T3 t y) R1 S p1 s-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! u5 ?; z& a7 H. L |" c& h5 V-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ m0 l U# U3 M: Q( I# |1 @8 R
\App Paths\Loader32.Exe5 G2 v# v9 l% C T1 ~% t q
2 b z; E1 M" x
. c* T' Q# t' @! Z' Q; D4 F' M4 c' BNote that some nasty apps could then erase all files from SoftICE directory
! J, V) ]9 K- ^1 _- {(I faced that once :-(8 u4 X2 n2 A# D& ?/ z% u
& U. W* \) |. l! _& X
Useful breakpoint to detect it:
8 M9 }( H) g% ]* g+ f4 Q
, ?% |' O, Y/ @* p" v1 m$ C BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
& J. r# q A4 W) \, |* O
1 K6 K: D. @2 m1 K- D__________________________________________________________________________4 u% a; }& l H# W
" z/ q" [$ t: |8 q& Y8 A9 \
' G) i# L% [" Y* zMethod 14 7 D( u0 ?# G" Z7 R6 J6 [+ [5 l6 ?! R
=========
* i7 m4 z/ O( q9 o3 `8 t6 h9 M
* s2 _1 h5 ?. y7 R& xA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 c% ~# j& D q. z5 w& t3 p
is to determines whether a debugger is running on your system (ring0 only).. }. X# B6 D4 r m3 x
4 U7 i* }1 m" O. \ }) @ VMMCall Test_Debug_Installed0 f& f9 | d+ ~/ v8 \1 [
je not_installed
" D4 a- _$ r* u+ W
9 u7 t6 p9 a4 g% M; ]" x9 u5 NThis service just checks a flag.2 b3 A6 z6 T* G8 {# ~- V0 H
</PRE></TD></TR></TBODY></TABLE> |