<TABLE width=500>
% H \) X% g' ~3 a+ P5 \& v H Y. t<TBODY>1 j3 D e2 L6 x+ r
<TR>
9 ?9 T6 j, n# Z! f. Z0 w<TD><PRE>Method 01
7 ^. d" x* q7 x" N=========
8 v4 [' \- N. o" R( j" K- m* L0 `7 N( J! I8 s9 m" I& j8 w
This method of detection of SoftICE (as well as the following one) is
: a3 \3 a5 i+ ^6 xused by the majority of packers/encryptors found on Internet.
/ M* ]7 E) C, d1 w0 wIt seeks the signature of BoundsChecker in SoftICE9 O' R1 S/ ]4 H$ L& P4 }4 ]6 F
# z* O9 N% W; j2 o mov ebp, 04243484Bh ; 'BCHK'7 ^5 U1 U+ k [, h) p/ G
mov ax, 04h
- G1 _; N5 d4 \( N/ r, t int 3
8 Q" Z6 O! y7 U cmp al,4
3 Z: R+ u, Y/ S jnz SoftICE_Detected
) `. G# X2 F( I1 r+ Q
! Y( D- T" m& u6 `___________________________________________________________________________ S* Y. m& {% r7 C K) R: h) C
& \. W/ A, h) [( }) S, pMethod 022 k3 _" X6 n, x8 z9 k) ?
=========. R9 T( d- U o' x/ M; w- h
1 L/ [% i, w8 g4 U& v z! EStill a method very much used (perhaps the most frequent one). It is used+ v3 c2 P- A9 T, j8 _3 ]
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
3 Q9 X5 }+ h9 D# [+ ror execute SoftICE commands...
+ y/ L1 ^7 @! R7 Y- S; \5 P$ ?; CIt is also used to crash SoftICE and to force it to execute any commands6 T' a! k) o* K% w, `! h
(HBOOT...) :-((
* W4 S F8 [% e) x0 ?1 M
6 K& Q8 i1 k( H. p. j7 v* s: ~7 I/ o& sHere is a quick description:0 W) c8 E. n* T8 ~+ ~
-AX = 0910h (Display string in SIce windows). a. t0 n- M9 Y1 i# O/ y- ?$ ^1 g
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 X3 I0 J. h5 X, E$ @; a-AX = 0912h (Get breakpoint infos)
5 n( T; b( [4 k3 P2 t-AX = 0913h (Set Sice breakpoints)7 {$ b: r; b1 f; s( N
-AX = 0914h (Remove SIce breakoints), T+ f/ w/ `: k4 o
+ ^1 _5 q7 G1 r/ J; X5 z+ z
Each time you'll meet this trick, you'll see:8 Y/ ~* c+ ?0 H% `9 B/ x5 S+ r
-SI = 4647h2 @) f" s6 |) b* T! F8 Y& j$ @
-DI = 4A4Dh5 b+ z! W6 h; X ]6 f
Which are the 'magic values' used by SoftIce.0 \. g- R) ^9 l& Y+ X
For more informations, see "Ralf Brown Interrupt list" chapter int 03h., J8 {) C9 l, y4 s' D! W O( y
5 V: `) p( k. GHere is one example from the file "Haspinst.exe" which is the dongle HASP' s' |; i4 [2 A" H8 z
Envelope utility use to protect DOS applications:6 a3 o! m9 N+ l
$ i; n& C" I6 I6 V" s" ?
. s$ }; w2 _' E" m5 P( q0 d
4C19:0095 MOV AX,0911 ; execute command.
* O, j7 @ |7 }6 J4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
: r0 Y2 w [7 w5 {4C19:009A MOV SI,4647 ; 1st magic value.
3 ^" b* W' h2 h$ h8 ^/ j4 H. L4C19:009D MOV DI,4A4D ; 2nd magic value.& H! x. D4 d7 M% {+ b
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)" n3 @: I8 a, j% T+ K. y
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% z; {0 a, E: H. q! N; G
4C19:00A4 INC CX
7 r) `1 F7 x) Z$ } c4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 y1 T, G% \4 m% t% t' r4C19:00A8 JB 0095 ; 6 different commands.
$ r+ f6 N4 p- @' @4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ H3 q( G; X& {& p) c0 \
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& {% Y- o0 B" ?3 m: ], g1 T6 v3 \) `) M9 t( o
The program will execute 6 different SIce commands located at ds:dx, which
: {7 M# B' l) d0 F& sare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 v, e' X$ b) D. p# M% h4 }' M1 K
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 Q" W7 m' \7 N# M N z
___________________________________________________________________________4 x H9 d" Z7 q" X7 I
+ f' |4 m& I o* O+ ^: D7 f5 n! G
- {) ]6 `8 w2 _7 Y y9 ]: h+ G0 N
Method 03
; S w4 O. o6 u9 r7 ` k=========
$ ?: O; Y% K! u- @ y! i N& b. L$ Y2 G5 r
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 |8 |' p8 D6 K W) {(API Get entry point)
) C. q" C& a6 D& o
! k& T! W* N2 U0 j$ Z
( A" w" x& B6 S xor di,di
1 N) a8 h5 G1 Q4 y+ e mov es,di
! T! p5 a: U( Y" v mov ax, 1684h
D' o: n! Q3 P- h) q, R4 N$ U% A mov bx, 0202h ; VxD ID of winice1 o `7 o4 [. ^5 n [1 Z
int 2Fh" m1 B8 K' j5 ~1 k; A3 w
mov ax, es ; ES:DI -> VxD API entry point0 Y" q( j( K6 j. Y
add ax, di, o. `$ Y% c9 ?7 N' w
test ax,ax. `% ?5 `; C& Y+ I! [5 K* r0 J3 V
jnz SoftICE_Detected
+ {) e: v: D2 S
% `8 d" [1 y: C+ B___________________________________________________________________________
2 N3 F# Z! b7 E) @
" u/ s: e& x4 cMethod 04# m5 [3 f; m& O! ]0 t
=========7 D! C+ t1 m! A L; j! [
* N+ i+ O/ i" z' C9 H, H! tMethod identical to the preceding one except that it seeks the ID of SoftICE
- \* p/ d+ d S3 dGFX VxD.
* g% N! ], h# s( o1 L4 I5 p3 c ?, z" D. w
xor di,di
1 d* K. X& {9 P; ~: L6 j mov es,di
6 T6 _3 g. k; w' y! U$ @% v mov ax, 1684h - B9 Q# ]8 O; n/ ~% |9 L9 \1 s
mov bx, 7a5Fh ; VxD ID of SIWVID
. R4 y0 M! M3 _7 g1 E! p* ` int 2fh$ _, O: k4 M9 {) |
mov ax, es ; ES:DI -> VxD API entry point/ S7 P6 C% P' z" P) C$ S
add ax, di
2 P9 c* o1 g$ p) d- n [ test ax,ax' e4 I* Z% F1 T5 b% d. `; q
jnz SoftICE_Detected
s" u2 d1 K3 ]. Q
: O3 x' ^, Z* C# \9 [__________________________________________________________________________. Y& g3 \3 z$ K
5 G. B2 M9 x6 o' M$ Z7 H N: g) |% t, e, z
Method 05
/ k% l- \) {/ ^2 x=========9 A7 N1 }2 ^7 h Y
6 F2 {* N( w0 x9 I/ t# C! L0 h) x* n5 L
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ C, }) {/ Z* b. } z
debugger. It calls the int 41h, function 4Fh." S2 W# E9 k9 T. t: f
There are several alternatives.
/ H4 \" V, d- Q, Y. B# M3 Q& [* X! n; R! ]3 k4 O
The following one is the simplest:! w( K2 P) Z( Z% p0 d
8 A' n) v T. {- O0 l, c. b$ B
mov ax,4fh
! i, v+ o' b8 D- z) X6 V6 h/ T int 41h8 L3 @8 n8 F: b+ l5 l' M- G& Q
cmp ax, 0F386: c9 C+ g0 S$ Z' \
jz SoftICE_detected: P% k) v0 }/ M$ c* j' b- ]
0 e$ A4 X/ z0 p2 c! }7 }2 w) s
% B3 E: t6 ~; ~% aNext method as well as the following one are 2 examples from Stone's
' ~. b. D8 h0 G3 z8 R: I# f"stn-wid.zip" (www.cracking.net):: Q n6 X* ]0 V" E: h4 R
`4 u# T) B" v2 R, [& j! u mov bx, cs
( |: ]% r7 ^6 e' c- |: W lea dx, int41handler2
6 ]' ^8 F# B/ A) b0 Z xchg dx, es:[41h*4]
% X& F, R- C0 H1 x xchg bx, es:[41h*4+2]
6 A, p8 N5 i! @0 m4 s& J mov ax,4fh
5 F! T; i& G9 z- L int 41h
. @: M) O) y: ]0 ^, Y/ R xchg dx, es:[41h*4]4 V7 ]$ r) G' |6 h6 D& S
xchg bx, es:[41h*4+2]" S! p8 `7 F6 M) l3 H1 g
cmp ax, 0f386h
) c9 e; D* w; a jz SoftICE_detected( T9 Z( W* k( U. ?, a" V" _
7 }5 Y3 X; Y6 {: T7 Yint41handler2 PROC
% b4 z/ e4 p( ^ iret3 Z- b' n* [- d- c; S! j
int41handler2 ENDP
/ i: t( Y4 [. L8 ^& W6 x0 y
9 V' e; [3 w/ V# Q- k1 U/ w
0 ]; j O: C0 a9 _) c_________________________________________________________________________* W* E! k) t5 R- G9 q" h; g+ f6 I
4 t# @2 b% N0 o3 g
- {4 q ~% M8 I$ `( L0 hMethod 061 n c5 g3 ], E; a+ P6 @9 f
=========
# [' { U6 N6 E2 V& g2 [& A# y, r( X4 i. V: t
$ l( p0 ?5 D- c. C/ C L2nd method similar to the preceding one but more difficult to detect:
9 R6 f% X# q) {7 r! R% s5 X
8 X" F9 X6 p1 G1 y$ p2 S6 x3 o# H
, \) i7 _6 Y1 a, y8 qint41handler PROC
) q z$ S1 r: ^+ i) | mov cl,al; j' w C' d$ _! X
iret
4 |8 m* c k$ N+ D/ }int41handler ENDP
; |& @5 s# i# L
/ C- ^: C v; }8 m. {3 f& E2 a% I. B
xor ax,ax) F+ w4 X! `6 p" d
mov es,ax
3 T4 y/ c" e) z2 | C' j# s" D; z mov bx, cs o7 C% T8 R5 Y0 n7 b" P+ t
lea dx, int41handler
4 s: G/ t$ d, S: X1 U0 b xchg dx, es:[41h*4]# j- G1 ]5 U/ F% W) N' U
xchg bx, es:[41h*4+2]
5 L1 L+ z! r& D. g in al, 40h
( q4 K: P2 `& R) c: J) Q xor cx,cx$ Y$ g! u$ D% N$ a; ^3 A. z
int 41h6 ~2 P5 ~+ G: L# G9 b1 [$ r7 | I
xchg dx, es:[41h*4]
! |: Q" o4 c. m G; g6 [ H: H: ` xchg bx, es:[41h*4+2]# \, r7 [8 h1 ~2 N" b- z6 I# S
cmp cl,al
3 U1 F$ u9 @# F5 @, z jnz SoftICE_detected% G H4 m6 k3 o
/ [: k0 w& J# p) y$ \) Z1 S
_________________________________________________________________________
% c F3 Y' U0 Z9 Z' b# B
: B7 q" C" R- G$ P" mMethod 07
: b8 [- ]; S$ ]6 o" B9 ]1 B=========8 S6 ` m* O0 G9 I
4 T5 R- d/ |$ e9 U
Method of detection of the WinICE handler in the int68h (V86)6 t7 [8 @5 \- ~. m( u% \
% ?% }- F9 i1 G, r+ y' P8 q
mov ah,43h r3 Z& O6 m% H! o4 }
int 68h U. j$ T! R. K. N
cmp ax,0F386h
# W/ M$ s, e; b! D4 M, C4 G jz SoftICE_Detected- E4 S5 L1 _4 D3 k+ B5 o
! k* r1 B( b3 A3 G2 t$ A9 {1 `7 H1 @8 g
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
5 i$ B+ R% ?3 i3 S% C ?% f/ i app like this:
7 r: m# P y: i. C; j7 C7 u
# t# }6 I+ P! M8 u/ b BPX exec_int if ax==684 }% H- Z( [" }& c3 T2 ]6 s
(function called is located at byte ptr [ebp+1Dh] and client eip is, U' p- @9 X0 K' G5 s
located at [ebp+48h] for 32Bit apps)
7 C+ G4 H8 y' u+ x__________________________________________________________________________
! z- E5 N: @5 j' S- w& J9 K! `' G, j$ G
" D9 ]3 a/ ` x; G+ S" @Method 08
1 ^: x2 @! _* b5 |=========7 Q+ P9 d1 q3 y* k
; ~' v" k( h0 r8 ~. }8 b0 K8 JIt is not a method of detection of SoftICE but a possibility to crash the
2 R$ x6 b* ?1 K5 @. U' Z5 X& W% M- usystem by intercepting int 01h and int 03h and redirecting them to another, J" w; b" n1 @4 \+ \8 ^: m
routine.! _$ Q; k$ e. j5 H$ W! t* P! ?- d
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" r# |9 t! T3 e9 }
to the new routine to execute (hangs computer...)
7 x& S& m# R7 a
" x. ?* s: C: G' V2 p mov ah, 25h
2 L A# x5 C% } mov al, Int_Number (01h or 03h)5 N8 b& |% [" J: G- [5 k) H, z
mov dx, offset New_Int_Routine
' @4 [9 f1 S! y0 Z int 21h2 I! `, T, A! V( o
3 D& _, T7 J2 V6 L* ~__________________________________________________________________________
$ N5 n' U1 I% B( R7 F$ _1 ^8 O
" H: G& \0 S P6 `Method 09/ n' G: h! Q! h, m" E& @% a
=========
$ K5 p3 u/ }7 I8 i% S
/ c; p* H/ ]: c/ C- {% IThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& u& v/ O+ I3 D! I3 Q3 |
performed in ring0 (VxD or a ring3 app using the VxdCall)./ Q d6 g9 ]+ b2 R, {( F
The Get_DDB service is used to determine whether or not a VxD is installed6 @; i' ]7 m( G) w z. B
for the specified device and returns a Device Description Block (in ecx) for2 U3 l7 Y6 y9 M" e
that device if it is installed.
1 |" m @# k- O, c/ Z% o7 i# Y6 t7 q" O! S- i \0 h
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 F0 B8 ]; }6 |
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: C+ m+ m) }5 D. f' v( a VMMCall Get_DDB' l4 L, w5 @& Y7 o9 ^
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ t7 P, l. M) W4 [; Y) O y( }, G
( d2 }( F x. n* G& G* `; k$ rNote as well that you can easily detect this method with SoftICE:
; P7 r) V2 E$ f, e* L* N bpx Get_DDB if ax==0202 || ax==7a5fh
/ x; t9 Q: O, h. {+ @# p& X0 C
5 z3 p, h% J5 i+ t% I$ k__________________________________________________________________________4 ?( ^* I# c Y1 e( h9 _
+ h6 g+ J3 j: f. JMethod 106 A, X, c) e: {1 B- ^( A
=========
6 n2 L5 e: c, ^6 ^( N* r! H2 [' D( h" `, E0 `
=>Disable or clear breakpoints before using this feature. DO NOT trace with B; A% N- T5 B! `7 P% W) y) i3 z8 u& Q
SoftICE while the option is enable!!
0 v9 t; w, ^* D- G1 G
. f: Y/ ]/ b) l4 X! c( J$ g RThis trick is very efficient:1 B8 e( B* E; F
by checking the Debug Registers, you can detect if SoftICE is loaded
# U r3 m ?# Z* s7 i: O(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ _2 d1 I) @* ?. R" D; ^5 Wthere are some memory breakpoints set (dr0 to dr3) simply by reading their; A6 c3 D( s; T& ]* ], n# j8 I" @
value (in ring0 only). Values can be manipulated and or changed as well+ k: r7 J+ G' l+ T: Z, h0 B
(clearing BPMs for instance)8 a9 ]" I1 j, x( _
6 r! A- `- c/ a2 Z$ h3 ]6 ~: m o" G
__________________________________________________________________________
) a4 ?" H8 ]: x! X0 }- H* j
9 V% |9 f0 G; h0 D4 pMethod 11
7 j8 Z! W* U6 W9 Z* l$ O=========+ Y, V5 P# `' T& r a# A0 V
: S3 C$ J) u. D, WThis method is most known as 'MeltICE' because it has been freely distributed' I7 P- K) X% g& g
via www.winfiles.com. However it was first used by NuMega people to allow W0 }- `9 \. h( v- a! r/ r
Symbol Loader to check if SoftICE was active or not (the code is located
0 _. n1 g! O* K; J' \! binside nmtrans.dll).+ @7 L( G' l0 E, m+ @" B0 `" u" W
. A3 G8 U. P. |8 E- P" |# ^. z6 oThe way it works is very simple:1 T1 q0 X% ^9 M- D5 Y( K
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 w+ H/ B- `/ m C4 J8 y
WinNT) with the CreateFileA API.* p1 ]( h1 G2 ?
6 ~+ ^) z7 o# J! _5 X( z
Here is a sample (checking for 'SICE'):8 V) X1 ]8 }3 `4 m/ \4 e
. ?, {7 @( ?1 a5 l% {" [4 WBOOL IsSoftIce95Loaded()
8 l) r$ n( w/ o{1 _* ~! N3 y5 {) {6 n
HANDLE hFile;
0 U8 e, h" w: s! }' q7 Q hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 f0 A, Z' ^2 W/ l
FILE_SHARE_READ | FILE_SHARE_WRITE,
' D, A2 U5 T6 K: h7 ?' A* ~ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ M0 R2 [" I, {6 Q. M if( hFile != INVALID_HANDLE_VALUE )
8 G* H6 k( _6 G% } {5 X7 z, m2 [$ Q& B. o
CloseHandle(hFile);
" h( H% r2 L$ S( A0 i. Z return TRUE;
$ }# R T* F" m* A3 N& r7 f }$ {6 j l8 C, _0 P
return FALSE;( B6 u+ V& S7 F/ Z3 z
}
: C7 ^8 p. W D" q+ f% T5 u9 y( B6 }) W- C
Although this trick calls the CreateFileA function, don't even expect to be: J' ~; l; ^2 L
able to intercept it by installing a IFS hook: it will not work, no way!7 M5 ~4 }; a" P7 {2 d5 w2 a
In fact, after the call to CreateFileA it will get through VWIN32 0x001F7 \& ~* t: Y% I1 Y# f
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 @( ?+ b1 k/ I1 D
and then browse the DDB list until it find the VxD and its DDB_Control_Proc I1 U; G9 J, r" q) @$ @- `/ f
field.
# r* _# D. u5 N; d4 I0 `In fact, its purpose is not to load/unload VxDs but only to send a
) F- `# k" ?7 {7 F: tW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). |5 p3 I. q% @4 B3 C5 \3 t
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 k# e/ t' a' S% Q7 L5 y7 E7 a+ vto load/unload a non-dynamically loadable driver such as SoftICE ;-)." O0 D. _- u( V: X- t' W
If the VxD is loaded, it will always clear eax and the Carry flag to allow) ~8 M; ~: s- X9 u2 F8 C: @
its handle to be opened and then, will be detected.9 `# P* p$ Y* S$ o: ^
You can check that simply by hooking Winice.exe control proc entry point' | _+ n' C9 i: p' w$ D
while running MeltICE.
! I8 a3 K5 ^2 P: y8 c- E5 D( U* y6 _2 l$ F, \% A- H% D" V
|: d" x' O( x" _% Y 00401067: push 00402025 ; \\.\SICE
1 d6 y' H: X3 i6 ^ 0040106C: call CreateFileA1 B1 Q) o1 |% a5 _
00401071: cmp eax,-001
9 \0 }9 ~6 {0 V1 U, e 00401074: je 00401091
6 k+ L" f4 U8 [ J, W; i; M. s( b6 i" i5 |. E7 j' ?
* N) ]3 S1 y6 E; j2 L* ]There could be hundreds of BPX you could use to detect this trick. } B% O7 N4 H, {- u( @
-The most classical one is:2 v5 b0 i" |2 t' M1 ~( e
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 K$ r& \& ]- _' @+ e *(esp->4+4)=='NTIC'+ S" y! V: g5 [$ f0 d
# G# x: P- }' v* c-The most exotic ones (could be very slooooow :-(
% [8 X) ^- c* h0 \* j4 c) O BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 3 e' S( X6 P1 ~$ A5 Z* K" R
;will break 3 times :-(
/ E: }$ V# \/ r" E$ g* ?6 i4 S2 e, L
-or (a bit) faster:
4 @7 s( ?% I8 v) D BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
; z+ P- C1 X& Z, k
5 p. Y+ n3 t" y BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
/ x& `0 l8 ~3 H- @- h1 P6 q ;will break 3 times :-(1 \6 Z& g! Q8 _/ W( t4 e, F
+ Y1 a7 u5 U/ n-Much faster:5 H7 u8 K& F, N9 C! `5 p s2 W) n% F1 t
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ u1 u# w' N; _
( u8 y7 y, O, }" B2 q" {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 V+ y3 e* k& L# v, tfunction to do the same job:
8 \: d9 O- s# d9 [" G2 U/ X5 Y, y
2 q$ y6 p$ e: b push 00 ; OF_READ, P& N J9 `9 ^
mov eax,[00656634] ; '\\.\SICE',0
3 X W; _7 R: J6 I6 [: E! x" h push eax- K) Y8 m" c) l3 s9 n, l- c
call KERNEL32!_lopen
8 J9 g$ U$ j3 N9 i inc eax
( t/ [' v: [- w6 y# a jnz 00650589 ; detected) @( F* w- v, J: n& i- P' ?
push 00 ; OF_READ
" ]& w% ?+ M) J mov eax,[00656638] ; '\\.\SICE'$ j4 F8 J# X* q, S6 j
push eax* `7 t! G6 w% Q" L7 }0 k5 |
call KERNEL32!_lopen
! S! M4 @* G* b' H inc eax# H2 L5 u9 M7 i3 y& G6 r
jz 006505ae ; not detected
% i/ Q9 w8 N$ H5 D, V6 }! G9 ?( T) N. y, a: V: M1 Q
/ J" _7 j2 u* k__________________________________________________________________________1 U% W$ j5 f$ T4 N( ]
# Q7 w* z& Y# R% R2 ~2 }& G6 |Method 12
( ~5 ^* I3 s6 D. b7 ^% a' g=========
3 d/ @1 `/ F8 e, y6 X+ ?* t& w! h+ j6 [% v5 Q
This trick is similar to int41h/4fh Debugger installation check (code 05
/ Z; }3 i" Y h8 F0 e2 ?1 j& 06) but very limited because it's only available for Win95/98 (not NT)- t- u- t ]- c7 f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.! ^/ }' b: @, P9 L/ s) s
! h* ^. l( C! h
push 0000004fh ; function 4fh
( \6 N3 c O) n: I' L/ T% V push 002a002ah ; high word specifies which VxD (VWIN32)/ [: o; z& ?1 c
; low word specifies which service
$ `" Q( b0 h' t (VWIN32_Int41Dispatch)
& l4 u. ]" L( d# E/ l& s call Kernel32!ORD_001 ; VxdCall) d+ G" n5 n, d9 N" L; v
cmp ax, 0f386h ; magic number returned by system debuggers/ D5 |/ M% r0 u" m' {
jz SoftICE_detected6 d/ B% Z3 b) M' X/ u
6 [4 Q) A5 e- {% @/ Q
Here again, several ways to detect it:/ x* W6 P- y! r
, b6 G$ L6 B) T9 Q
BPINT 41 if ax==4f. z/ ~! `% Z' r4 {5 V0 _, t
; i8 @+ M! d: B BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 @4 x) M, C P5 {% K, ~2 ^3 b! |7 p) T9 Y
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A* @+ c# F9 i1 l; F$ |" l! B3 e) Q7 ^
1 E2 j0 b g' O( i BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!4 L( ]6 O- ~$ g E# a6 L9 }8 q! q1 D
0 H& B& Q, F# d9 S9 e" d; V__________________________________________________________________________
/ p/ w, E! o8 X& K8 f
7 o/ B" v; M4 rMethod 13
" h/ D; g* u' O=========- ^/ c H& ]' u& S) ?9 a
* r! B$ S" a7 s' bNot a real method of detection, but a good way to know if SoftICE is% l; v" s% J; C. Q' C/ f0 l- w
installed on a computer and to locate its installation directory.' I0 }! k- |$ B6 }
It is used by few softs which access the following registry keys (usually #2) :
4 @% f4 R, Y; A! ]
; W3 w3 @& ~3 V* Y6 l3 n; m/ j-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 {; i+ h+ Z% q& G. t1 }* [
\Uninstall\SoftICE
5 s1 `' q1 ?$ P' h# a4 S-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ c7 Q! l# _' |! r( s-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 ~4 ]% G2 q$ N/ }; \) D7 g
\App Paths\Loader32.Exe
: V# t) \& n+ F5 Y t
- S6 d* G! F% a2 t2 X" }
3 y: R( y9 C( u2 M* O e/ [Note that some nasty apps could then erase all files from SoftICE directory/ H# v* I6 k( j
(I faced that once :-(
$ u9 \: x! k1 r5 `! | @( w+ \+ n8 M0 S. P! `
Useful breakpoint to detect it:
7 w+ u% X6 D1 P" S( A* n( Z- b z, V. y! ?8 E' y$ \6 t' P
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE') v4 H! b: m% I7 U, S% u' r# Y
( e0 x$ \& v- e+ I' O; ~! W__________________________________________________________________________ S8 X1 ~2 S; l) n
" o& R( t0 T) `! ~* v: }
& ^: S# J( \3 f) {1 ^" O& jMethod 14
! S9 |! w0 C G. D; |" M# l=========5 S4 R6 @6 ~0 [& V
. f9 G; z ^1 D! I0 wA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose' L5 e& o! q1 M! u7 t( v" U4 S9 M4 K
is to determines whether a debugger is running on your system (ring0 only)./ q |) p9 h8 O# C! n( I+ i4 o
8 h; j5 L. N% O, c$ D( P: z3 x" X2 R- A
VMMCall Test_Debug_Installed
9 n' l/ `: I8 o2 Q je not_installed- W( {: Y, ?, s7 E1 h& t% K9 C8 x
' G& C0 c9 a* a9 xThis service just checks a flag.
6 j% g, p) B1 Q</PRE></TD></TR></TBODY></TABLE> |