<TABLE width=500>
" p7 a9 y# |' G- R( l<TBODY>3 V# _8 D' w' l8 U. M* d
<TR>
; _' I' d/ h. t4 H, m! g3 V<TD><PRE>Method 01 l9 m, n6 Q% r3 l; N6 {( c
=========9 Z) b% v! v- e8 O" q
9 l" @5 j! H3 |/ ~# q0 `This method of detection of SoftICE (as well as the following one) is# O4 p9 e* C4 ]7 V
used by the majority of packers/encryptors found on Internet.5 O3 ^; k, V9 _0 u; t& Q
It seeks the signature of BoundsChecker in SoftICE4 p# E/ u# r; r7 h
. P! D u8 Z- x
mov ebp, 04243484Bh ; 'BCHK'$ {2 P" u! W/ K8 U p! y
mov ax, 04h
$ g# V2 @/ E: p1 ]/ C int 3
# E* b7 }: ]* _% ? cmp al,4
' j; L, l+ _8 F: Z: w' n. | jnz SoftICE_Detected1 T& U! a2 n3 [- l$ e
$ S5 J8 _7 r5 f
___________________________________________________________________________
& S& o- ?; {5 I' J1 m7 I
# o* F3 b! f3 [: d8 {* m/ B; KMethod 02+ P& r5 |' G/ |
=========% `" ^6 w* H) t# ^5 S! v* E
' \' c& p% U. K- \; H7 c k
Still a method very much used (perhaps the most frequent one). It is used3 _7 ?. K* N6 H5 x- S* ^8 f$ ^) y
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
G( l& R1 d/ g, |" N3 j/ u9 D5 _or execute SoftICE commands..., `* ^' E5 A/ g$ `3 ? \
It is also used to crash SoftICE and to force it to execute any commands d* n" c* ?8 @' T, M0 c5 `
(HBOOT...) :-(( ( d/ z7 S) {4 I1 V. u9 m
7 C) s" e2 m6 ] F+ |5 BHere is a quick description:
1 _- i& z& g3 Z! G-AX = 0910h (Display string in SIce windows)
) W' f! a6 ?- p" W6 O) t! d-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)4 Y& ~( q4 h [$ O! ? Q; Y" f! T! l0 E
-AX = 0912h (Get breakpoint infos)
; J/ L1 Q% o: q+ N) J+ ?. k! ]. k-AX = 0913h (Set Sice breakpoints)
/ n8 }- J) \9 u. b r-AX = 0914h (Remove SIce breakoints)
; S! s3 j* r) N4 Z) B" G" g7 h3 ?. [# @; |
Each time you'll meet this trick, you'll see:- f; v: A. l' A. B$ ~& j: U
-SI = 4647h
/ D6 w4 A3 ~0 g2 r-DI = 4A4Dh2 \( J. w! Y5 O" l
Which are the 'magic values' used by SoftIce.
7 U2 C" S" S* Z) k' K0 FFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: W- S8 s0 x4 s! A. _
: L$ G/ g( A$ n: oHere is one example from the file "Haspinst.exe" which is the dongle HASP
8 C2 n% O6 C; t4 ~. XEnvelope utility use to protect DOS applications:
; X( ~9 W A+ B
+ T% P% X1 R; I8 [; t& C+ J& t2 V+ [# j4 F. r) P8 B
4C19:0095 MOV AX,0911 ; execute command.& Y3 F: U6 S a1 i0 I, h% h' J3 m
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).5 J6 ]; ^, r: H8 E0 n# O
4C19:009A MOV SI,4647 ; 1st magic value.# J, X) }) {! C3 t9 [
4C19:009D MOV DI,4A4D ; 2nd magic value.
2 ]9 ~, `! j: x0 m2 Y, m" d4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)7 e5 C5 r' g+ S
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute0 n4 \* m1 P/ c
4C19:00A4 INC CX- m& J7 a! y& H( ]! p* _0 z/ |
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: I- n R6 ?" E) U0 `
4C19:00A8 JB 0095 ; 6 different commands.- Q# n1 i, h. x
4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ U* h8 `9 q' p5 I
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 x, s3 c1 e/ I# L: ]0 A. R6 f8 Y
' E$ V" X- ?( \% o) }+ O0 pThe program will execute 6 different SIce commands located at ds:dx, which9 e! D+ k5 G( Z% X
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.6 u( K r. h. H9 O, b) P/ [0 U' x
0 U, L. T$ e; P% ]5 F1 V5 b. t$ j
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# U* h+ F- N" I___________________________________________________________________________
" s+ D$ T. b& b7 \9 {! E
- [3 r/ r* R5 @5 X' t k
- c* G Q8 e4 k. `) D+ rMethod 03
]# W1 Z1 B6 ?/ }=========
7 d$ n: u+ ~3 X( w" w& N
7 \& l* t% Y, `4 a0 g* r: zLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 s. r3 w/ V* r9 [+ i( B- j( D4 |
(API Get entry point)
0 |0 g ~: x% x" L8 u9 q . s% T0 t) M- d! W
1 u! D8 c/ [4 {4 m9 H, P xor di,di; p, x% k' c; q) L/ [3 ^' l
mov es,di
3 {: U3 J+ A5 I6 k& A mov ax, 1684h 1 R5 [) Y3 |' K c
mov bx, 0202h ; VxD ID of winice8 |9 m1 y1 R0 H( W K" }
int 2Fh
" ]' ^( g! A: Y8 L mov ax, es ; ES:DI -> VxD API entry point
- ^3 a+ ]) @/ E2 K. } add ax, di
6 Z! H+ E. e& S/ {/ V' k test ax,ax
' A, D; u; e$ q( V8 o, A jnz SoftICE_Detected; n3 l5 O) R7 I- a! X2 \
7 s, M8 ?, e6 }% U: ^9 M___________________________________________________________________________6 T/ J: @% K2 e/ _! G! g
3 r. c: F2 a N0 H T$ S* I
Method 04
+ d2 y3 [' }, D, m: d2 G# A=========, ?& r: y& u8 B5 L, }
' Z4 n& h5 C$ X7 [- w9 P
Method identical to the preceding one except that it seeks the ID of SoftICE& A5 L- s1 G3 X) z1 Z4 T
GFX VxD.7 u4 e1 b% ~1 j/ h2 J
3 ~: c7 B, ]/ m& j' m3 c xor di,di
. U n9 w! ^5 m' p. B mov es,di
. }# y# b! d" m, N8 { mov ax, 1684h
0 c* N4 O( {' p( @ mov bx, 7a5Fh ; VxD ID of SIWVID6 P6 S0 k0 W: U8 |0 W( u# T+ Z
int 2fh" n3 ^& g4 G# B9 P2 e/ q! p
mov ax, es ; ES:DI -> VxD API entry point2 C7 G( T% q! ]2 B* U
add ax, di" K3 i6 N+ e7 r8 U8 w9 U
test ax,ax& n1 b* G }- E5 A+ W7 H
jnz SoftICE_Detected
5 _9 {! G6 l% U7 {' d: E8 Z0 q. P, |) c( I( x
__________________________________________________________________________
O$ j. M1 `1 q9 O) t% n+ H
' }- k7 [, `! d' j, \: Y) a4 @$ h% X/ E
Method 05
8 R! S) B7 U X; G1 Z) V=========& s5 ~ R# I! |6 L; w. q* F5 s/ s5 ^
" T5 _6 I7 ^0 X+ Y6 Z, D$ N% o5 L
Method seeking the 'magic number' 0F386h returned (in ax) by all system" u9 A3 U" m# X: i* S, g
debugger. It calls the int 41h, function 4Fh.
# n5 b- z, I/ z( i4 Q5 I8 oThere are several alternatives. " L$ r/ J1 u( U/ Z3 ^! N
+ r" a% o1 l" U3 v( R1 FThe following one is the simplest:( B" q$ Z+ ]9 y, A
( X. h* P N) r. J$ {4 T
mov ax,4fh
, |- O# R5 q/ y% l- \3 z3 S9 [: n int 41h+ H2 ]( c1 m3 A
cmp ax, 0F386
' A7 |8 G6 k1 M9 [ jz SoftICE_detected
N/ r# N7 G* c' D; I1 G. }
' T, P5 O) n/ {: a, S/ }9 ~) O+ _/ x: W, c
Next method as well as the following one are 2 examples from Stone's 1 K' ?6 h2 R+ a) O8 O3 K$ k
"stn-wid.zip" (www.cracking.net):
8 x# O8 B. F y) w# S+ V) o+ i" j% c) H- N
mov bx, cs6 O0 \" q& r6 y- [: l0 X
lea dx, int41handler2. c2 X# i, [# {# L0 G- K) x/ U
xchg dx, es:[41h*4]" [% V# b# J% q" n9 H
xchg bx, es:[41h*4+2]
' _6 q% U) l& l9 b( \, X4 w8 D mov ax,4fh
! }7 ~- S! c' ]4 K$ v* \ int 41h! K9 C0 b2 u& U( p# ^. ~' T8 O0 B
xchg dx, es:[41h*4]
9 c- ]* m+ B4 b4 O8 t+ d9 i xchg bx, es:[41h*4+2]: ~ g8 X T+ Z: j3 ^
cmp ax, 0f386h* H& q5 ^3 g2 i4 f
jz SoftICE_detected
! Q8 i2 U8 c5 d+ H) j
$ D% D3 y" `3 Y8 }6 _' Q" G }+ wint41handler2 PROC4 ?" n" j; Z4 t
iret
+ W+ f0 c" `: a& u* `% V6 \int41handler2 ENDP
; \# e- Q' D' o
& T5 Y1 J( m3 u+ v0 h4 I' j" E$ y7 u
1 Z6 [" D+ F4 c) _# f& G! a_________________________________________________________________________
1 q$ j; z# @( i" n ~4 X! c! t3 O" p( ?: C
( h+ ?' _6 [9 F r1 r! l# @! u
Method 06
: ~* x! ^2 N1 u( t=========4 a) k. i% H: c) F' E) F: r
; @5 c: x$ v7 F+ @7 J
8 Y8 e) s3 M) n2nd method similar to the preceding one but more difficult to detect:3 ]4 E# B8 \7 P* Q( b) K; O
6 w# F6 c7 \, R" G& z4 Y+ {* \0 u. D$ F: d! N, u1 b
int41handler PROC
+ u2 \ z. u$ d0 k: M mov cl,al
' c: ~# ^; y1 w+ v( c9 o* X: e iret$ x* {: Y2 S( U. `, k, t
int41handler ENDP/ ~5 r6 F1 A; }5 O4 M1 o! y
4 A! c$ j! \) i$ w8 t
4 h% v1 Q4 P [( u1 f xor ax,ax
% d2 H1 Y7 J5 n* t mov es,ax3 m* V" K- `# q) a
mov bx, cs
1 V. F) q: h9 ]( [ lea dx, int41handler
# z$ h: T4 m! W3 ^: S; h, n xchg dx, es:[41h*4]
5 k% V& f- F; o3 } xchg bx, es:[41h*4+2]# j- t4 D% A I6 D" L3 v6 U
in al, 40h
: S0 r1 |* f4 @: U5 i2 P* r xor cx,cx
0 d" F2 H, X o8 x( q! Y int 41h
, ~: Y. o% E- ^; W4 F @- G xchg dx, es:[41h*4]
% s- L4 |( Q' d% g* H E" c' J. O6 @+ B xchg bx, es:[41h*4+2]! O: Q- ]2 e; Q7 ~$ E6 }
cmp cl,al
/ E& Y/ N0 d+ Q" n: `9 n- I jnz SoftICE_detected4 F. _1 L r, `6 @. ]
1 h/ d& n9 C7 E_________________________________________________________________________
: F% U& @! G6 Q/ B* E2 j' F' O! d0 b! G- I
Method 07
0 ^1 K5 F/ U8 ~/ U/ V" j0 W=========
6 B1 x7 O1 M9 R0 x v8 ^8 P* ]# R3 \ {% p
Method of detection of the WinICE handler in the int68h (V86)
6 P& i3 A7 j: {
# P$ W, X* f% I mov ah,43h) H# d& E& l. m/ p# ]
int 68h
3 E5 n; L2 M3 N5 T3 k cmp ax,0F386h- V; [3 S) P0 e0 K& K" g8 c
jz SoftICE_Detected
- k2 l% a4 b% K' d/ |/ n8 m
$ ~# ^( p- y( H" l2 W
$ Z3 r- f; M+ {9 M* j! T* V, a2 F=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& l& s/ f" m' P3 A, Q7 @7 [ app like this:, e6 ^, T9 |" I) V
( T1 M8 v0 Q1 j% h+ w |
BPX exec_int if ax==688 @# {) N& m5 t: A
(function called is located at byte ptr [ebp+1Dh] and client eip is
7 @: ~' x5 ^$ s3 V# ^ located at [ebp+48h] for 32Bit apps)/ [. P: C0 U' k# a) _8 t
__________________________________________________________________________* s* C' b( N- D9 g
% Y9 X" {; {" r3 e. b
3 J/ N+ _: e" R! Y; lMethod 08* a% J/ [6 J: c+ O* D
=========
6 w5 {, h3 g2 n/ P% a7 G9 Q- I. @$ b8 h2 O0 w) Z
It is not a method of detection of SoftICE but a possibility to crash the3 q+ U4 O0 ^) P7 s' n: H8 {1 k
system by intercepting int 01h and int 03h and redirecting them to another
, ?$ m$ p Q& ^$ i3 E8 Mroutine.6 _7 F7 s2 W& J: x I
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 T1 m) ?8 n$ p0 @3 r# t
to the new routine to execute (hangs computer...) Q( U }& ]& D
. j" P+ [7 j S) S
mov ah, 25h+ P. [0 I, T' r% K5 ?2 R0 D
mov al, Int_Number (01h or 03h)
- a% W8 L6 V$ i/ G m% m. _ mov dx, offset New_Int_Routine
6 b6 ~; ]/ p* a int 21h
" V) y0 g; m& l" u+ S0 }, q5 z! R' \3 z0 [3 C
__________________________________________________________________________
7 g9 K2 ~3 c4 l8 K6 r6 \
+ ^! S% A* a& p; p! N$ l7 ~8 zMethod 09& J: D1 a5 }, n3 y" N5 k
=========
3 ]# P- R+ n- a: V8 y" k+ @( J* A. S ?+ _
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* N$ X" {, T1 }/ R$ M7 H# q% T
performed in ring0 (VxD or a ring3 app using the VxdCall).
0 z. W4 D" z; \$ ~/ \, \The Get_DDB service is used to determine whether or not a VxD is installed
( v8 p' B$ ]$ s, o Pfor the specified device and returns a Device Description Block (in ecx) for
: S- s5 M9 a2 H5 R# U( T+ Pthat device if it is installed.$ ?6 f0 M& X0 G
9 e# R w* t+ k( i( n
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID+ |+ e, F4 c4 u8 n7 j' x: ~% d# @
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 ]+ K1 H" y& ^, i, D* W. g VMMCall Get_DDB
$ I+ a$ m# x' @9 H, ^5 u mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed! j* m$ K$ |( _" T$ D& _
) E7 t& |0 V) w& n5 Z8 B- X- x
Note as well that you can easily detect this method with SoftICE:
& G3 x2 h0 `9 K$ Z8 h9 F bpx Get_DDB if ax==0202 || ax==7a5fh+ H* d6 L. z2 a+ K3 u# _
" [6 B/ w$ N* b! U3 R6 x
__________________________________________________________________________) K' ~7 B8 O, q8 @' y
; w' J1 W& n2 W( nMethod 10
# ?& e- j. u# h=========
7 M2 I) s/ n) m( I/ U( _; n5 N+ Y0 f
=>Disable or clear breakpoints before using this feature. DO NOT trace with6 {) x7 u# F! \; Y
SoftICE while the option is enable!!& Y% r2 L, i: @, ~
4 g% j! x& [5 `8 x1 E" V: o
This trick is very efficient:) C' I5 w7 i0 U$ T* |3 f, `- w
by checking the Debug Registers, you can detect if SoftICE is loaded
" n+ j' H* U9 b$ N2 v% X3 Y8 A% \(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- W; z2 c- k0 f( @( h, _* ]
there are some memory breakpoints set (dr0 to dr3) simply by reading their. l) t! Y; D x! b8 n9 `$ G1 U
value (in ring0 only). Values can be manipulated and or changed as well
m& h% k1 f9 ?6 v: n(clearing BPMs for instance)5 p4 K0 d4 _6 I% _8 a
" `; @" I1 q6 u' e7 t2 C" c7 I' _7 E
__________________________________________________________________________- j+ l& T+ U' F5 k- v; Y$ O
/ ]# N* C6 o8 Q2 D4 q
Method 11
3 W1 R. \# ^& ?& ]3 N M=========
7 F: [' N- _9 F7 s6 O- ~5 i: o8 V8 V6 t$ O0 k0 D! {- F
This method is most known as 'MeltICE' because it has been freely distributed
2 g1 S# Y7 y4 H+ _via www.winfiles.com. However it was first used by NuMega people to allow. d0 A8 g# l5 X$ u% d$ M
Symbol Loader to check if SoftICE was active or not (the code is located
0 f/ H6 r* \7 Qinside nmtrans.dll).3 o+ c* | G1 R' G* P, X6 ^. }8 w. ^; {
4 x9 M% `6 X$ m" g( e; uThe way it works is very simple:, G3 W1 S$ B- b. I s' y( b( Q' g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# H8 _+ }8 M( @+ F6 K# G* z( J5 `WinNT) with the CreateFileA API.# M9 x! V- Y/ l" x. K$ }0 t
- T; C. W8 @( i
Here is a sample (checking for 'SICE'):( c1 f5 y1 Z9 l& R7 X# t4 L+ B
& U" O; f- ^* X" GBOOL IsSoftIce95Loaded()
. s+ }' J3 s% i3 S9 P8 O7 l{
" w- X8 M- g/ X3 l2 N. |- h( p HANDLE hFile;
: A' J, M) v( t. _ p& J hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* f3 b5 w. z" Q" ^% J; A0 [
FILE_SHARE_READ | FILE_SHARE_WRITE,5 c& L" \; F8 U0 R2 ?
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 R. F' M+ g/ ] ~0 v if( hFile != INVALID_HANDLE_VALUE )
/ b+ P6 T+ z0 Q9 C {3 l3 f7 w9 T! w, R4 A6 l" k( q) I4 t
CloseHandle(hFile);
1 E9 W1 Q& Q+ K4 D6 {/ h return TRUE;9 D1 ^# w, k* C% ~1 b D/ N
}
* V8 r2 G/ C2 m$ o return FALSE;4 z! Y3 J8 S1 B. [8 C b
}
; c$ u/ i! C) U6 y4 |. D. {" I% F: L& G. w& q) J% e W
Although this trick calls the CreateFileA function, don't even expect to be) a1 _5 i( a8 H' A; B
able to intercept it by installing a IFS hook: it will not work, no way!
( I# z% F/ F! j* ]6 n( aIn fact, after the call to CreateFileA it will get through VWIN32 0x001F; @4 ^- y! f) P8 h: ^
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' k1 J4 d* q# Q3 ?and then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ O* `% j9 s3 ]5 sfield.
' `6 m0 O* N; ^, Q1 F$ AIn fact, its purpose is not to load/unload VxDs but only to send a 2 O" B9 C, S6 y5 E
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 D' U* _3 i4 j. l, v
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
. m# ~; o6 T) @' a- F1 o: l- kto load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ j, M7 s# J5 O* {4 a6 | }If the VxD is loaded, it will always clear eax and the Carry flag to allow9 _* J$ S, J" B& ^, ^# n, I8 s' g
its handle to be opened and then, will be detected.
( l$ I/ c. R' ZYou can check that simply by hooking Winice.exe control proc entry point k6 e' j. i6 }
while running MeltICE.
( |9 C) [/ `/ K5 N9 \7 C6 q L! L0 G3 L% l
. L3 W: d5 M( ` 00401067: push 00402025 ; \\.\SICE
+ |( w, \: n$ p2 Q 0040106C: call CreateFileA
1 k f3 U8 Q3 {6 z$ o; D3 R) U 00401071: cmp eax,-001/ P' j5 s4 r. c
00401074: je 00401091
! D% r) g' m- j- N* M, T+ A
1 X- `0 I; Y- F1 [. T; K) p( a
$ r' s! [5 u9 ^# K9 i0 ~+ \2 DThere could be hundreds of BPX you could use to detect this trick.
& C0 b" x. ^7 F4 g0 C-The most classical one is:8 ?2 n9 c3 s- [
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
' E( e A7 J' E( t *(esp->4+4)=='NTIC'" t& }8 m# e' q- F3 v+ G, r6 Y
. h4 E8 X2 D/ W. I. i+ O% C7 Q-The most exotic ones (could be very slooooow :-(
: q, K+ u$ e/ z2 S BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) ~) D$ E% y; h( S( N+ {# U
;will break 3 times :-(7 M+ L/ l8 N0 q7 N7 ]0 P' T% T) d
) z. Z- F3 x: N" Y- b-or (a bit) faster: 5 g: \& w, w K; A9 }8 N& @
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 k: F. N% I. i- u4 l9 _
3 g5 ?' }/ u0 x/ w BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' $ M" x6 f- m; n' l) W
;will break 3 times :-(4 Z2 B( y1 B j; r
0 P0 C; _, b3 h5 F; l3 S1 X% d-Much faster:; R5 Y: n) Q6 w8 H3 |
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 V; c$ g1 y# X2 x( ?+ o5 o
; S2 Y, S# ?( H: \5 U+ N6 }Note also that some programs (like AZPR3.00) use de old 16-bit _lopen$ Q4 F9 L7 m4 E+ u, Q T
function to do the same job:. }4 y' Z7 k* ? {5 K" N3 ?: f. [) k* L
1 W- I- I2 F3 v* h
push 00 ; OF_READ
1 t# M: e0 \, T& ~( a0 v6 ]8 b mov eax,[00656634] ; '\\.\SICE',0
6 }2 W2 c: F5 n3 U. B l6 z push eax
0 c3 M- V) o1 f! Q- V4 K0 b* G call KERNEL32!_lopen
/ D' o t5 b2 F inc eax g: L# a7 m+ q* \$ u0 ^; A3 B; H
jnz 00650589 ; detected
+ ~6 z) v U8 f N2 P push 00 ; OF_READ P$ v! r! y% K/ E3 N
mov eax,[00656638] ; '\\.\SICE'0 A( {. o, f4 a, \
push eax, B) z- c; i% M) M" d7 e; V
call KERNEL32!_lopen
- z& f0 C9 V' g inc eax7 j0 X* t# h6 p: F. ]: t
jz 006505ae ; not detected+ H$ c; t! _5 F9 _, s
' _; s+ [3 j+ K: Z, r# u! o3 D+ O1 O# P+ f, x
__________________________________________________________________________3 {) J! s; S3 x/ E; P0 I2 Q
% D7 m" c, C; G x' |Method 12
' M4 I: Z, R0 N7 A=========8 b) h( Z- i5 M( T% C& N. i& i8 @
& g2 `! c& e7 ~* n# l4 `& @This trick is similar to int41h/4fh Debugger installation check (code 05
" f X O& k! v4 `" b5 e& 06) but very limited because it's only available for Win95/98 (not NT)! M" q4 ?( ~9 e6 A8 z# W
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 t/ Q% |: j2 ^
* r) _, |7 T2 z- k1 x) D" z( i
push 0000004fh ; function 4fh) ^. ?! u: o3 [2 q0 ^, r1 f4 L1 E
push 002a002ah ; high word specifies which VxD (VWIN32)1 y3 z' @) q: \9 c2 {- R
; low word specifies which service0 n8 l# {7 W8 `! r; d9 c
(VWIN32_Int41Dispatch)
5 m$ `( ~& L, g, k0 _' v call Kernel32!ORD_001 ; VxdCall; T* m: P+ F+ t" r1 _: @
cmp ax, 0f386h ; magic number returned by system debuggers
% j9 X4 U$ k% m {; f jz SoftICE_detected" }) l: [) a9 n6 k4 w
8 u! h' D& R, q/ v( bHere again, several ways to detect it:7 t: d- O) W6 P8 z3 D; b
" |/ `2 G: `; e: u( [ BPINT 41 if ax==4f
" |: I: ^ i& v% `0 @6 P
7 K6 O2 \2 Y2 w5 B" L- }5 R BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
, |2 k+ Z5 X4 C3 a5 w$ H* N) R+ l
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: `+ M1 d N+ b5 [, q. g" n
" ^# z# l7 g9 F4 A1 p0 w BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 U" l. e, w1 t* i1 A
" j& F( C0 t( b__________________________________________________________________________
2 S2 Z# |+ N* v
6 K* }1 T0 {" @3 I; b: y4 GMethod 13
& d: N% o" M# R: _ y=========
7 z' c# b" y: r8 _& t
5 z* \: W2 i' t4 A& E6 GNot a real method of detection, but a good way to know if SoftICE is
& I w+ P* L8 W% Z6 E1 C, Ninstalled on a computer and to locate its installation directory.
9 v0 d; a# o) H/ b% zIt is used by few softs which access the following registry keys (usually #2) :
) G# k6 X- f7 I% m* A0 o2 M. S" j0 }' ]+ Z! R0 ?) a, F# z% v
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 u* X k v' u% b8 y
\Uninstall\SoftICE N2 Q) z0 W9 [, [3 V
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. d% `- x3 {2 K8 g
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 k) J) R% Y& D% V4 P' ~\App Paths\Loader32.Exe
5 l8 P% L* ]. b/ [
* ~/ l9 y, V) F2 [4 J& {
' i% @& {" x$ e# _+ O! NNote that some nasty apps could then erase all files from SoftICE directory
4 e/ j+ x* ?. Y% |* B. F- U6 A(I faced that once :-(
L3 Y0 x8 ^/ m
9 v- n* |3 |+ Z7 k# KUseful breakpoint to detect it:
8 e6 b) D5 V3 w: T# e4 Z2 [6 F9 M9 a; }( ]7 w0 D2 Z- G
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" s0 N: K. y, e' Y: f ~6 S* E8 x# m) V# y2 q# p2 z
__________________________________________________________________________2 p' @8 S1 o; e7 U
: Q0 r1 e) Y. I+ P# `. w2 [* V& F( h7 B
Method 14 - L8 M- j5 n! T: W8 R* j5 M" M
=========. K9 q! d& A' X3 F( S$ U( K
7 a1 B* c( S! _* G
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, v1 O( m* j: \
is to determines whether a debugger is running on your system (ring0 only).
5 w' N+ u# N9 u6 E
: L0 [- q9 i* ~* T* ^ VMMCall Test_Debug_Installed; j4 U1 [' |( C) M7 \8 j
je not_installed
5 ]. k. [4 T7 a" Z. O6 b& g) C' d( V; d3 Z* `/ B" r
This service just checks a flag.) B7 F" h5 `8 ^# U% V/ _
</PRE></TD></TR></TBODY></TABLE> |