<TABLE width=500>
5 I& ^5 k; f* q% e* M: l<TBODY>
! Y1 p" [' u6 q% i<TR>0 \' X; Q. i/ {7 B: ?+ w
<TD><PRE>Method 01 2 W) l/ e; P' c9 H) N
=========; M. B$ Y; t A/ F( m3 _
" P7 K$ U5 r- `1 C( L; i! EThis method of detection of SoftICE (as well as the following one) is
- R4 F1 c- A& O- iused by the majority of packers/encryptors found on Internet.$ o* b4 U0 K! I0 ^$ ~" E4 H
It seeks the signature of BoundsChecker in SoftICE3 d: x$ {6 A6 t$ c4 d1 b8 V d
% L) g {+ |$ C2 h. p, @) P& P
mov ebp, 04243484Bh ; 'BCHK'$ O% F2 }' E2 s4 M8 v
mov ax, 04h2 ^0 W, ?0 v& ]% l, C3 a
int 3
6 g5 g& I- ~1 L* R' ]1 N! @' _ cmp al,4
/ @& J$ r W' V( r. W8 L jnz SoftICE_Detected" `7 e4 ~( j* e. \. k, `; E9 A
, f$ A" f9 o- `1 C$ F4 @
___________________________________________________________________________
* M/ T( o, u! g0 R: M+ @. \+ f) ?& j
Method 020 o! }5 V- b) ^! [; R" B
=========1 |1 r" T8 @0 p0 [7 t1 I
7 |+ N* s& e5 H ?0 y7 UStill a method very much used (perhaps the most frequent one). It is used
+ o1 o+ }, P2 q7 m, I* A: vto get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ E% `; g% K1 j* d: y$ z
or execute SoftICE commands...
" C/ T( o( n+ I$ zIt is also used to crash SoftICE and to force it to execute any commands/ X r8 N; B% \3 V v8 p, K
(HBOOT...) :-((
9 ]) v; W4 T5 X% n2 ?
7 U2 }' M8 X5 r8 t5 B9 t0 ^Here is a quick description:
9 ~4 l c/ F' |; O-AX = 0910h (Display string in SIce windows)" g* E$ F# \. \ z# ?
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- h( E, a; A% g5 W, R+ h0 b- t
-AX = 0912h (Get breakpoint infos), J- r. w) D: Q% w/ W
-AX = 0913h (Set Sice breakpoints)
# i% E ~2 b3 ^; E! v-AX = 0914h (Remove SIce breakoints)' ^. h x- e% v0 l
9 t( j* ]1 i" v' j
Each time you'll meet this trick, you'll see:
9 d! b6 G3 u, v- s1 w$ [; p! G-SI = 4647h5 b# C5 v7 z4 R! E) h* h
-DI = 4A4Dh9 w- t4 @; S' L9 S, j) W% }0 d
Which are the 'magic values' used by SoftIce.
( C$ [+ J) m: S* m% n- I3 J2 fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.; k, u) u. w+ j) P5 D
& c$ I, A1 B4 }& u5 V; m9 YHere is one example from the file "Haspinst.exe" which is the dongle HASP$ O: T9 n) Y9 e+ F: D" U0 l
Envelope utility use to protect DOS applications:
2 x% a; {# `3 ]
- M; Q/ j& W( R) p3 W* _8 R# y# k' C
6 N" a/ _$ U' M" A& P4C19:0095 MOV AX,0911 ; execute command. ^0 B9 V1 S' b% F7 U1 b$ W) c( o
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
4 x; O! [+ h: [) M* x9 c+ \- {4C19:009A MOV SI,4647 ; 1st magic value.
# v) j; Q3 n6 w( p l* O4C19:009D MOV DI,4A4D ; 2nd magic value.
! V t; b5 {5 K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)- _& E. C3 F3 Y6 }8 X; q$ n7 r& i
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
% z/ H: z$ e% Z! L2 o4C19:00A4 INC CX4 R1 K& C: g+ a2 H1 s
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# d" x- y9 k0 R4C19:00A8 JB 0095 ; 6 different commands., [% J9 k4 ]9 P
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: G. O, S+ O. K; t4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
3 @0 A1 G+ B4 p+ U8 _; n% C* Y; \( G6 S3 I3 L' Z/ |" X4 w' K6 M+ ^
The program will execute 6 different SIce commands located at ds:dx, which
5 Q& p% ]' |( ^4 @% \6 jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.$ o5 \! h _: W
! S' r- `0 V9 v: M9 p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; \8 {% q r/ s1 k W9 g___________________________________________________________________________) E G9 Y) \! K8 a& |# i% N
! |& Y' e% d2 |" y
$ n- N) E: [; \; d
Method 03
" J+ Z" v# d; e( T3 F=========
, Z! d3 ^# C% Y( s0 \ B, A! l O+ d% ~* Z( R# h1 Q8 v/ V
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& L% Y8 ?% [& ]: I% ^! z$ t! p(API Get entry point)/ _ c8 O: X& M
7 L. d1 h3 `/ S- R y1 v/ L, G! h: w5 y i6 D1 G ~1 L4 B; J" l
xor di,di' s/ E! y- Q1 f; N3 u7 A" Q4 B
mov es,di
4 z: @; X! g. t, q) m mov ax, 1684h
; g3 f7 R Y ]0 [9 x mov bx, 0202h ; VxD ID of winice
2 G ]; r9 b' B1 m int 2Fh
" q; u" N9 e0 `7 m mov ax, es ; ES:DI -> VxD API entry point
5 X5 ^8 O1 x2 a7 N: X: F+ A add ax, di. H8 C: A, q8 F0 ]$ k& n7 T
test ax,ax( w7 s& K' a, J7 k! w
jnz SoftICE_Detected
% S$ {+ j8 ]/ D3 S3 Q$ R1 n& U# I M% l9 T: x- |- T' r
___________________________________________________________________________- q+ J/ _. L3 m5 W2 r4 s
8 N- {0 Z, {6 Q0 r) f0 W1 RMethod 04
. I8 V: Z9 }. u/ I0 {! ?; r" ~=========+ w2 q2 C- W" z5 l) R. f
0 r' }9 a4 _2 f! a8 d
Method identical to the preceding one except that it seeks the ID of SoftICE
' _: g7 m' c( i# t2 g2 m% zGFX VxD.
G6 p: G1 ] h6 N" `8 b" `7 } Y1 m' n5 B0 z3 G* T5 z8 H0 B
xor di,di
( N" g8 Z5 C1 c+ }6 Z4 L mov es,di8 T, R+ L( }8 _: W
mov ax, 1684h $ _! H. W3 K) V
mov bx, 7a5Fh ; VxD ID of SIWVID
t4 ~. n. ?* m" {( u# i, z- k int 2fh
% d* ~7 g. m! ?) k mov ax, es ; ES:DI -> VxD API entry point4 W; y, O$ L0 p, J1 |/ Q
add ax, di
4 @: G* S) x( }1 X test ax,ax
& Z q4 \6 J' q! D Q: n jnz SoftICE_Detected: [3 d" g, m, n- r3 r f
8 b5 e1 Y& \$ m; \4 \ x- G3 X" Y
__________________________________________________________________________2 m: _, t! }. x2 d G
9 [* T5 L% Y, j* \- D- Z1 u: q
4 D- @5 C* n/ A( {0 F U
Method 05- U/ `/ R; q& |* l# D; y
=========
" A ]9 _# C1 G2 z6 c1 R N3 ^! i, h! [) _% [& U- N
Method seeking the 'magic number' 0F386h returned (in ax) by all system W8 }2 R: j8 e7 q
debugger. It calls the int 41h, function 4Fh.+ q& I& e3 w+ l6 s, Z: {
There are several alternatives.
7 A9 n% _& f* j) r: C) h6 l7 K) X
7 }+ z2 u; Q1 `! n5 o+ {) yThe following one is the simplest:
& {2 {' y9 c. z6 ^( ~7 b. \5 e2 k4 `# q; G
mov ax,4fh
- M+ F O" N2 \5 o; D int 41h2 v" N& {/ z; x5 e6 y( y
cmp ax, 0F386
6 X8 u1 [) n$ M6 P& t jz SoftICE_detected4 H4 I6 E1 o p! {8 o
: N# E4 g, c: c5 c7 o
- O5 {( m8 O" e. T& ?$ `* l+ [ dNext method as well as the following one are 2 examples from Stone's
) {! N7 A0 ^! l# N- S2 t: n"stn-wid.zip" (www.cracking.net):
2 T& Z5 j0 m0 z. G) V
& c/ |+ U& P* T6 v4 W9 }3 Z' p, X mov bx, cs) Z" I- u5 g: l5 Q3 c- V
lea dx, int41handler2
9 n. B, P; ?0 g/ \) ~3 L xchg dx, es:[41h*4]/ e7 U; A1 J- J( N% H6 M' u
xchg bx, es:[41h*4+2]
* Q" {% ?9 @! x3 y/ u3 ~, K mov ax,4fh/ u: W3 ^6 t, T4 E, p
int 41h
* t: x1 |9 _5 v* g* t; V: V- J/ _0 ` xchg dx, es:[41h*4]
; w# Y/ M# L, V& e8 N& ? xchg bx, es:[41h*4+2]
5 j6 e2 S, a3 p! | cmp ax, 0f386h+ U. s2 P7 |5 P0 f
jz SoftICE_detected
- {1 N/ W$ n1 F5 F, O) M
; Y$ V( b4 t1 Fint41handler2 PROC4 `5 f0 h, G5 g+ @: j6 |
iret8 s& N. C1 b2 I b
int41handler2 ENDP
* m4 \$ a' @$ T3 o8 n$ n2 f" |4 B! a( F ^5 N8 V% J+ W% P! @& A4 ~7 D
6 q; s! `7 l" j" d, Y5 ]_________________________________________________________________________7 k5 v( [7 i" R2 }2 W" V) ^
8 Y) v# i+ v9 ^% {& X) k
, P) ~# Q4 Y c; L8 AMethod 06
0 x1 l: T9 U, B& S=========
. U3 M) R% K' }5 f3 ]0 h
& }) N# r, R2 E- Y) {( F
* F' @/ J/ k4 _+ d w2nd method similar to the preceding one but more difficult to detect: P, H6 q; K7 q2 H+ \/ ^ u
: L# [5 I5 u# l0 m Y
$ k' P+ e" m2 Y5 r9 }) Q; H, k- K
int41handler PROC0 X& z$ q6 G+ _* Q G2 C5 }
mov cl,al) o+ W: u" f( C! R+ F5 t
iret
' ~+ n, H! S+ S' m- Wint41handler ENDP* a1 j) d( r( j& `0 p3 ~
' f; ~ U1 d ]% F# t0 J6 H- l5 o/ |0 s$ _- l9 Y1 f: S8 V- p
xor ax,ax
) T5 r9 m7 ]% Q# e6 R4 N mov es,ax% N+ T$ k) l0 ?" k
mov bx, cs
" [5 t8 W! [* m% E9 q/ B) s# z lea dx, int41handler
, B$ H6 _# g( E6 x, ?6 p xchg dx, es:[41h*4]
+ Y9 G+ M/ Q3 W7 K& Y1 n" E xchg bx, es:[41h*4+2]$ O" p d! O4 s2 P: f* `
in al, 40h
7 S9 T$ P0 [4 A; M# z xor cx,cx
3 b4 B7 J' y' {# O( o4 A' M int 41h; B* b M3 Z' D3 |; S& _& a1 F
xchg dx, es:[41h*4]
, f$ E& j3 z. S7 c xchg bx, es:[41h*4+2]
8 K/ l; U0 @- ?; D' g" f" L( O& G cmp cl,al
7 {/ ^( Q6 V& }$ w jnz SoftICE_detected
. Y n2 ~* x1 ^: h W- p2 i2 ?6 y6 e8 g* Y
_________________________________________________________________________% B" ~& ~ D. ?* f3 z* s8 P/ L
6 h& |7 o. w- j
Method 07
: v9 E; s6 a3 I+ v=========
& V$ T5 f. E1 \$ T4 [
2 i0 ~6 S: \" i s5 {- K# Q( AMethod of detection of the WinICE handler in the int68h (V86)
8 X9 n$ }+ Z4 {9 D# t7 F1 v
3 I' \. W- n/ y mov ah,43h
# m2 ?7 D6 k5 b! E. H* r+ ^ int 68h2 S/ T. N' u* }) C; n
cmp ax,0F386h7 F8 n5 R+ ]% G; X5 _
jz SoftICE_Detected
5 H5 V0 |$ y. E' g h @% v
5 q+ h* A* L- B7 O6 H; U2 w
4 d C9 H8 _9 t1 _; R=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% z/ t7 x n9 ?; O, J; S app like this:
2 a2 @6 H* j% Y
6 R- }* g' M0 F1 x% g BPX exec_int if ax==680 n4 s1 I5 L! L6 p/ Q
(function called is located at byte ptr [ebp+1Dh] and client eip is7 T' f2 K* n' l6 a4 L0 S
located at [ebp+48h] for 32Bit apps)
/ f. h& T v# I$ S__________________________________________________________________________7 X, A5 j! I6 `; {* [! l
9 ]# f2 [- t1 U
+ E+ u0 M; U" PMethod 082 {' _! k, l; g0 |& c. D4 G7 ~
=========+ @; s; Y/ {2 y
* _0 f/ U3 I9 T1 YIt is not a method of detection of SoftICE but a possibility to crash the
6 N8 o# A7 M b# isystem by intercepting int 01h and int 03h and redirecting them to another
- ?& X: E( w: xroutine.
$ p1 n, a' g a; ]5 b0 L+ J$ Y9 a* gIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 `' H5 c% A/ {$ K- I
to the new routine to execute (hangs computer...)
- X& ^8 j8 i) j) r: w0 G2 g$ `- }
e% \8 h/ N, C& [& [ mov ah, 25h/ {- M2 r' _4 P7 R' G! r
mov al, Int_Number (01h or 03h); P! N( `1 e# v2 @8 e* |
mov dx, offset New_Int_Routine3 k @8 d3 G: v2 Y2 v' S# b
int 21h
6 t# z8 k" W6 J5 T- J8 Q. D9 D8 v% U+ V$ A& [
__________________________________________________________________________
- z5 h; A: L* G7 u) ?; n, U7 Q
& ~2 X" e. e' y* KMethod 090 M5 [! \6 m6 ]
=========! W( K; v4 q0 J- w2 i
) y) G; R& M9 Q) ]% L
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, o, y7 F( D4 ~" Q9 S+ v5 f
performed in ring0 (VxD or a ring3 app using the VxdCall).
( @, E M' z* }4 XThe Get_DDB service is used to determine whether or not a VxD is installed
) R! I6 L+ w! a7 D) W) jfor the specified device and returns a Device Description Block (in ecx) for0 z0 M! H% ^# X
that device if it is installed.
2 W. \ P: I }4 a9 i2 v( _+ \
/ `# R6 U6 s' F2 `) R8 X) z2 c mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID6 @7 ]4 J7 s! q, b0 V/ Y
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( l( s7 t. O6 @: m g4 N \: f VMMCall Get_DDB
! C4 }) ?; d/ E) A* } mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed( u1 T; t5 S1 }8 ]: W( |6 n
8 M% K9 }- E5 n6 B, A' K1 qNote as well that you can easily detect this method with SoftICE:
8 @) X. B& t6 A bpx Get_DDB if ax==0202 || ax==7a5fh( I0 v: I# L. V# a8 q# _. [+ `
# p3 w) t# P+ H& Q1 Z0 V4 f9 ]$ ~# n__________________________________________________________________________
c* \7 Z, q" Y
' `" o* `5 d) X8 t0 O$ O" nMethod 10+ s3 K. v1 y$ c9 c0 L
=========2 T8 n6 ^% X: Z
" \9 Z0 Q% E! N; I% l% G% ?+ ~
=>Disable or clear breakpoints before using this feature. DO NOT trace with& O+ q, \& n) i& S6 F
SoftICE while the option is enable!!! I7 U6 ~) W3 n$ _. d/ [
- ^9 S" k* U6 m9 k' Q1 w& Z, l5 Z0 N
This trick is very efficient:: H T/ o% ]8 J Q0 p
by checking the Debug Registers, you can detect if SoftICE is loaded& {9 S$ D& J" t& ]# A
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 _+ m- b: I0 S V
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 b, @$ j: B O t
value (in ring0 only). Values can be manipulated and or changed as well! }& t- e3 u4 z |1 [
(clearing BPMs for instance)
3 c& z/ G- _4 E4 h- I0 Y4 }$ E4 B5 i5 f$ X9 a- W3 y4 u
__________________________________________________________________________( E# i3 M* P) g
9 X4 j% L" O. `! e4 @
Method 11
" k+ G, Y+ K0 \=========: g9 j# e% j* f
* J# D; r$ ?7 e \This method is most known as 'MeltICE' because it has been freely distributed4 D# F' g2 @. m) M+ I/ N/ q$ M$ K" i
via www.winfiles.com. However it was first used by NuMega people to allow
+ ^* Y5 }2 F- a, G @Symbol Loader to check if SoftICE was active or not (the code is located9 z3 m, y5 V% u6 E; R8 {2 P7 a, ]
inside nmtrans.dll).
/ \" \. D& K2 @0 m" M' `; U* d
1 K4 h: f4 n7 T$ T4 R N+ B" AThe way it works is very simple:$ t! K) `# v: [* c3 w' ^! t
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- x3 M7 b% p& }- P6 u: M
WinNT) with the CreateFileA API.
' @3 y; {# L9 Z0 F
9 \6 d7 M$ n1 g b- S# |Here is a sample (checking for 'SICE'):: {1 s' O( R9 j, }
& e! q3 h/ \& g- X: a! o) [
BOOL IsSoftIce95Loaded()3 e# j, E- r3 @. ^% m# u& Q
{: T, q7 z" v9 x* I- G) w
HANDLE hFile;
' L& N" {- G) B Z$ ^ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 u% J' @" _6 ?' G; ~ FILE_SHARE_READ | FILE_SHARE_WRITE,
& c/ i# f! ^! C NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
9 ^5 W2 L9 u/ k7 Q if( hFile != INVALID_HANDLE_VALUE )- `3 p, z' n! F7 x* y( `1 s
{' J0 m. U1 Q, ]
CloseHandle(hFile);
+ q; N1 ^3 I8 X ^& M, S1 S return TRUE;
! g1 U' D/ [+ ~/ U% P$ v$ G. s }
0 | X9 X' W! |: `6 C. y return FALSE;* a, q+ a, i9 R* v8 H3 j6 B/ e: E
}7 z% _4 U7 }/ M* E+ y1 q
" M1 e$ o) C U* J7 VAlthough this trick calls the CreateFileA function, don't even expect to be8 G* t% O4 Z' C' c. M
able to intercept it by installing a IFS hook: it will not work, no way!
# a( D' u% q% B+ B3 T+ T/ |1 `In fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ F! A, R' O; uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& C: w" ]8 L* g) x/ n( z7 }
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ _- i# v5 @! g j8 |+ c% wfield.; z/ F \, o- ^/ l, ~2 C, O) C
In fact, its purpose is not to load/unload VxDs but only to send a
, `+ O, ]0 Z8 C0 @6 xW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
6 z$ I) G# _& E! ]( [to the VxD Control_Dispatch proc (how the hell a shareware soft could try
0 t8 |, w& Q! V9 yto load/unload a non-dynamically loadable driver such as SoftICE ;-)./ t) [: d2 H) }& G
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 W4 z. V% Q. T. L6 F) bits handle to be opened and then, will be detected.' ~6 Z: Y3 \0 F% i S5 N; z1 T
You can check that simply by hooking Winice.exe control proc entry point; E7 a L; b3 @! |* t
while running MeltICE.
# S, b1 z) `4 {( o5 e% s( `# @: _
; p' l1 |& y% N6 Y9 [% m" }' k
00401067: push 00402025 ; \\.\SICE
$ c; Q/ |3 k7 t2 @, m l 0040106C: call CreateFileA
: }$ D- }5 c9 z: n0 B7 [$ h 00401071: cmp eax,-001' ?9 k0 G7 M# q6 }% G# h+ A- h
00401074: je 004010913 i9 @7 G% Y1 N7 |
( t& G; |. O8 G2 N
3 W* l1 }7 u" y" l, L8 gThere could be hundreds of BPX you could use to detect this trick.
! a) W; r0 M" s# F u8 m/ h-The most classical one is:4 e4 |% c7 h- r" \+ q: S" }" [
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
0 y. d* O& x4 M/ P6 c9 T3 }) r *(esp->4+4)=='NTIC'% Z4 O; h9 C8 J# N0 p. E2 V8 z9 `
8 x; V5 x+ j5 S+ y6 ?1 O" f-The most exotic ones (could be very slooooow :-(7 h8 S/ m7 ~( d4 \0 d& d, t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
) l) m, v5 |! z8 }2 e ;will break 3 times :-(
7 K' F! s$ |8 p& ^
* k6 _1 I: f7 I-or (a bit) faster:
X5 F+ S( Y% v. Q BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 a% a) c! i. g( k- g: d3 i
+ w4 I3 r" x# p0 F% Q$ y3 B6 O8 j BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
" Y* }" {" T( M' t9 F( ` ;will break 3 times :-(2 \: H0 U3 P, ?+ j7 w+ `
( t& d5 Q9 `/ U b$ A( F-Much faster:: c5 P% K# U; k
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'+ L. y6 X9 F6 a% [- Y/ L; h
/ E Z7 ^8 [2 U. ^* d
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 V* w' V+ D' ^) z3 C0 G
function to do the same job:; ^( L Z+ A8 w/ n; A& [# b
$ o$ f: @. f$ |0 ]8 z) O push 00 ; OF_READ) J" w6 h. t& Q% ^' y5 \8 n& K
mov eax,[00656634] ; '\\.\SICE',0
. M6 p& r# p. P! z; B6 J push eax' F8 O9 M2 o# H6 c. S
call KERNEL32!_lopen
& t* {- ^ K* S# M# n' U" Z, g inc eax: q/ Q" ^+ e8 B; p
jnz 00650589 ; detected) n* T& Z2 G; ^: x z- n g
push 00 ; OF_READ; }) O) A( ?& v5 h
mov eax,[00656638] ; '\\.\SICE'
7 Z% M o$ c' k. b push eax
7 R8 `, ?+ |+ t: s1 r# G call KERNEL32!_lopen
( i, ]* ~6 s2 o6 {0 n$ E inc eax
( g' H' o4 P! K, x1 m# C) ~: @ jz 006505ae ; not detected
. l- }! }! k, Y8 ~% ~4 l7 _5 b. ~! q/ r, s$ w
! @5 X6 f$ b4 Z9 f7 m+ _9 C" j
__________________________________________________________________________% _& t* L0 t# J
- D" F1 z" _0 W& l R+ ~3 ]. v# i
Method 12: c$ Z* n! S; q3 P% n7 o
=========3 l/ R! i( {) Y! O
2 P$ R5 Y- `5 \! @* yThis trick is similar to int41h/4fh Debugger installation check (code 055 \: {2 D* V3 {+ e+ G6 J# t9 x
& 06) but very limited because it's only available for Win95/98 (not NT)
/ s# k2 L$ G* u& vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 |) W' i1 N/ k6 p1 B
; y |, ^" p& Q' ?$ Z5 r push 0000004fh ; function 4fh
0 Z4 s% g5 N3 `7 p2 u push 002a002ah ; high word specifies which VxD (VWIN32)
3 l* s9 d K# A! ]! y ; low word specifies which service
% A. P9 g# ~ a2 r) I ] (VWIN32_Int41Dispatch)) P z. }2 ^$ i$ W: _& ^( Z. u2 o! x
call Kernel32!ORD_001 ; VxdCall; [" T: k- K! x X$ [0 U8 |
cmp ax, 0f386h ; magic number returned by system debuggers) n2 v4 v# k$ R1 ]
jz SoftICE_detected
0 E7 ^- d1 k/ M, j
- N, `0 A2 i/ CHere again, several ways to detect it:
, d9 g& d, c& L& i( [$ i* r% e
8 y( o$ y9 n; y" A BPINT 41 if ax==4f
5 l0 h7 q8 x+ J7 x& ~! D/ S4 ~. G5 @
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) b4 Y/ F5 ]* ^# y) n- Q( K2 Z
7 ?8 j+ w. w- J# j3 \- D+ _' `
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
( W. I& j2 x6 h3 [
7 ?; M9 V4 a0 |% u/ D0 I BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ M3 Q# h- k* K$ o" H& d8 q( p* a5 T2 [" W
__________________________________________________________________________
@% I5 M: ` l1 H( R3 Z W
( \7 N3 |+ c k) }Method 13* ]/ ~0 r% T. u4 \) C7 v* F+ p
=========% S& w, G7 E$ U. l! T. M; U3 T6 B
( z7 C; l$ H- o( ~# e
Not a real method of detection, but a good way to know if SoftICE is# d1 n9 B" w6 h9 R9 {5 b
installed on a computer and to locate its installation directory.
# F, K: L: _. S7 M- ?$ r% v" eIt is used by few softs which access the following registry keys (usually #2) :9 t! g7 m0 p2 P! v) R/ F3 Y
4 G# l; }: X* Q9 J% j
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
c. I/ h. n. I\Uninstall\SoftICE7 k% x _2 o. k! {3 a
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# r+ \$ x! @$ N, }. x& G. B6 W
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 c3 _1 ?, K$ v& V2 Y; j) H\App Paths\Loader32.Exe
& w6 |) ]1 ^/ ]7 `1 F! a% _
$ p4 N) A5 m% i/ I& {4 r3 Y! L% A8 ~7 n
Note that some nasty apps could then erase all files from SoftICE directory
* t! a) _: w, \- A9 \; D(I faced that once :-(
/ u" p) o4 }- C& F5 q4 h+ U
7 ` ^4 R2 u) K- J) wUseful breakpoint to detect it:+ k$ P/ q' O6 a6 b( Z w( D
$ R C; X$ u" U& @% D: w- { BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 Z3 ~* v. j$ f6 e% z1 \
* Q+ z* ^8 O+ }5 u__________________________________________________________________________: w( o; u; P. v6 a7 D
4 v9 t0 A; H/ y. }' V9 I
! X0 Z9 y( G% b, |5 x
Method 14
. [7 E7 O1 r; N# `" \" w=========- |6 k) z& I& B' R" H- {9 B
# d1 f: L; U( k/ ]$ S$ EA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. ?$ O& ^3 d+ K3 ?3 ?is to determines whether a debugger is running on your system (ring0 only).! D3 A" B! T7 ]0 A" `. B
' L6 T* ?6 d$ W2 \! v3 C7 @; x VMMCall Test_Debug_Installed" g! \$ B6 F8 E+ |6 O* f( T' A
je not_installed" w4 o2 [, d$ F4 U
& L2 I% \2 {0 B7 E6 ], q- I* Q
This service just checks a flag.. d! z! o- Q- o7 t8 ?8 B/ W
</PRE></TD></TR></TBODY></TABLE> |