<TABLE width=500># r& n- S5 c# T+ ~0 r
<TBODY>
* D$ l7 W1 w7 I, U<TR>' o5 d& d4 X0 ~/ l' z; c1 T
<TD><PRE>Method 01 / p4 w, _7 k* e X
=========* \, c7 U) H( a
' T$ y Z! |. B5 xThis method of detection of SoftICE (as well as the following one) is4 t2 J% o! f! c& T
used by the majority of packers/encryptors found on Internet.1 j0 T$ r7 I. g" p
It seeks the signature of BoundsChecker in SoftICE8 h: {9 r, P4 T
% d: N# {/ a2 S
mov ebp, 04243484Bh ; 'BCHK'/ b: H% A |& k/ B
mov ax, 04h
0 R8 i1 ~- \- A& P, I R int 3 $ H$ P% A5 F0 z+ D/ [& P+ p+ [
cmp al,4: T J- _! |' R3 i. A* c
jnz SoftICE_Detected( }1 s8 u+ J1 H7 V
( ?4 a2 C3 l. `' K6 X" z' X___________________________________________________________________________* A: j/ Q3 {: M# g
3 n6 l0 I/ b/ ^Method 02
8 u$ A" J0 J, n/ C0 u2 S7 J. c=========" B' x- Y8 V) A, Q m- v
7 ^9 I9 I+ [% d! x* G' q$ L9 Y2 r
Still a method very much used (perhaps the most frequent one). It is used- w- X) m4 |3 x. D3 f6 L6 ]5 q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 e* J) M0 K: x# {5 z
or execute SoftICE commands...
2 g) x: t% i/ D; o4 G. DIt is also used to crash SoftICE and to force it to execute any commands% \5 v8 K3 s) {" ?
(HBOOT...) :-(( : C% H; C. p# z3 B
1 r* u E6 a0 z0 O
Here is a quick description:
7 V/ I4 q0 {! G0 |-AX = 0910h (Display string in SIce windows)
) i$ ?, [: J9 E% {; [. j# G$ F-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( ?8 V7 v3 t% ~' F, y
-AX = 0912h (Get breakpoint infos)' G: z; r( _. @4 F
-AX = 0913h (Set Sice breakpoints)' ?3 y8 ^3 j o: i
-AX = 0914h (Remove SIce breakoints)( h. Y. ?4 ]0 o% F! \- q' N
5 F3 v9 W: Y( M2 @ L! m4 w" iEach time you'll meet this trick, you'll see:8 `% J1 x4 C; F4 O3 [) p
-SI = 4647h p1 i+ l9 R/ P q5 H
-DI = 4A4Dh) u& N% U4 y/ e3 Z
Which are the 'magic values' used by SoftIce.
1 w8 V/ d4 p. a$ ]3 IFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 T# U3 ^& l+ E7 m
/ D& }3 h2 x0 E+ eHere is one example from the file "Haspinst.exe" which is the dongle HASP8 P: f; _( k" t' Q' F
Envelope utility use to protect DOS applications:
2 Y: j: o0 h2 l4 H: D- G8 G$ W$ m% V, X7 b4 M) D! r
1 a P3 k' l/ ?& v7 @4C19:0095 MOV AX,0911 ; execute command.
4 a$ x4 D6 w! V! U s! G. H4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
% }: D& t* f' ^( G ^) ~6 k+ v) w4C19:009A MOV SI,4647 ; 1st magic value.
+ P8 V7 W9 ~& s/ |4C19:009D MOV DI,4A4D ; 2nd magic value.$ _, E, d( y: j7 f0 ~8 C9 q9 ~
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)4 a: E# r4 q- P, Q
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute# m' U; \9 i+ Y% U X' t$ g" {
4C19:00A4 INC CX3 P" B4 @/ X2 l3 K' G
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. t5 p% `! u) i' X) l4C19:00A8 JB 0095 ; 6 different commands.
- W, a, h# P2 k+ m% P4C19:00AA JMP 0002 ; Bad_Guy jmp back., E4 v% f8 T* Q7 \- t0 s& g9 ^
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ Q4 L- S$ w' ^+ U' H y5 Y+ Z2 C4 y! H8 _# C
The program will execute 6 different SIce commands located at ds:dx, which! G+ [+ u/ c r( W; L* \
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 m% |+ Q( P5 d2 Q8 o% s5 _( J6 I) W: y
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: j$ \" C/ T8 C0 k/ ?- A
___________________________________________________________________________+ \! ~& N! l) E& J3 J- t# a4 i
# F% d: D* a1 w+ V8 Z
# }3 c8 L! U) z! I; Z4 |) fMethod 03
4 T: C: `* z" M=========) x8 [4 t, S* L+ |/ o. s: [
& s. D( z& [% e' w. xLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- m1 l4 E) K! ?) I" X" J9 Z+ L8 K(API Get entry point): l$ Y- s- k$ t/ Q1 H+ W6 V7 Z: |
1 E( s- [2 ^& x0 {: Y% ]% K% ]- r& T/ e$ [3 k2 ^0 X% K
xor di,di T- q2 I2 n' i8 c; a `0 W
mov es,di/ @* W8 I L$ l; N7 V6 r3 B: X
mov ax, 1684h * S7 u: P& q" ?; I4 k1 C! A
mov bx, 0202h ; VxD ID of winice
* f+ s1 P4 `5 r. L5 E8 S int 2Fh
s( E0 R1 `! v+ V mov ax, es ; ES:DI -> VxD API entry point
7 J# M5 z9 R& x6 @+ E1 z add ax, di
1 O9 f7 ^ t, V; q) ?6 w7 } test ax,ax& S7 p/ C! e8 [, n) u" A4 p
jnz SoftICE_Detected) w* x# Q& h+ t. X* [
1 q& N$ V$ ?( ?. K# l___________________________________________________________________________
, N/ |0 w7 V2 j
8 P }1 L) F4 J* dMethod 04/ t2 h) Z! E; m& c {
=========
* a5 D" o3 T7 W& Y3 q! x+ `3 M q) t8 O" @* n8 g" a d
Method identical to the preceding one except that it seeks the ID of SoftICE
6 ?3 a" U0 ~" B+ U3 N1 GGFX VxD.9 k7 Y6 V1 X; }5 Q$ c" z3 `) Q
. E3 }& ~2 ^+ I c6 @6 ?
xor di,di s1 h9 I9 t/ O) z, M0 T
mov es,di
) e; C( e* W n8 K mov ax, 1684h ! {" U* D* h* o$ u( M' K( K
mov bx, 7a5Fh ; VxD ID of SIWVID3 V+ F( U- H) e0 ?% W
int 2fh
: y* l. B: H6 @( a0 l$ ~ mov ax, es ; ES:DI -> VxD API entry point
8 I. l# z) t& C1 a3 U add ax, di
4 a) ~$ J$ m4 k7 `2 P4 R test ax,ax1 `1 S, S4 ^8 u1 H6 }
jnz SoftICE_Detected* M1 i0 M7 J( T/ G( i8 ^
5 ~6 o( O$ K; H( d__________________________________________________________________________0 k# p* O. j5 O& O
0 V$ T, v; |" x: [+ B/ @
6 c! y8 k8 P3 l" {5 ]4 F" T
Method 05 }7 `$ r" z, l! ~- J! N/ ^' k
=========2 m, R5 D) N A3 k4 |" V- n
" K# l2 x- u, }* J5 G' tMethod seeking the 'magic number' 0F386h returned (in ax) by all system
# d& I! ?+ G8 G) M5 A! h' Jdebugger. It calls the int 41h, function 4Fh.
8 d s: c4 U7 WThere are several alternatives. # g. Y, B+ C4 }: b$ ]$ f
7 k( g! x) X) {0 l) P4 U: Z h; L
The following one is the simplest:
- L, `7 s; Q( c% j$ L5 u n5 Z3 r$ s x! g! K0 v2 t
mov ax,4fh
/ m7 X% z9 {+ [ ^6 H' O int 41h
+ x3 |) T8 @! r+ n0 v* f y cmp ax, 0F386
' ? g- R3 D" r; n* U jz SoftICE_detected
" r3 W, ?; `) g1 b
& Z: z- j% S7 Y) _# B
# @" Y) i, r5 S5 O1 d8 G5 }Next method as well as the following one are 2 examples from Stone's
, T1 `0 E: }* D) G, l- i- B5 ["stn-wid.zip" (www.cracking.net):1 e; a2 o# x( V$ h
* D$ S$ }( ~; c' g# U- [* {' G7 g mov bx, cs
) q, n: R; s! A* L! [- p5 }9 E lea dx, int41handler2
) o% x9 P4 B p4 N& M xchg dx, es:[41h*4]
5 w- E8 p- f* v ^6 s xchg bx, es:[41h*4+2], p' q% W1 r9 u) n# a4 ]" R8 O
mov ax,4fh
4 x- Y1 c0 s& z! r6 n( Z3 p int 41h
# i; M( ~4 g6 L5 m* h. ?3 y. ? xchg dx, es:[41h*4]# S+ T8 `% g. ^0 H9 `* t
xchg bx, es:[41h*4+2]$ ?; j% q: a% o! x, D! z/ G3 w
cmp ax, 0f386h
- C! N1 P4 l2 X7 j3 o+ m jz SoftICE_detected
, H6 Q& u( \; w6 \7 n/ R3 Y+ m9 _: S7 _$ h3 J
int41handler2 PROC
. e! a- |% b% S0 F: k iret
$ z4 c8 `4 [4 u* e0 ]int41handler2 ENDP! O o) E. r1 q/ E
* Q6 ]7 { A M2 l
& e& q2 N( E* P6 h7 ^( N. M- L8 \
_________________________________________________________________________
6 d* @) {- w$ m3 A2 T
0 e( D6 y7 u6 x9 x9 Y8 V
& u2 F% B, f2 UMethod 06
! b1 x* L A" `& C3 s/ g=========$ t6 M: O5 F( a" k) H* a
/ I1 m/ V: N3 I) n6 s+ L* S D) r8 n8 p, T
2nd method similar to the preceding one but more difficult to detect:
; l, b8 Y' N p8 c5 F( y6 h0 B/ N/ c- a+ A! P
4 M& T% n M. B6 F) K& g1 l
int41handler PROC
. R! m1 ^6 S. Z0 J! j* [" S mov cl,al; |4 U# u0 v* G6 g
iret
0 {( t3 n. J! Y3 J) bint41handler ENDP D0 P8 s7 _* a& [$ X+ s4 \
& I) ^ `& Q" K! S% ^1 N+ J& ]$ a2 c
) l5 I. p# [$ a9 y
xor ax,ax& }9 S0 q, [% `4 @; q$ G3 a
mov es,ax5 _+ K( z; O9 T9 T* `. y
mov bx, cs
8 x: n8 ^1 P5 L5 d! s9 I2 h lea dx, int41handler/ W* p6 v' G/ A. ~# H9 o- [- A
xchg dx, es:[41h*4]
/ w6 d S- b- P" i: R) P1 r" v5 Y xchg bx, es:[41h*4+2]$ d( e" b, C, Z
in al, 40h
/ x+ P# E; ?; G. m xor cx,cx1 ]* \7 ]% x( }5 j% a* r. p" D% V5 v2 b
int 41h' f4 S6 W7 Z& P5 L. x- m
xchg dx, es:[41h*4]7 t s" _: W b0 P& D4 O+ Y
xchg bx, es:[41h*4+2]
2 Q6 @0 l% y% Y$ v cmp cl,al9 e4 o0 y2 z6 S( W# p; U# t4 p
jnz SoftICE_detected/ d$ v( V/ ^2 G0 W; \2 S5 M9 a2 G
. B8 S2 k! Z2 a' w+ X) @: j
_________________________________________________________________________7 ^: m6 B% N4 w3 D& Y. P; }
7 b4 G& Z5 x2 N# [; X j* xMethod 07) C1 M- g/ G; O0 A$ ?. {
=========
2 C- o2 l k7 W/ s' Z' d- ?& ~/ o% l
% Z! ^2 K% v% j) m1 bMethod of detection of the WinICE handler in the int68h (V86)
% `9 b) [& Z3 f
$ u* Q, M# }( F9 _! `2 L2 B9 j mov ah,43h
* [ _/ B9 `$ o" `/ X! L int 68h
6 W7 f" H. d4 F8 g; k+ u$ \9 j cmp ax,0F386h {+ K3 H6 j* N
jz SoftICE_Detected" r: a& v4 G4 }' f
$ A$ Q: [4 a2 v! V( j! M3 h% ]/ J( ~" l% Y$ r+ o7 K, D, M8 n9 Q$ O
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit- H# L3 ^3 i7 z& Q* u8 B
app like this:
) h, W+ H) k: S% ?5 Z- [/ B- F/ u" e& \ D9 F
BPX exec_int if ax==684 y3 Q' T' C4 {# q7 H2 `1 x! ^9 B
(function called is located at byte ptr [ebp+1Dh] and client eip is
' q; W. I) J9 i" \* {5 B/ F located at [ebp+48h] for 32Bit apps)# q; T6 R; Z! W5 F" w
__________________________________________________________________________
2 T" P9 S6 R( e$ y) R0 q+ W& k- m- Q# q' ]6 E. ~
7 B+ E) m) y C2 g
Method 08/ A, ^, U: l0 Q/ f/ {: L. }$ N
=========7 ~) n/ M/ `, P* p' q7 y+ g
I/ }3 ~- X& u( B. J' V+ y4 J
It is not a method of detection of SoftICE but a possibility to crash the
6 p4 Q0 {& e3 R: W+ R% tsystem by intercepting int 01h and int 03h and redirecting them to another7 D9 |* z3 T0 r3 ?) o
routine.- ]$ Y+ c( v6 L( G" q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
8 y% r* E {; n; q' s: t/ ito the new routine to execute (hangs computer...)+ A/ |: c3 h- n7 j- c, H6 _
4 [8 a/ `6 b0 l. { mov ah, 25h
; B( I( T4 x& B0 L mov al, Int_Number (01h or 03h)
$ V6 ^2 g" C7 H& p mov dx, offset New_Int_Routine
! t0 L) X9 Q1 K7 J r2 b( q/ b! Y int 21h L1 _7 t3 Q% h2 c! f2 m
" L7 y8 p" g2 P( o$ W__________________________________________________________________________- j1 n* l' v3 S: J# T2 X
; C+ S* ?- L) t$ {' N% ?Method 09
9 W2 ~5 m+ u; m9 y) \ Y4 x( L7 p=========
% g8 n/ p" i) b1 V, g/ g2 o
6 X ?$ I* r& l4 C6 r" N' HThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: Q' B- R5 ?4 w! N$ q vperformed in ring0 (VxD or a ring3 app using the VxdCall).! S2 s( m D/ B- A
The Get_DDB service is used to determine whether or not a VxD is installed" T9 J8 j, L: ]4 n6 g7 R: p7 V% W
for the specified device and returns a Device Description Block (in ecx) for( k1 @2 k8 H* O3 {+ w! p- X8 W- {
that device if it is installed.' ]+ F9 `; m0 P& w- }0 r
* _9 A$ o% L4 r) n4 ]8 a# W1 [
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 c' T5 F2 J. I6 L( g5 T2 K0 m
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" ]+ f! A A. ?4 K5 a. M VMMCall Get_DDB2 o% j! o6 z+ U; n& B
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed. J! ^8 Z( v5 [2 I& P. |' W
9 H6 A7 c( K0 I
Note as well that you can easily detect this method with SoftICE:
7 d+ f, i4 D6 U) ~ ?, f4 { bpx Get_DDB if ax==0202 || ax==7a5fh( d0 l6 Q L7 b6 n3 m
* \7 Z) ?! ~0 r9 d# |# w3 Q7 f! t, H__________________________________________________________________________
: d- Q/ z9 E W! T7 h1 S; A% c
8 K/ N; @. G, Y, F5 R! XMethod 10
( n$ W; E" q9 K4 e& p; B( c. V' c9 g9 g=========
# e$ B7 e7 B! M' U- H
! {. z5 A- n$ @- g5 I. F=>Disable or clear breakpoints before using this feature. DO NOT trace with( m& J6 F* `% i- j" g
SoftICE while the option is enable!!& o& [0 K3 G# M) `9 Z
$ n- g' B% Q3 X) [
This trick is very efficient: ~- h6 }$ r# e& f! p
by checking the Debug Registers, you can detect if SoftICE is loaded
+ w' k5 E p2 F$ m# f- J |(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
0 p: d) n9 L' V8 O: u1 Xthere are some memory breakpoints set (dr0 to dr3) simply by reading their% V# y* x2 l& C0 V/ z% ]/ h) O+ J
value (in ring0 only). Values can be manipulated and or changed as well
5 |" J, Q# n* s5 F+ q, s9 o(clearing BPMs for instance)
0 y* n: X3 i% Y4 {/ l3 e; r6 e) Q, x" ]1 C2 n3 v6 j
__________________________________________________________________________; ]! v; {6 g9 m9 J. R" n( i
1 O- x l2 w N$ Z) j
Method 11
' I- k0 _2 |9 Y) h( j, {3 k=========2 W+ x6 u4 l! q+ {, p
0 Y9 S1 ]0 d8 |( V2 L* ~, F
This method is most known as 'MeltICE' because it has been freely distributed
2 F# X2 W$ ~/ e$ Tvia www.winfiles.com. However it was first used by NuMega people to allow
6 \1 ?8 H# j# f+ h( u2 n; g0 O. RSymbol Loader to check if SoftICE was active or not (the code is located
: Z" n7 G, c, u* L% tinside nmtrans.dll).4 i: x) [. Q$ ?+ Y% S- z; N2 i1 o" D
. X/ B. _. E4 ]) |) ~! lThe way it works is very simple:
4 I) g- |, ]8 P CIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ J! P) y/ a5 R0 `: V
WinNT) with the CreateFileA API.2 H" |. g5 q, E- k
. D$ _" A; c1 A2 @6 GHere is a sample (checking for 'SICE'):
! ]8 e: B0 T$ U* B5 z, F; P& [5 U* }) F$ I9 }( R
BOOL IsSoftIce95Loaded(); j/ \( {& V+ H- ~ E
{
0 c5 D7 S! p( j& C3 m HANDLE hFile; " P. O: J. e( ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 y' [2 H, X$ f$ i- o5 R9 y
FILE_SHARE_READ | FILE_SHARE_WRITE,5 }; x) [" u s/ j1 x* Q7 `/ s7 q
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" k- {, }8 {. N" I; @ if( hFile != INVALID_HANDLE_VALUE )
" d+ p' o( n& j# z* a& O {
- g, U- f1 W4 s1 S3 f CloseHandle(hFile);$ [2 z) d; _% |& J# X {
return TRUE;5 }2 C! W) Y+ I- q+ Q. v( G
}! @; }( G1 w" t) Z, |+ V1 H- D
return FALSE;
& @/ X) } l8 o' _9 ~}
& F( Z+ p6 b& @+ v0 }1 J5 R& u$ b: {0 \6 [! U
Although this trick calls the CreateFileA function, don't even expect to be
- k# A H5 ]: x- s5 F# G; Fable to intercept it by installing a IFS hook: it will not work, no way!! o& @+ \+ o; l' W
In fact, after the call to CreateFileA it will get through VWIN32 0x001F# d7 U3 v4 v3 [, a$ q I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ S2 [# m& E8 @, U. g1 m1 b: @and then browse the DDB list until it find the VxD and its DDB_Control_Proc1 e3 }; b+ s( M( C: M3 \
field.
& c* k, O: F/ }- M9 j" Y4 AIn fact, its purpose is not to load/unload VxDs but only to send a
" _, l5 O1 r$ s; CW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* R# K: y# }( vto the VxD Control_Dispatch proc (how the hell a shareware soft could try8 o7 p3 p" I, D% r1 J: R; @
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* A( q- H' P3 B3 s9 V. f
If the VxD is loaded, it will always clear eax and the Carry flag to allow
7 b9 ]( }9 a$ h `' kits handle to be opened and then, will be detected.' A. z3 g. h/ W
You can check that simply by hooking Winice.exe control proc entry point. g& l' b, K8 _* l$ J, @7 F+ Z
while running MeltICE.- [1 y9 [1 y; f: |. F5 r
/ T% G4 r7 M0 L2 `7 K( H4 o
" G, Q+ q# N: F4 w 00401067: push 00402025 ; \\.\SICE4 r: t6 s7 k: }# t
0040106C: call CreateFileA
& e( W2 U' D& j( S) ? 00401071: cmp eax,-001
& C7 j& i( H4 `) \5 I! {& n 00401074: je 00401091
& Q, F4 Q. D8 U5 r5 P* p* a: C- w4 Q% L5 U& Z+ o
8 u) W" Q' a" V# B) m. }/ E
There could be hundreds of BPX you could use to detect this trick.
+ n0 T9 c+ d% B0 c-The most classical one is:# N3 k3 ~3 z2 M% W% i! x: P
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" L9 a. T5 f( n- F% x
*(esp->4+4)=='NTIC'" ]. A3 |- ]# n# x) _) F) c
" l; W8 c; K( n+ z) X4 x
-The most exotic ones (could be very slooooow :-(
+ f; a" k; `: u1 { BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 A0 E T7 b0 S" [
;will break 3 times :-(
7 Q- T; z; F! X7 L P
, x6 D0 | P+ D+ r: G-or (a bit) faster: * z! S' E7 h( C4 T h/ `
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')# ~/ f E) _1 W2 {
0 d0 A6 D$ u, }
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
B/ q/ `6 h) G! }" v8 D" c ;will break 3 times :-(5 [+ j: a; Z5 v; S N0 H" }
* v9 J8 Y2 E% l1 A
-Much faster:6 X5 C" \1 Z6 d7 V- H
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'+ d3 Q% G( s5 B7 e L- k/ B
. Z9 `: L0 r. s' A! V% J% _' {* ENote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& i* |, W$ e6 o' b/ r! W. i" ]function to do the same job:
) {; @. `% x* q' N; m- W8 ^3 M- e: b$ E8 \9 B$ Q
push 00 ; OF_READ, C6 G; L: i8 y4 H% T1 t
mov eax,[00656634] ; '\\.\SICE',0
2 c% h5 s5 n0 z4 w push eax
h6 c5 D* a" A3 J0 ]8 r0 l8 N. T call KERNEL32!_lopen
3 L- `3 R" e4 l2 ]; y inc eax
& D) V. @. J. g jnz 00650589 ; detected
7 F: ^: n, Z5 H: S$ U* k8 {8 s4 H push 00 ; OF_READ- G0 T0 @+ U7 v) s" O; c) m o
mov eax,[00656638] ; '\\.\SICE'5 k H1 H0 e4 H0 M3 g# `0 C: H& `& k
push eax
. l; e! M9 I! q call KERNEL32!_lopen
! \3 o, p8 ], Z, I( c inc eax
" n' c( f) t+ ^. x jz 006505ae ; not detected
2 f0 u) H2 m) b, m
5 ~0 R! a, q$ r- y, i/ D
" e) J/ P5 c+ D. u__________________________________________________________________________$ r; B5 O/ U# m
. o" Z1 j! {! o9 MMethod 12' s9 d% X4 E0 a% L' C
=========
2 H2 \8 H. x+ ]5 j' I& ^) w2 v- B( i1 _& f8 v
This trick is similar to int41h/4fh Debugger installation check (code 05$ h' V6 U2 V3 e) H3 w' \
& 06) but very limited because it's only available for Win95/98 (not NT)
( D% e5 R0 q" D. C5 s% Q4 ?% kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 a& |# o4 H/ {) r& z: T
& f, g% w3 i. H* X3 X push 0000004fh ; function 4fh( @+ W( ^3 ^ x4 S$ c
push 002a002ah ; high word specifies which VxD (VWIN32)
$ q0 L7 H6 A% N. M ; low word specifies which service7 q: B5 Q* C/ |1 x) r
(VWIN32_Int41Dispatch)
2 v! A. n+ h! `' K6 X# t( b call Kernel32!ORD_001 ; VxdCall
6 L4 L9 n% v! l) \ cmp ax, 0f386h ; magic number returned by system debuggers
& s/ s1 U4 O/ W J7 @* q jz SoftICE_detected
+ ~: {8 \" Q" e& o+ }' l, ?3 F* m% b
Here again, several ways to detect it:! [2 e0 {; D3 |2 i: P
/ s- ?, ~; ]4 j" C6 J1 ~ BPINT 41 if ax==4f
8 Q% z/ S# [. ~3 @6 I5 z! K4 w g+ Q& \
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ Y5 x; L5 W3 M% L5 q* y' @' ~) E% O2 q% z" p% a. v. `6 E
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
; r7 m8 C T5 M# W' b! v; D
7 M( f4 V; ~. x1 S5 y, b3 s BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 ~3 Q4 g9 x7 c6 v g, ~ ~6 ` `% ^" b8 ?: u/ r
__________________________________________________________________________- o; @# j3 k! S* A& l' q
v2 i' {* v$ W. F5 f% r
Method 13
( l7 ^' A$ E- }, F( g4 q=========3 f( g* J% b# O! e* M
: c! M1 r3 v4 A9 lNot a real method of detection, but a good way to know if SoftICE is
+ G0 o' A& s' D5 Z; Ginstalled on a computer and to locate its installation directory.
. K& t7 H/ a" b% {! vIt is used by few softs which access the following registry keys (usually #2) :
* J6 p3 x) N. l8 e$ r; g& y/ [& ^; \% l3 B" i) q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 v& [0 _. U1 H/ e1 A\Uninstall\SoftICE
" G9 s v" w c R9 z5 k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* e6 O* [. T C' e-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 ^2 O# C7 k* F0 v) v5 t$ }. M\App Paths\Loader32.Exe
7 N5 f5 r% r. T* g' q4 w W5 J5 R6 T$ g+ t, e7 v
' P$ G4 c4 l- e5 V! M" @- ^+ H
Note that some nasty apps could then erase all files from SoftICE directory
4 {6 l% r. q+ a' m) h(I faced that once :-(8 H8 U* j9 R# d" |' I% ?8 Y
: d0 |: T3 _. j
Useful breakpoint to detect it:
/ ]) n+ N0 _8 h$ w5 L! P
/ R: B6 d' f; m: h8 {* J BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' {* h7 k" x$ _: Z4 O) H
" N$ Z) Q' m" n, z1 G__________________________________________________________________________
" c' R* N) V' c$ F# p+ Q4 r
2 g3 a G: p7 j
( s+ ^( y* o6 L1 w+ _: sMethod 14
- Q+ x& o. H5 L) B- A9 F) D( o=========
, T9 N) n; B: e7 H u& ^+ X ^' g) _. C
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ z; T/ @- q! Z7 j( t I, U
is to determines whether a debugger is running on your system (ring0 only).
M }4 m$ Y* r7 J) c4 m v: w0 y6 U. `3 U
VMMCall Test_Debug_Installed+ U: v/ A8 Q1 a* j) u5 ~4 f
je not_installed: _, ^& F! Z) J4 L4 l* S4 m0 {+ q
' n. t* q- R% X& t( i: u8 V2 vThis service just checks a flag.
, d% H7 i' K: J</PRE></TD></TR></TBODY></TABLE> |