<TABLE width=500>
3 l7 X7 M$ f2 J4 ?$ [% }<TBODY>
; E" R5 Q0 T7 s$ z- a4 ~<TR>
' H0 C% ~& I# S% n% V0 e8 B- l: @9 a<TD><PRE>Method 01 8 r* D2 S6 i( k& Z. V' ^) i
=========
' J1 Y C+ x& t. h2 I! k; J T9 ]& r* `/ e0 [) F6 |: K6 W
This method of detection of SoftICE (as well as the following one) is
0 g/ g3 T0 A# R4 cused by the majority of packers/encryptors found on Internet.
4 j3 B7 J6 Z, ?- K. d# E3 N* T* ?It seeks the signature of BoundsChecker in SoftICE3 Z! r' v9 z6 t
, \/ z' m+ c3 k/ ^' j5 x( z2 Y3 Z
mov ebp, 04243484Bh ; 'BCHK'% a' U$ q8 W P: U
mov ax, 04h
8 D9 N9 v1 N O$ q# ^ int 3
+ x- z, F/ y/ y% U* p1 ^ cmp al,4& q7 u' M {7 S
jnz SoftICE_Detected( _+ F% u, w( p( S# A q* I
" Q' [; G) A% E. g/ s; R___________________________________________________________________________
- c) J+ Z, o; U9 N5 [ h
' h5 d& ?$ i {) {* sMethod 02# J! t6 _# d# c) P( S6 O3 `& M( p
=========! }( r3 e( b H0 v$ s6 X/ H
5 H. p5 P7 A; `9 S; w
Still a method very much used (perhaps the most frequent one). It is used8 f; ~, Y- y. l9 k
to get SoftICE 'Back Door commands' which gives infos on Breakpoints, A! L: y$ a5 A% w w V+ X
or execute SoftICE commands...
$ h3 s- ~3 i7 Z `, X4 a# [. V2 OIt is also used to crash SoftICE and to force it to execute any commands# N; X: m1 c+ l6 w
(HBOOT...) :-(( + b+ \3 r1 J$ Y, \
6 R5 o" q/ Y) YHere is a quick description:
3 p c/ z' f1 d5 X" ^; h-AX = 0910h (Display string in SIce windows)
4 v \3 z1 `' W! ^' t-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' q+ a1 o) w+ M-AX = 0912h (Get breakpoint infos)) z6 o# q5 b+ T, A
-AX = 0913h (Set Sice breakpoints)
) X! E5 M0 H7 y/ q: l5 {; ^2 B9 g-AX = 0914h (Remove SIce breakoints)
& P* m: _6 X+ K$ V
' W, I7 K- _' UEach time you'll meet this trick, you'll see:7 v8 C) b% g7 j7 p8 U' e
-SI = 4647h x( k. N! M" R! U8 S; ~9 p( a
-DI = 4A4Dh2 t" H* Z8 l6 z2 h- Y
Which are the 'magic values' used by SoftIce.# ]. w* _2 e9 ?% t+ V' a
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 @3 K5 s1 w# @8 O9 t5 M' O. {
* M6 e3 S# \: l( LHere is one example from the file "Haspinst.exe" which is the dongle HASP' N5 C# j, Q* c" ~
Envelope utility use to protect DOS applications:; ? B ?. O' v4 a( W0 n* E
% a r% B, H, ~
4 {( `8 J' J# J& G4 @4C19:0095 MOV AX,0911 ; execute command.
6 O* a& Y: C& G" X3 T4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).4 h- y* P/ O9 @' q
4C19:009A MOV SI,4647 ; 1st magic value." M& k& C, n1 P- l9 T- u2 Z# w; ^& D
4C19:009D MOV DI,4A4D ; 2nd magic value.
# q* @. v8 o% B. [4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*). @3 ` X9 Y b c' V
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute- w+ ^! o. a: Z( d: A; [
4C19:00A4 INC CX- U0 |% R% u7 J0 b
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, }3 `* m' \* e, m
4C19:00A8 JB 0095 ; 6 different commands.
+ Q1 u4 i& |0 e+ h* J4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, E: l- L |4 E/ u* d' O& m0 P4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
7 x$ r. v, t1 H* R1 y# G
1 G4 p, a& T( i( TThe program will execute 6 different SIce commands located at ds:dx, which5 N9 G9 }1 K" p- t5 V. O
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 i+ P7 j O$ T/ A! G- o! g+ `3 B* H) z
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ N7 s5 c, Z) V___________________________________________________________________________+ j$ B; r7 m' I( N0 x! ]0 {, V
' O% M e- Z) L7 h* s0 z/ o9 |' q2 q
2 s5 U! _" g8 d! MMethod 03
2 Z/ v2 P; E x8 q4 Z=========+ b) P5 }' Z: A
/ z8 Z# z% e* l0 p2 yLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. k6 ?9 D& y9 \$ J) n8 Y' ?
(API Get entry point)/ e- }; \% _/ W# m9 Y: n
8 c8 _$ ~1 w a- A% {0 k: v: {4 p4 m. E( Z& H
xor di,di
7 J% ] r$ s! x9 Z% y3 }1 l mov es,di
! J; u: z, A$ A, `+ F, x mov ax, 1684h % @5 M9 Y$ ?1 K: ?( Q. l
mov bx, 0202h ; VxD ID of winice( q5 i2 g6 Q) B9 C) J! O% x
int 2Fh
4 p% K9 P# g6 z% {: |( I, V mov ax, es ; ES:DI -> VxD API entry point
/ w/ @+ K# Q0 b2 A, ^ add ax, di; l, Q' J7 ~ P1 h) h* K8 x
test ax,ax
& Q: w- |- x) S4 q9 R( g jnz SoftICE_Detected
* W+ m$ \$ Q7 w, q1 ]+ |/ k" v5 {( |: y; c
___________________________________________________________________________6 q5 H$ N8 i9 @' U" d" L
. c% i4 Y2 j+ L$ {Method 045 F) \. a- \0 B& N; i5 z
=========# s; o5 V( w4 ^* G3 y" R* N
8 p) O$ g. y) v; L! U
Method identical to the preceding one except that it seeks the ID of SoftICE
8 }7 A2 Z" d% r1 [8 F( CGFX VxD.8 [! Z! N; T, \' n
+ \1 f/ e+ g& C/ G* X* R; ~% j, @/ m xor di,di
2 F3 {; T0 L3 |4 |! D8 R. k5 _7 S mov es,di- Q, s6 w6 K1 h* d
mov ax, 1684h 1 \$ t/ O8 Q9 Q4 G, Q% v
mov bx, 7a5Fh ; VxD ID of SIWVID
& h5 s5 c8 Q3 b) d- Q/ W int 2fh/ C, @. H" r" f5 T" Z' m1 G1 Z
mov ax, es ; ES:DI -> VxD API entry point; m( }% ]( J; R
add ax, di
7 O: o+ M9 i8 u& [$ | test ax,ax
( @6 s' [& E1 I jnz SoftICE_Detected
5 `* |% P2 Q: T' N1 m! ~, f
! p5 a+ F1 u. f2 H9 P! g__________________________________________________________________________9 \! F5 n5 G6 Q* j; [2 G, [
, [/ L$ ]& @1 Z# S0 Y( `: H
+ y1 n& _% }; i! AMethod 05
' _# b# F" k4 I) b& b% N=========; {7 U" M: o1 {; n# @) G3 ^4 o+ e0 ?/ Q
3 A1 K$ [- Q! _4 ~' ?/ ^- \Method seeking the 'magic number' 0F386h returned (in ax) by all system$ Z' g) _1 a' ~# `- m% F% C
debugger. It calls the int 41h, function 4Fh.6 R& @$ b* l8 [2 M2 @. f- B3 Q
There are several alternatives. ( L. E ^3 H. z) u
6 c4 e9 j% J( |0 w6 E; C$ \; _, KThe following one is the simplest:
) E3 S0 H! t& Z- w
& r p3 ^: j/ o* g1 O& G+ a3 I- U. P mov ax,4fh7 z# j5 A5 @" s) b) Q0 e4 V
int 41h
5 \- ?3 g7 a6 ^7 o) A$ w" ] cmp ax, 0F386* d7 s% {. e# @+ j
jz SoftICE_detected
' v, }6 L% i& u* Y/ U
1 e: B$ W- } v0 E# L5 y% J# ]+ S" \
7 x: Y7 e5 t$ T" H2 T9 a& ]1 VNext method as well as the following one are 2 examples from Stone's / G; b5 r9 k P! {: s1 M
"stn-wid.zip" (www.cracking.net): O1 y8 j) R! C) ?8 x
# K" ?& f4 i: P0 @* Z mov bx, cs9 G- b4 x- Y2 `* ^! W' Q# k! F
lea dx, int41handler2" T' C$ ^3 m) L ]7 p
xchg dx, es:[41h*4]
* m; ?- G! e4 N+ j/ l xchg bx, es:[41h*4+2]
# i/ ~1 G) b J6 O+ j mov ax,4fh N' W) x5 R. b( ^
int 41h/ U6 \6 E3 \3 u' f# [# D8 ]
xchg dx, es:[41h*4]
E# W1 Y5 M' l xchg bx, es:[41h*4+2]
P2 B, R7 r/ W2 e. T# {9 W9 H cmp ax, 0f386h
( R! w2 g6 H. H7 ~" U jz SoftICE_detected
& o# @( \% n) u" {, Z/ z$ t; U! c7 n& f1 j; \
int41handler2 PROC+ L+ l& z0 R' ]$ }
iret
2 ]2 o- w+ m8 Z& K9 N" Vint41handler2 ENDP
; z3 v3 K% b: S
9 N2 I6 n( w6 \, H8 X8 F
0 ^ J, p5 b3 P6 x0 x( \_________________________________________________________________________$ H' k+ ~2 S9 \, M6 `2 N2 F
7 ^3 L8 _" l8 D$ [7 D9 ~
$ E. G2 [0 U2 T. C) T* U9 `Method 06
% D/ h) X2 l; E5 z8 i! i+ v# q& G5 C0 Y=========
+ M' P, C" U F, E) Z: i h4 I4 {7 m; }' A8 F, Y( |" D( O2 Y* I3 p
$ W+ e& m: _! B. d6 \! w
2nd method similar to the preceding one but more difficult to detect:% k: d* @) H6 M
2 M8 }+ C7 o- l! c. S
5 }: r8 k4 o2 [7 Hint41handler PROC
2 n w3 o$ N4 u2 O mov cl,al
" l3 f& B% M$ M0 A' s iret1 O% ]- N* ~' P" X& }! L
int41handler ENDP6 i7 u; a3 `3 B$ m7 B. u
* \+ y6 j* P, y a
$ N7 h3 u2 d3 Q xor ax,ax
, h: ^6 ]4 T6 ?: E E5 ] mov es,ax
- A3 [5 F0 ]4 k& F1 z V mov bx, cs
8 I' M4 t, l% H! U) O lea dx, int41handler& X% F+ s' ^% {8 ?
xchg dx, es:[41h*4]& n6 j& F, ]8 a5 I9 F$ o
xchg bx, es:[41h*4+2], F' y: J3 _: _7 S$ w
in al, 40h
7 c( k8 k; _2 F xor cx,cx/ }) D3 |9 L" w9 S
int 41h
- @. b: o8 Z0 ], u2 ~' u( X xchg dx, es:[41h*4]
# j! u5 D0 s* X6 O xchg bx, es:[41h*4+2]
: b. h* g! l. s! T cmp cl,al8 }- O! e7 g0 `2 t- f/ ~
jnz SoftICE_detected
& e5 l, L0 Q( b% q+ T$ }' J3 q* b' h8 n) G
_________________________________________________________________________
; ^) {4 f; j2 `/ I5 L @! b3 V- F' h! \. `
Method 07
, P G( F3 P% t6 {=========
8 A! w4 { B8 v9 j) w( s
8 v" x; i: p. r+ J5 RMethod of detection of the WinICE handler in the int68h (V86)% Y" M. B6 D0 R, q. I- T
$ }3 P8 d" h& T# G0 {5 O5 { mov ah,43h' v5 d. k' ^! `, s# C) z
int 68h
7 |& V1 E# K( B cmp ax,0F386h8 E% y2 O' v! ~! l4 e& Y
jz SoftICE_Detected# ^& e$ h$ ~* U/ l; r
' _+ z. {' `) Z9 T+ I6 L, m7 @
0 N' m( O3 I( V! v5 N=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit" l; v$ ?7 j6 f6 Z: ~% b( p
app like this:
5 P/ h( D! z' P8 j3 ~6 ?7 I6 @1 q N* b& r
BPX exec_int if ax==68
7 M5 X# t* ^+ r1 \0 V" W2 ? (function called is located at byte ptr [ebp+1Dh] and client eip is
, `; f8 l. q' [* H2 S0 {3 v located at [ebp+48h] for 32Bit apps)6 i( u0 V% v& Q2 f
__________________________________________________________________________
( ~( ~- J3 h6 K, f% [% I' I2 @( w0 o: V& `6 Y3 t
) b" O$ S- N7 {Method 08+ m# l7 D; Z- Z
=========
- K1 c! ?7 s# C" H: r! E n0 S3 h% G4 h3 Y
It is not a method of detection of SoftICE but a possibility to crash the
/ @+ u' Y4 j+ i# l# N- Isystem by intercepting int 01h and int 03h and redirecting them to another1 @& `% z4 N0 x, U- t. _& `
routine.: s! F1 x- ~# E; O+ z
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( Q. m* |( e+ tto the new routine to execute (hangs computer...)
0 T1 A! r- M- |: ]9 i. E: ]9 q @: Z' }4 Z1 Z
mov ah, 25h
9 G$ y9 ~3 ]- T2 q+ S: B mov al, Int_Number (01h or 03h)
# x" e" O4 _6 s# ^8 @ mov dx, offset New_Int_Routine
. k x4 B( S1 v5 {. _$ F- f int 21h
- T% b$ j5 y! [1 _0 c' }" b* T+ Z: y" c* P* f8 Y9 T$ D
__________________________________________________________________________
3 d* a- M$ d5 g: c* U# y' E: d# C' h' \- d2 k
Method 09
& f' W6 j$ j% H/ P$ w( c=========) ~# Q' f3 H: s8 D* \4 W0 o
& [8 V+ i" y# D& W
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 g! S0 \0 K! m
performed in ring0 (VxD or a ring3 app using the VxdCall).
& a8 V! l, t& F! U+ U: g; jThe Get_DDB service is used to determine whether or not a VxD is installed, n$ v( |0 ?( d4 O" `
for the specified device and returns a Device Description Block (in ecx) for
' ]2 W+ S, I( j- f$ R3 p+ v, u# cthat device if it is installed.# P) n8 A2 ~* n9 k6 h9 t: V% R
& O3 t4 S/ J m mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) x$ z! @5 A9 c: h& |7 m mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% s8 ~6 E3 \2 ~3 h0 s VMMCall Get_DDB
$ B4 ^2 P) {/ `1 N1 i! ] mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 v6 a" j7 F/ u4 n# C! G, Z( P: g3 _4 W+ e1 l- ~
Note as well that you can easily detect this method with SoftICE:
7 b( s: J2 v" n+ p9 K bpx Get_DDB if ax==0202 || ax==7a5fh
+ E' P. x, a+ A6 c4 W- z0 X3 `' T* b) l, t7 ^1 |
__________________________________________________________________________
" B- r9 m- G+ a" o0 D6 \! B
' l5 C% U* U! m W' t+ AMethod 10
6 ^1 R0 |( B! \8 `; f- N=========
+ @" h4 L1 v* u6 I$ @ o( a. k
/ ^4 b- ~$ F6 }" f=>Disable or clear breakpoints before using this feature. DO NOT trace with. w- g/ l+ T1 y) }5 g7 r
SoftICE while the option is enable!!
$ v8 ~: Z' @0 N! v+ q
9 i" b5 Y) M4 `$ Z0 ZThis trick is very efficient:. h" M$ e# k+ m4 S
by checking the Debug Registers, you can detect if SoftICE is loaded
# n, r8 ]1 R0 L- d(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 q% M8 y- w, @8 [
there are some memory breakpoints set (dr0 to dr3) simply by reading their( P0 H( T0 [( Y7 T2 x H
value (in ring0 only). Values can be manipulated and or changed as well" K+ Y! Q$ D! @3 W
(clearing BPMs for instance)$ |6 P% `/ g9 y. s/ Y# X) }
4 |, k# N# G. J' h9 f" r1 D__________________________________________________________________________
4 }) h4 v/ U# G% }: f3 ^& ]9 p
/ m2 H* P- g7 E& @Method 11$ G- ^3 t( Q& s
=========' p( H4 l# N% R! s9 \
7 g( G M. O( ~" t1 [This method is most known as 'MeltICE' because it has been freely distributed* |3 ^7 A% @% D% e) X; T
via www.winfiles.com. However it was first used by NuMega people to allow; R# C& p- T; g4 }( |+ K, o; u
Symbol Loader to check if SoftICE was active or not (the code is located5 j+ N9 m7 o( ?2 \4 p
inside nmtrans.dll).
4 G4 {, t8 Z5 T/ U5 T6 F' X
/ T3 I1 ~6 q) E2 @& IThe way it works is very simple:
+ ~' h$ H9 N, J% N5 cIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 U8 }3 O: ]3 A
WinNT) with the CreateFileA API.4 a' p8 Y: Y0 a+ w
/ h2 B1 |$ M+ X: \# l
Here is a sample (checking for 'SICE'):5 b5 ?" q; ~% O9 A$ h# O7 N8 N3 u4 S& F
# g" j; C& g! O- lBOOL IsSoftIce95Loaded()6 h/ b& o0 U" K! E1 N l! f$ i
{8 Q c, q' X0 ?1 E& {
HANDLE hFile;
1 K# T$ |4 f( m hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
/ ~: C0 P! M- m! n FILE_SHARE_READ | FILE_SHARE_WRITE,& M. O+ \( f% \ ?4 e
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ q, P9 Z) o- ~5 |4 o0 S if( hFile != INVALID_HANDLE_VALUE )
3 `6 W, |" _0 H {1 `7 F: s6 u0 J* X$ c2 Q: q
CloseHandle(hFile);
' b# A. C/ L$ F* Y return TRUE;5 }) w& U& q v9 h7 B
}8 O9 e$ @6 Y4 u* _
return FALSE;
8 c; ~+ ~. c0 ~% l5 u! \7 ^2 |}1 Z' ?5 L7 f# [# }8 a( ^9 d
: q/ Z6 a3 U0 W" a$ I# L. Y+ I& AAlthough this trick calls the CreateFileA function, don't even expect to be
6 M; o! ~4 ^( z( }: m' l; r: @able to intercept it by installing a IFS hook: it will not work, no way!
' l X8 s& l) P8 H0 h6 lIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
w2 z' v$ n" K3 r9 Iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); T0 B& a& o V* e
and then browse the DDB list until it find the VxD and its DDB_Control_Proc( e$ A1 r+ x: z8 ^3 s# ~
field.9 I0 t( {, @8 ^% r
In fact, its purpose is not to load/unload VxDs but only to send a % B: G" N2 @( Z, R/ q( c# Q7 P
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)% ^' A7 u7 K6 B% w- ]
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# m( F" q. [: f" Fto load/unload a non-dynamically loadable driver such as SoftICE ;-).
- }5 y: R- a" f& l9 Z) EIf the VxD is loaded, it will always clear eax and the Carry flag to allow7 _* g' c) F. \3 \5 q% K# m4 i
its handle to be opened and then, will be detected.$ M7 y" V, E7 b2 c
You can check that simply by hooking Winice.exe control proc entry point- o" u' W5 {& o5 j( l# e) j
while running MeltICE.$ i5 r9 d; u; W4 Z) k' D% e. {' ]
$ N3 {( @( s5 x( n: R& p
3 G) N) B$ G! @
00401067: push 00402025 ; \\.\SICE
3 u' ^8 `# g2 B- I: a; N: O 0040106C: call CreateFileA
0 m+ [8 d5 i1 u5 D: X7 e7 J 00401071: cmp eax,-001' p. t# n& L0 b" ] ]; W+ d5 _
00401074: je 00401091
; w1 \5 Q' }+ X! k. t% w, Z. K- F
* u: Z; |1 k7 b& Q0 FThere could be hundreds of BPX you could use to detect this trick.2 Z, ?) h$ z1 G0 p. F
-The most classical one is:3 Z3 t6 b+ j- ^4 \' R/ O
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 V. u! G7 A6 q7 p& \ *(esp->4+4)=='NTIC'
: k/ x) G& x$ o g# X; x8 U! I/ U( e5 ^; T5 _! V- j
-The most exotic ones (could be very slooooow :-(; p) f) {$ a& Z1 Z/ M! I v0 ?
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) z% N: W2 Y8 t7 t t8 J
;will break 3 times :-($ N( R. A" j) A
1 F4 N8 u. O. ?. o-or (a bit) faster:
$ C. x0 f2 O/ x* d* ~5 d' v BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' a) ~. E% Z u% P' H& @5 I
& K- t0 g; r) g! ^: @ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
2 I3 r! y9 x6 |5 U. b; k, z ;will break 3 times :-(
5 P3 Q) r9 h9 l8 ~2 d( k8 @# L* N9 d, x, P2 v' k+ q$ n" o
-Much faster:
6 Z/ g" x3 j; N3 y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'$ t3 k. w: R8 ]( [/ f$ O
! {, M" m& X( `" s" yNote also that some programs (like AZPR3.00) use de old 16-bit _lopen7 ~; t9 t: p- c, h0 V
function to do the same job:" v. Y+ r' R- f i1 b; L, c' p
& S. J" l4 y+ g push 00 ; OF_READ
+ `: `6 z w' h6 K" ~! d$ d mov eax,[00656634] ; '\\.\SICE',0
7 n" ~3 J! B- g: d* N, T push eax3 g J2 w3 Z6 ]/ K
call KERNEL32!_lopen0 Y/ e' ~; _% c/ n
inc eax
. H8 ]7 K9 T1 A jnz 00650589 ; detected4 k6 ?- Z: B$ r( j
push 00 ; OF_READ
9 M- t. p! R7 i, D2 Y mov eax,[00656638] ; '\\.\SICE'& v2 Z& K& M/ \9 a
push eax8 z7 B# X8 I; e% X- {
call KERNEL32!_lopen* Q' F1 {, r/ |
inc eax
$ X, b" p4 U* a# x2 t3 L jz 006505ae ; not detected
) v* [; R R! l# P! i7 I7 w8 y# u6 k# H
" K/ I6 a- n4 @* E4 [* A__________________________________________________________________________1 _# U. m1 R; }( X1 ~# j
3 _/ b! u* k9 P) @1 i6 L0 ?& I
Method 12
! N- A9 g2 g3 U1 Q7 N6 L=========; }6 E) L5 e7 F R8 n
( B: ]& \9 i( E- e1 ~This trick is similar to int41h/4fh Debugger installation check (code 05) ?1 ?" T' S5 @
& 06) but very limited because it's only available for Win95/98 (not NT). w& r, V3 C% E; y3 f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% ^; I1 o; L6 a$ e
+ p; f6 ?6 b% f$ o! E push 0000004fh ; function 4fh; i8 a7 |0 b6 ]3 m2 \
push 002a002ah ; high word specifies which VxD (VWIN32)# Y* z- f, P1 _& p% N0 O* Z
; low word specifies which service
`2 O# f( \' m* }% J) N Q' M (VWIN32_Int41Dispatch)
) U" {8 {3 j( ^. Y6 e call Kernel32!ORD_001 ; VxdCall
$ ~' r6 ~+ R3 d) ]' G; V( _% Z cmp ax, 0f386h ; magic number returned by system debuggers
& o! z7 O" A* I8 I; g }" i jz SoftICE_detected
3 M* c0 l2 I: Y B
3 ?7 ?; Q1 ] k, K. gHere again, several ways to detect it:
4 R! ?: X* @9 w" a P8 w s7 g* b! H# m: Y
BPINT 41 if ax==4f
0 ?, p, u4 |' ]* V* v, N/ D! b) W
) d- N: D7 T+ l6 s7 V+ B BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
( C# }) Q( x* b! \% w, ^8 D7 c
! c1 y& z- D2 K9 [ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# ^ k" B) j1 u* g3 e; v
+ v8 V% J- L7 i% |# m8 F/ x; ^ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
3 j6 }8 G0 F) ?8 B1 X: A7 ~; C7 v+ L& W1 L) H) O
__________________________________________________________________________
3 S$ I& I+ X6 w4 y% t6 A' c! s) j* [8 Y5 T* ~$ A) j& E: S
Method 13
0 w6 o3 M; u0 ` R8 k% R) n=========2 r3 z# b6 a' a& O- K4 h
, L' x+ d& ?: S& M% m V
Not a real method of detection, but a good way to know if SoftICE is
- O. ]& p4 _9 y6 R/ u& N- Vinstalled on a computer and to locate its installation directory.$ i6 g8 l0 \: B! f1 O2 j
It is used by few softs which access the following registry keys (usually #2) :: b( G& ^# m' S0 C# I) _8 n
8 M, v7 B7 Z* |0 \9 K4 [1 ~
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 ?2 O$ Y* s# E" A) }" y9 u/ G+ i\Uninstall\SoftICE
! j! i; S/ E# L& P% e% i! m-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE p8 B7 R2 F6 R! [6 W2 V/ }
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 `) o: I9 }0 F* L- J6 T( X) |\App Paths\Loader32.Exe- s0 q% w# _6 e7 @0 m9 T8 H3 S8 g% z
" u2 j* Y1 ^+ U. G' U. F
- _4 |) H- b, j5 p+ j
Note that some nasty apps could then erase all files from SoftICE directory
$ U) m2 v0 q/ z+ P' @ f% H% N(I faced that once :-(
. s- d7 A6 `9 ?, a n A& l, K
$ J1 \7 }! _, v. y: ]" _5 bUseful breakpoint to detect it:7 z7 P: _" W7 V/ s* D- E
5 H' |6 k5 l" E" d1 ]/ U2 S
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
`3 T. f$ p7 W D+ b+ _3 ^, j) u7 N: k" ~2 N$ n! |/ I
__________________________________________________________________________
9 n! Z V" k9 ~4 \% z# M: M: o- R [1 T
* o$ F, [0 v: f/ |- ^$ v# o
Method 14
/ A. E1 e) Q, x' B$ A/ ]=========& ^% w4 ]5 \( ^& g1 b8 l
7 o" o: {+ l! n) P# \A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- U9 {, J/ L: @8 R' {, }is to determines whether a debugger is running on your system (ring0 only).
( Z2 j& ?" ^& P3 a2 v) y: p
+ p$ B6 q) W4 j+ ~# \, X6 E7 ^! p( y VMMCall Test_Debug_Installed
0 U, a- [& ]! S0 E: a je not_installed
# ]- `6 |2 o( A3 Q' V7 O
0 p8 n* V O' {; t9 ~ [0 f' WThis service just checks a flag.
# [2 t1 F {" L7 E% V) C9 j9 M</PRE></TD></TR></TBODY></TABLE> |