<TABLE width=500>
0 T( @0 w0 v+ x; z( N, B8 o<TBODY>9 [' P. d& n; M2 {) y
<TR>' V- a/ Q, S& y6 f
<TD><PRE>Method 01 / B. e3 J+ \5 z
=========7 I8 i: Q' ^+ E% i7 d Q. V0 Z3 I
- u3 C4 h5 ~( Q9 DThis method of detection of SoftICE (as well as the following one) is- N1 O1 v; k9 k& X* v6 U5 E
used by the majority of packers/encryptors found on Internet., a! C+ {; U3 P, i5 V& G3 S, m
It seeks the signature of BoundsChecker in SoftICE; N$ N3 _$ Y7 b- O
% k% F% ^3 z7 W2 O5 F
mov ebp, 04243484Bh ; 'BCHK'5 c) v# l1 c# |" f$ `$ H* C
mov ax, 04h
& ^% {& `& f5 y2 U7 X int 3 V; Z* h0 |% P# P& D
cmp al,4
5 _* e! w/ G4 _6 r! V: M6 E jnz SoftICE_Detected
4 [0 ]5 K4 ^6 {! A' }; C
% H- \. }6 r& ]5 A* y* m& Y2 C2 A___________________________________________________________________________6 C0 B. \$ i) H) r
- W! f1 U# {- V/ i2 W3 ?# a4 ~Method 025 q' {9 k- m; N$ B( b
=========
$ Y. g6 H9 I, P7 \0 U" ~3 G* Z1 Q/ L2 C- {+ x
Still a method very much used (perhaps the most frequent one). It is used" c8 d7 d, X* P% {3 E" x! @
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,& ~' G+ X' S1 y- k' u, k" g# [
or execute SoftICE commands...8 |9 ~/ `) @7 ]9 C: }" t1 A. @1 s
It is also used to crash SoftICE and to force it to execute any commands P# S* H( t; {9 X! c" [( H
(HBOOT...) :-(( 5 ]( ?& W. @' a' @
! J6 `9 ^, _9 JHere is a quick description:
1 w% e3 \4 \2 v7 e" u-AX = 0910h (Display string in SIce windows)# M$ n8 }! m( R# h4 U7 k' T. G
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx). B/ K& ~9 b4 W0 L* n
-AX = 0912h (Get breakpoint infos)/ P5 z8 y; {1 i6 G( M' x9 j. J
-AX = 0913h (Set Sice breakpoints)$ s/ N% t" A5 m. ]& \! J
-AX = 0914h (Remove SIce breakoints)
# b; r) {7 U- t: K: n
# S3 `; [; u) b4 [& jEach time you'll meet this trick, you'll see:4 l X. A$ u, {# V0 N& h* H
-SI = 4647h( b7 t: {! I' }
-DI = 4A4Dh
) |6 P5 ^2 m$ j, O( S7 HWhich are the 'magic values' used by SoftIce.
; y! C) |6 I+ ~* aFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.) t4 L9 e/ ]; O7 B2 w5 Z
9 z, ?$ s; d/ ~/ {0 J, u+ m# {" {Here is one example from the file "Haspinst.exe" which is the dongle HASP- `! G2 Z* W' Q: o1 E7 I% E
Envelope utility use to protect DOS applications:' Y( J) u) Z* a3 b
" |; B! I7 s" z( P* S' u9 o& n7 q* c2 c6 ?
; v8 A: ? a( E4 K4C19:0095 MOV AX,0911 ; execute command." \* l; U+ b% L, S
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) S: g% E B# v$ B9 U# `0 h
4C19:009A MOV SI,4647 ; 1st magic value.
3 }0 O7 ]- g* |4 i1 ]; \4C19:009D MOV DI,4A4D ; 2nd magic value.: ] b( H2 B0 {
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 l7 E- x- D% I
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 @. C6 c6 h3 X/ ] E3 R' t4C19:00A4 INC CX& Z$ S9 Z9 y8 Q% H. D2 e% Y4 j, O5 Q
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; z% h3 w! [: }/ o0 Y" m4C19:00A8 JB 0095 ; 6 different commands.
9 [8 k( i/ [9 }+ x J/ K& J* s4C19:00AA JMP 0002 ; Bad_Guy jmp back.
' q. g1 y* E4 x$ k4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" N, K% N: }- _$ o, H9 R7 c$ w9 i- E; v# ?: j! G
The program will execute 6 different SIce commands located at ds:dx, which
; a1 X# @( G/ Q* c) E, z; x4 C7 Eare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 H6 n2 t: x" D: t+ z5 [5 n8 y2 J- j. @8 D1 G+ w& L/ Y- c# U& D
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.+ ~" y* c6 x& c
___________________________________________________________________________
% w+ o& s3 |, Q8 r/ m* k- A) F; m) | c, k2 c, s& j5 G% Y5 r. E
1 A: E4 Y' S2 C; }: f% [
Method 032 w: S) S1 _4 G
=========; S% v3 T/ D, @+ k L! s1 ?" v
) U0 u; l4 S- b1 N$ ]2 W
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 C, M8 b! h9 S& u9 L" f
(API Get entry point)7 `7 X' C* c) z: o
! s+ w" w1 ~4 ?$ s' g8 J" z1 E" c& n% l0 i' u/ {
xor di,di
0 L1 f4 B4 c4 { mov es,di
- s1 _2 \! [1 U4 K! p/ ? mov ax, 1684h
6 a: k% B7 w6 w+ @7 B% P$ m mov bx, 0202h ; VxD ID of winice
H* H/ j' H! l$ H3 Z- [ int 2Fh
H; z. x7 G7 ~* `! R' R mov ax, es ; ES:DI -> VxD API entry point
3 Z) E ~ X7 o( U& g! f add ax, di
6 y$ x- K' _3 H. e0 I! O test ax,ax
% u+ V0 j, l$ I% p- m jnz SoftICE_Detected
4 {' h2 Q5 s r g3 `7 q4 c& r4 x' A0 I; K8 `: T/ X) w% b
___________________________________________________________________________! _. e- ^, p2 |1 E9 M* n
' w* o5 x3 F# v- ~& n# |
Method 04
4 O! J0 i, a& V* D! _8 x3 U=========
$ ]+ R1 c! a& I" T# E7 L' ^9 C7 I9 o' A! l
Method identical to the preceding one except that it seeks the ID of SoftICE
! A2 {+ A" T0 s; SGFX VxD.
- W6 d9 h5 ~. m9 \, }' o7 t( {0 [
xor di,di2 k! S# ], |2 A, ?- k! O$ H0 f
mov es,di
) g. C1 A& G& x: o7 l$ Y/ Y5 T1 e; H mov ax, 1684h
+ R4 {8 V; W/ F: k# w, _ mov bx, 7a5Fh ; VxD ID of SIWVID" {5 l6 R3 D) ^5 { o* Y* d
int 2fh2 ^8 z0 d& {3 [5 O- V4 {
mov ax, es ; ES:DI -> VxD API entry point, e# P% l; B0 z3 Z2 X; Z% b4 ^
add ax, di5 G4 r7 J" `- l: j0 `% v
test ax,ax
1 |' ]/ i/ |: w( B6 I jnz SoftICE_Detected3 ]2 A A- v8 T- e! f) O! L3 A
8 `8 o2 T) [" ~# \4 ^" |__________________________________________________________________________
: Z+ w5 K; C6 ?7 ~! ]4 d
! [ a1 S6 t. E$ m$ ` m/ a' a, s t' n3 A
Method 05" V+ @# R# S# S* t; ]5 t
=========2 ?: [) H% T( L' g/ J
; E* x4 ] A# @
Method seeking the 'magic number' 0F386h returned (in ax) by all system# B: B5 g: F* q
debugger. It calls the int 41h, function 4Fh.) U+ _# i+ @5 ? c( c6 X
There are several alternatives. 4 J& X) c/ E. j) K/ d
- U8 C) C, @; a4 C) z9 k5 R
The following one is the simplest:9 f, Z9 a8 W |; |# U' [3 |: S) c+ z
) V* j, J9 j" m% x" C- i" F
mov ax,4fh* V# g, U l }9 p. B0 y9 e }
int 41h
]% {0 A& T A) S cmp ax, 0F386) B5 C/ P* f' L ~" R& R2 U
jz SoftICE_detected
: O0 m+ T: l8 D% S- M( o! K& B4 @( a
/ \0 V* r& G, P% p3 G4 Q- f; s
9 Y6 j& i& w' m6 w0 C |* BNext method as well as the following one are 2 examples from Stone's
. K2 a' R- M; X$ R; m" W% ~2 \"stn-wid.zip" (www.cracking.net):
7 u& G4 `- g7 q5 H! T/ }7 D/ `5 N% _ B
mov bx, cs4 R& f& V& D0 Q9 d
lea dx, int41handler22 n/ f( m. g' u z; V& d$ P
xchg dx, es:[41h*4]
5 }0 b4 I1 g0 z xchg bx, es:[41h*4+2]8 `9 \! g* j6 e# L7 B( \1 g* m
mov ax,4fh
; g. @. y$ Z& O int 41h
; k+ ~ a# F* i% l% b* W5 N5 q xchg dx, es:[41h*4]
* ^" x A9 O) @7 F, l C: J xchg bx, es:[41h*4+2]( U1 l: X2 G/ J
cmp ax, 0f386h
2 ]& d5 r4 G# r; s% r2 n jz SoftICE_detected0 ?& f1 W8 y& n
5 C1 ?3 U9 i0 P1 F- j0 H' nint41handler2 PROC
, D' z* j" v2 K6 M iret# _% L7 p% a. f8 Z
int41handler2 ENDP
6 a+ ~ s" j! J# E3 p0 p% |
1 a" D8 |9 K- y h8 |. Z; V; ]5 p8 q. F! W3 u
_________________________________________________________________________
. r3 s8 V$ q! ^1 _) G! z, X; E+ m! C* t1 v" f
; ^2 I% p8 M1 GMethod 06
& C N. S2 f6 n; E: b( t=========
+ t* @" V! N$ L! o* G+ j6 M' F2 t/ N+ j4 c- [1 t: Y: C w7 _
5 Y8 L/ F# a% g2 Z; y2nd method similar to the preceding one but more difficult to detect:2 t2 \& `- k5 e2 J& N
" v% g( b) I/ w$ [, y7 T
/ ?( V2 p# Q0 e0 T$ H4 I7 l+ x
int41handler PROC
2 Q d2 Z9 w' s# H3 f( n& B' D. F mov cl,al0 m5 j/ i# \- l: v' c+ p: V; g
iret/ @# ]( e* |" Z G- t+ C+ @
int41handler ENDP
3 N* T. I5 y9 I- e
1 F5 d; E( F2 G' ~" q! a
- o- X9 H8 V9 V xor ax,ax2 u5 \1 H2 @2 F# D
mov es,ax" _" O! m6 B0 \! [- K# Q
mov bx, cs
: |3 f0 J0 J0 U lea dx, int41handler, `8 K* Q: K% N/ U. j
xchg dx, es:[41h*4]+ }" k! {' k3 a% j7 A- l, \
xchg bx, es:[41h*4+2]
[) p, D) R8 r0 o6 a) q" N in al, 40h& e8 z8 s4 R) a1 I' M% [, p( u
xor cx,cx
6 m( s( o d; D. x: `1 m int 41h' T( C J4 g% m# H
xchg dx, es:[41h*4]
( L4 L6 S' Y- h/ v xchg bx, es:[41h*4+2]
" a/ U- b* p9 W6 ^) S) d cmp cl,al
+ B+ E# \- W3 [* L5 G* u* f jnz SoftICE_detected
0 U7 m1 i+ q4 I! E2 [: K' _
4 v0 s7 Q4 C6 i( O4 {_________________________________________________________________________/ {4 @* _$ Y4 n1 L. m1 A" L5 r- {) \
, F8 Y1 V, x& l) l
Method 07* G, U! y- w8 y
=========3 g' |" Y8 Y- p' q
5 k4 V" w, _. z- P ~0 g: O0 ^
Method of detection of the WinICE handler in the int68h (V86)
9 j7 Q* ~1 ~2 ^8 A9 ?# m$ j8 T. I
0 J& H3 ^' ]7 s8 t; _( ^ mov ah,43h
* B$ W( r9 o$ [* p: U% ^; p& j int 68h
/ T6 l I0 m) ?5 h0 Y5 G: v cmp ax,0F386h: g5 g# H% e7 e- y8 D3 g: }2 \
jz SoftICE_Detected
; ?! X7 O- P y9 ^7 e
. P6 B4 {/ n2 w# H% V
! t0 D: c3 S+ e=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! P# e' e; y5 C+ a. ?
app like this:# s! G& H' V1 z, K! ~( k1 v
( A3 c E$ A/ |) F BPX exec_int if ax==68
/ r. o3 j2 L! B# L (function called is located at byte ptr [ebp+1Dh] and client eip is
: {/ u- m) X( x- P* D# Q/ e located at [ebp+48h] for 32Bit apps)
" W0 R9 A; E5 f s9 I* ?__________________________________________________________________________
3 _# ~3 v6 q& z5 \% d0 P s) [' d- o! c
& c/ `# C2 m$ i0 R0 ?Method 08
& {- G ^/ k+ Y1 M3 w=========7 u E4 i6 e. ` G, M4 k9 n
. Z" h) u# n+ C
It is not a method of detection of SoftICE but a possibility to crash the
1 _' `! k6 Z3 l# Y5 h2 h2 @system by intercepting int 01h and int 03h and redirecting them to another" G+ |- t3 d, c$ n$ y6 }. `
routine.
5 U* P' @2 Q0 S! {: f \4 nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 G7 G3 M/ p0 r% a) oto the new routine to execute (hangs computer...)3 T2 h3 O1 h& U7 W; h3 v% }
" x3 Z: ~. Z3 v( O" Y9 t mov ah, 25h
4 k. a, T4 ~/ f, P) p9 W0 @ mov al, Int_Number (01h or 03h)& _: A! ], ?! Z. K: }. k# R) c
mov dx, offset New_Int_Routine0 T6 \: k) G9 e! A# Y% ~
int 21h+ _. A3 K* d- V' q9 C5 W, V
) J: y' Y$ S0 v1 t
__________________________________________________________________________% i# A9 T$ b( m, ?6 i' t
: j/ F0 m3 s* e, N! ~
Method 09! q9 k, o% X. J* m0 P9 J; k
=========
+ N* m. I) U3 d' u# l6 u9 H8 _ G- S! d0 Y8 F8 K0 J( {
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
4 A5 Q4 C! G9 [* Dperformed in ring0 (VxD or a ring3 app using the VxdCall)./ X/ @6 p1 U/ v1 l+ p2 v' ?0 O
The Get_DDB service is used to determine whether or not a VxD is installed! R9 t! y1 ^) X5 \9 E0 W
for the specified device and returns a Device Description Block (in ecx) for
) o, T# m* A& H, _9 t2 t& X$ _that device if it is installed.
' _( ?# C1 Y; q
8 q3 `( c0 o# Z& i' d, w! u mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID6 X' Q# r( m& S/ a# E4 a% ]
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% n0 l9 _* w9 x0 `- q/ {
VMMCall Get_DDB
+ z& I3 S' p/ d) |7 x) [ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
' E4 a3 y0 n8 Z' Y
) g, Q0 f& q7 [/ XNote as well that you can easily detect this method with SoftICE:
; C3 D2 O3 u/ U1 Z s+ } bpx Get_DDB if ax==0202 || ax==7a5fh/ D# i3 h7 R3 g9 U* E8 y+ ^
% U, F- n) E1 N- O__________________________________________________________________________
/ l6 o! Z! y* [7 ]
# ~; t# F1 s% C7 \Method 10# U- c- A/ `) p% N6 q0 H" U
=========, L2 H% K% T2 A8 l1 ]
+ `1 r8 W) N* t! o% G7 N! H
=>Disable or clear breakpoints before using this feature. DO NOT trace with
+ t5 c- A' b+ ?3 s' x! [ SoftICE while the option is enable!!
$ T2 V9 u$ Z/ m+ p4 S+ Q' j7 r
1 B5 J* v& o9 g4 }1 i" c& O# c1 h2 \This trick is very efficient:6 N* |1 @& U4 ]2 P) J; Z
by checking the Debug Registers, you can detect if SoftICE is loaded; G, S$ n: r3 c* ]0 E6 W. Y
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" N4 H, {9 H. Z# G; B3 u" g, Y+ x! othere are some memory breakpoints set (dr0 to dr3) simply by reading their0 V3 @' N, S, ? W# z( |+ r
value (in ring0 only). Values can be manipulated and or changed as well
0 O N Q( x" ~3 ^(clearing BPMs for instance)$ O: j' z. a2 c( b8 L
% }3 o& ^" I9 y8 L$ H3 o3 y
__________________________________________________________________________$ w- C5 G# y9 U- b4 A. L
0 M; M; i1 _7 R5 l2 @5 n0 ?/ E6 L
Method 11
4 J) ]! h) I2 y: y) N8 X" F: P=========4 @: A! L: z- M, n; y& p _
* q# C, J1 ]) t- U5 z
This method is most known as 'MeltICE' because it has been freely distributed- G" _. L0 k5 O. \7 `
via www.winfiles.com. However it was first used by NuMega people to allow
$ m8 F0 G! f kSymbol Loader to check if SoftICE was active or not (the code is located
4 N5 a: H% c; s( k6 A" B) ^inside nmtrans.dll).3 w6 ~$ x6 ~0 A% M
( {$ z4 K% P3 v3 c! z# h7 f) f% k
The way it works is very simple:
5 K. v( G) P+ P3 k1 B7 PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& |3 Q) Y& E/ x3 W
WinNT) with the CreateFileA API.) D2 Z3 P; e. F4 v. n3 p! W
, @3 r* D6 X/ G1 X7 ~% NHere is a sample (checking for 'SICE'):
: g" k. H& R8 U4 g4 P* m) I& s% I4 k2 T# N1 N
BOOL IsSoftIce95Loaded()$ J# o* c" t; f$ i
{, C$ g* ~% |, W5 U( K. C
HANDLE hFile;
/ c6 v) ^: V' V4 A+ B, v3 v hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
: v4 w6 q. Z% m FILE_SHARE_READ | FILE_SHARE_WRITE,
# h7 z& U! t2 C3 T NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ V) M; E: R2 ^- f h g, `+ ^" F if( hFile != INVALID_HANDLE_VALUE )
! _8 ]. Y& c" r. {# S {8 K# L) P/ Q" N, j( E8 d
CloseHandle(hFile);2 Y( s$ x. g8 p7 @
return TRUE;
& q1 Z4 a5 A4 ^6 P* e9 \ }
' @& c" s2 |0 v7 R return FALSE;
1 N$ n8 O8 e5 `$ } w}
! `) i: S4 R) V; E( J3 x9 B3 H0 _3 k$ D4 W+ P0 {7 V* c. \$ B
Although this trick calls the CreateFileA function, don't even expect to be
% m9 S" o/ Y3 L0 t/ s& y# Dable to intercept it by installing a IFS hook: it will not work, no way!
9 @1 E. L$ V6 lIn fact, after the call to CreateFileA it will get through VWIN32 0x001F! v2 F. U/ q3 F0 ~
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 S- s8 Z3 h$ g, t3 P
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
! n- d/ X7 F7 m; |field.- Z: C, ?0 r" \" G/ y! d) [8 g
In fact, its purpose is not to load/unload VxDs but only to send a : ]- t( r& k- C5 V' W8 M4 h
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE), |4 W( h; F/ W2 c3 o* |' v2 ?
to the VxD Control_Dispatch proc (how the hell a shareware soft could try& j4 _9 b, W; |
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
1 c& T5 M* ? X3 _: tIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ f; k& i4 Q8 Z9 L0 B1 rits handle to be opened and then, will be detected.3 A- T9 g7 d& _
You can check that simply by hooking Winice.exe control proc entry point
& |/ U9 D( _4 g: @! w5 lwhile running MeltICE.
2 V9 Y) g2 S4 r, e' M/ ^ q$ d% m x( a
+ o, f6 h1 T8 u" {4 T& Q+ e
00401067: push 00402025 ; \\.\SICE
, ]9 u& d$ @; R s7 U! { 0040106C: call CreateFileA: h6 b2 P- j3 y
00401071: cmp eax,-001
1 T% \) c' T9 C, I) l0 A 00401074: je 00401091# r9 e( ]6 q& y1 \7 f
; [4 L' d7 T# ~0 i/ d
+ {1 }7 W ~2 a0 {
There could be hundreds of BPX you could use to detect this trick. B$ K k$ v& m4 [7 M, T
-The most classical one is:
8 J8 z, J: n9 I' F) u BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
; n. |* y) N, q0 e8 Q *(esp->4+4)=='NTIC'
0 B3 R" @; K$ G1 O! L7 Z
6 H, U% i0 j6 A: ^5 \' u-The most exotic ones (could be very slooooow :-(
; x! A( R1 M! k& {2 h BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
5 V/ F) t/ h0 ^- Y# H ;will break 3 times :-(
4 S0 H& c. a& f0 J. `2 C1 ~, h. u! N- z* \
-or (a bit) faster:
|9 |; ?2 p0 ~& [ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
/ ^. K3 x; m# D; v/ r+ k8 H9 L- o! y4 ^( ]) {% c
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 ^3 u1 P& ^. g; x$ Z$ Q
;will break 3 times :-(
% e5 f6 y1 O6 `; [' B3 ] d- p h% d1 f8 k
-Much faster:' k3 i8 R$ H" c/ z' p
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) t, J2 v: }) J3 ~
) ?) o- n: |2 c; CNote also that some programs (like AZPR3.00) use de old 16-bit _lopen/ s2 I) L- h$ X/ l
function to do the same job:
9 [0 w; c# ^2 ^" P; i7 `2 H( O! s0 e; R$ I0 R6 e% i( G7 _ U0 x. s
push 00 ; OF_READ P5 }* c! R$ ]* f( d
mov eax,[00656634] ; '\\.\SICE',0
3 D1 Y# g Q! N1 ~( P' |! S V push eax5 {/ k# G4 s* q. r
call KERNEL32!_lopen
" ]/ _! _ k; A inc eax5 u7 n" U+ j' V+ e5 ~
jnz 00650589 ; detected' c# b2 E5 N( T: Y
push 00 ; OF_READ
1 q- y+ | ]5 T( S( W/ S mov eax,[00656638] ; '\\.\SICE'
8 h$ K. b$ A! Z; S7 S" U push eax; H0 @( v' R8 ]6 s, j9 A7 S! [
call KERNEL32!_lopen! O! }3 A: @- i- g% f4 z' Z7 }6 b
inc eax
. a# e' _: S8 [( ~ G4 x jz 006505ae ; not detected
0 M: Z4 Y5 N& s+ H9 ^2 `7 u0 v$ h* }
[) W: S0 u5 h' E8 e
__________________________________________________________________________9 i" X. _& A) l9 y0 v4 N% U
6 i5 Z& z" j) sMethod 12- J3 S8 l0 l* ?5 y7 ]8 _: v
=========
% g7 I8 A2 w* L/ K: D" Y: C Z/ ], W8 g
This trick is similar to int41h/4fh Debugger installation check (code 05
- L' U; ]: K* U# [5 M* o& 06) but very limited because it's only available for Win95/98 (not NT), g- |/ C; L7 \+ ~$ R
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* @* V5 K8 g3 w
0 U% U, U9 m4 J; M push 0000004fh ; function 4fh4 C0 s; l" r( Q2 Z) x
push 002a002ah ; high word specifies which VxD (VWIN32)5 _1 ^3 Q* c9 k
; low word specifies which service
$ [1 k. U; q& f (VWIN32_Int41Dispatch)
! \' i6 v3 _4 b0 a call Kernel32!ORD_001 ; VxdCall
9 x( S: ~* g/ a( o A4 g& U) F cmp ax, 0f386h ; magic number returned by system debuggers
. K" b7 i- f5 |* r4 w jz SoftICE_detected( z% l- @) o" M
' C7 } Q8 s3 D0 t0 |) z1 A9 T
Here again, several ways to detect it:! h) R! J7 @2 \& I" Z
. T2 x6 ^7 e P4 _. W BPINT 41 if ax==4f" u8 i5 a4 y& S0 G: i
! F5 S! Q2 Z9 J BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 L# }+ _& N" x6 L( u3 f X! p
. F8 j0 d: J! q7 d& u. W BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. ^0 s* S' e* F; y2 n$ `3 b V- J$ {
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 O& z/ W$ |4 K" H( l+ `% ^
3 q5 f/ B( G! U9 a__________________________________________________________________________- v8 J% o' ^% X! f8 G7 Z5 b
( {' o" Y. ~/ \- y) |
Method 13
* s" z n2 u0 p1 F7 |* ^=========
2 s1 m- ]. o" n- g$ q
6 Q* F2 Q) P$ m$ f# WNot a real method of detection, but a good way to know if SoftICE is
2 n; \. P! Z l' R7 e- P c! vinstalled on a computer and to locate its installation directory.
8 a( ]& R8 ~/ `: [3 B! m8 UIt is used by few softs which access the following registry keys (usually #2) : U: {* ]$ X3 X, E0 S* B: M
% p% f! s. d) x/ m) u. _. X% {: x
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' z- k9 `- e8 k" [3 m\Uninstall\SoftICE
' {, U) L( G. U2 L-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- h& e/ N5 a! m3 k- N. I9 w-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; o( E# k0 c, ~. t; g1 P
\App Paths\Loader32.Exe
8 w/ E% ]9 F7 ]6 |. h9 L) A
- v, H' w* [+ ?# I/ C5 ?& n
. ~, P( L' ? Y$ c8 t0 JNote that some nasty apps could then erase all files from SoftICE directory
$ p! G7 o# A* K: G(I faced that once :-(+ C0 Z/ ^9 f& T9 g9 D% D# T
. m: z' \" v$ GUseful breakpoint to detect it:( f7 @. l4 m3 h
3 V, B( |9 S4 H! j9 x
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'6 h) Q3 L+ b# D7 ~7 f- V
& D$ C7 Y8 A0 i$ [* J2 U__________________________________________________________________________
6 V8 e: z7 y7 Z: q) m2 z, Z) X9 h% w/ g/ \7 A0 X; d9 T
z* e0 Z& U5 Z1 Y( pMethod 14
G- [* }8 I: V3 |6 f=========
% `+ d9 J g4 S5 L& d8 Q7 E3 A( ?" u
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 h" c2 ]& R/ v0 {
is to determines whether a debugger is running on your system (ring0 only). l" {( C: Q! k* p
@8 m) O: \8 d: m4 `0 P; R2 ~ VMMCall Test_Debug_Installed: A1 `6 e1 b9 p4 {$ d8 C* n
je not_installed ?4 a4 W4 T: g9 \
/ I7 \2 Z, g5 t- m& P) Q4 GThis service just checks a flag." Q9 h& N( v( _7 _9 k3 ^" p$ j. [
</PRE></TD></TR></TBODY></TABLE> |