<TABLE width=500>
! y1 R: r! }4 Z4 c. _<TBODY>- ?2 v( L( I& l& y
<TR>
2 O# p. u' y' a5 g: {$ g1 `6 B. _1 J<TD><PRE>Method 01
0 V9 e8 X$ E. t' \7 c; H; ~=========) g# a$ I3 b: B C
5 B/ W- ~( r1 ]/ C, ?. o; p& l# _4 ~
This method of detection of SoftICE (as well as the following one) is
2 p9 ^% b6 V5 J/ A$ Rused by the majority of packers/encryptors found on Internet.
4 |9 I/ ^9 N! O, U8 FIt seeks the signature of BoundsChecker in SoftICE
, W( L- y( k- [' b" b6 `; j* E! W5 J8 m8 d
mov ebp, 04243484Bh ; 'BCHK'* s8 e8 D, }% d" {2 W2 p
mov ax, 04h
( f. x6 h! D5 q# ]! O6 O int 3
% b* o, B# d) L/ I2 E cmp al,4
8 u' H. I6 B7 w- F jnz SoftICE_Detected5 B7 j* T, g. q) k X# I
. r1 c1 E+ [9 L. }0 @+ K/ a
___________________________________________________________________________
( p' C) q7 h3 s g! E. ~2 F# ^8 I* D) t) D/ c1 Q1 [% E$ V
Method 02
7 i# @$ ^, \$ a: F: s=========0 C5 `/ y* _# w# `$ `* Q( | L
$ ^" V# Y# A# P; s: ~+ S& n/ R( q- T
Still a method very much used (perhaps the most frequent one). It is used; k7 f1 W% N8 c( M
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. ^/ Z) ^: s3 o6 a8 lor execute SoftICE commands...
8 C# Z& r2 E; l1 YIt is also used to crash SoftICE and to force it to execute any commands
6 h1 [! o- w3 X(HBOOT...) :-((
3 m* m# }' v5 x7 X% T1 _- d4 @" l
- V0 ?& D" q# o; @! C0 O& _- z* T# B7 ZHere is a quick description:$ Q, d q( L: \9 T, Y8 T9 j
-AX = 0910h (Display string in SIce windows)5 O/ O% f/ b" B, q
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- f* r. Z$ J) d( i8 }3 A
-AX = 0912h (Get breakpoint infos)
2 {. U1 d/ u; u: k# D/ l-AX = 0913h (Set Sice breakpoints)4 N- Z1 f2 e& R) {% k& g, B( B
-AX = 0914h (Remove SIce breakoints)
' u3 d: u9 n. W5 w# t7 c. m. q# x
2 f$ h! @ u! M: U; GEach time you'll meet this trick, you'll see:6 B, h6 A/ X! I. Z i
-SI = 4647h
3 V: ?, ~ V w1 T3 g! R-DI = 4A4Dh
1 T' B# q% L) J% \( K* WWhich are the 'magic values' used by SoftIce.
( E# z: p: s7 I. U' z: iFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.) F8 c# B R3 [+ s$ [
, @9 Z6 E: A: J* A9 b1 W' x% I3 f
Here is one example from the file "Haspinst.exe" which is the dongle HASP
v6 L! H2 C- P+ zEnvelope utility use to protect DOS applications:
/ r% {: A" q; A
7 m2 J6 v* k* V$ R- a% M3 O" ]+ s
4C19:0095 MOV AX,0911 ; execute command.; d1 p. G: p& L G0 d& f( b4 g
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).- }% ~& i4 u6 |# \; m1 U
4C19:009A MOV SI,4647 ; 1st magic value.
% V, G- b. O8 }% z0 g8 g4C19:009D MOV DI,4A4D ; 2nd magic value.- m0 V0 `7 ~( [; L
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
, j6 A; w# |: j4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute0 }5 N- l% i. X K1 u6 m+ P0 r1 {5 U7 h5 w
4C19:00A4 INC CX
6 A+ Y; q1 Z8 g/ U- c* ]$ k# Y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- ?) J/ }8 T) C2 Q. y& l
4C19:00A8 JB 0095 ; 6 different commands.
% r$ C8 v( h0 J3 k9 F* E6 x& d4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% Q. {$ R4 U1 O0 \4C19:00AD MOV BX,SP ; Good_Guy go ahead :)/ @# A7 k0 Q9 {+ m' o$ S
, B- }! W, R5 e& I/ v( K& \1 u
The program will execute 6 different SIce commands located at ds:dx, which
+ @8 h2 b3 F7 R0 S& ?! |are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.) J& N }0 v* O* s
& \, @9 P5 Q$ @( |$ J2 q. \! u7 l
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 \: `# t6 u G2 R3 T' ^___________________________________________________________________________
; a+ A5 b! t9 n' M* |- y
0 h. ?. N) A f+ F7 h7 \* \0 q* k) ~. }* ^: T* g" _
Method 03
* U7 [& F; E' N$ p6 i* Y. j=========
' e Y5 w4 z4 V& J# c/ Z9 K) r
/ N F" ?* O# U4 m$ NLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
1 N, L( p0 i8 K& `(API Get entry point)
7 n: h4 X( o. r' e. S6 I
9 q) t3 h# p& `; c
& J0 s4 o0 ^0 M" s7 N2 D { xor di,di
9 W+ h' ]# _3 j; L( B mov es,di
n% M) V% H$ R2 S1 a- D mov ax, 1684h
: w# X$ h+ r& _ mov bx, 0202h ; VxD ID of winice$ Y) w3 w: G* I- x: J
int 2Fh
7 J4 B! }2 \; Z/ W% { mov ax, es ; ES:DI -> VxD API entry point
) N: @& {- n4 M add ax, di
" V# R( a; V$ F) j h4 m7 G test ax,ax
, \: y2 S( Z# R4 A% S jnz SoftICE_Detected
( t- p: J+ o) h) R3 c) o' I& R. _+ H' Y. M
___________________________________________________________________________/ i, I4 W2 c; s1 U$ N
9 ^* l; Y; h$ @Method 04. c: p: @* i5 s* Q5 h$ F& h
=========/ ]# U0 K! j1 {
% `3 z2 s2 M5 ^6 c- x5 vMethod identical to the preceding one except that it seeks the ID of SoftICE: p& G& q- v! o+ X6 T" _/ U- D
GFX VxD.
+ c5 ?8 H: p+ Y4 [% d1 `% ]. O/ F; ]( e! }8 s/ [. z' R
xor di,di* |+ q) l% P* Y7 n
mov es,di* d8 P0 x. ?! t6 c; f+ m$ {8 W
mov ax, 1684h 6 L, C! a0 W8 H% I2 v. `
mov bx, 7a5Fh ; VxD ID of SIWVID, `/ M1 g# y& @ ?& }1 i
int 2fh) G9 ~( _+ `+ g
mov ax, es ; ES:DI -> VxD API entry point
& R, G s5 [3 d. U, M7 q; W add ax, di
) [" @. h' H. _ test ax,ax
: x, a W1 J) \& k jnz SoftICE_Detected
. T g: L! N$ C* E8 ^8 W8 t1 Z5 e- i* {2 s! Q, [6 v u$ g
__________________________________________________________________________- e& f# Z$ @* o" l
. g( B, d; @. C" |, H i3 C' S& r
2 P( F% l: S% ?" u& v+ ]Method 05$ u% G7 F1 _2 \$ z
=========
& C4 k" J$ Y! F+ B( k6 _& G* q' Z9 ^' a
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ p! c* K% _4 i. ~
debugger. It calls the int 41h, function 4Fh.9 A8 Q' x% o I8 W
There are several alternatives. 9 n! U: {; Z3 `& W, h
! b) ]+ K+ B4 q5 p
The following one is the simplest:% p1 J; G4 a! {3 C4 p. p, W
& T& P7 e5 Q+ P' @- s+ o# M mov ax,4fh
( `. J7 @1 N8 `; C2 T# Y* ~# c- q int 41h4 D9 N9 u4 g3 w- u' K
cmp ax, 0F386
! T* O% m2 Z! s, Y jz SoftICE_detected
1 Z/ [+ S+ v O$ d! w; U. k- k* V. f9 v0 M9 E
; D# g* u3 C" PNext method as well as the following one are 2 examples from Stone's ' W$ B4 R5 L9 s- A& d/ @8 F1 [
"stn-wid.zip" (www.cracking.net):
# ^" {0 D+ m6 T5 F# W+ B
' r/ u4 V& O0 U/ o. a* b0 R. v ] mov bx, cs
$ t9 M2 n4 r& @* [ lea dx, int41handler2
1 Y+ Y9 x, ?- P7 j0 ` xchg dx, es:[41h*4]
/ {. ~7 M' B' [7 R% j xchg bx, es:[41h*4+2]9 ?8 H1 J! @8 q* u* u/ z) Y! b
mov ax,4fh$ u; {* j# g! \! W
int 41h
" t% t' r* U; N3 t5 H: Y7 M xchg dx, es:[41h*4]
, J( F0 F7 ]9 C6 i xchg bx, es:[41h*4+2] I8 r( E% d* K
cmp ax, 0f386h2 ~: G4 R; a. t5 p) W) K: w
jz SoftICE_detected7 u/ {6 W# N# Z
- R7 d* S2 |4 W0 e* V( O P% L
int41handler2 PROC. }% ]! X. w' G! F6 Z6 A2 K; r
iret
' ~3 d1 j% p/ N! M: T' Qint41handler2 ENDP
8 G) q+ t) Z. p. i& k- W# K! P. S7 r* f! T2 t8 j
" b) c: f) H2 K7 |_________________________________________________________________________+ x" k" B! _% a s% Q* S/ R
; ?, L G) m; D9 u6 k+ I I1 O# \/ l9 H4 m! d" E
Method 06
0 \1 D3 K* k* A) I=========4 Y1 P; T, b8 |3 K% }* `
! A; v8 M+ k! D- g7 o6 X' W( `# ] s9 Y8 r% i
2nd method similar to the preceding one but more difficult to detect:" Y- b- D$ S% }3 t* V
. ^. s3 B. D/ j1 R3 F
5 l' T* A, Q5 S" P& i6 M' Nint41handler PROC
* O! G1 t: P/ H% I mov cl,al# U7 d& ?. o% g N4 w( t! @
iret: [- J# X& R3 N* }7 b! D
int41handler ENDP( B( s% }4 K/ p% T3 ~6 d
- p4 y# h2 d, u5 t
. i% S, p. S; u+ A. }( `/ z/ w
xor ax,ax8 a3 F' m- D( s" w/ \0 C
mov es,ax
" U2 f, `4 ^( |# j' x% R mov bx, cs
4 Z4 P) B" j3 U. ` k7 u lea dx, int41handler" j7 t: ?& `7 Z; D4 H) [
xchg dx, es:[41h*4]
1 [0 W5 B7 v- |/ `, c; t _' i xchg bx, es:[41h*4+2]+ D, Z% D3 k, y6 x+ g- c6 G2 C
in al, 40h* L# I1 V' U8 z4 \
xor cx,cx. R. U/ m; F: H' i4 E i
int 41h. w+ P p8 v' @/ u4 Q% M9 A
xchg dx, es:[41h*4]
. j' C( f# q; {" c9 c: Q( f- [ xchg bx, es:[41h*4+2]" F2 i3 p% B2 I9 \- e A6 }; G
cmp cl,al/ X0 @# l$ o8 s# y
jnz SoftICE_detected
9 S0 m0 `1 B2 D4 f# W% r( i6 K: b T$ F
_________________________________________________________________________7 _9 Y+ H/ x+ N. g& }7 [% ~% J. E6 F
: @7 N- q6 y3 a4 G: c& UMethod 07" g$ J! S$ g+ V" F) O9 v
=========; i$ @0 L0 s( L( N& p
$ A" i5 u' ?3 Q, p3 k- x8 }
Method of detection of the WinICE handler in the int68h (V86)
/ S" _5 ` _* C
]% e" F$ ?) l3 x0 b: E mov ah,43h2 s3 b) c6 }9 ]8 T( h, P7 ~# `
int 68h. i9 w8 G: R: H
cmp ax,0F386h
1 E0 b) L- V4 e( c. h0 w' [ jz SoftICE_Detected/ x. n0 N7 ~( ?1 U
- Y- T1 X2 x" o) I6 a% S
. |0 C2 x! D1 |, F! ^1 V' \! ?=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
N9 c ?2 F) K# i7 C app like this:
& T# N. N1 a. T! F) \/ ~
6 Q: z% ~" q& ?' x BPX exec_int if ax==68
. f {1 ~7 p; L/ e& o3 W (function called is located at byte ptr [ebp+1Dh] and client eip is
" N d1 E" }9 \. F2 W+ a located at [ebp+48h] for 32Bit apps)
9 ^& w+ y' x3 ~& N' |( F__________________________________________________________________________+ `" r+ E& G! b! r, Z$ V
# N, `/ q& N$ I0 ]4 N
: j: A3 h: M: T0 g+ t/ n( k+ oMethod 088 k# C; j+ i' V% c. J6 F# v% t
=========, R6 p% Y; `' w. K
8 b& x$ z! o1 f! eIt is not a method of detection of SoftICE but a possibility to crash the
- z2 F& ^ s) y8 z& Y% f7 Qsystem by intercepting int 01h and int 03h and redirecting them to another; ?0 D* I, H. x- e0 t, d, @9 L
routine.% O* U- N$ h6 F. e w
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- }3 w2 z9 l3 x/ X# ~
to the new routine to execute (hangs computer...)
6 l! ]( b: Q! S/ [3 o- K2 ]; d5 e! _/ ^& F. n* X8 `0 `! k6 [
mov ah, 25h
% N" H4 @* ]: x8 B' U mov al, Int_Number (01h or 03h): q6 o2 G* C: p& K$ S. j6 n+ V
mov dx, offset New_Int_Routine
! z4 I% C5 b& M$ p3 Y* p* ^ int 21h/ e# G2 u& F( n% l2 S
' {9 h. b6 \* q, Y8 }
__________________________________________________________________________7 K3 |/ W* T: m) A- h6 x w9 K0 t
' z: K# O$ r8 Q, nMethod 09
3 g7 N# M- A- c=========# c, _% W* R" F
3 o& P; E; `6 l8 ?5 g: ~* x( `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
7 j4 G$ \1 u( [" F9 ~performed in ring0 (VxD or a ring3 app using the VxdCall).
' d, z! A- L) h# p2 h' L( u6 k, pThe Get_DDB service is used to determine whether or not a VxD is installed# s G; q7 ]- T+ [' ^/ e
for the specified device and returns a Device Description Block (in ecx) for4 N4 W# R d" X9 ?
that device if it is installed.
# |1 i7 Y1 V4 Y* I& x" h' ]
6 b9 @) d$ B- T; P3 y* F9 E; g mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, Q0 E8 W- W r, ^3 U/ {' e mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 j9 b# f' e& X* l- @1 ^
VMMCall Get_DDB- V" Z3 V7 f4 A3 k& W, Z
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
" u. u$ K' F$ K) {/ V7 N1 L4 T3 B: r4 r$ T+ O7 h/ {
Note as well that you can easily detect this method with SoftICE:
, t/ f& Y/ O0 r3 G' @ v: N1 _ bpx Get_DDB if ax==0202 || ax==7a5fh7 S% J" x3 A: [- z9 T6 z2 y
: a9 Y9 Y3 n# Z; U6 |( C, B( m# V/ W
__________________________________________________________________________0 S' H3 x/ E, _0 p( Z! v& a- U7 N
6 i8 E% ~9 K# M' d$ G
Method 10
9 `8 m& }2 y+ }4 U) z=========
4 A4 ?$ A% Z" {) B5 d" C. Q
6 h+ V# B' e4 B$ o4 C* D5 R& @=>Disable or clear breakpoints before using this feature. DO NOT trace with
. J& x7 r( @3 i f4 W: [8 k SoftICE while the option is enable!!; ~7 n8 s' m1 z
& P7 a3 U# x2 _: K) Y5 RThis trick is very efficient:1 X( o$ S1 _% b& N3 m1 i
by checking the Debug Registers, you can detect if SoftICE is loaded0 v8 b- F5 S4 [ d1 _; e3 w
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if& l z v& @) o# s
there are some memory breakpoints set (dr0 to dr3) simply by reading their' M7 S6 w, T; O3 T7 n
value (in ring0 only). Values can be manipulated and or changed as well. Z" |0 K- e4 k& F9 G2 F
(clearing BPMs for instance)6 S, i/ i( U5 t. z
0 f3 ~$ l7 m+ r" X7 C__________________________________________________________________________5 e5 l6 p' W/ n
3 [) y! R7 N) e4 |" W/ U9 xMethod 11
% Y8 P. T7 A4 R8 c; U=========
5 y1 A8 m$ _5 A# O) V& g5 A1 C$ M2 ^ P5 c
This method is most known as 'MeltICE' because it has been freely distributed
8 f9 K* W @9 T! [4 gvia www.winfiles.com. However it was first used by NuMega people to allow
, V: \& J8 l- H' t( ZSymbol Loader to check if SoftICE was active or not (the code is located
: F0 L$ Z% j/ ]2 rinside nmtrans.dll).
T7 q$ I- o3 u8 |, @9 K t, z+ W4 B- r% q; X+ a
The way it works is very simple:
* p' V8 t/ p% Z OIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' c# u) q' u+ m1 J9 o! [/ x+ u9 u9 P
WinNT) with the CreateFileA API.
$ M5 y. D- @1 d3 Q8 C+ b2 J
4 h. V0 ` g- D F; x2 jHere is a sample (checking for 'SICE'):( S# g. P$ j9 \
9 G# V- t) O0 Z4 e7 Q0 S. T8 RBOOL IsSoftIce95Loaded()
+ I0 a, W, N" j, j* ^* h, q a{3 K# d7 O- v: m
HANDLE hFile; 5 z* O8 k, r/ f$ i% Y% [4 f9 E
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 y( T* J4 }+ I0 B" ~ FILE_SHARE_READ | FILE_SHARE_WRITE,; a# l5 m d9 T8 Z8 P. I/ W V' N
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 L/ S, G+ V1 g7 P# K3 E& @. H4 N0 U" u if( hFile != INVALID_HANDLE_VALUE )# `' n) u8 k9 R' Y
{% Z0 K, G I( [2 X: r! b* n* h+ F
CloseHandle(hFile);
1 S& O/ C5 ~6 O. O return TRUE;
& B; G) o/ o6 g. b/ ~0 f4 J9 _ }( n& R4 ?/ p6 M% i, I' H# e. X
return FALSE;
. g# [9 G, o- Z# a9 ]+ a} B* O- V+ u7 T( T+ i
& ]; t' a- }1 l0 l& k8 F
Although this trick calls the CreateFileA function, don't even expect to be" i+ k9 x6 I7 N& \
able to intercept it by installing a IFS hook: it will not work, no way!
" P# O' c( v6 y" ]( L. t, y) V/ gIn fact, after the call to CreateFileA it will get through VWIN32 0x001F5 n9 I5 ?* @4 P J
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) l8 c8 \" w: a5 ?# d* V- band then browse the DDB list until it find the VxD and its DDB_Control_Proc
V7 G6 w/ h; t9 N: E. bfield.$ M( ]( Q6 k z* P9 p3 ?
In fact, its purpose is not to load/unload VxDs but only to send a + r9 z, L" i9 N( H% }* t! R
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" ~5 C( [7 m W4 O4 @$ x
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; Y- e) k" `; i& Oto load/unload a non-dynamically loadable driver such as SoftICE ;-).; O& D1 O k. P. b) _' G! ~% A) N
If the VxD is loaded, it will always clear eax and the Carry flag to allow
7 X2 J J) E# y, D6 V0 Tits handle to be opened and then, will be detected.
$ ~, Y4 j" ?, dYou can check that simply by hooking Winice.exe control proc entry point
& O. b9 u5 m! N, Y! awhile running MeltICE.4 ?+ j7 f) g$ O" ?2 o: v- |
/ g! \$ t |) ^9 `
) ^1 a; T$ W) {7 k+ R 00401067: push 00402025 ; \\.\SICE0 Z0 q: {# N" R. t# J% ~2 _+ v
0040106C: call CreateFileA! w* _) U, L' E; H3 z7 ^, V" D
00401071: cmp eax,-001
5 p+ l* ~, x5 }8 N3 S& i: u- U 00401074: je 00401091
" X( _& n7 D5 z, A3 ]( m; ~
7 m* X& P @3 Y8 t; g6 V. a, R- x3 x5 d* g$ X
There could be hundreds of BPX you could use to detect this trick.
7 X& }- w+ F: e0 X5 |1 ?-The most classical one is: T' L% `6 M" C
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 s1 P w, U4 x: c! y+ s" d *(esp->4+4)=='NTIC'
2 y9 ?. x+ j- }) X5 \$ a
! ?% \% q9 [ V) X* L3 ?-The most exotic ones (could be very slooooow :-(7 B `; N% | y0 R% B7 P/ ~
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') % V. \& r ]! R9 W, F, ?
;will break 3 times :-(
1 t+ J/ _3 z/ F
0 V: r- u9 F5 k( J- g# b$ I/ `, _-or (a bit) faster: B# l/ u8 T" r3 b& a7 `: N
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 a% o: E5 F3 V6 I) e1 E# B2 K+ K4 B5 n3 c$ I M9 e$ @
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ! Q9 K2 i) `* J
;will break 3 times :-(6 N# Z; ]- V. q& W0 Y
3 _( F8 Y: F+ P( F
-Much faster:& u- ~, k; m$ b4 l. \: F4 g- R7 O
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! \( w$ z! e/ q9 R5 \# G
! ]* s% J$ J# MNote also that some programs (like AZPR3.00) use de old 16-bit _lopen$ q& u3 i. _* y3 k
function to do the same job:
! F( S9 _. O2 @2 h1 Y6 ~5 W! A/ m$ Z+ y# u# U3 `
push 00 ; OF_READ
V; Z2 `. U4 ]4 l1 \ mov eax,[00656634] ; '\\.\SICE',0( b% X: n9 I: C8 s, } p
push eax' V W* F+ W- ?0 Q& }
call KERNEL32!_lopen
" E5 \% y$ N% {+ z" l5 m inc eax. `+ T5 a/ K6 Y1 b8 Q& C* v
jnz 00650589 ; detected q5 u! S* M3 m' c* R$ P1 q+ {7 e/ O
push 00 ; OF_READ
8 c( T6 m8 R; h# D5 A mov eax,[00656638] ; '\\.\SICE' v4 P! [8 b, x2 r& F
push eax4 V/ l( l! Z H2 s# P) B8 T0 E
call KERNEL32!_lopen3 a1 ^# ~. R& f N& l: L
inc eax1 p% |; j' f& T' P
jz 006505ae ; not detected5 `" H$ d8 z, h, q" ^, F; \
5 r3 o5 n& W- ^5 j m S/ N$ w
& M0 ^. y/ t: J0 X2 I! Q! K__________________________________________________________________________! M+ Z2 H# ~ `: G/ B
; f3 ]3 u+ r2 T5 k% a* Z- K
Method 12
- ]1 `- R) D. D9 a=========
( }! T- `# S# c. B) f' B/ n$ x, f- f! X" P# y" w
This trick is similar to int41h/4fh Debugger installation check (code 05' d8 c4 y# b# s
& 06) but very limited because it's only available for Win95/98 (not NT)
7 g% M; ]/ ^: H2 m) G6 h# _$ ?as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 M/ ^0 b. ^; M L. Q! j! {+ a4 A* R, h( x" z. D+ g. u
push 0000004fh ; function 4fh
6 Z+ M( Q2 Z1 S" N push 002a002ah ; high word specifies which VxD (VWIN32)
X+ M h7 p( B9 J; l4 v" m$ t ; low word specifies which service/ b' R# z( X9 G" Y/ O. L
(VWIN32_Int41Dispatch)
3 @* r+ e7 N9 y+ k- I7 Z9 P call Kernel32!ORD_001 ; VxdCall
- I8 u- u L" b# U V% u cmp ax, 0f386h ; magic number returned by system debuggers" w9 a* r; C! q7 j% e' S! r
jz SoftICE_detected
/ Y% v% H4 q, y: O/ H, {( J# N
Here again, several ways to detect it:: _* f3 M1 P2 k1 f" {
# ^3 [. r* [/ C4 k3 X. _ BPINT 41 if ax==4f/ V' G9 h' F* |
: y6 F! F, t! l& Q# O BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ J" L' W3 o- u5 q
: X$ m- S( e4 |; I: U m( ? BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 n8 t8 ?9 I& O) i# l
0 X; o/ b! h; O+ b) ]; y4 N, G: }8 _
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
( `* ?0 K7 ]7 ~9 v2 N2 U
; f) k; A* ^- n& Z& L4 t__________________________________________________________________________
1 p' s" ~* T6 |1 Z3 W; s W( I4 C! P3 v
Method 13' W6 e2 U. h# o1 X; I$ f# E$ R
=========
! N- j% Y! |; y. E3 ^( g( Z
) w: V, A' B4 L7 nNot a real method of detection, but a good way to know if SoftICE is
4 P# A F; [" z/ Oinstalled on a computer and to locate its installation directory.
$ K" f# y: O' Z& F7 s+ x3 lIt is used by few softs which access the following registry keys (usually #2) :7 i# l. ^! ^' f- ?3 _1 u0 [
9 ]( N- ], k# e, X. R3 ~7 O, E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% `# @( n; u) n\Uninstall\SoftICE
3 v; \# b. }3 f& V ~, @% c" f-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 I4 {0 Y, O& G: F3 P5 H; m
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, F) _# F6 o8 t( _3 N
\App Paths\Loader32.Exe
6 t# |7 ~1 F# _3 L, y
4 f8 J! |( W8 w& _: Z
, P0 A4 a% k, ?- G! I, ~% @7 @Note that some nasty apps could then erase all files from SoftICE directory
) {# @7 f8 u5 s/ T(I faced that once :-(
( Y, v& | v8 Z5 ?0 G- i9 A
9 ] c' P/ r& _5 j0 ]$ B" sUseful breakpoint to detect it:3 M# b& I n$ B8 r+ G# ]
( m% Z# ^/ B& |/ R3 }, E+ N
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 o5 I* R! X4 Z2 y
4 v/ B1 w4 p4 ]' f$ T2 A" a9 W
__________________________________________________________________________
5 k% {4 c$ o/ Z5 \$ Z3 Y) e, g* M' P2 H% l3 g! V1 f4 @; u6 y
3 X. w1 z& {5 q7 k
Method 14 : F0 x! W6 r Q) H1 W
=========
) ]" y0 {; s; v
8 e* t2 \. a }6 o1 YA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 e2 G V( v g) N+ x
is to determines whether a debugger is running on your system (ring0 only).
5 ? j; q3 B; W, Y' X1 y% z/ g7 r2 z. v0 E+ B
VMMCall Test_Debug_Installed
8 Z; ^) m$ d) t) J& C5 q5 p je not_installed* z$ D4 D+ v. _* X x
/ _/ s; Q$ Y- [/ w4 VThis service just checks a flag.3 E: |8 ~4 L& q, _) i
</PRE></TD></TR></TBODY></TABLE> |