看了一下惊恐鬼屋Scratches这个游戏。
" F* _3 N* I( Q; {- `5 o包文件有2个,scratches.res和scream.res,
7 h; c: [7 A" p+ u: W包文件的格式如下,可以用Game Extractor来解开。% I6 K- \! n& f9 p) A
http://wiki.xentax.com/index.php/Scratches_RES
) X, s0 }1 E/ x+ L$ I' }9 V从scratches.res里面解出一个font-michael.tga文件,就是在游戏利用的字体。- N% s' Y" `- Q
scream.res里面也有一个字体文件,但是游戏好像没有用到。
( T. w! T7 R2 {; `1 N' q( U- K# c1 c/ q6 g& R/ I4 E. T& c
用OD调试后,发现这是一个使用opengl API的游戏。9 U6 @2 x; }5 c2 N s, Z
在某句字幕上下了内存断点,断下来之后找到了和显示有关的代码段。
5 U; U7 [! O) B! M8 O5 a/ j- Q& a6 Y$ O. [* u$ B' i8 s
0040C5D0 /$ 53 push ebx5 N+ m% V0 O" r& V( d4 X
0040C5D1 |. 51 push ecx
( D( O f$ G* ~( R. g/ ^4 D0040C5D2 |. 52 push edx
9 k* r/ s/ W# V$ J0040C5D3 |. 56 push esi
% D" F2 B9 ~' N0040C5D4 |. 57 push edi- `: t; s. T! {/ T) J
0040C5D5 |. 55 push ebp
( C2 ]$ k( J9 o3 E N0040C5D6 |. 81EC 10010000 sub esp, 110
& r5 J" y" v. @. O' n Q0040C5DC |. 89C6 mov esi, eax
" p/ W* k2 O) c1 b: _, e0040C5DE |. 89C7 mov edi, eax8 O, [0 w4 s1 m
0040C5E0 |. 29C9 sub ecx, ecx
2 Q! |9 x$ x* s0040C5E2 |. 49 dec ecx6 _( s- X5 Q& Z& U3 `- ^
0040C5E3 |. 31C0 xor eax, eax
$ { P& D5 F* h; q( @/ a2 F$ |( i3 I0040C5E5 |. F2:AE repne scas byte ptr es:[edi]
" k8 i, r4 A* `( v" z% }0040C5E7 |. F7D1 not ecx
2 B& n \8 } u0040C5E9 |. 49 dec ecx+ X0 B) H9 G1 a( v
0040C5EA |. 31DB xor ebx, ebx5 F$ c& G- i9 r4 O1 O9 q
0040C5EC |. 31ED xor ebp, ebp
2 s: Z7 V$ T7 Q0040C5EE |. 81F9 00010000 cmp ecx, 100( k% L! h4 ]5 Z% W5 p% R
0040C5F4 |. 72 0D jb short 0040C6037 A5 _* R6 G5 C# Z9 c0 k8 k% ^
0040C5F6 |. 81C4 10010000 add esp, 1100 |% ?6 _+ a% S
0040C5FC |. 5D pop ebp
) M" m7 y: T5 K! a. |0040C5FD |. 5F pop edi
! ?/ l2 J. g0 P" z" V- u& _0040C5FE |. 5E pop esi
+ u Y: X5 n9 ]0040C5FF |. 5A pop edx% S" q5 S) g1 b' {" j4 Q
0040C600 |. 59 pop ecx
. M0 X' ~& Q6 X. x0040C601 |. 5B pop ebx
0 z# r. }1 N" L0 y( g0040C602 |. C3 retn
) q: d- n- }7 \. D7 X' k0040C603 |> 89E7 mov edi, esp
: z1 u8 x: X. p0040C605 |. 57 push edi0 o" z0 ?0 r; G4 b" `5 U$ G* X
0040C606 |> 8A06 /mov al, byte ptr [esi]
2 {' J3 C+ T( c; ? _# \0 K a0040C608 |. 8807 |mov byte ptr [edi], al7 w! s9 w5 V. `+ R/ ^/ a) |
0040C60A |. 3C 00 |cmp al, 0
' L/ V5 t& D/ |% l3 B3 b( t& S0 w! ]0040C60C |. 74 10 |je short 0040C61E
* A8 C& c O$ Y/ o0040C60E |. 8A46 01 |mov al, byte ptr [esi+1]
$ q6 y( A! @- n+ N2 C0040C611 |. 83C6 02 |add esi, 2, ~, F" Y& m1 p0 R. p& ~, ?
0040C614 |. 8847 01 |mov byte ptr [edi+1], al4 T% X$ U6 b2 `, f! B0 i! `
0040C617 |. 83C7 02 |add edi, 23 n5 ?" `) R# [( g% p4 _
0040C61A |. 3C 00 |cmp al, 0! @! E# v& n8 F
0040C61C |.^ 75 E8 \jnz short 0040C606
7 h: U+ b/ r+ s3 I( z% A! o0040C61E |> 5F pop edi
2 e/ L& J. d& u( U0040C61F |. 8A1424 mov dl, byte ptr [esp]) u$ F! m7 s) a+ ]) l( [
0040C622 |. 89E0 mov eax, esp
C+ {2 ?9 C: l1 S4 _- o1 l0040C624 |. 84D2 test dl, dl
2 m6 q" U& W5 ]4 A0040C626 |. 74 09 je short 0040C6312 {4 O! E9 F2 w* O+ f$ N
0040C628 |> 8A70 01 /mov dh, byte ptr [eax+1]0 z4 k+ r, }: s4 J! A: f
0040C62B |. 40 |inc eax
2 o8 i, `& w4 s% h# D2 b7 g% [) {0040C62C |. 45 |inc ebp; u, }9 a7 _3 S9 C/ l G o# Q
0040C62D |. 84F6 |test dh, dh" v, V0 \. X* \) U+ T1 _) B0 u
0040C62F |.^ 75 F7 \jnz short 0040C6283 `: E% h O H( b! e% w6 D
0040C631 |> 81FD D2000000 cmp ebp, 0D28 f! t0 `; ?2 m9 f1 u
0040C637 |. 0F8E 61010000 jle 0040C79E! \' M5 N; S9 C* p' R
0040C63D |. 89EA mov edx, ebp
) k; n9 y$ b" ^; R6 v3 B0040C63F |. 89E8 mov eax, ebp
$ u1 A& q; m6 e$ a& }6 p0040C641 |. C1FA 1F sar edx, 1F
, ~" e! v/ _# w0040C644 |. C1E2 02 shl edx, 2& K& ]. {- |6 u+ Q/ n7 K+ T# a
0040C647 |. 1BC2 sbb eax, edx
+ u8 C8 u) L/ B" k0040C649 |. C1F8 02 sar eax, 24 L( f# o- F% {) Z1 j+ p* r
0040C64C |. 89C7 mov edi, eax
3 W7 {; B `+ ~/ z2 ~& r0040C64E |. C78424 040100>mov dword ptr [esp+104], 3
/ D+ q1 _( w% i Z2 ^0040C659 |> 89E0 mov eax, esp5 I- x2 N5 {- T, ^8 i
0040C65B |. 31D2 xor edx, edx3 L4 u! I- ~1 k/ B/ @2 O* H
0040C65D |. 8A0C24 mov cl, byte ptr [esp]
" y2 ]+ F! Z( t, D# f0040C660 |. 8915 8477EF02 mov dword ptr [2EF7784], edx
2 L, \6 E' f% w" E& Z0040C666 |. 8915 8C77EF02 mov dword ptr [2EF778C], edx* z2 `) m4 z: ?. ?2 j8 O
0040C66C |. 899424 080100>mov dword ptr [esp+108], edx
7 Q4 V+ b5 n9 B! I1 e0040C673 |. 89E2 mov edx, esp
, [( y# ~1 a2 Z. V" m0040C675 |. 84C9 test cl, cl
; E4 }& I. ^* H! R6 ^' P) o0040C677 |. 0F84 89000000 je 0040C706
5 l0 h8 o4 ]! l @2 a9 z0040C67D |. 8B8C24 040100>mov ecx, dword ptr [esp+104]
/ |. ~4 D/ s; c' X6 ~, c0040C684 |. 4F dec edi2 A1 @/ n; O2 U8 X; P' y7 Q
0040C685 |. C1E1 02 shl ecx, 2
7 O5 b/ a7 t" O, ?0040C688 |. 89BC24 000100>mov dword ptr [esp+100], edi1 {0 M% T9 ^2 o0 u/ I3 A& L
0040C68F |. 898C24 0C0100>mov dword ptr [esp+10C], ecx9 p5 p% D- |' Z! j3 g8 y' W4 s
0040C696 |> 8A0A mov cl, byte ptr [edx]( H6 p4 X( z% V
0040C698 |. 80F9 20 cmp cl, 20- S+ n. S- i6 a& m! y
0040C69B |. 0F85 6A010000 jnz 0040C80B5 y u# a; ?' ?6 T
0040C6A1 |. 3B9C24 000100>cmp ebx, dword ptr [esp+100]
- H" h8 t# `# _/ x, J/ ^0040C6A8 |. 7C 53 jl short 0040C6FD& [' k( }( m( r$ @8 x! D! H
0040C6AA |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]! h4 {. \9 x: J8 u; ]4 G
0040C6B1 |. C602 00 mov byte ptr [edx], 0
! C" e4 B) O, Z0040C6B4 |. 89C6 mov esi, eax
U0 L5 b4 O. D$ ]0040C6B6 |. 8BBF 7477EF02 mov edi, dword ptr [edi+2EF7774]
8 X9 D0 s9 g9 Z+ a0040C6BC |. 31DB xor ebx, ebx" P) c- U! I5 E: f2 M2 L ~
0040C6BE |. 57 push edi% H- R/ R" |( Y. K" ^
0040C6BF |> 8A06 /mov al, byte ptr [esi]* o8 m1 F( x9 y% ]0 y, O' }4 h( _0 g
0040C6C1 |. 8807 |mov byte ptr [edi], al2 {- z1 D t1 a6 Z: G% N' c
0040C6C3 |. 3C 00 |cmp al, 0
6 D8 z5 O- w) ?) ]2 o1 g O% P0040C6C5 |. 74 10 |je short 0040C6D7
: D2 r3 Y' h/ A7 D0040C6C7 |. 8A46 01 |mov al, byte ptr [esi+1]
; B" L6 @# H2 L* }7 S w0040C6CA |. 83C6 02 |add esi, 2. j; ^+ I7 p) } D# O
0040C6CD |. 8847 01 |mov byte ptr [edi+1], al' v; [1 @! k7 X, b9 a: m
0040C6D0 |. 83C7 02 |add edi, 21 X. h J8 O0 A8 T1 v& _' W
0040C6D3 |. 3C 00 |cmp al, 0
T6 I) `/ |5 S% ^0040C6D5 |.^ 75 E8 \jnz short 0040C6BF
9 c1 i6 X2 a/ L' O& L0 }, y0040C6D7 |> 5F pop edi5 _$ i3 ~2 M9 u2 o* T& ^0 g
0040C6D8 |. 8D42 01 lea eax, dword ptr [edx+1]- m( Q# N+ [# {$ f
0040C6DB |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]
7 n7 x( N: u9 o( H6 w; v, B0040C6E2 |. 8B9424 080100>mov edx, dword ptr [esp+108]) B' F7 V4 p( Y1 z% H( ]' @
0040C6E9 |. 83EF 04 sub edi, 41 R; Y( ^6 ` R
0040C6EC |. 42 inc edx
8 {8 z" C: @, Q- r T8 N$ V% |; J0040C6ED |. 89BC24 0C0100>mov dword ptr [esp+10C], edi
1 N4 x1 c/ W1 _# w+ Z0040C6F4 |. 899424 080100>mov dword ptr [esp+108], edx
' n, h% ^; {) D7 n0040C6FB |. 89C2 mov edx, eax b S. S7 p5 O4 f$ D% z
0040C6FD |> 43 inc ebx! V1 Z# z7 m6 p' S% A
0040C6FE |. 8A6A 01 mov ch, byte ptr [edx+1]( q# c1 r+ @, e2 X7 u4 v6 P' m
0040C701 |. 42 inc edx
) ]3 z; R5 z) e0040C702 |. 84ED test ch, ch1 ^0 L9 y/ Q! l/ s0 S
0040C704 |.^ 75 90 jnz short 0040C6960 \$ \- O: r# _) t( h# U( c% b1 L8 N
0040C706 |> 83FD 10 cmp ebp, 10
; O" o: w9 W6 W+ Q, g0040C709 |. 7F 05 jg short 0040C710/ V* S3 I% i3 ]$ s3 d- D6 o4 ~
0040C70B |. BD 20000000 mov ebp, 20! w8 j, K: X, n* ^5 u P3 e u/ q
0040C710 |> 8B9424 040100>mov edx, dword ptr [esp+104]
# K4 [# ]9 t) M0040C717 |. 2B9424 080100>sub edx, dword ptr [esp+108]
; ?% R1 s$ r. F+ w) q6 ^1 ^/ ^0040C71E |. 85D2 test edx, edx
0 u) f7 Q$ m+ b1 J; O3 M: D" z8 A7 @0040C720 |. 7C 23 jl short 0040C745
6 p% P9 f/ Y4 {9 h0040C722 |. 89C6 mov esi, eax
4 U, d& A' K. W/ E1 {) V. V: H0040C724 |. 8B3C95 7477EF>mov edi, dword ptr [edx*4+2EF7774]
5 r2 ?, v: `1 p6 g( R/ A3 _: G0040C72B |. 57 push edi
" |. A' i( [1 Y/ ^ K7 \0040C72C |> 8A06 /mov al, byte ptr [esi]- @5 \# C, }2 o1 s3 b# K5 @( e* x
0040C72E |. 8807 |mov byte ptr [edi], al- \$ x: Y8 ~1 c5 q ]: p! Y3 v
0040C730 |. 3C 00 |cmp al, 0
5 N& g* S1 o4 Q* _; [/ Z1 G# B+ r0040C732 |. 74 10 |je short 0040C744$ _; }5 s8 ^5 n F2 l) W* ~
0040C734 |. 8A46 01 |mov al, byte ptr [esi+1]; P$ k' E7 c k( a. |
0040C737 |. 83C6 02 |add esi, 23 h" M& D) `: H s( G# G* Q* j4 A4 D
0040C73A |. 8847 01 |mov byte ptr [edi+1], al; T' H& P3 v" J
0040C73D |. 83C7 02 |add edi, 20 E( C4 |- J4 [& @6 X
0040C740 |. 3C 00 |cmp al, 0
, [/ p# H: ]. z; P4 ?0040C742 |.^ 75 E8 \jnz short 0040C72C
+ h, N. o5 h- u' H8 V0040C744 |> 5F pop edi
8 C2 Z6 r: b4 F# n3 C+ M9 T5 |( o$ h0040C745 |> E8 E6500100 call 00421830( ^- j7 Y+ Y1 q) Z" V2 m
0040C74A |. A3 8877EF02 mov dword ptr [2EF7788], eax. Y' ]' Y7 d% ]& N- X2 S. L" `
0040C74F |. 8B8424 040100>mov eax, dword ptr [esp+104]
" ~1 x% Q, W! [# R/ }: E% R0040C756 |. 40 inc eax
1 v' E7 u: h8 |! v3 u }0040C757 |. A3 8477EF02 mov dword ptr [2EF7784], eax3 t* b: \! z4 g8 |2 p% @
0040C75C |. C705 8C77EF02>mov dword ptr [2EF778C], 1' `" H/ C2 R$ B& E9 ~, v9 A
0040C766 |. B8 64000000 mov eax, 64
E: c) G6 G! z1 R9 X' B2 h0040C76B |. 89C2 mov edx, eax
+ G" r* h4 ^2 O5 a/ D0040C76D |. 8B0D E880EF02 mov ecx, dword ptr [2EF80E8]# [3 G( ~( y- }- I3 r
0040C773 |. C1FA 1F sar edx, 1F
& Q. @; j/ i( w: K$ X: K5 G0040C776 |. F7F9 idiv ecx
7 `3 L' w! w1 {6 N, T0040C778 |. 89C3 mov ebx, eax
/ A# z4 n7 P3 V+ V. r. @# X! \0040C77A |. 89EA mov edx, ebp
+ G: a0 w- @! z) {, J- N" v0040C77C |. 89E8 mov eax, ebp
4 d( ?* e' a5 v' A/ C" p+ R0040C77E |. C1FA 1F sar edx, 1F
* X. A2 l; B: l0040C781 |. C1E2 04 shl edx, 49 m, b: W- T1 B S, @
0040C784 |. 1BC2 sbb eax, edx* C6 S( J7 g% d. v C/ r2 z" B. _
0040C786 |. C1F8 04 sar eax, 48 d2 i/ g3 h+ `3 L2 |9 ]7 ~( a
0040C789 |. 01C3 add ebx, eax
7 F" {5 f# x! z# e0040C78B |. 891D 9077EF02 mov dword ptr [2EF7790], ebx
5 ~7 n; d! L$ k2 y2 d0040C791 |. 81C4 10010000 add esp, 110. s9 C4 V0 o i
0040C797 |. 5D pop ebp) Y" o/ ~, ?. z
0040C798 |. 5F pop edi
0 J, @" `( {+ K4 M; y0040C799 |. 5E pop esi
; a( S* t/ X9 J8 a. R2 x p1 Z0040C79A |. 5A pop edx
]- i( w$ W1 L2 Z% _+ u0040C79B |. 59 pop ecx, p5 |' ^$ d6 [ \
0040C79C |. 5B pop ebx
. m, f. k1 z. _+ P! s2 D0040C79D |. C3 retn
7 j$ Q- v; t5 h& x9 C1 p! ]0040C79E |> 81FD 8C000000 cmp ebp, 8C' l$ x/ D5 o/ K3 f3 z$ z0 c
0040C7A4 |. 7C 28 jl short 0040C7CE+ ]0 C4 ~) R; r2 |# b! @
0040C7A6 |. 81FD D2000000 cmp ebp, 0D2
# B5 V: A6 u! g4 x/ T% v0040C7AC |. 7F 20 jg short 0040C7CE! c y7 X5 s. o" K: j3 P
0040C7AE |. B9 03000000 mov ecx, 3
0 v( p+ F& E. u- X0040C7B3 |. 89EA mov edx, ebp
& g0 V4 B$ i6 j2 x0040C7B5 |. 89E8 mov eax, ebp4 J9 P! x* n. n( l
0040C7B7 |. C1FA 1F sar edx, 1F! C7 v5 K/ ]$ i, {/ u
0040C7BA |. F7F9 idiv ecx) V# f8 s' [+ U# \
0040C7BC |. C78424 040100>mov dword ptr [esp+104], 2
/ v, |) r: O4 V. p: L0040C7C7 |. 89C7 mov edi, eax
% q/ c5 Q5 t, _0 [% x" Q+ L0040C7C9 |.^ E9 8BFEFFFF jmp 0040C659' D+ h0 } u* x# O+ R( N; e! g! O
0040C7CE |> 83FD 46 cmp ebp, 46( X! N% K+ z$ p1 |3 O( m0 X4 I( ?
0040C7D1 |. 7C 25 jl short 0040C7F8
9 l3 ~# R' I7 Y$ Q0040C7D3 |. 81FD 8C000000 cmp ebp, 8C [3 t. U3 e/ x1 L
0040C7D9 |. 7F 1D jg short 0040C7F8 U9 Q) M% [1 D7 J
0040C7DB |. 89EA mov edx, ebp |0 V1 a2 ], Z& w2 O( Z$ X1 ~
0040C7DD |. 89E8 mov eax, ebp5 h9 }; l: b2 z& I, U
0040C7DF |. C1FA 1F sar edx, 1F
' E: L4 j! f8 I0 C- g- @0040C7E2 |. 2BC2 sub eax, edx
# x; S( V1 `1 H! u0040C7E4 |. D1F8 sar eax, 1
. U$ m2 z T4 p( }0040C7E6 |. C78424 040100>mov dword ptr [esp+104], 1
1 G! m5 d: k- `& `9 r" C5 ^1 e: c8 q0040C7F1 |. 89C7 mov edi, eax! W( _0 F8 U( U" G8 V8 w7 \& O6 {
0040C7F3 |.^ E9 61FEFFFF jmp 0040C659
4 T5 A1 K+ a* ^9 J: H3 F1 H" Z0040C7F8 |> 31D2 xor edx, edx5 `% S$ v3 x" L( i! v" X
0040C7FA |. BF 46000000 mov edi, 463 [" q/ i5 s4 a1 ~& Q
0040C7FF |. 899424 040100>mov dword ptr [esp+104], edx
. _6 X) l- |/ T7 |2 Y3 W0040C806 |.^ E9 4EFEFFFF jmp 0040C659
3 o& _' J( v% T8 S$ q0040C80B |> 80F9 7C cmp cl, 7C) C8 X7 V. ?3 a' t O
0040C80E |.^ 0F85 E9FEFFFF jnz 0040C6FD. h9 X+ S/ D& \ \8 A
0040C814 |. C602 20 mov byte ptr [edx], 20
2 {- H1 a, }+ K0 `* L" I3 [$ o0040C817 \.^ E9 E1FEFFFF jmp 0040C6FD
9 v- K% e- I" W- o. i; \( G' _6 H
4 L$ x1 U- d5 ]8 P& w1 F8 n" Y3 Q在scratches.sc和scream.sc里面有lua的脚本,保存有字体文件名。
( w0 n2 `; U5 Q8 A; W估计要汉化就要在上面的代码段下功夫了,以后继续研究。
4 U0 O' R8 H8 y: {* E" t* V* f7 U& Z b9 ~. p; n3 Q7 q
找到2个俄文的补丁,也许对以后研究有用。+ |2 u; W& n6 |: a/ q
http://www.megaupload.com/?d=EZH6X6727 _& z/ ?. A6 e/ m1 S
http://rapidshare.com/files/94227080/ScratchesDC.7z |