<TABLE width=500>7 u7 ~5 K& @3 V3 C% ` n8 \
<TBODY>
) w1 p' u: d G& D. N) d' t<TR>
4 G4 x3 S( ?+ b$ @<TD><PRE>Method 01 ' K' M2 ^- ]" |( K4 U
=========5 W. ?* Y6 K; ~6 u: X' E5 M$ [
! Q+ O% b) u: }, H' eThis method of detection of SoftICE (as well as the following one) is
6 A- w( \. `2 l! ~used by the majority of packers/encryptors found on Internet.' v& \5 p! l6 Y* G
It seeks the signature of BoundsChecker in SoftICE
* ]9 w# @ g& B" I
5 n$ c0 B1 J7 [$ E0 ?* h mov ebp, 04243484Bh ; 'BCHK'
+ S+ M* n9 ~7 I5 |' j mov ax, 04h
5 I) x# E, i c" A' X+ n- N _ int 3 , k: X* @6 f! v" I
cmp al,4& e2 J* O4 N5 b) n
jnz SoftICE_Detected, T# x2 Y0 Y9 r/ n8 z6 i
7 k1 Z2 N" a2 B___________________________________________________________________________
% H) x8 m; d8 [: z6 P
7 i' b- s8 @+ b2 s# Z( IMethod 02
3 c9 l4 m# X1 g( g S=========; r8 h0 p1 N# q- ]9 [9 s' j* R
0 _) P' b3 }8 C" B3 v
Still a method very much used (perhaps the most frequent one). It is used' G' w! I+ \3 m+ L1 d
to get SoftICE 'Back Door commands' which gives infos on Breakpoints, @6 G8 Y7 z% r q$ N
or execute SoftICE commands...+ P% M x, J% O3 a8 L' [
It is also used to crash SoftICE and to force it to execute any commands
- c! f/ B) d& s! `. v(HBOOT...) :-(( + s( w8 A4 G' [7 `, G- \
+ {- d2 ^) s" ?3 m+ o* v, [Here is a quick description:
* c! @& p$ T/ u. B-AX = 0910h (Display string in SIce windows)
( p- w4 I5 q& Y; M+ R6 V1 W# W-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
( C1 R" J; ]: W6 w. f. X9 U-AX = 0912h (Get breakpoint infos)
' V1 \$ ?, C. D% H0 q# l5 q-AX = 0913h (Set Sice breakpoints)& G5 V ^, I- w% n& ~
-AX = 0914h (Remove SIce breakoints)
1 c- Z, ^# w( b4 K' C. N! i3 K9 ^$ j9 b! r
Each time you'll meet this trick, you'll see:
2 l m8 u& J1 y& Z. Q-SI = 4647h9 C# P9 ]% F" C, v
-DI = 4A4Dh
1 [2 I; n' ~5 Z$ V' LWhich are the 'magic values' used by SoftIce.
( m; o0 I" ~6 G R, k* WFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
m9 D/ n( d; D* I0 }! s7 ]. d# O4 W* M0 U7 [
Here is one example from the file "Haspinst.exe" which is the dongle HASP8 {: x% J( m9 k( `% h( X- B: O1 c
Envelope utility use to protect DOS applications:
* e* W+ L9 h- b& }4 J7 @* T' I3 ^; r
2 r6 n. [& C" S8 c( }# `# S' c" Y# ?$ x3 z2 [
4C19:0095 MOV AX,0911 ; execute command.
_% `3 U( t8 F( W i0 s/ Y; d4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)./ X" [0 c! T9 V9 X% `5 L, C" H6 x9 s/ y
4C19:009A MOV SI,4647 ; 1st magic value.
" \. D, a0 U- s& N, J3 h3 X* w9 q) Z/ W4C19:009D MOV DI,4A4D ; 2nd magic value.2 T9 z0 n# T/ K/ d
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: u) }, L. F$ D) @% D# V4 j4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, \( |" u |$ V8 |4C19:00A4 INC CX
" x- i. w7 L: I! w" H7 l4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" F. _% K7 S/ v' t; I
4C19:00A8 JB 0095 ; 6 different commands.5 h, I/ h* S# S9 N/ q* Q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* o( T/ j3 i( r6 M( Z5 M$ e4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ \: C: Y( a1 X* f0 v+ h7 k7 N( b1 `6 R1 Y* q* P4 Z; K) X( A
The program will execute 6 different SIce commands located at ds:dx, which
: L2 y d7 f, f1 ^6 Gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: n- @8 U* T: M8 w5 f
. U& g+ `( O" C* W' D" _/ X* I
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.# }$ G# s, Y( _
___________________________________________________________________________
! c" U( p+ x1 K, t( H6 d6 H
7 ]& u1 e0 m% ^3 q3 m+ ~/ w) }+ D
Method 03
+ ?- E. K4 A" _+ G/ J/ g=========6 j1 @; S! V8 b$ ]4 T$ [- L) g
( b2 H8 \: A% o) [ ?; }Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
6 P# n* s4 j) ~' e- {! |- `0 U(API Get entry point)
, [! ~$ V2 L! p2 Y: ?) N o
& i K% R. Q2 i V$ f/ J
% U3 C7 Z. p( |& _8 ?) {8 B% D xor di,di5 F+ `, N8 E" m9 D$ _4 Z. s: p
mov es,di7 M' N: ]) [$ g7 C6 \ {/ U
mov ax, 1684h # S/ |) W. e# R# _8 {
mov bx, 0202h ; VxD ID of winice
1 ]6 Z, |4 A9 x l# b int 2Fh
& H! A9 @/ ?8 Z9 w& K; W: J* ]) w mov ax, es ; ES:DI -> VxD API entry point4 V2 K" u e9 @$ a
add ax, di
3 m8 |& D$ ?3 _+ G: d test ax,ax) O6 H! M1 m! D7 }3 p j$ o" H
jnz SoftICE_Detected& A& Z: t8 ~* I0 S9 Q
. Z3 ?. Z2 X9 f7 `7 ^/ W& o___________________________________________________________________________
4 R1 a. @7 V! Q- H- ` D4 I9 C
3 w) y2 E3 N- N v5 d& P, ^* W3 {0 jMethod 04
[$ j3 o+ V0 r' i8 h=========
' G7 K1 K) O; X0 T5 w; ]* o3 P/ T" K# ]8 c7 [* E% b
Method identical to the preceding one except that it seeks the ID of SoftICE" h% p( [7 _4 o/ i/ A) S0 s
GFX VxD.
?/ l* `: l) v" Q
3 p# I" [ ~9 x8 d! g xor di,di
9 m6 ~) l2 G4 b& N mov es,di6 K: q. p: K- H3 j
mov ax, 1684h
0 w$ I0 h5 I. F. J5 a' f) O' D mov bx, 7a5Fh ; VxD ID of SIWVID
$ f/ T- p( _+ Q6 q' W int 2fh
% R+ E: O) h: ^ mov ax, es ; ES:DI -> VxD API entry point4 g5 t6 {# L( d" E# E
add ax, di
. F. k: N9 h1 W( g test ax,ax
% L" v e% C( i! B jnz SoftICE_Detected% r, x; }# u) z- {; m: \. j. q
: G0 \. o3 n9 `2 W! p) e
__________________________________________________________________________8 b4 Z. L: y8 w4 X6 R5 f
+ v0 z, C/ z" g& Y/ Y* ~/ ]- l7 x* y2 V( h- k; H' D
Method 05
9 Y8 a/ }1 a4 U( t( f q=========
2 n1 }. \! L, |) m; m
5 `1 E D9 f, d7 [+ QMethod seeking the 'magic number' 0F386h returned (in ax) by all system
6 h, z U8 [8 w( Q" w' Ldebugger. It calls the int 41h, function 4Fh.
3 ?0 e* Y9 L5 D0 mThere are several alternatives.
' C0 Q" N9 ?9 k" `) O
3 y. s, I1 u- C- GThe following one is the simplest:, `7 U9 B3 V& l/ _9 j
' f) N# K9 r E. q+ D$ A, {0 x
mov ax,4fh
9 T8 }4 a/ X, _& S* P, @- t int 41h
$ b: {: \4 Y- m z5 D" v3 C* W cmp ax, 0F3861 z$ Z& |5 t* T# Y8 N" ]4 Y4 v7 y9 ^) D
jz SoftICE_detected5 ]. E& I7 V% p- E6 {5 t* I
^" _" i+ n8 F9 \
, B& ]- ?% O; _1 u2 K3 `4 ?* p8 UNext method as well as the following one are 2 examples from Stone's : Y1 ?7 B5 i* Z9 y+ v b' j' ^
"stn-wid.zip" (www.cracking.net):9 m0 {& H' Z! U
1 |( h/ a5 @! d7 t
mov bx, cs7 v4 q# f Y5 V8 x* i
lea dx, int41handler2
( Z) S& R, d, _% h- n. [% D xchg dx, es:[41h*4]
# s' U8 a8 C! X9 J+ K xchg bx, es:[41h*4+2]
: k9 l7 r3 Q" [ mov ax,4fh! q! l2 o8 W* n4 F
int 41h
, o, q, s3 I! n# H! H xchg dx, es:[41h*4]0 L; _: P( F+ W- D9 m: n3 Y' J5 A! U2 Q
xchg bx, es:[41h*4+2]
4 h1 t( g+ W: H cmp ax, 0f386h, w. T9 A+ o) R0 _- L
jz SoftICE_detected6 p; F5 y; O, G: E* J. t
' L& t" i& r5 `
int41handler2 PROC
( i! O0 u) K7 t# J+ p7 c iret# n5 i6 ~* k8 F; u* @3 ^' \" u
int41handler2 ENDP
, p; d+ l7 r9 g; I4 t5 f/ O) j" T0 j" P
+ z2 w L- ?9 M$ H
_________________________________________________________________________
+ p$ d. L# F Q! O2 k: {. m- g0 S* o, m8 k ^6 l% S! n- L" e
2 Y) J* m' A: r9 T6 T$ r/ k
Method 06* }5 g' O3 N- a7 L k! a- K% R
=========
* F% ^: Z q$ j' o/ X" G$ D
5 n: U: l/ e9 Y4 E' J: W8 ~5 J1 S( B( |/ p7 B9 b1 @' z1 y! J) v5 ~
2nd method similar to the preceding one but more difficult to detect:
\% W _/ Y" [$ I; }1 b' F( h& F! M, H) x/ A8 R
. L$ w: w% R$ ]/ v# x# B/ J, _
int41handler PROC$ D- G# y# ^: n8 ^: ~' I
mov cl,al% V$ W# c8 E; r- ]% f; W @8 M
iret# g5 h0 m' t8 f/ h) y, Y6 S }, c. U
int41handler ENDP
* w9 s4 U1 u- c7 B; @) H
2 f$ G& |- k5 T2 _- c0 U" W0 K* b. K* ]2 O
xor ax,ax( J% s4 G3 W# |0 g* B4 {* @% s/ j: x& I8 k
mov es,ax/ ^+ G! F& |8 F% k- _! b I
mov bx, cs
( x" {+ J6 N& E( W; O lea dx, int41handler5 f% p1 b( ~( S" O7 @
xchg dx, es:[41h*4]
2 ]) ?' ~$ _/ y( D xchg bx, es:[41h*4+2]
, C3 a# K% C; b8 @: U* [7 ` in al, 40h( X F" Y/ m$ j- T- }1 \5 }
xor cx,cx
0 D! @4 c* [8 a% g( i& s: Q int 41h1 Z# I4 g6 A) v3 I
xchg dx, es:[41h*4]
, K% P' C4 F2 b& W6 z8 r- u xchg bx, es:[41h*4+2]
. p" `1 y$ i3 n/ i cmp cl,al
4 Z. M6 N8 D2 C6 w3 U: c jnz SoftICE_detected
: X3 F4 }( B9 |" U# ] \) Z0 a3 K# }! f+ ?3 s3 y* Y
_________________________________________________________________________
: F: `5 ?7 Q9 e4 p
( ~: t- |0 q+ M4 [( P; TMethod 07; } a4 N0 d( z7 ?/ P
=========' ?7 s8 X, M3 c9 z8 x$ N# G- E
1 O! Q; c0 Y8 P5 w0 g5 ~
Method of detection of the WinICE handler in the int68h (V86)3 q' E5 S% o; h" ?
- g: g2 Z; p; N o/ g2 Y3 `
mov ah,43h8 N0 d0 }& I l' q& x: X5 [3 S
int 68h9 u! y- Q3 i( T8 i: h* }" L
cmp ax,0F386h
' `! U# V5 D. a5 T" M0 n* d jz SoftICE_Detected
1 Q% L* g: {* `2 F( K. V- \+ Z% V! z" V# D. _4 u
/ q2 b ^2 U0 Z3 e9 a; U
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 x; p* X5 Q# D! H# o$ n* s app like this:( |$ f1 q9 O+ l3 V5 E3 K$ t
6 ^+ `& `/ b) @! S' Y" d i
BPX exec_int if ax==681 Q, O" F ?9 q4 p, u$ }
(function called is located at byte ptr [ebp+1Dh] and client eip is
' V1 @2 h& @& ^! S7 r# O7 Y$ w( t located at [ebp+48h] for 32Bit apps)
4 P4 F9 T1 f2 _5 U- q__________________________________________________________________________0 H1 D; z5 n, }( ^/ {; C
# i* j, l/ b; `( |+ _% a" B6 n
# |! ^8 r& t! A! g G- L1 RMethod 08
. H- N( f( C6 N, E+ `0 |% K=========
* i: W% d9 P" [9 e" {7 l
0 l8 |! H L7 L |$ UIt is not a method of detection of SoftICE but a possibility to crash the8 t0 w. t' i. z, |
system by intercepting int 01h and int 03h and redirecting them to another
' I2 z2 s7 Q- vroutine." \. R0 ~3 c; [0 `3 |
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points: \. I. ?# o4 Q) Y+ `: C, H+ G
to the new routine to execute (hangs computer...)& ]! w) A* w/ Z6 p8 H+ _
a2 O+ g7 G# y7 J+ V' X. {9 ^
mov ah, 25h& l9 O3 p$ f( B# ?5 p1 ~ N
mov al, Int_Number (01h or 03h)
G0 a! S! o) N; B0 D0 Y9 G% v+ S5 c mov dx, offset New_Int_Routine
9 |+ H0 k1 O4 p N( J! O9 w4 G% r int 21h8 r `. V4 f$ D0 S' [! r
. Y6 B1 M6 q9 g: s2 K" l- s6 _5 r ?__________________________________________________________________________+ I, v3 m ?% h2 W# k( w
& |# y9 a3 u& b1 N( t
Method 09
. i5 a7 [5 s: Z* E3 ~! h' T/ f=========
- P5 S; {" o5 x) s5 m0 q( Z. r" x/ e& u+ A! T; b
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
6 ^' B# F" K Y# Mperformed in ring0 (VxD or a ring3 app using the VxdCall).3 A! n+ {3 y6 s4 n0 @2 G8 @
The Get_DDB service is used to determine whether or not a VxD is installed
+ R+ B0 K1 e1 D) M" _* D5 ~3 Zfor the specified device and returns a Device Description Block (in ecx) for
% q4 I' u! Q' J% l" j) Z; Kthat device if it is installed.7 J6 t# M4 u# W3 f. H& `5 l$ Q& m. X3 ^
" S& ?: |% B5 Z mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID" H/ J2 ^7 m8 `, c4 B$ s$ X
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
_: e8 b. \1 k1 V0 Y6 z3 J- _ VMMCall Get_DDB1 j9 B& a# k1 a- ^7 i" q
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& t7 R/ k, o l! c
) O& X0 m# u9 m t+ vNote as well that you can easily detect this method with SoftICE:; H4 z" l: R, P. q0 ^& N$ H# a0 b
bpx Get_DDB if ax==0202 || ax==7a5fh+ {4 _; B% ~+ H3 W! h5 C' l
4 p1 T( a/ e0 V2 w! v' @9 w( h1 ?/ {! @__________________________________________________________________________5 r2 h; y0 N4 ?
: c: e! a4 O7 x$ ^6 h
Method 103 K! M/ n0 C# Z( f
=========+ F, t6 S3 m' W/ c3 c' P- M
1 x2 ]+ }/ [+ c% K" D: _=>Disable or clear breakpoints before using this feature. DO NOT trace with
* l3 R( Q* s& H$ W8 b9 R# L SoftICE while the option is enable!!
! l0 X+ h; z& r* t
. A/ p$ b- I3 fThis trick is very efficient:
5 l: G: R4 R, B+ w6 l0 t/ S# r9 G0 L6 lby checking the Debug Registers, you can detect if SoftICE is loaded
0 b( @$ ^0 X4 z1 x7 h% w(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if: Y- g$ C# T% z2 f9 V2 l
there are some memory breakpoints set (dr0 to dr3) simply by reading their7 s2 {' n* P5 E- M9 ?
value (in ring0 only). Values can be manipulated and or changed as well. B b' M5 U( t) Y
(clearing BPMs for instance)# [4 u1 W9 `/ h3 v0 g2 s. D7 G; y
4 q! }( r: C2 i" b__________________________________________________________________________" x0 @' _& u5 V( Q
3 R4 z4 [ s) \( [. b! L8 T8 J7 mMethod 11
' w* d t4 `: {2 p. K% k( W; J=========
6 N' U; c; v: L5 ^' x* p m1 C4 j. L- @2 V- r9 [
This method is most known as 'MeltICE' because it has been freely distributed
! E3 O# V, A# j- A! P: _3 ?. Evia www.winfiles.com. However it was first used by NuMega people to allow0 M; R& x% s* }+ r
Symbol Loader to check if SoftICE was active or not (the code is located
; c( J% Q& W8 H% k7 ^; r0 qinside nmtrans.dll).1 l$ ?+ x4 r$ F
! V0 v6 Z) F. \: [, U4 QThe way it works is very simple:8 i( ]7 K# H# T" I0 V
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for1 I1 z1 ?) D1 e- s9 V. p
WinNT) with the CreateFileA API.
4 F. d" @' u; X& _* e% ]% p% X7 b% @: j) s) d# E
Here is a sample (checking for 'SICE'):
( n8 q, I* |0 W' ?& t. } z& `% u" y4 G- M) M" _
BOOL IsSoftIce95Loaded()
4 Y; m; t, [4 z) K9 i{% a; C, W4 f2 ^$ \; T) F. y7 C4 a
HANDLE hFile;
( b6 P; v% e+ F) O" y) q6 U; t hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) q v' D Y' O9 I) O/ X FILE_SHARE_READ | FILE_SHARE_WRITE,
5 T7 Q0 J2 I/ u3 ` NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ M) B+ U- o2 Z C) z2 c if( hFile != INVALID_HANDLE_VALUE )1 G; i& U* i5 P* k1 M
{2 c5 g# `2 ^: J: W" t
CloseHandle(hFile);
. M) A: L3 Y+ K$ S return TRUE;- U, e: Q" p! h1 N
}
! a* j% S- i* `1 L, i8 T* A( D3 k return FALSE;
+ y9 j Q$ H$ Z6 ?}% ]& u% J/ q* t1 I
- @' e- y6 ~' x( SAlthough this trick calls the CreateFileA function, don't even expect to be
1 J0 F8 J3 \+ y+ l( u7 c! P) lable to intercept it by installing a IFS hook: it will not work, no way!
! N+ D" e v* |" G1 b9 ~ [: M5 EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 U# V% ?; f4 c8 [$ O% u& [service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ x4 q, N4 @+ t9 L) u* x. [
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
8 g. l: @* H5 Y7 x2 J- lfield.: \3 l# \1 |# r# D X! S( ]
In fact, its purpose is not to load/unload VxDs but only to send a
+ m( C8 b% W+ @" lW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): w. M i7 p9 f& X8 {
to the VxD Control_Dispatch proc (how the hell a shareware soft could try/ g6 E f& J D( m. ^% I$ n
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* ~# L( f: d8 F2 ^( j
If the VxD is loaded, it will always clear eax and the Carry flag to allow7 P: _: R4 s I6 A$ f7 l9 _, u* @
its handle to be opened and then, will be detected.
B; u0 S" f1 ]5 c' MYou can check that simply by hooking Winice.exe control proc entry point
; D% u! J* [$ o6 Awhile running MeltICE.! t9 v! |1 _: @! E0 E9 @
2 T9 _* p+ d& v/ e( v8 S2 F
2 ^( z/ Z$ b' F
00401067: push 00402025 ; \\.\SICE
1 U- l# u; {" l* }7 t# s& X 0040106C: call CreateFileA
4 ?2 o( O2 X) `4 i y, \% t 00401071: cmp eax,-001
* J2 ?0 v! e. L6 `* Y 00401074: je 00401091" B- {& |: ^0 D# K, h
. N% }7 A. C- u( u
" g* W& K- V" H% W, }
There could be hundreds of BPX you could use to detect this trick.
5 K) ] y0 U' r! z" l-The most classical one is:0 i! d+ N: g9 m" L' V J
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||- h/ w+ J7 ~ M" r5 u& c: {& {
*(esp->4+4)=='NTIC'# h5 n9 f0 a) {3 L; q' Q6 l7 i
# M) f/ {1 M$ O, _6 H
-The most exotic ones (could be very slooooow :-(2 S- ^& R' M% n( N$ i g- @+ ?
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 j; q( t- x! o; g. F0 S2 x
;will break 3 times :-(
5 J# t1 [' s& q7 X2 @ m2 Z" S
' p+ W* s) \" x( Q-or (a bit) faster: / x2 N7 p. Z" x9 y
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): V. w! j7 H4 ~: U* A
9 m9 K5 P. s: n! N) \
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( j: \ T F( Q ;will break 3 times :-(
! K6 I. d3 e* U- Q! G1 V* p+ R6 j, r3 c& i4 P9 O/ y9 M% R
-Much faster:. I5 E9 ]. x, ]& }: B2 F
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' q6 L; m! S8 H4 [7 ^8 [
/ `) l& o& N$ N/ o* i; r% D' d$ V K$ [Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# k8 g9 B$ i9 j7 w* Z1 z" Tfunction to do the same job:# _9 F. k; {& ` Q
9 S. e3 @9 T2 ?4 }) h push 00 ; OF_READ
5 T3 u% d: h* j% @ mov eax,[00656634] ; '\\.\SICE',0. \7 ^7 {' h; O- a! u
push eax9 I6 n- h6 D) {6 g/ M! ?7 ?2 N
call KERNEL32!_lopen ^+ l& ]4 i8 T' t
inc eax
- H: B2 s) C2 I jnz 00650589 ; detected
' t/ [4 C+ d8 l9 v6 J) f. E push 00 ; OF_READ" g. `* i) j* Q/ H! D
mov eax,[00656638] ; '\\.\SICE'6 z+ B. a4 F: g0 Y' ~) }& g9 G
push eax
0 ^" n3 _$ d" ~. D a* H8 ] call KERNEL32!_lopen
1 g) }8 q! |2 O) \; b inc eax
( [8 y o+ [; G, ]! e* c jz 006505ae ; not detected
7 e* X( J1 T9 O& X
# m w5 |- P2 g& U1 o& m. X
6 T- S% ^! N. O+ W `/ ]( U__________________________________________________________________________
6 {" I3 v6 c" v7 o
5 U( h6 z1 u/ S; a: IMethod 12
) p# E1 a5 b& j=========/ G( Z" O1 q1 o$ t; g
* R& C$ ~; V, H7 Q* T/ k; qThis trick is similar to int41h/4fh Debugger installation check (code 05, F8 \! \1 V3 H# u$ M
& 06) but very limited because it's only available for Win95/98 (not NT)
! M n& v- j* \6 X6 Das it uses the VxDCall backdoor. This detection was found in Bleem Demo.& C( k. K5 t4 i9 d9 m7 o* ^4 }. G6 d
6 |2 y/ @$ E# Z; a* W6 X
push 0000004fh ; function 4fh. [, U4 d4 k( u6 ~4 G
push 002a002ah ; high word specifies which VxD (VWIN32)
5 c1 _; v" y+ h& ~* C2 ` ; low word specifies which service
" Y0 E) S9 _5 {( |+ _; G (VWIN32_Int41Dispatch)
5 ]) K4 k! ?3 v2 ? call Kernel32!ORD_001 ; VxdCall
: }+ ?) ?8 M3 n- H3 K( C cmp ax, 0f386h ; magic number returned by system debuggers# k2 d, T6 \5 G M4 [$ k8 O$ ?+ \! p
jz SoftICE_detected
; c' M9 W' p( x- V& u
+ ]- E$ H3 p+ ?Here again, several ways to detect it:
( y# b$ i. X4 N% f4 K/ S- e7 A; G( z# r( H
BPINT 41 if ax==4f
: G! W' [4 \) Z& H/ @- X) K4 [4 T
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
) K* T$ t1 @- J/ _4 s
9 m" m; N% V0 u, |6 ~6 @ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ [& n8 V1 o, `
5 e" L7 Y8 k7 ?* V2 D2 V& J( J BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: {' k; `5 _4 p7 f* Y6 N+ o
; Y* ?: I; j" B$ j$ s" I) e7 e7 g9 K__________________________________________________________________________* L! e: M- ^4 |% b: B- v$ F& k3 X
" Q0 |! @# X. F8 V# _' O& FMethod 135 p- I9 Z, X% g# K" t* ~
=========
- ? d- M, T. Y2 W# S# [* A2 W/ \2 ], |* P/ ]) T
Not a real method of detection, but a good way to know if SoftICE is
) W. }9 d" c# }8 M# ~8 Rinstalled on a computer and to locate its installation directory.3 O3 A0 ]: n' Y
It is used by few softs which access the following registry keys (usually #2) :6 \5 Q, |: P: g o! H: B, [$ }
: ^) z/ \, a8 B2 N# W, C-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' z/ j/ H7 N* N- [& h) H' O& {- `( A\Uninstall\SoftICE
' u) G7 q. H' c# d: }-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" b/ E& W% u' x" B# F5 w* S' E- u. q
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; T3 E* e' ?( q* w\App Paths\Loader32.Exe: y" v& I/ [- J9 o: `- |" b
$ U2 w9 {+ Y/ e8 B( ~
$ R3 H! y/ u7 i5 eNote that some nasty apps could then erase all files from SoftICE directory1 [9 W& v% j" i0 |9 t+ t- ]
(I faced that once :-(- l, B0 G8 e/ f) [
6 w( y9 p% o8 u9 j6 i" f
Useful breakpoint to detect it:$ t4 T( Q' p6 i; e# s
" T }( R$ D0 F" k BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( @3 R R% C- z8 g5 K6 l. f* v4 a
/ n( k# ?) L$ o/ d, r* r; F+ O5 ___________________________________________________________________________
( A8 j3 ]! B: Q$ Z" J' n2 q) v7 H! i' O* x3 @9 S
5 P- m1 i' J2 [- \9 a0 N' p3 H
Method 14
|$ V# E* w4 Y$ v! ~=========
5 q. L9 [! H3 \9 C: {7 |4 Q3 p
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# }7 X" s# r9 X: p3 K. B6 F5 Eis to determines whether a debugger is running on your system (ring0 only).6 g, D: O! H. J9 `
8 A! _: A7 b: r' M! E
VMMCall Test_Debug_Installed
* Q% a+ A- Z- Y( } je not_installed; S4 h* T# f0 m" y, t. |! h* {3 C
0 {9 H$ ]2 ^' U+ I2 Y
This service just checks a flag.) B! U3 X% D' w6 q! e
</PRE></TD></TR></TBODY></TABLE> |