<TABLE width=500>
% [' r9 Y4 \* m) \' ~5 }<TBODY>
5 W, N3 t: O7 {* r5 z<TR>% k9 N0 j8 Q" @* v7 y1 q
<TD><PRE>Method 01 " A% G1 U1 u: T7 D% h. e3 j u6 R
=========) T" H# @. j! o/ f
' ~! _8 k5 v9 ^This method of detection of SoftICE (as well as the following one) is/ l7 h" s8 p( \$ K$ I1 {
used by the majority of packers/encryptors found on Internet. C6 [! u& e# O4 `( J; P
It seeks the signature of BoundsChecker in SoftICE: y! i9 x$ z" n, @, l
* m; y: V$ A3 R9 @
mov ebp, 04243484Bh ; 'BCHK'6 X4 i& h2 ^- c& ~
mov ax, 04h8 u Y: T( g( V! V" @
int 3 6 T* ?) |& ]+ A1 D0 ^4 T# ~7 P
cmp al,4
" | f& Q. }, C5 V* W' h+ N9 g/ } jnz SoftICE_Detected; }+ ~% Y- C: Y/ a. F6 O
4 F+ Z5 V o/ `# Y; [ f
___________________________________________________________________________
4 H7 [8 ?" W! r) P5 M$ `8 Y6 K0 S# {, C1 c1 F8 [3 a: J9 {
Method 02
' t% x2 y, O; {; O* E4 [ L=========
/ P2 N! A1 T: p& M
5 @2 ~, t/ H, x; q+ m9 {Still a method very much used (perhaps the most frequent one). It is used
/ S! ~% U+ [; R1 y0 m9 cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,; k+ {9 q: l3 V; R1 K C
or execute SoftICE commands...& f8 Q# I) b l/ e
It is also used to crash SoftICE and to force it to execute any commands
0 Z- _4 O3 f! I, ]5 Q8 R6 k; V(HBOOT...) :-((
% ~, p8 S1 ~* C9 J) J% z9 v' e- g! `+ Q& Y0 E) n6 x# I+ o
Here is a quick description:' l T8 _# n. x) o* ]/ y x$ U2 u
-AX = 0910h (Display string in SIce windows)
* m& }8 O6 V' ~0 S0 e0 n3 A( I-AX = 0911h (Execute SIce commands -command is displayed is ds:dx): u3 B& t; P, M9 p* `# ^! q6 j
-AX = 0912h (Get breakpoint infos)9 \# w4 w j* A5 N( r0 k4 X8 ]
-AX = 0913h (Set Sice breakpoints)
; M5 `: Y! i) d1 ?/ U) y, W-AX = 0914h (Remove SIce breakoints)
* P9 P$ T& A4 N, u$ a: Y% E
2 I+ @9 U$ `/ e) W, y# }Each time you'll meet this trick, you'll see:
+ P8 ~$ V$ H8 `; o-SI = 4647h
3 o1 f* [0 L! ^+ m8 F-DI = 4A4Dh
: c( P( ^# w2 U0 T0 \. `Which are the 'magic values' used by SoftIce.
- R6 }5 t+ J( W {0 q" @& s+ ?For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: N- `5 I* J& M, S1 m' m% S& `
# X! h$ S+ a0 \, D* c6 S6 `Here is one example from the file "Haspinst.exe" which is the dongle HASP
' Z: I9 [% C c( CEnvelope utility use to protect DOS applications:
0 y$ m" y4 s1 c) Q, W% t3 j4 f5 V+ ?+ M6 D3 f" J4 b* g
, a2 N+ `: g% W" h/ k! C
4C19:0095 MOV AX,0911 ; execute command.
: `& Q1 A. }2 o( `1 T2 v8 I4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
/ v1 X$ n, t; ~ Y; C4C19:009A MOV SI,4647 ; 1st magic value.1 I) ?9 B# K& e: u7 q. j- x' T
4C19:009D MOV DI,4A4D ; 2nd magic value.- B6 @4 g2 y" Z+ p& ]0 W; J# G
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)) h. W3 @# m% m e5 `+ d' Z N
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
! J0 o4 X l5 M6 j; o4C19:00A4 INC CX+ A) d: Z8 z- {+ \/ Y% A' c/ I
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
3 I+ v$ ?* ]6 J e O4C19:00A8 JB 0095 ; 6 different commands.
( W7 e! G; b* {. `! _4C19:00AA JMP 0002 ; Bad_Guy jmp back.
$ x6 R2 ^9 M$ y4C19:00AD MOV BX,SP ; Good_Guy go ahead :)3 l+ h1 I% |! k. H
0 f" J+ L. T" O
The program will execute 6 different SIce commands located at ds:dx, which8 }3 B+ R: k% v7 Z! t2 j( L7 z8 \
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" A1 s; C% t( o/ X4 ]" S; o) t+ M+ b9 P6 y* `. u
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 n1 |! b6 W4 c6 a
___________________________________________________________________________1 u: f3 m B7 X, E0 q' l; i$ `
. K m" `# D7 _8 ?8 Z% n, G' e( A
+ ?& z0 ?. t. e9 X, I! WMethod 03
2 y d" d# q. Q! E3 P6 L; x: g========= G2 U1 Z, r1 `% T4 a6 N% i
* d& l2 u0 e) f# Q8 _# I
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h8 a% Q; L% T" L0 C) h" G4 N6 E
(API Get entry point)
# p! [/ Y* t' P( L
* t! G4 t" Y# S% i; o& Y4 q8 n, Z k$ n8 h3 }, \4 D( z3 g
xor di,di3 b% O5 h: N: \# t) U$ k# E
mov es,di% N" @; l9 \) v0 h. b3 d
mov ax, 1684h
z: P# e3 \. B5 U. M$ Y mov bx, 0202h ; VxD ID of winice
, r/ ~0 B/ b A# \ F int 2Fh0 ^ w2 v* _0 m/ T- s
mov ax, es ; ES:DI -> VxD API entry point
* D# F* F9 ~# {" J. o7 ~ f add ax, di) `- T# c# y5 u% s8 s7 T3 N8 v
test ax,ax* R( e+ h f4 V; m3 ^9 Q; s8 \. f" _
jnz SoftICE_Detected
+ N- M' _3 a: s/ G
4 B' ?, ~6 F0 {$ \- \2 y___________________________________________________________________________
T+ ^5 X) w7 D. y1 R! q: P
' U) P; F" a: K/ u! e" tMethod 04
6 i1 b# u- c7 X' j# ~3 v=========1 y; n9 g5 f2 A3 F% N* H
! a2 n0 s. b. JMethod identical to the preceding one except that it seeks the ID of SoftICE# h' U: k3 p8 p ~9 f7 c5 T
GFX VxD.
) D! k8 q, [) L' [: T0 `1 E B' D
xor di,di
( ^! j- U0 D1 m. S- \: x mov es,di
" [& a9 v+ S1 T mov ax, 1684h
" r* ]- t d2 d/ o4 k mov bx, 7a5Fh ; VxD ID of SIWVID1 i. ?, m; T: Z! V! c' [
int 2fh
# s+ x/ y0 g) Q- F: H# Y0 j. ^ mov ax, es ; ES:DI -> VxD API entry point
+ c& f& |) t8 g! l: P add ax, di' W* G6 X3 S( p% t! Z' j& k
test ax,ax# F+ N5 h3 y5 m, _1 \$ b; }
jnz SoftICE_Detected
% @# p3 W) _8 O, [. u H; ?' l/ h7 x7 h3 m8 M* P9 ~. P* E
__________________________________________________________________________
; O2 A5 m4 {8 Z8 K/ `, a& q: _! e4 w/ U3 Q. B+ }( e& z3 A
' x* D8 B6 p; N0 p7 tMethod 05
0 m) l; Q. V! \=========: l9 |+ q2 q8 m( b0 m1 h- \
# L8 V, F. }/ Z' @* R. GMethod seeking the 'magic number' 0F386h returned (in ax) by all system5 W9 v) R& X' R4 n* h. o# u; ?
debugger. It calls the int 41h, function 4Fh.
& W+ N) d# b D: d1 FThere are several alternatives.
% {; A- E2 F4 A6 x/ `9 x: X6 V( d. \. S( U# p
The following one is the simplest:2 ?( n/ D& C; i% ]6 C) F8 C0 F; m
* ` v5 `: W& K6 T* G# ^! ~3 Q
mov ax,4fh
6 _+ N$ n0 R s- L int 41h
1 G3 J$ Z$ L, w# I. J, P& \/ \+ v cmp ax, 0F386$ E4 h" N% E+ I# R5 A
jz SoftICE_detected
! S+ S' G/ W m+ R! V7 z; }: J+ a3 u; p* b2 J
( w- _2 T) w x; d
Next method as well as the following one are 2 examples from Stone's 7 ]' a6 O. e) U- G4 p
"stn-wid.zip" (www.cracking.net):
: p# _" c7 j9 }6 Q0 |- Z9 Y+ Y8 F. u( O% c; |
mov bx, cs' t3 f" s/ W6 _ x( X; X, D
lea dx, int41handler2: ^; P7 H1 @9 H2 n( f5 V3 X
xchg dx, es:[41h*4]+ M- b4 r2 v# `5 W1 A# |
xchg bx, es:[41h*4+2]
% B' v' X* Q- Z5 s1 }; B mov ax,4fh6 b+ @, L/ d/ f0 K( q" S
int 41h
7 q9 x! J, M) X; b( T4 D/ ^ E/ X xchg dx, es:[41h*4]
% L% X* w8 D8 g! s6 c) w( R+ J xchg bx, es:[41h*4+2]* Y$ g3 z+ `8 E) r# J3 ~) `; |
cmp ax, 0f386h
! o1 n5 w+ p0 v1 w# N% U" x jz SoftICE_detected
, r7 G; Z$ _/ |8 \, [8 O* L) L
: K: A; h7 [/ `, t: C% g' y4 vint41handler2 PROC
9 a7 k+ i- U. d% l7 S4 f iret% `; `9 O+ Y+ g' M+ g0 C. ^
int41handler2 ENDP) p+ }# ]8 Z9 X' Y% e( ]
( [1 N' v$ f, J9 _0 a3 D9 C7 M7 p3 l, l C( {
_________________________________________________________________________
" L# \' p: L4 {
% k/ y1 B8 O8 o, t' A2 e4 ~3 |' @ R a- l. S) v6 d; \
Method 06
3 r5 G( W2 k2 r; F=========
- V* B& R+ p' k I! E& Y
$ ^0 ^4 n0 M% R& n; l3 @0 B1 H0 Z7 T# C$ i- ` @
2nd method similar to the preceding one but more difficult to detect:& b; s S, _6 T
9 B( C- o! D( \+ h% @$ K
: C! v. x; q; H# I8 m: L1 X- Q
int41handler PROC
/ P- z, d7 @6 B+ c2 b' j mov cl,al
/ a: f3 A# Z' H, s, U8 P iret6 m. X, R' [ W% Q
int41handler ENDP
+ O$ O0 W! j, q. a7 Y
# p0 T; Q$ ^, |4 P- `
) \: i- \- ]5 U xor ax,ax
' |. z2 G7 |& M3 e, f mov es,ax6 Q( ^6 f7 k+ }0 J) y
mov bx, cs) G" w4 K& M# u7 I6 a' _! o
lea dx, int41handler7 B' u0 F! }# h) ~! R
xchg dx, es:[41h*4]# b# ^& \ v2 S) E j2 h: |
xchg bx, es:[41h*4+2]
) U9 Q0 O/ I0 H" D in al, 40h3 q* j% H: N% Q7 A7 e3 O3 b
xor cx,cx2 f/ _9 T; T1 e% F4 L3 M
int 41h
3 L# V3 r6 j1 {" l/ { xchg dx, es:[41h*4]* e3 G3 _$ b# F/ P: e" p
xchg bx, es:[41h*4+2]
! K4 m: W8 v; Z; j cmp cl,al. K$ Q8 S, r/ y; B: O9 u
jnz SoftICE_detected% D( k* ^. m- |9 Q) ^
! C( t5 U" }- V. L
_________________________________________________________________________
& ]. t6 _/ `( l0 a7 ?# B8 l+ T! v6 H) x' G) E+ i; Z
Method 07
& z9 r: I5 B( \, _; O, g" Z=========! d- ^6 n/ k+ C% E3 k! u6 ^
# Y& o+ d+ P9 f. ?- ?, Y4 A' z
Method of detection of the WinICE handler in the int68h (V86)
" s% b; I d+ q: u4 y- R
8 b% R+ o w# A mov ah,43h
/ ]' u Z. q& B0 n int 68h9 N' y1 O# A3 g/ v! h& u5 o
cmp ax,0F386h5 D* o" @: i& r8 R" C" M
jz SoftICE_Detected
2 V6 t: ~6 [. o9 h: |6 J2 o! r. _( y* M* V
0 o m1 f# f" U& o/ m% D4 p
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# @0 p) Y6 h& [; T
app like this:) h' E. G2 J& b0 D7 `' {: A
0 k5 F) m+ H5 l0 L BPX exec_int if ax==68
Q: z: [' _$ } (function called is located at byte ptr [ebp+1Dh] and client eip is
1 a. S) X& y: }( e% _" h, ~ located at [ebp+48h] for 32Bit apps)& ^" z/ I3 w1 u2 _0 |
__________________________________________________________________________
# g' a. q2 d5 @* P' J2 I7 j
2 Q: o# {8 |& }7 }: _3 v- {, F+ q( e2 h3 ]
Method 08
& b0 H/ }3 O7 R0 i=========
# _- u9 A7 N5 A( N
* E3 }5 |( D7 UIt is not a method of detection of SoftICE but a possibility to crash the
' Y, ^5 B* @; o1 ~system by intercepting int 01h and int 03h and redirecting them to another3 H3 |! @6 I+ U E6 w+ l4 ?
routine.
) Z( C+ N4 D& @, YIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 p* B" a( H1 \( g
to the new routine to execute (hangs computer...)# k/ H% D/ ^+ A8 Y p
! }! q& `% P9 d' v" C mov ah, 25h9 w; i8 z0 |3 l3 i
mov al, Int_Number (01h or 03h)
. H& H' @$ U# @$ f0 z mov dx, offset New_Int_Routine
9 z& ?' _9 C: {7 Y( j( @ int 21h# _0 X0 Y; G1 f5 ?# a
3 p- V8 x$ W+ p1 O' W( M2 N__________________________________________________________________________9 d8 o7 z# K" H: \3 }1 ?+ \
/ p2 M N1 c3 p
Method 09* n% i" ^- i% C/ \7 v
=========
( i+ j- m& T/ f1 C* L d7 ]$ s8 \% d' |
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( B+ L2 n3 ]5 K9 G, L* m5 L7 ?
performed in ring0 (VxD or a ring3 app using the VxdCall).: X/ I, F, A. C* D1 a2 D
The Get_DDB service is used to determine whether or not a VxD is installed
, |1 G& }$ ]/ }" _for the specified device and returns a Device Description Block (in ecx) for+ L4 `# l3 ^. e2 K! L
that device if it is installed.1 X5 p1 ^9 }3 E7 a+ s- N; z9 I9 e2 C
- W$ Z" m1 O/ k9 B8 m2 Y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ N! l. `2 j9 x8 n' C0 X5 R5 L mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" j2 d) E! N9 G* M3 W; p8 H S+ w* i VMMCall Get_DDB) ]- j/ l, V- F5 v# ?- g
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 X7 ?' S: _; |' \; W( A, B9 Q- M, S9 p
Note as well that you can easily detect this method with SoftICE:
7 `: U& @3 h% V bpx Get_DDB if ax==0202 || ax==7a5fh
$ c3 e1 ^) E" I: b$ D# t: j0 {" @0 f6 X9 P! K0 D: t
__________________________________________________________________________
: `( Z9 g0 w4 W% }# X; j! d" l
Method 103 [3 b% q6 F+ ^, u! g
=========/ l- P/ ]/ u% f0 c& s7 u. k
# O3 a2 H( W7 w5 `" C5 z1 R+ P4 }=>Disable or clear breakpoints before using this feature. DO NOT trace with, t. k, V# x$ f
SoftICE while the option is enable!!
( Z9 r0 v" B: r7 w9 W5 Y! t* n) Z, X
This trick is very efficient:& j- C1 P! H! _3 c
by checking the Debug Registers, you can detect if SoftICE is loaded
, m1 V( M( W# Q9 }& D7 z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# g5 b4 j9 ]% N, S6 F; z4 hthere are some memory breakpoints set (dr0 to dr3) simply by reading their
. o: ?& c4 F: p8 g8 Z' a/ Zvalue (in ring0 only). Values can be manipulated and or changed as well1 C1 W4 C, p; x1 n% L! |/ _
(clearing BPMs for instance)
% ~, h1 A, G' n8 K& F c; b2 V3 b3 z" K. g# _, i+ u
__________________________________________________________________________
7 U$ ]; i' z9 l5 F: {- H3 I" s7 Q" w/ c6 e# H/ a) o
Method 11; F k) Z/ K9 c- k' s
=========9 p9 B1 K& p1 {4 Y# b% a/ g) f
- F2 K) r, o/ X3 KThis method is most known as 'MeltICE' because it has been freely distributed# Y/ Q2 A& E. b: {! r
via www.winfiles.com. However it was first used by NuMega people to allow9 |) X0 @. T7 v/ g
Symbol Loader to check if SoftICE was active or not (the code is located5 |0 f1 W! h. T
inside nmtrans.dll).* O E3 q0 f) w7 M
- Z5 L% O/ ~' J% tThe way it works is very simple:
$ _4 X k( {8 _+ n9 z$ hIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& P4 h. O7 r3 v u, l r" D, ?
WinNT) with the CreateFileA API.3 ^/ o8 o0 l& G% }, U9 U
$ i) B e( g% E7 K* S' H( d
Here is a sample (checking for 'SICE'):8 g, @9 I9 l; t$ U
) ?: ~1 {4 P2 E D) u) ?
BOOL IsSoftIce95Loaded()& [5 C' g* H9 Z5 u$ _
{3 w( g4 Z$ o6 ]7 d; r6 c$ s, m
HANDLE hFile; 7 F. y5 Y+ X$ w9 l
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 o" x& h: Z/ u1 w) H' i FILE_SHARE_READ | FILE_SHARE_WRITE,
+ E8 g0 P% s- c* S NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);& U; e8 y% {" j$ T" Y% U+ A
if( hFile != INVALID_HANDLE_VALUE )% |, C4 I- k( ~
{3 p9 [4 I T8 ?: e5 z- M! j
CloseHandle(hFile);
/ V/ n% [- r: W' y: } return TRUE;, E+ U, M0 S( |2 A
}* S. f% G0 u& ^
return FALSE;
& s5 q/ q" [% P, ^4 _& s}
& p3 M' L& Z9 Z/ G* p
5 N$ W \2 ?) B0 q7 j- WAlthough this trick calls the CreateFileA function, don't even expect to be
% J/ w4 ^$ A F% h# X2 Rable to intercept it by installing a IFS hook: it will not work, no way!$ I( P# l/ g- J; _! R
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 ?; s' L: N1 p4 r1 Uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 M( f v' X0 X1 |and then browse the DDB list until it find the VxD and its DDB_Control_Proc( v3 D5 ]5 f V
field.) w2 o1 z# P4 \& L$ I
In fact, its purpose is not to load/unload VxDs but only to send a , Z5 B" \4 A9 ^# `& L; A' M
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
`; d7 X. L8 u9 F7 D( fto the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 a; L+ p: P9 I( r& ~3 ?" Rto load/unload a non-dynamically loadable driver such as SoftICE ;-).& H# k' ?2 Q- g8 d
If the VxD is loaded, it will always clear eax and the Carry flag to allow' e1 |& l1 @6 m" B- I' e! u) {
its handle to be opened and then, will be detected.. ~3 |' f: V5 J
You can check that simply by hooking Winice.exe control proc entry point/ E( s3 |, e3 V
while running MeltICE.( G$ T! K+ n) i' X( a0 G1 G6 ?' r/ ~
2 i3 V( z8 e) Y, k! d& p
4 A3 Z5 t$ ~' `7 D; `5 @: o6 n
00401067: push 00402025 ; \\.\SICE+ {: ~" f2 r( N! t& n8 O
0040106C: call CreateFileA
3 G8 g- Q: h& m/ V) |2 { 00401071: cmp eax,-0011 g7 ^) ]- t3 t9 z4 X2 l
00401074: je 00401091
% N3 @4 ]* ]1 S/ ^- e8 C9 v1 V7 z |1 o% t4 I; l
. D/ O2 g( b. VThere could be hundreds of BPX you could use to detect this trick.9 O/ ?* d0 Y- g7 m$ g" ?. O; G
-The most classical one is: R6 j+ r; w2 D Z0 K1 l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||: B: T- [1 G$ x8 z% t! u- O8 @
*(esp->4+4)=='NTIC'
' b: ^% H c) u# b; I/ z5 l/ A) U& Z
-The most exotic ones (could be very slooooow :-(
/ ^0 y+ \7 Y k/ N# {2 r BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
/ d& s, [9 |7 E8 S L& G ;will break 3 times :-(, c, S( M* X0 D) n! T& u5 L( M
1 w, W$ w& T3 t4 \, v-or (a bit) faster:
F4 `1 a+ o9 d9 G+ g1 m BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). P4 z% K- I; E4 x- o* J9 C6 }+ N
; D, N- q4 x" ?
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - U, {# e1 i" Y
;will break 3 times :-(
7 g7 _) l# ^* `3 V" \+ U7 N' t }9 {3 d7 O( q# A8 {- e* m: P
-Much faster:. e8 d' V8 c9 i- ?
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
+ h6 s4 K8 Y4 {; `, M0 d, F& a5 {3 p5 |/ [8 B, q( E' } `2 O
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen" H# a8 {0 x- Z# Q
function to do the same job:' k' H W+ r, w
9 g! x6 p+ m$ C9 I) A% A5 B
push 00 ; OF_READ/ C1 ^! e, }" X1 U! z
mov eax,[00656634] ; '\\.\SICE',0$ {' X: m, `- \" Q: {
push eax* V; H- i3 V0 V3 [/ u+ Q
call KERNEL32!_lopen' N7 P% h( K8 v- i" m
inc eax
, p4 R: I( W: _ jnz 00650589 ; detected
" f, E$ t) g3 s+ H* G push 00 ; OF_READ
9 a0 e5 V( U4 U; M& `+ N6 Q mov eax,[00656638] ; '\\.\SICE'
- I3 ?+ \! w: P8 }7 \ push eax
- b8 B4 [3 R0 h6 n call KERNEL32!_lopen
/ Y3 Y" R' I7 _, J inc eax3 {; R) M0 w( f9 ^
jz 006505ae ; not detected! m; _2 ~. S: `3 d1 L( x
8 F9 F/ t) C) w9 g% ?$ \' v
, u% K. h4 M$ \__________________________________________________________________________
2 T9 p) o( j. Q5 s, P* D9 \$ y9 `
( s+ E# _. p+ N& N- n( W$ YMethod 128 f4 x. n4 b0 z+ A* X3 a0 C
=========
1 a" s0 g$ Z; [8 `: \' r* q# z0 A, L, h3 y6 ^* i8 X
This trick is similar to int41h/4fh Debugger installation check (code 05
7 z9 {) B. N2 q2 w& n5 B6 V& 06) but very limited because it's only available for Win95/98 (not NT), d0 D* A7 P% D) Z% B6 T6 C
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
- W0 j; e) D% c8 z) Y
. G; d; u7 S. x/ I- e push 0000004fh ; function 4fh
+ B9 X) Y. a+ D Y1 y: M; f# S, j7 Z push 002a002ah ; high word specifies which VxD (VWIN32)+ `4 h# T- {- w v) w- d
; low word specifies which service3 \7 L$ @9 M+ s# d
(VWIN32_Int41Dispatch)
1 @' Z5 m, c2 z! t! y0 ~! I+ U5 b call Kernel32!ORD_001 ; VxdCall- n: W n0 x$ ]
cmp ax, 0f386h ; magic number returned by system debuggers" r4 @ ?( v* u* x" r
jz SoftICE_detected
3 i/ X# ^) ?$ I& k+ L0 n; t
8 r. }1 V0 ?& p' t. CHere again, several ways to detect it:+ g9 I3 E9 C3 o- I0 x4 f( d
0 S9 s: Z( j- x* t" y+ @ E
BPINT 41 if ax==4f7 N$ Y2 s4 h2 C4 H( |
. `6 Y! a3 y" u2 u2 T8 C* s7 I
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
" b4 T; L& v1 P, M1 m5 ^
9 s& |* s/ r' D$ U7 o' d BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) ~5 L4 E9 X+ e. ] |! R3 M. e, K5 n6 Z9 v T# Y4 |/ B6 r
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ q# Q0 E( `6 C6 K
- B" F1 w, n) A% h) m9 [
__________________________________________________________________________; F$ @( z+ [ m5 v/ g
) ]1 {9 h9 [( T* p8 w% e @5 dMethod 13% X# v6 L4 }2 c8 V% T
=========
" O5 A+ Z( A @8 ]* t! k; t
5 X" X& n) Q i$ N! n8 gNot a real method of detection, but a good way to know if SoftICE is
1 c+ S. c* [. C0 X3 F. m# A" Rinstalled on a computer and to locate its installation directory.
6 W# G7 b3 }! LIt is used by few softs which access the following registry keys (usually #2) :
& I) L8 z( Z/ y1 L
z' R$ m1 x( u' o" ?7 y7 }, }, m-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# S7 ?* d% W$ m& O/ d+ o- I: d
\Uninstall\SoftICE n9 A! S# V6 e- t; F7 \& z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
^ g9 G. o) ^" b3 \-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% Y" Y$ r) a+ n. ?
\App Paths\Loader32.Exe4 |+ U! f1 |( g: v
2 u* j$ s8 H$ Y" \, M+ f) [+ L9 h; V& v! \* A' X, Q& x% s0 ]' G
Note that some nasty apps could then erase all files from SoftICE directory( r* h8 d. R$ {' f
(I faced that once :-($ R# l- a. u8 s. S
; b$ m4 k, g3 j- j2 x0 E5 W. |Useful breakpoint to detect it:- Z- x8 X) N* F" j5 l6 V" b
% n: a* U: N& J1 H }$ d
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'9 M1 [- W. D) ]) G& A
$ o, f& i% G$ u4 u' g0 Q. x2 z. f. I
__________________________________________________________________________7 D: h% r9 e, }9 R
& ]4 s2 H4 C7 _( x/ O8 i
1 v; l. j) A* d q+ S6 r; O0 ]% aMethod 14
) P$ R5 x5 M! B. Q! n* y8 G=========
8 L- C; k! N# h' H% t- A8 a% S- I& q6 A' h2 ^. f! P& W- t
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- v o G. r; ~8 m |( ~! Tis to determines whether a debugger is running on your system (ring0 only).! M/ B8 \1 r8 N6 L, f
+ D6 P! I0 C2 R3 l5 \
VMMCall Test_Debug_Installed
9 q+ @) I5 g9 O: P, O je not_installed9 q% V2 @% z/ Q: K# U4 e- b& f
7 e8 g3 b8 F4 }* z- HThis service just checks a flag.
0 K% @ @: t& H( N) v</PRE></TD></TR></TBODY></TABLE> |