<TABLE width=500>) X. V6 D4 g% ^$ G5 i/ z
<TBODY>
+ i% ?% N: T8 j7 D+ v4 q<TR>1 |9 ^; [% k' `( S
<TD><PRE>Method 01
1 I8 g) x$ |0 d8 Z0 ?2 M=========
* A' @! q" O1 h8 b! h M" p1 a# q2 J3 a% c8 b2 {6 l( n
This method of detection of SoftICE (as well as the following one) is
$ u: N& t/ I2 K+ S& Tused by the majority of packers/encryptors found on Internet.8 l! N" R% S# ]1 x/ Y( P0 v
It seeks the signature of BoundsChecker in SoftICE! [. |8 @5 ^! p y! ~5 E5 }+ w7 @
! @5 L$ L/ A/ ?* z' D
mov ebp, 04243484Bh ; 'BCHK'
8 {4 V! |0 b$ h4 i! U- c% z- v; k mov ax, 04h
( ~1 |" f1 v% [1 s int 3 / t, p- a( y, M Y, I
cmp al,4
; u$ R! F u6 j6 p+ w jnz SoftICE_Detected# Q# m0 t- j$ B' O/ g! J( X
$ X9 V- K/ Q" d$ `5 c0 v) _9 r" s9 }
___________________________________________________________________________
, q5 s' T; _( F1 }5 ?* K7 X6 \' b; K" X, A
Method 02
3 j& i5 c" q! O' O& ]=========
' @: ]& Z, ~2 {/ @/ ]3 e: C% o% @1 k& E3 Q$ ]% d
Still a method very much used (perhaps the most frequent one). It is used' f, y/ Y- S$ m# T4 g- ?, e O
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 [8 O) N* I1 W6 W% Zor execute SoftICE commands...% ^3 J: i9 |" t8 c( E
It is also used to crash SoftICE and to force it to execute any commands" r4 I+ `6 L% B; H: O- V
(HBOOT...) :-((
. ^- G1 E- H# ?0 B- f7 p: y% _3 Y) a, b* Z. Z8 I/ ~" a
Here is a quick description:6 m H0 A$ D* d9 b
-AX = 0910h (Display string in SIce windows)) J: \. V0 g; n& K2 h
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
2 ` S6 G' X5 q; Y8 _" r-AX = 0912h (Get breakpoint infos)
6 L5 x4 K& h* v y- p) O9 Q-AX = 0913h (Set Sice breakpoints)
0 E0 E4 {" y( b( D" x' d; g-AX = 0914h (Remove SIce breakoints)
. Q7 K8 V# J1 p) o& [% {
' S8 @# t6 e' Q3 l( t7 ?Each time you'll meet this trick, you'll see:5 ~$ W4 Q1 @: {1 @2 b
-SI = 4647h- k& T$ @; T! b: H# `6 p
-DI = 4A4Dh
& {& v$ w# \3 p4 Z1 t2 O- j+ `Which are the 'magic values' used by SoftIce.5 B8 g. M' j3 J1 h! o
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 y$ z/ n" H3 q8 L+ {& d) a9 ]8 ]
; A5 E4 i! g O+ `- t% JHere is one example from the file "Haspinst.exe" which is the dongle HASP
6 b% X6 L; T$ ~9 \& c: ^Envelope utility use to protect DOS applications:
t @# C& B! k' E/ N' b1 O
8 a, k, J6 j g* Z; ? e( ?2 ]) g! v. d4 Z( U
4C19:0095 MOV AX,0911 ; execute command.
* Y o- _6 }( Z4 v2 c0 u4 `0 }4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! e5 ]5 ^/ [; @/ o, u: S4C19:009A MOV SI,4647 ; 1st magic value.
* o3 p. G6 _# R5 M \0 x* b0 g4C19:009D MOV DI,4A4D ; 2nd magic value.6 y3 }6 W' L/ T* Y0 [
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 Y E' ] @2 z& t. @4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute, i" M* u( v5 ?' Q- p
4C19:00A4 INC CX
3 Y# X3 C" H) u" E J+ a4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
, o" f- N8 A* Z1 v& t) Y5 u0 p4C19:00A8 JB 0095 ; 6 different commands.5 N- G# ?3 S% a9 X5 c
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" E1 I' D+ v" U2 {* J- g5 t8 B$ L! s4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; d2 ~7 |" g) a3 Y1 Q0 C
3 I, r! H: ]& h0 x; _; B+ e9 _% dThe program will execute 6 different SIce commands located at ds:dx, which
3 Z9 S" b& a! V- V- ~ R) bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 S: R& S$ J0 o( r2 F
. G! K' \. N7 \+ g) r! V8 A( Z6 q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 p r a1 i& m: n
___________________________________________________________________________
/ @! n) P% E# Q3 ?6 i
* H0 b( a' [1 D! ~8 w2 M
; v2 a, i/ U s' `- m. i0 A2 YMethod 03
9 K% w9 i) Z. H( S=========. C1 ` {: F1 d B$ p4 i
8 @( A0 k0 \; ]0 bLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
/ ^$ H: K" y% a6 \(API Get entry point)) |, n/ M; y: }5 a: a# P6 z. n
. Z3 Y& v8 m3 T( N% e
; k5 F. M. w+ c7 N/ u
xor di,di7 I ]# s: P2 P
mov es,di
1 s9 T4 d* O$ G1 M mov ax, 1684h
2 H; J3 [7 ~- q5 ~ mov bx, 0202h ; VxD ID of winice
+ X( Q9 B& M9 D6 o% E0 R/ m; s int 2Fh
9 l# R6 a9 X. R/ w* L' _/ @2 q mov ax, es ; ES:DI -> VxD API entry point4 Y; U$ n* z- s' K
add ax, di
q/ b* a9 d7 u( f3 Y test ax,ax
7 c. G9 d5 G6 x8 k, y jnz SoftICE_Detected, H9 ^7 Z) f) c& a B( V
m# N; a5 R0 }) c! f% }___________________________________________________________________________8 z6 @& R" b$ K7 Q7 b: Z
/ Q; j0 M% b8 V/ h8 tMethod 04
+ O& B F- e2 l" z! y# I=========
2 \' f% j. Y' ~
: u) Z$ i: x5 m3 P( d0 M* z& j HMethod identical to the preceding one except that it seeks the ID of SoftICE7 R- c3 m! W$ i' v3 x8 T
GFX VxD.
0 C, e' b |7 ?, t7 W0 m/ I9 U4 N* a* N( f- y e
xor di,di. d; G3 d, c4 I4 t9 [: r; q& p. m
mov es,di) U5 _9 J! T: j( a
mov ax, 1684h
# o A! g! o% U6 h' I) X; b" ^ mov bx, 7a5Fh ; VxD ID of SIWVID
. m) r$ }+ ~, d; y- Y* G% B; N int 2fh; \3 Z& @* o5 K* g& T: ~/ r) d
mov ax, es ; ES:DI -> VxD API entry point
; A8 C* q: E, H! z add ax, di
$ b' {: {! X3 D; r& O test ax,ax+ h9 Y# }+ P% q
jnz SoftICE_Detected# H3 |* F8 j9 R, J: J. l
4 J* p9 }" v3 A__________________________________________________________________________
. ^: G* C1 U( d! a" j9 b$ Z! q" _5 L$ X M9 X% a
S6 l, r' q1 X" l+ d8 C
Method 05- c2 `, b* k! \. l: n, l' ]
=========; L. c( ~& C0 B% U, V: r p0 I
o/ P" `2 E5 M+ ^# O- A4 y
Method seeking the 'magic number' 0F386h returned (in ax) by all system1 `5 Z( P9 a8 F
debugger. It calls the int 41h, function 4Fh.! ?& Z9 {5 l0 e0 l
There are several alternatives.
* c1 @, F U* w" c1 I
' [* \* }0 Y1 C6 x5 p: X( iThe following one is the simplest:3 X" Q+ y* G* H6 m) h
5 a a- V; c, ]: b& E0 X+ N9 J
mov ax,4fh
$ @; \" h& S2 S- @6 S' M# D int 41h
: K# t' q& A0 t* P( j cmp ax, 0F386
0 p: @$ F8 M+ w# a jz SoftICE_detected
9 a3 C4 A2 |! M- E1 A3 a; N. ?5 ?7 V/ k( C3 v" ^5 x
6 _( E; M6 ~1 L+ d6 X4 G% q; s8 ?# XNext method as well as the following one are 2 examples from Stone's . f. b& ^2 x0 ?: M% q
"stn-wid.zip" (www.cracking.net):& R) Q4 P, P+ A( P! b5 O; j5 ^9 t6 k
6 w& k( F" v; M$ ]
mov bx, cs
! J0 R, h# B A' \ lea dx, int41handler2& S, C1 [6 p5 s/ |7 c
xchg dx, es:[41h*4]0 ~$ C: d+ @3 [. ]
xchg bx, es:[41h*4+2]. b8 m, R7 m; z; Y) f
mov ax,4fh# S. f- F0 F: }5 T4 w8 R
int 41h
8 S8 i8 U, {2 F6 q a1 c" H xchg dx, es:[41h*4]
6 f: l- u& d! b) c/ ` xchg bx, es:[41h*4+2]7 T5 y4 P5 U$ g6 M9 a
cmp ax, 0f386h
- S8 [$ \& }. r jz SoftICE_detected
1 \- G1 l$ X( H c4 @/ ]: M% l) u6 N8 E
int41handler2 PROC
4 b' Z: Z- W# Y6 m8 h* q, C8 @5 G+ i' `5 ^ iret
% {/ w- N7 ^( C) {: Vint41handler2 ENDP' K+ c7 H% W4 T7 U. m/ J$ O; e
' A: ]5 J4 \- h" G. w4 q
. \- I7 m: Y$ I8 v8 U% J- V
_________________________________________________________________________
, q- m7 J- G0 N! S* b; p8 Y- J0 W' N$ r
( T1 y0 b- K& U' Z2 O& h
Method 06
- _% t# P5 m$ c& j2 z. `4 r=========( K5 N9 g7 @- y a8 `9 R( A; Q3 n
5 g2 G) F( N0 b8 z3 h* @2 W* {3 n
* ^$ Q4 V3 l2 g3 j2 h# Q
2nd method similar to the preceding one but more difficult to detect:
4 a" k2 }6 }( C# i" J3 ^7 b& o' G0 {5 Y; @! o7 J
8 _4 o# I1 N4 ]
int41handler PROC! Q) N8 y$ v* V8 V
mov cl,al2 E. `* K% H" H: v+ P
iret$ B) Q$ p" U' }% Z; c
int41handler ENDP0 W2 v7 Q+ z& B# i- C5 C0 N4 j% E* P
& y8 k1 p7 I$ \/ h0 z, O" U0 {
9 F3 `# d8 U& t$ `: S3 {
xor ax,ax' \1 T5 P2 ` X' s+ }* M
mov es,ax
7 t) [+ ~) R. M6 b) H! ?, m mov bx, cs
# g- I2 A) d. U lea dx, int41handler) Q8 i# O5 K9 D* H- ?
xchg dx, es:[41h*4]
, [: |% t: T8 y; ~ xchg bx, es:[41h*4+2]
# [; k$ u' Y5 W4 H# M$ A in al, 40h
3 o1 h! j6 ]* L* {% s" @ xor cx,cx* ]7 R5 s/ o# M7 ]
int 41h0 @) P/ y( `8 ^3 ~" _) g4 a
xchg dx, es:[41h*4]6 h) K4 r1 f7 k' E+ T
xchg bx, es:[41h*4+2]
: F( O K* ?4 z4 L; K cmp cl,al: j; G, A- d8 N* D8 M) z, D
jnz SoftICE_detected
% T3 i. X# G/ S$ z3 F. ]# W9 S$ ~
_________________________________________________________________________; X6 T& C8 R3 h1 |1 P: \
5 J, e9 D2 t' z8 h) J: d1 g% O
Method 078 M' v7 X4 I8 T/ |0 O* V( S0 N3 S
=========
" d6 l3 C6 K# w3 x) L4 u1 e" N/ O4 [: \, e* h' A' A, X" m
Method of detection of the WinICE handler in the int68h (V86)
) l) n! c4 P, t2 b: s! _1 ^4 n1 A. n" L' r. ^4 O
mov ah,43h
r& s- Y8 j u; O0 n% x( n int 68h- |5 n" m. \ `
cmp ax,0F386h
: {- E! ^. Z! e' k4 b/ | jz SoftICE_Detected# a( h. v ~! s A6 k, _. @0 \
2 a! }5 d* U5 p" E
+ S3 U( G8 C4 e3 g2 h5 }4 M! R=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
' c. Q6 ~" H6 I app like this:" T7 Z+ F* e* e3 L S
% k0 T# Q. \2 _# o8 G/ S
BPX exec_int if ax==68
5 n$ J) z: F* k/ q8 o7 A8 ~9 h (function called is located at byte ptr [ebp+1Dh] and client eip is
9 w/ L E3 J$ F# |2 d9 Y1 d located at [ebp+48h] for 32Bit apps): S+ {+ d' s0 w: a# g
__________________________________________________________________________/ [( \$ H: E6 E+ S
9 ?: K$ ~0 ?& W' [& J4 Z
% J0 G" h7 K" P0 o2 {
Method 088 ^9 d9 K* c$ @0 w3 I5 M( C: R
=========
- I, K# t5 L: l I, ?! k5 w' E3 w* b
It is not a method of detection of SoftICE but a possibility to crash the0 Q) c; ?( q0 f; u* j7 ~1 n, o( `
system by intercepting int 01h and int 03h and redirecting them to another7 J) [# m/ A& |3 p* P
routine.& Z/ q2 e4 K& _1 X+ c
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, o: w0 P6 h5 _4 P" D( K* j
to the new routine to execute (hangs computer...)
, `6 x( ?: c) h' v U/ M
- |$ `; B" x4 V p& Y3 C mov ah, 25h
' M& o) a$ m! a mov al, Int_Number (01h or 03h)
3 L Y, a# Y# Q7 M8 L# Y4 { mov dx, offset New_Int_Routine
" T+ g' o8 W2 v9 e# A' r; o int 21h
2 {5 @! l1 Q% a7 r) ~
# H' t) M. z6 V$ v. e; C- Y u Q__________________________________________________________________________
4 L: E% g2 G# i3 K3 a8 D/ l7 l9 j4 H9 T# a2 w2 R, e9 B+ o
Method 090 c$ V4 L: @& ~" Z
=========: l0 B5 x$ b* B" ^( n$ Z- l
2 H* H& O1 G, D+ E. {
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, w$ B! G0 o+ b! t ~
performed in ring0 (VxD or a ring3 app using the VxdCall).$ @, w. t' w3 l* h" t
The Get_DDB service is used to determine whether or not a VxD is installed
" |5 l# m! H4 m$ ]" mfor the specified device and returns a Device Description Block (in ecx) for/ I, F( ?- Y% l4 ~8 Y; m
that device if it is installed.
' O# ]2 N/ X0 e, _' v f# A$ ?/ H% i7 h
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! |" r% E' d. z9 @ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 c8 W$ f: l+ V# f VMMCall Get_DDB
% H2 u' j. }+ C' k8 q+ T" ~9 { mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
" d6 X# ~: _2 y( g! s0 w9 A! x' {. _$ I$ P3 k7 l8 ^% h3 k, x
Note as well that you can easily detect this method with SoftICE:
4 d% [- `5 @& W$ w) r7 X* d bpx Get_DDB if ax==0202 || ax==7a5fh
/ m& i" m2 {$ L7 w! i5 r: m
# v7 L1 S4 } c# ^" ^+ r8 t3 e h__________________________________________________________________________1 R* W5 I( Z' j
" _1 b8 s* S3 V$ h6 ?
Method 101 i; F3 e# U6 I9 z3 d! h3 R
=========( X- }# T5 U1 b% i- u4 ?
2 X+ R, P4 y. Z/ I2 F
=>Disable or clear breakpoints before using this feature. DO NOT trace with
5 X6 u0 n. A; P5 L& i SoftICE while the option is enable!!& t* [- \6 Z7 g
8 \' [( c1 c9 L2 P% \3 }0 FThis trick is very efficient:
( e1 s, p! ]3 N! A L) m8 hby checking the Debug Registers, you can detect if SoftICE is loaded( j9 K$ y" d7 Q
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) c: {, R6 A( k6 b( i. d) c
there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 t: f7 Y# y9 D! Cvalue (in ring0 only). Values can be manipulated and or changed as well
, q4 D8 I8 r" [. Q0 T& U: D/ c(clearing BPMs for instance)6 {9 Q2 ?& g9 M4 R6 h) O, A
( G* k' P. M/ p* k) Y8 R) W7 I' g
__________________________________________________________________________
; L5 a9 ~( a5 z. T0 x9 o
% x. E+ w; K9 @1 Z- \: VMethod 11" @( _' {& |8 N- Z
=========# @# n* D& \; I( j% E
* ~) A' V: P8 J3 }
This method is most known as 'MeltICE' because it has been freely distributed) k9 T8 z) M2 _: |& ?9 M
via www.winfiles.com. However it was first used by NuMega people to allow9 U/ x9 _5 y5 v+ c
Symbol Loader to check if SoftICE was active or not (the code is located4 I% H, P" D3 ?& {0 u* R5 f6 }- j
inside nmtrans.dll).* ~: l J ~, w, N: N9 X
( U1 e$ g7 _2 h3 CThe way it works is very simple:
& u# f1 `! g8 U* WIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* R( \1 l) z( HWinNT) with the CreateFileA API.
! r% H% a' u* s5 U: k. t0 P# z! z, }# l H8 G
Here is a sample (checking for 'SICE'):: `9 w; `, n8 Z0 s q
4 q6 O3 a: z5 w4 g- v# }# {BOOL IsSoftIce95Loaded()
B9 Q3 ^, x, r# R' R( M) q" c3 q{( x: a6 t C r
HANDLE hFile;
& z6 n. t& t" n7 T9 [) S hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 r; j3 r9 z2 S3 E9 i* }
FILE_SHARE_READ | FILE_SHARE_WRITE,
! A" @! S/ H+ y5 M0 p2 [ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' p2 ?& L* k3 c, K& D# v! q7 F( C
if( hFile != INVALID_HANDLE_VALUE )
. m2 p* v9 ^* Y2 k" l; ] {
' D6 R2 x' k1 W$ B, i/ N" l5 x CloseHandle(hFile);7 j1 a4 ~- X" \) m/ d. C i
return TRUE;
2 }9 B8 o3 z, ^4 y6 M }9 g9 H3 K v, w' W3 C" [$ x
return FALSE;
+ V7 I7 \ d' k9 v8 x0 u& f( h+ k}$ H& Q: y- H8 w! p/ [7 a
* ]2 O' }7 ]' q* RAlthough this trick calls the CreateFileA function, don't even expect to be+ s4 H8 p; K' W0 S; ]2 W, K( q4 ~" j
able to intercept it by installing a IFS hook: it will not work, no way!
+ N, }: R. ?4 v" G3 fIn fact, after the call to CreateFileA it will get through VWIN32 0x001F, ?8 h# M; X/ k4 s
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
8 v- R) t+ ]& Eand then browse the DDB list until it find the VxD and its DDB_Control_Proc9 m, ]5 A4 i6 C" p9 p" T" s
field. S$ ~+ J* p/ B8 ` u: w' Y. Z
In fact, its purpose is not to load/unload VxDs but only to send a ! n, c G5 c; R
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, M+ O; Y% ?/ l9 B' d. Vto the VxD Control_Dispatch proc (how the hell a shareware soft could try; e* ]1 A2 V# c6 a1 z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* ^! f! P: s+ g# n4 L8 W. ?
If the VxD is loaded, it will always clear eax and the Carry flag to allow# } [* f4 h9 ?' w7 \3 M
its handle to be opened and then, will be detected.
! a% c, ]* ?6 S. Q; O* pYou can check that simply by hooking Winice.exe control proc entry point' m% Y( B! q$ p' Q: c
while running MeltICE.
/ |1 Y% I4 v1 W* R: z/ u" u) l0 Y4 W: D; k$ m# c& b' x* g
# [' e( j6 P: S0 N! i: Z) L 00401067: push 00402025 ; \\.\SICE9 K2 W) L3 Z' }5 v( z# ~
0040106C: call CreateFileA
r) g2 U' H# J 00401071: cmp eax,-001" O1 \( e7 |; U/ k7 a7 F% {# L$ u
00401074: je 004010915 V- C/ h! p7 o! P% U9 n& b
- _. Y1 }6 j a- f; H
! |3 d7 t: R* Z5 ^5 pThere could be hundreds of BPX you could use to detect this trick.: P" C: U1 E& o+ w: d# k1 o
-The most classical one is:! [3 O! h* e8 q9 c
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* ~8 l* w- i* d5 }; m# ? *(esp->4+4)=='NTIC': T# `5 i' y1 m1 _( ~# y
+ d( _8 d6 V$ v3 X5 X-The most exotic ones (could be very slooooow :-(
N6 z G. F& a: M& o9 ~! u BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
* T/ l3 h: {* I' Q1 o ;will break 3 times :-(& t; e9 R/ D1 C, C; q2 w
: a X/ h0 C. u S, b( J' Q-or (a bit) faster: 3 f* h9 M. s( V5 Q. H
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 n( u6 S8 w G/ L: z
W9 t9 j6 ~: D9 u BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % e. l0 I: v) V c- s0 A5 @; n: b
;will break 3 times :-(
: P/ S% u# R5 C' b: p
6 ^ _& `6 j. {# m0 ]3 M# q$ X) L-Much faster:' @/ n( c; X$ |, K' K0 R
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 p% \0 B, r8 H9 ^% I4 _. D0 }
% ]9 ~ x3 t0 ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 ]6 N+ i" _6 mfunction to do the same job:3 M( O. ^( h$ v2 W9 ]
+ v: @4 z& l" d, k1 O
push 00 ; OF_READ
# y7 d) n7 ~% C6 w2 j. T. u. c mov eax,[00656634] ; '\\.\SICE',0
1 |- l1 i) O0 z& p+ k push eax
- J; [, W7 ^5 ?0 E call KERNEL32!_lopen7 x6 a/ u1 L8 u% f) k- O
inc eax1 a" P. D8 ~0 l9 X
jnz 00650589 ; detected
- ^. p7 b2 F1 T4 N1 H) [! v- L2 N push 00 ; OF_READ: U0 c+ e$ M, e/ |- C& ^
mov eax,[00656638] ; '\\.\SICE'% Y5 L7 q! s# ]: h' s
push eax+ U' K) d1 G/ U1 K# c
call KERNEL32!_lopen
; V$ J. Y. q; Z. _; T inc eax
# X3 w/ _0 `2 m8 J& ~4 w jz 006505ae ; not detected
8 S* [' c; i( u3 _- k- J8 Y A6 }1 I H8 y, |
4 W8 {% F# v; g% r& X( u" A7 z, E
__________________________________________________________________________& [3 s7 k2 J& j ?
1 x! R5 i( ^+ ]/ O0 a" ?) h Z1 ]5 @Method 12
3 N* Z- G/ p5 B1 c. \8 L( i) t=========
+ K5 {4 }4 z0 ^0 q8 J; b' z
& Y; _( ^+ p2 U9 B* N- `This trick is similar to int41h/4fh Debugger installation check (code 054 a* m. u: l/ K& M2 A
& 06) but very limited because it's only available for Win95/98 (not NT)# E- J4 }% V3 g. R
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' Z+ s- j; G) U! i
d% u$ |- Q) ~
push 0000004fh ; function 4fh0 ?# m, W. }, p9 o2 i
push 002a002ah ; high word specifies which VxD (VWIN32)3 S" d- B: s9 U. y
; low word specifies which service9 g$ S5 k) R8 K1 T" b% F
(VWIN32_Int41Dispatch)0 F1 P! C l. B8 d, G% d4 Q
call Kernel32!ORD_001 ; VxdCall! S$ t9 ]0 L! Z7 k1 \
cmp ax, 0f386h ; magic number returned by system debuggers
0 E" Y: b% i) I4 M3 E5 D jz SoftICE_detected. G/ f. ~4 c; R: H' @8 s
0 Z' r9 X3 P( ]& _7 {7 d
Here again, several ways to detect it:& m* A: z. ~, y: E1 p: d) }
1 g9 {5 {/ O1 j. O$ E1 k, b" |
BPINT 41 if ax==4f
8 ^- u" x, `$ O9 V& f. N# T
8 t) K- I0 M% {: ~8 l, w0 q( @ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 ?- V; N1 u* Q( f% ?* N- u' G! O( U
* Q* \% e! [! {, X0 ]' O, ~ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A( Z j& U. F; E5 }" w
: q$ C+ g2 T1 v4 V% {8 p BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 l6 e3 R' k: S8 R( [ t* c' J( _0 K
__________________________________________________________________________
- {5 t' z# w- w% P9 \ ^ h
5 ?3 B7 g( l- _5 bMethod 13
' h/ I8 A% s: @! i E/ P$ n=========
5 c% u- F1 L O
' t) X- d- m7 }6 mNot a real method of detection, but a good way to know if SoftICE is
. N1 M) |2 S2 ?% j! v1 Z2 K* S# jinstalled on a computer and to locate its installation directory. Z7 y' P2 c, W! G" q2 `
It is used by few softs which access the following registry keys (usually #2) :- c& @# ]; T6 x+ U0 }
+ E; H! n# p X! g3 o; |+ l! Z T
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
a0 j4 l4 A0 i; |* R\Uninstall\SoftICE6 Y% c U$ }5 c3 {( K2 X" g
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* K" T& o/ ~* K- c$ a- v/ u-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: [ C5 P6 w' k- K\App Paths\Loader32.Exe2 v3 `- n$ [9 Z( ?5 g6 e/ ?* G8 L
8 N- t4 F/ n% l# R# n* C+ P" T' N" ~ t: N! m2 Z+ G [: F& v
Note that some nasty apps could then erase all files from SoftICE directory
" i) r! r8 i6 I$ x% b' h(I faced that once :-(
) M' j! U3 f. B6 G- x' X
2 b) `" v5 b5 [, s9 b5 q, ^9 eUseful breakpoint to detect it:2 j; s. s7 e }
% C+ |& x1 W! \- G3 R$ G BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
_* g" g3 K W: O, w' F: v8 U- R( {1 P0 l$ I; m8 [: ?
__________________________________________________________________________, V' r/ x- m' c( ~4 f
2 n5 _8 }; H! J- h5 F& F* ~
0 g& K- J- _! W! g7 d: E
Method 14
. O8 C1 o( G) w7 z=========& } H# y' c& q. q& _* d) l8 k
o: ~3 W9 @5 H; e0 S) l- w0 _- \
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* [5 C$ i5 V: \3 P( L6 Q* M
is to determines whether a debugger is running on your system (ring0 only).
' B+ [% X8 W: A" v6 A) G" I) u/ f; `$ {2 R/ y" R
VMMCall Test_Debug_Installed
+ [1 f1 R, Q( w2 e( n7 B, \ je not_installed
4 t+ {3 Z: l! \& k! ^# Y
: A5 w! l3 l8 d- J NThis service just checks a flag.3 {: O8 I7 E1 o. R6 J* s/ y* O
</PRE></TD></TR></TBODY></TABLE> |