<TABLE width=500>
P4 B8 l6 k! c' M/ w; z% ^<TBODY>
- V+ D. G- L% Q0 V# n. n7 P3 U<TR>
2 r( ~; _, ?- g4 j7 t: e<TD><PRE>Method 01
# V1 d( J S3 T; M4 |& u. }0 b=========* Y5 r E! }: o
) ~' }1 a5 F5 j2 d! IThis method of detection of SoftICE (as well as the following one) is# {5 E4 i$ v: x% @; y3 f
used by the majority of packers/encryptors found on Internet.
6 e# E4 T. i1 u% FIt seeks the signature of BoundsChecker in SoftICE
1 L# M8 k8 [( H; B% {- A8 B
+ L# N3 b: ] e mov ebp, 04243484Bh ; 'BCHK'* R- Z5 [ O6 Y/ P, |
mov ax, 04h% `+ @/ c9 O* p) ~
int 3
& Z/ x$ o# t3 ~& z cmp al,4
5 ]/ M! n2 D. N" v jnz SoftICE_Detected( u) _: G4 d3 G- R3 E7 x; O+ W; I- u
# _- z8 p- A$ [ K/ I. }, B/ R
___________________________________________________________________________
+ m5 ^/ S' |5 s( b$ X3 ?
5 i1 P6 h( Y/ ]3 {) P5 }Method 021 o0 y8 b& B' r' d5 Q
=========
& g# l; @( n. G# y. G9 Q/ F& b0 K" i/ t! n
Still a method very much used (perhaps the most frequent one). It is used
* S# K8 n3 Q7 O1 F) |4 h& b& jto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
3 J6 M7 I; V( V- k& Dor execute SoftICE commands...& |2 g) ~ X& J9 g
It is also used to crash SoftICE and to force it to execute any commands7 z/ N+ e% y3 }, T/ {8 S
(HBOOT...) :-(( 7 I4 r+ h$ u- Y4 O
2 J+ ~5 h( v, Q, @" B
Here is a quick description:
* L# N( M: N. s, g; t-AX = 0910h (Display string in SIce windows)
) b1 L% u, y/ }2 m: R-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- H& i. ^5 `& W
-AX = 0912h (Get breakpoint infos)
' x, o! G3 T) |0 j% t6 a-AX = 0913h (Set Sice breakpoints)4 C( W& F7 c3 Q7 \
-AX = 0914h (Remove SIce breakoints). z2 o1 q/ j1 }1 X
$ m) F7 `* Z6 S# G! u) z& i0 KEach time you'll meet this trick, you'll see:. Y9 H/ V" H- r9 i9 q( M" [ n
-SI = 4647h9 u) w; p- P& S
-DI = 4A4Dh K4 r) J: C, Q8 U' Q. ~% Q. Y$ e% P
Which are the 'magic values' used by SoftIce.
; a8 E+ U1 [8 T; v; AFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 J X8 X, r! Z t7 K( A8 H* K/ @' s
6 x* F, o" {1 Q; c) h! H9 OHere is one example from the file "Haspinst.exe" which is the dongle HASP
* @; t J1 @4 p+ WEnvelope utility use to protect DOS applications:
5 w5 j$ ]. j' @, q+ \7 z+ I( a/ } G9 R. H- ~
8 s" s/ G H5 M w4C19:0095 MOV AX,0911 ; execute command.
$ K- m# Z/ v3 x7 Q$ r& e7 P4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).8 V9 U- N2 n, t
4C19:009A MOV SI,4647 ; 1st magic value. x$ h( q; Y) B V* C! l( y! o& [
4C19:009D MOV DI,4A4D ; 2nd magic value.
8 W1 h" C. i. i& m3 u' H! E4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)+ j4 r- x/ I3 Q# `) I
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute& D2 ?- I& \ L) Z+ \
4C19:00A4 INC CX
4 u4 o. _2 B$ z# W" E3 U0 i8 N# H4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, M9 L. {, o; T6 l
4C19:00A8 JB 0095 ; 6 different commands.
! H- I. h; @( [2 v4C19:00AA JMP 0002 ; Bad_Guy jmp back.! K3 q. j6 @2 d7 \) V
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)* T) d4 S6 d/ {
/ M! z# C1 |1 P# ? p; K: XThe program will execute 6 different SIce commands located at ds:dx, which
?8 o6 o: n, Jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 b6 w( {4 f, T) s @) G# R, C5 B! L) A* H o' g) R: L
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ N0 O6 i/ k1 B! X
___________________________________________________________________________; J D3 Q2 `6 E1 v( Y
7 Z5 u) }7 S6 W) V, c
. D, |" |/ N f9 V% GMethod 03
0 e2 X/ d8 W: v5 b& J% K4 |* `=========
( `* A7 |" W, j
! Q" I: Q! N* L9 L/ D6 @: l5 ^Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
3 `! s, r/ E5 `2 _# W(API Get entry point)* U( n) d; G" q- H; Z# ~' V' S# y1 W
% a; {" J0 X; t: u( r; P j" |, j- K
6 t( _# m j. R6 x% a: `- m- c M3 T xor di,di
9 b' P( W6 {0 L5 z' h+ D: [ mov es,di* Y# Y5 O" c0 B/ V7 g9 Y4 I* y
mov ax, 1684h
# C, @# c9 i- d6 }& A mov bx, 0202h ; VxD ID of winice& \0 E3 n+ j. K' x8 R6 M4 }
int 2Fh
% G# R/ |- k8 j7 r; ] j, m$ c0 h mov ax, es ; ES:DI -> VxD API entry point7 z' A. W& c" b @2 p, a
add ax, di
% x# H$ G/ g3 w& t5 O test ax,ax6 A$ P' H9 @% |9 E# m
jnz SoftICE_Detected
5 x& [" e6 X N( g5 c! f" ?) g
& Y8 _+ K, G8 m" `; |, @___________________________________________________________________________4 G' `) h( `7 r8 G* P
: z4 e4 _' E$ y0 F" `- G
Method 04
* Y, h3 P" j0 W8 e=========6 G& [8 p$ L+ N/ P( {/ ~% C7 g( g
# w' f# K7 v: Z2 B" l5 \' a( tMethod identical to the preceding one except that it seeks the ID of SoftICE$ c o$ q5 I3 W
GFX VxD.
4 L, w: ?# U v& P4 B
4 p# _2 I$ c9 l& g. W3 B! e xor di,di0 _% M' g8 u# F# m3 L
mov es,di8 l9 n' j& Q* ~2 m
mov ax, 1684h
" K- S7 Y' x: z D mov bx, 7a5Fh ; VxD ID of SIWVID
9 A4 u1 a& N' y- s! L- w% l int 2fh/ b( y2 r: `; L% }) ]" X" G3 J
mov ax, es ; ES:DI -> VxD API entry point
! x6 Z. R' O; m( u; S' g add ax, di- ~- @: L( l: L) F9 h% k
test ax,ax4 ], P: }2 z0 t9 ]2 _2 d- `
jnz SoftICE_Detected
" J4 Q" ]) N6 I4 t! [1 ]9 K
. U+ K( s" ?1 \8 `) b__________________________________________________________________________
" [( ~1 x. z' U- K" @" M
; y1 B! Q) i1 ?% F& Y4 `, u2 o2 ~( t+ s3 n+ C
Method 05
+ O9 n5 ~, X+ m=========
x& U3 _# ]! i3 ?
$ b" G3 {- r* yMethod seeking the 'magic number' 0F386h returned (in ax) by all system
1 C' y; h1 N. H& D7 ^debugger. It calls the int 41h, function 4Fh./ \7 M5 \3 \- o5 C; ]9 d1 u
There are several alternatives. 2 `5 I- g" x4 C' B; y2 Q
5 p# m6 p# e8 I1 S2 K9 V+ c
The following one is the simplest:
: h; a4 ~3 i, j( t' _$ y% G5 I& _ V, R9 T, P
mov ax,4fh: Y" ?- |' T' w6 I
int 41h
+ e3 E3 Y' `9 i: M: i1 K cmp ax, 0F386. R4 t' p" k- {# u c" a
jz SoftICE_detected
) `1 r! ^, u$ Z: r! B2 ? A7 ~" n+ c2 L4 {8 X* ]6 i' d$ Q: r
p- p) M. T$ }- ^) F! h
Next method as well as the following one are 2 examples from Stone's
0 y" c8 f! Q) V" q"stn-wid.zip" (www.cracking.net):+ N) x5 v7 c5 Q) l# P
1 B2 ]/ M/ ]/ O: k! i$ `$ K; ? mov bx, cs! B7 `% ]7 E5 l$ L- u
lea dx, int41handler2( N8 a0 ]( s9 M6 G6 h+ r
xchg dx, es:[41h*4]
' ?1 P* ?3 r. i- {( v1 a0 ? xchg bx, es:[41h*4+2]
7 D7 q6 O0 T3 q& r t' q mov ax,4fh& i% x; d3 n) i1 f
int 41h
! d6 l% x' |6 @/ [ L1 h xchg dx, es:[41h*4]
( L- C$ S/ z+ K! z xchg bx, es:[41h*4+2]
2 I5 p/ l- ]& U) U3 j" L cmp ax, 0f386h
# R; R% F) T. z( y jz SoftICE_detected! W2 \2 ~1 O3 H- z- j
0 }' J1 m& V9 n u" M# O* p8 tint41handler2 PROC" c3 q: y0 C z- `9 a) ^2 P8 z
iret" F! w0 Q- }3 M- S3 N" z
int41handler2 ENDP1 I6 Z5 M; ]' u9 t# ?3 j
; J0 |+ G( A6 r; @1 p* A T+ V0 Y
_________________________________________________________________________
) ^/ \; a2 T8 |9 a3 h" j- ~' L) {+ b! C4 z* G8 O
# M& u3 e8 a, D4 h+ i: I
Method 06
x0 g3 t- L" T6 u=========
3 `5 L3 J+ ~0 [$ Y! @; _' h7 r' P* A p/ }* X
7 t2 J: c. R* p/ j: b2nd method similar to the preceding one but more difficult to detect:
9 B" X1 G1 `$ w/ _) I3 b }8 J8 ~6 q+ ^1 U" d _
) B) x% y. x. k4 I1 Cint41handler PROC
0 _ C9 P; U' z mov cl,al4 K! _" f$ v* j1 F, R- ^
iret- Y$ T r* C+ V' r
int41handler ENDP
) A' l7 L3 O8 y6 [' N9 p, {' ~, @1 L2 Z7 B0 }5 I+ h
" w/ }) }. o3 M3 ]7 X# j$ n
xor ax,ax! l2 ?& z- u. |. |* b. u" q* G! n
mov es,ax
: c+ }5 U: M) x) x mov bx, cs
! H3 G) b& ~3 v# s3 |& S lea dx, int41handler
! O; J, Q3 W5 ?1 o& E( ] xchg dx, es:[41h*4]' H5 F* f- a1 P/ k
xchg bx, es:[41h*4+2]
! O0 r& {8 m& E- r# m in al, 40h
( C" d+ Y; b( K7 ^- ^, H8 C+ i xor cx,cx
* e8 n, M; S6 W4 E int 41h
# x( k- e2 Y) O8 R' _4 h xchg dx, es:[41h*4]
& b, u3 S# J) E xchg bx, es:[41h*4+2]+ L, k0 t% z! E4 c9 }
cmp cl,al' U( N) w$ C: Q/ [! w' ~
jnz SoftICE_detected/ L% I0 ^: h$ C/ D" T, F9 C
& n; e, M5 v1 m9 H_________________________________________________________________________9 ^2 k- q0 J* a6 p) s! L; l9 R! g
8 f+ }7 l! L! @7 w0 ]% [8 cMethod 07% E, ?- p5 V% b1 g Z
=========& r4 N( H$ J4 a3 C; N! e
+ J7 x+ _% K1 [. [* \2 m7 MMethod of detection of the WinICE handler in the int68h (V86)8 D% \( H" y8 k8 g0 e0 q4 f
- R% [/ B* G+ q, A
mov ah,43h
3 v, G$ Q8 s6 h) i6 y2 _ int 68h& p2 Q: ]/ c% ^) B! `+ v
cmp ax,0F386h7 y- v7 a& S9 d+ I
jz SoftICE_Detected C; x, g' U2 p. H" W
8 V- J0 g1 R+ J, R
' [. W) q7 s1 d" Y; R
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
/ X( Y7 G2 }) k [$ E2 { app like this:
3 |" B# r; m; N; `" F; K) O* A" E% i; U
BPX exec_int if ax==68
" x( X6 S3 I6 {/ `# P+ Y (function called is located at byte ptr [ebp+1Dh] and client eip is& S( g/ |: R3 q, b
located at [ebp+48h] for 32Bit apps)
. j7 f# a" }. Y2 }__________________________________________________________________________
( t+ N' s+ Y" E! J: X( R
/ @' ?% `) q/ z) M6 ~# K/ O
3 f) w- A, D2 ~, X0 M* eMethod 08! z7 f1 C8 C2 i* \9 g: d
=========0 w, P6 H1 m9 O! P
, N# z7 n9 k6 @# H
It is not a method of detection of SoftICE but a possibility to crash the
$ z! `; }) C6 r/ ^, ]; T& Tsystem by intercepting int 01h and int 03h and redirecting them to another5 Z9 l" H; N% T9 o8 w: h" b! t
routine.& U- R- M) I x/ Y) ~
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 j7 L$ ]- b9 \1 ^* } dto the new routine to execute (hangs computer...) z: n/ ?$ P: M, z# `& U, \
5 C$ }% q1 j3 l4 q+ S5 c2 r mov ah, 25h
8 r* |: O) C# ] mov al, Int_Number (01h or 03h)" G6 q1 l1 }1 h9 A& f, U6 w7 V' X
mov dx, offset New_Int_Routine8 B5 n+ p* w) I
int 21h
$ E& m9 O- J6 \5 U V
4 j# d; p/ ?/ r2 d, W2 j. K; J__________________________________________________________________________: J4 p; N& N/ Y9 d- m
! A. M" s4 E o& u* v1 x. L
Method 09
4 `. a4 @& c2 w" V. b4 E* D=========, W* V! t# z E
2 [$ U5 r# u8 ?3 ~
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* w; b& N/ @+ ~( ]( _
performed in ring0 (VxD or a ring3 app using the VxdCall).
) Y/ l- o u2 L+ ]$ o; H- r1 |The Get_DDB service is used to determine whether or not a VxD is installed
. d) a( U( O3 Q& W" H9 _% t1 Vfor the specified device and returns a Device Description Block (in ecx) for8 n3 Y4 M8 G0 b- z" S8 L: k# P+ M
that device if it is installed.6 t' _$ ~5 ?# E4 _4 ]9 \
0 x. _" Z- j/ L0 G E% G
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 @7 V* K2 }8 Z0 F, I mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ A; P3 k: Q0 j
VMMCall Get_DDB5 I+ c7 m5 _. z* c; M. Y3 ?5 s
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 H B) b D8 m) u- s
; G/ D7 U* N& Y# U
Note as well that you can easily detect this method with SoftICE:* U( k- K( B6 I3 j/ T l; _
bpx Get_DDB if ax==0202 || ax==7a5fh
7 `+ M+ f) k, b2 y+ E+ F4 m( Y7 Z4 x
( Y( J3 ~8 H; K+ [' f__________________________________________________________________________
3 U8 J$ l; Q, r! O6 s @) e1 C6 s* ?+ J+ L5 Q6 Z. n+ q. ]5 T
Method 10/ T9 @; I: x- q, l9 m1 n. X' o& s
=========
% F- m% ?: N2 E& f _+ I3 ^' G! C
; @1 t c, M* o: W=>Disable or clear breakpoints before using this feature. DO NOT trace with }* m+ E. K! d
SoftICE while the option is enable!!* F. a0 p! e }9 g7 T
3 k7 D( \# y6 n) q0 Z
This trick is very efficient:0 W- f# x7 i1 m5 U/ ]5 s
by checking the Debug Registers, you can detect if SoftICE is loaded7 }; X( ?% R6 S& s7 |
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
0 q5 V. ]7 M( s x$ Cthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ I; o( E# H) B2 I5 Gvalue (in ring0 only). Values can be manipulated and or changed as well
6 W X: H8 ^! q: `% ](clearing BPMs for instance)% z4 z% Z1 C' R/ m6 U
H+ s% a8 T5 I; d
__________________________________________________________________________9 m# J1 w6 I% ~
4 q! ^+ o/ Y) v% EMethod 11
- T6 O' l6 ?; O: j! s=========. v$ X+ o% b f5 L$ O; o* E$ r; ]
7 B, m$ Q0 B" G( O1 I
This method is most known as 'MeltICE' because it has been freely distributed
1 g" w) w2 ?7 ~$ ]! kvia www.winfiles.com. However it was first used by NuMega people to allow
. H$ ^; h' C; K$ j* c8 ?2 ]4 vSymbol Loader to check if SoftICE was active or not (the code is located( @% _1 R0 p; o% Q" [
inside nmtrans.dll).
4 U& ` {5 l' T+ s
4 j7 a) `# S" Z6 i3 |4 }The way it works is very simple:
- a) Z3 R0 X' u l3 bIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& L6 G) t0 Q q3 ZWinNT) with the CreateFileA API.
4 W; Q3 e6 _# G3 L3 m0 ^; F3 I+ H3 p5 {
Here is a sample (checking for 'SICE'):4 L) w; \; s1 D* I/ {& L- t6 d& a
; P" \ B! K/ S; n0 Q$ E/ LBOOL IsSoftIce95Loaded()2 L q/ f$ s* d3 D8 p# j
{
0 d0 l) E4 ]' P& _& s9 [( k HANDLE hFile; & ?- ^- Z0 ~9 I( C2 @: y6 [
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( I2 u! I* i2 @5 _% C
FILE_SHARE_READ | FILE_SHARE_WRITE,
+ K: j/ |6 G% J7 [ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! [: p4 C W4 r9 X' I8 T! y if( hFile != INVALID_HANDLE_VALUE )
" }3 j9 ~3 h/ z, v {6 I) a: A( d5 j3 u5 L9 t/ [
CloseHandle(hFile);9 k+ V* h1 _1 h
return TRUE;
5 O+ x9 I# Z3 @2 p" W3 ~ }* Z; p0 C4 P' Q: f# s% J( U9 v8 m
return FALSE;0 o3 N& E' h9 C1 A* `
}
1 [9 p# A- Z3 O3 _5 Y) j+ D% l7 e' z U- V
Although this trick calls the CreateFileA function, don't even expect to be
( k. m- O, R* w( Oable to intercept it by installing a IFS hook: it will not work, no way!4 l+ O' p2 J) u3 L- Y8 w" u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
" H6 F+ e$ m+ D. Gservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& a" d4 F0 j t' C3 ~5 F* K5 a
and then browse the DDB list until it find the VxD and its DDB_Control_Proc0 l4 \6 S* k* Y k
field.
1 D& J/ e& Y" ^6 P7 ^4 ]+ R# vIn fact, its purpose is not to load/unload VxDs but only to send a
& d1 N/ Y6 M! _8 g- d4 YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' c& X- C" ~% y1 Gto the VxD Control_Dispatch proc (how the hell a shareware soft could try# e2 @( q7 Y$ d% i5 l" @
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ o+ \* |& |, Y r/ ?If the VxD is loaded, it will always clear eax and the Carry flag to allow
6 O% }- ^- a8 a# u; gits handle to be opened and then, will be detected.1 m/ }$ n2 O( m4 q1 `- Y& A& e) C
You can check that simply by hooking Winice.exe control proc entry point9 i( A U9 n4 i0 l# q8 }0 Q
while running MeltICE.
$ `9 O2 l1 ]0 I) P5 y
, f2 |- v8 n4 N, i6 R1 c( E9 B4 ^. [- w/ j# C
00401067: push 00402025 ; \\.\SICE5 H& W- A& E! r1 a
0040106C: call CreateFileA% Y( T: j' |; g0 x
00401071: cmp eax,-001( z: Q$ K3 \$ h7 T' P. n( x& w2 i
00401074: je 00401091& j3 d4 m/ m$ N% \! ~
- }2 V8 O! D* ]+ p: N
% z2 ], H+ F5 @0 q+ `, _
There could be hundreds of BPX you could use to detect this trick.1 ~8 Z P' I. R5 g: J
-The most classical one is:8 l# C3 _0 R. C Q
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
. `, Y) ~* M. B4 z. V2 n( a *(esp->4+4)=='NTIC'6 z8 W/ j5 J. H4 N1 Z
$ {+ m( e0 Q( C( g-The most exotic ones (could be very slooooow :-(3 Z4 R% K' h1 x
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
3 G4 o+ u P3 o$ ^ j6 U5 M ;will break 3 times :-(+ J; C! b% _4 D; l
3 O) x: y; L& U+ g& s- A-or (a bit) faster: 8 ~' R0 @) j( k$ h7 Q) }2 l
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 j: M* e g' D1 Z
/ s; \" ^- \6 }3 N BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - A% ]- v5 s5 V! y) _7 X; o) X" J
;will break 3 times :-(
6 X1 D7 g q6 C' m# g. ^1 V% k% j# z3 L" ?0 Z
-Much faster:
4 U( m) D9 `! _8 g& A) u5 z; M BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 W5 C* ]$ X: W; U9 A+ u
0 Y0 C+ S$ O: p7 C
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen: P6 q! O, z, `3 B. }/ ^* p
function to do the same job:- n7 u! ~6 I( o+ v+ g3 n5 s
3 q- q9 {0 q" D8 a( ] M push 00 ; OF_READ/ I) D- i8 h6 J6 K
mov eax,[00656634] ; '\\.\SICE',03 E7 E/ h2 U3 U
push eax6 C" Y+ N9 W2 q: _+ l8 w4 P+ s# s& A
call KERNEL32!_lopen9 L2 H2 x! X' q1 _- F4 i8 n
inc eax8 w# D$ ^0 M L. V5 b. K
jnz 00650589 ; detected( y2 `' s; C2 t i4 K; o, `7 Z. e
push 00 ; OF_READ
9 d+ `- J1 e! c$ q" J mov eax,[00656638] ; '\\.\SICE'2 B }7 X6 d. B5 z E% U
push eax9 ^$ b; y' [$ d: d6 Q
call KERNEL32!_lopen
# X, y8 k+ a8 S1 x D3 c inc eax. n& W5 I0 d4 \4 C( X# {! h4 F4 u
jz 006505ae ; not detected
! }+ G( A5 l0 l! u: [2 W, c" h" _3 j3 w" ~ e! |) R% b* t
6 X9 S$ o) r7 N4 H2 Z9 `9 f__________________________________________________________________________
! C4 x5 r" h# U6 b3 r( C, ^& h) d: B
Method 12' o3 ~0 k: d# D5 V
=========
* G. z9 F5 F: p w: R
) N8 _8 H" l7 V; c+ |/ |/ R `This trick is similar to int41h/4fh Debugger installation check (code 05
) k* U& m) L+ t7 _+ x5 G4 p9 T& 06) but very limited because it's only available for Win95/98 (not NT)
5 H0 d. P/ n: X1 Vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 c$ O: U% t3 V
8 I0 B# W4 R/ f5 V3 e
push 0000004fh ; function 4fh
6 G- p5 b5 `9 A `3 B# q/ {4 n push 002a002ah ; high word specifies which VxD (VWIN32)2 G& R q& x; V# t h+ J {
; low word specifies which service0 _+ K' Y1 l7 s, x
(VWIN32_Int41Dispatch)
( I; H' c7 K8 M1 l% Z1 } call Kernel32!ORD_001 ; VxdCall' E V, m4 f! l0 F
cmp ax, 0f386h ; magic number returned by system debuggers/ ^7 }% c* d m* U. }
jz SoftICE_detected
* M/ F _" T4 m/ z; n( l+ x4 [ C) J5 r) f4 l
Here again, several ways to detect it:
! }- b2 H1 D3 Q& R
+ ~) \+ Y) l8 y* D' a' |1 J5 f7 } BPINT 41 if ax==4f
. l9 M; O7 P. q3 `" `
( V% U# x& ]& M) \' o# u& f BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: y3 o; {5 ^' R7 x( B+ E1 e
; q' _6 L( u* i+ M
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A2 @) K& p/ v1 J- K7 h! M
) i" b: c0 V% P/ a$ E& c6 V9 \( S6 `+ n BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 v( f( e7 s9 O' q
* F: h' y% H; v; ^$ n- \__________________________________________________________________________
6 H4 b+ R% I, R+ O/ n& ?" j7 k+ e
( l+ G; m9 ?/ X, c2 x8 ^- l6 w7 VMethod 130 W$ i: u4 K- T* C" ]
=========
0 ~* D* `8 }% [* W4 M
* M' |, c. w* V9 f$ T8 c" UNot a real method of detection, but a good way to know if SoftICE is) }# i; k" p; W8 d
installed on a computer and to locate its installation directory.
3 E/ d* P& P: S% i- r3 nIt is used by few softs which access the following registry keys (usually #2) :
+ P x/ a y ]& m( V& ^* N- u
7 @* q/ H$ H+ d) \7 ^-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) Y+ o/ ]7 c5 R: V. |: r& j\Uninstall\SoftICE
6 B @, A9 S, M2 Y-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
7 t2 I q) p; ?5 _-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 o1 v6 L2 d/ @\App Paths\Loader32.Exe
+ X( I: |& j' J- [: z7 \) n# O1 B5 D. I" f2 ?: ~
& O9 d9 ~' }' B" ]Note that some nasty apps could then erase all files from SoftICE directory4 v/ X7 }% ]7 F# g: J' E, v9 x' [! ^( v
(I faced that once :-(
, d5 ?, @' M9 n3 |( W M% C+ c% y: h, O4 l
Useful breakpoint to detect it: b% P8 \9 n" q9 c3 l. u- o
0 [5 d7 H, y$ m! [: I
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
1 G. j" D: H3 E8 \) d
7 u$ z6 O- n# ?/ z ]( u" G__________________________________________________________________________
- c% v: r, g, k; r; ^
7 d) @3 \( {8 X/ B3 h! U
6 H0 ^0 K+ ~% {2 g+ g$ z9 EMethod 14 2 u7 e( @# M/ M0 {% {
=========, ?$ F5 R' ^: h' k/ `2 R8 L
6 M( Q H' _2 @7 @5 J% RA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 i. n/ D6 `2 Y* `3 N, o/ f+ F
is to determines whether a debugger is running on your system (ring0 only).1 ~4 G2 g' h% @) N: ]$ K; Y
8 J! {% K4 T8 T) L VMMCall Test_Debug_Installed
* O* ~0 q4 L5 N: ^" e7 @9 v# k3 ? je not_installed2 q9 e7 }" P5 y3 S, {
2 a) [( K) M( P$ X" l! KThis service just checks a flag.7 [) c Y) i5 P6 `! i
</PRE></TD></TR></TBODY></TABLE> |