<TABLE width=500>, Z4 D+ n, @$ p/ J. Z
<TBODY>5 {6 B2 o7 d. r" H0 y1 N
<TR>
8 b, i7 {6 p) v<TD><PRE>Method 01
$ ~$ _# m8 x# ?' z* ]=========! Y; x2 ~" [5 F3 _6 b
" x4 r: d. N( B/ rThis method of detection of SoftICE (as well as the following one) is8 C4 ]1 Z( g4 R" r. I [
used by the majority of packers/encryptors found on Internet., u7 s; e1 H# Q$ W F
It seeks the signature of BoundsChecker in SoftICE1 U+ e$ b+ x+ `$ |
" o; X! g" Z; D! W% R- m mov ebp, 04243484Bh ; 'BCHK'
& q9 k) o- O% J/ u mov ax, 04h1 s4 d5 ` h% K
int 3 , l7 ?# ]4 ]5 P' Q |3 u3 j: k
cmp al,4, I) O2 B5 o3 \
jnz SoftICE_Detected
B4 O/ h/ L- d R8 B0 K- J. _2 K. R
___________________________________________________________________________
' i2 }8 D: @" g' k
- W+ \+ m/ q0 S" J5 _. M, ~Method 02# @8 `: `( z* `( }4 ]
=========2 y2 [& z+ \ m, @* ?; }
. V6 j! _ q- F5 XStill a method very much used (perhaps the most frequent one). It is used- t& ]7 ^1 c7 c% b2 l9 ]
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 `. E0 R4 `5 [, Q. G) y5 M) d
or execute SoftICE commands..., c' T" X6 Y, _( s% g+ R
It is also used to crash SoftICE and to force it to execute any commands
/ T& r6 V7 v) r( q0 G' l(HBOOT...) :-((
1 V0 y% q3 m% |4 l# V& N
8 F, n5 n+ ^# ^' ZHere is a quick description:
: ?4 P. r! p6 T. j% f* x/ C-AX = 0910h (Display string in SIce windows)
$ w# N2 v& @$ t: {1 [0 `- X' J-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
/ i* @, T' D& l5 y$ P8 I- Z2 B-AX = 0912h (Get breakpoint infos)2 X) g; l" f% z* a- X" }
-AX = 0913h (Set Sice breakpoints)
/ I) }8 U, ^. M-AX = 0914h (Remove SIce breakoints)0 L) P( \/ Q: m2 r+ ~8 r( P
/ n# B4 {8 p- |8 @" j
Each time you'll meet this trick, you'll see:/ K; |5 D$ B7 G: S. M6 G! j9 g$ C0 H
-SI = 4647h
9 f+ W7 t, O3 r4 X( B! O-DI = 4A4Dh
. s9 ^2 x$ z) |. FWhich are the 'magic values' used by SoftIce.3 B9 |. S2 T; I u
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ f0 N2 B, E# A" p9 [/ W" O6 v0 I. G
Here is one example from the file "Haspinst.exe" which is the dongle HASP& t r# T! p$ G3 S% g
Envelope utility use to protect DOS applications:
: A' t, S' I# L2 Y# l
' W! ?7 v7 n% A9 l# Z( P6 N2 }: Y; }+ m
4C19:0095 MOV AX,0911 ; execute command.2 c8 Q/ @# V. C$ ?: Z
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).5 n9 L+ A+ r3 k* k, [7 p3 b+ z8 V4 h
4C19:009A MOV SI,4647 ; 1st magic value.+ b$ O3 r. i/ ~( H8 y# ^
4C19:009D MOV DI,4A4D ; 2nd magic value.
6 Z# m! ` m0 P6 {7 N' ?4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* f! o5 C. b6 | {+ ^# T$ r
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ K8 v, k; [4 i& g4 j5 v" H4C19:00A4 INC CX
6 f) N2 t+ g2 ]3 I2 |6 {6 Q4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 ~9 D% s5 m( l ~- m
4C19:00A8 JB 0095 ; 6 different commands.
9 t) C$ `) U( z9 ?: E/ ~9 ]" d4C19:00AA JMP 0002 ; Bad_Guy jmp back.) `3 ^4 I+ j. n8 a% `: m
4C19:00AD MOV BX,SP ; Good_Guy go ahead :). ?4 X8 ]' R% v1 J7 y8 b8 |
- V6 O3 b4 }+ V3 W k/ w. U9 h5 D
The program will execute 6 different SIce commands located at ds:dx, which
; m3 v4 w7 c% }5 Z9 ~are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ {* q! ` o, v1 V. P
2 M, H5 D" y/ s5 Q' z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% G) {' V4 L9 R, r
___________________________________________________________________________$ t. t3 r! h2 O i$ @
/ g+ [" L; _7 y+ l5 \1 i! J) {
" i! y& r$ a3 G* ?Method 03! ?' b0 m. @, k) V
=========
+ j/ s3 I5 z) T1 ~; k3 F6 _0 J; A7 ^' i& t. D! H2 k
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 G) e) d* U! q& x. D(API Get entry point)
f# Z4 q( s! G" Q# F$ ?* ^ : d8 _! w) T5 u! f" L# _4 z
" y" s! j' _( R1 R/ F/ v4 W/ b xor di,di1 g7 h! @0 c! [: b& d. e+ v& |
mov es,di
/ C! L& C. I% U. e) q2 T8 E9 c mov ax, 1684h * N3 y* F4 ^3 q3 t! J
mov bx, 0202h ; VxD ID of winice
$ N! E- f3 s5 M* j+ s& ~ int 2Fh
. ]6 E$ |1 H2 H4 u4 y mov ax, es ; ES:DI -> VxD API entry point) W- u. W$ _* x8 w
add ax, di) d8 E, \( N9 G' `1 a* S- E; w! n
test ax,ax& s% [/ z p/ `. @, O+ A8 U4 U
jnz SoftICE_Detected- }4 z% F0 |. N* B, u1 |, |
1 I* K1 h" T7 v1 |. @" j. H___________________________________________________________________________( @$ G; I5 Q* w" S
W* N7 z! p% c9 e3 H! j' V
Method 04' c5 E7 \* K' g
=========8 D1 j+ w1 |$ e v+ U- x) j2 K
5 P7 |. G! y4 a& d, q% }- P
Method identical to the preceding one except that it seeks the ID of SoftICE0 D( S4 s% ^9 T( `' ~ q
GFX VxD.
6 @ a: G5 l! l
$ d7 T9 y0 q% B" x xor di,di& n/ k, K: R* f: q3 i
mov es,di
; t: V' P, e. X mov ax, 1684h
. O- [6 h# M! f. x mov bx, 7a5Fh ; VxD ID of SIWVID
' O# C7 ~* O# G- e3 C int 2fh
3 T. S$ h. W$ [- m& b mov ax, es ; ES:DI -> VxD API entry point( |6 @# W9 C2 ]5 |) I
add ax, di
/ x |5 {# [+ t" v1 _ test ax,ax3 U# }& y4 g$ T1 N7 s
jnz SoftICE_Detected! G. |/ ?* C0 Y0 |
$ r0 b9 S# a( `( x! a
__________________________________________________________________________& }" t) [+ ~3 S
- `5 J: a( {8 f1 O: O8 c$ M4 U# ~& G# j& j: a! g
Method 050 ?8 ]( u; ^# D( Z0 B" Y+ f
========= T/ x! S) m3 Z6 }! l: K
) {% S0 K0 k2 O% r1 b; V! n' @1 [6 }Method seeking the 'magic number' 0F386h returned (in ax) by all system
: y- C. G0 [9 k/ f$ R& s3 n# u% bdebugger. It calls the int 41h, function 4Fh.* o4 X0 a% ]: b9 x, ]+ I' M
There are several alternatives. 7 k0 R. I6 {& L% c' v
8 e L* g- g- p" I, p! v% MThe following one is the simplest:
" E' a: t) a8 M. C
$ r! H; c8 T/ S, G0 ~" x mov ax,4fh/ H j& j0 Z& B. _2 A; t, Z4 ]. A
int 41h
+ y3 ?, E7 V% p1 g: a- D7 \, e; V: o7 h cmp ax, 0F386
' K2 b* y8 H* l/ Q2 W jz SoftICE_detected- T v3 |; P3 x8 c2 @; N3 q
4 T* L& m [7 v5 V" w+ x/ c9 u
2 R" K$ r+ J* @7 _% n1 ~Next method as well as the following one are 2 examples from Stone's
+ f% W( U: D! z7 V"stn-wid.zip" (www.cracking.net):
5 ^: b+ ~0 k, a* t4 f( U- r7 v
5 j, h2 K2 v7 i- l& l3 u+ n mov bx, cs7 {; p: |' r8 W6 l$ u9 V4 i
lea dx, int41handler2: ^) Y7 t/ M6 W! P2 T& }' j
xchg dx, es:[41h*4]
, q7 h: |' C, `( a4 O xchg bx, es:[41h*4+2]
# C, s# `3 N) u2 { K mov ax,4fh
+ u/ C# d i7 ]; ?! P0 ]" z+ Z int 41h; w% d9 o7 k+ e# q. H+ |9 J
xchg dx, es:[41h*4]
3 \5 ]7 s5 E, \% p- J6 S xchg bx, es:[41h*4+2]7 @4 v) D/ Z' d' X
cmp ax, 0f386h2 ]4 ^8 ]6 D0 j& E* |- X- B
jz SoftICE_detected
% m2 S6 ]$ z' j
0 h) P" X" o, T) J5 c0 aint41handler2 PROC
7 ^! ?+ N5 n0 z/ y& m" E/ P iret
- Y8 y. M8 ~0 S; z3 P! Uint41handler2 ENDP& W Z" v; H7 h ~6 b% G
. O8 t5 q, a6 o# G* n0 g7 G& K
5 T" N; Y5 X, T% {_________________________________________________________________________
+ [6 W& f6 f' X" n8 K7 B* O; i( Q, F8 `# g3 O+ [
2 q8 ]: h9 |; R Y3 ~
Method 06
5 e5 O8 o- a1 @6 z0 b V6 d=========, f' N7 _ o) W) A( j; ^$ t
5 W8 p! M8 b4 a
- M Y5 B$ K% R2 I4 [- g7 } q- C7 l: @
2nd method similar to the preceding one but more difficult to detect:" d4 S- ^+ _; L9 [
# E9 A6 i) r( j: C4 w0 b
$ ~+ P5 |" { q" ?1 Tint41handler PROC0 m" T/ O$ s$ ] J
mov cl,al0 B; m" C& P3 e9 F) e, d' X( T9 l; D
iret
! j( z$ |4 O( K# t2 rint41handler ENDP. k1 c3 s7 p2 D2 m
% ~) w5 `' G8 p2 o3 }' I& G
/ Z* ^4 e9 `% ^7 W" X xor ax,ax
) w8 v( u; k3 Q mov es,ax7 w9 V, L- M3 Y
mov bx, cs X# U3 _6 a' _$ [- \) t
lea dx, int41handler
+ E, n; ]- x% y: |) |) v- M xchg dx, es:[41h*4]
- }7 t$ K) A4 {0 x5 o8 D xchg bx, es:[41h*4+2]+ k/ n3 E2 e; _- Q
in al, 40h% |' [0 R6 F5 b# q r% Q
xor cx,cx
3 T- y% P& v& r, Y7 r4 l% E int 41h6 n8 L5 M+ j% k ?3 Q5 B
xchg dx, es:[41h*4]
, Y5 Q& D0 C$ ]2 ?! S3 G& h0 y xchg bx, es:[41h*4+2]
+ G9 l; Q7 W2 a cmp cl,al
& R8 e0 Y9 e0 S2 ^. ?1 i6 C+ \ jnz SoftICE_detected
+ ?, ]5 L, k1 U/ W( |7 K! s z2 `6 ~6 v/ I- A @. _# I) e
_________________________________________________________________________1 [8 Z7 E4 G- m. H$ E" H2 l! T
2 r; |) F3 K$ FMethod 07" i/ H) f h" Y! \
=========
2 g4 r8 I' J! s4 a7 k" N: o
$ ~' U0 Z9 g5 C& B: O4 A0 H9 WMethod of detection of the WinICE handler in the int68h (V86)
" f$ L% o8 m/ R7 ~% W- n- i
: p1 n" B2 s/ y: u; H# q mov ah,43h* Y/ k0 \( { f! @
int 68h
. U7 }8 B+ p/ Y) h' k; T, h cmp ax,0F386h+ ^ |! z$ B0 k& @9 v
jz SoftICE_Detected, z8 {8 w3 o9 q+ d/ i
2 _5 U6 {, n5 q/ J) g7 p5 L
1 e" j: n. m# I" Q. R9 E=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! f& f9 Q& t) E" D app like this:4 p% p( c- M1 X
" L( u7 t# S# y5 ?6 y* h- b6 J( X BPX exec_int if ax==68
% D5 Q- }" {9 j* s0 V. b (function called is located at byte ptr [ebp+1Dh] and client eip is; F+ B- H9 I# l% N6 G0 o: g
located at [ebp+48h] for 32Bit apps)6 x0 |. t9 H1 w1 {, w
__________________________________________________________________________
9 G" M: R8 W4 L
; C2 Q$ d$ t& ]$ I" o
5 {6 H, ~! Y6 b2 k# ]1 r8 y. LMethod 08
7 r0 y$ b" P0 T8 m0 ?0 S* F=========
L5 _* _2 P) Z2 J7 l8 z/ s) A/ f1 Y- Q( [: B1 h3 F6 }" a2 s2 l
It is not a method of detection of SoftICE but a possibility to crash the& a7 h% y9 F+ \& j7 Z; `
system by intercepting int 01h and int 03h and redirecting them to another7 ?$ K* X% L% |* Y: z8 k3 b
routine.
% X5 l" Z& F* H [; x# |- i$ kIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 G4 h0 t, U) b4 k O7 l5 h2 }to the new routine to execute (hangs computer...)' H, ?/ G6 D, V3 A
3 f& `9 X& I6 ^. E! I- T" G mov ah, 25h
6 h& ^8 v v3 i. k. C mov al, Int_Number (01h or 03h)
# T& s7 Q& ^4 A3 T+ F8 `* v% C mov dx, offset New_Int_Routine5 b8 q' `7 p& P7 H) `9 r; e9 ]1 t: [
int 21h/ Q/ q% n0 R- t6 w. S
6 ]; i1 p1 ~) s* {2 T( n
__________________________________________________________________________
4 L6 |1 u0 ~! V8 z- x8 q$ m0 t$ I- N- Z
Method 091 Q! c( u/ j" i7 D* }* X
========= k6 @$ u9 A, K. T
$ L" r9 L' g, g5 P: x
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! L+ _, g8 F! E) x
performed in ring0 (VxD or a ring3 app using the VxdCall).
' V2 l' R; w, yThe Get_DDB service is used to determine whether or not a VxD is installed
" F7 Z7 |5 K2 i/ ?7 m- H y4 r+ Ifor the specified device and returns a Device Description Block (in ecx) for! p; H! ]2 m C; q. r
that device if it is installed., t8 ~; _4 S G4 v
& i! I+ ?7 R) Z$ N
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 ~- @ J0 }8 I) _ t2 @ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 x) `! P9 Y6 [& v% R VMMCall Get_DDB
9 v* d" N2 O% U4 s! k" w% _: Z& } mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
I6 A3 N( ]. U' S# u( {+ r. W- m: i) L% y8 @0 K
Note as well that you can easily detect this method with SoftICE:) K7 e Q% D! G: {! g3 D+ y& c, ]9 k
bpx Get_DDB if ax==0202 || ax==7a5fh( Q+ v8 R0 z) ?7 F( y
6 N I- Z3 l( E6 P& i2 i. b
__________________________________________________________________________
' c0 [- E7 b& K8 z4 @ j! Y8 ] Z W: O/ e
Method 10
. r; g, G2 q/ b( V=========+ i3 }) L3 ]1 i9 }
+ b4 T/ C0 `4 S6 j, u
=>Disable or clear breakpoints before using this feature. DO NOT trace with
: y9 I6 r, u( \( j/ n9 C7 N" | SoftICE while the option is enable!!7 m: B( ~( ~( _# ]9 `
( S5 w+ Q2 y( K4 w! Q, BThis trick is very efficient:
! m% t: \+ `' a8 Y- m3 ?by checking the Debug Registers, you can detect if SoftICE is loaded1 t- ^. a# f6 p! v& s6 \1 b- G9 l
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if7 L$ O0 w( D0 M2 K& v- ~
there are some memory breakpoints set (dr0 to dr3) simply by reading their# ~- m0 z3 G( y& M
value (in ring0 only). Values can be manipulated and or changed as well4 d! K* @. c3 }: A1 l
(clearing BPMs for instance)0 H) W, d& Z* G" }( O
: |" F' e+ N9 F4 R__________________________________________________________________________
. ?0 y! Z! s' u" q: f% u9 P7 V+ @% j D% J& `. M
Method 114 A t: Y1 \4 Y% N
=========% w5 G% E9 G8 ]5 m
! y2 f% z$ I( t% rThis method is most known as 'MeltICE' because it has been freely distributed
( ]; m) a7 k# j& k1 ?via www.winfiles.com. However it was first used by NuMega people to allow
# i/ ~ t+ h. X! t7 C- A$ |Symbol Loader to check if SoftICE was active or not (the code is located
9 `: |, F2 ^% w* s' _inside nmtrans.dll).
3 v# V7 l0 `. q% x' U' L. H, I' s" ^1 y6 H' p& _
The way it works is very simple:
3 \/ z' G \/ f1 o- ]9 U$ kIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& e' s. k$ K, Z9 P. W, S
WinNT) with the CreateFileA API.
5 Z" Z) L) y1 l, Y+ E' C/ u" Q% s8 S' h e
Here is a sample (checking for 'SICE'):
1 C: K4 P% C6 m0 B) B
! C! [) \* @3 l- A0 L: ABOOL IsSoftIce95Loaded()) G, d- ]% ] U* I; d3 l) l( b. I
{0 Z$ T2 t! D' K& L) M
HANDLE hFile;
' C& B- O, j4 v1 k9 E: L! b9 z0 R/ _ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' D: y' K: V; S, }' O+ p8 U3 M FILE_SHARE_READ | FILE_SHARE_WRITE,+ Y* V; Z& ?" C/ ?$ J! I1 @3 ]3 y
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 |6 ^4 k9 E; P* h9 m9 O if( hFile != INVALID_HANDLE_VALUE )
' x" m) `2 s. O! a' I {/ A, N- |$ X3 M9 N
CloseHandle(hFile);
; U7 M7 U/ v% T return TRUE;
: |* f h% _0 Y7 ^ }
4 o" R( Z' j; `/ D4 m return FALSE;
0 v; n3 W* l5 x9 Y}" Y, U7 d% U) t: {8 G; n9 h
" H0 k- G# ]. d8 pAlthough this trick calls the CreateFileA function, don't even expect to be
7 A) O8 X4 M( d- f6 uable to intercept it by installing a IFS hook: it will not work, no way!3 \3 w, q4 S9 C& m* p, |4 G2 n
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
1 ~) l/ J' ^! H4 ~5 b$ c* Uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ o. N9 P" D0 {+ N% i8 m% I' [and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ q% S: ^5 K6 l+ b8 R
field.2 I7 E; a/ S+ E: _+ b: x
In fact, its purpose is not to load/unload VxDs but only to send a 2 A/ V4 p$ d% z
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)9 x" d( L6 e" T! I( c" l C+ c) x4 I
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
( `9 B1 q0 B3 ito load/unload a non-dynamically loadable driver such as SoftICE ;-).+ v7 I, |' M- q- Y2 J
If the VxD is loaded, it will always clear eax and the Carry flag to allow8 O8 J5 i. D+ W: T, X- i2 w4 g. U
its handle to be opened and then, will be detected.
) s, \- V( o* \You can check that simply by hooking Winice.exe control proc entry point0 d, x: V$ Q& ^3 H, X: W* @. X
while running MeltICE.7 u3 N7 W( ~1 |7 T* X" h
9 o' c- y# O* ?2 r2 ^# v! u
[% ^ T6 J2 W8 v2 A' J7 c0 ~
00401067: push 00402025 ; \\.\SICE
: n/ l9 t2 L2 \/ o1 B 0040106C: call CreateFileA7 G6 I8 Z4 Y' M4 e; W3 [, E
00401071: cmp eax,-001/ g( w x* L F9 D2 a
00401074: je 00401091! `: o+ C7 p7 h6 i5 G
2 z* c8 b8 w9 f, y |+ y5 C/ z
: X% r% h6 C- T' I& v3 C: ]
There could be hundreds of BPX you could use to detect this trick.% }* q4 f/ g3 v8 x
-The most classical one is:6 f- G7 i, J. t# L$ h
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||# v) W& s# N- d( j% b" t' W
*(esp->4+4)=='NTIC'
- e7 G& X0 `6 U) g6 J
& q: O- j8 J8 Z-The most exotic ones (could be very slooooow :-(5 o* ?$ p) j( y) b3 Q6 ]
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
) q) H9 y1 p A ;will break 3 times :-(; B) b/ S/ z, i8 [3 z5 A
+ t* n. C; `' l7 @( x3 |
-or (a bit) faster:
2 t# ~( [8 w" n1 f9 o BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" @4 M* v) M6 I4 I3 Q
1 J1 M4 |3 A( d BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) `! l/ w7 E: ^1 l; X( }
;will break 3 times :-(6 b$ O" D. \$ N6 p. m
/ D# n) M" e6 U% w( j ~2 s
-Much faster:
' Q- J! c4 y( D8 { BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
9 h; O; f& Q5 _3 K, y& _
- J+ A) @$ Q% ]Note also that some programs (like AZPR3.00) use de old 16-bit _lopen! `3 G4 g1 C2 L) ~4 T
function to do the same job:' z0 u* z) g N' {! X
! l" v+ P# s! ]. { d push 00 ; OF_READ& R: P$ L+ `! g' J7 m$ x
mov eax,[00656634] ; '\\.\SICE',0
( s3 t2 S: z9 B6 x* K* a) t push eax5 O. f$ h* `3 L4 }1 Y
call KERNEL32!_lopen- M% _# b$ x; I1 b' [6 B% B+ K
inc eax+ D+ i( H5 O( c9 w9 {9 y
jnz 00650589 ; detected
' M" y. e2 U* @ push 00 ; OF_READ
+ a+ g3 h. l9 M mov eax,[00656638] ; '\\.\SICE'
! C) ^2 s, h! m( }# C t3 z, N+ r push eax
( }% h5 M" q }$ k; a5 a call KERNEL32!_lopen+ d9 H0 V1 w5 x1 g& z
inc eax4 Y: _$ J! g- T1 |9 s
jz 006505ae ; not detected
+ ^: k# g' m8 n. u3 S7 f. I2 {8 D7 J! |' S$ b, d) Y
% j9 E0 g4 w6 i+ U/ Z. ]
__________________________________________________________________________
- g3 D' ]7 r! B3 _2 O$ _" S: b' R; k4 h% }! ^
Method 12; _0 ^" h, h; n' u9 U' J" `) O
=========; m3 r4 x! ~2 d4 \+ t. @5 n9 H6 i: {
2 V; X% u4 p# f5 f; t
This trick is similar to int41h/4fh Debugger installation check (code 05
0 }6 n3 i! ^- Y8 s( n/ u' E& 06) but very limited because it's only available for Win95/98 (not NT)$ o9 Z7 ~. x- O0 }7 M. O2 L
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* b. n0 P4 V6 c: d) x3 U; |% k. w* B2 z9 h" e. K
push 0000004fh ; function 4fh
7 }7 D% d; U' I push 002a002ah ; high word specifies which VxD (VWIN32)% \9 ~8 [7 I4 E& C9 n9 b$ ^0 z" p
; low word specifies which service6 ?2 B0 [) e. a* r3 U
(VWIN32_Int41Dispatch)1 @5 h3 i5 v& R6 Z; a+ a. b
call Kernel32!ORD_001 ; VxdCall
1 ?( K) y0 t T7 u4 b cmp ax, 0f386h ; magic number returned by system debuggers' v7 J; p7 S2 N% `- n- v
jz SoftICE_detected. w+ W T3 g. h/ t3 r
: b$ v9 C% L3 n" P( \Here again, several ways to detect it:
- A$ S- C$ g8 L6 V# s. D( S: G8 T, C/ w K. @9 `2 P
BPINT 41 if ax==4f5 ~2 }' [( m/ L& j4 D1 O
% p2 [% z; W6 r, A' a+ q
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one9 z) h' [' W7 v3 |' @" X
1 ?: b4 X8 l( d( |% n
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A& m9 Z* h6 }* ]7 T v9 S2 j/ U
^: \: k6 q/ w- P b& ?7 r
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!' l; J& y" Q/ s) O. }7 t& X$ B
8 C( s* ^5 l! D' |. ^: i+ U__________________________________________________________________________
/ W, g# a* ^3 O. Y) }/ W& y3 ?" B6 N
Method 13 c+ ]: k" B, a4 m2 X# B
=========
6 E; t" j2 @; ?+ r- G3 [8 v( ] s* h
Not a real method of detection, but a good way to know if SoftICE is. P* j- _6 V) E n& E; N
installed on a computer and to locate its installation directory.1 p: v6 Z& N6 R/ d) V; ]
It is used by few softs which access the following registry keys (usually #2) :) |! o# {8 n1 p6 J5 C5 W% F
% G0 U+ C6 _/ Q# B; E2 V
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ W2 s+ O" B5 s2 C5 N
\Uninstall\SoftICE
/ B: Q- P2 Y6 z _6 W/ |3 ]( _- {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
, e, @# N+ Y% U, V; P% f-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( J& @0 z! N [, J) P+ K! ?
\App Paths\Loader32.Exe/ l. K9 l. i3 ]4 Q6 T" R. g
* {4 D. {. W3 F# }6 R% w6 ?# S5 b# q+ ^% a( U% I
Note that some nasty apps could then erase all files from SoftICE directory
, A5 i7 P5 b% G+ C, R/ K7 X7 k k& }(I faced that once :-(
+ m( q8 R0 [& \7 ?6 ~1 ^6 B% A9 [' z9 k
Useful breakpoint to detect it:
) `0 `, p: G+ M
# k; v- G! A2 c" K; w4 t6 U BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 v2 W; H1 r7 h4 _
' w# `! r* G1 p! ^' s0 r9 s7 X__________________________________________________________________________# ]. ?* n5 ]* C0 Y& z* [$ S i( @
9 |# T9 y$ g9 {9 O' ^( u8 N+ e" r! w6 }. b- ]3 I
Method 14
" j6 f! x) P# F- h' `5 Y=========% e( ?4 Z* x% w& B/ a
# n7 f9 R- z1 N S$ L7 j
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 f6 [. E0 ~* u$ s+ Z h# C
is to determines whether a debugger is running on your system (ring0 only).
$ V! `% G2 m) I8 Z# E* c* I- Y/ `/ r
VMMCall Test_Debug_Installed* |8 r' R' ^2 I% ?; e# y4 |: ~
je not_installed
1 P3 G3 @8 b- W- J( l% F
8 U" A, p( v1 ^+ r! J/ }This service just checks a flag.
3 i7 P/ }! i3 r0 C7 @</PRE></TD></TR></TBODY></TABLE> |