<TABLE width=500>' n- z! J Z1 x3 k4 i
<TBODY>0 g6 \. F! S5 s4 d7 B" C
<TR>
" @* Z4 S( s5 B9 V<TD><PRE>Method 01 8 G0 R0 Y1 s" i$ X% d1 i% M5 N
=========
5 [8 U& P7 t' Y8 L- b' i8 [" o, h' x2 x# [0 Z& Z2 n: i& h
This method of detection of SoftICE (as well as the following one) is3 t9 k0 ?0 O! c4 r2 \" Q' O! S5 Q
used by the majority of packers/encryptors found on Internet., `9 }0 u1 \8 r; b& V; u, R& [3 d
It seeks the signature of BoundsChecker in SoftICE; `* S7 ^" A7 H+ s, U9 u
9 w" h. G9 [, Z mov ebp, 04243484Bh ; 'BCHK'
1 c8 C- q/ n# V6 o6 U mov ax, 04h
- r6 d* c2 g) @5 f/ q d int 3 9 x) f0 ~7 `8 c' T( D! q9 W; d
cmp al,4
# _% X- R$ a, Q( y8 s+ s* V. r4 A9 ^ jnz SoftICE_Detected
2 P+ O* i! x1 y+ ?# l' ~, l8 f' C/ L' b C l ~9 a1 t
___________________________________________________________________________% Q* k1 f% _ u' }/ D# C
& v* f( T8 L) k. v0 o
Method 02/ \" J+ y" h8 |8 @
=========) m+ l/ @& l/ f
5 E; w( i# }% T2 hStill a method very much used (perhaps the most frequent one). It is used, L9 ]0 j: T9 w: D' y( p! e4 A$ H
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
# \0 C% H; ^2 f1 K& K( k6 nor execute SoftICE commands...
0 @8 q! g6 F7 m# t6 g3 X# HIt is also used to crash SoftICE and to force it to execute any commands9 F5 a' p) U/ G. b. s
(HBOOT...) :-(( & e: `% h, S. X
& L2 F! N) T) B! X- a* ZHere is a quick description:2 \! @: V; Z' u% O6 \
-AX = 0910h (Display string in SIce windows)
4 w8 Q+ A- z% n6 d( y& o6 [' }-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 N* g: P F- V# a* p-AX = 0912h (Get breakpoint infos)2 c- h; K. \, W5 I$ B$ ^0 Z) U/ C
-AX = 0913h (Set Sice breakpoints)5 A0 r9 d0 h- G2 E
-AX = 0914h (Remove SIce breakoints), r4 w" }. p# @) r5 k
3 ]! [) K7 o; ?4 g
Each time you'll meet this trick, you'll see:1 w' c+ Y: Z- G/ a) g9 i
-SI = 4647h6 y: O8 b- |1 p5 I. A
-DI = 4A4Dh0 B( `0 `1 i" \4 k7 B
Which are the 'magic values' used by SoftIce.- u4 s' O& {( v, |
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.9 C( {5 w2 S, N. G6 ?2 U
) o0 Z0 E5 B3 M- c3 d. ?, F" J
Here is one example from the file "Haspinst.exe" which is the dongle HASP3 k% Q; g3 K% ^% |
Envelope utility use to protect DOS applications:' N6 Y8 C% ~0 [/ y, [
# z( v7 z. [6 I
/ J" |/ k$ L1 Z" m8 u+ O
4C19:0095 MOV AX,0911 ; execute command.
: R( s K! j: w) o5 T4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
) Z) [/ t. h# L$ k$ T! x4C19:009A MOV SI,4647 ; 1st magic value.
/ d0 g; c! N. J9 F3 v4C19:009D MOV DI,4A4D ; 2nd magic value.$ _9 q$ J( m% ?
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 V+ u- ~& s2 V/ c( t$ v4 N4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute- V) D9 y% t' {: b1 A
4C19:00A4 INC CX, ]7 |' Z% D3 |3 n* L
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
& a& n. a* g; j" y, C4C19:00A8 JB 0095 ; 6 different commands.
X% F# w2 f! k) Y% H4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: r0 j3 U" z3 m: K0 Q4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( Y7 C) Z: O& p, G! L" X2 |6 s
0 y% Y9 N. J6 S3 s v6 [1 Q3 z
The program will execute 6 different SIce commands located at ds:dx, which
0 ^0 C: Y: r& vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 e7 c+ w2 m; N( z, e
+ ~ ~2 ]% X" c* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.3 U3 H: G. W" D: u5 v5 ^" t0 c
___________________________________________________________________________8 \1 K% H; H6 ~% e3 k6 Y! c. v% H
; K7 @' M$ o" i# _' Z$ K
i+ @7 H: N# v+ f1 B+ p
Method 030 ~) O- I% i+ e0 Z: ?! {; O
=========$ _+ P) L- H. ^& l" I n; T
2 x, M: b5 l2 \3 q- zLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h+ `3 {3 u2 j, d* s6 t, D
(API Get entry point)
2 }, q( ]* s1 I8 m 0 }9 r6 N W1 t' m
; l4 i' ?% R$ u- W% C' k xor di,di- D+ W6 C" t4 j- l. Q9 e: Q
mov es,di
1 T3 g3 W! I* V7 m mov ax, 1684h 8 J! H ^' W8 o6 F8 H+ R
mov bx, 0202h ; VxD ID of winice
+ h0 a& }* \* H int 2Fh2 U; C7 [: }% f4 r: T
mov ax, es ; ES:DI -> VxD API entry point# e, r: Z* ?# X1 N
add ax, di0 x+ l) X, O1 r7 ]
test ax,ax% {( C- L$ G! ?3 J$ ^6 q& W
jnz SoftICE_Detected% j+ Z( W1 k0 E: Y5 d1 p4 q. n
- B' ]3 D9 l- ]1 T___________________________________________________________________________
* X9 L& M. C& c! G" y* {/ x. M F# S4 l7 @4 n7 A
Method 04; A0 A, `8 d/ q' M
=========9 C8 ^6 ?4 Q) ^1 h' L) p
" H! ~3 N7 G$ A; v2 G' AMethod identical to the preceding one except that it seeks the ID of SoftICE. ^5 B9 i1 N# r0 T" f. j
GFX VxD.0 J/ L! }7 T. c: ?# c' p+ F# |" c
1 a0 J2 k- R: I2 \0 a& z" Z
xor di,di
6 ~7 H+ q& X0 `+ D4 G, `0 [ mov es,di0 R6 [1 U; Z9 R* P3 L& l/ _
mov ax, 1684h
7 T$ d6 x f o1 [8 u mov bx, 7a5Fh ; VxD ID of SIWVID
# C7 ^/ r2 s' n9 C/ [ int 2fh
: q$ d# Q+ d. M8 M* Y mov ax, es ; ES:DI -> VxD API entry point- H6 u' J* {) F6 Z
add ax, di
, ]6 e. o% t" k% u8 s test ax,ax) ^4 m9 T) n( V8 G, }, Q' R
jnz SoftICE_Detected( U/ y7 z7 p2 u3 P: X% z3 h( G# m& `% W
+ B$ F6 d% z$ `0 ?( B9 m/ A, p/ `" y
__________________________________________________________________________5 ?6 G3 n' I: B* m
( [& [5 Y) x7 \2 g9 d. n+ ~! p; e0 U; ^
Method 051 b% `+ ^# S1 M9 R" n
=========7 A8 W4 v0 x" N! F% j
, Z- v6 S9 m9 L# DMethod seeking the 'magic number' 0F386h returned (in ax) by all system Q8 X8 `' h1 q3 F7 g
debugger. It calls the int 41h, function 4Fh.
) @; P; f" x! T! d8 d3 DThere are several alternatives.
* _" f! F' e* i5 J
1 R S% Y2 G' v8 G; P+ JThe following one is the simplest:
B# i! u% i2 s: ~* }7 ]0 o" z/ [1 b& ~3 o2 I
mov ax,4fh: c% r; Y$ N1 r1 d
int 41h
! J6 O5 f. u5 J1 y cmp ax, 0F386' _- P: k3 n# U& Y5 w
jz SoftICE_detected
$ q: |# h) T0 c2 |
- `# h, M3 u0 `, T! \5 L& z z2 ^- O8 p0 N9 l
Next method as well as the following one are 2 examples from Stone's
% ]$ S* N1 ~3 N: S( q"stn-wid.zip" (www.cracking.net):
9 J7 d! H% T7 S" f8 ]; P y
3 }: ~0 R9 K- ^: ^5 f" \# \ mov bx, cs' I" P. C- }9 F! a9 [
lea dx, int41handler2
9 r: H. G4 `) X# {* s xchg dx, es:[41h*4]
* Q- t9 j) M% U xchg bx, es:[41h*4+2] O; q& q! d; J8 M8 J
mov ax,4fh, c9 Y" B2 E8 I! ^) {' w9 H a
int 41h. _7 G3 a( v9 g( \ h+ E
xchg dx, es:[41h*4]
4 K! g; z n& D9 ?2 P! f1 p xchg bx, es:[41h*4+2], m3 ^8 n6 S6 [. r7 v- C( v( n6 w
cmp ax, 0f386h: A" j. B$ |) I( I/ e8 R
jz SoftICE_detected' [7 B" S1 ^$ @8 L; d. P8 J
0 M# r6 L. B+ B* y# Y4 x1 \" M* J
int41handler2 PROC9 `9 d1 c! _9 J6 A6 ^3 g1 L
iret
- q& q; L4 t7 S& [int41handler2 ENDP4 D0 c& W0 ^" _* h
* K# A* f+ Q% A
9 d& ~6 A$ o9 W: s( X2 D: j$ e5 k_________________________________________________________________________
% _3 G) N: I# @2 |: y% W. Y1 }
, b: B6 d- l5 ?6 b' s# F& y6 u2 L$ b0 M% ]) D5 w8 h% r5 p
Method 06! i3 W3 }6 h3 l( V \
=========8 W" N' k: u9 w% J: z, }
9 L2 _2 U$ ?/ m* ~0 k4 ?$ v" q: l9 X7 K4 |
2nd method similar to the preceding one but more difficult to detect:
+ I- h( O3 ]: ?- U6 e; {- e' S: _8 V( a& J( {, Q1 D. T4 l% g
% D- g5 r# X& z2 ?int41handler PROC
+ m6 }- _' f" r: }# e) u0 H" b7 g, j mov cl,al
8 g5 g! R/ y4 |: L iret8 a9 E/ J. l) M' d
int41handler ENDP
7 x+ g; T. b) L: n% l1 }" p. _1 o% _ i d
0 |0 M8 P. B, Z+ R9 N5 m8 _
xor ax,ax9 S( ^! M* u& X
mov es,ax) i$ G6 O7 t: j; x- }& g/ ~, V, A
mov bx, cs
8 y8 b2 |) `9 K% ~% P' Z7 t lea dx, int41handler8 l i/ J O0 U0 m5 R5 P. m# K
xchg dx, es:[41h*4]
# Y. Q, g2 x, A* Z( K+ [ xchg bx, es:[41h*4+2]1 ?7 X8 _- x( V% i# j: I. q
in al, 40h+ @9 R, F- y) a8 ~
xor cx,cx
/ @( c) q1 M9 w3 L K6 t* X6 a; {8 d int 41h
. K2 S2 i1 H3 i6 @. T- U' P" z xchg dx, es:[41h*4]
6 W6 `5 n, `1 _ xchg bx, es:[41h*4+2]
! P1 \5 k0 m$ E+ M8 n) v# R. P cmp cl,al" J$ ?, Y+ C* @; `: l" a/ Q; P
jnz SoftICE_detected
. h- `* g$ w8 y) ~ y
! j3 x- R8 M( s2 s+ f# T9 ]7 x7 u_________________________________________________________________________7 f) n) ~/ X6 [4 \8 r2 e* v
4 B6 B5 A4 o# P9 C1 K ?- n/ a
Method 070 b8 }# B1 u$ x
=========
6 n; O1 ]& S3 {2 p5 Y3 r- u' L/ ^9 J
Method of detection of the WinICE handler in the int68h (V86)% x* c2 a* g& I% x+ K
! o$ X5 n& F1 q mov ah,43h
, T5 a8 D1 M9 n0 N9 k int 68h
4 p+ X. y! ?! v s4 u O1 M( J6 W cmp ax,0F386h6 M* M0 F3 I5 ~3 K+ q) I0 ~
jz SoftICE_Detected4 |* G* d* a; z Y4 H7 ?$ x
+ s$ ^; k M ]! p; E$ P" o O) L7 l4 Y! ^ T9 X* b; D) B
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" f$ Q4 S' {: A6 |/ a0 h app like this:
) _7 m, m& l1 _& J. c2 e4 c/ \1 Y A* \6 s4 q' U
BPX exec_int if ax==68 |8 V, B; u% j% y" o. g
(function called is located at byte ptr [ebp+1Dh] and client eip is* w3 N3 N/ F. y+ U0 {, s2 A- U
located at [ebp+48h] for 32Bit apps)
3 ?% a2 q8 m5 X5 j__________________________________________________________________________3 }4 B# B" s0 [# @/ e! l% _& R
6 }9 _% T5 s" `4 F0 D+ I% v" [. T+ x- y) G
Method 084 ~/ f) e% c, [/ i: j# J
=========2 {4 B8 l! n2 i. { N) f; r* e
" o5 ~: s* C/ O, u2 G$ j! }
It is not a method of detection of SoftICE but a possibility to crash the4 H, z9 L& X0 b* \: @
system by intercepting int 01h and int 03h and redirecting them to another* X2 s8 t+ j+ f2 y4 z7 T, c
routine.# o4 K# k/ ]4 p
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( D1 w/ K2 H) d/ o) B: F
to the new routine to execute (hangs computer...)
/ g: q2 Z/ a I8 p$ ?
/ J) Q2 C' Y/ r: `! i% F- V2 K A" } mov ah, 25h) y8 {: b7 o1 a+ h# S
mov al, Int_Number (01h or 03h)
8 ]$ ~" N9 `4 J& u" A; e) b3 U mov dx, offset New_Int_Routine
( D7 T, F* {( Q, v/ k int 21h
8 ^ j1 Q. ~2 |# K2 V' F
8 V0 b+ h! A5 f__________________________________________________________________________% W- y% }% p; B! q- u |& k
6 U# \( W; {" x9 [( Z6 O: t; v$ QMethod 09
. v- X! G6 N. O/ c- u# Y6 ^5 y=========5 G+ P) U/ ]8 B, ]# a" e
* t; y, T. I3 Z: u5 O; r+ lThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
. a% G# x5 H2 \" E" a4 vperformed in ring0 (VxD or a ring3 app using the VxdCall).+ } E- M. e8 L7 l; r: `/ ]0 y
The Get_DDB service is used to determine whether or not a VxD is installed
" Q* V7 t! g, G/ p% @ J+ {' yfor the specified device and returns a Device Description Block (in ecx) for: [% q0 ?$ z( t$ S# c, N
that device if it is installed.
W1 | y' I& ]- Z3 @3 _' h; B; ]% A( r' ^7 S! ^: O* u* F; }* _
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID6 Z! w/ S2 Z( D" m F
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ S; m2 o5 @0 z: j d' o& ~; h) | VMMCall Get_DDB
5 q/ g6 \0 _$ J+ l9 {% b mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( j& Y. N# W' Q0 r2 G' T: g5 j# h0 ?& {) V
Note as well that you can easily detect this method with SoftICE:
" ]0 C5 p* e! s% V' `. v" m bpx Get_DDB if ax==0202 || ax==7a5fh" x: C% Q, Q2 W; y P9 ?1 H
: E0 O/ z& B* I' `
__________________________________________________________________________
) V8 U3 M; I/ ^4 \2 \- L" m# Z( h
Method 10* J# ^: C2 M! c- }: ^- \
=========' o5 j9 P7 b4 f# e6 A8 f f4 m
. l: y' W1 q Q
=>Disable or clear breakpoints before using this feature. DO NOT trace with
: v2 s8 F* a) l% Z# w7 L SoftICE while the option is enable!!2 s% f8 z1 b1 Y" L* a
! ^* p1 x) B- p; J* cThis trick is very efficient:
% E- \( q) E6 ~4 z" w+ Pby checking the Debug Registers, you can detect if SoftICE is loaded
4 I1 e* w+ i+ A+ t" c% @(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; a; z" l, i# J- Bthere are some memory breakpoints set (dr0 to dr3) simply by reading their! |: U0 f5 _6 c( H5 X
value (in ring0 only). Values can be manipulated and or changed as well
c6 ?% `% j% B3 i(clearing BPMs for instance)( Q; m* t- u/ o( ?1 P6 V* }
9 [2 C+ E4 {2 i! B__________________________________________________________________________
9 D f. ?3 m6 Y# V% k; d. j
! q# t; U7 k! d @Method 11! e5 r3 t, k$ e5 S; u& D- `6 {% t
=========
4 B1 B: n- O5 y( P5 d2 c2 a% R$ p% }0 h( O& E$ b- T9 q* m
This method is most known as 'MeltICE' because it has been freely distributed
- E0 C+ A8 B( u! f/ {via www.winfiles.com. However it was first used by NuMega people to allow* z9 C5 z1 E _) h# E5 a4 e- B
Symbol Loader to check if SoftICE was active or not (the code is located
; X' X$ ?/ D |1 d6 Q6 kinside nmtrans.dll).
% K( _+ ]# Y* O9 f) B1 s" i- p8 Q* Z* |4 g1 F: u
The way it works is very simple:
- C6 F# p9 M# g5 X: R, qIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" |# D0 h7 N( e
WinNT) with the CreateFileA API.' {# E/ w- L) b8 |# B) Q
6 [5 A+ y% d! aHere is a sample (checking for 'SICE'):
9 z+ S/ P# c" B6 [" K
) ]8 y1 b4 e" m6 \6 RBOOL IsSoftIce95Loaded()
6 c6 d" ?4 t$ k% L{5 R' l- V) E$ p, N4 ]# ~; O% t
HANDLE hFile;
& L+ C0 [; b# U. Y hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ K; a( ^" D) E# H6 V
FILE_SHARE_READ | FILE_SHARE_WRITE,
. i! P/ [. A6 q6 w3 X NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 j- i: a- K. v8 q4 j if( hFile != INVALID_HANDLE_VALUE )5 m0 z, @" Z' w u$ ]$ z+ z
{0 M" k- J! o- |5 [
CloseHandle(hFile);
* x1 W0 A6 r5 r return TRUE;
0 q: N! K; ?/ c. `. Y9 } }1 b; K- B2 [, ~$ H; {! s
return FALSE;
7 x3 p i( v' G3 k} q5 H! Y% Z" h8 S
! \* F, K+ z# h& B8 `
Although this trick calls the CreateFileA function, don't even expect to be1 x3 \* f' ~! _2 l0 x" O1 `
able to intercept it by installing a IFS hook: it will not work, no way!# \$ v+ v/ M: s& W* p8 b% B$ @' H3 ~
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
* u5 s! b) ~: z% j! P: X( Zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
4 L7 ^+ L2 |6 C- h7 w- kand then browse the DDB list until it find the VxD and its DDB_Control_Proc
8 w7 [- k, F) L6 @) l* Dfield.
) N$ G0 ?0 X) IIn fact, its purpose is not to load/unload VxDs but only to send a N8 k+ k, a* k/ m
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: I% y' p8 @0 p2 C6 f- e8 Jto the VxD Control_Dispatch proc (how the hell a shareware soft could try% C: G7 E ?9 ~2 [# o
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
! Z" E$ J! {& j3 d3 @$ x' v0 |" hIf the VxD is loaded, it will always clear eax and the Carry flag to allow
& G& b$ j( Z* j1 v' H% Uits handle to be opened and then, will be detected.9 v8 A% Z$ P. S( @/ p" X: l
You can check that simply by hooking Winice.exe control proc entry point; t: ?5 ?0 M0 r+ }( L& i+ I* }
while running MeltICE.
4 O) p4 E! c. R G3 i G) [6 T
9 s% W+ g+ U5 o* w3 u# U+ R; ?) A7 Y3 |1 n9 n8 b
00401067: push 00402025 ; \\.\SICE
8 d! k& {# B& [7 O& C4 p. @( v1 e 0040106C: call CreateFileA
: \/ r4 t( f6 U' W/ [, Y1 g- w' f, o 00401071: cmp eax,-001
% W( A1 |5 t3 m* e9 U 00401074: je 00401091
( h# G$ ?$ u( t/ D ]0 O3 D
8 r& L' \+ l4 N& d' `( ?
: u+ S- E) C) a, UThere could be hundreds of BPX you could use to detect this trick./ g6 ^' h _) R) E, m1 G
-The most classical one is:/ x; r- [/ j7 {' U) I
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||! J" T% K0 V8 V) D
*(esp->4+4)=='NTIC'
! a5 N r6 s9 }9 E( ~# I
4 H6 h T3 J6 Q' W' v( a. z-The most exotic ones (could be very slooooow :-(
* G K2 i0 I3 p2 e BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
4 Q; X' \) X& x) ^( Q0 p ;will break 3 times :-(
$ c( s/ `: U; q1 j+ s3 A/ ^2 i, J0 S: v, _: m' L! @( h: C
-or (a bit) faster:
. w" M8 t! p& E; G. g$ i8 ]- t0 C BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 G, }& I! D; V( s' c+ m' u/ |. X
8 b4 g5 }- c) Q% s BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : W, |4 n7 t0 P/ E: z1 }
;will break 3 times :-(
! ]5 O' }& k, o6 I. ?# R$ U. n6 c; u- K4 i9 p$ ~
-Much faster:, W( H3 }, ]. U8 b# _
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 f7 r% c$ ^+ i3 ^. C9 m6 b/ R+ d2 ~+ o# F4 F; v
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 v. o: X; N) d9 e' G$ G2 ^- ]function to do the same job:
7 d8 o( e& T* F& F P! D4 e
8 N6 d# _3 O+ D4 Y% T, Q push 00 ; OF_READ( [+ { L, l; c
mov eax,[00656634] ; '\\.\SICE',08 q& y' B) v# A: q* ?& f
push eax. K. O3 z) l3 M8 S/ q5 e# Y6 v
call KERNEL32!_lopen2 P. }+ ?3 R, G/ w
inc eax
; J5 y# z6 ]1 j; ~: P Z jnz 00650589 ; detected
. B5 F) u/ a0 F0 S2 w push 00 ; OF_READ8 l$ N( Y) Q' z+ w: j
mov eax,[00656638] ; '\\.\SICE'% S7 d- z# M, D" o
push eax
7 U+ G6 n( G3 G call KERNEL32!_lopen
, f, ]% u6 ?0 j% w! d8 H4 J5 r4 W inc eax
F# i3 N S2 f" _. A; z2 w, c jz 006505ae ; not detected+ ?& X' k* B9 l
' B" i7 L1 i; ~# ^6 u5 C5 `
. E" j. a# Z' T3 x
__________________________________________________________________________/ S( S3 L# V* h F/ m* H" P
5 W- I. H" q: z4 A- E2 V5 M) M
Method 12
4 ^! H. b5 m& _; C1 L. w2 Q=========
" y9 T+ x a7 U1 C" D2 X3 w4 X6 G# S
This trick is similar to int41h/4fh Debugger installation check (code 056 Z5 B4 p7 z1 W, K; r: O8 X
& 06) but very limited because it's only available for Win95/98 (not NT)
( j. V5 O* h, D3 L9 P" m2 Kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 a3 G+ |& d0 _6 ^: T# h( |! ]( G' x4 G
push 0000004fh ; function 4fh5 [, Y# s* R5 k F3 I
push 002a002ah ; high word specifies which VxD (VWIN32)
* D1 E+ f3 \" v* ?* S ; low word specifies which service% S+ W x5 U) k4 `: b2 }
(VWIN32_Int41Dispatch)
$ Q3 D6 O8 i& s1 |* G9 L call Kernel32!ORD_001 ; VxdCall B, @! a% r* _( c8 L; x
cmp ax, 0f386h ; magic number returned by system debuggers2 E' x1 f; Q. N( O, {0 o
jz SoftICE_detected
6 ]- @" ~+ h; K% Q; |
2 Z0 Q9 e$ C# X/ C7 v4 NHere again, several ways to detect it:
3 D8 k! P C9 b2 M; V; v# r, n/ f( `7 |: C0 d2 I3 U
BPINT 41 if ax==4f! C% y: W/ T( F* Z/ o8 v' ]) d. ~5 R
: Z# u* D$ m4 Y& H5 S; I: B) z' z
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
j8 N2 P5 P$ j, F9 P# \. u/ H7 S) }. K% {2 N
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A4 K8 e& E: H2 S) q+ E* S
5 R, F6 \, y; u! S, F+ N: _& j0 r
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
$ X) N6 A/ P2 Q3 C4 V
0 y4 @. p/ Y" c/ m9 A__________________________________________________________________________
) ], K# I# f9 Y6 w$ v
O, G Q: w: S7 s& l; NMethod 13
4 \. U0 }: p1 R9 p9 M1 n! H=========- b. A: l* P8 D
" H7 }( D) h9 d, S& R* [8 M1 DNot a real method of detection, but a good way to know if SoftICE is" g; A& r( k7 |# c! n0 L: k2 g; t
installed on a computer and to locate its installation directory.! N. {2 G+ B: `2 u* |) d" r1 F& t
It is used by few softs which access the following registry keys (usually #2) :
7 U' Y% G& Q) Q5 ^" m
9 e4 l: h w o7 L1 ]-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 I5 P( M/ X9 Q& A8 o
\Uninstall\SoftICE: M8 N5 R. `1 m5 ~" ^
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ h& }$ A* d+ \, J# `2 Z |-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 E ^( F5 t; a7 L
\App Paths\Loader32.Exe: ]3 }4 r/ @3 h
9 E- G6 F4 w( T0 o
8 b$ a% }7 j) N0 I2 r3 [+ W6 C" hNote that some nasty apps could then erase all files from SoftICE directory% z7 d$ r( P. r2 v, [
(I faced that once :-(
0 }. M/ C) @! Q9 R
- y% t7 C: ^; [, y- m' ~7 TUseful breakpoint to detect it:* g1 B5 C) ?. c7 o, j
6 Q z, U* V, s4 T) ?, N/ \
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" r: E% O0 R/ x3 Q) R2 a+ N9 v6 o4 Y. F, i( V% O9 g- E! Z( i# f$ {
__________________________________________________________________________* @5 {: v8 D) M0 D& f. t& e, q
4 j/ B0 y. H& t I/ }6 d
/ e8 X% Q; y$ b4 V( aMethod 14 4 `+ i) q1 C# }% t v
=========) Z" f/ p( R) L% Y8 y# y2 |# H
* p! j# `# V7 {A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
5 ]( i6 C1 P' L8 x& J: B& sis to determines whether a debugger is running on your system (ring0 only)./ m" n( T }" \0 `6 d9 s9 A; n
/ u! Y3 [+ S/ q! d
VMMCall Test_Debug_Installed
( K r/ w8 F! `) Q( F) q1 W% h je not_installed% v0 r! H% S/ W; L1 J5 Z* A
" e5 ]# A+ j$ L- s
This service just checks a flag.
1 Q6 A+ e/ S+ g</PRE></TD></TR></TBODY></TABLE> |