看了一下惊恐鬼屋Scratches这个游戏。
5 c, f+ C& V2 W1 W. P, L' }包文件有2个,scratches.res和scream.res,, w. L8 ?: U4 I! @* K
包文件的格式如下,可以用Game Extractor来解开。
' F0 ^4 O- n) f& X. l5 ihttp://wiki.xentax.com/index.php/Scratches_RES% H6 A9 i5 j5 I% }
从scratches.res里面解出一个font-michael.tga文件,就是在游戏利用的字体。
- X4 |# M! Q4 J# j- f* I1 yscream.res里面也有一个字体文件,但是游戏好像没有用到。, `' _5 `/ b" @7 x! |; e
2 N1 V6 m* }/ Y: B- g/ @2 k用OD调试后,发现这是一个使用opengl API的游戏。) R0 l n2 ~! T8 f5 E+ D+ t6 w
在某句字幕上下了内存断点,断下来之后找到了和显示有关的代码段。" q& [, P4 [0 {) d6 p/ {
! _" p ~* g% w+ P, _1 Y
0040C5D0 /$ 53 push ebx$ u+ J l4 u, [% Z
0040C5D1 |. 51 push ecx' v- L. |" \0 b4 r' _
0040C5D2 |. 52 push edx. t* N% \0 O; X/ K C- a
0040C5D3 |. 56 push esi9 j' K) ]1 o+ t. k$ v- L
0040C5D4 |. 57 push edi
# W }1 P+ g* ]" \4 \, e+ G$ j0040C5D5 |. 55 push ebp6 \1 D) V6 W# M/ R) y; H
0040C5D6 |. 81EC 10010000 sub esp, 110
# x7 S5 _% X# G2 Y) i- Y9 `0040C5DC |. 89C6 mov esi, eax
% O% K- R$ k& ]0 g: ]% C, d9 K9 `0040C5DE |. 89C7 mov edi, eax- \6 g* F% p# b& H' M/ l1 O& i
0040C5E0 |. 29C9 sub ecx, ecx
- w, {+ C' c$ V! ?2 r1 |! j& V8 e0040C5E2 |. 49 dec ecx
+ I. W; K' ^1 D$ e6 `9 N" Q5 x6 s1 h0040C5E3 |. 31C0 xor eax, eax
! V* v$ l9 I& {# E7 y& ]0040C5E5 |. F2:AE repne scas byte ptr es:[edi]) H/ \- \5 l3 g/ L
0040C5E7 |. F7D1 not ecx& `0 }. P8 C1 h; K
0040C5E9 |. 49 dec ecx
% g& W- d+ P( @/ g' Z1 L0040C5EA |. 31DB xor ebx, ebx8 T# n! a& [' j2 q
0040C5EC |. 31ED xor ebp, ebp
8 i6 {) S) l$ j1 v' m ?* ~0040C5EE |. 81F9 00010000 cmp ecx, 100
. L- H! J+ T- S0040C5F4 |. 72 0D jb short 0040C603
4 ]5 I3 }- a% ]# Y/ x0040C5F6 |. 81C4 10010000 add esp, 110( d: f$ a) e' ^: Q+ e* Z- Y7 j
0040C5FC |. 5D pop ebp
; M) ]' a/ g2 L4 Q9 a& c0040C5FD |. 5F pop edi; g- h u2 O: \: V1 X! v/ x% h
0040C5FE |. 5E pop esi
, _4 a0 L e1 d0040C5FF |. 5A pop edx
' G4 u& R9 J/ e0 B; m8 S0040C600 |. 59 pop ecx
# R2 G; R3 R2 Y0040C601 |. 5B pop ebx
. o6 N; l8 @ e; a0040C602 |. C3 retn9 _" k/ @$ B3 H& y8 f
0040C603 |> 89E7 mov edi, esp
$ B; i: x* m2 Y( [7 ] |/ F0040C605 |. 57 push edi
2 k' q. Q- f9 ?6 C p2 T2 W/ [0040C606 |> 8A06 /mov al, byte ptr [esi]( R8 O$ X. z2 J, l; U" K7 k9 I
0040C608 |. 8807 |mov byte ptr [edi], al
+ @4 p9 p6 ?; w/ |2 m# a) l0040C60A |. 3C 00 |cmp al, 0
* F4 G* u$ C0 V7 O# V' p) V+ `0040C60C |. 74 10 |je short 0040C61E
7 ~+ Z2 O. z$ a, H. [9 Y7 f0040C60E |. 8A46 01 |mov al, byte ptr [esi+1]
s4 Q0 Z$ I6 b; [$ v, C0040C611 |. 83C6 02 |add esi, 2
' N7 H# L" ~7 m& w3 P# R0040C614 |. 8847 01 |mov byte ptr [edi+1], al
$ l' d+ ~( ^* Z5 v0040C617 |. 83C7 02 |add edi, 2, x0 k* r! ]% U3 E: s, A2 ~" W
0040C61A |. 3C 00 |cmp al, 0) d2 l( e1 d+ A3 y: k: x3 C
0040C61C |.^ 75 E8 \jnz short 0040C606
# s+ k( }8 ~$ u; X0040C61E |> 5F pop edi/ v( m- _; t5 D# B
0040C61F |. 8A1424 mov dl, byte ptr [esp]: g* D4 g- C# |6 D, M
0040C622 |. 89E0 mov eax, esp5 \2 l' e$ l# R' U8 f, C% J
0040C624 |. 84D2 test dl, dl% a2 }8 O2 c+ B/ [* M1 I
0040C626 |. 74 09 je short 0040C631
# R( X. u7 b: o5 z/ x2 f3 [0040C628 |> 8A70 01 /mov dh, byte ptr [eax+1]
. d# x0 R( Z: U/ o4 D* B+ Y( Q0040C62B |. 40 |inc eax
L( `7 X! s W. C; J0 X0040C62C |. 45 |inc ebp
/ b9 B7 j* z0 Q/ \6 J: z0040C62D |. 84F6 |test dh, dh& h$ w! c2 m9 e% @) {
0040C62F |.^ 75 F7 \jnz short 0040C628/ S4 D" N* r# f n
0040C631 |> 81FD D2000000 cmp ebp, 0D2/ `. z) S ~6 D% J
0040C637 |. 0F8E 61010000 jle 0040C79E
3 r- q- L7 p# Q) d8 q0040C63D |. 89EA mov edx, ebp
3 y4 |: W* D; x: ]7 q0040C63F |. 89E8 mov eax, ebp$ C* u2 `, \, m) ]: f
0040C641 |. C1FA 1F sar edx, 1F
, i( K+ {+ G, ?( ^7 B0040C644 |. C1E2 02 shl edx, 2
/ J4 [, R' i" D5 @3 P0 A0040C647 |. 1BC2 sbb eax, edx
. u8 a. p9 e8 r( ]1 D0040C649 |. C1F8 02 sar eax, 2. `# E# ]; y D) T: s
0040C64C |. 89C7 mov edi, eax2 t* D( ?4 _* P2 H0 b
0040C64E |. C78424 040100>mov dword ptr [esp+104], 3
& ~$ X' N2 y- L8 f0 {5 C0040C659 |> 89E0 mov eax, esp2 e( U3 _- ]! }( Z7 E6 f
0040C65B |. 31D2 xor edx, edx
. K b/ Z3 }! ]8 }8 _0040C65D |. 8A0C24 mov cl, byte ptr [esp]7 l9 F; a: d4 n6 [0 I6 q* `
0040C660 |. 8915 8477EF02 mov dword ptr [2EF7784], edx/ O+ o; ~3 D( q& J; S
0040C666 |. 8915 8C77EF02 mov dword ptr [2EF778C], edx$ H9 I4 @+ _4 W3 ?8 _4 k' j
0040C66C |. 899424 080100>mov dword ptr [esp+108], edx: Z6 l, y1 p+ x
0040C673 |. 89E2 mov edx, esp7 y% r' Z& F, Q( S6 w H/ V2 s9 Y2 m
0040C675 |. 84C9 test cl, cl2 _' Y1 g1 d8 ~& C2 @. `8 g
0040C677 |. 0F84 89000000 je 0040C7063 G" a3 u5 |& n' L/ e# {
0040C67D |. 8B8C24 040100>mov ecx, dword ptr [esp+104]: E ]. |! v( J! p& j. ?- D' M
0040C684 |. 4F dec edi
P5 B& m% S. }' Z. R6 f0040C685 |. C1E1 02 shl ecx, 26 g6 h* B5 ]% U1 t( h4 y) ]
0040C688 |. 89BC24 000100>mov dword ptr [esp+100], edi8 _* y r. y" p: t2 }) [
0040C68F |. 898C24 0C0100>mov dword ptr [esp+10C], ecx. g# J! ~$ x( e; r$ k: a' X, G' O8 }
0040C696 |> 8A0A mov cl, byte ptr [edx] ?+ z' q1 X& s/ _# E
0040C698 |. 80F9 20 cmp cl, 20+ L( M# R7 [1 A0 A O* C
0040C69B |. 0F85 6A010000 jnz 0040C80B
, z9 b! x/ f' P% N% @( t; S0040C6A1 |. 3B9C24 000100>cmp ebx, dword ptr [esp+100]
, Y3 C/ J" q0 w0 y+ Y; w6 j0040C6A8 |. 7C 53 jl short 0040C6FD, x+ W* z, t: z
0040C6AA |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]
, Q- d, I5 w: [: |& W1 G0 ?' L1 v0040C6B1 |. C602 00 mov byte ptr [edx], 04 G+ L$ ^( n" T) W
0040C6B4 |. 89C6 mov esi, eax
" W6 W/ k0 V" ]5 {! ]0 c2 r0040C6B6 |. 8BBF 7477EF02 mov edi, dword ptr [edi+2EF7774], A/ R1 }! B4 s% }
0040C6BC |. 31DB xor ebx, ebx
) J9 M6 ?( w1 A) t/ | N0040C6BE |. 57 push edi" y) N& G' m0 }" p0 V
0040C6BF |> 8A06 /mov al, byte ptr [esi]$ C) L) E# F* V1 x! p
0040C6C1 |. 8807 |mov byte ptr [edi], al7 b% A! s, J/ @2 w1 d
0040C6C3 |. 3C 00 |cmp al, 07 W/ k8 c; ^% \, [4 P- Z1 I
0040C6C5 |. 74 10 |je short 0040C6D7( b9 [- L4 y# U9 R# Z
0040C6C7 |. 8A46 01 |mov al, byte ptr [esi+1]
6 k7 k$ W/ _! v+ u0040C6CA |. 83C6 02 |add esi, 2; z& K# `2 O6 h, O i
0040C6CD |. 8847 01 |mov byte ptr [edi+1], al
$ }! n: L# B; k% Z c0040C6D0 |. 83C7 02 |add edi, 2+ E B" j. i0 ?0 S5 N9 S, y2 L
0040C6D3 |. 3C 00 |cmp al, 0( @4 e: C8 u$ t* j. b
0040C6D5 |.^ 75 E8 \jnz short 0040C6BF
" A/ [* m8 d) L0040C6D7 |> 5F pop edi U R* ~8 y+ j! g7 |7 D
0040C6D8 |. 8D42 01 lea eax, dword ptr [edx+1]' f& w; e+ O/ I9 h6 N1 O
0040C6DB |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]
- G5 K/ h# _" i. n( \6 d1 J$ [; j0040C6E2 |. 8B9424 080100>mov edx, dword ptr [esp+108], a5 E+ V b! a4 c) c6 L
0040C6E9 |. 83EF 04 sub edi, 4
$ V; ] b3 L% ^: q! h( @& p( l0 Q0040C6EC |. 42 inc edx
6 C5 [' ? Z+ I0 y, R/ m0040C6ED |. 89BC24 0C0100>mov dword ptr [esp+10C], edi
8 f4 U- E3 H r0040C6F4 |. 899424 080100>mov dword ptr [esp+108], edx* o" ]( C$ ^$ U5 M
0040C6FB |. 89C2 mov edx, eax
; x8 Q0 a) I, l# q1 c+ @0040C6FD |> 43 inc ebx# V6 _4 o _' s2 t
0040C6FE |. 8A6A 01 mov ch, byte ptr [edx+1]
3 z5 ?8 a) g$ k1 o( ^$ u/ d0040C701 |. 42 inc edx
/ a: m9 P+ B ~8 P+ g0040C702 |. 84ED test ch, ch: F% F5 A1 @2 T, Z6 Z; Q
0040C704 |.^ 75 90 jnz short 0040C696
$ n4 n1 P$ w/ v$ c: y# T7 R0040C706 |> 83FD 10 cmp ebp, 10
/ t8 A: n0 x* v6 d7 M' w0040C709 |. 7F 05 jg short 0040C710
; ?& V+ } M. e5 `7 n* T- l0040C70B |. BD 20000000 mov ebp, 203 }% C* f- e/ p9 |3 V! J- R( X
0040C710 |> 8B9424 040100>mov edx, dword ptr [esp+104]
) _( j# c" m5 l0 k1 \' v+ W0040C717 |. 2B9424 080100>sub edx, dword ptr [esp+108]
+ O/ W, o& k0 `( A; D0040C71E |. 85D2 test edx, edx
" x# d+ V& g$ A G7 m0040C720 |. 7C 23 jl short 0040C7450 N& A# H$ h+ t% q7 M. g
0040C722 |. 89C6 mov esi, eax
, b [" o# D& e- h( C' S0040C724 |. 8B3C95 7477EF>mov edi, dword ptr [edx*4+2EF7774]
, J+ w( x5 O, t5 J% e( {7 u0040C72B |. 57 push edi' l) h% w2 i5 C6 E9 F- O
0040C72C |> 8A06 /mov al, byte ptr [esi]" j$ q6 j' g* I8 n
0040C72E |. 8807 |mov byte ptr [edi], al
9 H# d( a& o( u1 y: K" G0040C730 |. 3C 00 |cmp al, 0
6 y, o1 B/ Z: e. `! X0040C732 |. 74 10 |je short 0040C744 t- C& x4 n) X1 I
0040C734 |. 8A46 01 |mov al, byte ptr [esi+1]
/ |3 Q, {; E7 k4 t" }- n0040C737 |. 83C6 02 |add esi, 2
2 c. E6 d; N8 I+ o9 W2 u; s, P' ]0040C73A |. 8847 01 |mov byte ptr [edi+1], al1 { ], k& P6 j. M' O; O
0040C73D |. 83C7 02 |add edi, 2: @: g3 V8 R! T6 _& {2 E; s& ^
0040C740 |. 3C 00 |cmp al, 0
6 G/ s$ ^" p1 m# T( s3 J0040C742 |.^ 75 E8 \jnz short 0040C72C2 b' u* D; `' N/ v1 w
0040C744 |> 5F pop edi
( z! Q9 y9 q1 `* _0040C745 |> E8 E6500100 call 004218300 i* w7 r4 E" l3 s
0040C74A |. A3 8877EF02 mov dword ptr [2EF7788], eax
! _1 W+ E( e. B) n5 K0040C74F |. 8B8424 040100>mov eax, dword ptr [esp+104]
1 R* i( ]/ n4 i0040C756 |. 40 inc eax
8 y) l* ]' P- }: D1 H0040C757 |. A3 8477EF02 mov dword ptr [2EF7784], eax* P, v; o4 N) F5 F/ V3 v
0040C75C |. C705 8C77EF02>mov dword ptr [2EF778C], 1; f& }/ w& H# T& u, @: U3 T
0040C766 |. B8 64000000 mov eax, 64
5 m3 B) A, i) \% V, S0040C76B |. 89C2 mov edx, eax
, g4 {; L4 q/ \8 B% a0040C76D |. 8B0D E880EF02 mov ecx, dword ptr [2EF80E8]
+ P4 p+ K7 D; A' C* C# ~0040C773 |. C1FA 1F sar edx, 1F
! l' A5 }) d2 Y9 U2 A; q. M0040C776 |. F7F9 idiv ecx4 ~4 ~- i; h- t9 E
0040C778 |. 89C3 mov ebx, eax
, J8 `4 z9 F6 c/ }9 k0040C77A |. 89EA mov edx, ebp
4 u; G$ w! V7 L& G7 T0040C77C |. 89E8 mov eax, ebp0 ~) k, K7 h( ?" L9 q
0040C77E |. C1FA 1F sar edx, 1F
1 [. J8 z: W" ]! h0040C781 |. C1E2 04 shl edx, 4' Z3 g% ?* }( h3 J$ R
0040C784 |. 1BC2 sbb eax, edx
! u4 C. ` @+ V0 a3 Y5 l) F# d0040C786 |. C1F8 04 sar eax, 4
. p0 H% b8 B$ R& G p0040C789 |. 01C3 add ebx, eax
5 z2 z& w% ]0 g, }' U- I0040C78B |. 891D 9077EF02 mov dword ptr [2EF7790], ebx
, G6 d! P$ E* m0040C791 |. 81C4 10010000 add esp, 110
2 _9 l, N/ t9 l5 @0 Y4 G0040C797 |. 5D pop ebp
, i7 c* I- g0 l' P; \5 b0040C798 |. 5F pop edi& w9 s+ `* a! O. v1 T0 W# G7 A
0040C799 |. 5E pop esi+ R# @+ j7 g2 }9 Q9 g7 h9 n
0040C79A |. 5A pop edx
, @3 U) ~+ W U, S R& W( i, L5 S9 ~0040C79B |. 59 pop ecx
2 w. y4 c% H# @9 ^( i% Y" p( l0040C79C |. 5B pop ebx' _8 Z6 B- @3 B+ U
0040C79D |. C3 retn% a5 X. v; p" Z: H$ c+ L1 {
0040C79E |> 81FD 8C000000 cmp ebp, 8C
/ r; A- S2 l; b" y0040C7A4 |. 7C 28 jl short 0040C7CE/ S- b& e" b6 q. y4 v8 k4 M
0040C7A6 |. 81FD D2000000 cmp ebp, 0D20 ~% p5 v" |* b. U# r/ j* j5 E& w
0040C7AC |. 7F 20 jg short 0040C7CE, p* O9 `+ Y5 g3 {0 H9 q
0040C7AE |. B9 03000000 mov ecx, 3
+ r& M( S/ t V/ F! p- m0040C7B3 |. 89EA mov edx, ebp* G& z) `( ~2 c# Q3 l5 H4 Z
0040C7B5 |. 89E8 mov eax, ebp& T% s! o% k# }+ `4 E; _8 H
0040C7B7 |. C1FA 1F sar edx, 1F% p- C6 C$ g8 p5 _2 D7 r
0040C7BA |. F7F9 idiv ecx3 y1 w8 F1 Z* x. w4 f
0040C7BC |. C78424 040100>mov dword ptr [esp+104], 2+ z6 B9 E) M. Z j
0040C7C7 |. 89C7 mov edi, eax
- B: F' X* T! M; w$ `0040C7C9 |.^ E9 8BFEFFFF jmp 0040C659
. r1 r( o5 O/ S6 O' h: K1 R" C0 @9 {. L0040C7CE |> 83FD 46 cmp ebp, 46
# s8 N4 M5 t# b0040C7D1 |. 7C 25 jl short 0040C7F8& e' U1 h0 |/ W
0040C7D3 |. 81FD 8C000000 cmp ebp, 8C
4 q3 K7 T9 \% ]% i3 e9 I7 k$ Q0040C7D9 |. 7F 1D jg short 0040C7F8
, x- A% f" T8 w! n$ c0040C7DB |. 89EA mov edx, ebp
$ w" M# f o- A+ s9 G9 O0040C7DD |. 89E8 mov eax, ebp, W2 m5 J0 T c$ M; }- J1 e
0040C7DF |. C1FA 1F sar edx, 1F
- ~5 p6 a2 G5 f+ v7 C* S3 s" e) d% `0040C7E2 |. 2BC2 sub eax, edx7 W9 i0 r. N( d/ t# h4 U
0040C7E4 |. D1F8 sar eax, 11 Y: ?6 o! j9 b' o7 h
0040C7E6 |. C78424 040100>mov dword ptr [esp+104], 1
3 f" q3 N9 A( a0 Q( G; ]& o0040C7F1 |. 89C7 mov edi, eax
* v! C# ]/ V" @9 r9 X0040C7F3 |.^ E9 61FEFFFF jmp 0040C659/ z v& G- `: B7 b [. q1 x
0040C7F8 |> 31D2 xor edx, edx
6 X9 ~5 H- A" e4 m& B! ]! ~, F0040C7FA |. BF 46000000 mov edi, 463 Y( b# z7 W7 v; n3 u+ F( f7 T
0040C7FF |. 899424 040100>mov dword ptr [esp+104], edx3 m- s0 `3 @* z( F6 @; _
0040C806 |.^ E9 4EFEFFFF jmp 0040C659
2 D& J# E4 W1 N$ m0040C80B |> 80F9 7C cmp cl, 7C
2 i% J" I- p* X ^+ I1 `0040C80E |.^ 0F85 E9FEFFFF jnz 0040C6FD- d( A: r ~# |+ S1 e) \
0040C814 |. C602 20 mov byte ptr [edx], 208 T) S( G$ X3 V2 V7 j+ n
0040C817 \.^ E9 E1FEFFFF jmp 0040C6FD6 D0 d) J: L O) R) G: x
y. ^2 |7 N0 M4 q/ s1 H在scratches.sc和scream.sc里面有lua的脚本,保存有字体文件名。/ h! ^8 D0 ?6 x
估计要汉化就要在上面的代码段下功夫了,以后继续研究。
7 ]- P( i" R1 F; p+ J2 M% e. [6 l1 q5 S' D' j2 K$ m+ _9 Q& n# n
找到2个俄文的补丁,也许对以后研究有用。
+ U |# w. l( `$ M% Z9 Yhttp://www.megaupload.com/?d=EZH6X672
4 q$ g+ L0 S7 Shttp://rapidshare.com/files/94227080/ScratchesDC.7z |