<TABLE width=500>! j2 ?7 L4 a" f; f. Y% b
<TBODY>
. k8 s$ M: H4 P4 o; J' {0 A3 d* K: s<TR>+ ]; h9 x2 r( p7 F3 y: x% \: Y8 m
<TD><PRE>Method 01
3 a* I: J, q. |! {9 S=========
1 M3 \7 J2 F/ w: P
* A/ S# V2 p3 Y8 L1 H, M* sThis method of detection of SoftICE (as well as the following one) is
; x5 p9 @: G7 q9 O! f: c: Jused by the majority of packers/encryptors found on Internet.1 B1 d2 L6 j3 r
It seeks the signature of BoundsChecker in SoftICE
' \7 T' y; l9 U0 z- o: I. O# ?3 u% q8 X9 G9 C
mov ebp, 04243484Bh ; 'BCHK'9 y0 M3 N, e8 |4 M( ~. `
mov ax, 04h
, F! w8 B" L1 T, i# Q int 3 , y# L$ Q+ v9 o; O. K9 ?9 p/ Z3 s
cmp al,4
6 Q: c7 s( Q6 \! B) ] jnz SoftICE_Detected
5 j, n# `. U# j k1 K% F& P* l6 K8 [- }6 \
___________________________________________________________________________: \$ }' ^! M1 H; C6 z" V6 W
1 b- v' {) y. C M g- ?0 TMethod 02
0 p" Z3 P4 S! y* L2 r6 h% b$ i=========
- B8 ] n2 @" k$ T1 n3 O l3 S; B* ^' j# g
Still a method very much used (perhaps the most frequent one). It is used
8 Q% i0 U& K! {( S* z5 Hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,! ]% f' }+ ?* }; B
or execute SoftICE commands.... g! F6 t/ p2 X5 d& X o
It is also used to crash SoftICE and to force it to execute any commands
/ P7 J' ?: v# e. E(HBOOT...) :-(( . z" i5 Y! ^* s5 L
# r; B: t' k; L) hHere is a quick description:5 G( j, j- E( n4 m1 o
-AX = 0910h (Display string in SIce windows)
( \5 H: {3 f+ W z-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# r& k; q0 Y; J S: @
-AX = 0912h (Get breakpoint infos)+ i4 J, w! o( L( ^/ |% d
-AX = 0913h (Set Sice breakpoints)2 |' j$ t, X* q* N
-AX = 0914h (Remove SIce breakoints)
' P8 J3 Q9 h: O. |1 r# _3 @# J9 t$ q
Each time you'll meet this trick, you'll see:& O' M$ B; P/ u. s+ z
-SI = 4647h
$ A; j) _4 z2 X! k# p9 Y& X-DI = 4A4Dh
0 M9 B' p9 v: {# I. R) BWhich are the 'magic values' used by SoftIce.
6 ]* M" t. |' B4 M( n( ]For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 |+ {* _& }' |* O! O. e- O ^! C9 p- \
Here is one example from the file "Haspinst.exe" which is the dongle HASP w9 A( V8 N) F% X; ^7 v3 Q. | d
Envelope utility use to protect DOS applications:" s. z3 `) t( `4 y' P
+ ^! e$ t( F/ T% T- |( N9 w
; p& `3 x5 e7 y4C19:0095 MOV AX,0911 ; execute command.
& H# `; P" E+ b/ t5 g4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).. s: m3 T. _. G' \/ j
4C19:009A MOV SI,4647 ; 1st magic value.& _4 L' H( m) i1 N$ g
4C19:009D MOV DI,4A4D ; 2nd magic value.
. f6 q! r1 a! d% G! w4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& g& L5 R# L2 c$ \6 c
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- {% D( u3 n: k9 z$ b( ]* u4C19:00A4 INC CX$ X! }' J9 w3 S ]" a* ?
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
& T4 C9 S3 Y7 m& M2 {, V9 d4C19:00A8 JB 0095 ; 6 different commands.4 T0 B b+ H' f$ |% {* S
4C19:00AA JMP 0002 ; Bad_Guy jmp back.& B6 h( @% q5 g0 H b
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
) |7 |5 \0 ~: L4 e' {: s' e- o8 ]
' g5 A, E y$ MThe program will execute 6 different SIce commands located at ds:dx, which' s* M) A0 P- Z$ R2 l7 ]! b" Z$ S/ ]
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( f9 Y# S# N$ { n
& _3 e, ?2 [7 I+ Z0 N. I* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: V q& Q2 v0 J) H: t- a0 J4 n2 J/ O___________________________________________________________________________
0 c3 u7 i; G4 t
8 b) F; v) H Z& _
$ H0 j1 J5 k* S5 g. xMethod 03
+ H( [* i, u$ z=========6 Q# Q1 Q* U( g3 k m' G" |
% U: S! L+ k8 F F6 v/ x% pLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! s8 Y( B% [- R6 i$ b% I2 L(API Get entry point)
7 r; w2 X0 v* g" V
( ^" C9 g- C0 V: Z% y& e* [8 B$ H! s3 J7 U/ | V! K5 _
xor di,di% ]% @4 d* O, R# ]" T9 W2 O
mov es,di$ R3 u' c6 m) N) M; q' Q/ g
mov ax, 1684h
" A$ y$ z/ { ~8 g1 A. E( g mov bx, 0202h ; VxD ID of winice( R( ?: Q: L9 j/ Z
int 2Fh; U2 C' g. U5 x) y
mov ax, es ; ES:DI -> VxD API entry point0 P6 I2 {8 p. }* g% v* X* E
add ax, di8 K$ G% H! O; ?' G1 z3 q1 O2 `
test ax,ax; f) f4 O) w7 {# v' G
jnz SoftICE_Detected' X/ Y# c$ y5 H# t# `
2 Z+ _' b- h( P' R$ W: `; ~
___________________________________________________________________________
; k+ u% f4 i k) M
9 C* c E: b4 g+ }; nMethod 04
# J7 K& \7 g6 P. p4 W=========
( o+ @) y1 H( J4 X$ b# O9 i* x7 P7 b1 k# {. {' |. {
Method identical to the preceding one except that it seeks the ID of SoftICE
J' B, M; { qGFX VxD.
# W8 X7 X/ U. a4 s. p/ `& @( [! e `3 Z" N6 Z3 @
xor di,di
1 ^/ U I6 x) |* {/ l. M, ? mov es,di
3 B9 k0 I- Y2 L; L1 M5 _, z mov ax, 1684h ! w; x+ @+ H& s& R( T+ W: k l
mov bx, 7a5Fh ; VxD ID of SIWVID4 V6 ~; W) U; v. f8 P
int 2fh4 `* u- T T+ b
mov ax, es ; ES:DI -> VxD API entry point9 N# d! P* u% g
add ax, di# E- F s( c- |% i( r
test ax,ax
+ h/ g9 m/ a6 w6 B1 U E; u* R jnz SoftICE_Detected$ ^/ n( |9 N0 n( |0 X
" R; z! s! |1 v6 P1 l6 U, Y__________________________________________________________________________
9 a0 H% T" M* ^# X" ?! p+ P" k, a8 n" N$ I! n* ]" x1 |
( S5 ], x+ L. A' D9 H7 }% ^1 y8 U
Method 05
, s# C8 t# V0 b# E& u=========
2 }* g) I5 N$ E4 `: S2 E# d9 f7 i- S; p+ H# W) H6 W
Method seeking the 'magic number' 0F386h returned (in ax) by all system
5 O- F- N; C, Xdebugger. It calls the int 41h, function 4Fh.
4 h, O2 T( g; P# ~; sThere are several alternatives. 8 N( j8 r; G( _- m6 T) W
, g$ Y; }8 v: |The following one is the simplest:! R; y2 A7 o! }
. ~0 n8 J' |, D' @; |5 X mov ax,4fh
, {, ?1 w. r5 S% z. f, v int 41h7 Z1 U- F( D8 J) x
cmp ax, 0F386: a9 ?. m8 d) t( f; S6 @
jz SoftICE_detected6 V: V8 n( |& r: [& @0 D$ A- h
, |8 }, ^2 y0 i0 i' P% h
" e6 \! U; E4 T- A$ ?0 wNext method as well as the following one are 2 examples from Stone's ; c$ r6 U' G, A5 r/ _1 y
"stn-wid.zip" (www.cracking.net):
& k- A6 y3 K2 R! a7 n' r' U3 x
; O' g; k! N6 N3 [* G Y mov bx, cs
# N% b$ C( k& ^) c lea dx, int41handler2
$ A( p$ Z# k8 K% P# h3 f; n% x xchg dx, es:[41h*4]' l( X: F7 z3 ~$ o
xchg bx, es:[41h*4+2]* U" I& l* V# W$ B
mov ax,4fh
6 r8 @* V( v: p" S) t, j0 i int 41h
' b1 E( \5 h4 C: c; M, H* o xchg dx, es:[41h*4]
6 a3 Q2 i$ {& S xchg bx, es:[41h*4+2]+ J( F9 x& Q7 Q; T: {5 X
cmp ax, 0f386h/ o. d3 {: o: O/ P5 E
jz SoftICE_detected
+ g9 [: \( ^, v0 p3 P
) S0 k8 F/ Y. g/ fint41handler2 PROC
8 Y$ e" i5 u" |/ v: m) } iret3 W* k" [1 L( |" f( N- e! _. r
int41handler2 ENDP ?$ V# }+ C- U. ^
" x% M& Y$ b$ p( J4 y" I" q% _! Q
_________________________________________________________________________
* b+ @7 Z/ g" N3 W% w( T# V- F4 z3 ]/ g0 E$ u
# ^1 h/ k! O; M$ i XMethod 06
; ?8 V, ?- P* ^7 v% a=========
! E5 s& g" f# H4 c; m' t5 {
% Z6 f. {$ t; ?! Z6 I- W6 c u% Y7 [7 ^& g2 y/ G
2nd method similar to the preceding one but more difficult to detect:
/ k0 B: w' \ |3 {, L1 c
( f. ~- A( V ?/ `- j3 | |) `: K6 N$ c
int41handler PROC
, z* e# c0 D8 _& a3 N mov cl,al
& \2 n, e# U0 |) H& O9 e6 _ iret7 o% l4 t2 l0 _6 Q, Z" r
int41handler ENDP
0 x8 B7 o0 W; t4 T4 g& K& _! n. _9 i" p, q+ S
0 h8 U1 ~. H2 E9 V xor ax,ax
2 U1 \! }/ Y! g% Y b' m; P mov es,ax
& L7 G* m) o* d% U( v7 K6 v6 S mov bx, cs
+ I8 D( @/ A. L lea dx, int41handler$ g" _; Z* T1 j" b6 X
xchg dx, es:[41h*4]6 e: w$ q- k+ l$ o) `
xchg bx, es:[41h*4+2]
3 M. k; b2 m3 O" E, z in al, 40h
( o( T/ `: N7 h( r1 q" K0 w' i' M xor cx,cx+ W# l+ |" _( |0 o! r2 d; V- d
int 41h
# n- t! e+ h9 {2 D xchg dx, es:[41h*4]
8 v% ^% ]8 d) |0 O. E! F2 Y$ A xchg bx, es:[41h*4+2]
1 L4 q; ?1 c7 X; w; N- D- m cmp cl,al8 q/ f: K4 P5 D7 v ]; n8 G4 y+ L/ E
jnz SoftICE_detected& @* U: c/ J% P
+ |' c4 U" Z' f) r0 q" Z: m8 a! \
_________________________________________________________________________7 H K# m& y) \! z
* ~# ^* G2 J4 d) }% v) L
Method 07
3 s3 t; V- j6 {" [# l2 b=========
1 Q* O- w9 x) V4 s6 D- [
& K9 v* }; i4 A7 ~& p2 DMethod of detection of the WinICE handler in the int68h (V86)2 p6 B( p$ f7 A
( e( ]: w$ k5 W8 L9 Q
mov ah,43h i g3 v2 I+ o& w* O" }% G
int 68h! T9 f) K1 w% N) p# u5 S6 c% V4 `
cmp ax,0F386h
+ N: K z4 }* P+ B jz SoftICE_Detected6 |+ o9 b- a& P
( r( D1 u! G* j. D: ~# [
+ U* l! {: ^4 P1 d* I- E5 d=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% l& U( g4 y. O0 Q3 @) _; H( } app like this:
( e( k5 Y; H, M: t5 ^: {2 p* Z2 x% s. K3 J4 g
BPX exec_int if ax==689 V* \: X0 f X# s, T2 O) P( w
(function called is located at byte ptr [ebp+1Dh] and client eip is! c% f. b" Q4 V) l6 P) l, I" o* I
located at [ebp+48h] for 32Bit apps)
; E' R- O5 y+ @# `. E__________________________________________________________________________
- K7 h0 p4 z. N' i9 @9 V' Q* ?, r* I6 X$ \4 J2 t
4 z! y5 u$ ^& J" L [2 W/ {Method 08$ f9 R0 \. e+ S, ]# N; n- ]
=========
/ v, t$ x" h W w w4 N7 u. q' T2 l3 x0 Z% D7 Z/ A
It is not a method of detection of SoftICE but a possibility to crash the
! o# Z! _) l! [, F3 S% asystem by intercepting int 01h and int 03h and redirecting them to another
& Q+ C& L. b$ B! Q" k8 R' r' T/ Lroutine.
6 L+ c; k" p. M& j! ]It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 F- v9 B7 f3 @- x Qto the new routine to execute (hangs computer...)- e7 T: |1 A9 i2 o6 ~
: H4 ~- k5 I& g6 P3 A: l9 G mov ah, 25h
8 n6 s1 |- x# x& D mov al, Int_Number (01h or 03h)% y4 B) A" o5 H+ R$ r: C% U
mov dx, offset New_Int_Routine \/ \- w& G1 `6 E- w, @4 S
int 21h( t6 t( _9 _* e: r% R$ G
$ O7 W+ _7 ~+ w5 T1 l% b
__________________________________________________________________________
7 [' z4 i0 m+ a! u: i" @
, F4 O$ `/ z) @5 L) S# T3 }+ [Method 09! y6 Z/ c' G9 V7 a i/ k7 g
=========! G7 H% V4 c' l' O5 s7 T
$ i" i. T7 V& [6 {
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ U) p) a9 C4 e: ~! l: O/ m
performed in ring0 (VxD or a ring3 app using the VxdCall).
( @; o9 T5 j" k9 X; F1 CThe Get_DDB service is used to determine whether or not a VxD is installed
R3 a. {, B' Cfor the specified device and returns a Device Description Block (in ecx) for1 y% b9 B% b/ F! _' M+ N2 ?
that device if it is installed.# \& W9 i% L- T6 M( k/ H9 c
$ V4 D( L N' ^, F( x. J
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, G7 T3 a+ F2 z2 K
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) Z$ g+ d$ w* v& b& U- o& h1 N2 T0 b* I VMMCall Get_DDB% T1 [1 f; P5 g& H
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
: O& h2 b, \1 V8 c, ? m
& K1 f4 T+ `" O8 |Note as well that you can easily detect this method with SoftICE:
. H j1 o+ ^1 | bpx Get_DDB if ax==0202 || ax==7a5fh
7 c- }- ^" D: T7 ^8 e
1 c6 ^& c( n1 O% H; G. `* p; s9 G/ u__________________________________________________________________________
" C7 \$ x2 V$ h$ e
8 O8 j: N9 l$ \+ S$ L6 S# |Method 10
0 P/ f6 Z U. X1 x2 j9 o9 \=========
6 N7 X4 ?% c6 \& a: Q/ ?# D
0 p' n2 ?1 {8 A& @1 W=>Disable or clear breakpoints before using this feature. DO NOT trace with
& Q8 r7 M D# \! f# ~ SoftICE while the option is enable!!1 X' e! w4 `! m4 f. z* l. ^
% G7 B& v6 [. Y# Z) i
This trick is very efficient:
- c) N5 a: ^3 B( w( ^by checking the Debug Registers, you can detect if SoftICE is loaded% L; q) P V! y7 I. R% o2 B: d
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 U" f; S$ J2 b2 D$ ?4 Z& K% u- _, s
there are some memory breakpoints set (dr0 to dr3) simply by reading their) X& G; t5 }% W# S3 c. q
value (in ring0 only). Values can be manipulated and or changed as well
: R2 @& y9 n0 U% }(clearing BPMs for instance)6 R5 I, Y# ]6 m! }0 U; j
4 q3 }6 w. a. h& F/ g0 A* v1 k8 F__________________________________________________________________________2 `9 S! r& @8 m6 l2 E
' Z& i1 t6 n& _Method 110 p. R8 N) _9 j
=========
; y, ]& u4 B6 ~# q0 Y. I9 }) \/ L! U' l' b, @
This method is most known as 'MeltICE' because it has been freely distributed3 T/ b. H, I2 @9 o9 U
via www.winfiles.com. However it was first used by NuMega people to allow
9 q+ f0 \) e4 A o; }Symbol Loader to check if SoftICE was active or not (the code is located4 \1 u; j1 N* j0 J5 H, |
inside nmtrans.dll).
3 t2 w2 b( } g$ f! c+ g+ r
' m! `6 a* O% h9 WThe way it works is very simple:# l3 y9 K. v& Z0 F. i
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& C5 R9 d8 v% _# r V9 o
WinNT) with the CreateFileA API.
; _4 B6 _& z: C8 l9 \) r0 B
1 |/ N9 Q: x6 @" `# KHere is a sample (checking for 'SICE'):- V2 W" S2 `" @4 j# D: o4 j% k
5 j7 h/ f7 g! V0 p1 A
BOOL IsSoftIce95Loaded()
+ |/ @. l7 c( e A7 A% y8 c- R/ @{& n/ [* U4 P( \) |0 B2 q$ _% m
HANDLE hFile;
- Q, {( X. V. I! |5 B( w% F hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ R/ J! H) a" i( x6 F
FILE_SHARE_READ | FILE_SHARE_WRITE,
$ e1 d# l3 x2 p) C; b( c& O" p NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 N/ u" n' D0 q) d' f
if( hFile != INVALID_HANDLE_VALUE )
2 e1 U# A3 y. x; n {
9 l( A3 [: U1 W6 d9 F- q CloseHandle(hFile);3 A$ E& V* X ?& B
return TRUE;
- F6 h* W9 B8 f }
4 ?, c- ~( E" A+ x3 D: l R2 X1 @ return FALSE;% n& G& a, n2 o, A
}6 G- L, j; ]) S' d$ V
& _4 E H& P( [7 L" ]" U4 |; @- `
Although this trick calls the CreateFileA function, don't even expect to be8 V5 I" s% Q0 P5 i: z0 Z- s
able to intercept it by installing a IFS hook: it will not work, no way!
3 l% l8 F4 f5 O+ T! m/ MIn fact, after the call to CreateFileA it will get through VWIN32 0x001F% e' k; i" p6 A
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function), w# H4 E, S7 C* |4 n
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ |1 u. T& C& b) p8 ?! B7 \
field.) }& z& Z6 J& V9 x! }
In fact, its purpose is not to load/unload VxDs but only to send a % X) _7 l2 U" U" }
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: s) w# Y8 A/ ]6 nto the VxD Control_Dispatch proc (how the hell a shareware soft could try: ?2 p2 D& r' k% u' |& ]0 `
to load/unload a non-dynamically loadable driver such as SoftICE ;-).. S; ~0 U$ t* x) }
If the VxD is loaded, it will always clear eax and the Carry flag to allow
* @, Z% w& Q) W3 p) x( s6 xits handle to be opened and then, will be detected.* D6 \* T) W9 r+ |" w; S! }& Q
You can check that simply by hooking Winice.exe control proc entry point# I, t4 [0 L& H6 c3 t8 k) _' @
while running MeltICE.
1 @. D1 T% m: o9 g$ J5 T
% e( B; p/ n- U7 ]' w: f4 L+ Y& N
. e' f" @/ y5 C F( K8 c* g. x( [% d 00401067: push 00402025 ; \\.\SICE1 C! m* l A+ }+ @7 o( k/ \
0040106C: call CreateFileA( ]$ n: {3 b2 E* z7 y( H! U. S
00401071: cmp eax,-001, r* W. S6 C3 j, h: V% a( H
00401074: je 00401091/ K( c; {1 m, v/ A& P2 R6 P
7 r. l8 C c/ j2 z. a5 _" |& M G( J
There could be hundreds of BPX you could use to detect this trick.
W3 X) u" {$ ~-The most classical one is:5 i b* O1 p% Q
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
' \- g! L J6 e" g: _7 ` *(esp->4+4)=='NTIC'* N1 {" j. X |+ G& {* z0 N
# S/ D4 J/ Q$ v: h8 L4 J, \; V% r
-The most exotic ones (could be very slooooow :-($ Y6 f; c+ m" ]
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( U! j6 x! o+ K+ X) k& j) @ ;will break 3 times :-(: L6 _' q7 z; B# j8 d3 R
8 r S& P, c! j! I-or (a bit) faster:
- `$ u7 G9 ?; G- `. s" E BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 W- x+ a% T% ^$ X
# S3 v/ U( ?, ]; x3 G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' * p+ a% U; X* v
;will break 3 times :-(
5 Y, s' ^; d; o& z; |1 h* j6 F
- P% _5 q. M; b' k5 T6 \- ^0 Y-Much faster:
# }/ K4 j8 b0 Y4 O BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# l. n7 f2 y: X4 q5 }+ y- Q+ w7 N' _$ H
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen1 ~ ?3 L& h9 x
function to do the same job:
. L4 L6 w' e( x6 K
5 B0 ^( W6 X: e push 00 ; OF_READ0 x0 |* j, }) `+ a
mov eax,[00656634] ; '\\.\SICE',0
6 H1 w* P, c" h push eax3 c5 l9 b% J# Y; Y) Q) Y- a
call KERNEL32!_lopen
1 D; E" S/ I9 s inc eax) [, {0 ^' N8 } N; P, }. P
jnz 00650589 ; detected
; f& q- O5 Y8 E) A2 ^ push 00 ; OF_READ- v3 N4 Z4 Z0 K6 v) Y t2 b
mov eax,[00656638] ; '\\.\SICE'$ M6 b5 {" m0 R0 @. Y- i
push eax
9 n: I d$ m! y' M5 N! C call KERNEL32!_lopen/ K- P% @( T0 i( L+ @( v
inc eax6 k. {: `( q4 F( [ O( n. [
jz 006505ae ; not detected t: N: w0 @. ?. t7 T
; ]- ?9 t- S1 A, |$ ~$ `3 y( k
* p1 W8 }0 B% s& h6 f/ U
__________________________________________________________________________
5 C: W! U: w ], ~& z% v' K; W! R, u6 g- }0 f, ]) P: }* v
Method 12
+ P! d' W* E# {3 w N=========# b$ N* |# Y7 G5 C, f
7 M0 U' x- M0 r- z: {1 D8 {
This trick is similar to int41h/4fh Debugger installation check (code 05
6 t0 g+ ?; D# d: A2 B% B& 06) but very limited because it's only available for Win95/98 (not NT)
7 j& ^9 U( |7 T% Qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 ~2 O4 R, q5 n, B
' c E+ A# r6 D v7 {8 ^ push 0000004fh ; function 4fh" N- F9 ^; ^8 e$ Z# X7 L2 u
push 002a002ah ; high word specifies which VxD (VWIN32)) g& N9 b# v3 X/ Z. Z! M5 l9 Z
; low word specifies which service- w( Z$ X# y5 m8 Z7 p) L1 f& }
(VWIN32_Int41Dispatch)4 _- S3 @4 y! t
call Kernel32!ORD_001 ; VxdCall
* w: P2 L# f3 U/ m# O cmp ax, 0f386h ; magic number returned by system debuggers
) M2 t4 }4 n, s! } jz SoftICE_detected
6 |* M5 j# `5 b( o8 h1 o# Y y8 T b& L7 }
Here again, several ways to detect it:
6 C1 }4 k- S r* j2 L8 z [, r, ~# c+ o: j
BPINT 41 if ax==4f3 u1 N% Y7 W( m8 u3 n) }
: @/ f) ^1 B/ k) {! h y c9 U- ~
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one+ z; `, G' g6 m. S" M3 k) q: f7 Q
# j. B9 C1 j5 F0 T7 H& M% J* N
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: U% T( i K$ u R3 n0 l3 Q
, f6 A/ \% e- L7 a) U BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!; n( s; q$ E9 n% c9 x' I5 G: T
1 S5 d1 k, S! @
__________________________________________________________________________+ c/ @! ]) W/ |8 u) N8 ~
% l6 \/ U1 Q6 g6 c, u
Method 13
3 I0 E4 p7 F2 E4 S+ p7 g) l=========+ f! v% a5 g9 o! q
0 O5 F* S2 _ M6 V0 _4 VNot a real method of detection, but a good way to know if SoftICE is
" j' a2 w- v; u; M0 L4 tinstalled on a computer and to locate its installation directory.
% z8 Y) ?3 M$ KIt is used by few softs which access the following registry keys (usually #2) :) ^* P' j+ A+ p1 p* c1 Q, E
4 E) j, E) T8 v7 h4 f2 u' X* F-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 ^ {8 ?1 T% D" }9 p4 N\Uninstall\SoftICE
6 T, G' K0 D- t* e! {; B-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" U+ y; {/ z/ Y5 g
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- b9 u7 H1 k, V% z* e\App Paths\Loader32.Exe- s/ k+ E; f; x0 h/ J
0 q, O0 x J2 R' t# V
/ b" D5 l0 Z; K, uNote that some nasty apps could then erase all files from SoftICE directory
# }8 r$ \2 j* B& T$ p. h, [(I faced that once :-(
! i" K. E7 @+ e0 w& a' R; k: G6 t; J% M
Useful breakpoint to detect it:4 l* g6 L4 k- o$ N6 p+ N
% i( Y3 l$ ^/ D" S% S; C BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
$ s, c9 n: I, \" A: X) \3 S: N
2 u. L9 @4 i# r: o2 `__________________________________________________________________________
/ X5 }- I) r' r, \( l- S
$ U4 I6 I$ A" r9 k9 f" l* ]0 N- C! u3 _' i. z. {0 [
Method 14 + w. ?8 [: L; V) _9 p v" o# _( ^8 B
=========+ u- k. G$ I- [/ [" M
! w. T' {& P0 M& f! @& {
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose n5 u% R1 L( c6 c3 h
is to determines whether a debugger is running on your system (ring0 only).( N2 i/ D# w4 q- o3 e! U% G0 M
% {% m/ s/ v5 f8 P, t' Z6 ~5 N6 ^9 [
VMMCall Test_Debug_Installed/ H( z& u3 K' u d* M4 U- Q
je not_installed
& N) f4 c5 v9 ~' B+ \: X5 B! |9 X& w, u" L# g7 |
This service just checks a flag.
2 ?7 G9 E: S5 K5 _0 O J</PRE></TD></TR></TBODY></TABLE> |