<TABLE width=500>3 P! R( m8 E, K! P2 V
<TBODY>
, N# n" c- H8 n( \& {, h3 E% M& h3 ?<TR>' ^2 K+ D6 K5 Y$ r6 G
<TD><PRE>Method 01 ( q2 b0 O( C7 T3 v% {& n" L
=========
3 Z3 L9 {8 e& D9 {; ?3 E
# u( D h: w9 |( N; h* F7 eThis method of detection of SoftICE (as well as the following one) is
3 g, k: J: Y) jused by the majority of packers/encryptors found on Internet.
3 ~' Q+ x+ i4 k, a0 HIt seeks the signature of BoundsChecker in SoftICE) H- h( }. k6 p2 @, Q# |
9 ]0 ~7 T* Z% K0 j+ k
mov ebp, 04243484Bh ; 'BCHK'
2 h: T* e, q1 K2 O0 O: i* D) a mov ax, 04h
1 @2 ?1 s" R3 q+ R4 e2 H int 3 + _- [/ h. R, Q; E+ e1 l) S
cmp al,4
3 J0 B6 C4 M" F- k4 [6 H T& S( E jnz SoftICE_Detected7 E3 `2 e x) k5 T1 r
" G' e# ^$ L4 u
___________________________________________________________________________# }' y/ E- ?% n8 T% ]% G$ `
7 l4 B: I; M; R* g- R- O) _
Method 023 R% O+ j$ D+ Z( H5 [2 \( x$ F
========= N% F# h3 c9 `) I! N
6 k) B. e* Z5 S$ U- v
Still a method very much used (perhaps the most frequent one). It is used
/ S5 M# C, S# J/ |to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
1 f1 o3 @/ F! q3 H5 P+ p6 v! Wor execute SoftICE commands...
5 g4 }/ b7 W! kIt is also used to crash SoftICE and to force it to execute any commands
1 |: x7 f0 i2 ?(HBOOT...) :-(( * I/ _3 P) A7 t0 |4 Q5 @% r
5 ?9 A$ A7 a1 J
Here is a quick description:
" i6 P) Z$ ?3 ~2 s% V0 l# h% y! r-AX = 0910h (Display string in SIce windows)
5 N" Q4 K* ^) s/ j8 e9 X( {. q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)2 a1 _4 [/ @+ ]7 ^
-AX = 0912h (Get breakpoint infos)8 v+ d' U5 ^- E! d# }. v! y% P/ F
-AX = 0913h (Set Sice breakpoints)
5 c5 h$ }' D% S. o5 w( j-AX = 0914h (Remove SIce breakoints)
$ O% y1 P9 h0 Y$ O
4 U) b$ A: U4 x; m3 V. gEach time you'll meet this trick, you'll see:2 F/ q: V* G; ]2 n) U0 K$ g8 T
-SI = 4647h
" ~! c# Y) _. u/ \7 @$ }-DI = 4A4Dh
/ L# R8 K% o" Q. H4 Z4 X5 R; m0 lWhich are the 'magic values' used by SoftIce.
) G6 f. X: E" O- N5 s! g+ x' LFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# j- V7 i& O9 z3 ~& |1 p
8 [5 n5 v* V1 o4 \; U, J* ` DHere is one example from the file "Haspinst.exe" which is the dongle HASP
) ]# ^2 }+ m& `1 CEnvelope utility use to protect DOS applications:
* R+ p) R2 _- j& D; V) T* p
- D4 |' G9 `8 F4 Q( U: X# L
! X8 T. \* \1 b% I3 E4C19:0095 MOV AX,0911 ; execute command.: V% b }* h% t# L0 B" I" m3 M- l
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 A9 }4 o' i: O5 ^! \ C( D3 j8 ?
4C19:009A MOV SI,4647 ; 1st magic value.& |' c2 y& L3 s# u6 R6 k
4C19:009D MOV DI,4A4D ; 2nd magic value.
" j Y$ E3 \: B$ Z9 T4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)( M& x' h& H" \ G: p7 B
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
s: U) H9 ?6 p% R$ C! z4C19:00A4 INC CX! n* J6 a3 a1 ^0 Y% r0 \
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
+ y4 U, Q$ k" S8 `* V4C19:00A8 JB 0095 ; 6 different commands.
. ?8 ~2 W/ Q. V4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 M$ o$ o/ }' c" q5 I
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
8 I. y- h# g( x4 v: H9 h2 p7 U2 |& s
% @ M$ T+ D5 a. k. w+ ^The program will execute 6 different SIce commands located at ds:dx, which6 t% x" |, U: _. {& s* ~; H
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT., h7 e: g: E! E- E; l# Q
" \. H. o- Q3 Z6 @! `& B% t
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
4 X7 W/ ` N* v) h( p8 V( w$ z___________________________________________________________________________
+ d7 [ S) F8 y! g% H6 W8 W
! e, p! _ U. y% C* ]% Z
+ i9 z0 p, E/ H: P; d* dMethod 034 L# e% F: t1 D6 \1 J" h6 |
=========* W6 V/ S) E5 M) A
% B K7 i4 D! Z/ e/ e+ Q4 ^) n+ l
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' b4 J1 ]+ F! n6 \8 E- q(API Get entry point)( v9 K5 o5 k0 [1 \+ \8 ]9 H
3 T1 }2 I- b H V% z5 r# c) Q; S3 E8 Z! N; G8 v2 T. k
xor di,di/ ~4 ]' m, D1 T, T9 u3 q1 [% \- w
mov es,di- e* k2 H! C; W9 H
mov ax, 1684h 9 m" M( ~' l# q: A3 b
mov bx, 0202h ; VxD ID of winice
2 z: ^' k* \8 X. X# L0 {8 y) @ int 2Fh9 M' C7 S9 t3 s2 w) H; `& e7 B
mov ax, es ; ES:DI -> VxD API entry point
- K* u6 u' B- Z+ ^0 {& p add ax, di
9 d) n' c6 ~. @( A test ax,ax' B8 L0 ]* U( r7 Q6 p9 I4 O% I
jnz SoftICE_Detected4 V3 u) M3 S" P/ L5 D& U1 m
( k) G8 K! Y8 @% A7 ]; w! Y( N___________________________________________________________________________
) u! t: O- A' U9 O& F" i, p3 U8 f1 D# K& C% d! F
Method 04. u0 y* @& M6 s6 b' Q( r" a
=========
+ _. Q, _/ T/ p$ Y! j! P+ v/ s6 o; n9 O: v
Method identical to the preceding one except that it seeks the ID of SoftICE
* y( v$ C! k/ y6 m$ X4 ~# N4 BGFX VxD.# a* l! i. E5 q9 I! T" }8 q9 C
0 ?6 o# H* ^7 q% q+ M ^; V# _
xor di,di# Q. f8 \; l+ h6 D
mov es,di1 z. }) |, y8 C) b+ x o
mov ax, 1684h 2 Y& x& a6 T: h1 k7 q. f0 F9 \
mov bx, 7a5Fh ; VxD ID of SIWVID
5 ~5 t1 \; j0 F# k. ~, O/ u3 \% P int 2fh
7 b! a. z4 W( Z" F mov ax, es ; ES:DI -> VxD API entry point$ `" c+ Q/ ^) q
add ax, di
8 E- C: C* d) P% x test ax,ax3 ?" L9 X9 w+ _) i- H3 \& z
jnz SoftICE_Detected
: U) H/ ~4 s+ A; Q2 E, t$ m n! o, [1 Z: v6 |; e
__________________________________________________________________________
1 n( t: v; X; Z" ?2 ]1 j: H, A' Q. {, I% r N; n L0 G! @$ h- h
. D( b/ B1 h$ v2 F. G3 ]
Method 05
/ r; u7 y7 @ U# d2 ? Z=========) q0 E# C6 M K" q$ J
+ \0 Q& a- n$ {/ U; q
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ i* T, b C: x
debugger. It calls the int 41h, function 4Fh.; ?2 {, h% c/ i
There are several alternatives. / U3 Y7 V( [: u+ J* K* E# W- ]
: w& y7 B$ t! N& b( W
The following one is the simplest:$ Q' h0 s% ^8 I8 r
% `1 a; Q1 X4 y% P$ T; P* ~) @; X
mov ax,4fh
8 d/ V+ Z( i: Q! ?8 x/ G. S2 | int 41h! o" r; p, g( m. }
cmp ax, 0F3868 H- b+ O" t0 K7 P0 I5 S# {# e
jz SoftICE_detected o0 x+ N, H4 B m
$ P" } \' p X# f! U( G) s5 C
* c4 ]4 B% ~$ g2 K7 t
Next method as well as the following one are 2 examples from Stone's
* u5 Y3 d& \6 ?"stn-wid.zip" (www.cracking.net):; c8 m* M$ `8 L; G
* _" B% z7 Z+ H# u1 D7 s
mov bx, cs
+ B3 L" J6 b; v4 G lea dx, int41handler2
6 a; q$ B, Q: y, l$ h% h xchg dx, es:[41h*4]
7 W; Q- K w- J; a7 o6 \ xchg bx, es:[41h*4+2]# x3 i W f( _, H/ H1 H- w
mov ax,4fh
5 Y/ B0 ?$ S3 k. x0 p- U int 41h
@$ o3 F4 K, M6 V xchg dx, es:[41h*4]
# ~& F3 N6 k6 z. u2 V( n! a- k" b xchg bx, es:[41h*4+2]
5 g% H' [6 u K) b6 q cmp ax, 0f386h
& L& [7 B1 h4 k; R0 `$ e& q jz SoftICE_detected
3 V+ i0 O- }6 V/ l# K
; Y- c8 _: q/ C g( w4 gint41handler2 PROC
* v( W4 l g5 x, [& s$ \% F iret
# p% h- j6 K. R- _4 Yint41handler2 ENDP
! x- Y: J% e* B4 ?. q+ M) l9 \8 y) P# H' |2 r. |& o# _1 f
3 C% K3 u. R+ R* R6 N9 r_________________________________________________________________________& G0 S, i: l. o$ V4 P- M, @. f& s
! K9 [! C& |6 S7 y. ~
/ ?: G$ p% R- `- Q3 \' |6 ?Method 06
0 p! C0 M0 q" [5 \- ^1 |, p. y: m" a=========
$ U" b: c, n' m6 E6 `6 ^8 m- v8 D
7 A5 ]5 I* t+ i P& ?1 h; @
* c" @$ q% h4 w& ]6 H- @ {2nd method similar to the preceding one but more difficult to detect:
5 R; B9 [: ]4 F) ^, T6 Z5 i$ q4 n( v, ^
( e/ l% F: g7 M3 y
int41handler PROC
) N3 { K+ h- \- } mov cl,al$ u& `6 |) Y0 {- B: M
iret& N2 g6 l& W6 i+ P
int41handler ENDP
4 c! n6 e& d: M7 N' h8 g7 h- y( V$ G7 y1 |+ L3 g- ?
5 W6 p8 V: D3 d' ?' P! r
xor ax,ax
; O1 A+ j) e" b$ k8 K mov es,ax
9 ~& F5 u/ b# _ mov bx, cs
* X8 M" q/ A( f2 ] lea dx, int41handler, c4 w/ q& B3 Y! e8 y
xchg dx, es:[41h*4]
# A4 M$ y0 f' z ]/ P* e2 C xchg bx, es:[41h*4+2], H/ N: p( |. h3 t) A
in al, 40h
, N4 X* [( e/ f# r xor cx,cx
. R) q8 F2 w2 ?. J int 41h
5 ~5 Z" T# y( Y+ p xchg dx, es:[41h*4]
' j% z. P% `' y; X7 \3 C% N0 f xchg bx, es:[41h*4+2]& `0 e% ]. s1 V7 [( X8 J
cmp cl,al
* T/ T; B* f! G* O- W) T jnz SoftICE_detected1 K E1 _+ c2 Q- \) g# U
0 p8 K3 N0 y' g8 R2 Z
_________________________________________________________________________$ a, k6 Y4 A) j. w* g- ^# a3 U( G
+ l: d' K* c5 w& Q; s8 w
Method 078 j' R# Y0 d& j; a! j
=========
6 n; a |7 f5 C8 T9 s
/ `9 B: v" B! l9 y7 i% v6 }& `Method of detection of the WinICE handler in the int68h (V86)
* m6 P1 s$ H: S0 R( H% z" N& K1 m) Z4 e) q
mov ah,43h! @3 f) s' d9 P7 V4 G; ^ t
int 68h: r$ u* x8 m2 v" Y: v8 _7 |
cmp ax,0F386h5 f9 n& ?+ ^- g1 J: H0 l( m
jz SoftICE_Detected
: A' G% `9 E( c& M7 p3 w
. F% Y& `5 j9 q' O7 N1 `, `% b6 G5 F- ~5 {4 h
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 V7 {0 W# J7 B0 I3 h7 G
app like this:: z( Q% {4 A" ?2 U1 g* O
2 D5 L: k' ?4 J! i* r) R
BPX exec_int if ax==68
. b; K1 A2 A8 m0 _! P2 r% u$ a (function called is located at byte ptr [ebp+1Dh] and client eip is
# ]* a8 O$ ^1 ] {$ T located at [ebp+48h] for 32Bit apps)
' g( u; ]3 B& h__________________________________________________________________________
4 d- H& K4 p- I- S# o* d7 h3 F1 c. `$ ]/ h9 a/ L' z. E
3 {( |9 p! _+ Z0 [* c0 K+ [2 VMethod 08
2 V! B/ w; B+ u+ [, \$ g- g+ C$ c=========% ]% ^. B& H6 N7 O. M2 i
+ X5 J& v8 \, ]: |7 N! I+ @
It is not a method of detection of SoftICE but a possibility to crash the4 D( w! p" w5 p) e# h; _$ @
system by intercepting int 01h and int 03h and redirecting them to another& Q; O3 C% A2 L* V1 _# v
routine.
8 l( ~. O+ ^7 w: p; jIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- a- U- m$ C6 H) c
to the new routine to execute (hangs computer...)
0 c; w/ t9 v6 q/ D* c
& C. B R" I. { mov ah, 25h& {2 T) N1 i5 g& G( c! F
mov al, Int_Number (01h or 03h). ^; l4 B/ j0 }9 [1 T
mov dx, offset New_Int_Routine
8 }; @) q; a) i: Y int 21h
* U ~. F4 L* h6 T9 m! `% g
8 W4 g+ L+ @, J. [5 p2 {5 ?__________________________________________________________________________6 J/ z# w2 c& J' n
: ^0 z; `2 z( O1 i3 w" S1 H& r
Method 09
! w$ x1 X3 \" ]5 E: H5 |$ j; m5 h=========
: ^ t0 {. q- M! T# Y3 v. ]! r& ~ \# A' b
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 [. C: G7 X# w( h) @
performed in ring0 (VxD or a ring3 app using the VxdCall).
, J; R5 g4 u- k, q* I# x0 iThe Get_DDB service is used to determine whether or not a VxD is installed
8 W- x9 o( g6 B8 ?3 b T" Ifor the specified device and returns a Device Description Block (in ecx) for( |' E S2 M3 ]& k
that device if it is installed.
$ b* _9 L2 l- o7 {! I; M/ D+ i3 T+ }+ ]2 g! w
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID" y3 Y' z! Y2 R+ Q2 Y
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-) E( p+ Z9 Z- e" j8 Y7 V! S7 a3 [' {
VMMCall Get_DDB
& S4 \* S7 P% v* z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: I$ `0 b# j- H' H8 f/ z% b$ p
9 O$ \0 W6 Q% C2 [# M2 S: t' X
Note as well that you can easily detect this method with SoftICE:+ T0 q( d! j9 B' V- J) j( e
bpx Get_DDB if ax==0202 || ax==7a5fh( l; E( j' }0 v: m0 G8 K: ?6 G
; N3 Z+ }- c1 ^, Y6 g0 z
__________________________________________________________________________
4 ?7 C! C8 x' {6 ?: P! C6 v0 R* C
Method 100 h1 @7 l4 i# W# h$ O; @
=========
) w) A& U2 w. F. |8 r7 s' C M' Z: ^- u7 I5 h2 P: q
=>Disable or clear breakpoints before using this feature. DO NOT trace with
8 u/ X4 s- p5 i. s0 Z- y4 J6 U SoftICE while the option is enable!!
0 J# g7 }& B7 |, O
: e% B) h# Q0 L* J9 J% x+ CThis trick is very efficient:7 F8 o6 l1 M7 Y& b T( v
by checking the Debug Registers, you can detect if SoftICE is loaded: k# Y( p! C3 f0 a1 y: v
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ F" G3 H8 R+ s' {1 M+ T6 I; xthere are some memory breakpoints set (dr0 to dr3) simply by reading their$ f* |8 v3 V, d8 _, r+ I( y2 m
value (in ring0 only). Values can be manipulated and or changed as well K6 r0 b$ Q8 E- B0 G
(clearing BPMs for instance)
$ `6 D. N- ]: E+ ]# V \* i3 \5 O6 }: h% y; v
__________________________________________________________________________* w+ M% N3 g3 I
% d+ n6 }2 F" }Method 11% w. s- M6 g ?) C7 h
=========0 y% o( N2 A6 t. ^$ F
0 O) o) \7 {6 b0 u" ^
This method is most known as 'MeltICE' because it has been freely distributed
. Q, R8 h# Q. Mvia www.winfiles.com. However it was first used by NuMega people to allow, H; W, M( I; u4 O
Symbol Loader to check if SoftICE was active or not (the code is located" G) o- Y, a& o' C6 |6 Q3 H; q8 ]
inside nmtrans.dll).
% g- o! | J9 ?2 p7 z7 z! l; ]/ x
9 `) v8 I5 E+ b0 l' OThe way it works is very simple:
1 X8 e8 j; @7 gIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; |1 R/ k/ _7 N& H9 q) {WinNT) with the CreateFileA API.
6 L) C' e' W; R6 g8 T( L1 ]1 m+ O
" z" }/ Q3 }( c+ l# U+ W0 O6 S4 \/ {Here is a sample (checking for 'SICE'):
7 H8 z% r; d0 C" _& J+ N, s9 Y
! x! S$ m' C; Y/ m2 l, ?, |3 pBOOL IsSoftIce95Loaded()
4 p, s8 z. W4 J0 [, g% j# S{
3 P# ~6 E- Y: F HANDLE hFile;
' W; @8 F3 B' `6 l z7 ] hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) ]+ O6 A8 `0 {! Q+ k5 x5 L+ i FILE_SHARE_READ | FILE_SHARE_WRITE,0 `2 [ V' v& j- B* F
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- U A# O$ ?& U* j1 H7 ]
if( hFile != INVALID_HANDLE_VALUE )
5 e7 C, Z$ y8 J, a& C {7 m3 q* S0 N: Z: U/ D3 [* V
CloseHandle(hFile);4 g( g; \# t5 W
return TRUE;
' B, ?. w# C9 | }
) g4 S# n8 V; T& y7 g return FALSE;' A& y9 o2 a0 o# ^" l I
}4 h j( X& k( K
+ ]4 r! Q: [$ R' Q3 m
Although this trick calls the CreateFileA function, don't even expect to be( a0 k! U: ^; {+ h+ m" ]) \( L4 K9 ]/ Z
able to intercept it by installing a IFS hook: it will not work, no way!
, z) u0 a) b: e1 P7 qIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
* y, i. Q: T/ `+ l! rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- I* \* s+ ~" _! B& l/ L( z1 kand then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 e6 F! M+ L) \& Afield.+ k' b$ u$ a2 G4 R i
In fact, its purpose is not to load/unload VxDs but only to send a 5 M4 g6 e% W) \# n) U
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)1 h# x, l1 q8 y6 M; B7 a
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' ]& @: {- p6 |: ?8 w5 A( S
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
# o2 K" X( Q+ x7 [5 c- uIf the VxD is loaded, it will always clear eax and the Carry flag to allow* e5 t' Z4 k# I
its handle to be opened and then, will be detected.# {* `2 j+ W" w1 @& ?
You can check that simply by hooking Winice.exe control proc entry point. }7 m$ x4 N- \, V
while running MeltICE.0 b; }/ z, v! J% l1 t+ g+ F- i6 @
! O" W8 N0 r9 Q4 Z+ S3 B3 Y$ C
: K8 K/ d) n- h/ ^# ^$ G/ E# k# c 00401067: push 00402025 ; \\.\SICE+ w3 u" Y! P2 \+ w* V- |% s" X
0040106C: call CreateFileA* v$ y2 t+ Q% H/ |! _* o e2 `% ]% R
00401071: cmp eax,-001
! t( [; x* X- i( z$ h7 H 00401074: je 00401091
2 X: Z! h* x* r6 @6 A% p9 t2 G
" ^% ~5 I2 G9 _9 k5 s: P% S& C% S0 K4 `% Z s
There could be hundreds of BPX you could use to detect this trick.
! K* V: G! C% E u% n; F3 O-The most classical one is:/ r3 V2 x, i0 ~: w" Z( K2 f! b, l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" y1 E: E; ]2 K" Q( o
*(esp->4+4)=='NTIC'
4 F& U) E. t6 p2 w5 n8 D, @' J' ]$ g
0 c$ i& \7 P+ e! K$ r-The most exotic ones (could be very slooooow :-() \) M8 ~) I. h# H
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( `8 m/ i2 ?: E6 {9 y! p( s4 _% N
;will break 3 times :-(
6 ^% Z+ q4 r# q5 [' {# c1 k; _$ l1 r7 d6 u" i7 c" u- p1 d* S
-or (a bit) faster: " j5 B* g" X) Q: i* e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* R3 L3 a* z5 P6 [
# g9 W( s; z# Y1 Z- \ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
* |. k* b3 z V) |# U$ M7 A" v ;will break 3 times :-(4 k V' D$ p$ `
& ^/ j# Q8 }9 I3 q-Much faster:
: | ^' w/ f0 E* l BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! s6 q8 o0 y) L" l v' y! }
/ T1 W) L$ u8 TNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
" O" M* c2 f! `& Pfunction to do the same job:
. ?* s1 ]9 F9 j. V7 n8 Y2 q
0 M3 C/ I# @2 {8 f5 |$ z push 00 ; OF_READ
; V' C) m# ^, `: R mov eax,[00656634] ; '\\.\SICE',0
* T, {( I/ W, @# N) J! {. p! k( f7 F0 P push eax1 p0 ~/ m- y% e1 ]
call KERNEL32!_lopen
; ]* l; Z; ^- [" j8 N- ~6 h inc eax
0 t5 U$ B0 I$ ]" [ ^- ] jnz 00650589 ; detected
7 Z0 T* k( o( Z3 O) q, I# B push 00 ; OF_READ; P3 L* q5 q& h6 q5 F
mov eax,[00656638] ; '\\.\SICE'
' w7 W, M& Q# N* Z0 E push eax8 C2 H9 a% I* K+ c9 y* P
call KERNEL32!_lopen4 b( y! D( [+ L p( Z; `
inc eax) p0 u: U) j& Q' [
jz 006505ae ; not detected* `+ i* R, N5 C4 b3 W. f
8 j+ ?+ K4 D9 \6 n7 R6 v' {7 t6 x0 z
3 S# u% E7 _1 v# x, T1 ]0 l
__________________________________________________________________________
- H# O) U7 Q1 S1 i/ t
0 u( Y: o4 O! n5 ^; i$ j( a" \ iMethod 12
$ R- M+ {: L, f6 u5 f! V+ _1 s=========, ^" r' Y5 J# M) |' [( q3 a
2 r1 U& E9 N! P
This trick is similar to int41h/4fh Debugger installation check (code 05" Y) w6 ?+ ]+ d* j! x9 F
& 06) but very limited because it's only available for Win95/98 (not NT)
7 W4 g- S) j% T% Ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 R/ H/ \) E8 w+ h' [+ K1 f" n6 @7 w. V* @
push 0000004fh ; function 4fh$ X8 _8 C! \6 v0 ^* S1 d" @" o0 G9 _3 b
push 002a002ah ; high word specifies which VxD (VWIN32)
& [ l; O4 N* l ; low word specifies which service
/ s+ w5 i3 J' ?4 G (VWIN32_Int41Dispatch)
( _% e8 U7 X3 Z7 _% r8 R9 |& ~3 r call Kernel32!ORD_001 ; VxdCall( {& M) W& d* [( u- Y( j5 [
cmp ax, 0f386h ; magic number returned by system debuggers
6 O# [! q( M4 V9 ~+ Y: F! { jz SoftICE_detected
a) C1 S6 [6 Y' s+ x
' w0 T2 _4 v% q) \- J4 CHere again, several ways to detect it:
( a0 q7 F/ R# }
J) f2 {4 m& o; D( d7 Z9 y BPINT 41 if ax==4f
( Q6 o6 J! J% V% }" e2 T% ^& t* }6 ]9 }6 z- M$ A/ Z
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, `. x7 n5 A u9 z7 w7 o. L
3 o; R8 L, M: H. M( b9 F
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
7 S) l& p$ t7 z9 W+ T3 H" h u8 t5 a9 I' w. N
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, R) p5 r. i: \# P7 \ |7 G) P3 b
1 n) H" D% |' B6 F' U* q__________________________________________________________________________
/ H2 V1 q7 ^" y% A1 {4 j0 o# g1 F7 K; ?* k( ?1 U0 x/ T
Method 13
" \* Z3 H6 g L6 o0 W=========$ C M/ |, D- o
' V) f4 I! B2 _( J ^ y$ e0 r# C
Not a real method of detection, but a good way to know if SoftICE is
2 `+ M& c- i( E! p) d/ D# Z# _installed on a computer and to locate its installation directory.. G: _) K5 F3 ~/ D! R' t
It is used by few softs which access the following registry keys (usually #2) :
6 W7 ]- S6 h$ ]+ I+ s
" t7 A( D p) \- @$ P-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 n% Z, t& ~ C" r/ { o7 h\Uninstall\SoftICE
- k8 u4 s* Z& A. W1 h-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, @; z9 g8 G7 X' L9 h& ]
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 A* h% l9 i% c) H, E" h\App Paths\Loader32.Exe
. p2 H0 `2 @5 g, O% R! ?5 e8 r, {! J2 {
- {7 K- B* c( |, ]* x: r( p
Note that some nasty apps could then erase all files from SoftICE directory8 m' H+ A3 X9 B1 w
(I faced that once :-(
- \" P: Z6 R5 \& \% w6 j
* |" q( g C# G- jUseful breakpoint to detect it:; R) C6 r. P7 @% e+ A6 r2 k
3 X: l: W. _3 ^4 A+ I
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
- ]: p8 m& `8 I5 O. m7 k9 j4 r* I M3 w. N: |5 [
__________________________________________________________________________
9 K2 l4 e. a) w( @ L" a
) s- [6 q L" K% R( ?2 z3 Z0 \# O+ g3 v9 C. g* t. \5 u5 ~
Method 14
, M: M! H; ^8 c/ H* i========= B6 N$ |) o3 l6 w& O5 d: {2 a3 \4 W
/ P7 ?5 @# x7 I; v* TA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: W+ ]9 F3 H2 x a8 m0 Gis to determines whether a debugger is running on your system (ring0 only).
4 c# |. y l$ V" o0 q- J4 U2 U5 ?; A
VMMCall Test_Debug_Installed
5 E4 ]- A3 X+ L je not_installed* Q8 r/ x6 [+ R5 z' d4 P$ ~
( Y9 n" F9 i) c$ P% J1 H7 rThis service just checks a flag.
1 y: D! N* v7 ?: E</PRE></TD></TR></TBODY></TABLE> |