<TABLE width=500>* k y1 e. s6 y6 A0 V* g* H/ W
<TBODY>
" M" x9 v( I* C<TR>
1 _; j+ ^! @$ z$ {$ f, a: S<TD><PRE>Method 01 : Z8 D' N9 g7 @6 a
=========
; P: r3 R4 I2 V5 t7 I
1 x$ B, q8 Y; W* u( PThis method of detection of SoftICE (as well as the following one) is1 r( M& O0 W. L+ v: ]
used by the majority of packers/encryptors found on Internet.: H5 M, d. {% R m Y8 M* p
It seeks the signature of BoundsChecker in SoftICE0 \4 c8 o! N6 i- G
/ U+ c" E& h# [& X3 a+ y2 w mov ebp, 04243484Bh ; 'BCHK'/ v* X8 b: X0 p7 e: T' l
mov ax, 04h
p) v& U& ]' ? int 3 : Z8 ~4 Q2 [7 m, z8 B/ z, a" C( ]
cmp al,4
4 R* e5 T- J4 I3 i! u jnz SoftICE_Detected
/ R% P2 P8 H: v5 H$ B9 v/ x. C% I( I
___________________________________________________________________________
* i6 J6 \. ]& w* N8 s4 i3 `# C o* d
Method 021 O: ?$ G! S7 H
=========
1 V( `! ~2 S+ r! Z# l3 L, V& M7 N/ p, }
Still a method very much used (perhaps the most frequent one). It is used$ S1 z a- Q8 S4 f- f1 H# Q& h7 A! M) d
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
% n j9 }# Q+ S2 J- h- p* Gor execute SoftICE commands...0 F4 K" T9 G* W' ]
It is also used to crash SoftICE and to force it to execute any commands$ r% S! ^! h e$ c* m+ p# |" q
(HBOOT...) :-(( 9 D2 U0 z8 z" x& N0 g
( o# A5 [' d# X0 h( W# h4 QHere is a quick description:
6 d" K2 H+ M2 A/ ]-AX = 0910h (Display string in SIce windows)
$ G( V! s0 x! M2 P-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 s: I2 l9 r+ @, }+ h
-AX = 0912h (Get breakpoint infos)7 c4 r% q' s( T+ _
-AX = 0913h (Set Sice breakpoints); w: U* e6 d6 t0 l, O O+ o: u/ {
-AX = 0914h (Remove SIce breakoints)
1 L3 i) E$ [8 l; U9 }) A: `* i# w
4 }/ M# S% R! ]2 m* wEach time you'll meet this trick, you'll see:
" \( b! K- Y/ y/ ]) _-SI = 4647h0 {! Y) [: V9 b+ l7 Y [" z G
-DI = 4A4Dh
" _4 Q H! ?3 k3 I3 ?Which are the 'magic values' used by SoftIce.
8 F8 G+ A n, u ]' o. bFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.; y5 \& @, ^0 N- T
1 n9 d) H# y, ~6 c# V$ sHere is one example from the file "Haspinst.exe" which is the dongle HASP
: i, M5 S \' R3 qEnvelope utility use to protect DOS applications:) B2 u/ n% L- {% W C
G9 t2 \) Z8 i Z( H
9 Y& ~+ S9 T0 A! M5 q3 ]
4C19:0095 MOV AX,0911 ; execute command.
' y' w; y5 H% B% U: R4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 [% _( L. n! s J! H+ z4C19:009A MOV SI,4647 ; 1st magic value./ U+ V+ R7 F; V" q! K
4C19:009D MOV DI,4A4D ; 2nd magic value.
5 |7 E# b ]: l- {6 w4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& ]& ~5 r" O' b6 R/ \% i
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute, ` N* v; J% z- C' _+ {6 H$ F% C
4C19:00A4 INC CX
: R f. `! @, S3 k! e( E; b! @4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. v1 d) P, m/ @, h
4C19:00A8 JB 0095 ; 6 different commands." u: U/ R% ]2 P/ {. @1 v
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* S' E+ s+ z0 o m1 Z2 P) U! R4C19:00AD MOV BX,SP ; Good_Guy go ahead :)+ s; w1 F2 A; R$ S! I% l2 N1 D
3 F% I: k% c2 C$ A# IThe program will execute 6 different SIce commands located at ds:dx, which. t l2 Q9 K: y& _; A/ w, Y0 ^8 p: t
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 F$ o r3 X" B9 a0 l/ d
* `2 G# z+ M" \9 Q! |4 y/ ] x
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
B0 j3 K R! {/ S% ____________________________________________________________________________
. X% C% n. C0 D) B
. o7 f0 c ?1 U) e
* E/ g( M8 O" W; G. c5 p* a6 LMethod 03
$ u4 F, V6 e/ x( m3 b: }4 i+ ^8 r9 o* T=========! l+ q2 [& j8 n9 M
# P9 K7 K8 l1 |% {8 C. [4 W/ O6 B8 zLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
7 r: S. C) K) @; `& p2 E(API Get entry point)4 W. \- @7 B- q! g/ G+ B4 c. y: G
# Y+ Q* n9 q& u) j8 m' k# O) \+ d D5 A
xor di,di
1 @/ r+ e, d" m. O g6 t: k8 I/ L mov es,di
. \9 k) D- {/ C% K2 X9 d mov ax, 1684h
* r1 w# X! s! u/ _+ ^0 j4 C) R mov bx, 0202h ; VxD ID of winice5 q( ^: c* A, c, Z' |/ s2 R
int 2Fh
, o3 S. L' V$ u! @$ ]. l mov ax, es ; ES:DI -> VxD API entry point2 }) g( d) D9 M( W9 |9 g
add ax, di, W% _. g7 h& h9 O! J# f. L& F7 D- J
test ax,ax
$ ^6 q) j7 H' S) _, M8 O jnz SoftICE_Detected
( G1 h2 ]6 S. Y" g) u/ I0 _0 Y# v; ^
___________________________________________________________________________
0 } f# l" |: H2 M0 k! g t* {
Method 04
. ]" G* S: ?. a7 ^! ~8 g9 \=========
" v& H# ^$ h( i) d/ w) g* V9 V! i
Method identical to the preceding one except that it seeks the ID of SoftICE. {% x' F9 X# V' Y- D# w
GFX VxD.
8 E8 l, d% ^$ V' F. x7 q J$ O& _' ^9 Y" F
xor di,di
2 ]; E8 Q; _% |1 S7 ~: w mov es,di
! a; E; L) Q3 q- O. \) p mov ax, 1684h ( o- p1 Y% k1 q9 w! T9 E9 P6 O0 r
mov bx, 7a5Fh ; VxD ID of SIWVID
/ B; [! S# k4 W; j$ ?! R int 2fh
3 {/ Z8 i: `, w) i mov ax, es ; ES:DI -> VxD API entry point+ B* `/ L0 c+ x! Y
add ax, di- e% f1 A5 H* O, F
test ax,ax
* [7 n& g5 \* c7 e/ t$ |8 G+ \ jnz SoftICE_Detected
4 M6 P! r1 V$ Q5 P* r4 J: a P' n3 H6 p; D. n
__________________________________________________________________________$ p9 M' s7 i4 s8 c
, Y. R* A3 |* m% n% z6 P9 N [) c0 p! n' Z7 V! w
Method 05
) [8 F H7 {' p, n+ `6 V=========, g- v9 r, J# X% ^
5 ^2 k+ e; b' I; g4 I- d
Method seeking the 'magic number' 0F386h returned (in ax) by all system
: W' R; c) Z- g8 x4 C, A$ \debugger. It calls the int 41h, function 4Fh.
, }5 e, ?( q2 |There are several alternatives. ; {" F! ^9 y! h& P
$ ~9 r8 l1 \. E# x2 F _1 PThe following one is the simplest:
0 C/ F6 ]. {" s: @
; i9 x) ?" B. a3 H mov ax,4fh \+ @: D. r6 X7 |. _% J% w
int 41h2 _3 [$ ^" f, y5 a, c
cmp ax, 0F386
- ^5 k* |! O/ b# {6 d8 _& c jz SoftICE_detected/ v1 ^9 U. S1 f4 P/ c8 S) p8 H
9 v( f. I. H! _7 C6 a+ I
5 w! h& C8 X" F' k/ G) _" RNext method as well as the following one are 2 examples from Stone's 5 d( `" a, _) W4 q) l1 b1 o- q
"stn-wid.zip" (www.cracking.net):
/ U, b% b U( j: K5 u0 E5 S, z8 i5 G: o: k w( B
mov bx, cs
1 m* n* @3 N: {+ @7 s$ n% [) o lea dx, int41handler2
2 J3 M' c6 u$ _( d2 u xchg dx, es:[41h*4]
: o* s) e! Q$ G9 ^ xchg bx, es:[41h*4+2]
$ L6 F6 u6 r9 b3 {8 C; ^: n mov ax,4fh8 a; ~$ i" L# V, t
int 41h
( I+ q4 Y! p& A) x xchg dx, es:[41h*4]
0 N! B1 e- f/ L3 F xchg bx, es:[41h*4+2]
" C4 s. J8 ~9 _& s9 o8 [4 g6 h cmp ax, 0f386h, w( T; q& g" N: Q! E
jz SoftICE_detected8 T6 e# M% `8 F
0 H$ } p3 f& i9 C
int41handler2 PROC
{+ z9 p5 k6 g1 d4 _6 | iret
. h8 F) ]* O( jint41handler2 ENDP5 T3 Q' Z$ w7 K0 G# ?
1 O0 {, g, q+ {& H$ S0 p) \" t8 z8 u# ^: S, P; w% ~" }9 i
_________________________________________________________________________( m/ m; H! B) X
) |$ R. i; A8 @, h8 s1 U3 m0 n7 B t6 Z) s2 Z0 O7 m
Method 06
- _6 u# R8 H) G4 M, y2 M=========/ Z% k- s7 w& l0 U& H
, b- ~& {4 b7 ^& _
8 r/ r0 L& O6 g$ G- K1 J9 L& }+ j2nd method similar to the preceding one but more difficult to detect:
0 t" \0 {1 q" A8 T/ U* n6 V4 q4 g; R6 O* o W& n2 q
^7 a2 W; S/ Q) C/ J5 b0 C
int41handler PROC
0 f, g# e7 P* C4 p3 ]' F- p3 j" h3 w mov cl,al M1 x' S; ?: J! G
iret
; j1 D) {. m3 E" D" M- Oint41handler ENDP
6 i# u9 k3 [, I! _4 A4 Z& @& b" K2 L1 ?
* l1 b2 Z) s1 m5 j) ^0 W3 J xor ax,ax9 a( u5 l" a3 E
mov es,ax
" |/ {" U1 d; J; S) v- p mov bx, cs8 L: `( D1 f# T: ^0 M7 N( q
lea dx, int41handler7 y" K; |% Q5 X
xchg dx, es:[41h*4]: S6 G4 T6 `+ c
xchg bx, es:[41h*4+2]: u% {+ R% t7 j5 a* C& {
in al, 40h
! S: L$ } H" Q1 a/ l! S) | xor cx,cx
. l4 }" a4 |6 X1 p- z* |- p- d int 41h8 k7 C" w, k9 d: [4 b
xchg dx, es:[41h*4]) P3 y1 j; {2 g# J
xchg bx, es:[41h*4+2]
# R3 @ c- e+ n cmp cl,al- G- m C" h9 N* ?
jnz SoftICE_detected
7 l9 P( x+ X% M: K- Z9 J8 u& j6 m* k( R/ k4 u+ g1 ]
_________________________________________________________________________. i8 e3 i/ } a. B3 C
: ]2 z+ `; [$ q7 Q% U% G" R! eMethod 079 I2 Y9 W. z3 Q C; D$ t ~
=========3 j: _: k, D G5 C
1 R6 J1 l& E9 `* cMethod of detection of the WinICE handler in the int68h (V86)
( A \" k6 B. R& W, P% [: a$ d0 N; f4 Z0 G
mov ah,43h) g' ~2 Q' S9 h8 \( `# L! L ?. _
int 68h
" x- k' L- X- \% |% R& b cmp ax,0F386h
% _ g8 w# \/ r0 ^' _ jz SoftICE_Detected
4 L" I$ Z# V* K$ I; r$ B
$ R1 O7 u: x3 q9 Q7 X' W) x+ Y
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ x7 P5 ^6 R( l( f5 k1 v4 z$ k
app like this:
1 Y2 v/ j" f6 e/ v
; b* W9 m: J& e! m5 w BPX exec_int if ax==68; u/ E& y5 S4 I* |
(function called is located at byte ptr [ebp+1Dh] and client eip is
: e5 H# e- |) w located at [ebp+48h] for 32Bit apps)
/ w3 V- I: F. r& `3 C! Z- b# d__________________________________________________________________________4 f6 h$ C8 O9 U0 F" X
# H P7 ]- L' n1 N x6 ~ Y" o
6 S' E1 h7 u7 ^7 y3 U7 ^) ?6 ]/ I
Method 08$ p/ X2 O' t0 Y: l( A+ P
=========" L- I g! ]& X+ N' h1 b
$ p1 Z4 U! x* Q2 v8 iIt is not a method of detection of SoftICE but a possibility to crash the
; x! L u3 Z+ u4 q' Gsystem by intercepting int 01h and int 03h and redirecting them to another
( \9 F& j# h8 b2 \6 b5 |routine.
2 d4 {% A& [- O v# E9 w; W% }9 h5 f/ TIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
' h# J/ q/ e* @& ]$ e# b% E% m) f. a# e; ?to the new routine to execute (hangs computer...)
2 d- ]$ V* T/ C. |- `
2 ~ H* J0 v" [' }$ {6 ` mov ah, 25h6 M) U0 }" ~ k- [6 t/ Y9 i& Y
mov al, Int_Number (01h or 03h)% j6 V, g# y% S* J) G- n n3 q
mov dx, offset New_Int_Routine
5 E5 V' V ]0 v$ q) d. s' j2 Q int 21h/ _# h! P3 v; C* |/ G3 {
+ k7 ^! D- T V5 g, C8 ~
__________________________________________________________________________$ \+ w& L0 z1 |. p6 V* W
4 I. E H3 c$ ~( |7 ?1 BMethod 09
# o4 L9 K4 @" o/ v' A8 @. L=========3 x% [1 y- Y& v) v( o% _
; L4 E$ ~! N! a) I2 F* W
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 E w6 L) `' T4 e8 w2 [+ `' ^performed in ring0 (VxD or a ring3 app using the VxdCall).
/ F, t' \5 |- ]The Get_DDB service is used to determine whether or not a VxD is installed
0 d, ^& g! }- I" s" dfor the specified device and returns a Device Description Block (in ecx) for
# r" ?* @' m; r' O2 H( c) {that device if it is installed.
& M; Z4 G n- N' M$ ]6 K8 Y# R) @
# O7 S8 p) \' o" X$ ?, J mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- a9 c8 T0 j$ g; L6 [
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
2 F3 r, i$ {0 }: t VMMCall Get_DDB
K- l( s0 O3 k mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 h8 N E: c% L0 g" t9 j* M0 g K1 b7 p& N7 z/ w# R8 C/ m
Note as well that you can easily detect this method with SoftICE:
: ~: u" K% V4 c bpx Get_DDB if ax==0202 || ax==7a5fh
" y3 I& @' T7 a8 K7 C9 r# X9 V4 c9 i" w; V. ~
__________________________________________________________________________ d2 g4 C3 S& n# X! x, r
9 ]- W3 G* Z- g! [; HMethod 10+ y; t: M, p: G$ }+ ?- _, F7 J9 Z
=========6 Y2 E k) C7 ^
4 d" t9 b: K. N7 E=>Disable or clear breakpoints before using this feature. DO NOT trace with v0 i$ S$ b1 s4 |# H
SoftICE while the option is enable!!
9 L: c0 F4 i3 u% e& P2 X+ @: C
I- Y7 ^- G1 m6 ]8 H8 b- p! T& PThis trick is very efficient:
. j1 p# L. _( k* [1 v8 G! ]by checking the Debug Registers, you can detect if SoftICE is loaded& O9 P( g- L/ [$ u! O# r
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 f' m0 K8 X5 d D& b! S
there are some memory breakpoints set (dr0 to dr3) simply by reading their
* W: |, R- |# v7 v1 s+ Evalue (in ring0 only). Values can be manipulated and or changed as well7 a* E+ _& D9 e+ _4 _+ `
(clearing BPMs for instance) }; P4 G- {' ^6 h
S* A1 j8 W% y6 K
__________________________________________________________________________1 A2 Y* q% u( W9 Y& |( F+ h
' D( q7 s2 N: V) H; {& E5 L$ ^( K9 BMethod 11# `8 u3 M1 O/ [, V& b/ D7 N
=========
" z: j4 f i: L& i# U" ?
) M# ~& a% [/ v6 o# T: ^5 M* HThis method is most known as 'MeltICE' because it has been freely distributed
3 {8 G4 Q" I6 H- _2 Qvia www.winfiles.com. However it was first used by NuMega people to allow! N1 B; x. L2 j1 U+ T! a6 m4 j
Symbol Loader to check if SoftICE was active or not (the code is located1 z) p `7 A% m" g6 {' i
inside nmtrans.dll).
3 A/ R x, H/ p' W7 W) X" J. E% }" X
8 y8 g. I6 l6 KThe way it works is very simple:, Z& J1 E5 t0 M0 M- c9 G( P7 F1 C: ?
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 w& _. H# s; E5 H' Z' a) @
WinNT) with the CreateFileA API.7 ~' k4 X) |7 ~, _
* j5 V4 U4 E2 N/ G4 m5 D
Here is a sample (checking for 'SICE'):
) N/ F9 o/ ~' n! _6 J, _1 u6 B- O
2 \) l' f4 G1 L/ T( i2 H+ FBOOL IsSoftIce95Loaded()+ F, o; a. Q; C8 E8 P2 R
{' M5 l. n8 A T f4 i% T2 c" S
HANDLE hFile;
3 }7 ^, ]: @ L* f0 {# f hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE," W4 Q* x1 @0 R* i0 E7 b( p: s$ K
FILE_SHARE_READ | FILE_SHARE_WRITE,
# X& X8 y' j3 S/ ]) c2 h NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! A: S8 M3 |" f# _+ ?3 V if( hFile != INVALID_HANDLE_VALUE )4 @+ j5 x# k$ z0 n, M) z ~
{! k/ z! O+ Q8 {* D" L
CloseHandle(hFile);
. ~. P6 n3 @$ v/ I* [2 t7 J; N+ x return TRUE;
6 J4 l9 R$ J9 m' \ }
5 \' S8 n# B! N+ X return FALSE;3 }; y/ U, S* f2 i1 ]
}
" n7 e# G. \+ [1 J J. [ i, Z
$ n* B% d/ l ?, O. S" T0 OAlthough this trick calls the CreateFileA function, don't even expect to be" c- o$ m8 P0 {, L6 d; w1 n+ v
able to intercept it by installing a IFS hook: it will not work, no way!
% T1 ~/ c$ u1 h3 d8 j, sIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
! m. y. ^. z) `7 c8 W8 e: X7 G vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 |( w& H9 o# L( J
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ c# I1 H) J" Q5 s
field.
3 W7 R; m& o/ Q h* gIn fact, its purpose is not to load/unload VxDs but only to send a
. X9 v9 o! {3 l( gW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* K6 X* i7 _& u1 Nto the VxD Control_Dispatch proc (how the hell a shareware soft could try" [0 T5 z5 ]) v
to load/unload a non-dynamically loadable driver such as SoftICE ;-).; [8 g, o5 e' D! s) V0 m
If the VxD is loaded, it will always clear eax and the Carry flag to allow& K, F+ G1 |0 c) N
its handle to be opened and then, will be detected.
2 h" I0 F8 W0 T& fYou can check that simply by hooking Winice.exe control proc entry point# Y( ]/ p$ k1 f" j" u
while running MeltICE.
" K8 p5 d+ C: Z! y# V$ ?4 j* w! Q3 d$ P3 a- q. ~9 x5 r
0 J$ H. H' x9 O2 v) V 00401067: push 00402025 ; \\.\SICE! _- \/ t, [! e4 [3 x& H. K
0040106C: call CreateFileA
) J4 ^: D( D1 H, }3 @ 00401071: cmp eax,-001
7 B9 r8 k, J: g 00401074: je 00401091 l* r! y) c, n5 @3 `5 [7 J2 @
' C+ ]. J* q! h2 F. j, n; b
% N1 q; Q' F6 h* n$ Q/ oThere could be hundreds of BPX you could use to detect this trick., c/ U/ c( r: w/ G9 N* }
-The most classical one is:
$ O1 P' F9 S- G7 S9 F" e BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 L5 g u$ t0 F6 U9 ~6 ^+ g- @ *(esp->4+4)=='NTIC'
! u- w% T6 ~$ c2 S! y, ` }. Q- s$ q( z( X+ W- a
-The most exotic ones (could be very slooooow :-(
% S% {( o( C" `5 {) s: }; D* z- a BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
) u( h$ S1 D+ y' v6 k ;will break 3 times :-(
! N8 N6 n3 m8 P7 ~9 U4 v/ i8 S
* a8 { o' N5 q. I" g3 g# A-or (a bit) faster: 6 Z9 ?+ ?$ U9 F6 q; P; N
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): I4 T, ?4 e9 N7 [7 I) _
+ G" _: P6 r5 N2 O
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 3 f$ B! F! \1 m1 b$ q
;will break 3 times :-(
# m* G$ z+ N$ b: q
. A( A! O. L6 Q8 ?1 r: R1 w) L-Much faster:) B4 i s. T8 d4 Q& x8 C
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" d, @- _* J# A3 x5 _: t1 z& D4 a: b3 R% t f
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( k+ V" _3 m% S* O' t6 _* r& z" Dfunction to do the same job:. X6 w4 X, l, o2 G# F
P( d2 w4 I. t
push 00 ; OF_READ f3 h, m C6 M8 i. D' e1 b
mov eax,[00656634] ; '\\.\SICE',0
- l( D6 L1 v2 L4 h push eax
; H; C* G3 I3 q5 Y! n1 X3 T call KERNEL32!_lopen
' G* k: a/ g; x( t; I p2 c& _0 I inc eax1 v9 J- f) z' C7 g' b4 z
jnz 00650589 ; detected2 H- P, N2 ^/ ]; Y( U
push 00 ; OF_READ6 p' s- A C/ X
mov eax,[00656638] ; '\\.\SICE'
; F- U' d9 y1 { push eax
1 e2 |) X2 w7 p3 A# J' t1 ~ call KERNEL32!_lopen6 Q; f& @! X' g, V5 m* i6 A
inc eax3 V: E2 ]* w% d1 ]
jz 006505ae ; not detected; L4 R- \" K! C- L) U9 h
6 f3 P* P+ J8 l
( `" o2 L! h# j# U1 Y__________________________________________________________________________6 ~+ {* O6 t: f' L4 o: L
) U( y" L+ D( W* W' @. WMethod 12+ T9 I0 p7 \! f X
=========
* ]% F/ N( F e2 N# w0 C4 b
3 x% ^. _ b$ vThis trick is similar to int41h/4fh Debugger installation check (code 053 k5 z) f& n, U. F; v
& 06) but very limited because it's only available for Win95/98 (not NT)# p: ?+ N6 B. K* Y4 f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.: g6 m1 g3 }: w" j, C& w% \6 ^1 a
" x" S# v+ z+ {. o8 W+ I" [ push 0000004fh ; function 4fh
" n) v" L( B4 }# W push 002a002ah ; high word specifies which VxD (VWIN32)
1 D9 c, j; `1 y2 X& m: }* n% l1 x ; low word specifies which service3 I, L7 m1 C7 h/ H5 Y( I
(VWIN32_Int41Dispatch), W# o, C% O+ D) d' p) Y& g
call Kernel32!ORD_001 ; VxdCall4 g- n3 W0 }* U) t
cmp ax, 0f386h ; magic number returned by system debuggers
. }0 [" U3 `4 c4 g7 X, C0 }4 U3 i: j jz SoftICE_detected
" Y2 l3 p# m; G8 S0 e! M( e0 s6 m+ u: q: C+ t/ f
Here again, several ways to detect it:! f. P. G) P: K& @9 J+ r8 o
9 O* {% T* w, }0 L5 R. h
BPINT 41 if ax==4f3 f( g0 p- C2 V4 j( i
* s* S' \0 y' o+ p) ^
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one% f' R! @- U3 d4 ?4 F
8 c( r; G a4 _% ~- i" Q2 u& C5 e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
! [, l* z# m4 N" c% g
e: z9 T5 _ F2 s BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 X: L- w6 C9 x- O
1 O8 N& t2 D% Z' C__________________________________________________________________________
7 _: y1 I: h- S! U3 C! ~" m8 a" L5 y. K8 {) C( h( T& Z
Method 13' w' t; u4 T* A8 Y! K
=========0 R9 o D& F% e0 m1 v
9 J' S1 f* p, T/ j3 X3 T5 s( UNot a real method of detection, but a good way to know if SoftICE is
, L! i, W6 W+ s, Winstalled on a computer and to locate its installation directory./ r' d1 t I. x
It is used by few softs which access the following registry keys (usually #2) :* D: s* g. D; h: ~* J2 n$ [
M# S: I! |9 w5 X3 i4 a4 V-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 _# A; G7 p) g) b
\Uninstall\SoftICE
& D/ H, d4 Q. v0 z7 h8 h: B-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 U) P( L7 L' V8 {
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 Z2 x/ S2 @$ \ o9 g% w2 T
\App Paths\Loader32.Exe
! Z) S! h& z. K1 U" P; W4 V$ [ H U6 X5 U7 O# u1 V3 R l- K" R
6 I; W+ e" L/ I, \' e8 ?' Q( ^% O7 ANote that some nasty apps could then erase all files from SoftICE directory
* B. y( N; T, c* L& ]: V1 @& z) h E6 z(I faced that once :-(
" s( A1 J( ?8 }4 r- s5 x
; z3 I! n4 W v' v& ?7 B; tUseful breakpoint to detect it:
$ B" I% ?6 i; X( d* J
/ C' p+ I; j6 ^0 d BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. w) ^: V8 `2 T2 Y/ v+ `
, v% _1 {. N* ^! d. A__________________________________________________________________________
2 X" q! D) u( u( Q# O# w/ r2 ?9 n5 w. ~
3 s1 B: N- b. \1 p$ o7 |Method 14 8 g" H" r i" D
=========5 v# w6 ~4 @3 |
1 C# S4 q8 r' X: o. b. p( HA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! q8 i; L D7 A; [- x& Z! U
is to determines whether a debugger is running on your system (ring0 only).* f1 F8 B2 J/ j; _
6 A" a, A1 W" u* n VMMCall Test_Debug_Installed
/ c$ H" j/ l1 k0 D# ~ je not_installed2 {, r. B) c+ r2 v2 A$ @$ `
$ [# r% n" t# u) c. H. `+ f0 C& v7 F
This service just checks a flag.) W1 `: Q' V) H/ H
</PRE></TD></TR></TBODY></TABLE> |