<TABLE width=500>2 M* S) J: k L( s0 m# `2 z& A6 A
<TBODY>
' |, m" o+ }* O6 ]+ O4 d<TR>
# l" Q0 P& s0 r# @0 \- s$ c+ t<TD><PRE>Method 01 ( Z, \/ `* y! Q2 b; @: S/ D
=========
; f6 p/ i0 d' h6 p2 z7 [1 R! F1 ~9 [( H# c
This method of detection of SoftICE (as well as the following one) is
/ w# ~7 P9 w* L, z% s' Wused by the majority of packers/encryptors found on Internet.
/ Q( U5 f O- \( ~It seeks the signature of BoundsChecker in SoftICE ]& i* E, Y% K4 O! M
3 n4 u: {/ X" c4 g5 V7 b' B mov ebp, 04243484Bh ; 'BCHK'
2 ^, v/ Q' t- y$ i/ ^+ A mov ax, 04h, A: N* \" z8 A4 _1 m& w9 L
int 3
) } s5 K/ o* p+ y4 ~ cmp al,4. Y% D& _' H% ?) e
jnz SoftICE_Detected4 e5 a3 w. O0 t, C- ]4 O9 }* h
( ]$ u0 w& f8 o3 h
___________________________________________________________________________
$ S* {& ]' F( p# u* T( g R- F [2 t) ?$ d5 J; r \
Method 024 t, H( y" w8 U6 U8 y X) b, \7 h6 `
=========
) p6 j5 G/ ~* Q% y8 `& N% k) g
9 u: Y. `+ J1 O) T+ k4 qStill a method very much used (perhaps the most frequent one). It is used
4 m7 ]! ~5 w0 ^% Dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' q/ Q& Z0 {3 y+ [! v+ oor execute SoftICE commands...) s& d7 F3 O; o+ {- C0 o! B
It is also used to crash SoftICE and to force it to execute any commands3 m! m& E% K2 o0 E$ `2 x+ Y7 G
(HBOOT...) :-((
3 r6 q$ p0 }0 e3 b/ U" m' d0 X0 z& C1 S
Here is a quick description:
' }9 {% v. m, ^7 x-AX = 0910h (Display string in SIce windows)7 o" O; i1 G0 h+ y) h* s
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)9 \0 H# S6 @5 p. l2 H
-AX = 0912h (Get breakpoint infos)! P) B, i& `2 O. I
-AX = 0913h (Set Sice breakpoints)
8 e9 d9 E& E7 B; R# s3 B-AX = 0914h (Remove SIce breakoints)
- Y* J; v' }" g5 t- w) i% Q6 f% f' E* N% Q
Each time you'll meet this trick, you'll see:6 ^5 F4 m9 s$ K: {
-SI = 4647h
) P* ~* e- K! V5 b-DI = 4A4Dh- y' { C8 t# z2 z4 z/ K' x! ]$ C
Which are the 'magic values' used by SoftIce.# y) w% C8 h8 W* U0 {3 Z
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& ?$ O& S1 `% O! C
! i' m% f" E6 A9 c2 L7 [# NHere is one example from the file "Haspinst.exe" which is the dongle HASP9 {% ^9 w+ n: s. ~0 q
Envelope utility use to protect DOS applications:
, Z9 m" [& t1 k; {' b! x
& G: @$ }8 K( ~ H' v# Y- {% \0 \
4C19:0095 MOV AX,0911 ; execute command.
2 n2 {- I" G6 h6 b& w$ m+ m4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).3 }# h' O2 O! u- C; V$ Z
4C19:009A MOV SI,4647 ; 1st magic value.6 }( |; w, U2 A2 k: b3 D. h4 W7 J
4C19:009D MOV DI,4A4D ; 2nd magic value.7 W9 ~& j& ?* ~/ I u: M
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)0 V. a1 q+ d/ j; k4 b
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute' O- b- k5 }: D0 }
4C19:00A4 INC CX: h8 H9 N. U( n* n; d% T* K. R
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& g2 k. n& U8 H: v; y4 t
4C19:00A8 JB 0095 ; 6 different commands.0 r, I/ G9 a7 E& k8 _& A; t0 F
4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 k; a+ b3 ?6 h, ~: ?6 m
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 e/ ?8 X4 s& Y
5 Z7 g2 q& j1 F4 o5 a
The program will execute 6 different SIce commands located at ds:dx, which
" W; `6 [8 J! Q7 pare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 h' V1 ?8 x$ ^( Q `, u/ `, `
5 {7 M$ b! Z( b: u9 ?+ B; S7 O* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 |3 N# t& x2 u* q# O% O4 O- r" s- k
___________________________________________________________________________ K6 t U6 Z8 ? i
1 }4 b6 A8 v) w k- b6 k# T+ ^) ]: P1 u* M- J3 U. |: K% W
Method 03 o# S, g! ?" J7 q& d: Z# j
=========+ h8 ?; N" u2 }1 ~6 q
7 k: v- o3 r! X+ gLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h& ?+ r/ P9 ]2 P
(API Get entry point)
& N) o- e! m/ T( C3 X7 i , T! `5 K0 q, f. m
q1 a, j3 g. n, c8 Y0 E xor di,di
3 _- y; _$ N" W# [ mov es,di
$ U" ?4 @! I4 x$ m* ^ mov ax, 1684h ; @( g( J( u3 [4 R
mov bx, 0202h ; VxD ID of winice0 k" d2 n% G: j2 Q8 [
int 2Fh
+ t( O7 O; ?, K8 b5 o; G mov ax, es ; ES:DI -> VxD API entry point
7 \3 Q3 d6 k& q; |# f add ax, di: v/ S: X. Q2 M ]. a- X
test ax,ax( U$ I n! K7 {% S `
jnz SoftICE_Detected
+ p$ {1 ]7 H" o; j* j. r' \; }; |; o, o4 y1 K& L; W/ O& _
___________________________________________________________________________
) {% u5 X; i( Y5 @$ {9 B2 T1 w5 q9 K H
Method 04
0 J& x$ Q6 A8 J=========+ A" ?/ b: z4 I# p+ b$ k" o6 y0 b
* p7 V9 F/ c C$ r8 z K0 sMethod identical to the preceding one except that it seeks the ID of SoftICE5 F- U+ J: U+ r! q. o. m$ _
GFX VxD.
! H" J2 _5 o% C$ w0 m- B$ Y$ _3 r" P0 ^' p' `: \8 G
xor di,di! T# @! Y; f* Z. O1 m* u _" C
mov es,di
; i% v) C7 D* l$ o% _ mov ax, 1684h & B6 F" p( \: M, ^
mov bx, 7a5Fh ; VxD ID of SIWVID1 C7 A) N+ `$ R5 F6 B2 X+ ]4 s
int 2fh
6 Q7 S5 m; ]$ g+ P mov ax, es ; ES:DI -> VxD API entry point
5 c. S0 o) \. z add ax, di0 a Y9 @( M% m" l+ \4 W
test ax,ax6 Y' u0 e- U6 h. \, L
jnz SoftICE_Detected
' B9 ~. K" m( G* d$ j4 {* B4 n# k7 y; e. U D1 Z$ b
__________________________________________________________________________
8 N) P! {) E# S' N9 |$ P; v
$ q# k X$ l" b1 ]* f6 k# a( h2 g, \: z
Method 05
$ f' e( Z& W% [2 J=========( F0 W6 {6 A% P" i0 O3 t
; v! |5 e) B3 \ z( d1 s* n: i2 pMethod seeking the 'magic number' 0F386h returned (in ax) by all system
. n/ @- x* }4 L7 V/ Mdebugger. It calls the int 41h, function 4Fh.
8 L4 X( F& Q( ]$ @& u+ |) WThere are several alternatives.
& ^9 n m! c3 F- W* U, j, D" w2 Q: x2 ~% a+ z9 |1 J
The following one is the simplest:& [& u) r5 b& _% k- ~# t" b# [/ U
$ h% I; M' Q' o# A I$ H mov ax,4fh
2 L- s; O1 R. _9 ^% t int 41h
* j. C. W: @! m cmp ax, 0F3863 z; O x0 X% H, v# f
jz SoftICE_detected
" v" m5 `7 L' R0 ]6 k
9 R& u0 t" g8 m& j$ g- O% r8 p* W* c1 F6 R+ P" Y
Next method as well as the following one are 2 examples from Stone's
- y) s: B3 q7 P7 @, f+ {. G"stn-wid.zip" (www.cracking.net):) N! f* O* A! J7 [" {
1 ~7 J7 Z. O7 l0 C2 Y# e0 ]& x mov bx, cs3 F, v- ?# o3 s$ Y
lea dx, int41handler2* \ y. [ w9 s+ J& t% J
xchg dx, es:[41h*4]- |2 s% _8 m3 I7 A D5 z6 @# c7 A8 ?
xchg bx, es:[41h*4+2]
) Z, I' n% f/ Z7 U$ D2 B6 ^ mov ax,4fh
0 S1 }$ L6 s- f5 ^ b% k6 W* R# c int 41h4 `7 f& L: @9 c0 @
xchg dx, es:[41h*4]
- i7 h ~2 J! X. K5 d4 S xchg bx, es:[41h*4+2]
( `$ x. m, l! H; O4 K6 n cmp ax, 0f386h
# M9 [% Z' y# Z3 L% b jz SoftICE_detected
0 z& H; N2 `" F+ c, ?- q' R0 u; ?. }8 ]5 I" t
int41handler2 PROC% B2 ]1 `% i! S
iret
! S" j- \+ K( |+ K. k- Fint41handler2 ENDP
+ ]0 G7 u( U5 e( f' O* G) o% A! T
/ O+ G: M) z: x: l6 p3 U
$ a8 U, O$ O& b, y" M. u_________________________________________________________________________
7 C' C, ?. }3 Q* K6 f% ~
, j" q' S7 B- x# ]4 W$ f k! G
' t; c, r8 S% V" _# u; ?Method 062 |3 }$ I! {! h7 T2 ` F
=========
- C v0 Q4 @8 H5 \! F2 o4 z
. g/ y, y# R1 X+ {/ K, L, {0 Y
2nd method similar to the preceding one but more difficult to detect:: \7 E7 Z/ `8 P3 g# a5 G8 M
, _, C1 Q7 f& h d2 G$ d1 U( o) [9 h9 s5 `4 W/ p4 d$ e
int41handler PROC0 Z' a$ i* f4 J) H
mov cl,al
) P: n4 C! y6 ~" U- L% V iret
* l- A% k7 E% q( q2 ]int41handler ENDP. K, S' b2 S8 Y$ [6 P
% D8 e, `7 v" V5 ]8 F7 N; ^1 S% u
# m' T! \/ w" ? xor ax,ax: o* L0 ?! O# j# i" F* n
mov es,ax
; l2 @/ {; {' o. f3 k7 ~) } mov bx, cs
5 x* J, _2 Q5 L4 |5 P: C lea dx, int41handler
3 C& u& M& g7 U xchg dx, es:[41h*4]
1 B% b. R4 ]/ s xchg bx, es:[41h*4+2]
6 n, y/ \; V) b5 Z* G in al, 40h
* f. X) d4 v# b8 _$ X xor cx,cx) j: M3 S+ K9 M# S; K! @$ ]7 c/ g
int 41h
1 X* {( b+ ~( u* @+ m+ }; L xchg dx, es:[41h*4]
3 S! K8 w: p9 W xchg bx, es:[41h*4+2]
; I; J0 U$ n; z4 _ cmp cl,al6 d- y4 k6 ]2 Z
jnz SoftICE_detected
+ [4 R8 X0 S% b9 T
9 m6 b, C9 |6 O- k0 ]_________________________________________________________________________! @; ^. B9 q1 ~2 q, [) u0 Q
7 J! B. o8 }& G8 m# ]. Q9 t" K% U
Method 07
! a: Q4 T1 C% T1 {========= a; d& @: b9 M/ X1 j
+ | \+ p+ Q! l
Method of detection of the WinICE handler in the int68h (V86)
5 a2 M5 W4 D y4 ^$ e
9 _2 r8 z6 K& M8 d% q6 t' r mov ah,43h( o% C9 }0 t: d5 z
int 68h& ^2 n* a- p. a
cmp ax,0F386h
3 S, X% T; _6 p jz SoftICE_Detected
2 ~& Z7 k) Y1 I8 N$ z& W) v3 ?
! O1 i7 R) a$ ]2 b; T, f) P7 G) a( d
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: s4 w$ J3 \5 H' o" F; N" p. R9 z$ A app like this:
) i4 \8 O- s, E/ u
4 B) e, g) B; \4 B8 A BPX exec_int if ax==68
1 ]6 \9 z) H5 R, _1 } (function called is located at byte ptr [ebp+1Dh] and client eip is1 \- r6 ^* I5 e% m- `1 d) M
located at [ebp+48h] for 32Bit apps)
3 r4 M3 B) @9 y0 T& y. q" s__________________________________________________________________________7 X0 g( b. M) J/ a
& H3 x$ \( E0 c" e! v8 C+ f
- `- {' Z9 T5 e l# D
Method 08
( V* l; ?7 j" n% h- n% y5 _=========3 j) H( ]! n t# g) y7 d$ T
4 o- i. F# `" E! e1 S
It is not a method of detection of SoftICE but a possibility to crash the# W+ K8 Z* N4 P6 B( ]0 [
system by intercepting int 01h and int 03h and redirecting them to another' h- ^3 A k M
routine.
0 V' h+ U9 m# p5 u6 iIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: l' U/ @0 q7 k3 ~, s2 Zto the new routine to execute (hangs computer...)% s# A u+ r( B- o" Y1 O% h$ n
8 Z& p" R( ^% G; C" Y% z5 Z+ k0 s mov ah, 25h
8 {9 q m4 W$ Z- h# k. ]# w mov al, Int_Number (01h or 03h)# {$ C& {8 c9 p! k* E2 e
mov dx, offset New_Int_Routine! r6 t. Y3 S8 U& L6 }+ }
int 21h0 ?% Y2 s. i5 {% f
* Q7 L) ?. R5 L9 o! \1 s__________________________________________________________________________) U9 j% V+ h% D1 ?& P- m# c. F
: |- S! R7 b+ q, n; M
Method 09
. ^; V* T% _, \6 U C) W9 y- f=========/ ]" f& M. V( D) J% g1 m) H: M% p
' _" k* e, _5 h* T, S
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) b8 L/ v, n$ T$ {4 a" Pperformed in ring0 (VxD or a ring3 app using the VxdCall).
7 v1 A: k; {7 F8 \% ]The Get_DDB service is used to determine whether or not a VxD is installed
) M5 Q; H4 |% f4 o/ m j3 P/ pfor the specified device and returns a Device Description Block (in ecx) for
9 V( L. L; \+ S- U# R( N6 @that device if it is installed.
/ c7 D# J0 o' q/ w3 l$ j
- p- t8 f& j2 e2 p: b mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
I* f7 R3 g# u' } mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
8 b- ?% I, X3 b v% a VMMCall Get_DDB2 p; M/ k% F" ]: g0 o) d* v2 S# ~
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed5 \0 X2 l/ J- Z2 U
+ x' R' D; m) K9 s3 s/ O9 @
Note as well that you can easily detect this method with SoftICE:, l# O# W1 B" s9 F2 t' c8 }
bpx Get_DDB if ax==0202 || ax==7a5fh
3 ]+ b1 G: g; S/ G# U& T$ t. o
__________________________________________________________________________5 I* ~: U; s9 i2 T
, F T3 Z' d4 q% X- wMethod 10
/ Y4 o; ]0 d& J" r* f7 R" g* o+ B=========
7 A) o' R: R! I% a3 F
: M- b$ @: u0 J$ A=>Disable or clear breakpoints before using this feature. DO NOT trace with9 N: c8 f& T0 B, C$ L& D# w
SoftICE while the option is enable!!( g! D1 {( d- o. N" t( V C9 G
% y3 k* {. c2 x; l
This trick is very efficient:
2 S7 p0 x, p' Y+ x* A: b! bby checking the Debug Registers, you can detect if SoftICE is loaded
! S s. i& j* [# Q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 M% @" Y& w& z3 M& X$ {! ^% [8 Z9 W
there are some memory breakpoints set (dr0 to dr3) simply by reading their
$ D' D0 c6 r. [" v5 Wvalue (in ring0 only). Values can be manipulated and or changed as well2 C% z/ k9 B# F. P$ X" W8 }
(clearing BPMs for instance)+ @6 u+ s2 O- u
) w7 Z9 M, b8 S3 c4 J
__________________________________________________________________________7 B' T1 f1 l8 r2 T8 e
; [6 |; _7 I0 f L" s7 QMethod 11
. G" h" b* M- X r: W3 d& c' @=========
1 t+ [( y, R8 B2 d B5 \
* u; e! D' L( y/ g4 x9 pThis method is most known as 'MeltICE' because it has been freely distributed
6 ^( |1 @6 S' p/ _: v4 q8 s4 hvia www.winfiles.com. However it was first used by NuMega people to allow) p5 U8 l: I, i" p' m9 o5 t6 w7 }
Symbol Loader to check if SoftICE was active or not (the code is located
- m1 r! b2 k6 T4 c1 \; O, ginside nmtrans.dll).+ ~; k% L( y% p
# s. ?& P! w4 d8 n
The way it works is very simple: ^1 @9 H, l7 A! p0 s4 }
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 g1 @+ O/ ]2 D0 o% c
WinNT) with the CreateFileA API.
1 G+ C- E; R# e2 j ?% ?0 q) [! R; G! G# c
Here is a sample (checking for 'SICE'):
' m/ X$ w0 g7 f# Q7 _
$ {7 U: Q8 k: }$ ~1 _4 p }BOOL IsSoftIce95Loaded()& }/ L% t/ q" @8 w+ Y, M1 P; ]0 l
{8 N, `; v" l, \# Q7 C+ i
HANDLE hFile;
" o; t! D0 F; f3 [ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& H; c; U$ X$ s- T' ~) t5 [ FILE_SHARE_READ | FILE_SHARE_WRITE,
& u7 p {( U$ W- G2 B NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 @) ~# r3 M9 M if( hFile != INVALID_HANDLE_VALUE )
3 `$ @. N2 z5 Z+ k5 b {: ^+ B% X* f8 e' b0 U+ v
CloseHandle(hFile);
n6 |$ ^4 h' Y: Z3 X2 k return TRUE;1 {9 W" T! f9 e
}6 n! N" M, h. o9 }; M
return FALSE;
/ B% S# b8 l z, I) ?}
" ~% n6 A3 H7 I4 w' s; x+ Z: f* _% f/ p7 I4 x0 \5 X: u+ d8 O
Although this trick calls the CreateFileA function, don't even expect to be! ^# m1 ~2 L5 C( z# h4 c2 i
able to intercept it by installing a IFS hook: it will not work, no way!! W; S1 t- c( h3 y& s/ A
In fact, after the call to CreateFileA it will get through VWIN32 0x001F7 h$ R( z- Z* r9 Y+ G0 V
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) O. [+ ?% n' {5 r7 f6 p7 r
and then browse the DDB list until it find the VxD and its DDB_Control_Proc! i8 k3 V! A9 i4 F0 u
field.
4 }, \9 b- W5 LIn fact, its purpose is not to load/unload VxDs but only to send a ) Z ^' o- D3 D0 n: i
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 T \- h3 U V' `9 zto the VxD Control_Dispatch proc (how the hell a shareware soft could try
* Y" P# E; O" T. j' L( l n M2 oto load/unload a non-dynamically loadable driver such as SoftICE ;-)./ T W, P$ J7 b' s
If the VxD is loaded, it will always clear eax and the Carry flag to allow g# w7 G1 l) [$ R. e' O
its handle to be opened and then, will be detected.8 p9 l7 M1 P3 V) \( y$ j# ?
You can check that simply by hooking Winice.exe control proc entry point
- A* k1 W% {7 T! {3 Z' u. xwhile running MeltICE.
! J F7 \$ o# H0 G/ q) h; E# V, v( a' k' u) D; @
* k3 p: V0 @- O* u; s
00401067: push 00402025 ; \\.\SICE( n6 S! ^& O' G; ^' K. G/ k
0040106C: call CreateFileA* T h: h$ Q* @
00401071: cmp eax,-001' y" n) n1 `8 I% }6 i7 [' p
00401074: je 00401091
/ k; y# {' j' X% V
3 h6 @3 p3 Z2 i, I" N* H
$ B' ~5 e# j# s; b, _There could be hundreds of BPX you could use to detect this trick.
0 E( n0 C3 e6 b1 B& K: c3 |4 E |-The most classical one is:4 j* e% |; z( v0 O6 p& e3 @# `
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 u, ~" ^/ x- ^2 d3 U
*(esp->4+4)=='NTIC'
/ h- u9 s6 [3 c1 ^* e% _7 y" V
7 C1 P& f3 {3 d# _9 C' h$ m) l$ c-The most exotic ones (could be very slooooow :-(* e C# z: f* E8 z1 M
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ N* ^1 E: s9 ^1 ]8 |! W1 l8 g ;will break 3 times :-(
( a* s: O+ @& ~: L( l
4 r4 _) q3 W( B0 m6 q-or (a bit) faster: 1 U0 J A, Z% z
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 n: s1 ?# V! B, [9 Q! ?$ g7 W, A6 r' u. _& r: S
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% w. N+ X0 u( Z0 K, S1 a ;will break 3 times :-(+ D, D' f/ d* W
" J3 [# H- Q4 R, l C [0 t& e$ T
-Much faster:
0 \+ C& ~& w7 K+ R4 M. r" X* F BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
% U" }7 t! q( H2 j4 G: F5 H4 u$ a% B" u% C$ k1 ^
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen' v2 [; q+ a0 `4 u
function to do the same job: J5 e0 U# [- }. R/ B
" M/ `1 j! L; t' E$ M' u3 W
push 00 ; OF_READ3 N' G! \; a# ^& V' h" k* r7 K
mov eax,[00656634] ; '\\.\SICE',0
6 }% J% W' g$ x9 ] push eax- X7 _4 V* L! \( G
call KERNEL32!_lopen( ?: k" M+ R6 C1 w3 S
inc eax
0 R1 y3 i# M+ v7 w* K, t jnz 00650589 ; detected
0 X* m* k+ N S; M+ Q- |: Y- j push 00 ; OF_READ
& {$ W* z# M# a5 |& D2 y mov eax,[00656638] ; '\\.\SICE'
' F/ ]2 U/ u# q0 }# i8 } push eax% t: c+ j n r+ T7 H
call KERNEL32!_lopen
$ a" z/ _. {' W' @ inc eax. ~3 A% y: a7 o9 K
jz 006505ae ; not detected
4 G: J' N f# j$ i8 I1 u9 l) i; W8 |+ R$ a& E3 \. k
" ~* o, ^( q$ \# S
__________________________________________________________________________: }* U. y' `8 g5 V; g1 |+ H1 d
! s, _8 Q( b0 Z! b, I5 LMethod 123 I! l% q' `$ g( T4 e, q/ ^
=========. Z# [+ Q7 \+ Y; R/ y, {
7 b" P" O6 m) r" j2 B
This trick is similar to int41h/4fh Debugger installation check (code 05
4 \( o) {( G: t/ W& 06) but very limited because it's only available for Win95/98 (not NT)
; z! t( i- [. m/ P) N( kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.2 k3 N7 _, `8 n: T V4 y0 R
( M7 b/ p! E" y push 0000004fh ; function 4fh# \5 M; Q) k9 q0 t9 D
push 002a002ah ; high word specifies which VxD (VWIN32)) d0 ~- F# K; g3 K1 m+ A
; low word specifies which service
; [( {) @+ x8 N- U/ i (VWIN32_Int41Dispatch)
2 ?) @, j0 v4 V1 T" u- m call Kernel32!ORD_001 ; VxdCall* v* f" N$ ^8 S# M: `
cmp ax, 0f386h ; magic number returned by system debuggers
8 l/ C5 }( W4 E! Y9 l& G" W8 R8 o jz SoftICE_detected' L* n+ p! _: o7 x, j' x
1 Y4 X8 u% Q3 W/ t, n/ D" X6 fHere again, several ways to detect it:9 ~# s: Z" h$ W U# X: f+ t- m
! i& y" ^% R% Q7 }, ~+ [: B$ z BPINT 41 if ax==4f1 v/ e; [: d% Q1 L- A% s
% ~- n0 } y/ B7 \* i
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one0 i( K/ [ ]# q7 W# a( x! R
% x T" d0 Q3 f9 V. e: e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A7 M# X! V. Q/ o: D! U& U& S: U
+ i" g+ R0 j- s0 e' q5 o
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!7 ?/ b" j; X$ ]6 Y- ]+ L3 P
1 {6 h: e- G4 D% M9 W__________________________________________________________________________8 B, M: X1 O% W1 J- Q3 O" k
* A! F- H1 B& g+ T2 ^Method 13
, I/ @6 {. y h0 @ @=========
7 v4 h b* Z/ _' u3 {
5 U# {- S3 I& {! XNot a real method of detection, but a good way to know if SoftICE is
. a8 Z$ q$ }# _4 `9 Dinstalled on a computer and to locate its installation directory. x* H: D# V1 X7 h6 {- f
It is used by few softs which access the following registry keys (usually #2) :
' U6 Y! f1 o9 Q+ I) w+ K& y: b& j1 z: H1 |% j& ?# J% V, f
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 w+ e- m7 l( F/ i6 D# q\Uninstall\SoftICE
5 G5 m( z3 X) _; @7 Q3 B y-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
9 I2 A$ {8 V" i0 L' G! ]$ M, S-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! n8 t3 |! z9 ?2 F/ g/ D
\App Paths\Loader32.Exe
' @; f( V1 J# r( ^
+ P: a* y3 n. u% `8 m, U7 f$ b" x* ]" C- e+ z: M, f% }3 X8 [
Note that some nasty apps could then erase all files from SoftICE directory
# ]0 c/ c, H* h! X0 U(I faced that once :-(
* \: h& f9 W* ^* q- F) z7 R# ]/ c. b v* y' x+ @' w) E+ [# r4 P
Useful breakpoint to detect it:
3 d+ A8 C# c3 v2 ^' |6 f1 n* v) R" e; m# R
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ ]. U# F/ J0 N( ~% e6 d1 {! H- q
# V/ D k" R$ v__________________________________________________________________________) F6 I6 s3 L' m! o- @
) b! a9 ^. U4 C( d
0 l- _2 P( ?1 p7 M& ?Method 14 0 x. j' q) [% e6 e
=========! W3 \) X5 \, p" p; F
# }( C# r7 V t% SA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 w8 O( }) W+ a8 t4 L2 | Tis to determines whether a debugger is running on your system (ring0 only).( {2 a( R4 c" @. \. E$ f
9 v' i# u) @3 X: [+ \
VMMCall Test_Debug_Installed
1 \7 j; R ]. _$ A je not_installed
/ T- x' ~! |4 e" F- ]
/ a3 X" B5 S( T% m8 N. E7 |This service just checks a flag.
' E) ]+ R- l$ g! l</PRE></TD></TR></TBODY></TABLE> |