<TABLE width=500>9 @2 n' h r3 q2 g3 Y9 P2 `1 d) H4 i9 f5 O
<TBODY>
( U/ b/ P; Y3 ~5 ?<TR>' ~: v3 _& s5 p# d) m9 e% S
<TD><PRE>Method 01 4 k2 r. z9 b: d) @
========= T3 X/ m% E; T
8 c8 ~* {+ S* o
This method of detection of SoftICE (as well as the following one) is4 ]1 r1 s# u# \, g
used by the majority of packers/encryptors found on Internet.; x& A u$ Q( |7 D* P5 M
It seeks the signature of BoundsChecker in SoftICE# i$ J' X8 D' L* d0 u2 L
, I, r7 d! v1 ]7 g. m& } mov ebp, 04243484Bh ; 'BCHK'
# G" Y# y9 S# v4 _/ C mov ax, 04h# ^3 a6 U" [! T! ?4 X
int 3
7 A- ` o$ J- L# i v) o cmp al,4
' X6 Y' D& {8 E: z; X3 r0 w& `+ f jnz SoftICE_Detected0 L1 ~3 C8 L, P8 _
# S) V& W4 s! o% x0 h5 b1 p/ f4 y___________________________________________________________________________% c- |) s' y3 c5 Y$ G
* ?) O2 T# y- o+ J" k) g9 x
Method 026 r* }& }2 Q1 r7 u2 S6 _2 c4 p
========= U# @& i5 I" p
1 E7 P: ~9 V% b: R; ~ b
Still a method very much used (perhaps the most frequent one). It is used
, }, ~8 d+ e4 N+ ~! m! ?to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
- {9 M; n0 }( P/ p3 Nor execute SoftICE commands...+ O8 p' h) }5 Q! N; x" Q" N
It is also used to crash SoftICE and to force it to execute any commands
4 R5 }2 v( F8 N, j. n9 p5 H- P% V(HBOOT...) :-(( J6 E# z5 b3 o# h X o: F
1 U* n* E3 \+ g
Here is a quick description:, Y1 n8 L6 N! ]1 V1 @ i) K
-AX = 0910h (Display string in SIce windows)
# H a/ i4 M0 _. |3 y/ ?! O! } B/ T-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
* b1 G; ]1 e2 T-AX = 0912h (Get breakpoint infos)) j& T, R2 y- r4 V' c
-AX = 0913h (Set Sice breakpoints)
8 o7 ]! k" Y& H8 g-AX = 0914h (Remove SIce breakoints). t* K8 L5 S: O3 f3 \9 S
+ _; Q' |8 ^) ~. HEach time you'll meet this trick, you'll see:$ j' [3 m5 Z5 G1 `* Q
-SI = 4647h
( Q& ^4 [# z- J0 M-DI = 4A4Dh
7 X' c2 J+ f- r+ [; BWhich are the 'magic values' used by SoftIce.
: n: @4 t2 t( @* K; ?6 hFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! ?) V. t! o1 t2 P% | ~' S8 {* e$ q( B5 ]$ k" f, B: D# ~
Here is one example from the file "Haspinst.exe" which is the dongle HASP' X* a# b! z3 l, w* A6 }0 b
Envelope utility use to protect DOS applications:
% M+ T% ^. c: ?5 a
, u, F' a6 S% L s* e' j" }5 L. [. }: M5 M1 k) {
4C19:0095 MOV AX,0911 ; execute command.; ~- A9 E& n' ?( Q1 T$ T0 V* a( n
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
1 S6 U' [9 h# B1 ]/ ~4C19:009A MOV SI,4647 ; 1st magic value.
& t. J7 P% m( S/ s7 z4C19:009D MOV DI,4A4D ; 2nd magic value.7 U9 L* O, w) [
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)/ [+ p* M# ?8 b
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute9 w) O! l5 `, z9 B5 E- Y) u
4C19:00A4 INC CX, D {# Y6 k, D, K. l" p& v
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
2 i. @4 V ~3 l4 R& _9 `4C19:00A8 JB 0095 ; 6 different commands./ s* |- h( \* j1 c5 T
4C19:00AA JMP 0002 ; Bad_Guy jmp back.: V9 j4 ~/ v2 d% R1 x. Z3 M
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: H/ D v2 A/ F. R; c% N# t" [ p& _3 d# O
The program will execute 6 different SIce commands located at ds:dx, which
! t6 K9 C6 s1 D' }are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# d# x) Q. \% u, S2 V
2 w/ L! F) L5 }: C+ Q9 s! B
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
7 R0 y7 ?( M$ Z9 q$ \+ Y___________________________________________________________________________
0 W2 |; b/ T( A+ S* F( l
5 x+ j. R/ V5 x1 [& |1 S
$ r; z7 ?+ E' `3 {: z* u: PMethod 03
- |8 G8 N$ y) A# ^1 f=========$ @8 P3 L P7 V3 j! s% r, A; s
$ S8 s- n: ~$ p3 z3 U: q: D7 WLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! `& E0 g N6 o& X7 D' N
(API Get entry point)
, R$ H/ a, i2 U# S4 M0 {& v( R 6 L+ s) A3 {1 z2 |
$ Z8 W) d' D7 i/ f xor di,di- S6 U7 N3 o6 v; {* p2 U
mov es,di
2 u+ _# x7 M | mov ax, 1684h ( Z1 Y# a' a' {* y$ w
mov bx, 0202h ; VxD ID of winice9 [3 ^/ N$ ?% B6 z4 C ` W# s% _
int 2Fh
8 w5 d6 x% G5 c0 i mov ax, es ; ES:DI -> VxD API entry point) l6 k) g7 e* z H4 g6 K
add ax, di5 B P% W h& u8 v, o
test ax,ax
7 q# Y$ z4 K& @1 ?7 ` jnz SoftICE_Detected' u. F" B' t" J- p" V4 N1 B
- w& o& g5 V# K7 z8 k3 g! e6 H
___________________________________________________________________________
* [0 e; s `4 {7 Z6 ^8 b _" Q3 @& E, Z! D: f- @1 b! y& u4 R' b
Method 04$ N! o4 y' C* R5 v
=========4 v( l4 Y/ I) d6 F6 d0 x
' R8 u8 [5 b5 ?! i0 U
Method identical to the preceding one except that it seeks the ID of SoftICE/ u+ k/ |& f5 ~# B- _+ w% Z; ]
GFX VxD.
% q- x0 s. j' ?9 m: P# \& _, T* i: a% k
I7 i5 _0 I7 `3 G0 ~ xor di,di
, C7 r# E$ o4 o1 m mov es,di2 Q" d+ c, Q! I: Y6 r- ^" C
mov ax, 1684h 2 j2 n" ]! U' S! U( U* `0 c( s
mov bx, 7a5Fh ; VxD ID of SIWVID
6 D) V; t1 d: ~( p+ D int 2fh) v: o1 w) U, ~+ H- B
mov ax, es ; ES:DI -> VxD API entry point
; `) f; W6 H7 g- y( n add ax, di0 { Y+ p6 Z3 M0 B: u& ~
test ax,ax
, G3 i6 }; P' ?1 Y* I5 d jnz SoftICE_Detected
9 J5 z- n7 {* O2 O- m+ O6 @) M+ E- Q/ E" f+ Y
__________________________________________________________________________
& M+ |0 ~3 m- e, w) }; O
: V+ b. K7 h& G7 p; H3 M4 n' ~
Method 05
. u% g/ s- p, h5 [7 P=========9 a8 ?% y9 a( D" k
+ Z7 B9 H* o. BMethod seeking the 'magic number' 0F386h returned (in ax) by all system! @% Z h0 L3 j4 C, S+ O
debugger. It calls the int 41h, function 4Fh.
8 i9 Y; E2 d; QThere are several alternatives. 3 k4 ?9 P- C8 N* q/ H8 u" a
7 Q+ q' q7 r+ {1 A n) {2 Y) f; A# sThe following one is the simplest:2 [! V- \% C% n5 X1 r
7 D1 Z3 V. o- M+ d4 Q1 \
mov ax,4fh& o6 D2 _ A! j- O% j4 M
int 41h
: w9 N$ s+ W+ N# X+ r cmp ax, 0F386
$ `7 \9 k* N" |' U0 Y) ]# t jz SoftICE_detected
5 m. N# a. e# f0 O) _3 V
2 \! `: o" B2 \/ x w/ G- S" y+ z/ t4 G/ ?& J! {
Next method as well as the following one are 2 examples from Stone's 6 u/ I2 m }( r; L# f
"stn-wid.zip" (www.cracking.net):5 }1 W; W: V% P) L/ s
, |$ u( Z- U1 E! ~ mov bx, cs
6 a7 Z, N$ L1 ]/ K8 E lea dx, int41handler2, e& g8 ]9 w% U& |
xchg dx, es:[41h*4]6 b# C/ \0 S' ~9 E5 z
xchg bx, es:[41h*4+2]
) u) |& j7 n2 {8 r: p) O( L mov ax,4fh ?- [) U& i; z5 z2 l
int 41h4 M- O9 G6 ^! q D, t, c5 \. h# p
xchg dx, es:[41h*4]
# [5 L% a4 i! R xchg bx, es:[41h*4+2]! } |- p) Y; n2 ]
cmp ax, 0f386h
# ?/ N4 O. Y4 m8 S8 }& S. L [; [ jz SoftICE_detected
" O/ u3 m6 n% \# V0 Y" P
( o! n: e& }, U9 H: n3 H( Kint41handler2 PROC$ _8 @1 N4 ]1 v( v% O& K+ h/ f
iret
5 g8 q ^" L+ k# H& Hint41handler2 ENDP' J- o' F: o5 w( |. e- c
1 j7 L* [' c- s0 Y& T, z8 r
5 {1 k. s0 C7 ~8 \- |. E
_________________________________________________________________________
1 t/ |( A5 q; a: ?) G6 E
( w5 {% |7 C- ]
% E* N+ t, h2 H' X+ W P9 NMethod 06
0 y. }% I6 n2 w G% B=========: n$ s# k: l- M5 S( ~ ~8 @
( d3 `$ ^# t3 r5 b) s. `/ Z' E1 d$ M
* k* m* r( F. H- f( Y4 F, G
2nd method similar to the preceding one but more difficult to detect:3 f* {% W5 v+ o" i: l4 ^
% ]6 b4 _2 m3 o6 o B* S
$ C- B: U( p4 p& p. S, Gint41handler PROC
2 T5 K2 ^" z" L# Q; g( ]; Y$ o9 r0 b mov cl,al- u$ J3 s1 I( S$ G
iret% x! P, k& s7 n- R( p- u
int41handler ENDP
0 S B a7 p! M+ F$ `
0 I8 w. @! l) e" u
" Z! D5 U7 S( w+ [: R3 B xor ax,ax* H& S9 y1 S: G- y7 v8 W& M* ?3 v% T
mov es,ax9 {2 M" h! T- G
mov bx, cs
2 \0 \: t# {- i- P) x' {3 s lea dx, int41handler# J% k* E9 I& ^% L+ `' O5 ?
xchg dx, es:[41h*4]
. }# ^! H) }4 z g/ }+ \8 } xchg bx, es:[41h*4+2]1 d4 L( {: L8 X- l* c
in al, 40h
& J5 e6 t$ H" [% c8 e& E/ L xor cx,cx: ~. O r; }6 U& I+ E% h& i
int 41h0 _3 ~/ J- h5 Q3 s0 f" I( Q
xchg dx, es:[41h*4]. o; h5 M- r k! t4 b
xchg bx, es:[41h*4+2]
& y8 r7 Z5 B" q2 P cmp cl,al
; Y: g# O2 n }: ?2 i& }% o jnz SoftICE_detected! d; o/ n: X# m; a/ H6 w
. R3 X' ], T7 m; s0 V_________________________________________________________________________& w; m9 d; @# R, M4 l1 o
0 |6 H& p9 a( ^% r$ ^, e/ Z( p
Method 07
6 d/ e! B$ ^5 K5 l=========
+ z& T5 f- Z" j5 Q6 b
- |+ V2 \; n8 ~Method of detection of the WinICE handler in the int68h (V86)$ W& S4 q8 Z' |$ n
+ W0 V$ w# a% r D# c1 I
mov ah,43h
& I% X3 k1 {8 f% H% B6 f int 68h3 Q% a* B2 l4 [: ]
cmp ax,0F386h
. m7 M8 t3 J# x1 a, o, k% H- q" ? jz SoftICE_Detected& Y/ l' J! s* |8 s/ K9 L
. T% ^% @+ k' c0 u+ }
4 s" q5 t6 S$ V7 }2 I) |=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 L/ Y! E/ F! G9 G; D app like this:0 p+ B& i+ G3 r9 |$ L$ |$ z9 c
& f# l T6 Z, g7 u$ q# }
BPX exec_int if ax==686 L- M/ b' E4 E9 P% Y
(function called is located at byte ptr [ebp+1Dh] and client eip is
% [- W- V9 K. C+ i/ y located at [ebp+48h] for 32Bit apps)
{" E. I; k* L/ w__________________________________________________________________________
" S* C4 p. M; t1 H* D- m% V$ ^7 P6 S2 J3 Y% \# j: ^7 _
% R% V0 _7 g7 H s/ D6 Q; [9 z" C
Method 08. u% s4 Z) J( @- c0 s
=========$ o# u9 T1 [2 H
1 d/ y5 r3 v4 z; J' X& W$ H4 M
It is not a method of detection of SoftICE but a possibility to crash the' ]: n8 y! l, }3 b1 s
system by intercepting int 01h and int 03h and redirecting them to another
) b6 X8 u3 Z3 `4 [1 yroutine.
; E9 |8 C3 C" w: U0 YIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points: L' B& j' }( z
to the new routine to execute (hangs computer...)0 k; ^6 g% n" I, D
+ F. @8 `- U% e; s mov ah, 25h
2 ?3 P h% {+ X& u! `, X# @ mov al, Int_Number (01h or 03h)3 u& w5 r# ~, m% P, ]3 s# R
mov dx, offset New_Int_Routine
& [; P6 F ?% @2 _0 b9 I1 c3 _ int 21h
2 Y0 j/ q7 i! l0 S1 L# u% y. \# e: I' u, J- Y' m3 t3 @7 N
__________________________________________________________________________+ Q" E7 K% X- {! P4 h; \. r5 H
7 X9 m; L0 D0 r0 P& PMethod 09% C' N7 u8 H. Y4 d5 E. {# i
=========6 j5 p, `1 c* P& e9 _
$ L/ A5 g" ^2 Q% E
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
! j/ P$ v; {/ I% e) T9 Y" F" k/ Jperformed in ring0 (VxD or a ring3 app using the VxdCall).9 J1 B1 |5 S c4 V- I
The Get_DDB service is used to determine whether or not a VxD is installed
& Q4 e0 A1 t% v; K* Ofor the specified device and returns a Device Description Block (in ecx) for, a' R' ~5 j. X, j( P
that device if it is installed.
- M9 J1 C6 O! ~/ {# c8 ~7 m$ \6 E! b6 [4 Z+ ]% V5 `# R% G$ S+ G
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID6 Y& o6 ?6 ^8 K
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- N% Y- K& t3 \8 P* M9 ? b& j
VMMCall Get_DDB" v0 @( I* M5 Y' C
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed! q+ U. p O. ?' }
]3 M% _, A) w+ V! U, L/ R% N
Note as well that you can easily detect this method with SoftICE:
+ a/ E+ x: }! R1 f+ u. H; T! W bpx Get_DDB if ax==0202 || ax==7a5fh9 M3 w7 E+ F9 i, {
0 p4 n- T3 L7 {__________________________________________________________________________
7 U2 j$ K; Z! I7 @% g
" `/ s) Q3 o' m5 r+ H- ~ D( ~Method 10
- G9 K+ ]6 W% A7 E4 C=========
; ~* J9 e. Y* A L9 h* |
% G& w1 v k: X/ |. I' Q=>Disable or clear breakpoints before using this feature. DO NOT trace with
2 M* c' y! `; y$ h5 b1 q4 n" L SoftICE while the option is enable!!- A3 A. a4 G7 u9 j, Z
- ]) q8 x* |: E2 J8 QThis trick is very efficient:
0 L' [9 c! j9 A- v( a4 w0 ^by checking the Debug Registers, you can detect if SoftICE is loaded3 P6 E* n( e8 w# ]
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. K, ]$ O+ [8 vthere are some memory breakpoints set (dr0 to dr3) simply by reading their$ }) W' t" a5 T' e) K# _
value (in ring0 only). Values can be manipulated and or changed as well5 J+ K& m% ^5 i/ [' O4 V0 V
(clearing BPMs for instance)
) n1 _. c1 d) s3 `6 O2 C( \5 J3 H( C# G& @& S ?! j {9 i/ O7 e
__________________________________________________________________________
: m. `/ `. O: v) R" W
' {& |3 Y W3 X* j0 s* \7 @Method 11
* l' v/ ?6 P1 \=========. P* V* d# N& g" u
2 N- @3 Q, @4 F( z9 J) V. l5 w
This method is most known as 'MeltICE' because it has been freely distributed2 }, h& d' z' \" W( w& s
via www.winfiles.com. However it was first used by NuMega people to allow! M# L6 v, _/ f1 N v, S' Q
Symbol Loader to check if SoftICE was active or not (the code is located
" Z2 X7 ?0 O: |- m* n) j. Einside nmtrans.dll).. T8 l6 I6 W7 O+ Q
2 T9 z# t# j. q/ d+ c# K1 n: \
The way it works is very simple:" D. V' w2 B1 ~+ [7 j6 o
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
l8 f5 q( F/ j3 Z2 dWinNT) with the CreateFileA API.
" ^0 W* w7 T6 l2 O4 i+ B: P3 n# x1 [. X9 |5 t& l3 f
Here is a sample (checking for 'SICE'):) K$ B, v/ A; m
# b" a1 C3 E. v* l+ IBOOL IsSoftIce95Loaded()
6 Y& g. o+ Q/ ]4 M1 N( s{
0 C4 M% q( Y$ m5 x- e HANDLE hFile;
3 [! W) |$ F! q3 e$ I: Q hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! K& T8 e' c1 X0 k# j3 S1 ] FILE_SHARE_READ | FILE_SHARE_WRITE,
; Q) z9 z- y3 W7 V7 k+ I2 f+ p NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 a: v& |7 D1 R: B& K) y6 j6 O& R
if( hFile != INVALID_HANDLE_VALUE )
' A- }; F K' I {
1 a; o4 G2 l8 J3 `/ t+ i7 r CloseHandle(hFile);; Y' [8 y. q7 ^+ Y# S
return TRUE;& N+ t* Z. d: c6 i2 N& H9 H
}
3 ^% P3 u+ e- ?4 s1 T return FALSE;/ A# S; v: v7 o$ A( H
}
( }! u" y3 e/ ~' x9 W( u8 C1 R$ N4 m6 e6 {: w" V5 f/ U
Although this trick calls the CreateFileA function, don't even expect to be2 e! T2 z" _6 m9 Z% C/ B0 a; f7 K
able to intercept it by installing a IFS hook: it will not work, no way!# y- |* w+ A/ Z& e1 F
In fact, after the call to CreateFileA it will get through VWIN32 0x001F3 b# u8 ~. c% }" C
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 k; c' [7 }. zand then browse the DDB list until it find the VxD and its DDB_Control_Proc$ r. {7 d$ n. l
field.7 u: p b) i8 B+ N3 o2 w
In fact, its purpose is not to load/unload VxDs but only to send a
Q$ B/ o! D# EW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)' ?2 x/ V/ G4 M* Z4 I7 m+ r
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
8 G1 H) s% z" H n+ R! P: mto load/unload a non-dynamically loadable driver such as SoftICE ;-).
% L' S% k. e: R" W: E* R" k& f4 HIf the VxD is loaded, it will always clear eax and the Carry flag to allow/ d m7 H# z' m
its handle to be opened and then, will be detected.
/ }. Q! h2 V- R% O& }7 M# ]& XYou can check that simply by hooking Winice.exe control proc entry point. @: {: e3 T7 w M
while running MeltICE.. t, R' w& x* k& H$ O/ C
' G5 ?. ], L4 y0 e: H2 B, x
, v8 v- Q$ G: S3 s
00401067: push 00402025 ; \\.\SICE
) Q0 d! c5 n, ~2 G7 J( t0 b: C 0040106C: call CreateFileA6 b8 z* a# B Z" P4 [. `$ R
00401071: cmp eax,-0018 P1 L ~9 V' q: d4 U5 `. U
00401074: je 00401091
/ B! v1 N6 o# I& g. Y5 \3 u, X3 }# u/ F
3 j0 w( k3 R3 ]& C5 ]& R2 ZThere could be hundreds of BPX you could use to detect this trick.1 K- Y# v9 t r' n8 G
-The most classical one is:4 A8 e1 T( L5 ?) y$ f! @
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||. D7 r5 r! e* x* Y5 U7 c' n! V" ?
*(esp->4+4)=='NTIC'
1 q& Q0 {& ^ n5 J: o, r0 v$ v7 A
-The most exotic ones (could be very slooooow :-(0 i& B) j4 y Z9 Q4 ~
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 x) z8 R, P" E
;will break 3 times :-(0 l6 C4 e$ O$ ^& g
# ]9 U3 ?3 K+ r \ w- T
-or (a bit) faster: 1 V8 o7 B2 o: S0 A6 a; L; G
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" H& p. M& I4 Y! F& M& `0 \
- n# u2 t+ O+ e% t( f, X2 ^8 x
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ( e# X# ~# t8 i8 [; S F
;will break 3 times :-(, o/ J" R$ G+ J; G
. L' k m0 L$ w6 w5 U-Much faster:; s& H8 V0 j b; m( f, V
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. `3 g$ a) s, [% ~3 d6 |
3 K% v$ k0 m. w
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ p9 E6 Y* a1 r1 j7 ofunction to do the same job:+ Y2 m+ A( j. {
5 [' E- l7 _6 T; T; R8 n push 00 ; OF_READ
( |( y4 t5 `- s. x& i mov eax,[00656634] ; '\\.\SICE',0! p/ c! y0 H$ l$ F% Y2 c& |
push eax
8 t* m. }/ [3 D# B. \ call KERNEL32!_lopen
, v- O7 g/ _. F( @ inc eax
$ P; x% |7 Y1 Y8 F( F5 u4 O jnz 00650589 ; detected
6 z; S5 }' i7 ]3 \ push 00 ; OF_READ
, G7 [) ^% v; u* W mov eax,[00656638] ; '\\.\SICE'
7 |, B3 _6 U; P+ v' n* N& {( a push eax
' h$ [1 _9 v3 m- l call KERNEL32!_lopen$ }+ n0 L2 V- u/ U6 [. K3 b
inc eax
1 a& j+ B6 w! o jz 006505ae ; not detected% [* ^/ g' w/ E) F8 P2 J
- t) w* y* v, y0 D _ E. E9 q% y5 H2 D! Z6 o
__________________________________________________________________________! k9 e9 F1 H. v) C/ X5 v
4 F( T6 Q3 G& c$ n' u. K! WMethod 12
- @* L' A i; ^0 h0 S) d=========
4 T$ p% j# t: ~) Q+ o' p# A/ L3 s8 ^" l+ ~8 Q- {0 y
This trick is similar to int41h/4fh Debugger installation check (code 053 N) ^$ m* y- \) m
& 06) but very limited because it's only available for Win95/98 (not NT)
2 Z" {1 O* }3 G0 n0 T" S; t# u+ }as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ T: u+ Z3 B0 @
, t+ r& ~! O' p9 w9 z9 o push 0000004fh ; function 4fh. V: Q) e6 _0 A4 R' j
push 002a002ah ; high word specifies which VxD (VWIN32)3 Q" f# M8 c( D' _
; low word specifies which service
+ j* G, o" W# t7 Z/ C. V. l (VWIN32_Int41Dispatch)# ^, \6 q/ w, E& R2 E) z
call Kernel32!ORD_001 ; VxdCall; a) E# r# B; R/ z8 ]
cmp ax, 0f386h ; magic number returned by system debuggers. |) @( I) t/ x' o0 C
jz SoftICE_detected
5 ^6 v2 n& Y$ }8 R% `
/ _ x5 ?: ~$ ?3 ?7 }& r0 N3 ~7 nHere again, several ways to detect it:
; a" P* l8 |9 W6 N: \ E1 n4 G/ K+ U" @
BPINT 41 if ax==4f
0 {) ]& i2 z4 M$ Z1 H$ \/ D |! ?& e% `
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; o# i5 e( s$ C: v. T% c# \' c K: d) R6 I$ N) P5 s
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A4 P6 k! t6 j- |3 w" ]* N
! t( z" @* z0 H4 j0 m7 g* ~ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ B* d* v& i) w# G% M+ F1 i- r) D+ }& }: `# e
__________________________________________________________________________
`/ x( V/ O2 q/ b: i! S& x
) L% u% N' |; B$ b5 L3 t/ SMethod 133 t. @1 i- d: O, t
=========1 R2 A* m( [6 `1 L" D
$ ]3 e* s) [ V3 q" Q; Z$ C4 D
Not a real method of detection, but a good way to know if SoftICE is
7 f+ y; k5 J" X0 ~% e% S3 e/ v+ W. ~installed on a computer and to locate its installation directory.
6 b& b5 B _" L$ b0 E+ Q, z8 _It is used by few softs which access the following registry keys (usually #2) :& ~3 W+ S# u" [+ c7 x1 Y. c
) b' Y1 H. V& {! s0 k9 q-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, v4 O$ m9 k$ R4 W3 j G
\Uninstall\SoftICE
! x6 r# t5 Q# p. I, m( k& g) B-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) c4 c! i# l8 n8 a6 Y/ K$ ?-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 _7 I4 e. f, }1 N5 T( A4 v\App Paths\Loader32.Exe
) ? D7 m b( Y6 ]4 i* r7 a! L9 e$ D
7 N; }' m3 u0 X
Note that some nasty apps could then erase all files from SoftICE directory
4 Z0 v) g8 M) y% Y(I faced that once :-(: C6 ]) z$ O6 j' U4 ?
$ f9 H. \% y3 j( ?0 SUseful breakpoint to detect it:7 B# W) f; F2 I9 N, [( X$ t
) t8 d: m6 g, X7 a BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'$ r5 D- L9 G/ a6 E% T* i: w& M
. q2 t* Q: m. `" z. @; ^
__________________________________________________________________________+ W4 f. O" I9 P1 R5 E
5 u2 Y, V, k3 I( k1 f# b( P1 e" e: R% k
Method 14 5 |* L9 H3 j$ A- |) O9 F7 t
=========
. D& Y( p+ Y* [3 i5 W9 j/ i6 K/ w6 Z" R! z W0 B8 W% X/ }
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) h. W/ Z# H$ s, y4 M6 Y, ~& k1 Gis to determines whether a debugger is running on your system (ring0 only).0 [1 N4 X/ W' B6 `: F
& m1 y3 [8 M8 b1 b3 @; g2 v. E
VMMCall Test_Debug_Installed3 r, W& x* K7 G/ `9 q/ S8 E4 S0 L
je not_installed; `. }0 z2 O5 K, J0 ]; q; L
3 b% R4 ?% |0 iThis service just checks a flag.
' V) p8 u X$ [. f% O</PRE></TD></TR></TBODY></TABLE> |