<TABLE width=500>
$ O" D9 t f" y0 x g' z* C5 e, m<TBODY>8 K( l! D% y9 O& G( L1 T9 ?
<TR>: N5 f$ v3 g8 f" n, x
<TD><PRE>Method 01 ) K8 m1 W4 |, f! m
=========
! w: x4 N$ b5 D" f( \$ _; W) ?; M: Z: d
This method of detection of SoftICE (as well as the following one) is
6 {& {+ j' ~3 @( ?' gused by the majority of packers/encryptors found on Internet.1 w4 \! v1 E, d3 n
It seeks the signature of BoundsChecker in SoftICE2 k5 _9 `4 B. v4 X- a3 e* x
/ k2 ?) x J; M2 V _: b' i! e' o
mov ebp, 04243484Bh ; 'BCHK'
1 `* v+ Q3 Z* K9 R2 t, x mov ax, 04h
9 }: R- e( [# x/ k( e3 e6 t# a int 3 0 d2 g/ z/ l- J* N* N, j' {- A& e
cmp al,4: o6 e1 ?; \: d; M& c+ }+ B
jnz SoftICE_Detected
' w! x4 {3 M* j- X8 I! Q
# k$ N* b" W8 s9 r0 P' L8 C+ p6 z___________________________________________________________________________1 r, V) r2 `, g6 j" f: v3 a
+ S8 C+ m- M( w( Q2 \% ^8 ^+ eMethod 02, d) s( A# {% m+ P' r( P" `/ i
=========/ y5 w; K) }* j3 T
- K1 ^3 |& ?+ [5 x/ }. ?' L d1 }Still a method very much used (perhaps the most frequent one). It is used8 d" T9 b; l! D- K1 d+ D" w
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 z& K, O. ?3 z' s; C" c s6 F1 x
or execute SoftICE commands...
2 M _4 i( u' _6 n/ V+ T: pIt is also used to crash SoftICE and to force it to execute any commands4 O$ \1 a {2 ~
(HBOOT...) :-((
( f/ h2 v7 B8 k" f7 K" |: f1 @) L1 F3 u; }
Here is a quick description:! T C. [) c5 }3 ?- J( D; A
-AX = 0910h (Display string in SIce windows)9 U5 c8 r% u0 ~6 y
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
8 w5 |1 X3 v! [-AX = 0912h (Get breakpoint infos)- Z9 E2 w4 `0 G" ]) p3 b2 N5 `
-AX = 0913h (Set Sice breakpoints)* E" P' ?) F o, c9 `
-AX = 0914h (Remove SIce breakoints)& Z6 R$ I4 h1 ~! L3 }+ a+ g6 o
4 G' F6 R: ^2 d, p
Each time you'll meet this trick, you'll see:
$ D% ~7 ?& [7 h1 K2 C-SI = 4647h
$ G9 t; y2 z7 ]4 r8 \-DI = 4A4Dh
, s8 n5 ]& a& Y' \2 W1 V9 zWhich are the 'magic values' used by SoftIce. R. J5 H" P* x/ F$ @
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: @* ]5 g2 E; q( ^+ l
( N3 c6 f. g' E+ G, T- `6 s& R$ C# HHere is one example from the file "Haspinst.exe" which is the dongle HASP
! g- G6 w* s' w( w6 T) A \, G) a( s$ ^Envelope utility use to protect DOS applications:; T1 `5 f( f5 L/ {+ s8 M
" r' R2 U- T% O% V% H |0 `$ }
3 R p% N; f4 V
4C19:0095 MOV AX,0911 ; execute command.
- D/ X9 Q! m, B' p2 M8 t' Q4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
/ T) G/ O- ~8 E4C19:009A MOV SI,4647 ; 1st magic value.% Y5 H0 | F n" L
4C19:009D MOV DI,4A4D ; 2nd magic value.
! o2 S6 }6 Y+ x, [2 {4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
& p2 e5 Z; c; _6 w3 ]4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 r$ Q! n4 E8 q$ d
4C19:00A4 INC CX
; P9 @! \: m8 I# L+ y# f Y1 N, c4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 u/ y, P% {2 j. }4C19:00A8 JB 0095 ; 6 different commands.
8 t0 T% h2 K& J, g8 l/ c7 A) ]4C19:00AA JMP 0002 ; Bad_Guy jmp back.% M" {) k# ~1 b! Z% g4 u* j$ {
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% O# g) u. ^, |9 u- }
. w( y" L( o/ t/ W
The program will execute 6 different SIce commands located at ds:dx, which
, r* x* l0 _5 F$ ^5 A: E: ?are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 {( }; T& I- \( }, ]. C
* u+ R. o+ I: y7 L/ `$ N: H* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) v5 m# d/ o5 E1 c" L$ d___________________________________________________________________________# j( E s/ {8 L& u. Y3 d8 j! c
4 O: g! y4 h$ m# J7 g* u; B( X: `( f+ l# d
Method 03
: x0 g' f: D0 c=========0 k5 r4 F% q# v7 `7 f. f
1 k' R# i3 q% Q3 |% S0 u2 D( c* rLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( r7 V# Z( |" _9 f# _9 r% e' l- i(API Get entry point)
- f* e! }& K4 W5 G8 A5 C) M/ y
$ N, X6 J% H1 o
$ J$ c# P& q1 \/ o" r7 ?# s7 M/ h& ` xor di,di) Q# `3 |, U" t/ [0 W5 h1 J
mov es,di
7 x1 o# X5 D3 B1 C5 B7 @ mov ax, 1684h
) g5 B; k/ x' {. P mov bx, 0202h ; VxD ID of winice6 e/ K; C& n- i3 c; K( X) n
int 2Fh' D' q$ v0 }) w) y
mov ax, es ; ES:DI -> VxD API entry point6 O6 y, }; K& E f; M9 ~
add ax, di* S) e: u, F) Q# {$ |) E- ?
test ax,ax/ m) S6 J5 w" ~) O' _& h# w
jnz SoftICE_Detected
1 [, I- i; t2 i! t" g& R. t1 c2 ^( c4 A2 `/ A+ Q+ i4 d( U
___________________________________________________________________________
& Q9 S% J% u/ s+ e5 b. T6 l X- o2 v' K" W9 U' F9 C
Method 04( P' [. l9 A0 J! ]
=========
( h. }- O" s3 T2 j1 N
2 e4 i/ W" f% B$ wMethod identical to the preceding one except that it seeks the ID of SoftICE
- J5 ^- _5 D. D1 Z( Z( iGFX VxD.2 M0 G% }! q2 ~ d! k
" u) t& B; L& k2 K* J! ^ xor di,di; I! [6 C+ G' W3 K; C8 I5 t
mov es,di
$ d" c! m* R, \! ^) R mov ax, 1684h 6 u7 a' F V( L( C: A& l& M
mov bx, 7a5Fh ; VxD ID of SIWVID
% J: s1 X2 B! I; T8 Q+ s e int 2fh7 z9 V3 l& k5 h7 N+ ]
mov ax, es ; ES:DI -> VxD API entry point
/ m1 m B* O1 d* U: x. z add ax, di" b, P3 O! }5 Y
test ax,ax X5 }% V7 A+ ?! v" q% d
jnz SoftICE_Detected
) x) `6 S; {1 O3 o
# S @* C: G- s5 q- w__________________________________________________________________________# J2 v+ p+ H( }$ o. J! m6 r4 a
. q6 d* ^6 |0 W# [. v& y# J+ _4 M$ f. f1 G q5 _: {
Method 050 r. F4 x) b) Z3 J, c# E# n
=========7 f4 }% V9 H) f' \+ V* m
& U0 R: T v- a4 nMethod seeking the 'magic number' 0F386h returned (in ax) by all system
& I+ G5 R3 L6 B) Ldebugger. It calls the int 41h, function 4Fh.
5 g3 j5 _ A8 l5 h' P0 {There are several alternatives. 3 ?2 Q1 R9 s- T/ L- w
& x" g1 G3 l7 h3 EThe following one is the simplest:" ?& j/ K2 Y( e! ^8 O1 F2 d
2 M+ p8 ~5 H [" ?
mov ax,4fh* m$ _- V/ u0 L$ I1 b% t, ]- Z
int 41h
2 h7 _5 s/ w1 s' z; H1 k5 m7 m cmp ax, 0F386
2 j% a+ z% ^% a# B. o+ c* ~ jz SoftICE_detected
5 l& ~' c" b* t5 U" v' w
6 S5 j: }* G) p3 o: w4 w; f1 B, \0 Z- y! t- F8 N
Next method as well as the following one are 2 examples from Stone's 3 q! d8 l# g) A/ l1 v
"stn-wid.zip" (www.cracking.net):
- E! Z( U% y# x8 n" M. P$ ]6 M5 g
mov bx, cs
( p, {9 O. G: P0 G lea dx, int41handler27 E L/ j* c+ W
xchg dx, es:[41h*4]
& z% {: A/ D2 _+ f6 S" H3 d5 ^9 } xchg bx, es:[41h*4+2]
5 ]' X# r) B. N' u mov ax,4fh3 X' a. V# m3 {2 u j
int 41h
8 z% c2 A9 [8 k1 N( g, U$ h xchg dx, es:[41h*4]
0 a, m' {+ x" R xchg bx, es:[41h*4+2]7 }+ H9 d' @ _' M9 T) c; S7 n0 l& o
cmp ax, 0f386h, q# O5 z& l/ N
jz SoftICE_detected
! Q' T3 G7 q% I: F6 K$ `6 p! I3 Z/ Y s
int41handler2 PROC
3 K2 U4 ^& `/ }6 L) i* D: w/ H iret( N0 v. b$ w% S# o$ z
int41handler2 ENDP
% o4 E2 u0 W5 r( \
0 O6 P5 p) w- @; E$ E: n7 d S! K
_________________________________________________________________________
1 m9 R* m5 r/ r) J) f {. k* [$ R4 i+ J# w
+ B/ a6 i8 m9 T- qMethod 06
8 `! G8 B% v4 ^) t- J. C/ `+ M=========
/ Z, z2 M3 V5 ?- T( r' y
- z( N2 }. J* w5 A) ?
W1 P9 ~- G* d! x7 `2nd method similar to the preceding one but more difficult to detect:$ Z# u9 W7 Y6 g9 @( q4 ]0 w7 [
8 ^+ @" k8 j( \6 B, {
; s, n& T8 c. ?2 P& G7 q3 zint41handler PROC
8 w) T3 l! G: X- {/ [ mov cl,al# z; g! L% v! A- g# u/ L8 [4 ]" W
iret
/ ]4 @, R( E8 w3 g8 `: ^int41handler ENDP' e/ d n# j- y' V# N" B9 J ^; Z
5 x4 n) v/ t: u
( ]) @! h. a4 H& \1 _8 `! x
xor ax,ax. j* F) T: I1 U' q
mov es,ax: a/ D& e. B9 D, ~2 A/ M
mov bx, cs
8 C+ P/ \5 A1 E2 O" [ lea dx, int41handler
0 P& W( G* ?% b( H$ V' G. Y xchg dx, es:[41h*4]0 b Z* u0 `) P
xchg bx, es:[41h*4+2]
. u1 U8 k+ `% ?3 L( Z3 ^ in al, 40h1 N1 X4 Z6 `' ]: k7 k2 M
xor cx,cx
* b4 B% t9 H+ D int 41h
$ O1 _7 L& l: V' ~ xchg dx, es:[41h*4]1 d, L& f" P: C9 h
xchg bx, es:[41h*4+2]5 s, U+ f$ ~' O
cmp cl,al/ u1 h( B1 A& i8 ^7 j
jnz SoftICE_detected
/ |5 m4 W4 y$ L3 p
) Q: p3 a# ~ H% E_________________________________________________________________________$ x- X+ s4 l+ @0 w3 U. U
. ~3 C" y5 p3 U3 Y
Method 07+ C' T9 d) v. l2 U Y
=========2 u @2 w% }7 I
2 N' h" z' Z5 L, K, Y6 x
Method of detection of the WinICE handler in the int68h (V86)( o$ U; w8 i0 ~
& j, @" i2 [" v) o; D# X
mov ah,43h
9 ^ _2 C. j6 t- r int 68h
+ e3 e! Z% t, T- b) t cmp ax,0F386h
* y# Z) g. ]7 |! d" w3 m/ x8 W jz SoftICE_Detected A; {8 D) i5 L2 I
$ |3 U$ `) U3 w0 f" N; J
/ ^1 }- ]: @# v. { b5 l% e I=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& P2 J! ]4 n ]$ I
app like this:% {8 f P: ?/ g7 r' E
0 f/ p" w+ J' A7 U& B BPX exec_int if ax==68
$ }8 r8 W v! c( B+ c1 |* G (function called is located at byte ptr [ebp+1Dh] and client eip is( m4 E7 ~* h! \0 p; W
located at [ebp+48h] for 32Bit apps)9 ?) m& m8 h y- a9 Z5 d1 ~
__________________________________________________________________________
3 o' C: j/ G8 R9 w5 b# J: T) `
K. d8 l- g( N$ ]' K5 h$ k5 ~7 D% g1 W2 M2 ~" @3 g* i% Q
Method 08
# p! {" x' Z* b- C=========
$ _, U* j. B7 c
3 x+ q- G8 E% L/ N7 j4 s, i3 PIt is not a method of detection of SoftICE but a possibility to crash the
$ t9 V: ^+ F4 e# B7 \7 fsystem by intercepting int 01h and int 03h and redirecting them to another* O& ], X" ^/ Q0 D
routine. A, O" M# j: D8 D" i3 z+ S* M
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 e# Y y6 w F' Z7 hto the new routine to execute (hangs computer...)
% T5 j3 h/ O3 x) }9 n1 a% q; X* I2 V+ n3 X; g3 J
mov ah, 25h& i4 n H) r0 B8 H9 Q- g
mov al, Int_Number (01h or 03h)8 h" ^, D& [9 k- x( [- ?9 ~2 X8 k. G; @
mov dx, offset New_Int_Routine
/ Z. b& q3 H: @4 D1 q& Y3 c& H& O int 21h$ }6 q( u2 c; u9 Q. V5 n+ l `
# Y6 V8 t& A5 S# ~__________________________________________________________________________0 A( o! a1 d r0 D: e% N
5 o g8 e" l! ?; b. g8 {8 j
Method 09" V3 E; Q: a6 S; w `/ u
=========; O0 M9 {% w0 T \3 ^
2 ] m. _$ h" V1 y" ^( E3 [1 l$ \( KThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ Q0 |9 q Q7 k7 v m# ?% v$ Aperformed in ring0 (VxD or a ring3 app using the VxdCall).
" ?/ q5 J: l! w' `The Get_DDB service is used to determine whether or not a VxD is installed
" q$ T# E( [$ g! N9 r* a8 bfor the specified device and returns a Device Description Block (in ecx) for, }6 o5 q0 F% r+ z1 k, ^
that device if it is installed.6 d2 D9 r) Y6 Z5 ^
4 _4 b/ ~* j- P mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, k$ P ]0 R ]7 v% }, {! t mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- a! x' B4 S3 X. y
VMMCall Get_DDB3 L6 d% G S( t0 Z! O5 K
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed# Y5 Z9 g; \3 S5 p" j6 f6 @: i% S
' ]' I" O5 }$ v' B3 F9 N& UNote as well that you can easily detect this method with SoftICE:5 E+ B4 F- g; e
bpx Get_DDB if ax==0202 || ax==7a5fh
* R7 o( b; |9 \7 O( t- r. @8 q& D# ^" s. x
__________________________________________________________________________3 Z8 P1 c' W9 U3 ~, l
! s$ p; D5 Z$ R }
Method 10
' M8 B; q0 S) H5 h) P1 L=========" }% T1 [0 E+ x7 ^4 S; ~
* _* n: ^' Y" u/ w6 G; W, B5 R=>Disable or clear breakpoints before using this feature. DO NOT trace with
# [4 d2 M, p" L3 s SoftICE while the option is enable!!
. @9 Q5 n0 k3 I, B6 ?/ F
# t$ [1 R2 o5 ~This trick is very efficient:
" G. f! e1 A. k3 _by checking the Debug Registers, you can detect if SoftICE is loaded
" s6 p J6 U( u/ b" P0 m(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
O8 `9 Y/ j' T% L. {there are some memory breakpoints set (dr0 to dr3) simply by reading their
6 Z/ l# z& r3 T- kvalue (in ring0 only). Values can be manipulated and or changed as well
/ P) F2 b' {! s* a9 _(clearing BPMs for instance); [+ t3 K" r! u2 F& X: O
: W6 [+ T: S3 u z! ` Y0 s5 M__________________________________________________________________________+ p8 T3 P+ T! _; C& v: [
+ q l1 u; M# v7 R1 S' m% OMethod 11
/ ?8 l3 }8 F/ @. b/ f, m+ ^! H=========9 O+ M9 R1 \$ j2 ]/ L
h$ o: U4 v6 Z0 B* @- ]$ ~# `This method is most known as 'MeltICE' because it has been freely distributed" ]2 A$ W4 C0 T: f
via www.winfiles.com. However it was first used by NuMega people to allow( h: Y! M: M, Q% m3 e7 X
Symbol Loader to check if SoftICE was active or not (the code is located
: i$ @, @- B9 w4 ] c/ Linside nmtrans.dll).3 @5 i1 n0 E+ q7 M) ^, B# V
: c7 k% q( A- E' G+ W
The way it works is very simple:/ F+ T' ~# t* \5 `6 _$ [) ]' J
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; I- W* g( b1 y6 ?2 s- G6 e
WinNT) with the CreateFileA API.
$ _ k6 t) l0 x1 f
" ?% m" M' N& q9 dHere is a sample (checking for 'SICE'):$ t7 A; B( l- k, k: H
/ R8 I4 g b1 n: t$ W8 Q
BOOL IsSoftIce95Loaded()
: F6 v) f6 N! R$ T& F{- N6 y# g7 i0 ^2 X( o8 `) v
HANDLE hFile; $ ~* L5 \/ T( [- l. G
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 G2 j1 I6 K0 U* F, m: M FILE_SHARE_READ | FILE_SHARE_WRITE,
! L$ i) p3 \3 D6 L) e* u NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ P1 p0 G) K$ g: Y8 }# J if( hFile != INVALID_HANDLE_VALUE )
) @* b7 ]2 u( J" M {3 [4 ~( V0 k5 I9 a5 L
CloseHandle(hFile);+ V& x) R7 ^/ F# b& {6 z
return TRUE;0 a+ y! M" n3 l
}
/ M! Q' e7 V- C7 H) H' u# T; f$ D return FALSE;3 C9 S0 ~% s3 b3 s$ e# K
}
8 i. k. v) B: L" ?
' u5 i/ a7 w% X3 ~7 [! s% [Although this trick calls the CreateFileA function, don't even expect to be1 D2 n$ J5 g0 V6 q# ~1 G
able to intercept it by installing a IFS hook: it will not work, no way!" A- j5 A! L) I G& a, b
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ T2 z! R* L: w+ l6 Bservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
# }) K/ Y7 B. uand then browse the DDB list until it find the VxD and its DDB_Control_Proc3 |! q2 v( y8 }8 b$ @
field.
. Y3 F3 V7 }0 l0 @; Y0 iIn fact, its purpose is not to load/unload VxDs but only to send a ) Y+ f; w) c- y7 @) O4 B# I$ G9 H
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" G4 F& s* ?/ g" Q2 N1 ?3 B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 @) W* F/ G4 _0 Z( _, Ito load/unload a non-dynamically loadable driver such as SoftICE ;-)." H& D; d. }& U$ C* `- C
If the VxD is loaded, it will always clear eax and the Carry flag to allow
' M3 L" L6 l% b) Tits handle to be opened and then, will be detected.: {2 D1 I$ x# E0 |
You can check that simply by hooking Winice.exe control proc entry point
: C: {' y* V# ]- ywhile running MeltICE. J6 W7 O" H& |+ x0 h
' Q# {: o- n# {
. U7 |& q, Z Y" G1 [
00401067: push 00402025 ; \\.\SICE. c. `. H+ @. x/ R0 f8 ?
0040106C: call CreateFileA- |7 G X* B/ s) p; w/ B9 L
00401071: cmp eax,-001
( M* m) B7 o" o0 a/ @ 00401074: je 00401091, r' K- J( k2 I+ S. {6 O& x! i, g
4 _* T1 r7 O4 U$ w' h- @" p/ D: ~8 k" p* P
There could be hundreds of BPX you could use to detect this trick.
6 h3 g& H9 Y: y5 a; L-The most classical one is:! L' j0 e& x+ \$ T+ N
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 I, j/ p8 n" a6 K3 ~ *(esp->4+4)=='NTIC'. t: I$ x+ I2 W+ h" Y; W8 b% d
' E7 Y; Y1 T Z8 z0 W-The most exotic ones (could be very slooooow :-(
, j0 ?3 w) |* A* Q6 u% s: n, L2 H BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
9 \9 S* \ d! T) W( o ;will break 3 times :-(
" p- z' X5 I" C; n# c
5 {4 E2 S3 p( n/ I/ S-or (a bit) faster: 3 I3 Y$ s* G ^' s3 Z' V4 d& a
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) m3 ^) K$ g: H. F/ \/ f0 x( K1 M' L! A0 F4 Z( w
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 4 f0 d; _3 i. H! |, V
;will break 3 times :-(
2 v0 t$ w" _6 w/ g$ T
+ L& @1 r% l& Z: E. o: l-Much faster:, \0 i$ y; |* g
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( e+ \' @5 w( B q9 j
2 G- Q9 E) {; m- }6 V4 \% s
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen" i9 d9 K9 q# m% I
function to do the same job:( h; c# g; |4 ~/ ?8 ?
: b5 c" q. U4 ]8 x8 r7 X* E7 { X6 \
push 00 ; OF_READ% Q! S( ?! Q$ I
mov eax,[00656634] ; '\\.\SICE',0
# M% V9 @1 `' u9 e+ W$ Z push eax
- s/ B9 Q5 V' L. [! K, U call KERNEL32!_lopen# i1 m" H0 B; \" i
inc eax7 I: x3 g& \' D, \
jnz 00650589 ; detected" \# L6 V" p: @$ y) ^2 g
push 00 ; OF_READ
3 z. Q3 S1 d0 f' q, @, e# _ mov eax,[00656638] ; '\\.\SICE'
% o$ `5 }, f# G5 r1 D, c push eax4 j" r7 ]6 B/ t
call KERNEL32!_lopen4 ~# v% Z, F9 @- j! t4 q
inc eax
5 }# `, }# p. o5 [+ w9 H5 R6 p jz 006505ae ; not detected* G& U3 C. L# w$ E& K* {
, c( t# x" i' a6 K0 S1 j x( P, j, [: e% `
" j$ e6 P7 K" q. M {# Y__________________________________________________________________________6 S1 F: J; k& s$ X$ |+ ?
* k" h- q, e" pMethod 12
+ f3 Q; s+ H; @* R/ e=========
" e8 s1 S9 @( x9 p, |3 \) x5 B# c: L2 r
This trick is similar to int41h/4fh Debugger installation check (code 05
3 G8 }4 r- a) E) q, C! \& 06) but very limited because it's only available for Win95/98 (not NT)
. T: v/ \2 Q" L% J( f6 ~. X0 Fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 O8 q/ i7 a4 E4 E, |& P+ o
8 \5 {# r; o5 \! T push 0000004fh ; function 4fh
2 M- V0 l, q* X+ N4 ^* p push 002a002ah ; high word specifies which VxD (VWIN32)( ~$ W3 g! S P6 o# o! z, n1 u8 p
; low word specifies which service
) y. @* [8 _+ T4 l* ]3 O7 T' @ (VWIN32_Int41Dispatch)
6 c* y& `. x9 H call Kernel32!ORD_001 ; VxdCall( K2 Q& h: o2 q. G( n9 h
cmp ax, 0f386h ; magic number returned by system debuggers
/ ]" D7 K! G5 x' a F5 ] jz SoftICE_detected
3 a+ v5 z# m* \0 n4 T
% K; N, F* N! h z* i% THere again, several ways to detect it:4 e" u2 t D0 W4 Q- n
- k/ J& H1 W4 u( v! t( \- O% {3 \
BPINT 41 if ax==4f6 m* t/ c- Z: v; T O9 A3 a) F1 A
2 ?9 X7 \1 }: F: y$ @
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
1 [- ]" s) H$ d) [* e) S0 e/ P; f
6 t1 `: H5 r! y BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A3 ]) [% v7 { x9 N
# J, P7 O% y. L% a BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 B+ s; {$ H8 y& b1 s3 }& z- e c# V4 l4 l, M
__________________________________________________________________________4 c7 P8 {( Z: r+ Z
i( W$ ?" K* @8 L6 rMethod 13& n+ E0 F9 Y9 S' V2 Y' `
=========
w, z6 w$ ^" N: F" j. z9 a; a% L' N+ G2 c
Not a real method of detection, but a good way to know if SoftICE is2 b: E4 E& ^ x
installed on a computer and to locate its installation directory.
: t& }6 b; R: @% j7 r8 QIt is used by few softs which access the following registry keys (usually #2) :( z; o3 A0 _5 K8 I
9 z( }: X8 g5 J6 X: R1 ]
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: y9 x1 n$ E) \* M) N- g) c
\Uninstall\SoftICE+ P0 S- x5 c; A( l
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' L. f: p% _) }. y! t- x
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 _' `" b3 a3 L+ G' z\App Paths\Loader32.Exe0 O/ _) S) R" q* l
$ k+ P, ~0 u- X. T! `( Y, U* T2 F
4 h; H4 z$ I7 P9 W9 _Note that some nasty apps could then erase all files from SoftICE directory; k- u, \+ ^6 u) h# [8 Y
(I faced that once :-(
6 ]* V" |9 c0 v; I# K- ]% `; k9 C3 m) D3 l
Useful breakpoint to detect it:
7 ^, h/ ?6 n+ b7 }' A7 d0 _( r5 C7 U" ]9 M. s* A& O4 h
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'. Y1 L9 l! |& _2 R4 W1 U
/ l# L3 n" N# R4 ]__________________________________________________________________________
- n2 L0 h, ]; a" Q. Q: K( V+ @& t5 Z* ~
( E$ c. m. @" F0 [. a
Method 14
( O! u5 j" @7 u( a4 o=========2 ]+ ^: r; }+ q, ?; T5 W
# u N4 k! N6 w3 }- h0 X
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* V& R+ l4 H5 c3 c& ? Tis to determines whether a debugger is running on your system (ring0 only).4 d7 T! x+ ] M
- A; R% I% x, |* u, P, t: p
VMMCall Test_Debug_Installed
: w3 u) O* _' S: T7 l$ ] p je not_installed
* M+ P8 \9 T. W( m" I3 S0 Z
4 [/ R5 g( j# x( q( FThis service just checks a flag.5 ~" X) ^) j6 s
</PRE></TD></TR></TBODY></TABLE> |