<TABLE width=500># m, I5 F9 {" }$ m9 B
<TBODY>
, _5 w! J) o Y) n* p, `<TR>2 ^# @( K6 a" m0 m$ C5 z5 M2 Z
<TD><PRE>Method 01
1 Z; p5 v2 E5 z0 G: l# Z=========2 P: ?% p( M) k8 }
* r! ]% v" p$ `) @* T6 w% f6 w" }
This method of detection of SoftICE (as well as the following one) is4 u. `9 A9 E4 M4 l, f7 M' s3 a# J2 X
used by the majority of packers/encryptors found on Internet.
: }# r% v; w2 `+ E: B! jIt seeks the signature of BoundsChecker in SoftICE7 `% l% z1 E5 }: P: D, s( o3 e
- C! |6 g5 ]+ k% r# M2 T mov ebp, 04243484Bh ; 'BCHK'6 \1 p$ x8 H ?
mov ax, 04h
0 _ A8 e+ ?# Z' E5 g int 3
7 x/ F& t; O1 @9 A cmp al,4" Z0 o. M+ _' e& n! L' z
jnz SoftICE_Detected) l K( V3 L+ {$ {9 Z6 m
+ m8 P1 W' U& Z% f! s. u% z& y# z w___________________________________________________________________________
& X! Z/ m. X+ o4 _0 A. V( q
/ _- L" ?. q3 _2 w; S. \/ HMethod 02
: x* T8 t1 w$ d! ?' Y0 z$ [=========
% ?! l; c) L" t+ C1 q! ~
$ d) e% V6 e8 |) i# X, }8 @- bStill a method very much used (perhaps the most frequent one). It is used* v7 p0 s/ l" t1 { I/ t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
3 |+ q- ^8 z+ ~# |or execute SoftICE commands...; U& }0 `8 l+ _$ M
It is also used to crash SoftICE and to force it to execute any commands! E( _% g. |# n2 F( G' v) k
(HBOOT...) :-((
# t$ E- F4 ]1 j8 c9 h6 U( w% q6 t' v, H9 t
Here is a quick description:
: c# `; F/ t, g( L; v& d7 Z-AX = 0910h (Display string in SIce windows)0 x- `4 b5 H/ L- o8 M7 O
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
( P$ Y% t: v9 I, |3 |: j: f2 t-AX = 0912h (Get breakpoint infos)
" T" ]; {& k# O1 g5 W- v7 F-AX = 0913h (Set Sice breakpoints)
, m, K. I, P2 O- ~1 s* n- |-AX = 0914h (Remove SIce breakoints)
S% U! \2 ]5 K* n- w9 b, D( j" r# Z* U8 \3 K& |
Each time you'll meet this trick, you'll see:
: s# a1 n2 s3 i* U- {-SI = 4647h" O3 ?$ t8 {4 o- l Q
-DI = 4A4Dh
' a6 S( X f& A! h& Q/ Y `& y3 _Which are the 'magic values' used by SoftIce.% Y# [: g0 P4 B
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; J# x# N9 _$ Q$ b. |+ m/ H8 D# v0 o1 G" S5 d4 E
Here is one example from the file "Haspinst.exe" which is the dongle HASP4 i4 }& n) S3 g7 l; a
Envelope utility use to protect DOS applications:
& |, F9 |( z: _+ A
0 y& e# I# T5 {6 r" D* L0 O; \0 Q; w0 D4 ]
4C19:0095 MOV AX,0911 ; execute command.
* R: ^; y2 S, u ?- S4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: S2 b0 v* H% O; H/ z( E
4C19:009A MOV SI,4647 ; 1st magic value.% ?7 N2 r9 m& i9 d( J$ n
4C19:009D MOV DI,4A4D ; 2nd magic value.
# [0 {# Q( L6 j" W/ m7 r4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: A: R3 S9 y: X6 r7 ], u: H4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
$ m4 Y& t4 r# c0 e5 h4 ]4C19:00A4 INC CX
7 v0 o! _/ x; P2 s4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. @7 j8 n( N- r) W. L4 s9 `6 _. u
4C19:00A8 JB 0095 ; 6 different commands.
) ~; ?- c0 J P; J4C19:00AA JMP 0002 ; Bad_Guy jmp back.
. Y0 Q$ q" }$ k4C19:00AD MOV BX,SP ; Good_Guy go ahead :); y$ f$ e. u- ^9 ~" \$ ` Q
( h/ E$ A0 Q) I$ ^- z* {# V
The program will execute 6 different SIce commands located at ds:dx, which
5 R3 S, M5 L9 [: jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
+ E, j: Y$ q( I! \/ k
9 [+ w: j* |: C* k, @* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# a% `; ?* O2 n" G& @___________________________________________________________________________
! T, l( Z+ k/ ]) j! F
! G* T) x2 ?; E o$ v' D& Z% g2 ?" D" }# }- R. z0 B
Method 03
# h _ }6 e% {, p=========
$ @! ^! u, @6 \9 U" {7 v
' t9 L$ @* e3 O$ MLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h$ a) b! A W! P8 f
(API Get entry point)
, c7 ^3 E& H6 ?/ Q* Q* }. z3 z 7 _' K$ y, K- P" |& ]7 r! l1 ?3 @
, I, ^# a; E- v2 F xor di,di
1 ?: ]4 s1 c8 B" k mov es,di) Z4 C5 a: F4 t. H/ T# b
mov ax, 1684h 9 v% {) p8 w" M$ g" \7 ^+ l
mov bx, 0202h ; VxD ID of winice( S' O& H7 q" ~7 M/ M3 g
int 2Fh
( E5 h, l2 R. X- c mov ax, es ; ES:DI -> VxD API entry point: {0 g" O) y7 B$ I/ `
add ax, di
+ C- S/ l: A' @* h8 W( S5 H test ax,ax
- b, `3 {0 U$ [* ~" [& X a& T jnz SoftICE_Detected
/ z( h/ N" j) i. E: I
' y: f w- t2 c! S2 Y___________________________________________________________________________- W1 | d6 U4 c$ @
7 t. Z: `3 c8 \4 W
Method 04
* O+ L8 {+ t& c6 V6 ~; V=========9 k, {3 Z. m- [: x# g; P* T
3 J5 |- @/ b/ kMethod identical to the preceding one except that it seeks the ID of SoftICE
9 Y( U- O7 W5 J4 c k6 l# n4 qGFX VxD.2 m# }$ u- Q |. j( |. _ \
+ d# x+ U( B% X1 ?. ~
xor di,di
* ?% q7 o& V/ w) C1 i mov es,di2 A/ N, x2 s. X6 I; n/ L5 \0 k
mov ax, 1684h
9 ?, y3 k/ b* Y( _9 ], { mov bx, 7a5Fh ; VxD ID of SIWVID6 V. m/ J5 Q, e* B7 d" _# W% G0 n
int 2fh; O1 E0 X7 R& b
mov ax, es ; ES:DI -> VxD API entry point8 F' y9 S! ?" E, w' d
add ax, di, q6 E9 T( f- L) J. m- b
test ax,ax
& X' s3 q& \$ f& O H; \5 c/ h jnz SoftICE_Detected8 K5 F. S! f# A+ Q3 a6 c5 k4 t
. R3 [8 C2 Q( S6 o! v9 R: o- P" a__________________________________________________________________________* m0 [" E0 O- z8 g) t
z" u% h' A- j/ l# Y% g
$ B) F) R! W; M$ uMethod 05; n3 k- n1 h' D' {+ F
=========5 N% q0 B- \- O
* a* k' q' Y# d$ N) D3 b9 e+ O) c
Method seeking the 'magic number' 0F386h returned (in ax) by all system4 ]6 I& O- R u7 [
debugger. It calls the int 41h, function 4Fh.
7 ]# F! x$ P& T( o" g7 zThere are several alternatives.
" M/ d3 w/ G5 A! K9 ?( P J1 x/ k# j! \, y
The following one is the simplest:
2 E. Z( L& t. H1 @
4 F- b$ s. ]6 a- ^# G& K2 \ mov ax,4fh' j! C* u2 D9 O5 h
int 41h
/ b0 W E+ o0 Q/ B! O' p8 C cmp ax, 0F386. }+ n% b+ _& X7 s
jz SoftICE_detected
5 J0 s5 l- q7 C/ s7 j
, w: C/ b8 S' d) z G3 \: y
2 w3 {# b, N) J/ G( b6 F. jNext method as well as the following one are 2 examples from Stone's
( v- ?+ E( P/ n% ]! }"stn-wid.zip" (www.cracking.net):% P/ f1 }6 X4 J8 s
" ?/ t/ a: u- n0 r- X mov bx, cs
/ e) R+ X, A! E lea dx, int41handler2( W9 z& |2 A; t& L/ H4 w
xchg dx, es:[41h*4]7 T# j* ~$ O4 Q. g3 f
xchg bx, es:[41h*4+2]
$ ^0 I2 ~/ J( ]; k/ a mov ax,4fh
# H0 S. r5 O0 A+ {3 a) K int 41h
- ]" `% \, E! ~* H; [ xchg dx, es:[41h*4]+ G2 f2 g/ d5 O/ M9 g2 a+ @
xchg bx, es:[41h*4+2]
i$ A/ F( I9 P: D7 ?+ V3 n cmp ax, 0f386h; [9 {8 X( ~# z/ @
jz SoftICE_detected% m$ x; A; N2 ^
$ S5 | t! r C3 U' i. ]
int41handler2 PROC$ _: J- R& o8 h" V9 i
iret
% K9 Z7 @9 c7 k6 ]9 F2 Hint41handler2 ENDP
5 t) D+ K* t& s. x" k7 e; h# ]* |( A. b
2 x+ M: a6 L2 \8 m+ a_________________________________________________________________________
9 t) Z" g7 y$ `9 g/ [1 k: H9 @4 |1 S/ G2 i, |
. \) V4 g1 w: b9 |: M
Method 06% q# Q6 b! G K. @- o6 o
=========: y5 _8 L v4 i
7 Q& [; V7 T2 |& B: i, t
. A6 i# x% y- q' M- u
2nd method similar to the preceding one but more difficult to detect:9 _/ [1 R- f# p
) g J+ _+ N% H7 U3 `/ s" b: }7 }# w; q5 E$ o, e! h6 F
int41handler PROC
) |. b( u' E+ k4 f0 U- L mov cl,al
! d( O7 B' q7 p iret
' Y4 G9 X9 U% ?/ X/ l+ U' Bint41handler ENDP
2 M/ J7 j* F; n$ w' {2 M+ p# r4 B( \/ K: S; b
2 Q7 j1 e( f0 v5 e! C* |3 N& d
xor ax,ax
% E! m* E/ c b$ ~ mov es,ax
# S: N& m# |, Z7 m8 a; | mov bx, cs
6 X6 q, L8 q; q/ u, k' k lea dx, int41handler# a3 s L7 s8 N
xchg dx, es:[41h*4]
" k' M( _' R- Q xchg bx, es:[41h*4+2] }3 w/ \" H3 `/ ~: @/ M
in al, 40h4 a i' `7 M& ^' {; Y
xor cx,cx/ s' Z+ ]# l; b* {+ x0 P) i
int 41h
/ ?$ y2 {! p" x, P7 G( n/ n xchg dx, es:[41h*4]
9 U/ S/ k! U" B( `" v4 b, m xchg bx, es:[41h*4+2]7 e+ s9 D4 l% I
cmp cl,al4 l$ h. i& h- W# F- @/ {* i5 t
jnz SoftICE_detected
+ z A- n; L. T4 w8 H) _# L
C+ C1 y* U& J: I+ K! E, T_________________________________________________________________________2 S5 c, Y: i& f& c7 |2 G- M
9 n$ O; X4 |& L' R! iMethod 07
, N" T+ Z3 G n/ D, ~=========
# u' k. h/ E6 g( B
1 C% j! _! e& e( lMethod of detection of the WinICE handler in the int68h (V86)
h: a( ]4 V$ H+ [7 e; x
# l! V- `0 {3 r+ f& z" t. @ mov ah,43h" k H3 k: D3 m: Z v
int 68h7 @! F8 h! X9 q$ ^* [* ^
cmp ax,0F386h: N4 x5 L1 t3 O M
jz SoftICE_Detected
0 y' Y* I X/ ^- v: L7 E& r v+ d& Z2 [7 [7 o
/ J3 [4 I8 G: s* h7 c8 F, A
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( Z1 n) a- w4 g8 v6 P4 \; v5 I4 v app like this:
" v5 O8 X& x4 S% g( j3 N+ J6 ^. s" }: T) K. B7 R% C$ P
BPX exec_int if ax==685 m! i, a' L6 e5 r: J) H
(function called is located at byte ptr [ebp+1Dh] and client eip is0 O4 J4 a* b# {" z
located at [ebp+48h] for 32Bit apps)5 J9 k5 n2 C( w! }3 j
__________________________________________________________________________
2 H# n0 M+ H! Y- d% J) e' [3 @3 _: Y3 Z- z( w/ Y" a5 D9 i
, j5 q! b% g5 b, R
Method 08
* Q% y- c1 X4 X8 Z& u; o=========+ D9 i; p2 [2 K" _# n" v
7 i" y+ o! |. r) D, D
It is not a method of detection of SoftICE but a possibility to crash the
$ R- z6 a1 h% z3 Z5 X& B. csystem by intercepting int 01h and int 03h and redirecting them to another: K" M! ~! `2 H' ]; l
routine.5 h O; ~; l4 f6 e
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: _2 u1 F, ` G1 F/ a+ V& ito the new routine to execute (hangs computer...)
( G# J! N0 b! d# P4 r6 x/ N0 S3 @6 k6 B# V' |- N1 K8 F
mov ah, 25h
8 }$ s! d, |2 N+ F x1 N mov al, Int_Number (01h or 03h)
3 q3 C. d' z* g mov dx, offset New_Int_Routine7 |' X5 v6 \; e
int 21h
* ^) D6 w7 P: N, X' ^3 w- s! [( v4 b2 ~; o6 o. g, D
__________________________________________________________________________
/ t1 I1 |% ^* R1 F/ V$ o2 L' a3 q* f6 @; {1 d: e0 D; L
Method 09) O, {8 f8 W* f1 y' W2 h V
=========
6 O7 H6 C& ~. d. w' v( F, C# V" ^' d
. N" T$ A- D9 y& D. K2 D/ L4 UThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ q+ j$ x1 q6 xperformed in ring0 (VxD or a ring3 app using the VxdCall).
. r R" ^7 ~* j7 E) y0 [The Get_DDB service is used to determine whether or not a VxD is installed
: [7 K7 C" r- N6 h. }3 n8 m) Ifor the specified device and returns a Device Description Block (in ecx) for% t8 e& a+ f, A* n
that device if it is installed. ~" I2 m5 G, C- V. W% `
1 y8 T+ d& R- V- ]; Y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID) s1 x0 G! w N3 S e1 Z5 V% X
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ d) n+ e7 C; V
VMMCall Get_DDB
* m: H/ b0 G6 z1 z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; G* S/ C$ b6 |2 L/ i# b
, U" L# F* f. u" q' b* h' @6 Y
Note as well that you can easily detect this method with SoftICE:( E" J6 X& W" E$ y+ x( m
bpx Get_DDB if ax==0202 || ax==7a5fh
; y* l. x* T2 m3 }# ~! I$ e9 R: Q
5 b2 ^; @! U( {% K__________________________________________________________________________
5 B5 m1 o; G% S6 a% b- W- z2 i
, O/ o: G& v# G% EMethod 10
/ G" l/ q5 X3 A4 H0 `5 N+ m=========
8 [( b7 e Y* v* \, o5 s1 a8 y
5 A3 T' f/ d" X y=>Disable or clear breakpoints before using this feature. DO NOT trace with
1 }1 P' \; x. |9 u SoftICE while the option is enable!!* N4 R w- ^ ?2 }7 @: J* }
2 I( K( i7 o$ ^" k: X- hThis trick is very efficient:& i# C* p& o6 G1 }
by checking the Debug Registers, you can detect if SoftICE is loaded
, F3 h$ d# R% E5 j9 |' @(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if% W) _* j3 g$ {6 t( [
there are some memory breakpoints set (dr0 to dr3) simply by reading their: }" V- @- n! b5 p+ F; l2 o& F
value (in ring0 only). Values can be manipulated and or changed as well
* x6 Y* D( b4 U. l(clearing BPMs for instance)' k9 \0 g1 S- c% Q( L5 b
* ^' q# D! q2 w- E__________________________________________________________________________
: j3 P- n' o" C
' r; ?% _! ?+ Y! ^: Q* A) i$ i7 `& K; eMethod 11
4 X+ |: |. }5 G. g( `( f) f. O% w4 q4 m=========
. H0 Q& J* v5 l, k, r& K2 E8 K+ O+ |) w3 Q# X! {6 N: C+ {* x
This method is most known as 'MeltICE' because it has been freely distributed$ l. @" h( L, g6 R
via www.winfiles.com. However it was first used by NuMega people to allow
% ~+ b% ~/ K3 J, L8 ]7 u$ b4 ISymbol Loader to check if SoftICE was active or not (the code is located# g X+ _2 w5 E9 c' d9 J
inside nmtrans.dll).# R0 D! n- J7 d5 `
& K/ W* B8 q1 s7 U! tThe way it works is very simple:% h3 `2 i# h; Y- B. k
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& [5 T5 w( b3 q/ M) yWinNT) with the CreateFileA API.6 V, b2 P9 c& o; i7 {: U5 P% p
! O% g# V3 |8 ~3 w& r, ~( [Here is a sample (checking for 'SICE'):% E& R0 K3 {7 b3 ?$ c
) u" Z( {8 A- j. b Z
BOOL IsSoftIce95Loaded()
4 F3 {" _$ p4 e6 S- \4 a" O{
3 A1 W3 A- y. A HANDLE hFile; ' h$ [$ _$ ~/ W1 H0 {2 l
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ K8 F5 V( f c5 G7 N- ]
FILE_SHARE_READ | FILE_SHARE_WRITE,
/ u# D4 H8 j# Y! \$ M& D NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% r2 P+ O! W* d) x0 H5 w, \5 f
if( hFile != INVALID_HANDLE_VALUE )3 F+ P5 {0 C$ x: F% k, O; d
{
- e& Z: w% d. l; e1 H CloseHandle(hFile);$ _' @3 |- q7 W9 q4 Z& s Y/ n
return TRUE;
5 I' `' p$ z" Z/ Z }
; z: _7 N. d% D5 y' y8 g return FALSE;
. W/ K( e- A- S3 \3 S}
: |$ A7 t' i! ~/ q9 l! \* P$ ?; s7 `# e) J* x
Although this trick calls the CreateFileA function, don't even expect to be
" @) z; _5 t8 pable to intercept it by installing a IFS hook: it will not work, no way!, A* B& N5 R Y: U. T) O# X0 r
In fact, after the call to CreateFileA it will get through VWIN32 0x001F/ V; g! _. ^6 s+ q) g+ q: ^$ _) F0 E7 |
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 o3 Z$ J5 o- X/ D6 _
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% e9 q, `, v) e u( Y+ Yfield.
9 ^$ I# t% E1 [$ t3 P' o# MIn fact, its purpose is not to load/unload VxDs but only to send a $ i3 v$ d* r. w9 p1 q' E( p) p
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) g6 T( X) x% [- D* W
to the VxD Control_Dispatch proc (how the hell a shareware soft could try: ^; C; `, a) p r8 [8 ^, U- f0 p
to load/unload a non-dynamically loadable driver such as SoftICE ;-). B; B- o$ E6 y. k
If the VxD is loaded, it will always clear eax and the Carry flag to allow) ]- G7 b: X! G. d2 |
its handle to be opened and then, will be detected.: V; D! E5 l6 Q7 J
You can check that simply by hooking Winice.exe control proc entry point" F n( t8 `& o! z$ a- \, P7 ^
while running MeltICE.
H# Q. m0 Z7 d) g1 p
* K9 b( o; s5 g
7 v, p3 m o# D* b 00401067: push 00402025 ; \\.\SICE/ ?. G+ v3 e: @2 N
0040106C: call CreateFileA
8 C2 e6 R1 d; B5 w( ^# }0 t7 x 00401071: cmp eax,-001
* O2 S6 G* P, ~. J" w4 F$ a 00401074: je 00401091' j, K+ l6 H; @
' ] y# O0 `. R
- Y6 z, a' c* u% j1 [9 o4 Y
There could be hundreds of BPX you could use to detect this trick.( e( o! _# |' D* U+ q' o3 a
-The most classical one is:6 C" m M( l* i% T& ^! i
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* a+ e; ?4 ~* C _' g *(esp->4+4)=='NTIC'
; H& T' u* M' h. b! [. z1 @( `- Q) V& h( ~" ]
-The most exotic ones (could be very slooooow :-(4 S% M+ a$ `" b0 @
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
! R# j+ h, d+ r0 \3 e V+ u. | ;will break 3 times :-(3 U0 @+ c0 h$ ^, W
5 G& S0 Z! ?3 H' ~-or (a bit) faster:
+ I0 Y# c, j, M0 L7 k$ e/ h5 [/ h BPINT 30 if (*edi=='SICE' || *edi=='SIWV'), ?) R9 R- ` r9 u) {) l
. r( c1 v1 K' F8 W$ C; S BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 L) X4 J5 s9 @5 r
;will break 3 times :-(
- U& m; z2 {$ Q% L; c) y4 ?1 x3 K$ e& g, u$ W0 F. T3 q6 E& @( D
-Much faster:4 D. H0 S9 y" K9 x- ^
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
% k3 ]( |4 n( ?8 S5 \: O
. E7 }8 n- E4 w. e+ a- XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen. ~1 b0 z3 H- y% m) P
function to do the same job:
4 k1 u) P; }8 J$ t2 N( X5 L) b' n% H- ^9 Z! R# A
push 00 ; OF_READ- v+ D$ ]: t: h1 S( V3 e7 U
mov eax,[00656634] ; '\\.\SICE',06 V0 Q: z( K$ t0 Y+ T4 F8 G
push eax
6 v, b G. r, i$ N call KERNEL32!_lopen
6 @! q- D! l, x0 [. B inc eax
+ B) e# | I# [/ I+ c/ b. S. r; Q. n jnz 00650589 ; detected: K0 b$ z5 S2 B3 X- H! @4 i1 @
push 00 ; OF_READ" J5 G1 T; t' B+ g$ w
mov eax,[00656638] ; '\\.\SICE'
) E3 i' t' k# y k( K push eax
) j9 h6 a) S5 A I; H v call KERNEL32!_lopen8 C" n3 |- B1 K
inc eax% B3 j5 h J$ [% P) Z
jz 006505ae ; not detected
9 { [& i( Q+ S: L! z' k
- p7 ], _! c" G4 t( B! U' t
* h- M' _/ s# w5 \! ?. q e4 e( B__________________________________________________________________________
& q8 D" Z" E3 M: a: C2 U
0 B9 k r* h0 W1 Z+ EMethod 12
9 D7 z) J: B* Y, I=========
' q% s7 C! K) K3 T9 c. |
, q8 c' l' d* ~2 Z8 Y! ^- X. kThis trick is similar to int41h/4fh Debugger installation check (code 05 @) J+ {: ^% _1 J) z
& 06) but very limited because it's only available for Win95/98 (not NT)
+ ^1 ~" Q; t; W3 `as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' M, J3 V4 o4 j
" g" i) X& y+ L' H8 o$ C push 0000004fh ; function 4fh
2 m/ S" m2 t; Z+ o push 002a002ah ; high word specifies which VxD (VWIN32)) ^- O% D T4 U2 D- n) u
; low word specifies which service
+ e! i+ s: U. y# l- Q3 D; H% r (VWIN32_Int41Dispatch)- E+ W1 v0 J0 ^, E0 N. v' `. p2 w
call Kernel32!ORD_001 ; VxdCall
5 i1 c: v0 z2 \+ y cmp ax, 0f386h ; magic number returned by system debuggers
; |& r( J2 D3 P1 P0 Q& Z jz SoftICE_detected
4 q {! l9 }# S: G, d. N0 \
' r' s' F6 c- p' H$ IHere again, several ways to detect it:
2 W: W% [+ w$ c! n
5 g$ i1 l. ^6 K: H BPINT 41 if ax==4f
" n; D: {# ~1 o8 Y2 Y
) D3 n2 B0 O5 b, ?5 q BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
% n& C) O$ S' A- V6 V: g/ U
+ t# k4 B) M9 V l- j BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 b! y: O& Q+ p3 b; C5 L0 Q
( p( X; _/ Q0 [. } BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!& B5 R& ]0 {* j% E) G
( _# ?5 B9 {$ p" N: I( R1 ?# @& A__________________________________________________________________________
4 A7 b2 ^" |' W- s5 F. ^3 N9 z) ^
Method 13
5 y( s' t# K9 l/ W; d9 `=========
2 r" G4 z3 d7 e T8 d& f8 n, t% D1 X0 l' s6 Z# A
Not a real method of detection, but a good way to know if SoftICE is- g N) J! l% t1 p, [. S3 y& m
installed on a computer and to locate its installation directory.5 b$ B g+ O6 k B$ e1 F
It is used by few softs which access the following registry keys (usually #2) :2 N# _% ~: E" L% {0 q5 [- t
. x: ~6 T7 ` [# j8 `+ }
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 P. C+ Y+ w) M5 \- e8 Z
\Uninstall\SoftICE% W. z' ?/ U$ Z; Y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. O# b* j' e! s. @/ \
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion+ Q1 A: O s, R5 i
\App Paths\Loader32.Exe
: T# n' i {$ K
% ~# D. t1 T# }+ f1 ?! s# Q
( t+ o6 }& W8 _. b0 nNote that some nasty apps could then erase all files from SoftICE directory
; X. o" C& u( f8 J# c1 I; F9 j(I faced that once :-(
' P1 F2 l+ |2 r8 i( p+ Z
+ S1 o a' b$ o+ j& m2 O: K2 pUseful breakpoint to detect it:# {+ g1 e4 N# v9 l k1 Q) P4 t2 Z
0 A+ d6 z- G0 _0 U4 E, x6 ]" {* V BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
n# r0 ?6 t: t( u; J- i) v, a/ @/ D4 }: a' @2 o! Z7 @
__________________________________________________________________________
7 Q( ]2 P5 q2 N% e( E ?" p: U4 M
( N. K- p* U3 [# \
+ h c( Z; m9 |. _8 BMethod 14
% X- R$ \1 I3 j0 r& j+ {; z=========
! S; k% O) p4 O- Q2 ~" P+ ~4 Q3 J& ^" |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 o, ?5 ^) s+ R8 H4 G |, q) G9 Y
is to determines whether a debugger is running on your system (ring0 only).( F I/ L! z8 \& Q$ I) @
4 W# ]% z1 H+ A; R% o/ v1 i: l VMMCall Test_Debug_Installed5 s j3 T$ }+ [
je not_installed& L7 ^7 K3 g0 o& g& E9 s
- v! |. a. g8 H2 s0 T9 L NThis service just checks a flag.+ ^4 r8 f; ~$ m$ M( U! S
</PRE></TD></TR></TBODY></TABLE> |