<TABLE width=500>7 O" a7 [2 f. e* q1 @6 _ u
<TBODY>0 e3 C2 q6 I( Q) @) c2 I0 l
<TR>5 n( a* Q" l4 a" @$ R t7 T
<TD><PRE>Method 01 : R: ?9 z4 a. |( d$ u- H) v$ c
=========
6 F/ ^ T* p0 a( B1 k6 }# G% U; {4 w
This method of detection of SoftICE (as well as the following one) is
" J& y. H- z3 lused by the majority of packers/encryptors found on Internet.2 Q' A) R# h: w% Z
It seeks the signature of BoundsChecker in SoftICE
$ @8 u+ Z1 s. Z, r* Y
) n% ~* q! o. s. h( R' y& U* ?2 N: c e mov ebp, 04243484Bh ; 'BCHK'
8 r5 V. [3 Y6 j- H, b& f2 I mov ax, 04h
+ V, k$ x7 _& w* r2 A/ ^: R int 3 , h9 R9 R. _8 ^ e5 G9 a/ A
cmp al,4
7 u5 F7 u6 h: p' P jnz SoftICE_Detected
' T2 Q [; n+ Q2 M8 C4 X: C- C7 E) H! _, m0 x* p5 G
___________________________________________________________________________
2 t* u/ [* {% ~
( L; [; k1 T0 @! j9 p7 ?* e7 ^% k$ NMethod 028 w7 a8 n# A$ @; i3 m# x
=========
1 k8 K9 `; `+ T& W6 v, J6 u+ Q: y/ Z& b9 X
Still a method very much used (perhaps the most frequent one). It is used# T3 j, C( |( S+ P2 q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,& [) y7 |) ?! k
or execute SoftICE commands...
! \+ r7 S8 k$ Q' E8 Y# IIt is also used to crash SoftICE and to force it to execute any commands
5 p4 l& J& f' v5 Q7 V(HBOOT...) :-(( # d. G) _8 P0 c* l! p
" \" |8 D0 Y" R: Z7 Z8 H; yHere is a quick description:$ }1 z% O- }% E
-AX = 0910h (Display string in SIce windows)
, s0 u: l9 O" P# r( f-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 k2 a- c4 l" T e
-AX = 0912h (Get breakpoint infos)- a- Q# W5 K+ L8 }: }! A) Y
-AX = 0913h (Set Sice breakpoints)
/ o7 F$ _ T. O$ |( y-AX = 0914h (Remove SIce breakoints)
2 H+ w: P' s v! e, ~8 D+ {$ i% @8 q: b) p. G
Each time you'll meet this trick, you'll see:
3 K4 } X% \% U1 w, r4 p-SI = 4647h3 @ |0 i0 a! B9 }, u
-DI = 4A4Dh
, Y0 @' l/ x0 C. G/ b4 \$ V. kWhich are the 'magic values' used by SoftIce.
8 M4 A9 ~+ C3 ?( HFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 Z8 X- `. m( N
r, U3 j9 i$ WHere is one example from the file "Haspinst.exe" which is the dongle HASP) t0 S5 O1 G5 j& o* P% ^- E, O
Envelope utility use to protect DOS applications:% [, \. g. H) k
9 L9 Z7 o3 s# [2 f7 \. \/ J$ n5 ~7 ~, K0 N" Y2 l
4C19:0095 MOV AX,0911 ; execute command.3 Y6 Y( [4 [6 k: {4 h2 P
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* o7 Y6 C2 p$ R5 S* b8 ?' F
4C19:009A MOV SI,4647 ; 1st magic value.
- D- L; \. i3 j. `/ W" v4C19:009D MOV DI,4A4D ; 2nd magic value.
5 P9 B9 t, |: k4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)1 ?8 t+ h+ i* n
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 c- D! @! N/ V3 B. U, s
4C19:00A4 INC CX
+ h* n4 m) t$ o9 x: x0 |8 @4C19:00A5 CMP CX,06 ; Repeat 6 times to execute1 Y! v% H7 R6 V* e1 C
4C19:00A8 JB 0095 ; 6 different commands.
% |1 {8 G% \* M4C19:00AA JMP 0002 ; Bad_Guy jmp back." G5 U1 X. M3 u2 `* F, B
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
! z/ f+ v x) ]' y& z0 a# D
7 d) v! r: |: k& d9 F! ~1 `4 p+ iThe program will execute 6 different SIce commands located at ds:dx, which
( q. C# @7 u# `6 tare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: ^/ v5 G4 e2 Q
) I* R- b, q# T) K4 A/ c& K5 m
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& V; Q1 C) f5 l' X
___________________________________________________________________________
% t- K+ M; c( R' K7 y& C; T6 K
" c+ `* d) D/ d# q
. \4 x5 W2 X8 c* a& ~- {: fMethod 03
* l8 R, |. @9 P, o=========; N b& J) y+ ~: u
& U! K+ n# [4 `1 u' K. fLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
1 {) n1 o) @1 w r5 s2 t8 |7 f/ O4 @(API Get entry point)
+ d" p% b% L3 J" k. [5 P0 ?; h ) p6 S, W# n4 \ T1 f
& t) l; r# j& J q) s, f$ Z
xor di,di& f5 `; n% m" ?3 m# M
mov es,di5 y% N }5 m' r/ A" @
mov ax, 1684h
1 \0 E3 ^+ E9 @& J5 q6 w6 d" ~5 s mov bx, 0202h ; VxD ID of winice
( s0 b' U6 @( o7 F int 2Fh. x1 a- Y2 ~6 U# X
mov ax, es ; ES:DI -> VxD API entry point4 a5 k" Z" W/ C# C# w! S5 P
add ax, di: D* a5 L! P f
test ax,ax
' L$ f/ \- J; V' G, D/ f5 ~, _ jnz SoftICE_Detected: I6 T! z7 Y& e8 f0 E' K. H, F
6 T3 t5 R2 \; y' |, W
___________________________________________________________________________) x# Q! \/ O4 {; y$ c2 G
/ i7 S. s* [- r' E7 t
Method 04/ A& Q$ ?8 {2 {% `
=========
' C; a2 U- T' ?# \* P* k! s8 R
& J4 P8 \/ `, ~, J9 BMethod identical to the preceding one except that it seeks the ID of SoftICE
9 s$ A$ G3 m4 AGFX VxD. }* ~1 r4 S" ]
5 j! O% o2 k( b6 L% W xor di,di
0 @5 [* P. l* I/ @, h mov es,di1 K$ o- a. g- p: L' a0 W
mov ax, 1684h + z; @6 x, e" p5 \" n+ v
mov bx, 7a5Fh ; VxD ID of SIWVID- ]; k& U; m2 W
int 2fh
' `# G/ E3 d: P1 W; R. l, { mov ax, es ; ES:DI -> VxD API entry point
: n5 W9 C9 j% ^# E. u8 ]$ k add ax, di5 J, Q2 y6 W( G0 _$ _' T9 B7 `6 E+ I
test ax,ax! P3 k5 B3 x6 J( { s2 c L5 \
jnz SoftICE_Detected
. u0 M/ m4 \; A& e+ q4 e- T1 S! N8 P0 V3 l+ h- z5 r
__________________________________________________________________________
/ f$ B3 a& X/ ^/ }1 e
+ O0 T4 _, U) X( K& g1 ~/ G/ c0 h' X" e0 S3 R5 {- j: E
Method 05
7 t6 Q$ r2 N/ d=========: x- a+ D* n0 x9 {# H
7 [/ U) k( D* T3 F4 i3 b* A2 `Method seeking the 'magic number' 0F386h returned (in ax) by all system! I/ f7 K0 Z4 C1 X
debugger. It calls the int 41h, function 4Fh.
% k2 v9 ]( o' Z. {% @There are several alternatives. ; w6 `! p/ j9 c ^; P
8 R$ L! o! y" v5 J. V% ~/ O) ^The following one is the simplest:
+ e) i. n. B7 U7 [; p# W8 @/ ]/ B# {1 f% Y V( m+ x
mov ax,4fh
1 h u3 ?& l5 m' D8 e" A( ]- e int 41h6 @. e; ^$ S( ~' ]1 F( Z
cmp ax, 0F3866 p! p S# o6 U* ^5 Y' P
jz SoftICE_detected2 Q: j7 Y& @6 N- a+ G @+ I7 N+ F
* f5 w+ _0 j; }$ O+ y! y, y- ~
4 w7 K; O8 c: v7 [' z3 o' \6 O e3 ]2 ?Next method as well as the following one are 2 examples from Stone's 3 i) i* p& m5 x# g7 d: k0 K0 D! `% D
"stn-wid.zip" (www.cracking.net):! V W! H# V- d, @, l, e
, }$ B. ?4 |' O/ M7 u; q! ~0 R" [ mov bx, cs' `' ^6 w4 C% u0 L/ W+ b# P) F
lea dx, int41handler2: `* B# i! m" d* ~
xchg dx, es:[41h*4]8 L, w. h4 V8 s- x a+ A# X
xchg bx, es:[41h*4+2]( j' k! q- d$ K% \0 Q
mov ax,4fh- P# }+ R8 ~, U8 A/ T! G
int 41h* a1 g0 d; S& X1 u1 `
xchg dx, es:[41h*4]- H1 W" I/ p5 e& w/ t# h
xchg bx, es:[41h*4+2]& j. [; [% |& z8 c
cmp ax, 0f386h' x1 W* T# N1 @0 \8 M7 b
jz SoftICE_detected) R, V$ `( A3 N- q2 Y$ p* Y
1 q! V# ^: f2 r/ j
int41handler2 PROC8 b b- g( {( \: x# Q3 a
iret
0 k+ r, \" R& h3 wint41handler2 ENDP
?, i/ P' s) X \1 N! `+ B" @
4 q) T0 |+ s4 B" E @5 l& O8 G6 u
_________________________________________________________________________
e# U3 J$ A4 J) a3 P
7 Y0 f: i, Y8 ~+ p2 q7 }
( M5 n3 t- g F GMethod 06' v7 _; U- O7 [
=========
# r3 r8 o+ L% R x3 q( R" ?% v; } ]/ h0 g8 ^
9 w8 J w- z4 p) \) B3 V
2nd method similar to the preceding one but more difficult to detect:
! D) D. {5 O, h( ?$ ]& t7 y# b0 }/ v* T- r
& d1 b* r6 `- n5 g
int41handler PROC) \6 r+ P1 C" B. I
mov cl,al
! e! F7 U! U# A! g7 ^4 U iret
, V0 U# s3 X. D U( x6 D: Nint41handler ENDP8 p5 |2 A. l* {% A j- @7 W2 n+ a
9 i( h* G3 Q3 O2 s$ M# D- e
& v/ j, Q4 C; ^/ y# A xor ax,ax2 C' B& q5 r8 k$ Z, ~* Z/ |
mov es,ax, A1 o' U& a5 N3 a" P% X% a& D
mov bx, cs |$ P( O% \6 C# C1 {# n
lea dx, int41handler
2 I% u/ Z. x0 c6 n3 ` xchg dx, es:[41h*4]
' p) X. ] ~* p xchg bx, es:[41h*4+2]" ~$ t/ f7 U) B2 F9 K& Q0 h9 g& V
in al, 40h; I( K" p3 O4 g) a, s
xor cx,cx
( @0 J/ h. p2 o \5 ` int 41h
- y( b; M$ E! J3 `# p! k xchg dx, es:[41h*4]
1 [7 D ]7 C* `' I xchg bx, es:[41h*4+2]$ m4 v( O" |$ G' C% q& S
cmp cl,al$ v4 m! \# b: E! R6 S% j( R0 |7 D
jnz SoftICE_detected: l' q" u p# ~3 a2 `
" ?0 V. I0 m. B: C7 c_________________________________________________________________________
( J0 C9 T" M7 M4 u2 w4 ?
1 o1 c& K, \8 T1 X: x4 ?: n8 S* tMethod 07; Q% _5 L4 ]! T0 K2 `8 c/ l
=========
0 G h5 {) n4 X! B0 b; z
) ], u0 M0 K& q, fMethod of detection of the WinICE handler in the int68h (V86)3 ~( H6 O; O8 q9 C9 b
# D! }: ~' n [; k% u$ C( O! w mov ah,43h
2 f# s' [5 l3 H0 }$ v int 68h
/ I- x/ t( @4 t7 w cmp ax,0F386h. q y0 T* r- u$ Y' ?
jz SoftICE_Detected
3 {& e* Q( t. d* ?# n; x3 |) K& } g* I" }3 z
/ N5 p. P- K+ m3 P$ s=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
}- N' J4 \2 L' ]+ V# d app like this:' i+ K2 X% {; q0 B# u3 [
! X$ @/ `$ I1 w
BPX exec_int if ax==68
8 z. V Q0 ~" n% l3 I0 H( W; J+ o (function called is located at byte ptr [ebp+1Dh] and client eip is
/ }+ [6 d6 A7 B$ ~/ | located at [ebp+48h] for 32Bit apps)* A9 g) S2 G1 @+ I% p
__________________________________________________________________________) r" }9 c: k( U4 ?& ^/ l2 s
$ i) c" d+ s2 }
* w5 Z; i! d9 h8 F5 L8 O
Method 08. N" g0 s0 \% p
=========1 x$ T! }" Z8 t2 G
( T) U C- u( e1 |( o F, ?
It is not a method of detection of SoftICE but a possibility to crash the) m( z" i) Y; n' x* ]2 G: }
system by intercepting int 01h and int 03h and redirecting them to another! l6 L/ y, } s# M7 W
routine.# Y) d+ B) Z, s( [
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 Z0 l& J; V9 e% I2 D7 q; q; k8 v6 E0 r
to the new routine to execute (hangs computer...)$ r7 P, l9 j4 s& I2 o$ B$ E8 ^
# {( {8 x5 t' T9 \1 B& S mov ah, 25h R/ W; |2 I7 E; B3 {; M
mov al, Int_Number (01h or 03h)
2 S/ C R& O7 e6 b( F+ e4 ` H mov dx, offset New_Int_Routine! H& ~5 m0 p1 A5 Y& w# ]
int 21h, v" x( f. Y9 G
7 `% G+ {7 j. F1 Q& \# M
__________________________________________________________________________
) {* _" l2 z M
7 E9 V' x- R VMethod 092 _* X7 H# C7 ^) R o$ x" H
=========
4 J, B3 e5 E9 U* ?& {& O
# b* \7 g* @& q ?1 k4 \4 tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
6 Y$ e0 d1 w; C7 Pperformed in ring0 (VxD or a ring3 app using the VxdCall).
! O% n- O4 Q7 ]" b3 [The Get_DDB service is used to determine whether or not a VxD is installed
1 i+ I( Y7 X4 U' z' Yfor the specified device and returns a Device Description Block (in ecx) for
5 C$ `% K1 p. Ithat device if it is installed.0 A8 W+ K: Q" p& f2 u( P
; G, E4 o3 v2 ~! W9 M+ Z L
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID& J" ]+ s2 f% @4 U8 k8 g9 k
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% _8 s7 z' ~+ C% U! k VMMCall Get_DDB
+ v8 k+ @% H8 Y- \- P& Q5 C# { mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* G5 L9 M# ]/ b* ]
& N9 ]0 P" q! g% `# ~* }Note as well that you can easily detect this method with SoftICE:
& T! P' R7 x5 K. J% N7 E bpx Get_DDB if ax==0202 || ax==7a5fh# [% _7 T z/ E& p3 X: d3 E# x
7 b) y3 n9 O. B& \( P
__________________________________________________________________________5 G4 o2 Z2 i& z3 `
7 U1 Q& C3 e2 w2 O" M% LMethod 10' [$ H" a( `; m0 o* F
=========0 T+ L, W+ F9 J8 i: V2 n: i
6 i/ b- r5 @# j1 J! e3 X1 R0 Q=>Disable or clear breakpoints before using this feature. DO NOT trace with4 c% s7 p. d7 t' V ^8 b
SoftICE while the option is enable!!9 W6 Y0 L' S2 s% r
$ A, f* e, ]: _- p2 j% {This trick is very efficient:
9 K* d5 Q' l0 b1 G, ?" v1 `by checking the Debug Registers, you can detect if SoftICE is loaded6 r7 V7 H) g2 z4 C1 B1 K
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: K- G3 A( i) ethere are some memory breakpoints set (dr0 to dr3) simply by reading their; U: G+ _. m8 E1 b/ ?6 g
value (in ring0 only). Values can be manipulated and or changed as well
# W# g5 i1 V( _(clearing BPMs for instance)' W; [! V0 f" u1 U: A
4 b- Z5 d" L/ ~" z* T9 L5 ?( \% N
__________________________________________________________________________
3 x. T! m" E/ h9 @! {+ D D7 P' ^! M$ _7 n8 s
Method 11
3 g. W; l4 A, Y& _% u=========8 h; O8 ^7 F5 ?: F6 h
0 `0 f9 M$ v2 T) n! |4 GThis method is most known as 'MeltICE' because it has been freely distributed+ d1 ~7 I8 Y: y p3 v) m" [% |
via www.winfiles.com. However it was first used by NuMega people to allow
0 z `5 D! g3 A& Z9 CSymbol Loader to check if SoftICE was active or not (the code is located
/ b u! T# I! O: N0 _inside nmtrans.dll).
/ P3 |3 ~, r- ~ Y5 R; d0 i
$ T" e( e8 [: i! N' B& v% sThe way it works is very simple:0 U5 w: x, V* \; z
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& j% E5 H; N0 m0 L1 H; y3 u. F6 E
WinNT) with the CreateFileA API.
" H; r- r% p$ u1 d% u
. A- K9 u; h0 kHere is a sample (checking for 'SICE'):; B- d+ t; \/ Q. A
- |/ O- _: O* [7 w. U; R4 N _. d9 Y! EBOOL IsSoftIce95Loaded()9 S, ?" l2 |# y
{
- G. \/ z: [% _5 P) y1 N* {( s/ q HANDLE hFile; . z3 `3 z6 j' m8 L: _4 T
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
/ M4 r5 V g1 T/ [. j5 E% t FILE_SHARE_READ | FILE_SHARE_WRITE,
, c! q, y9 q( {+ c' A1 w NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, f3 Q) Q# M4 ]/ T0 b+ N7 l2 p
if( hFile != INVALID_HANDLE_VALUE )9 |, m$ {; K* F8 E" u7 ^3 _7 m
{1 [+ u; i4 Q) w( P$ i
CloseHandle(hFile);
3 D( X3 Y" j: e1 W return TRUE;
9 d: f B, r- Y" D! U/ J6 y }
* z7 h3 v" R! R( r5 x. V/ T$ M; L return FALSE;
U0 z/ k$ Q" f}
7 Z4 o. f+ j* c
6 ^+ e& V2 U7 J* RAlthough this trick calls the CreateFileA function, don't even expect to be- X/ Z1 \1 _3 l$ l& M* u: b" d$ m+ T# J% N
able to intercept it by installing a IFS hook: it will not work, no way!
( q; R# N# D2 H5 bIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
- V. U5 P8 @% `$ u7 Hservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" h" l0 g* r0 t5 j3 V; gand then browse the DDB list until it find the VxD and its DDB_Control_Proc" r, X4 ~" X) p3 m+ A& L$ ~) h4 H
field.
: [" p @+ V2 AIn fact, its purpose is not to load/unload VxDs but only to send a
7 x/ F& k! l$ r- g- x* I& xW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- O4 O f9 D' c' d- t$ l
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# c3 R& d! Q% }3 z/ k, Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).7 @( ?( S! I! d& O5 `* u
If the VxD is loaded, it will always clear eax and the Carry flag to allow% n: \( U% ~! F" l% ?5 |) ?
its handle to be opened and then, will be detected.% g+ `1 u2 S0 n s* C( K
You can check that simply by hooking Winice.exe control proc entry point
! Z2 j$ K. Y9 t/ Kwhile running MeltICE.5 f# |. n5 i5 h8 O4 N0 ?' ^; h
8 |% K, D9 a; v8 \; w7 P% u# i8 f1 @2 { B! q+ M6 B! ^
00401067: push 00402025 ; \\.\SICE
! U$ O o) B% X, |. T" Y 0040106C: call CreateFileA
7 r* \2 H! I" o6 A 00401071: cmp eax,-001/ p! T4 a: k$ @- Q7 Z
00401074: je 00401091
5 X# K4 u0 Q9 _2 Q3 T3 J: N# }1 a4 e @+ b9 }1 e
! \) |; V H3 D$ Y3 Z6 Z0 u+ PThere could be hundreds of BPX you could use to detect this trick.
. c; |( L6 u* v- h) w-The most classical one is:
- y. N) R1 u9 M# a M4 R BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 [4 c3 u4 @# V+ ]1 D( _9 U& ~ *(esp->4+4)=='NTIC'
) n4 I. E' p8 E
/ w, h( x) {0 r7 H$ C-The most exotic ones (could be very slooooow :-(6 J2 B' W1 d4 X5 y
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') , C; d% t/ k [' G
;will break 3 times :-(
' X8 c' y4 m, W( `7 l0 g2 H1 u: A1 u( G8 k) O, x. h
-or (a bit) faster:
+ \* o: I# W+ a( b& Z2 x$ ?# ]9 a BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, M V4 u3 l) {0 Z c
9 R2 Y& g$ g; [$ v1 D BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 4 p5 J" g3 v# G5 p* `! m2 O( G p
;will break 3 times :-(
' ?+ I/ Q# v9 ^# U
4 r! `( Z9 S8 D, w; K4 P-Much faster:3 D2 ?! b4 I, f8 d% U
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. O. z7 r. L; f) u. z$ @
/ D6 q2 a- K2 ?# Z& y, ]- ]
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
% R. T" S- A0 ^: L6 a# t* L! ffunction to do the same job:' M* e- i" H( a, j# |6 x3 L0 U
: u# W' }; r, l, T, x2 z push 00 ; OF_READ* j6 Q7 G5 Z( c( d. o
mov eax,[00656634] ; '\\.\SICE',0 Y$ ]! _' p W ` a4 C1 G
push eax+ ?8 c! o0 h# P$ K4 h% t% l
call KERNEL32!_lopen
, Q3 I: [" k, p- i! | inc eax5 Z' ~- A1 C& y6 j
jnz 00650589 ; detected
( I7 _, V4 j! L0 W push 00 ; OF_READ. s# R8 v4 \1 v+ M/ g* }! b, f
mov eax,[00656638] ; '\\.\SICE'4 m$ r4 N. s3 {) z# Z: T) G
push eax
# X1 l0 w2 \ ~' v$ ` call KERNEL32!_lopen
1 Y" e' p4 f) w) b7 ? inc eax
0 P: w: X6 g o- t3 ~5 w jz 006505ae ; not detected
8 e0 d, y! t( q; x% ?
" z$ {6 F$ V) i3 b: C4 y! T4 e4 U( w* c4 a
__________________________________________________________________________5 [. J6 y7 _3 i) Y8 O
- e6 U m+ h9 y6 @- W6 ]Method 12. b- P, I. O7 y; R& P+ w- ^) o/ S
=========, n2 y; k! [" `" A% x1 W! f% D5 x- ?
: \. n! J' ~# T4 c1 @8 G" P& u. pThis trick is similar to int41h/4fh Debugger installation check (code 05
# z5 K0 @3 p% g5 z% v; E& 06) but very limited because it's only available for Win95/98 (not NT)
! d: J/ l$ a9 Q. R$ V* }as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ W8 ?, e T' P! [( E, A
/ G' _; Q, p- j) e/ N+ E push 0000004fh ; function 4fh
; ] ?8 |- T6 m push 002a002ah ; high word specifies which VxD (VWIN32)7 ~/ ?; P7 {3 V
; low word specifies which service
8 \5 t }9 ?( c5 `0 {: M3 z (VWIN32_Int41Dispatch); y( Q4 P% X; G' Z3 H
call Kernel32!ORD_001 ; VxdCall, E. {/ d- E: c' X/ v
cmp ax, 0f386h ; magic number returned by system debuggers
5 F/ o) ]/ ^' _, i1 m jz SoftICE_detected
/ \7 j: X! p1 w: u
3 V. @' Q8 [( c+ G. R" ]3 ]2 ~8 Z2 R rHere again, several ways to detect it:
) [3 T9 n3 s9 w7 A
1 s* H' z! f- a$ p5 T1 L+ ^' ?( y BPINT 41 if ax==4f
1 \7 J% K6 N& @! A+ x6 f$ h
. I q S$ c2 o+ p0 ` BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
0 w, S+ h) ?0 P2 z {& D3 k0 Y* q: K; r8 A& u0 }' C& |3 ]& h
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A$ J5 z8 l- \# P5 n0 V4 \4 E
5 W5 i4 \4 X7 K1 c BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!6 N6 c7 |" e5 L* U' d
( M/ l/ G: }5 \/ }- Q; H__________________________________________________________________________
3 T: I- V a. P" N: m: z/ N* x
% q: t3 ]& h2 y* C6 uMethod 138 X. ^5 E G0 Y7 z7 T
=========
# q; ^" q7 m/ ?. C$ Z# W, M
: ? Z& f6 O4 u; M4 t. ~1 \! hNot a real method of detection, but a good way to know if SoftICE is; h5 G, u4 u& t
installed on a computer and to locate its installation directory.
7 j$ y2 i0 J& JIt is used by few softs which access the following registry keys (usually #2) :, Y) R/ A1 P7 ]7 |
7 J% `6 i; d) k( a9 a
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 f; s9 N* b' j* N0 ~\Uninstall\SoftICE2 @+ r$ K4 _/ u% P. q" {+ m
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: L$ X9 T' N$ _+ B& x2 m1 [-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 V0 o! E! T# X% M- w0 W6 U( N
\App Paths\Loader32.Exe
; M0 J! q& N1 N. x
; _& H# `5 o' \4 S' X U$ s2 ~* u0 k8 x
: e, F/ {/ k1 A4 K1 X9 b/ dNote that some nasty apps could then erase all files from SoftICE directory, I `' n% Y e9 u
(I faced that once :-(0 F2 P7 w$ U/ v5 I' I1 ?% e1 }1 b, u1 e
) s( ^( p6 e& \9 e- h8 {
Useful breakpoint to detect it:
& ]* S6 X& ^& F, w2 g$ ~$ z8 a! P& G
8 r& n% x4 T2 }) g1 I# H# } BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
! {, u/ s' w- ?& N& [. e/ d; a: X; X: |/ @
__________________________________________________________________________
9 f( k" o; e: ?$ y( S% m$ g( ^& e; ~9 X4 H5 a
$ i' U- x" Q2 I) R2 n8 S/ x- fMethod 14 4 l5 Y8 F! i! O
=========
) m5 } x# \6 m( v: F" W; \3 x
3 t& Q- V* K4 h9 |8 \: c. KA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
$ k- J& e1 d; E$ @1 [/ qis to determines whether a debugger is running on your system (ring0 only).
$ U! l0 m$ ~; a7 q) E- X) \
" O# i0 R/ U3 j* y3 A- K( { o VMMCall Test_Debug_Installed' S2 V5 m5 ~9 _2 Y
je not_installed; I2 f- B: o5 I2 T2 G
, [/ J$ m9 T/ ~3 ^0 J' E ]
This service just checks a flag.* e }3 F# d2 Y* g% _
</PRE></TD></TR></TBODY></TABLE> |