<TABLE width=500>& M1 Y. L/ ~4 @/ Q7 `; i9 ~0 ~/ _" `( L
<TBODY>
2 d5 f1 `& u! ^* O<TR>' Y9 v. w1 x6 v! I. N& X/ e0 X
<TD><PRE>Method 01
- E7 f7 m6 y7 L=========. @2 ]3 g: h6 q. k
1 D" w' a, b, X0 Q
This method of detection of SoftICE (as well as the following one) is
/ `+ y" o) X* [used by the majority of packers/encryptors found on Internet.# J" b9 r+ k4 f: C6 J
It seeks the signature of BoundsChecker in SoftICE
2 _" @* w" p) d0 W5 H6 _6 T& Q- H
7 C8 b7 g$ Z' {0 y' I8 | mov ebp, 04243484Bh ; 'BCHK'
- t2 B3 G5 _/ J, y9 H M/ v mov ax, 04h
: U( T" b" f+ I5 F6 G int 3
4 s) N7 e" d r: `1 { cmp al,4" r% X1 W) D( j
jnz SoftICE_Detected
S# m) `5 f6 u' ]) O( C% m, ?/ r6 W0 p C) d
___________________________________________________________________________
+ ^" |; K& u7 S, I& ?" S' V2 P1 s# c+ ?+ a; P9 L( r
Method 02 {" H3 l7 i1 z' b* R
=========1 M+ m# Y% y4 K, v
* R) _: l/ b4 @9 }! S6 h
Still a method very much used (perhaps the most frequent one). It is used8 [9 U( o0 o$ E, |0 M$ I$ P3 g
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,% f6 Z- {- ~/ t3 K, @8 \, Z
or execute SoftICE commands...9 d2 T2 j+ \3 y, }# n# Q; r! r8 z
It is also used to crash SoftICE and to force it to execute any commands6 T6 s; ~) G' ^
(HBOOT...) :-((
: h, [; u8 I3 l. o0 x' T# q W0 P' j0 T" B- N& k' L& h- r
Here is a quick description:8 Y% x! r1 W# N m7 c$ |3 i
-AX = 0910h (Display string in SIce windows)
# B4 c' r# o" l0 o+ r, R-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' a* l) t. h+ @3 Y- s
-AX = 0912h (Get breakpoint infos)/ C: d) {( [. E d
-AX = 0913h (Set Sice breakpoints)
! N& A/ x3 @! N-AX = 0914h (Remove SIce breakoints)& V6 p& Z) x4 R
# w8 X7 J# D" C5 b
Each time you'll meet this trick, you'll see:
7 i7 O# z: g1 m: a3 }- f; g4 ?-SI = 4647h; ?4 M% V: ~- J4 v2 _9 E6 `4 h
-DI = 4A4Dh, t% T& W) s& w! ]# r, L
Which are the 'magic values' used by SoftIce.9 o. K6 o* y- J; q0 L
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.- e9 b0 H* u2 e" }- x0 ^
: k# p7 e: B& K+ BHere is one example from the file "Haspinst.exe" which is the dongle HASP
$ i8 W( d4 O* N: ?4 w* @5 KEnvelope utility use to protect DOS applications:
# T. P9 e' a7 U" w
7 J/ _3 c; U$ c+ d8 ]+ W4 B( M
$ E+ L5 l. o6 k& o, p2 Q* t- ~4C19:0095 MOV AX,0911 ; execute command.+ S7 l" `! ~4 l/ G: M% s
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' l% y [! r) ?/ H0 u; V& V
4C19:009A MOV SI,4647 ; 1st magic value.+ z6 b- N+ q: R5 C8 w/ v+ I* M. [
4C19:009D MOV DI,4A4D ; 2nd magic value.# ~" b8 ]' w8 N1 Z6 O2 x v
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*) P2 ^" |- H3 H, k# _2 g
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% Z7 x% X4 @: w/ v/ N0 ?+ _6 b Z& \4 t
4C19:00A4 INC CX
) ^ c% z* N& I* N; Q. O4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
) l: i) H+ X( Y2 m4 _% G9 \4C19:00A8 JB 0095 ; 6 different commands.( N: |$ T/ a [2 M2 W+ j" `8 g
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! u0 c0 B5 |! t# d* f4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" E* S8 k2 q# J* M
: C2 `0 F. t; z- \ ~# a) eThe program will execute 6 different SIce commands located at ds:dx, which
& A4 f \2 X" D0 care: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& Z7 N/ E) G6 R. d! E: G) y
1 e0 U4 D" b% g* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 Y$ u3 K' k, ?8 d0 Q
___________________________________________________________________________
! Y p, e8 @$ M% {. e; X B5 Z0 ^% k
+ W* }6 M1 v' m, D. w, C
Method 03- w. w: l* u/ e$ S
=========* j3 m* z# s3 ?& A- k
V& t* ~; o" c& R- U$ O
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
+ L9 M" g3 Z @* p# _: X(API Get entry point)
# C7 ?( n, X. ]6 ]" }
$ L+ Y4 z) x9 V, v9 @& ]$ x; d, f1 W2 L6 W
xor di,di9 J+ J& `. `0 y9 q$ B
mov es,di
5 q6 f8 H9 {4 \! p& b, j mov ax, 1684h : {& s. k- P! C3 m$ W. I; G
mov bx, 0202h ; VxD ID of winice
. G5 E* ~. L7 U8 k6 C3 \5 U4 @ int 2Fh0 |& Z3 [+ n9 b8 O' _, u
mov ax, es ; ES:DI -> VxD API entry point
" y; v' L4 q! \. v9 H9 r add ax, di
0 Q6 Q8 s- K; [9 z test ax,ax
E( S( o3 [& F# Q3 ^; g jnz SoftICE_Detected3 @6 Q# d! E% P9 M' _
+ G, j! r# x* X; I* |! b. p
___________________________________________________________________________# l! e8 J+ D% W, l3 b& ~ j( u0 [7 m
% K4 }) k( b7 U0 i, x- K( c7 rMethod 04& [4 l2 {& A( @4 p" P
=========) g1 e3 q/ t2 W8 F
) i9 T9 V9 H% T y T
Method identical to the preceding one except that it seeks the ID of SoftICE9 s. U r2 r& b4 j: e
GFX VxD. I |/ O" q% B& Q' |: j
0 \0 @ q) |# `" ~7 e9 C2 F xor di,di
6 F5 t6 t3 P4 Q) l/ e3 a mov es,di3 L0 m! ]) C. `# \4 h
mov ax, 1684h
, c. A1 }( ]" ^3 l Y mov bx, 7a5Fh ; VxD ID of SIWVID
3 e$ E# P/ Q6 L5 W' ^0 L* n int 2fh! ~$ n) ~) a0 t; a1 V5 n
mov ax, es ; ES:DI -> VxD API entry point8 o8 M# ? n1 f, w3 x
add ax, di; I; w: y/ L0 R
test ax,ax( B. [* `! ?' H9 Z0 Q6 W0 d: {
jnz SoftICE_Detected
0 |3 v" i( `$ I5 C
7 g% x) U8 u" {! u7 P0 C S__________________________________________________________________________
: G3 [- m* [2 [! O4 f9 E" _% A6 H0 _+ x1 a9 U+ J ^
1 n: A0 L" Z0 `& @$ HMethod 05
' @) b1 H8 t% ?1 X2 r=========4 ]3 b, {4 l9 p$ O/ k* J7 ]3 q7 _
) r+ o6 y9 E# K+ K" d
Method seeking the 'magic number' 0F386h returned (in ax) by all system
, i/ s) |9 G @4 A+ i* }debugger. It calls the int 41h, function 4Fh.
7 ?! u( l/ O D7 R% HThere are several alternatives.
Q* s7 p' D4 v3 k8 I
) U4 x7 [, V1 N! MThe following one is the simplest:
9 Q) h7 z( S4 K; A' u, h5 I7 _- L! \! ~
mov ax,4fh: N+ b1 X& l4 j F6 V& C
int 41h
0 K1 T! @" ? F5 v+ S- ]2 i# | cmp ax, 0F386
1 Y- e" G1 R- ^ jz SoftICE_detected
3 \7 N- r. l2 M% Q- T& p$ s- v6 R! O2 ]1 n0 [" U3 i" a
1 \) Z( c' Q7 ~: [! R7 |
Next method as well as the following one are 2 examples from Stone's ) N/ M0 y1 f- }% X( ] w3 {% t+ V- L
"stn-wid.zip" (www.cracking.net):
6 H9 Y" F% U# a* s8 I* _3 ]
6 h* i" r' E: J9 S5 E/ L: z# [ mov bx, cs
' E9 u1 |- H! o5 F; n4 [" N lea dx, int41handler26 W7 }9 q$ t e- y g+ e8 g
xchg dx, es:[41h*4]
1 d( k( L2 G; X5 `8 B xchg bx, es:[41h*4+2]
- p% S- ~ J# e/ @ mov ax,4fh
0 X8 W* w; p# L. D int 41h( ?5 M7 o" k' }5 Y0 {) I* d4 D
xchg dx, es:[41h*4]( c) @ n1 e* o+ v- e B& f' k) c7 G
xchg bx, es:[41h*4+2]! F) y$ s8 e2 W q$ Q$ {
cmp ax, 0f386h
( A: ^, q' } ]9 k" I4 K jz SoftICE_detected
5 o |* @* U. x9 Z# \
* }1 A) g9 a' ]; R/ K; z" [4 Sint41handler2 PROC2 h/ z# j! K& y' e/ k: U K
iret
) m3 N# Y& r. D: P5 Dint41handler2 ENDP+ `8 W6 @3 x0 Y( P
) g3 [# t" ]. x3 E
+ h7 N Y5 J h5 U_________________________________________________________________________; \4 g H# b( q4 F3 K( U
# ]) e6 c$ _# o1 D4 c! S+ u4 w& P
- ]2 Y& X. }! T: I' C& y7 k
Method 069 o& F! b! Q0 @6 V
=========
4 W7 E) d( T9 Q, O1 @2 ]: ?8 m. \: s' Q) f2 u
- _& @0 J! L, r# i9 K% e3 i1 d6 h2nd method similar to the preceding one but more difficult to detect:
' ~3 l1 `# E: `
4 N1 ?' M" s5 |
$ g% t) q4 R3 Y7 D0 Fint41handler PROC
- R; _# t2 x8 m7 I0 T mov cl,al
: S/ U# A7 ^$ | {. V) q p iret
( A$ ~# a' W$ W! e ?0 k' ], @int41handler ENDP
7 @6 e) r9 L7 \& ~ t% a5 W) `8 M8 q( W
7 P0 J" x2 _& Y3 M% A xor ax,ax
* h/ j# ]. n) R: h6 P9 t2 R mov es,ax4 X5 [4 L5 u& ~0 \: A6 y
mov bx, cs
1 S Y( r+ R8 ]% q+ ~8 F lea dx, int41handler. _4 Y4 R% Z% t+ L% d+ q) p
xchg dx, es:[41h*4] l7 k4 b& D9 @
xchg bx, es:[41h*4+2]9 H: O0 s$ Q2 e& w5 J, a" o: m
in al, 40h
+ H0 X) x( V2 a1 y z& Q' v! N xor cx,cx. p% w/ l# C) ]
int 41h6 E" V7 X3 f. H
xchg dx, es:[41h*4]# |" x) [ _# j2 t Z [
xchg bx, es:[41h*4+2]
7 ?) _* B2 ]: s- S4 S* i cmp cl,al0 x$ `) C6 x# v' g
jnz SoftICE_detected* j1 i5 s/ l% \% v: b) ?1 E
f [) I3 E6 e, E5 Q Z0 U_________________________________________________________________________
+ H2 q: o7 N9 h
. X* {: f7 P4 m- @7 vMethod 07
3 p6 t3 @" S' J; C$ o6 g' l=========
% k9 _& |: B* Y# p- b( `9 {. X5 y/ ^- i/ v w
Method of detection of the WinICE handler in the int68h (V86)
1 o4 U6 v% F7 f5 Q4 {0 \+ }: d, ]+ I$ y+ h: ^8 e
mov ah,43h
" l8 O% g$ A* S' A! [+ Q3 V int 68h
6 r( z4 O' H U* W6 W cmp ax,0F386h
% h7 H- a$ O0 s2 C6 _" Y jz SoftICE_Detected7 i( Z+ ~% O+ o8 n! F8 p$ F, ^
! K* f/ ^4 D v2 ?5 A8 T; n' p
1 {9 C( G9 {% d3 b6 B=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ F* U. `) T; W! y9 E* t5 n0 P
app like this:+ R' h, I2 F" ~# ?6 ?% h1 r
% Z2 ?3 ?# |8 P, I- ^ BPX exec_int if ax==68
6 x% D, K! A! s+ C+ z: l; ?& E (function called is located at byte ptr [ebp+1Dh] and client eip is4 P$ e+ ]9 p: o" w; z
located at [ebp+48h] for 32Bit apps)- b; T1 K' R- o
__________________________________________________________________________% T7 y& q [: F9 N
% P" s/ C7 r+ I8 R* u6 |8 t7 H; O* Z5 i( v7 r, Y8 G, u" A2 Z0 @
Method 08
$ W7 V1 M- X! ^9 @* a4 z=========
% y2 p. I1 u9 z. Y1 R
. N/ X: q1 e! c/ }$ yIt is not a method of detection of SoftICE but a possibility to crash the
% b! f) Y! T! q9 Wsystem by intercepting int 01h and int 03h and redirecting them to another
3 S- U& y* I( `7 S4 Eroutine.
# h$ y& r4 u4 c1 r# D0 F5 gIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 R: k: E$ y9 ^to the new routine to execute (hangs computer...)& U L' l3 n* k, Z2 Z
$ k/ L: Q1 h2 v8 ^ B7 G mov ah, 25h Z0 S4 ?' A- C8 }4 d8 j: l2 z5 C1 l
mov al, Int_Number (01h or 03h), |0 f+ i, _8 z: Q$ e' \
mov dx, offset New_Int_Routine9 Y, y9 D, [/ c3 W
int 21h4 [7 W& X$ F: ~
: f, i0 c* e1 H# C0 ?/ F) X% J. B__________________________________________________________________________- z+ N0 E+ u9 [
# `6 H% W- j) v, z2 c) A Y. v8 `5 ZMethod 091 X$ m- \" |/ O( M) ~8 o
=========" b- }8 n9 d2 R* n- i- o
2 q' C2 J9 Z; z/ ^3 }& n2 H, G
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" C! Q4 N" M( Y& sperformed in ring0 (VxD or a ring3 app using the VxdCall).
% D' S$ [" x& ?! eThe Get_DDB service is used to determine whether or not a VxD is installed
) B" \0 C4 D% w; efor the specified device and returns a Device Description Block (in ecx) for
# }7 T' |4 a* q, z5 s+ othat device if it is installed./ b" E$ E* M9 y9 @( l z+ O% t8 G
& [! `/ v$ { ~) `7 } mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- S4 k ?6 T: [) k; J2 j
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: n- D$ Z- z* r5 j0 I VMMCall Get_DDB7 d8 j! E) |: a! I# D! q( `6 b
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed7 Y+ E1 l4 p4 l
: c0 E0 I. k1 x7 d+ tNote as well that you can easily detect this method with SoftICE:
* x- L7 O/ }* F- C* b) n bpx Get_DDB if ax==0202 || ax==7a5fh
& k. @9 [) a! } b( l- c8 U" [( Y& k' P' x7 _5 I% |: s
__________________________________________________________________________
# C+ |% I3 @1 }1 n* }3 ]
: H; w6 J* `6 WMethod 10
4 ^$ _( I8 Z7 ?) C9 v9 _=========8 S& O. ^4 i% d& c: @" _
) q, Q$ J) @4 B) G=>Disable or clear breakpoints before using this feature. DO NOT trace with' u7 Y( d7 Z, {! w F/ j
SoftICE while the option is enable!!
0 U$ a: | }2 x9 y) s, y& M7 J6 G& O+ [0 i1 u! j6 a
This trick is very efficient:- `. o/ M; ^; \. @ @
by checking the Debug Registers, you can detect if SoftICE is loaded- X; N5 p. `, f3 h
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
3 [8 E$ M- p$ W( Pthere are some memory breakpoints set (dr0 to dr3) simply by reading their4 D7 `/ y* O1 A- |# I
value (in ring0 only). Values can be manipulated and or changed as well0 |/ |5 @7 N0 I' o
(clearing BPMs for instance)6 a8 \; i+ o% J' K( n9 [7 _
* ^ t: _% b" m; T* f( `" e& T
__________________________________________________________________________
* k* w) Y% a" s& x' G) b' { v y; L8 P5 T& b0 i: t) Z
Method 11
0 y; m$ z0 ?; U========= m" P9 ^4 G. }1 k, a
\' _) g6 @$ ?
This method is most known as 'MeltICE' because it has been freely distributed
# [: Z+ \( }2 k/ n4 svia www.winfiles.com. However it was first used by NuMega people to allow1 r0 W9 A/ J- w& L S
Symbol Loader to check if SoftICE was active or not (the code is located s0 v% Q! Y* T8 k; g$ o
inside nmtrans.dll).- i+ ^$ p! r2 ~- Y- {1 S
! l" Q( [1 S7 ?9 f' {! a5 S
The way it works is very simple:
7 T: o2 z; ]8 _) z MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
3 x4 [6 S* q- g! \7 W; iWinNT) with the CreateFileA API.
, j3 e6 Z* C0 o" a8 w, i% z
! D* X2 v e5 S9 }Here is a sample (checking for 'SICE'):
7 [1 T' T: G# x% k( }0 v& V6 U
$ w& O+ ~5 \6 f# ~BOOL IsSoftIce95Loaded()3 M; F* N& ^, `
{! M' t3 u, D+ o
HANDLE hFile;
% G) f* S0 {% ?. v$ }5 M hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 h4 I& ~$ x5 c* `0 K/ ]
FILE_SHARE_READ | FILE_SHARE_WRITE,
2 C% j; k2 g% m NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 u1 _' ]- |0 h
if( hFile != INVALID_HANDLE_VALUE )/ M5 l- @- R' W4 H4 P1 h- k
{
- r' Y- r& n% H* W/ g, Y( k" | CloseHandle(hFile);
# q% Z3 o2 t9 d: Q return TRUE;+ C' I- @+ Y2 O1 V: ]- @
}
/ U: }( Q$ o- \1 I/ N# v8 h return FALSE;9 ^% K1 e. F6 \ H3 j
}; K3 E8 o+ Q% A2 C/ X
, A( i3 F Y/ {; o
Although this trick calls the CreateFileA function, don't even expect to be
" S! J2 v) v- Q- _# S& Q: L5 Fable to intercept it by installing a IFS hook: it will not work, no way!9 ^+ M$ ]; q/ S, w9 d
In fact, after the call to CreateFileA it will get through VWIN32 0x001F# G6 c/ R' D3 B8 v- L- T1 p5 A
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ b) e4 [: Y' H# \
and then browse the DDB list until it find the VxD and its DDB_Control_Proc c y% T- P2 o* m. A
field.+ h9 G2 i/ y8 l& ?1 J$ u) q6 d% v& P
In fact, its purpose is not to load/unload VxDs but only to send a 8 V8 W) {$ K8 P) W% r
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
4 y' e7 V7 b. eto the VxD Control_Dispatch proc (how the hell a shareware soft could try& \8 _4 r3 K4 @; S- i0 O w
to load/unload a non-dynamically loadable driver such as SoftICE ;-).: o% o( y2 k# A$ N
If the VxD is loaded, it will always clear eax and the Carry flag to allow) x! I' [; T' z
its handle to be opened and then, will be detected.
" P1 H7 _# {8 ~" C# n1 ~* @0 `You can check that simply by hooking Winice.exe control proc entry point6 l( y$ z( }1 J1 t4 L
while running MeltICE.
5 s t2 j( `1 r; X7 B4 l
' j+ `/ H. L+ b1 ^. N
" S6 V E, L- J. Q 00401067: push 00402025 ; \\.\SICE
, ~' E3 z2 ^+ n. t$ Z8 Y 0040106C: call CreateFileA) W. ~7 K1 S0 O# G/ v4 L5 ^
00401071: cmp eax,-001# I4 K8 O# t* |1 l5 d$ E4 c1 z4 t, ?
00401074: je 00401091
& u3 C# R4 m: g0 N- `% ^/ }8 Z( q# T# ^* l, t
6 ~3 }: W' m! p! R3 p' q# E. DThere could be hundreds of BPX you could use to detect this trick.& V3 O; n- H! g0 K% r4 J
-The most classical one is:
( I; i+ S v: s$ o- p8 b x7 V BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* o+ \8 Q* f3 q *(esp->4+4)=='NTIC'. E$ P4 I; x" _, [: {
2 [; W/ a& u: q1 j9 V: k8 Q! d
-The most exotic ones (could be very slooooow :-(
f' l$ e; l$ O. t$ `; C BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" r) k3 P; Y9 y: y3 K5 X ;will break 3 times :-(
, y6 m0 d/ N1 v7 U
, S4 C1 {9 d" u8 f# {-or (a bit) faster: 2 w3 m1 z) m5 H& B
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 F3 H6 X! X* R# M* z
7 w0 R* m$ |6 O$ k; [ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% [8 k; Y: f6 p& c: y ;will break 3 times :-(
0 q+ K* c/ G/ ^7 Q6 m9 |- u5 Q2 @ f$ s3 U
-Much faster:, O/ O, w& R1 G: E6 z9 G
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. ^4 D& X! t0 I" P2 k$ D- W
6 s0 r9 _; t0 y* N/ N- K
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: [- h* n% m; ]0 ?; Vfunction to do the same job:
6 a# p* f; V0 @6 L' x4 K: ]
2 Y0 K; ~0 |1 y2 x3 O" v push 00 ; OF_READ
8 O; p( @; V2 m! N2 J4 p6 K$ `9 T mov eax,[00656634] ; '\\.\SICE',0
; s/ I5 K, j; n2 h push eax
; T5 b4 k9 f( x call KERNEL32!_lopen' n; t5 B9 O7 Z! T( j. e
inc eax
7 W7 T3 f$ k' r3 c9 w/ K5 j jnz 00650589 ; detected
" h7 g9 N, u6 d1 h0 e5 K push 00 ; OF_READ
( d! D7 G2 ?/ D; J8 k mov eax,[00656638] ; '\\.\SICE'
' {% X5 g" n |. z push eax
7 Y- \2 b% @+ | call KERNEL32!_lopen# N7 D3 T' D, U% g
inc eax
8 `% P0 i" Z$ ?/ q jz 006505ae ; not detected
/ p/ ^% s% F. e. t" B1 q9 _( A# P, v3 t# L* J% l0 j
" [% d$ J0 K+ a# f; h L__________________________________________________________________________
& L) M1 z K5 S+ {* D6 e2 t, R5 [3 N* X2 N+ k/ K& X' [
Method 12- k/ |3 Q& u, _
=========
, k( x/ h* m. p7 b; U% z" L# o5 m) p+ ~( I
This trick is similar to int41h/4fh Debugger installation check (code 05/ [& R8 ?) D) x$ z }$ p; V
& 06) but very limited because it's only available for Win95/98 (not NT)6 E# D3 e3 P. k8 U+ `
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& O/ V4 `. j4 B! y) E# d9 R5 S
: l0 `. z# ?% v push 0000004fh ; function 4fh
; e6 U( U' M" k push 002a002ah ; high word specifies which VxD (VWIN32)
# m- I( C7 T. S ; low word specifies which service( ]+ }2 h/ T4 H) i
(VWIN32_Int41Dispatch). I# L3 M( q& R0 K1 q
call Kernel32!ORD_001 ; VxdCall
5 s1 ]8 @$ m2 g. I3 L* t( a' G cmp ax, 0f386h ; magic number returned by system debuggers
; ]0 V! Q% [( x% } jz SoftICE_detected& \* i! j/ ~( T- W$ S* {1 o3 J* j
/ c' [: o" P8 B$ \( F: c) uHere again, several ways to detect it:7 p( r, c) U- m% s, }# q
2 }/ Q$ x$ ^* o& B/ B V6 a+ Z' ^" v
BPINT 41 if ax==4f
+ T, `" J( k! K4 ?; ?' M1 U$ j: j2 m7 P! B
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ o; G; Z( P) ^; r
7 W2 [" u4 N5 b7 ` BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 T o3 h' m. U6 Z8 ^4 H6 }! Z; m
" E. N7 V, _6 l J [0 P+ p" z
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: R$ i" p* Y) F9 c2 D3 f0 x- d1 ?" w4 J6 b( F1 q; X9 W& c r1 A
__________________________________________________________________________+ y# S6 O2 @2 X. J. c
: q3 k2 h3 Y+ m6 oMethod 13; {/ _2 |" }, S& C5 R' _4 j
=========
+ w' }% r) t F$ a% h$ {& j9 s+ O j& H/ K7 D9 E
Not a real method of detection, but a good way to know if SoftICE is
! ]+ H2 i7 t" `1 n, a$ b* f3 o; E8 einstalled on a computer and to locate its installation directory.
1 q/ S$ \ c; `! V" f" I" ~! q8 `It is used by few softs which access the following registry keys (usually #2) :: O9 N) H0 D3 b# h
$ K5 J1 G o( d! q) t. w-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( c8 U3 k: {2 E- i. J; n& X& N% w\Uninstall\SoftICE) P0 d' [5 L, o0 b9 ~
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 a" g+ u. B# Y1 [8 g
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- ^' t+ |& R+ H& g, k\App Paths\Loader32.Exe
3 W) Y/ r+ t8 I' _/ r2 S2 E8 r% h7 F9 v" T/ L1 l; |
. h5 F2 t8 u) X
Note that some nasty apps could then erase all files from SoftICE directory0 I, j5 U2 z4 y. c
(I faced that once :-(
4 U. l6 ^/ l: M' _% B0 \1 R5 ?+ ^5 T1 l. F4 A0 v
Useful breakpoint to detect it:6 Z7 }$ o! t& W8 Q9 U$ J
$ u6 o. J3 E* C
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
# ]# g# e( b$ V# I' g# l. X8 X1 M# Z |4 s1 `% g
__________________________________________________________________________
8 k7 `2 h( ]; T; Y" s' ?1 o, @) L0 m9 h2 m! i
# X5 E- y: U5 ]& j" c( c
Method 14 % f* E9 H* ^ g0 H
=========. M$ f9 P2 I& l9 z+ S
) e% v3 t4 V6 Z$ W2 T$ `) nA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 j E, M. d% |
is to determines whether a debugger is running on your system (ring0 only).- t9 \8 S# s' Y
# b2 l) `6 B2 }5 W3 I
VMMCall Test_Debug_Installed
0 `0 V2 G) J, U, G% _+ \ je not_installed
5 J0 c& T7 Q6 p5 F$ k
8 Y" z! ~* h( X( A7 i+ oThis service just checks a flag.- |* D4 j: ^+ w7 g" ?
</PRE></TD></TR></TBODY></TABLE> |