<TABLE width=500>1 W4 E; l6 Q6 k: s9 [/ }3 A6 k
<TBODY>
! m0 c& s3 z: l. ?0 E<TR>
. V! m0 D$ |8 ?5 s<TD><PRE>Method 01
+ z a) f# E5 W=========
9 p( k2 Q( J' J! w) o) N f
4 m/ r1 J, c2 ]/ L8 |3 ?& P4 l6 VThis method of detection of SoftICE (as well as the following one) is* q( P7 s7 c/ B7 O; ?8 Q; n P
used by the majority of packers/encryptors found on Internet.
+ L2 l! Y, R# t( PIt seeks the signature of BoundsChecker in SoftICE! w0 F* q8 ~1 C" J6 p- ]
; p/ T; S9 j- a7 i: U1 L& `# `9 ~" p mov ebp, 04243484Bh ; 'BCHK'4 b) t9 P! l- w3 d( h
mov ax, 04h: z3 F$ j( k) J& F# P+ T' P
int 3 + u g9 R. P u; B
cmp al,4" g8 L6 f" P5 k& c' A W7 C
jnz SoftICE_Detected
3 Z$ ~6 d; x U2 x% Z8 E# x1 h6 N. ^' z' ~
___________________________________________________________________________+ A9 K' h, K+ i, b9 m3 B3 ~
4 r8 e8 L$ P' R/ z: C1 a- G7 WMethod 02. ~' |7 _/ f6 r1 Y6 O2 ]9 H4 X
=========, L! Y9 z3 l& Q$ w$ K6 K% z
) N& x6 I- o* R+ L6 V
Still a method very much used (perhaps the most frequent one). It is used i$ f+ Y: s2 P) w! o# `5 U
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- _, c" {; c% Y' {* w/ Q
or execute SoftICE commands...
" C* c( J: @1 sIt is also used to crash SoftICE and to force it to execute any commands
7 E9 a% x+ F! m M4 ](HBOOT...) :-(( G+ W* z# p+ V' c3 A8 I" o, a
; {9 d) I4 z& ? N" j
Here is a quick description:& Z' A0 T$ I7 V7 u, P, ^4 ^: Q/ O( k
-AX = 0910h (Display string in SIce windows)9 o5 Y0 b3 Y1 q0 a0 J9 o: A2 d
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
. W% M. R( T, i s-AX = 0912h (Get breakpoint infos)( ]' N& F" Y: O5 G
-AX = 0913h (Set Sice breakpoints)
; D$ |5 P, O3 ]# [! B-AX = 0914h (Remove SIce breakoints)
8 w* ~1 C" c. v6 U; g* Q g% G$ y" n$ `$ G$ C! Z
Each time you'll meet this trick, you'll see:
' V; D* k1 B( P2 r-SI = 4647h4 B/ z1 V) L2 N
-DI = 4A4Dh
: F+ |" M4 C; O! V' ^% ]Which are the 'magic values' used by SoftIce.3 Y! Z' I. `6 Y9 d0 F
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 [& t! s' C1 _7 g2 _2 ^
1 C# p# w/ g# B" j' aHere is one example from the file "Haspinst.exe" which is the dongle HASP7 r% E. ^( E9 e H/ K
Envelope utility use to protect DOS applications:
* h5 a0 X" p. O2 U y$ x
r5 m3 I" N* N! F7 \ p/ f
8 k, Q- ~. E) Z4C19:0095 MOV AX,0911 ; execute command.. Y. d* B5 u" x
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 D) F8 ?) N X0 R' L3 T4C19:009A MOV SI,4647 ; 1st magic value.8 m. b, b2 K+ J0 ^. U; L! h1 O9 A
4C19:009D MOV DI,4A4D ; 2nd magic value.7 U" q) v+ m* x% e/ C
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& b$ R( A& ~ F* a$ E
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
! \7 R; o* q9 c7 J# n7 r4C19:00A4 INC CX
; m# H) I# W8 y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute9 Q5 k9 d: F, o9 l
4C19:00A8 JB 0095 ; 6 different commands.- Z ~0 V1 m# Y6 o$ g
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
2 U& ], |0 z4 v! t4 q6 Q4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; J+ R/ {6 S* C4 q
; Q8 `# t( y5 S& J& YThe program will execute 6 different SIce commands located at ds:dx, which
/ S2 _/ ~$ C* G vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. }. X7 x) N9 ?5 H& i2 a3 S/ s: U
+ Z" H4 H+ c) x3 l* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
- n9 S2 j- y4 |+ [: [6 ]6 Q: K0 k___________________________________________________________________________5 c9 Z' e, {# T7 k
. Z! g9 n2 k, A1 i
" A' j' e( t' S" s
Method 03) r- L, _2 b( {* [4 J' ? B5 e
=========
7 w# U) H2 T! @( [" p# V; q# ~, J( }
+ |1 n) @2 B, H/ cLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, b" \# \& C$ p& u: {* v) E
(API Get entry point)0 n% f- M" X) A$ w( F
' w R7 C8 Z3 x A8 g% P5 y8 t. |' M D" e) _+ j
xor di,di
" t3 J7 t% a1 K5 Y& m8 p, j mov es,di
. X" s1 q; J% s# J+ a6 U7 n; C I mov ax, 1684h 8 i+ _6 Q+ d L1 A! p- ]# h, C7 J
mov bx, 0202h ; VxD ID of winice: |: N3 L. }' Q9 [+ P
int 2Fh
; C d8 t& O+ Y8 G7 E8 S2 p- q9 e mov ax, es ; ES:DI -> VxD API entry point
* i( ]2 L& Q$ d3 m/ n2 X add ax, di5 G' u+ y( E( D% z4 }1 y
test ax,ax r! T9 w5 x& X
jnz SoftICE_Detected
1 o& T' X, T' B& m. s3 z; G* W5 z8 w9 e) J: m) A3 H/ G
___________________________________________________________________________4 Z" s. r* u4 R3 S: O
+ i( W: m6 L$ K7 u( ] \+ M7 z
Method 04
- R3 ~9 @9 ]$ \( I=========, c- ?8 |3 w; _) ] L
4 n+ Q4 n0 P& N0 ~5 \' A" X
Method identical to the preceding one except that it seeks the ID of SoftICE
5 @5 n5 q& S. G/ ?, E) EGFX VxD.5 B5 E! _; {& Y, H1 {- l
& C+ r0 R/ i9 i( z# b+ k xor di,di
' {; s9 K& m4 j! H mov es,di
9 n- Y. y7 {( q mov ax, 1684h - N3 x* b' g1 a) u7 V% z
mov bx, 7a5Fh ; VxD ID of SIWVID7 E( p" T9 w* ~* Y% `
int 2fh
0 @8 W5 z x5 Y ~ r5 ]2 [# U mov ax, es ; ES:DI -> VxD API entry point3 B, b' w6 U3 Y4 o3 d% t/ n
add ax, di2 u5 \. O. Z% f0 z* [
test ax,ax. @1 T( y! }" Q0 {( s
jnz SoftICE_Detected; l) f. F9 w% g- V0 ?
C& @/ ]* G& A" s! t__________________________________________________________________________$ I0 K d# P* Z8 o& n L+ j! i ]
) [) p/ R9 a9 ?. v" w. ~9 l+ R( G) b5 b- e
Method 05
( n) F$ l- W) n=========+ f A( s3 Q& P* A: x' K
2 R8 c, U3 H. EMethod seeking the 'magic number' 0F386h returned (in ax) by all system
2 d9 e7 U. t5 A3 \% V2 Fdebugger. It calls the int 41h, function 4Fh.# b1 d9 b F7 U x8 A( r$ X
There are several alternatives. 1 h+ n( m- V0 p F6 t
: y' ^( l/ u7 [1 y6 x+ j7 d
The following one is the simplest:/ X4 E9 v, a4 {( t5 I3 b
# |1 C4 i5 p, g" J0 x$ G, Q/ w* S mov ax,4fh
' [3 W) T7 [ ]+ p' m- d int 41h* T' p5 Q! W8 c$ l6 \6 e
cmp ax, 0F386
' k2 J1 ]% f9 O6 u" ] jz SoftICE_detected
) ]/ ]( x2 J9 G2 Q% y2 c$ h- Q
% L0 d6 r5 r/ t) ~4 N ]* a: A }( o! K6 J# `# V8 `' [. E7 B
Next method as well as the following one are 2 examples from Stone's # [& |1 b8 f7 ^( v9 ~
"stn-wid.zip" (www.cracking.net):+ K% ]6 O9 f" x& D; i e
( x- Z+ U- L0 m: \
mov bx, cs" V7 @' s) X& @. b2 b1 l) [
lea dx, int41handler2, Y1 z# Q/ @6 F! u& L/ W
xchg dx, es:[41h*4]: R& v' {" N1 a% T U6 g
xchg bx, es:[41h*4+2]
/ w' ^) c: k1 h mov ax,4fh
4 \5 Z8 d1 z( o/ m& C int 41h8 `* C6 p" d5 J5 l
xchg dx, es:[41h*4]2 ~- W$ p4 B: U9 y' e) P5 w) O
xchg bx, es:[41h*4+2]8 O6 |& ]: R8 t( z& v3 Z
cmp ax, 0f386h3 ^8 X" J0 t G7 c7 j% [
jz SoftICE_detected
' }* d6 I9 k2 n |+ T* _) R |9 A& F6 l+ V
int41handler2 PROC4 l/ d' R8 W" y3 ^- G% ?$ |' V o
iret7 D4 B1 Q0 l. P. Q
int41handler2 ENDP& C' D" M( K4 @4 l) o3 a$ v6 n
( U/ n. B6 i9 P4 H' n5 B+ C
* [7 L. p- [" s; t_________________________________________________________________________3 V) n9 P2 H1 n$ N
/ Z! r3 ]- N5 G8 f" B" F
' U: r2 d) A+ {! }, H4 s
Method 06
6 \+ ~* x3 P, H7 o. b1 }8 T=========
* j& @, a+ p( u/ B% X
" R6 a5 S, w& [/ B# z
( p8 G2 @$ } M7 V5 y# r T$ y/ c4 E2nd method similar to the preceding one but more difficult to detect:' X- i' ^ t2 o# Q0 J; r( A
! T# F5 {$ u# p$ F5 k! i; v
- T8 D* T8 @7 D. N; T
int41handler PROC
3 `: n4 ~# {2 r/ Y( i5 m0 M mov cl,al
/ C/ T/ h$ e! o iret2 {# V2 U1 J/ I, u+ O- K
int41handler ENDP$ }0 k w$ b8 p
2 ~! K1 i1 m5 D. C% K: n+ E- M5 V
; M- ]8 v! J/ o3 W xor ax,ax# G" T; C- b$ h+ Q; c" ?6 G
mov es,ax
/ ~" j# V+ a! z* H mov bx, cs) q% I- l6 ^2 W: {( t$ ~0 J
lea dx, int41handler
: w9 E/ O% ?0 _9 G- v9 W xchg dx, es:[41h*4]
3 _- ]5 l: F3 ^, M# U' J$ s xchg bx, es:[41h*4+2]
7 s) W. ^" |( G$ B- D' x3 L in al, 40h
8 y4 Y! v$ H( w3 A. S xor cx,cx
; ]- E% x4 H' G, a6 b! f# P int 41h
/ v7 T; A8 g5 N Z xchg dx, es:[41h*4]
& g( e7 s6 _1 s4 P& i xchg bx, es:[41h*4+2]
: D4 C6 p% w! q cmp cl,al" m# O( {; o6 y2 S5 d' F, Z
jnz SoftICE_detected) @: t( ~- h/ ~7 F6 o6 d2 v6 n
. R! A; ^* P% x6 D! d_________________________________________________________________________9 j" R, S: j2 Q0 j& m- T( @
6 ?; R! Q, F" y* sMethod 07
4 A! p7 {! {3 N* C$ r0 q=========
/ n: k# M" Z9 O7 U& ~
6 h% z; |: R! a# U1 cMethod of detection of the WinICE handler in the int68h (V86)
$ l1 b; H& H$ q3 { u
+ E. k2 W% H: g. [; ~ mov ah,43h* x1 r3 S: V9 h1 U9 p
int 68h
( \' q `) P! D) m cmp ax,0F386h
& U0 r& ]; \/ R- F1 k# K jz SoftICE_Detected2 k1 x2 a0 T6 \ U+ J0 _
: ^6 A p7 c% b9 u; l# A
4 y2 z- \- A4 V; n0 e5 Y4 k
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ [4 s6 U" v) c: D app like this:
8 U! N7 J$ ?- \- ^5 w* W4 U r$ E& y) A5 S8 n4 v. z
BPX exec_int if ax==68- z& D2 J3 s: p" P
(function called is located at byte ptr [ebp+1Dh] and client eip is# D" f9 c) G3 @. R, K
located at [ebp+48h] for 32Bit apps)
% {/ [: ~* A+ e4 L3 z__________________________________________________________________________& F6 n6 @# S6 O% {: v. H' r
: t; _& m# ^3 L t! F1 z f" }
. G0 s, a$ A+ I [. n2 sMethod 08
7 k' O5 T- j/ R! a( `2 }=========
0 ]5 J, m9 x4 u- ~3 B* u0 L) S6 q' o+ P5 h, [0 `& H
It is not a method of detection of SoftICE but a possibility to crash the
/ |9 X [: q. m. s. ~# n% @+ Psystem by intercepting int 01h and int 03h and redirecting them to another3 ^+ ^" R1 T5 O d" ]
routine.! w+ i! c b2 S& ^1 L
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points% S7 u% f( N& T$ E* h" D, g
to the new routine to execute (hangs computer...)' ^3 g. j2 W/ ^- {. N
" v! ~) H; q+ G e% J mov ah, 25h- p& R7 e$ ]4 ^( l! ^; \
mov al, Int_Number (01h or 03h)
8 ~( D; ~6 {: N7 ?% m) ]( f7 {' P mov dx, offset New_Int_Routine+ H5 {. l# B$ a& S M! x
int 21h6 V% a+ q. E/ D+ A
. D2 [% @/ Q' c- p
__________________________________________________________________________
/ }1 W$ a1 X- i. B; s& r
1 _, @$ Y- x8 yMethod 09 K8 ]% ~( Q0 @; Q9 K4 z9 [2 p
=========
$ y3 i7 |* F+ t4 T
/ H2 e( P# E- F+ Y: E, sThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 d1 p+ q# d* T4 p b
performed in ring0 (VxD or a ring3 app using the VxdCall).
0 v" Y# ?1 H6 r- ?$ ~. s! AThe Get_DDB service is used to determine whether or not a VxD is installed
; u6 `; U9 T/ R7 e( K# Bfor the specified device and returns a Device Description Block (in ecx) for
9 }1 d. Q* [' B2 R+ d9 o5 G! Rthat device if it is installed.
' Q# O+ D* o( Z6 o: `" G6 f9 Z p9 {; J+ y- u% R
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# E: D9 L+ ?$ B$ X mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* a$ \' {1 j9 U, S* b6 u2 J9 m VMMCall Get_DDB8 g! E3 }$ r# c( \/ ~7 [
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- K0 K) y9 y" O7 C+ p) s& a2 k7 w- g" `2 X
n5 b7 L5 f6 D# N Q
Note as well that you can easily detect this method with SoftICE:
! V9 w1 w: ]8 r+ F/ ?& N" D bpx Get_DDB if ax==0202 || ax==7a5fh
9 d7 u1 {* g3 q3 s4 m! t6 {. P6 Q" }+ I6 G1 G7 q8 C* I% L$ H
__________________________________________________________________________" m, w0 e; w6 Y
8 m' N ^) d5 o F1 AMethod 108 H% p: {9 z# H7 b! i/ S# _
=========
7 X$ Q" L- i/ o) N+ O7 X: h4 B2 |3 m" C
=>Disable or clear breakpoints before using this feature. DO NOT trace with
3 Q# a$ q" G* q) `8 j SoftICE while the option is enable!!$ p9 k6 Q/ J& w. J. I* r% e
G4 g5 {% n, f6 E
This trick is very efficient:! D% R$ F' x h4 \" h
by checking the Debug Registers, you can detect if SoftICE is loaded
( B9 T' \) l8 f/ P6 n& ](dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 j9 g4 j3 P# c* U3 U/ m
there are some memory breakpoints set (dr0 to dr3) simply by reading their
) b3 k* E( V7 b+ b4 \- Avalue (in ring0 only). Values can be manipulated and or changed as well& p2 O0 T' j+ s/ L9 k
(clearing BPMs for instance)
6 ?6 `2 V, x6 A5 B/ | c* v) f% r( b3 V! k
__________________________________________________________________________/ R' F: b5 G- g$ |
e/ Z8 W1 a) x# N' KMethod 11
; D) ]9 K: \' z: E0 K' v=========
. t* A9 } ]/ ^/ _7 E& y3 ~$ U
r" D! n! J/ h1 R- Z* @6 |" pThis method is most known as 'MeltICE' because it has been freely distributed+ e$ s$ E: ?! B4 T& M) K" N
via www.winfiles.com. However it was first used by NuMega people to allow% L$ c* u+ X3 ^ F7 M, g( p
Symbol Loader to check if SoftICE was active or not (the code is located( c7 w, J# \ B- n9 D1 S
inside nmtrans.dll).
4 l, }( T/ w( v1 x7 X, G c" [5 C5 F n
The way it works is very simple:0 f. {* R* d' L' d) F, I
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ N0 B4 s+ ?9 w+ C" k' H. _: } bWinNT) with the CreateFileA API.
/ B- A$ q* {; x r9 K; K, E0 s% b* C2 L- S- L7 o
Here is a sample (checking for 'SICE'):
; n" a7 l1 z6 a) E( _3 n+ N% n; i0 N- `7 @# V
BOOL IsSoftIce95Loaded()
0 [: q! m% g7 ?{
0 c& W. V+ z, G% d" y- n( k* @ HANDLE hFile; 7 @* ?7 N. ]( R: f! v8 V0 Z: C
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; w, M% w' @7 e% A- x7 C# @: j- A
FILE_SHARE_READ | FILE_SHARE_WRITE,
. s1 ]! V, V! N NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) B. W" O" x7 H2 L0 _7 y if( hFile != INVALID_HANDLE_VALUE )! e( a2 T9 Z: M! G1 ?6 b& P
{
( {% y& Q$ X0 p) m* j CloseHandle(hFile);
3 E$ \* d$ X2 s return TRUE;, \6 o* F5 Q& Z+ H, Y
}
9 z1 L8 B9 W Y+ t return FALSE;# \% Z2 d; k, T. v
}) q! j) G1 W7 d# Y/ b4 d. @; y
* j ]2 L9 b1 a d1 TAlthough this trick calls the CreateFileA function, don't even expect to be
# g$ T4 A9 c! C1 k- Jable to intercept it by installing a IFS hook: it will not work, no way!# y( S! q' J+ G# P* |- ~( M3 G
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
1 j6 P* N1 d6 t4 B8 e) _' e1 c6 |service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) R- U" B' E! V8 |8 h5 U
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 m# {+ {- ]/ q, Tfield.% c' E% e1 \/ h
In fact, its purpose is not to load/unload VxDs but only to send a
5 a$ F4 f0 E1 h3 H9 mW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ N ?+ I, n* D( {) I% h9 m$ ?5 t
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
' v! s) {# y# l3 }6 T0 D Qto load/unload a non-dynamically loadable driver such as SoftICE ;-).+ k, \; E. k" d& @- `4 E; \
If the VxD is loaded, it will always clear eax and the Carry flag to allow! C ?# [, r2 X6 m
its handle to be opened and then, will be detected.. L* E1 u& i7 e( U M: ~) b8 x
You can check that simply by hooking Winice.exe control proc entry point, N$ l6 z6 ~9 b& c* L
while running MeltICE.
# Y7 F( L m, T1 X* x$ Y2 p8 L: B' H+ [9 r
# h# x% H3 Y! ?, x- Y$ e 00401067: push 00402025 ; \\.\SICE
! C& C, q; w% y 0040106C: call CreateFileA/ ~" A9 \% F' j5 J
00401071: cmp eax,-001! G8 }# C( H( o w$ k
00401074: je 00401091
: H4 J" [( i7 x) ?. z6 t
% E8 G4 V# k3 H4 [4 g9 c7 B6 ` c/ \8 g# d) C
There could be hundreds of BPX you could use to detect this trick.
! {( N6 s7 M* Q' \$ X-The most classical one is:
: G* ~) e- C/ o8 i C7 z( U BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 s2 P) t' H" D7 I+ t7 V *(esp->4+4)=='NTIC'
. ]! B3 F" H9 G8 a# T9 g. J
; | a* K( C4 G4 Q- z0 O-The most exotic ones (could be very slooooow :-(( k0 |$ t. _4 D( ~. A+ ]. o6 O7 a
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
! F8 C1 J$ |1 Q t& y ;will break 3 times :-(! ?' I; [; W* m' {# ]
P7 b \6 ?. ?) u8 w6 I" |
-or (a bit) faster:
3 W9 d$ O/ M N" o& W BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 H/ o9 P* M$ X* ^" j
& b$ ^% V, U( I BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 S! _' p( X& g# b
;will break 3 times :-(
+ [( v" N3 |; q$ Z- d& E' }' p! E) S$ z
-Much faster:# G9 u* A4 N7 h
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
$ W7 X- O1 c S4 g$ ~ ]2 G. f3 w4 H8 R# _' |/ Y2 ~/ U
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 a. }3 o1 \1 J
function to do the same job:9 N) `2 A. w$ N, M0 Q% E
! C6 P" c' I+ \* B |
push 00 ; OF_READ! }9 H, e/ S) k. M4 F* r" O2 C- P
mov eax,[00656634] ; '\\.\SICE',0
. M4 H+ ^+ I4 L C: G0 ?' P push eax, T( V' B( u. g S1 b( g
call KERNEL32!_lopen
$ i& R! N' b- |0 v1 Y inc eax
- c2 N$ y1 q. `* ?; C9 [ jnz 00650589 ; detected; K$ @* q3 Q; ^+ c& A L# `
push 00 ; OF_READ. y7 T, c! s1 T, ?
mov eax,[00656638] ; '\\.\SICE'
: o' z/ ?( x: _/ l8 @ push eax* E' b8 @) c% ~ C4 v& a$ G7 S
call KERNEL32!_lopen
; e0 h8 V% a; V% }/ i( s$ Q inc eax
/ Q" K; L. j1 E$ ~! l7 g jz 006505ae ; not detected) F( a) B! ]9 a0 C( n# W# h5 r
& a/ {' H0 |3 g/ V
- B, V# K5 Z# g% D__________________________________________________________________________8 h4 d0 {1 s' n1 q# @
. p- S" c- ?% r; }) H1 y- V
Method 12
! F/ F# J& I" J3 H. H( r$ \; A" U=========$ U9 X' ^" L- g
- K; R* B4 [8 K5 z2 Z. GThis trick is similar to int41h/4fh Debugger installation check (code 05
* H! e# q* {$ Q, S b* k& 06) but very limited because it's only available for Win95/98 (not NT)2 R# K5 N3 i. ?! U" |3 s
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 L* o: e3 ~. h" [# D& `7 X' J1 ~# n8 [3 ?: O& [! B) {" i
push 0000004fh ; function 4fh
B/ R; ]4 X! s, L push 002a002ah ; high word specifies which VxD (VWIN32)" a' U4 g3 a9 _* h6 ?" r A" y" t
; low word specifies which service) y1 p7 m# \" W3 {8 e
(VWIN32_Int41Dispatch)& N* _0 ]! e/ W; v& C3 n
call Kernel32!ORD_001 ; VxdCall1 k7 j3 i9 Z! i/ T2 }5 I' r* R
cmp ax, 0f386h ; magic number returned by system debuggers
1 a% c% E* z( ?) X' C jz SoftICE_detected
; B/ M. p* i- b9 J8 G- ?2 H" f% d
Here again, several ways to detect it:
( x) Q9 C1 o5 c' u- x9 m( ?3 e! Z! b* O+ Q2 k
BPINT 41 if ax==4f& c2 j( A1 _& g0 z( t$ ^8 l: [
+ t3 G. ^' G6 t& a* [ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one- n& t" C) e$ b/ l% c
* D' \. h: w2 [! g) C4 O) J3 @0 `
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# Z: O% Q; a9 @
) X. G$ N% p/ I6 }! }# f2 h
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!* r/ V; I1 b6 a8 A. _" p
9 E x; B! {$ A! B7 `
__________________________________________________________________________
2 s& G2 X4 i U( Z5 n# W5 \
B/ X! Z- o- \7 v3 O, O1 YMethod 13. |: }* b! p# _& c: z* ^. c
=========
: z2 O5 [9 b. O) {$ v
% U" ^/ ~( T1 ?2 T3 kNot a real method of detection, but a good way to know if SoftICE is+ e* }! A4 |5 X4 W) w3 \
installed on a computer and to locate its installation directory.+ F ~! `$ z1 N. }- Y) A
It is used by few softs which access the following registry keys (usually #2) :
: u, s7 x- \& K) f
" p4 {$ D4 ?9 u) o' S$ ]2 J-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 e4 T% T0 {' K3 O
\Uninstall\SoftICE/ B2 f' F9 p1 l4 Z' [
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" [' O6 ~4 f+ D9 R4 r b! M-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
x, c, H% ]: _, x! p+ Q. a\App Paths\Loader32.Exe6 n, y7 b1 i' {! I- K' K5 C
. B9 N+ P. U; ]
5 Q2 s, L' ^1 f& `6 z3 K3 q
Note that some nasty apps could then erase all files from SoftICE directory: W2 D" ?" i8 n& v5 `* ]2 w
(I faced that once :-(
5 s7 p1 Q! h8 a8 H4 s: S. }
7 t4 x7 V; R8 bUseful breakpoint to detect it:4 K; [) y% _" p3 n$ O- X" |
( V0 T8 [7 k, I3 x" D- _/ `7 ^5 }
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# h! N" W( Y; r Y: `/ E
a. `' L# F& o: ?9 w
__________________________________________________________________________
5 Q) V6 }6 V7 i- O
) \5 _2 F' F) w! i( X5 ^3 V9 a5 k6 d8 E+ t4 I7 ?3 U
Method 14 2 i2 _- K/ j5 Y' I6 `+ D
=========
5 }/ _/ j) u5 e+ z8 s2 E- R
8 C- \* I( k& ]5 _8 R1 E$ MA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- U' J( Y K/ l7 i8 M: Y, [is to determines whether a debugger is running on your system (ring0 only).
6 C' U! a' t: G/ ]2 K, [) X( D: D" r' a# q
VMMCall Test_Debug_Installed! {6 q' B4 B" P2 c6 z) L# J
je not_installed
8 F, Q9 G: J; S0 o2 q2 H0 ]% E0 `2 O/ R: Y, u5 Q8 t
This service just checks a flag.
0 _& H( s6 Q/ J6 l i, h</PRE></TD></TR></TBODY></TABLE> |