看了一下惊恐鬼屋Scratches这个游戏。
; K( g7 m! w. g, j5 E包文件有2个,scratches.res和scream.res,# z7 j/ W' C2 ^( i$ d% Q0 }! O2 B
包文件的格式如下,可以用Game Extractor来解开。4 R" \' \7 o6 Y! h
http://wiki.xentax.com/index.php/Scratches_RES
: K; v1 Y. H( b% a# n: n+ }$ D从scratches.res里面解出一个font-michael.tga文件,就是在游戏利用的字体。
3 d9 l9 s5 z( ~scream.res里面也有一个字体文件,但是游戏好像没有用到。
: V/ C2 F H S! g9 t: B8 Z3 ]* E" U; e1 _( `- Z; A+ \ o) Y
用OD调试后,发现这是一个使用opengl API的游戏。
+ t0 s7 c7 p g5 G' a" n2 }在某句字幕上下了内存断点,断下来之后找到了和显示有关的代码段。7 O) ~3 ?) |* P. |% ^. N7 A
. L0 x A8 \$ c- Y$ ]. z0040C5D0 /$ 53 push ebx
! ?+ h( N' z* v0 I0040C5D1 |. 51 push ecx
1 y; o, c' X6 k1 B |$ T0040C5D2 |. 52 push edx
1 o1 y% o( U& j" D5 N0040C5D3 |. 56 push esi& d! ]4 M1 I% Q: p
0040C5D4 |. 57 push edi+ f! C, |0 ]! ~9 F' [
0040C5D5 |. 55 push ebp
( W/ E( d$ ^4 o G3 v) j0040C5D6 |. 81EC 10010000 sub esp, 1106 m3 C) P/ H7 y8 V- l/ W
0040C5DC |. 89C6 mov esi, eax
, G7 J) ^6 s) y5 z1 R( w. f0040C5DE |. 89C7 mov edi, eax0 x; J. E7 L* m% s
0040C5E0 |. 29C9 sub ecx, ecx2 v% { t3 r9 ^
0040C5E2 |. 49 dec ecx8 t) F, M% }( @+ ~
0040C5E3 |. 31C0 xor eax, eax* N3 w! ~" D( G
0040C5E5 |. F2:AE repne scas byte ptr es:[edi]
0 t: @8 ?4 v) d" p, c0 N5 S, h0040C5E7 |. F7D1 not ecx+ C: s9 D- ]" p
0040C5E9 |. 49 dec ecx
2 S/ h7 ?& S/ J$ s% S# i9 r0040C5EA |. 31DB xor ebx, ebx7 \$ D3 V' T6 b' M5 ]3 S" Q w
0040C5EC |. 31ED xor ebp, ebp3 `- o( n. f0 \0 a
0040C5EE |. 81F9 00010000 cmp ecx, 1006 G) h/ q- K4 V
0040C5F4 |. 72 0D jb short 0040C6037 C2 _3 D* Z7 M! }
0040C5F6 |. 81C4 10010000 add esp, 110
4 o. ]* v6 n* J, R$ |. C' S! E0 Z0040C5FC |. 5D pop ebp
7 ^. m1 K' w6 a8 L; L3 R" v0040C5FD |. 5F pop edi
4 ~2 @; H* w v+ B. L1 b: ~0 v: W0040C5FE |. 5E pop esi3 H- o( `: x3 e9 \
0040C5FF |. 5A pop edx
6 H& T( c1 d6 X; w& e0040C600 |. 59 pop ecx
9 Y& n* F- X1 k& f& @0040C601 |. 5B pop ebx
% F& T6 D$ P: j2 L( p0040C602 |. C3 retn
% f/ d; j* Z# V- T( V1 E! {0040C603 |> 89E7 mov edi, esp* u7 u" P+ W, B, l: t
0040C605 |. 57 push edi
, Q1 c/ S9 a! |0040C606 |> 8A06 /mov al, byte ptr [esi]& ^. g, M i) A* @9 y E5 N. `& O
0040C608 |. 8807 |mov byte ptr [edi], al
V c; ]4 L8 u) j0040C60A |. 3C 00 |cmp al, 0; u2 p% z9 H; U! y% `- z, E
0040C60C |. 74 10 |je short 0040C61E5 n; `, t3 [0 v% s0 }! q# P+ h
0040C60E |. 8A46 01 |mov al, byte ptr [esi+1], z# U2 B# J5 t$ k
0040C611 |. 83C6 02 |add esi, 2
8 {4 a# o; X; j2 s: S$ S0040C614 |. 8847 01 |mov byte ptr [edi+1], al' V' Y! x5 A3 O8 G& O
0040C617 |. 83C7 02 |add edi, 2
( H2 c2 _1 S7 z3 w# u) k0040C61A |. 3C 00 |cmp al, 0
+ v8 {: b( Q i- H3 z4 @& z( e( c0040C61C |.^ 75 E8 \jnz short 0040C606
: C4 Q' H- f# N: A2 H' U, E0040C61E |> 5F pop edi/ a) X! R _2 E* S4 @1 t. u
0040C61F |. 8A1424 mov dl, byte ptr [esp]8 ~$ V! P8 j: E# f
0040C622 |. 89E0 mov eax, esp
7 L( m. k& d1 d8 y/ [0040C624 |. 84D2 test dl, dl
9 G0 x5 J) P# N% r z2 r0040C626 |. 74 09 je short 0040C631
4 X. a' t0 A. y* E- p7 a- {& x0040C628 |> 8A70 01 /mov dh, byte ptr [eax+1]" ~% X. F2 k3 X% a$ e
0040C62B |. 40 |inc eax
L% k8 X* ?) c4 a9 p% X& S: Q0040C62C |. 45 |inc ebp
- N; e9 C0 A3 p( Y5 L4 w0040C62D |. 84F6 |test dh, dh
, @1 Z, k) U) f0040C62F |.^ 75 F7 \jnz short 0040C628
( h* L V8 d6 V$ y, B r. [8 p0040C631 |> 81FD D2000000 cmp ebp, 0D2
. J, A8 V- F" i) l+ l, A: m0040C637 |. 0F8E 61010000 jle 0040C79E
$ b! J# ]* P6 V7 E% A& l0040C63D |. 89EA mov edx, ebp! J) {8 B( V0 o7 \) x8 c2 X
0040C63F |. 89E8 mov eax, ebp
1 z. i( ^( E' |8 V6 H$ u7 p l# k) R0040C641 |. C1FA 1F sar edx, 1F
8 h8 U1 w; z) H' m0040C644 |. C1E2 02 shl edx, 2- |* P6 n5 E4 L( H
0040C647 |. 1BC2 sbb eax, edx( V$ ?9 p% _8 e# r2 I
0040C649 |. C1F8 02 sar eax, 2
* f7 J+ o, U! _ g0040C64C |. 89C7 mov edi, eax, y8 w6 A# K$ s1 p+ {5 k2 s; _: u, a
0040C64E |. C78424 040100>mov dword ptr [esp+104], 3* q' D# b. r1 x7 b
0040C659 |> 89E0 mov eax, esp
; T! f$ W( S. i+ [ F: K* ]0040C65B |. 31D2 xor edx, edx
' D* i& `4 s n7 x2 E1 ]9 z0040C65D |. 8A0C24 mov cl, byte ptr [esp]
$ p! W& ~2 m/ U/ T0040C660 |. 8915 8477EF02 mov dword ptr [2EF7784], edx
( f& j( t1 r/ T1 ^0040C666 |. 8915 8C77EF02 mov dword ptr [2EF778C], edx
6 x; c; J, g( X" p9 k+ F; K V; W0040C66C |. 899424 080100>mov dword ptr [esp+108], edx1 j, A$ ^0 r! g) P: i
0040C673 |. 89E2 mov edx, esp0 `* {. y: K. W) g2 B& j. J* b
0040C675 |. 84C9 test cl, cl- F3 i) [& L6 d1 e" i
0040C677 |. 0F84 89000000 je 0040C706
( |+ z+ V/ u7 y2 i1 r% B8 H6 X0040C67D |. 8B8C24 040100>mov ecx, dword ptr [esp+104]
" _# l \1 |$ q) N! Y0040C684 |. 4F dec edi" e* ?0 D+ v" M( i
0040C685 |. C1E1 02 shl ecx, 25 t$ _% b3 {8 ?5 [
0040C688 |. 89BC24 000100>mov dword ptr [esp+100], edi
3 n5 d2 \% p( Y4 ~: V3 ?/ g$ e0040C68F |. 898C24 0C0100>mov dword ptr [esp+10C], ecx
0 y- p& q* ~& ?5 j0040C696 |> 8A0A mov cl, byte ptr [edx]7 B* a8 [6 p$ y Q! O5 p' h
0040C698 |. 80F9 20 cmp cl, 20
7 q) F/ s: g6 T0040C69B |. 0F85 6A010000 jnz 0040C80B
! C5 X ~( }: n2 F6 d. m: ^. X0040C6A1 |. 3B9C24 000100>cmp ebx, dword ptr [esp+100]
/ L+ ]# s- ]* C, {% j) ~1 w' d0040C6A8 |. 7C 53 jl short 0040C6FD
2 u3 `/ N% @. P% D4 ]0040C6AA |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]: x: n `, q. @9 y/ V! p
0040C6B1 |. C602 00 mov byte ptr [edx], 0
: l& `& O$ ^7 r2 \3 i2 F0040C6B4 |. 89C6 mov esi, eax0 W2 I [: }/ s6 F. g& Q3 _
0040C6B6 |. 8BBF 7477EF02 mov edi, dword ptr [edi+2EF7774]" U4 h( g) P+ o! d! }1 j
0040C6BC |. 31DB xor ebx, ebx
$ |$ K9 m L7 V: N0040C6BE |. 57 push edi+ U5 Y, ]9 B1 j- t- @
0040C6BF |> 8A06 /mov al, byte ptr [esi]
+ h" g: g t' S0 |8 y# q7 M0040C6C1 |. 8807 |mov byte ptr [edi], al
. r/ f" B' \, w v; F+ {- i0040C6C3 |. 3C 00 |cmp al, 09 r) G% a8 b+ x
0040C6C5 |. 74 10 |je short 0040C6D74 ^, X$ f. [3 d+ f9 `( n
0040C6C7 |. 8A46 01 |mov al, byte ptr [esi+1]3 `4 H, r. V4 F' f& c
0040C6CA |. 83C6 02 |add esi, 2# [' N9 r) y8 e- P: ^
0040C6CD |. 8847 01 |mov byte ptr [edi+1], al* _% m' {# i$ h4 T
0040C6D0 |. 83C7 02 |add edi, 2
0 f5 _0 G% O# C0040C6D3 |. 3C 00 |cmp al, 0
& ^* O# b5 {/ z$ l8 L7 `0040C6D5 |.^ 75 E8 \jnz short 0040C6BF8 D! [3 n" D- a9 g8 W1 A0 Y9 G
0040C6D7 |> 5F pop edi
. R- v4 Y; x, \8 j( q0040C6D8 |. 8D42 01 lea eax, dword ptr [edx+1]
: B1 n9 }4 W' c" a) ?$ P! J/ f4 [0040C6DB |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]$ d+ u% D) _5 ] L
0040C6E2 |. 8B9424 080100>mov edx, dword ptr [esp+108]: x" _0 q K! v: Y
0040C6E9 |. 83EF 04 sub edi, 4
3 m1 g! G' {4 x; u# ~/ W0040C6EC |. 42 inc edx7 L$ q+ i k# l( w6 e1 m
0040C6ED |. 89BC24 0C0100>mov dword ptr [esp+10C], edi
5 q$ }$ N7 d& c5 J' I$ t0040C6F4 |. 899424 080100>mov dword ptr [esp+108], edx
7 l8 X3 B" Q5 q9 S8 B) W/ O! r2 x0040C6FB |. 89C2 mov edx, eax
) T3 O, G3 w! W3 k" Z, b' Z( t0040C6FD |> 43 inc ebx
9 M5 ?) ~+ _8 \, L# F/ B9 p! T/ _0040C6FE |. 8A6A 01 mov ch, byte ptr [edx+1], T, @# M8 I0 j6 D; q2 F
0040C701 |. 42 inc edx
- b5 |! q+ j. J3 Y( y0040C702 |. 84ED test ch, ch
! E% M |; N9 S [0040C704 |.^ 75 90 jnz short 0040C696+ G. X# |5 x' y( J' n: |
0040C706 |> 83FD 10 cmp ebp, 103 F( Y' m+ F8 i) }+ ~
0040C709 |. 7F 05 jg short 0040C710, [. O( Z# j0 L5 G& ]% W
0040C70B |. BD 20000000 mov ebp, 20
" r" B0 A( q+ a0040C710 |> 8B9424 040100>mov edx, dword ptr [esp+104] d; d+ X O6 a& `- Q
0040C717 |. 2B9424 080100>sub edx, dword ptr [esp+108]
& R3 h& n: K+ ~; v0 `6 U) t3 j# c0040C71E |. 85D2 test edx, edx
0 H% Y8 g# K" b2 K0 w7 A8 k) N0040C720 |. 7C 23 jl short 0040C7456 u0 c* G$ k+ R+ p; b" _
0040C722 |. 89C6 mov esi, eax% C8 m6 ?1 r* U
0040C724 |. 8B3C95 7477EF>mov edi, dword ptr [edx*4+2EF7774]
7 F& m2 @0 U0 p; L1 L$ J0 u0040C72B |. 57 push edi
9 X+ s4 \5 h* E8 Q$ U0040C72C |> 8A06 /mov al, byte ptr [esi]
* G6 U6 s4 f @" ~3 ]* h4 q) M0040C72E |. 8807 |mov byte ptr [edi], al" p. S- T) n, L+ F) s& [# [
0040C730 |. 3C 00 |cmp al, 0
S: V, v1 `5 G- c7 l9 A0040C732 |. 74 10 |je short 0040C744
2 S, B1 P" Z3 h1 C2 ^- ?0040C734 |. 8A46 01 |mov al, byte ptr [esi+1]
9 @2 k' G7 H/ M/ m, _0040C737 |. 83C6 02 |add esi, 2
, t/ e( k& _1 c) h& |( C0040C73A |. 8847 01 |mov byte ptr [edi+1], al- U% ?& U) h5 Q. A5 o- ?: L2 ]/ _# i4 I
0040C73D |. 83C7 02 |add edi, 2
6 Z& T& Q0 t @$ x0040C740 |. 3C 00 |cmp al, 08 g! v1 X0 @0 y) u2 f: D
0040C742 |.^ 75 E8 \jnz short 0040C72C
/ U& A( z! Y' Y0040C744 |> 5F pop edi9 h) G6 L- Y. W( T1 \
0040C745 |> E8 E6500100 call 00421830
1 \6 j9 f. ~% W Z) y( u! t0040C74A |. A3 8877EF02 mov dword ptr [2EF7788], eax; J. N* S4 J" ?' q
0040C74F |. 8B8424 040100>mov eax, dword ptr [esp+104]
& t0 @: a. J, w0040C756 |. 40 inc eax7 j# N ~3 k# J1 h# l$ c6 [( T
0040C757 |. A3 8477EF02 mov dword ptr [2EF7784], eax& S7 a- [9 s& u
0040C75C |. C705 8C77EF02>mov dword ptr [2EF778C], 1
$ O/ Z6 r7 n( U. B/ X2 Z; Y! r0040C766 |. B8 64000000 mov eax, 64; p" x; q7 @3 Q
0040C76B |. 89C2 mov edx, eax( S4 N1 Y% M4 c/ c7 M
0040C76D |. 8B0D E880EF02 mov ecx, dword ptr [2EF80E8]$ D; `7 O* N9 h& C
0040C773 |. C1FA 1F sar edx, 1F
! Z! C! Y1 ?5 }$ O. T6 o; a6 N& `0040C776 |. F7F9 idiv ecx5 S8 f7 m# Y4 |$ m
0040C778 |. 89C3 mov ebx, eax% h8 b$ `6 E: U# \2 y; Y
0040C77A |. 89EA mov edx, ebp
4 t2 O' l" j9 t& P$ d" q/ J& ]0040C77C |. 89E8 mov eax, ebp1 J7 a) G7 s3 @
0040C77E |. C1FA 1F sar edx, 1F$ x) ]: [! a1 v. @2 S2 ~' f7 j% H
0040C781 |. C1E2 04 shl edx, 48 X3 T1 O% C- C6 u
0040C784 |. 1BC2 sbb eax, edx- z( Y. c1 R% g8 J! U
0040C786 |. C1F8 04 sar eax, 4
5 |7 d) H0 \6 B8 S, f0040C789 |. 01C3 add ebx, eax# a# k* \5 Q7 i
0040C78B |. 891D 9077EF02 mov dword ptr [2EF7790], ebx3 p# b3 U. V% C/ q9 t; N' r; f
0040C791 |. 81C4 10010000 add esp, 110% W* t( I1 S! `; g- J _1 z
0040C797 |. 5D pop ebp
' B. k. V0 G& n* V* |( e0040C798 |. 5F pop edi; _" w; K, ^% O, Q1 }
0040C799 |. 5E pop esi
m) a7 V5 M, z- u4 ?$ n' G4 {3 f/ r0040C79A |. 5A pop edx
; l6 X3 i8 m( O2 l9 k6 u0040C79B |. 59 pop ecx
" l* s/ ]. _0 k0040C79C |. 5B pop ebx e% X( d; V7 W1 ^; S0 u# g
0040C79D |. C3 retn- ^! q' K! O3 i5 T- d
0040C79E |> 81FD 8C000000 cmp ebp, 8C' C. B& @9 X5 ^1 e, [) t F7 \
0040C7A4 |. 7C 28 jl short 0040C7CE5 {3 ~. T. |* i) ]0 x
0040C7A6 |. 81FD D2000000 cmp ebp, 0D21 o7 O& `. d( z2 D) m6 j1 L* H
0040C7AC |. 7F 20 jg short 0040C7CE
7 x7 U) ^; z' v% i0 J1 U6 [6 a0040C7AE |. B9 03000000 mov ecx, 3, U+ f6 `5 t) y+ O: i) g
0040C7B3 |. 89EA mov edx, ebp
8 e1 K; S; ~0 g3 Z; g9 l5 @0040C7B5 |. 89E8 mov eax, ebp
* S1 U# W9 p/ }0040C7B7 |. C1FA 1F sar edx, 1F
5 v% B5 a9 y; Y1 {4 @+ p% K" y/ o0040C7BA |. F7F9 idiv ecx
, l3 z4 I( N/ z" \- a/ a6 S0040C7BC |. C78424 040100>mov dword ptr [esp+104], 2
! p% N$ O) ^6 K! Q1 C0040C7C7 |. 89C7 mov edi, eax
, a" C. d* g5 f0040C7C9 |.^ E9 8BFEFFFF jmp 0040C659
( h, k- A! A( n0040C7CE |> 83FD 46 cmp ebp, 46
. w. I5 V3 a4 _2 j; I' h- |5 ?8 ]0040C7D1 |. 7C 25 jl short 0040C7F8
$ [" ^3 x( v9 Y3 P. p: V2 L0040C7D3 |. 81FD 8C000000 cmp ebp, 8C2 r+ R- V/ M2 W
0040C7D9 |. 7F 1D jg short 0040C7F8
% K# U! y( j& s0040C7DB |. 89EA mov edx, ebp
: c U+ K; ?4 L, I" X4 @0040C7DD |. 89E8 mov eax, ebp1 F' \8 ^: w% }9 Q# d6 B
0040C7DF |. C1FA 1F sar edx, 1F& A* s: a/ h% _; Q: ]' ^9 ~- P; S
0040C7E2 |. 2BC2 sub eax, edx7 c K; e2 F- p( V
0040C7E4 |. D1F8 sar eax, 1; i. k' j/ J# D7 V# }
0040C7E6 |. C78424 040100>mov dword ptr [esp+104], 11 s2 }1 `" f& j6 k& Q- \
0040C7F1 |. 89C7 mov edi, eax
: Y8 a" { q* B k/ n4 N' v0040C7F3 |.^ E9 61FEFFFF jmp 0040C659
. k; ]) T; m a# ` }0 l0040C7F8 |> 31D2 xor edx, edx
' J7 i$ K: _* J4 Y- T j0040C7FA |. BF 46000000 mov edi, 46
: K' O/ H9 A3 I9 ~6 n0040C7FF |. 899424 040100>mov dword ptr [esp+104], edx7 {4 A& X% k7 x% h
0040C806 |.^ E9 4EFEFFFF jmp 0040C659! f9 _) i) } H3 l: L4 ] L
0040C80B |> 80F9 7C cmp cl, 7C
0 {% Q6 c0 Z( y( K7 Z0040C80E |.^ 0F85 E9FEFFFF jnz 0040C6FD3 p& W R ^# u
0040C814 |. C602 20 mov byte ptr [edx], 20
% `" G3 r o1 w: [+ z0040C817 \.^ E9 E1FEFFFF jmp 0040C6FD
4 q! L0 n5 ?6 [ J+ l3 j2 A) K( E4 E, q/ H8 I+ B. H
在scratches.sc和scream.sc里面有lua的脚本,保存有字体文件名。
. p: Q, F. b$ S6 h0 b2 X2 l估计要汉化就要在上面的代码段下功夫了,以后继续研究。
2 N* W/ n, u9 ~ b& ~* F7 [# Y* n j" a4 h* [. p0 z" w3 d
找到2个俄文的补丁,也许对以后研究有用。; y- u! T+ |/ `2 Z5 o
http://www.megaupload.com/?d=EZH6X672* n, V1 j" d D! u8 g* S
http://rapidshare.com/files/94227080/ScratchesDC.7z |