<TABLE width=500>) L+ _6 b& l$ B) R% Z7 C
<TBODY>
7 P6 {; t: o+ m* t% K6 Q N& k. d' ]<TR># N9 n9 O' F$ B4 N# h% q7 D
<TD><PRE>Method 01
8 c' Q0 @ [5 d. W$ W/ Z- g, c=========" x! r( |7 I: P
0 Q* ^9 l- m7 X! B
This method of detection of SoftICE (as well as the following one) is
: X) q, q/ Q1 g- Bused by the majority of packers/encryptors found on Internet.9 M7 i( _/ y% O: ~) U7 \3 r
It seeks the signature of BoundsChecker in SoftICE; k G: g* R' x4 ~* W
# |# S$ p0 h, H% r. w. M
mov ebp, 04243484Bh ; 'BCHK'* i/ j( C4 @+ l8 E
mov ax, 04h0 V4 ^5 J8 X' i% u) V2 S) x+ T
int 3 $ Y* J. m4 |" p4 ?6 i: g% f
cmp al,4
3 x! O7 }% R- x2 J" S. P jnz SoftICE_Detected) v% b8 K7 \1 ]. \3 n }
, z; y7 r( a1 q$ K" A4 j___________________________________________________________________________8 p. k+ X# ]9 L" u
0 b7 i; M& O2 D, u) t, V' mMethod 02
: N; e2 v- h# t3 r5 r% \3 J, [=========
; ^2 S% v( ~0 L4 y" w' {4 W# q! u+ I6 H
Still a method very much used (perhaps the most frequent one). It is used
3 l& L; p; d- t0 |3 Fto get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 }. U; l* n$ [* `* }
or execute SoftICE commands...
7 ~! u0 M3 ^7 l: c2 ?) B6 HIt is also used to crash SoftICE and to force it to execute any commands V1 P0 P7 u( h1 ]* ^+ P: ~
(HBOOT...) :-((
6 e I# {' ]$ Y+ w$ y6 U
% ~& S5 _! B9 z; SHere is a quick description:! j* A: Z/ Q' E* k
-AX = 0910h (Display string in SIce windows)4 V. Z! e- V, |( Q! i# R
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ c) s# n6 U9 m9 e' R( \ @-AX = 0912h (Get breakpoint infos)& V* C8 V; Y M) R, |
-AX = 0913h (Set Sice breakpoints)
- Q1 a/ e" r5 `2 V3 N-AX = 0914h (Remove SIce breakoints)
2 N' g0 t4 l' i) Q) e; S$ {4 V8 R# o$ L3 i! z
Each time you'll meet this trick, you'll see:
f C$ I, }0 x/ u( C4 g5 @& ~-SI = 4647h
& }) A# t5 V* B-DI = 4A4Dh) S7 V3 \) P) v, x) I/ e
Which are the 'magic values' used by SoftIce.) v' d& {* T0 @. g! I9 a' T% R
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.- i5 `) T# w( r: F2 z9 t. }! t
]5 B- X. k8 ~& B4 B# Q
Here is one example from the file "Haspinst.exe" which is the dongle HASP
$ G4 E C) V0 J4 j/ KEnvelope utility use to protect DOS applications:
5 p3 G4 [ \& D& n0 e b" {2 @* [6 b4 V
$ c( b. W5 \% P6 w b8 ^* c$ m
4C19:0095 MOV AX,0911 ; execute command.
- M5 E% S! e/ i" D# {1 @4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).. J) f0 B8 F1 q; T7 b
4C19:009A MOV SI,4647 ; 1st magic value.& v7 |; ^$ L7 ~ \% A4 U: j* P; ~# ?# e
4C19:009D MOV DI,4A4D ; 2nd magic value.- k! X6 g- @8 F' K- \: h
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
K/ T' u! X+ {3 m* q6 S4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! I d9 u* Y, t- `/ J3 b/ b
4C19:00A4 INC CX8 {! q$ n" H7 {7 x! T: D
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: y X, S; p: l6 L4C19:00A8 JB 0095 ; 6 different commands.) X0 ]) H, d7 `* R' q8 P& {
4C19:00AA JMP 0002 ; Bad_Guy jmp back./ A; A) x0 W/ [5 Z9 m. R0 i5 ~
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)3 Y' V1 @; h3 b# g) w" I8 e
; d$ [0 x+ a$ H6 u' d) x6 Z7 KThe program will execute 6 different SIce commands located at ds:dx, which
0 z) c4 C! g' v, k1 q' W+ H' R8 L- Tare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
* s2 p. G* m: e% O3 m! `& N4 n. I9 _# f
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% V: c- L. E% Y! y/ V___________________________________________________________________________
% g4 l x+ h, k
4 C, e8 s8 ?& \
! R8 B! I) G; m$ ?Method 03
s* p. \ j) ]; c% H' D5 u3 T4 \=========
: B5 I/ O% L4 @4 T& ~$ |6 m
- d6 ~* W( T! A3 W. M( jLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h* e4 ]: `; t0 A; {/ Y2 @
(API Get entry point)
" d( U" C9 A" R9 A2 D
% L$ S4 o. l( `( ]5 n5 M
7 i9 b$ b2 k* N. A; |3 u# e; [9 ~ xor di,di
$ ^1 d$ X8 o" I7 M mov es,di
! [ t' z9 l, @8 _! C8 t- u. k mov ax, 1684h
8 K, x) c) o9 X2 \4 z+ J mov bx, 0202h ; VxD ID of winice
! G! u, |: W/ V8 h0 H+ S8 x int 2Fh
, W7 Z2 H1 L* n0 @5 M% x3 j mov ax, es ; ES:DI -> VxD API entry point
7 p& i& x7 M; s add ax, di: D; _1 K6 Z' v c4 }( ]
test ax,ax9 t' Q6 B# D) _5 i
jnz SoftICE_Detected
8 A4 R) [3 R5 {8 Y* S, G! ?) ?, F- q e& }/ v5 Z2 Q- G4 V* d8 M
___________________________________________________________________________
4 H! o( |! ~ P% h% k* g2 Q0 I4 z
* D5 I1 B) p) yMethod 04) f6 B$ }* _! V2 N k( |. y
=========
8 U! t; s& \' P) L e7 x
- ^8 o [& h; o7 d3 A- K5 HMethod identical to the preceding one except that it seeks the ID of SoftICE
$ @3 Z' I2 T, ?GFX VxD.$ T& |: u) G) c" s% v
. s& _5 b+ `! i4 X/ q, P2 ~5 Y xor di,di
" H% @$ m6 y! F mov es,di- C1 k7 x; W7 N4 u
mov ax, 1684h , L! F+ |1 ^- \
mov bx, 7a5Fh ; VxD ID of SIWVID% V( k: @! |4 o
int 2fh* _( |$ l. {6 |0 Y
mov ax, es ; ES:DI -> VxD API entry point
+ d0 k( Q7 ]( H. S; D add ax, di
0 t# j7 Y [0 V, ^ test ax,ax2 o% ?3 ~( v: k; L4 T6 \4 y
jnz SoftICE_Detected
, u3 ^0 ?' h v+ P2 [$ \8 b, r3 V v4 \! l
__________________________________________________________________________& d# n7 |! F" O$ [5 m
0 ]5 ?$ {8 k- T$ z& {; Z
3 B% H' h0 l5 J+ [Method 05
! d* b+ T& A1 t M=========" a$ ~2 }% W6 y8 b
! t" X+ p3 X7 u) M" YMethod seeking the 'magic number' 0F386h returned (in ax) by all system& A M7 ]6 Y& k! ?+ k2 {6 z
debugger. It calls the int 41h, function 4Fh." _0 k6 i2 M, F- M* i5 [3 S" j
There are several alternatives.
: X2 c1 W3 O; F# F* V
5 k4 @" p @; R2 r; MThe following one is the simplest:
+ ]: |$ S: Z6 V/ Y, t6 {$ C6 |; ?1 ^9 N8 A
mov ax,4fh
0 @5 h3 y3 w2 L- E) o int 41h
$ r. l! q. D' N/ ?$ \' j0 y cmp ax, 0F386; S: E5 H/ r ^" f/ O; t2 `8 J
jz SoftICE_detected
; J" E& i1 F: o2 T8 ?) T: B2 }# ^
9 x# e/ M* n( D! ]Next method as well as the following one are 2 examples from Stone's
4 D w6 j; t6 v' c/ V"stn-wid.zip" (www.cracking.net):
1 t9 x! R c' u6 S7 B! C$ T4 S" j& a1 u( ^; |" A- @5 l
mov bx, cs
% ~8 u2 u! Y/ Z. G& Z. h5 r lea dx, int41handler2
/ H2 {8 e+ k& B xchg dx, es:[41h*4]
9 A: `& y2 a2 s0 W xchg bx, es:[41h*4+2]" b: j; G" J! p4 z% Z: V& M& s, z
mov ax,4fh) i) V7 Y# f/ Z$ m+ C6 U
int 41h
2 p$ ^6 b; R' o, V ~ xchg dx, es:[41h*4]
' w, v" }* `6 d% | xchg bx, es:[41h*4+2]
7 {0 n, t. h1 q, n) v4 ] cmp ax, 0f386h. y. F9 h) f1 z) J+ I( Q5 X
jz SoftICE_detected9 ], l" ~* y4 e4 k1 i2 I& Z; H
2 I0 j0 }' N6 |$ p, h
int41handler2 PROC
# n5 Y; g" y9 v iret
2 A9 \7 _ x! H. G$ \int41handler2 ENDP+ s, t) g( R, O1 j3 _: X
9 v2 A" F- Y# f. n2 C/ W
3 m3 v& ^8 x# O9 y( a; j" S% k_________________________________________________________________________$ j& [- h/ X$ J0 @4 s
+ ?8 F* Q, d, k$ F$ L
$ z7 _& L' g5 S* S) G. g1 P
Method 06 y9 c9 H# j& S
=========( e. |; b: L# w4 x- P" R! N) F6 c" t
! u- U! Z# I- W: g0 D8 p* D
1 t' G; l3 f1 B( y
2nd method similar to the preceding one but more difficult to detect:4 \5 i- H* Y) q) _% y) K. Q! w
% o+ k, I5 l# j; q$ L5 n; t0 J& Q$ X* o; C4 p! n1 W) p
int41handler PROC
- `0 v2 R7 b' G$ t. N* o7 X, { mov cl,al
0 @) T; a! o0 M3 `, u4 ]4 q+ P# ] iret& f- C9 x% B8 w9 Q2 z
int41handler ENDP
6 d% n2 Y, h2 d+ M
6 w* t N2 v( J/ t/ W' C
( R* Y7 l4 I! p& a' v( o xor ax,ax3 n G% g" S8 H; m1 v
mov es,ax9 ^7 l& o7 a" H
mov bx, cs
+ K. [1 D0 k; a" z5 u lea dx, int41handler4 c H& D3 M6 x7 T8 i
xchg dx, es:[41h*4]5 B& }2 O) w$ I% S$ B# s
xchg bx, es:[41h*4+2]
. s( i9 H; B7 Y- h in al, 40h
' q% h8 c5 C3 {0 f$ q% Z& X xor cx,cx
. u" ]# b" _" H2 D B2 y7 O- R int 41h! f+ E% t9 C7 q9 C- Z
xchg dx, es:[41h*4]- q1 d: c( q* u! a* B
xchg bx, es:[41h*4+2]. t6 A. t6 b/ p0 { K
cmp cl,al
, n: K3 _, a# Z: O% a# N jnz SoftICE_detected9 g4 c6 ?6 P) j+ c! |4 F% ^$ V
& ~& Q8 t$ m! k0 H2 c* ^_________________________________________________________________________9 X; s' V! A1 R- R! e
+ P8 _) m% t* e4 b) rMethod 07
6 r' v- `5 A! Q1 w=========0 I2 A$ P1 L6 {
$ j% h# V% J; A* ?4 z; v" `: ], l
Method of detection of the WinICE handler in the int68h (V86)
. x. f- C% l1 g; R B1 c8 f# U1 ^( G/ i" L) g% h, ~+ J7 j; k
mov ah,43h8 x# T9 H& X3 a1 z7 K1 @+ T, ]
int 68h9 D+ i! ?' K6 _$ W F; D- R' F3 [
cmp ax,0F386h8 Z6 ^. B* H6 c$ F! [3 {5 P1 P
jz SoftICE_Detected$ @& R7 a6 j3 }7 ~; Y3 n
9 E% s& z, ]8 O- H; r/ N# B# ^) V2 T" L+ ?) t1 d' D( e! y' r+ y! N8 f
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: E# e" o) q9 A9 D; y+ Q- Y+ R
app like this:) @3 e. A8 q V7 ]+ H; i) C
* S) H) A8 [. `9 ~/ v V BPX exec_int if ax==688 ^" I5 k5 l4 _
(function called is located at byte ptr [ebp+1Dh] and client eip is
$ o5 f8 G1 |! |' f3 w- d located at [ebp+48h] for 32Bit apps)
# `4 {4 M0 w) F0 ~1 ___________________________________________________________________________
* B3 J9 L: W5 q7 V7 i8 |7 ~1 P# A4 a# n
9 J* g2 d: g2 I/ Q. j; o% G) nMethod 08
" s* \0 E' c1 I" i2 K=========
p! z5 o( d w5 ?/ ]# h" y6 [. l9 _/ E
It is not a method of detection of SoftICE but a possibility to crash the {7 ~' ?( ]3 X' Z
system by intercepting int 01h and int 03h and redirecting them to another
4 W. ], Y' y5 F! F' ^# [) U* proutine.9 l4 o9 y- p5 J5 D% _
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; N$ R. g# ?8 t0 ]& `to the new routine to execute (hangs computer...)
7 K6 M% D2 _% p- [: v, h
8 V+ v: J' {2 e% X1 j3 s mov ah, 25h
) a+ g o4 i/ O4 F+ a# ?7 ]8 u+ {: ^ mov al, Int_Number (01h or 03h)- D4 O; f! y% D
mov dx, offset New_Int_Routine
4 n( _( I2 M$ |' ` int 21h
; q4 G8 U4 ^/ S/ M+ ~1 m. ?$ i! d1 b5 D: |& E, w" X2 Q* K
__________________________________________________________________________
; \/ \, @, Y! _1 E4 _- {3 ^4 v; _. p, {$ n
Method 09% o9 |; i, }; F2 Y" q' s" ~
=========
' V O) `! ^+ k: L" Q# h$ P
' O2 x" `# V( H' c1 EThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
1 P* u) b% D+ f6 b+ J5 Qperformed in ring0 (VxD or a ring3 app using the VxdCall).
- c$ l B* X7 e8 `The Get_DDB service is used to determine whether or not a VxD is installed; l7 A* ~# ]5 L
for the specified device and returns a Device Description Block (in ecx) for* K8 U9 \/ h4 T
that device if it is installed.
2 O) I& V X7 I5 B8 v/ D9 o& z& v8 S k! G( X% f( f# ^
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID8 d) a' ^2 t( R1 \
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ ~0 D. W5 P u VMMCall Get_DDB
4 ~+ ~" }6 o" [# ?" h mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed3 ?$ G- U: k# `- b; B
- P7 K1 x6 R+ V& ?" Q- X+ R. w
Note as well that you can easily detect this method with SoftICE:
, y; S# s; H2 H. k4 j' Y" x0 w3 b bpx Get_DDB if ax==0202 || ax==7a5fh0 p1 ]5 V) f5 U
9 c. p4 k8 i' n# o! Z6 b [; f__________________________________________________________________________
; U" t- `; I4 \% U/ L' s, {- M% c
Method 10 X& }! N a. m& I$ d, J; Y
=========: [0 B% k1 i4 H# m% A
. X" \& M. [- f# y+ E( _0 [- C
=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 g* a: r' C! k0 J, g7 @ SoftICE while the option is enable!!
) s! y) ~0 ? u
1 S/ T1 A3 K5 y2 a& |8 TThis trick is very efficient:
8 C) x- G2 U. p5 h& |by checking the Debug Registers, you can detect if SoftICE is loaded
; ]6 { c$ y: H1 |4 O' b3 U(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if$ K5 i. o" E5 C" D0 q
there are some memory breakpoints set (dr0 to dr3) simply by reading their7 ^" j- v& V# v9 R0 J
value (in ring0 only). Values can be manipulated and or changed as well; l5 X$ u4 j e# a& J$ R3 d: m1 g# e4 U
(clearing BPMs for instance)
; p5 u9 m3 g J2 B* B. {; E
# K( \. Q& r8 T" Y& \__________________________________________________________________________
: d1 w1 G# H& ~* m& {# ^* E+ T( d! m4 P/ P. p& B6 ^8 |% A- |
Method 116 P6 Y+ S! n) q/ O0 V8 h- n
=========. l, y: v2 l0 a2 l
) ?4 }6 D4 M5 {6 O$ A/ wThis method is most known as 'MeltICE' because it has been freely distributed6 b) g$ ^9 [6 c% u+ w! b
via www.winfiles.com. However it was first used by NuMega people to allow2 k a+ t7 B9 ?# `1 a: f- D
Symbol Loader to check if SoftICE was active or not (the code is located K7 D4 T5 V$ [: m/ E
inside nmtrans.dll).
1 M! V v) e1 ~
6 X! }, [" r) {The way it works is very simple:# {) z: ]0 @( [
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 Y Q# ~/ {, A: T7 M, wWinNT) with the CreateFileA API." P/ m6 x, C' H0 W0 a( @6 B
# j5 t0 k' P7 F/ Y
Here is a sample (checking for 'SICE'):* v$ ?/ K5 Z. a) r2 S. |
+ c5 K, c( T& J. [7 \
BOOL IsSoftIce95Loaded()
# ?( }% v9 V" X% j6 E2 Z4 j{* L5 N" a- w+ v, X
HANDLE hFile;
4 U% K$ t, {5 P) r hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* T0 d/ N3 \8 W. j) t5 [
FILE_SHARE_READ | FILE_SHARE_WRITE,* d- h# m; g" M9 n1 r6 k3 F# U9 [1 V
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);) }' D& D9 N* K, r( `/ `& \9 E
if( hFile != INVALID_HANDLE_VALUE ). F; k# F- y% J! f2 U
{
3 k0 Y( }5 o* i7 H" V+ J5 z: a, I CloseHandle(hFile);6 [( O' K) f- L6 {% L
return TRUE;
, J- O# d, p0 N3 T' Z- W$ a }& E0 ]8 s% u! t# C2 ]4 r
return FALSE;, X' e9 c- G& J# z: S8 v
}+ h! P, Y2 \" z4 G$ A+ F
$ O: e( @$ o/ S" \& q b1 H- {. H
Although this trick calls the CreateFileA function, don't even expect to be
6 ^3 c! M5 M8 | J1 Nable to intercept it by installing a IFS hook: it will not work, no way!5 z& |# K1 m. D1 p
In fact, after the call to CreateFileA it will get through VWIN32 0x001F. Y3 b0 c: _2 m, C; A4 s2 ]. I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* G+ o9 O& m+ g& I& y2 A% Jand then browse the DDB list until it find the VxD and its DDB_Control_Proc+ W$ k+ L# M8 O2 M2 w
field.7 c5 l% W8 ?, m. e0 s' G
In fact, its purpose is not to load/unload VxDs but only to send a : S6 D% I4 y3 D$ [$ W
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)' N9 s6 \2 @% G \; p* U; V
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
9 k2 A( m7 g; k( e+ ]to load/unload a non-dynamically loadable driver such as SoftICE ;-).
. y3 o0 ?( x8 ?( C. J2 h2 ?0 YIf the VxD is loaded, it will always clear eax and the Carry flag to allow) c3 Q, N6 s4 h% P
its handle to be opened and then, will be detected.
% A, j8 k/ A1 B0 i0 P9 g' {+ QYou can check that simply by hooking Winice.exe control proc entry point) ^( f6 b8 T5 f; q/ F
while running MeltICE.+ @5 |3 [5 n8 ~; W3 }% G: h; f
/ V/ e: I. ?5 m, R; }, s
/ P) C: J% y2 C1 X3 k+ Q! G
00401067: push 00402025 ; \\.\SICE" C: v$ P! `2 Z9 ^/ v3 N
0040106C: call CreateFileA
$ S1 }: { q( O/ H, K 00401071: cmp eax,-0015 P- K5 X6 H* d) _
00401074: je 00401091
$ `/ ?/ g% E6 U3 m& K
& W5 ~' k- s3 T# ~' U! D% \
* ~5 Q# }1 s! C5 BThere could be hundreds of BPX you could use to detect this trick.
* e0 P+ g5 k- V, n. l9 c-The most classical one is:
% T7 v" M7 ^* z BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||1 }4 e2 d# V/ _
*(esp->4+4)=='NTIC' ?9 v, e, E0 R4 c' ~% p* A
4 [1 w; \7 h% M2 u# b# D( D! C-The most exotic ones (could be very slooooow :-(6 N4 _7 Y+ \7 c, V9 g" N t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 B; m+ @0 D- }: ~
;will break 3 times :-(6 e% T* K# t9 Y/ `- u: C; `; _
: U q6 I$ T6 o9 {( w6 Q: j
-or (a bit) faster: * |* i2 c; y" O; b
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ @5 j: Q& l. Q0 E+ h6 W
3 Z2 W/ K: A/ n
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
" `4 d& `0 e1 X( p ;will break 3 times :-(: ?' p! B' ~3 Z( p# ]# B
+ x! A& `3 }* U$ N+ z-Much faster:
, R7 y% y) K9 H% _1 A6 J P3 J1 c BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: V/ R' J! x& l- ~* j
& e m; E; g! _4 q7 q, ^Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ P% e& _/ I6 p: k! Y( O7 ofunction to do the same job:/ `- O, y9 B! y' n- v' K
5 A0 O- n" Q4 }4 d, ^ push 00 ; OF_READ( }- U) B% E( k2 N3 k+ m6 _5 o7 f
mov eax,[00656634] ; '\\.\SICE',0
- ~' f) t7 j9 I5 Z) y# t, j push eax0 j$ ]1 k$ H4 s5 a7 T- I
call KERNEL32!_lopen: w8 `5 b) W: p6 @2 Y/ v) d
inc eax
3 Z: i# L8 u4 F4 V9 U) s2 l jnz 00650589 ; detected
4 r# e& N5 i0 v- M- ]( y. i push 00 ; OF_READ
0 K6 N( S9 a& s4 n# P mov eax,[00656638] ; '\\.\SICE'; T: U T% }- T+ r, E
push eax
1 E$ ~, d) H$ d7 Z call KERNEL32!_lopen& A: A- p4 w9 r8 E) C1 ?) \# `+ y9 U
inc eax0 ~. y u6 k. f. v
jz 006505ae ; not detected
0 e2 ~0 c, B4 k$ @( ]' l: a
$ `* v" u5 } ^) j+ ]" I. G- T: B6 c# ]( |
__________________________________________________________________________* W- ?, n3 q V; H5 o6 b3 z+ Y
: M! S4 p: G! j; n1 o) g' ~( F
Method 12
6 M' L( `" G, q8 ?+ h=========3 W, j- ] \) c
6 c$ x5 A( H- MThis trick is similar to int41h/4fh Debugger installation check (code 05
& Z8 k6 p$ e3 }+ t: ~& 06) but very limited because it's only available for Win95/98 (not NT)
; Q& j0 Y" S! e3 M9 v( ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ i) ^* }- j+ c* y) ~) @+ P
4 n! G, H$ F- p8 t# C8 \8 R push 0000004fh ; function 4fh
# g/ w4 p; f5 r6 e* M) p: k push 002a002ah ; high word specifies which VxD (VWIN32)7 M( ^- p, l" m/ n, k
; low word specifies which service- R- L$ N$ G0 L1 i2 H% X: S
(VWIN32_Int41Dispatch)6 u3 c0 e$ w1 R' o& R* y7 @; @1 _
call Kernel32!ORD_001 ; VxdCall
! X7 k2 i7 e' j& N, _+ Q8 S cmp ax, 0f386h ; magic number returned by system debuggers
1 Z/ y5 j! y: U/ T+ B5 R jz SoftICE_detected
" m) r* V/ l0 G, H/ h8 b# P0 R" y+ C- ~/ K- u
Here again, several ways to detect it:
! _) b8 I4 `. x9 {
" z7 I, V' x2 q! p# G BPINT 41 if ax==4f" b! Q# x* I# m9 H2 L" z( W+ w
+ Q7 A0 h* [! x1 }! g5 n# \. d y
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
/ _& @: Y8 m$ r
; {0 k% s& i$ D$ m BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 C9 ?3 T' c1 K5 ~* p* A) |* ?( @$ i9 B
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 R* o. B( @' M$ F# y" h( F0 q/ X8 x* r6 ^2 J- y8 F* H
__________________________________________________________________________
- h: b# T8 P, g* f6 W6 e4 f0 I. Z9 P$ ?( R5 x
Method 131 h9 M u2 l2 G W/ s1 k
=========7 ^. V2 ^9 H6 i& i
0 Y/ l% q8 `. _1 @
Not a real method of detection, but a good way to know if SoftICE is6 |$ C8 [9 E4 f% Z L$ d; I" E& [
installed on a computer and to locate its installation directory.5 e) b, M' Y4 r0 k! m+ G9 M; ^
It is used by few softs which access the following registry keys (usually #2) :% ~) [' \/ v. c* [, R
# e" w7 c" m L" g) N$ m2 o! x# m-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 U3 \% d3 {, ~6 t; {\Uninstall\SoftICE; l: }/ o# [5 e' d4 ?
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE+ D# E$ u% M, C- K8 X8 Y
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ g7 X8 N1 G9 a2 J
\App Paths\Loader32.Exe
, T: l4 @- i/ j' ~% g# S( U: V! O5 C0 {
0 a5 N0 T& _0 S- _& @
Note that some nasty apps could then erase all files from SoftICE directory' E# p6 Q# C I! X+ q
(I faced that once :-(
$ }9 j+ v4 m# {7 P- o$ Q3 p2 `1 y, _: m2 d
Useful breakpoint to detect it:& X; M; C8 `$ i* n$ i/ r; y/ W% w
8 [" N# V6 D; Y; v- O' C4 b+ K3 Q* K BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 I% T& H8 ~4 X) @
* V" h, z$ T/ E: i6 l__________________________________________________________________________( R9 O$ i8 G9 \" i2 z( M4 B8 D: K
1 k6 d6 h) D! H" |/ B9 h( n! S# F
% u$ K. f2 x4 |( ZMethod 14
( s2 A+ M1 F- P8 Q) f8 `8 |1 M=========
+ ]$ P# ~( D2 q& {/ u" S
' i. k+ @7 k* z9 W8 {A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# R& W: E7 g9 U. Z* v$ i/ \is to determines whether a debugger is running on your system (ring0 only).
" }* i5 Z; {5 L4 w. i; x6 G4 l) E9 z# p; j
VMMCall Test_Debug_Installed
# E; R- {: s' M; E$ a8 }& c je not_installed u' d! j+ I' s# G$ x/ o# {6 S
* o) m6 i0 W; {# }% ^( K0 O
This service just checks a flag.
* i) }' B. Y4 l1 J& S% n0 F</PRE></TD></TR></TBODY></TABLE> |