看了一下惊恐鬼屋Scratches这个游戏。, o) D7 m5 q9 @5 I4 L3 a% j
包文件有2个,scratches.res和scream.res,3 |. g+ @4 k+ N9 K
包文件的格式如下,可以用Game Extractor来解开。* I+ N6 J9 y, [& s% t5 i" E
http://wiki.xentax.com/index.php/Scratches_RES
0 O& N) L+ s: A从scratches.res里面解出一个font-michael.tga文件,就是在游戏利用的字体。
# i6 m) |: h0 B5 Iscream.res里面也有一个字体文件,但是游戏好像没有用到。
% Y" u ], K! X' Q, f& C8 K
! m2 S1 G% p6 d9 S1 {6 X用OD调试后,发现这是一个使用opengl API的游戏。9 |$ S# j, E! P6 M% K
在某句字幕上下了内存断点,断下来之后找到了和显示有关的代码段。
2 l7 m+ y6 T. l T8 E
7 e% n+ N" r* t }" k% ^' s s0040C5D0 /$ 53 push ebx" p0 e4 h5 D% C8 H
0040C5D1 |. 51 push ecx0 r+ U0 [: ~2 O# Q8 n+ u
0040C5D2 |. 52 push edx$ F3 n! M) A4 b6 i( }( R4 F5 o
0040C5D3 |. 56 push esi/ [, q, |4 q$ f( a$ T
0040C5D4 |. 57 push edi5 z, }, K' Q0 R
0040C5D5 |. 55 push ebp8 P+ o6 V, H6 D5 Y0 A; b5 S ~% n
0040C5D6 |. 81EC 10010000 sub esp, 110
4 b1 k8 p. p4 B [# g3 h7 D- ~- l0040C5DC |. 89C6 mov esi, eax
( \ a" t! M- f( U# |) d7 H4 T0040C5DE |. 89C7 mov edi, eax/ D5 K* U4 E8 d7 P# v: T! _
0040C5E0 |. 29C9 sub ecx, ecx
$ N. G2 b( o& l0 v/ X k0040C5E2 |. 49 dec ecx4 [" Y$ J4 u3 x' y4 S) a
0040C5E3 |. 31C0 xor eax, eax
4 i* _5 `7 U' w; x* m0040C5E5 |. F2:AE repne scas byte ptr es:[edi]
7 O5 m; h% G, z0 L- r" _0040C5E7 |. F7D1 not ecx5 Q' i& v% h) V4 |
0040C5E9 |. 49 dec ecx
, ?4 v1 b9 a% @# u0040C5EA |. 31DB xor ebx, ebx
8 O* W Q: e+ S6 G0040C5EC |. 31ED xor ebp, ebp
L7 S, c! y4 a7 }5 F* o; U0040C5EE |. 81F9 00010000 cmp ecx, 100
' u/ a7 g- l, c* D* } |+ d" O0040C5F4 |. 72 0D jb short 0040C603
3 u; D5 ^- C+ r2 q8 `% ]0040C5F6 |. 81C4 10010000 add esp, 1104 t; [4 W ?. H0 H9 w# N3 }6 L4 R& w
0040C5FC |. 5D pop ebp9 R) A$ m" N6 a5 n9 C5 N
0040C5FD |. 5F pop edi" e' ]7 b* A; |8 K2 k# U. a7 M8 |: |
0040C5FE |. 5E pop esi
- \8 r6 n) d. A0040C5FF |. 5A pop edx* o: P( u/ |1 }& C- H' q
0040C600 |. 59 pop ecx
' c6 d9 `" c! A/ B- A5 K5 }0040C601 |. 5B pop ebx; q1 ]# j! ^6 b9 x
0040C602 |. C3 retn9 | t, G! s8 b1 P7 R4 K
0040C603 |> 89E7 mov edi, esp: ]! L$ K; ^ v
0040C605 |. 57 push edi' _3 v7 p+ q: [* f4 t
0040C606 |> 8A06 /mov al, byte ptr [esi]: E G" n$ r/ i* V' s6 p' g
0040C608 |. 8807 |mov byte ptr [edi], al
. q+ a* K% v3 H/ n8 `, ]; S; X0040C60A |. 3C 00 |cmp al, 00 M1 \# T8 H5 a E4 n- E4 l5 U
0040C60C |. 74 10 |je short 0040C61E
B+ {2 M$ V& n5 s" M8 _6 C' ^% v0040C60E |. 8A46 01 |mov al, byte ptr [esi+1]7 j3 ?$ l8 n4 R' W+ y- F. L) t
0040C611 |. 83C6 02 |add esi, 2
# h; V1 O6 j1 y" ?5 d! m0040C614 |. 8847 01 |mov byte ptr [edi+1], al
( V( \1 ^6 q- d0040C617 |. 83C7 02 |add edi, 2
" z% @# `# N. {- O4 @2 A0040C61A |. 3C 00 |cmp al, 0
0 w) W% w- @# O' P5 {" t0 J0040C61C |.^ 75 E8 \jnz short 0040C606
: a) m# [9 [4 y$ z Q8 z7 Z0040C61E |> 5F pop edi
X" F% B$ d. c; p7 w0040C61F |. 8A1424 mov dl, byte ptr [esp]
# ~1 F3 V: s2 P0040C622 |. 89E0 mov eax, esp
2 Q; i. B8 f5 Q% {0040C624 |. 84D2 test dl, dl' A" B4 R1 z1 X& I, e
0040C626 |. 74 09 je short 0040C631
% _/ L" M, D$ z' v2 ^/ G* _. I0040C628 |> 8A70 01 /mov dh, byte ptr [eax+1]
4 F$ N, A, V. E7 p" v8 R) P0040C62B |. 40 |inc eax
5 ~; o7 f$ x2 L7 u" Y T0040C62C |. 45 |inc ebp
1 M' k& I" j( I9 G7 N) Y+ y, y0040C62D |. 84F6 |test dh, dh
3 c! K+ t1 a) ]( w( t6 q9 l O0040C62F |.^ 75 F7 \jnz short 0040C628/ x% |$ {1 |9 L
0040C631 |> 81FD D2000000 cmp ebp, 0D29 j( e7 Z3 ^- G* |
0040C637 |. 0F8E 61010000 jle 0040C79E
0 S5 N# N9 {9 G! d0040C63D |. 89EA mov edx, ebp7 g5 R; r& O5 s. @% A+ F" D3 \, f" b
0040C63F |. 89E8 mov eax, ebp
( t) [3 i/ q3 ? N4 n5 k& _0040C641 |. C1FA 1F sar edx, 1F7 M+ N w8 x" _: X
0040C644 |. C1E2 02 shl edx, 2$ a! f i! U& K" e' m6 _+ X. {
0040C647 |. 1BC2 sbb eax, edx
# ^8 h) w4 ~. D4 H: o# i& P) y" v0040C649 |. C1F8 02 sar eax, 2
- l4 j4 L/ e) N' J( Y4 `0040C64C |. 89C7 mov edi, eax
8 C1 _# B. B) K0040C64E |. C78424 040100>mov dword ptr [esp+104], 3
( j9 l3 S, @0 A$ s! q1 H0040C659 |> 89E0 mov eax, esp
. C8 z8 a' B. R0040C65B |. 31D2 xor edx, edx
1 L& w: e! K. X( B* u- p9 R; G0040C65D |. 8A0C24 mov cl, byte ptr [esp]. d, @+ z8 f P' _9 C! \" X1 Z
0040C660 |. 8915 8477EF02 mov dword ptr [2EF7784], edx
* J2 R3 f: S9 S. ~6 H5 I% F7 { d0040C666 |. 8915 8C77EF02 mov dword ptr [2EF778C], edx
% J0 K' `% i. [" F7 `3 l$ S0040C66C |. 899424 080100>mov dword ptr [esp+108], edx
4 H% x( `- c4 k0040C673 |. 89E2 mov edx, esp+ F+ \7 w1 j# S2 r/ L$ l& ~+ J( q
0040C675 |. 84C9 test cl, cl0 o# R" \6 c1 k+ ~" M, ?
0040C677 |. 0F84 89000000 je 0040C7060 e* [5 ?# A! z$ _& ?( z
0040C67D |. 8B8C24 040100>mov ecx, dword ptr [esp+104]3 d% @$ r$ K1 z/ c
0040C684 |. 4F dec edi% t+ G% g2 G$ i& e, N' \
0040C685 |. C1E1 02 shl ecx, 2
" r& m9 O+ O* o5 I( a- P6 Y0040C688 |. 89BC24 000100>mov dword ptr [esp+100], edi& {. o/ H+ k7 `; o$ ?! {. h
0040C68F |. 898C24 0C0100>mov dword ptr [esp+10C], ecx7 A# I0 ?1 Q9 c# _' j
0040C696 |> 8A0A mov cl, byte ptr [edx]
8 h5 G! c1 ]' A; `) l* O. ?0040C698 |. 80F9 20 cmp cl, 20% T4 L( {" ]/ Y! z/ G4 ~1 c: O2 |
0040C69B |. 0F85 6A010000 jnz 0040C80B
$ G q' n7 m# n J: k+ n* m* G- I0040C6A1 |. 3B9C24 000100>cmp ebx, dword ptr [esp+100]
% r. j: W* B+ m' Q* k3 z0040C6A8 |. 7C 53 jl short 0040C6FD& p" M6 G* y2 c
0040C6AA |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]$ r; ^8 U" u) E5 I
0040C6B1 |. C602 00 mov byte ptr [edx], 0
% r$ }7 I0 F9 I! e! Z L8 c* r, _- ]0040C6B4 |. 89C6 mov esi, eax
* x8 a0 } p3 X: S/ o& V, L0040C6B6 |. 8BBF 7477EF02 mov edi, dword ptr [edi+2EF7774]4 q4 d, _: q1 @* l/ K# h9 r* R
0040C6BC |. 31DB xor ebx, ebx0 v6 N+ I, A* o3 x
0040C6BE |. 57 push edi
; E. }0 o: o* I! x: S, u" {# G0040C6BF |> 8A06 /mov al, byte ptr [esi]4 z e$ R) l8 t( X0 X, W/ X% H
0040C6C1 |. 8807 |mov byte ptr [edi], al
0 s0 u; \% f2 u4 E" ?: ~0040C6C3 |. 3C 00 |cmp al, 0
7 L* f" G2 `9 ~2 Q; E0 [8 I6 a0040C6C5 |. 74 10 |je short 0040C6D7# j7 C$ K. p9 j' \( O2 t" J
0040C6C7 |. 8A46 01 |mov al, byte ptr [esi+1]
" D) p! v/ E9 |& G* m/ S* ?0040C6CA |. 83C6 02 |add esi, 2/ I( v# Q9 v1 J1 f- J% T" d
0040C6CD |. 8847 01 |mov byte ptr [edi+1], al3 \: p% B' T5 `
0040C6D0 |. 83C7 02 |add edi, 27 d5 H, Z; P( X6 `; n" G- Y# ~3 B$ ~
0040C6D3 |. 3C 00 |cmp al, 0: }! d ~. u, Q: V9 S0 v( G
0040C6D5 |.^ 75 E8 \jnz short 0040C6BF+ r2 |5 h9 x. k6 _3 r/ q! z4 \
0040C6D7 |> 5F pop edi
+ H4 i( _7 z8 ?3 v" }; O! V0040C6D8 |. 8D42 01 lea eax, dword ptr [edx+1]1 J/ W) R! S; F# [. t1 i3 v3 [
0040C6DB |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]
6 v" i" q5 E% s# }, u P- p0040C6E2 |. 8B9424 080100>mov edx, dword ptr [esp+108]- l& }% b! ?6 S* c- k; A
0040C6E9 |. 83EF 04 sub edi, 4 G6 n) u, G/ E6 W( ^
0040C6EC |. 42 inc edx6 z {( w0 a7 i4 s
0040C6ED |. 89BC24 0C0100>mov dword ptr [esp+10C], edi0 ^9 P5 Y! A1 K
0040C6F4 |. 899424 080100>mov dword ptr [esp+108], edx
/ x% }+ X p7 w) Z* i+ G0040C6FB |. 89C2 mov edx, eax# X/ `* J9 u P5 O! i( t" |9 V
0040C6FD |> 43 inc ebx
; r& b6 ~. @, j% p6 W1 R0040C6FE |. 8A6A 01 mov ch, byte ptr [edx+1]! v' o* L h! j9 U$ b
0040C701 |. 42 inc edx
5 v2 v. W4 A8 G0 k5 N; ]% C0040C702 |. 84ED test ch, ch8 w1 [) s4 \4 l: l
0040C704 |.^ 75 90 jnz short 0040C696
5 K0 g0 S: ~4 T0 I0040C706 |> 83FD 10 cmp ebp, 10
m- x! a( _5 f+ H, Z( i0040C709 |. 7F 05 jg short 0040C710" a, Q6 ~4 R2 I
0040C70B |. BD 20000000 mov ebp, 20
/ r& s S7 H$ D4 d8 @5 F/ E0040C710 |> 8B9424 040100>mov edx, dword ptr [esp+104]+ K# n4 A& y; e5 l# p! Y; B
0040C717 |. 2B9424 080100>sub edx, dword ptr [esp+108]3 t( k( a8 K3 @' X0 p
0040C71E |. 85D2 test edx, edx6 T% n, q0 m! e, u" L! [
0040C720 |. 7C 23 jl short 0040C745
2 J; K4 [3 V. S+ q0040C722 |. 89C6 mov esi, eax
L: y& V# `) s1 z8 k1 i2 D! k0040C724 |. 8B3C95 7477EF>mov edi, dword ptr [edx*4+2EF7774]
& Q2 W( I& a+ j0040C72B |. 57 push edi' V7 r. Y6 p/ m8 @
0040C72C |> 8A06 /mov al, byte ptr [esi]4 R$ x/ O4 q1 W1 H* \5 _8 t
0040C72E |. 8807 |mov byte ptr [edi], al: r- R O, {+ r: x, a* E
0040C730 |. 3C 00 |cmp al, 0
6 m! T! `8 h* A, b% x0040C732 |. 74 10 |je short 0040C744
' L% v! y: P1 {3 e5 e1 W5 `5 K5 k0 d0040C734 |. 8A46 01 |mov al, byte ptr [esi+1]
/ e! Q& R0 r8 \; F- W0040C737 |. 83C6 02 |add esi, 2" X, |% b1 B: h G
0040C73A |. 8847 01 |mov byte ptr [edi+1], al
. D) I0 a- u/ H! j0 c8 {, Z0040C73D |. 83C7 02 |add edi, 2- s, v6 k# X1 _ C8 R' w5 h
0040C740 |. 3C 00 |cmp al, 04 G6 [' l% n: v* K q
0040C742 |.^ 75 E8 \jnz short 0040C72C
3 J4 F Q7 K, q1 A% K0040C744 |> 5F pop edi! A% f5 I0 c4 p" l
0040C745 |> E8 E6500100 call 00421830! K! }# U7 t, R* t% c
0040C74A |. A3 8877EF02 mov dword ptr [2EF7788], eax( B" t4 r$ E' u
0040C74F |. 8B8424 040100>mov eax, dword ptr [esp+104]
5 s, J: F4 o3 x7 p* x- h! D7 s0040C756 |. 40 inc eax
( H5 D6 O+ ~. f- i0040C757 |. A3 8477EF02 mov dword ptr [2EF7784], eax
Q( }% Z$ g; B: d' ~+ i0040C75C |. C705 8C77EF02>mov dword ptr [2EF778C], 1" s" D5 ? v( Z0 T) L# p
0040C766 |. B8 64000000 mov eax, 64
: O2 X" Q. R( L& Y$ n I0040C76B |. 89C2 mov edx, eax
, ~3 f. U1 @$ l: V9 u" y/ d0040C76D |. 8B0D E880EF02 mov ecx, dword ptr [2EF80E8]7 l+ D( q" R" z2 `
0040C773 |. C1FA 1F sar edx, 1F) i& s0 B' j$ E) e& U
0040C776 |. F7F9 idiv ecx4 q" j! h& D* ~8 B* d; Z
0040C778 |. 89C3 mov ebx, eax
! i2 Q2 A# _4 c. O+ L# l5 m0040C77A |. 89EA mov edx, ebp, V/ @2 g8 Y0 n6 h5 F+ r, D8 d
0040C77C |. 89E8 mov eax, ebp
& c0 O* l; ~9 A, G: |7 K \0040C77E |. C1FA 1F sar edx, 1F
# A2 c! B! W& E- d0040C781 |. C1E2 04 shl edx, 4, o3 L8 c$ ~( x
0040C784 |. 1BC2 sbb eax, edx
y/ |$ m" ~ p5 j5 n2 R& b1 Y0040C786 |. C1F8 04 sar eax, 46 K* l5 v: q, Q( A
0040C789 |. 01C3 add ebx, eax
" D* p9 I+ q$ L' j0040C78B |. 891D 9077EF02 mov dword ptr [2EF7790], ebx
" F/ A( E+ `6 q4 k+ s: T/ ]0040C791 |. 81C4 10010000 add esp, 110
9 h+ G2 u$ G2 [; O, w7 M) [0040C797 |. 5D pop ebp8 }3 w$ U' F! z% A
0040C798 |. 5F pop edi' C! I. A: Y" O' v# {
0040C799 |. 5E pop esi7 f. q7 y8 P+ E$ t
0040C79A |. 5A pop edx
7 V0 \1 M- B U6 v2 i; L0040C79B |. 59 pop ecx3 C* s% q! z. ]$ Q9 y
0040C79C |. 5B pop ebx
$ |7 L; E: Q5 B6 f8 i3 I0040C79D |. C3 retn& I: q! Z' C% v) o1 U% e7 }2 q# t
0040C79E |> 81FD 8C000000 cmp ebp, 8C- J$ Q* @7 A5 B
0040C7A4 |. 7C 28 jl short 0040C7CE' V4 ~& x( g- k3 w7 \( _5 ]
0040C7A6 |. 81FD D2000000 cmp ebp, 0D28 ^1 n9 m7 o0 x" G6 J& X
0040C7AC |. 7F 20 jg short 0040C7CE
6 y2 D0 J) m2 P7 W6 I, s* N0040C7AE |. B9 03000000 mov ecx, 3
) Z3 N% _3 B6 X4 q0040C7B3 |. 89EA mov edx, ebp
: y0 C. x& M2 Q" R$ ?& I" L0040C7B5 |. 89E8 mov eax, ebp
' g. r% `* \6 v. U; q. l1 O- ^0040C7B7 |. C1FA 1F sar edx, 1F
, ~5 m9 b' G/ ?3 F0040C7BA |. F7F9 idiv ecx6 }- N: b; V) k
0040C7BC |. C78424 040100>mov dword ptr [esp+104], 26 P) ]4 s4 S# G- w [
0040C7C7 |. 89C7 mov edi, eax1 v& X/ v* e+ z3 Z8 R+ ]' f
0040C7C9 |.^ E9 8BFEFFFF jmp 0040C659
\' k. ~# P# g5 U+ n5 \3 u0040C7CE |> 83FD 46 cmp ebp, 46
4 V% C& D+ L9 b' Z- O5 A- J# r0040C7D1 |. 7C 25 jl short 0040C7F8
+ e" B1 o' |! i4 F1 t0040C7D3 |. 81FD 8C000000 cmp ebp, 8C
2 U7 }! z2 x8 k% T" s0040C7D9 |. 7F 1D jg short 0040C7F8
" ?; c; I$ N$ I2 t" s! D( ^: t0040C7DB |. 89EA mov edx, ebp
( c9 K4 \* L, u. y0040C7DD |. 89E8 mov eax, ebp* n8 i' |5 Z4 R8 G2 j8 a
0040C7DF |. C1FA 1F sar edx, 1F' G7 T) \$ p1 r- N7 H3 z$ ~
0040C7E2 |. 2BC2 sub eax, edx( A0 Q' W% |8 C+ B+ O( w$ f' T% @2 I
0040C7E4 |. D1F8 sar eax, 1: R4 O0 L9 b) V+ z
0040C7E6 |. C78424 040100>mov dword ptr [esp+104], 1
/ ]/ H% q4 ]2 c2 g2 }7 a+ X0040C7F1 |. 89C7 mov edi, eax3 Q3 i1 q1 J% l5 z
0040C7F3 |.^ E9 61FEFFFF jmp 0040C659
% K% k& E2 |8 q8 P- b. Y$ G0040C7F8 |> 31D2 xor edx, edx
& U7 b, C% Y; p0040C7FA |. BF 46000000 mov edi, 46
# Y- O- J C$ |4 W0040C7FF |. 899424 040100>mov dword ptr [esp+104], edx! m) v4 J( J" k/ A. |6 @, X
0040C806 |.^ E9 4EFEFFFF jmp 0040C6593 E! x3 w, j; k/ o- C0 F I
0040C80B |> 80F9 7C cmp cl, 7C
0 ]# B, `/ M' I" ]% D. V0040C80E |.^ 0F85 E9FEFFFF jnz 0040C6FD ]7 z% W7 [1 y8 r8 T5 R/ {: c/ [
0040C814 |. C602 20 mov byte ptr [edx], 20- j/ I: ~3 m) r" l
0040C817 \.^ E9 E1FEFFFF jmp 0040C6FD
A! l2 Y6 H% O: O( S# m8 s* m
& N2 D; p( U1 `* n: Z1 X4 u在scratches.sc和scream.sc里面有lua的脚本,保存有字体文件名。8 ?/ Q2 g) }6 D$ A
估计要汉化就要在上面的代码段下功夫了,以后继续研究。
) t& O5 h1 F9 i1 o4 W
5 u& R9 f. y- j4 B" R' J H找到2个俄文的补丁,也许对以后研究有用。/ X( a0 V X% Z
http://www.megaupload.com/?d=EZH6X672: |, V! w- R2 F: I
http://rapidshare.com/files/94227080/ScratchesDC.7z |