看了一下惊恐鬼屋Scratches这个游戏。+ s+ y( ]+ ~) F1 e7 _6 t
包文件有2个,scratches.res和scream.res,/ Q" x. @% w8 I; m% v, D
包文件的格式如下,可以用Game Extractor来解开。8 _! L$ I; u- @$ z* k+ n
http://wiki.xentax.com/index.php/Scratches_RES
3 g/ ]: q. ]5 B, F从scratches.res里面解出一个font-michael.tga文件,就是在游戏利用的字体。( G8 a$ u/ f7 S G$ C
scream.res里面也有一个字体文件,但是游戏好像没有用到。/ O/ L; V, k& T
: _& G& m& _& @0 d
用OD调试后,发现这是一个使用opengl API的游戏。
/ r; ?4 {# K9 `0 P+ l) A在某句字幕上下了内存断点,断下来之后找到了和显示有关的代码段。
s- V9 @) S2 w; O0 T. S6 k; z' A/ T; M2 S& F/ a
0040C5D0 /$ 53 push ebx8 n1 T0 A$ r9 l' Y! @8 a
0040C5D1 |. 51 push ecx
& ?) m% G" ~6 _6 J7 U3 }0040C5D2 |. 52 push edx5 `; ~* l4 H% N8 p' t
0040C5D3 |. 56 push esi- i4 L K1 I% e( G* J
0040C5D4 |. 57 push edi* T, O% I H( s
0040C5D5 |. 55 push ebp/ s+ j1 Q- ]* u3 M# z. _7 r6 h
0040C5D6 |. 81EC 10010000 sub esp, 110
/ r9 I- n4 n# S0 [0040C5DC |. 89C6 mov esi, eax
" x+ i+ j* ~ a; h3 I4 z0040C5DE |. 89C7 mov edi, eax# J3 _' d) F" @0 ]9 w4 s x, w$ q& H. f
0040C5E0 |. 29C9 sub ecx, ecx/ G( V0 I& c; {1 o- H3 u8 D4 D
0040C5E2 |. 49 dec ecx
6 b& l/ f1 t5 W6 L4 d0040C5E3 |. 31C0 xor eax, eax
7 L b f# ]* N) a0 C; p0040C5E5 |. F2:AE repne scas byte ptr es:[edi]
8 L7 m6 w3 q9 ^0040C5E7 |. F7D1 not ecx
0 k! j- W( l8 \, |$ O0040C5E9 |. 49 dec ecx8 l% V L6 u$ b# H- i( {1 p2 J
0040C5EA |. 31DB xor ebx, ebx
- P5 `: Y) `+ P _' E; k0040C5EC |. 31ED xor ebp, ebp
/ j+ R9 f/ `. O3 L+ s! o0040C5EE |. 81F9 00010000 cmp ecx, 100
. Z# W; V ^# X8 C6 h- Y2 u0040C5F4 |. 72 0D jb short 0040C603
2 E, c$ b% ?( `$ H* H, V$ \) {0040C5F6 |. 81C4 10010000 add esp, 110
* q5 `4 Y l# F! c- O0040C5FC |. 5D pop ebp
7 C# z# k" K5 ^) S0040C5FD |. 5F pop edi M- _7 G0 {, `, j- s$ Q6 r+ i- q
0040C5FE |. 5E pop esi( z& i5 s( q. A/ \+ X6 A* J5 c# a
0040C5FF |. 5A pop edx
% z2 y- B/ l( c8 |* w( w, }0040C600 |. 59 pop ecx9 L) l8 i' C B, t
0040C601 |. 5B pop ebx# }( l: c0 T% h6 T
0040C602 |. C3 retn
( C" b9 z3 |6 E' \$ K6 R+ C0040C603 |> 89E7 mov edi, esp
7 H+ K* B# Z1 d3 W" ?' n. b) O0040C605 |. 57 push edi& c1 L1 |, W+ v8 Y' f3 g
0040C606 |> 8A06 /mov al, byte ptr [esi]
c# g( N" ^ l8 ^% s0040C608 |. 8807 |mov byte ptr [edi], al
4 A) E; q0 p4 e' F3 j6 z$ f0040C60A |. 3C 00 |cmp al, 04 M, t% O) E. N0 @$ D
0040C60C |. 74 10 |je short 0040C61E
0 ]9 k. `& J) O: U- u0040C60E |. 8A46 01 |mov al, byte ptr [esi+1]
9 ]& k) L) J- z. x0040C611 |. 83C6 02 |add esi, 2
# g: U, I$ _$ x0040C614 |. 8847 01 |mov byte ptr [edi+1], al
! O' z4 Z5 I6 C6 {, X, U" H0040C617 |. 83C7 02 |add edi, 2+ o+ X7 G8 |3 v* j2 q& [; f
0040C61A |. 3C 00 |cmp al, 0* h: w2 m6 u5 N7 c
0040C61C |.^ 75 E8 \jnz short 0040C606
$ h5 w2 l+ H9 S' k0040C61E |> 5F pop edi
6 @) E2 y) H; D) s6 }2 ^0040C61F |. 8A1424 mov dl, byte ptr [esp]
2 l* E% k& r, K0040C622 |. 89E0 mov eax, esp }7 v, T5 Y1 ?
0040C624 |. 84D2 test dl, dl
# Y5 K. q1 S. g0040C626 |. 74 09 je short 0040C631; Q! T5 |- Q7 _1 y" S, ~
0040C628 |> 8A70 01 /mov dh, byte ptr [eax+1]# k3 m" B3 d1 ^8 M u6 L6 e2 o
0040C62B |. 40 |inc eax
& S- Q/ Q# ]' N3 J3 y0040C62C |. 45 |inc ebp W2 k( _" W$ b$ z) a
0040C62D |. 84F6 |test dh, dh5 @& S6 N' [; c9 g% |% {! G( Z
0040C62F |.^ 75 F7 \jnz short 0040C628) R% o6 N" N( c1 J. i% R
0040C631 |> 81FD D2000000 cmp ebp, 0D2
1 {5 _, W2 A' E6 M z0040C637 |. 0F8E 61010000 jle 0040C79E
- t" E1 q; R* H' j( p6 E# X7 G0040C63D |. 89EA mov edx, ebp8 t1 i5 i' A! z' D# q0 E
0040C63F |. 89E8 mov eax, ebp
% {" F4 T; |) e: f! n; W% _( z+ N& Z0040C641 |. C1FA 1F sar edx, 1F2 ^! e' o2 {- K( ~& c
0040C644 |. C1E2 02 shl edx, 2
I8 r& y( u7 i- _$ J0040C647 |. 1BC2 sbb eax, edx- b& D- k1 L9 A: z# g( c) ~- w% j& G5 s
0040C649 |. C1F8 02 sar eax, 2
2 t0 u6 r2 `* M0040C64C |. 89C7 mov edi, eax
" E3 d! e3 i- R0040C64E |. C78424 040100>mov dword ptr [esp+104], 3
/ ^6 d" M$ G2 P/ @# d0040C659 |> 89E0 mov eax, esp
: |2 `8 f' K) R6 W/ ]0040C65B |. 31D2 xor edx, edx
& v; J6 x* z6 \# S0040C65D |. 8A0C24 mov cl, byte ptr [esp]: M$ M! q/ @7 h5 O/ X- H
0040C660 |. 8915 8477EF02 mov dword ptr [2EF7784], edx
! d6 Z7 z! B' B7 v$ b4 a a0040C666 |. 8915 8C77EF02 mov dword ptr [2EF778C], edx
: p5 p. d9 I" Z9 u- V/ {. i# k0040C66C |. 899424 080100>mov dword ptr [esp+108], edx& L G4 S, [# @
0040C673 |. 89E2 mov edx, esp
% S0 [9 S0 H% v0 O0040C675 |. 84C9 test cl, cl% J7 l+ W- t- f. E, ~8 H
0040C677 |. 0F84 89000000 je 0040C706: V4 \. i" S+ ]7 O" y3 r9 y; \
0040C67D |. 8B8C24 040100>mov ecx, dword ptr [esp+104]
R/ B- k0 p% O+ z+ \8 b0040C684 |. 4F dec edi
4 u! L8 l) Y+ N# [! p* U0040C685 |. C1E1 02 shl ecx, 2
6 Z2 ~/ i' p7 f ]/ e! E0040C688 |. 89BC24 000100>mov dword ptr [esp+100], edi2 h1 v" O, U) K2 K4 Z, h' e
0040C68F |. 898C24 0C0100>mov dword ptr [esp+10C], ecx$ v3 x9 \* E+ c' Y6 \, C/ u4 w
0040C696 |> 8A0A mov cl, byte ptr [edx]
# T+ t- e* O. W+ ]8 V0040C698 |. 80F9 20 cmp cl, 20
/ g# T1 C* s8 v, f0040C69B |. 0F85 6A010000 jnz 0040C80B
* o1 x7 L( N' e9 I0040C6A1 |. 3B9C24 000100>cmp ebx, dword ptr [esp+100]! W1 a1 ^1 N+ J; O5 W1 w
0040C6A8 |. 7C 53 jl short 0040C6FD
, a4 Z3 g5 w) B0040C6AA |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]
7 g5 Y4 l1 W+ c1 o) O, L' x0040C6B1 |. C602 00 mov byte ptr [edx], 0& O( c$ N( _ D: ~5 Y% u1 i+ K; ~
0040C6B4 |. 89C6 mov esi, eax
5 D: y4 j+ a/ o9 n! y6 Z0040C6B6 |. 8BBF 7477EF02 mov edi, dword ptr [edi+2EF7774]% c$ E( s+ ~4 s: q1 @' ~+ ?
0040C6BC |. 31DB xor ebx, ebx
5 ]0 S# l: S8 t5 n0040C6BE |. 57 push edi
w5 a& Y0 |) E& f& k; z0040C6BF |> 8A06 /mov al, byte ptr [esi]
: o0 b! A- ?# M, h) r$ X0040C6C1 |. 8807 |mov byte ptr [edi], al* L/ c3 y4 T: O0 `5 k% E8 N
0040C6C3 |. 3C 00 |cmp al, 0
, A E, m* ~! X* V$ q0040C6C5 |. 74 10 |je short 0040C6D7
/ t4 X5 k6 e4 f1 t0040C6C7 |. 8A46 01 |mov al, byte ptr [esi+1]
1 B! f6 Q( a7 q% P4 }% e: |0040C6CA |. 83C6 02 |add esi, 2& I$ G# L$ r% g" R
0040C6CD |. 8847 01 |mov byte ptr [edi+1], al5 E- d% F* N' X+ l
0040C6D0 |. 83C7 02 |add edi, 2
7 R$ o1 i1 x& ]1 ~; A' |9 q( M2 {0040C6D3 |. 3C 00 |cmp al, 0
3 F. [9 F' x4 j" p0040C6D5 |.^ 75 E8 \jnz short 0040C6BF
y y, z4 Z% L% F; @ h9 V0040C6D7 |> 5F pop edi2 d% Z# [4 ]8 A$ R
0040C6D8 |. 8D42 01 lea eax, dword ptr [edx+1]
( n8 h% o/ T' [0040C6DB |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]0 S& }: c$ y% P8 b D: w
0040C6E2 |. 8B9424 080100>mov edx, dword ptr [esp+108]
% Q. A+ t, i9 x% j7 w0 m5 F' t) Q0040C6E9 |. 83EF 04 sub edi, 4
0 C3 q' {$ h2 t: I7 l+ Y ^0040C6EC |. 42 inc edx: j; E9 L! y9 ?7 O5 R |% @
0040C6ED |. 89BC24 0C0100>mov dword ptr [esp+10C], edi% M1 M1 ]2 ^ c+ B1 n
0040C6F4 |. 899424 080100>mov dword ptr [esp+108], edx, f/ [2 B: o/ b: D$ V, O
0040C6FB |. 89C2 mov edx, eax
6 j; J2 ]9 R+ J1 O+ ?0 c" E* y0040C6FD |> 43 inc ebx
( D( C- ~1 _6 ~% ^4 E9 W0040C6FE |. 8A6A 01 mov ch, byte ptr [edx+1]; E6 v7 E9 H' O8 I6 e% i
0040C701 |. 42 inc edx& O1 H; V, V; p
0040C702 |. 84ED test ch, ch
9 }' P! L6 M+ l; i. g0040C704 |.^ 75 90 jnz short 0040C6960 P+ p R1 u+ |0 q+ y, E4 u6 B
0040C706 |> 83FD 10 cmp ebp, 10
$ z% Q- ^' E5 ]0 {& W: q3 ]4 T8 d0040C709 |. 7F 05 jg short 0040C710, x. W# K; d5 }9 Z
0040C70B |. BD 20000000 mov ebp, 20& ?1 Z3 G( p2 b* H( Y
0040C710 |> 8B9424 040100>mov edx, dword ptr [esp+104]+ v2 e. F. j: Q
0040C717 |. 2B9424 080100>sub edx, dword ptr [esp+108]! Z& i: `! S: K+ m6 S4 ~( \
0040C71E |. 85D2 test edx, edx, g8 p, n- S/ o: M+ v
0040C720 |. 7C 23 jl short 0040C745+ M) D& y- L0 Y, l+ r/ m" x; y5 Q
0040C722 |. 89C6 mov esi, eax( U7 R' P- M0 V' R! A
0040C724 |. 8B3C95 7477EF>mov edi, dword ptr [edx*4+2EF7774]( t7 ?" `9 r8 G" Z7 J
0040C72B |. 57 push edi7 [) M( O8 [7 ]( i. |
0040C72C |> 8A06 /mov al, byte ptr [esi], `9 O+ _ r7 h
0040C72E |. 8807 |mov byte ptr [edi], al( E v. u c" f4 e/ u
0040C730 |. 3C 00 |cmp al, 0
' q0 D5 v: {- M0040C732 |. 74 10 |je short 0040C744
: l3 p2 z4 q- [" A" ^+ l/ i0040C734 |. 8A46 01 |mov al, byte ptr [esi+1]
0 j- G/ q. M- ^7 h6 ^; D: ^0040C737 |. 83C6 02 |add esi, 2
& o4 x8 d, O0 X) i* v" S2 _( [* q0040C73A |. 8847 01 |mov byte ptr [edi+1], al
0 v( K8 O" v3 w" B2 Y2 k0040C73D |. 83C7 02 |add edi, 25 c7 G) [! |6 h
0040C740 |. 3C 00 |cmp al, 0* x3 C; p/ F5 k8 c7 ~; `
0040C742 |.^ 75 E8 \jnz short 0040C72C3 O& A2 \, ]9 w$ E# x' k
0040C744 |> 5F pop edi
M! {5 i6 K% h" f% W( l0040C745 |> E8 E6500100 call 004218302 [ z1 g9 _# n3 ~5 s& f
0040C74A |. A3 8877EF02 mov dword ptr [2EF7788], eax
4 I" c) g2 S' v0 q! g. v e, w0040C74F |. 8B8424 040100>mov eax, dword ptr [esp+104]
: D4 g5 a. E( t1 v2 L3 u0040C756 |. 40 inc eax, N- @2 r$ Q& B
0040C757 |. A3 8477EF02 mov dword ptr [2EF7784], eax7 d: K9 i6 n1 Z4 `0 i
0040C75C |. C705 8C77EF02>mov dword ptr [2EF778C], 1; O/ w5 l) `& u0 u
0040C766 |. B8 64000000 mov eax, 64: `5 }2 ^& X4 B. C
0040C76B |. 89C2 mov edx, eax! b- m+ [& y- H: r j9 @
0040C76D |. 8B0D E880EF02 mov ecx, dword ptr [2EF80E8]+ a0 [" |( c5 W: C# v2 |5 [
0040C773 |. C1FA 1F sar edx, 1F4 j7 Y/ f" p6 X2 z" |8 `$ j$ i; |
0040C776 |. F7F9 idiv ecx
. p1 l/ h$ U5 k$ |; \0040C778 |. 89C3 mov ebx, eax
* X- Y% K( H3 N3 Y0 K' Q0040C77A |. 89EA mov edx, ebp) x$ R0 {: d" ], w
0040C77C |. 89E8 mov eax, ebp) U' w0 K& ?9 S+ c
0040C77E |. C1FA 1F sar edx, 1F
2 w$ Y2 @. ~, H) j0040C781 |. C1E2 04 shl edx, 4
+ ^% i8 G- w) {* A& t" k2 L( C0040C784 |. 1BC2 sbb eax, edx
8 J- i! O. n% R" g0040C786 |. C1F8 04 sar eax, 46 f0 q, g! g) z9 N
0040C789 |. 01C3 add ebx, eax
: N& |' Y) J& |2 C0 }& X2 g( X2 Y& w6 {0040C78B |. 891D 9077EF02 mov dword ptr [2EF7790], ebx
: G5 }; t+ F# Y; M$ [ Y% V% i2 l0040C791 |. 81C4 10010000 add esp, 110' k; @% _, Q' _* M7 j6 E3 T' q
0040C797 |. 5D pop ebp
& z% `4 l7 U# i4 @0040C798 |. 5F pop edi
3 L$ X( e# s+ u) Q) d9 h& X: p1 Y0040C799 |. 5E pop esi ]/ X3 J- b" S% J7 `$ \. X: D. I& Y
0040C79A |. 5A pop edx
6 ?8 @# z* b" |8 @. r9 H4 D0040C79B |. 59 pop ecx
% N( {2 H8 A" m4 [& s9 Y U0040C79C |. 5B pop ebx. g0 I( {# A @* q' K) |( z y
0040C79D |. C3 retn& w+ j: O9 N2 x' g
0040C79E |> 81FD 8C000000 cmp ebp, 8C5 _0 ]9 l" `( h. t
0040C7A4 |. 7C 28 jl short 0040C7CE
! d! w' W* }7 o$ |0040C7A6 |. 81FD D2000000 cmp ebp, 0D2( Y1 I/ A4 M+ Q+ M* }
0040C7AC |. 7F 20 jg short 0040C7CE
( J$ e# _8 q4 s2 v9 z9 a: @ Q0040C7AE |. B9 03000000 mov ecx, 3
& _: U9 L* W0 b9 n1 W5 A, S( H6 e0040C7B3 |. 89EA mov edx, ebp1 I9 V, A' ]7 F( T. Z9 }$ }' F
0040C7B5 |. 89E8 mov eax, ebp
( C% g) _* c* n- Z3 i8 {0040C7B7 |. C1FA 1F sar edx, 1F
1 Y# n2 z2 ~7 d U6 J" ]" A) [6 w0040C7BA |. F7F9 idiv ecx
! s& n- b& h& P; J H, ~0040C7BC |. C78424 040100>mov dword ptr [esp+104], 25 ~5 H: X, d3 N/ Y
0040C7C7 |. 89C7 mov edi, eax
4 r6 _& F# ?7 {" O* j! c0040C7C9 |.^ E9 8BFEFFFF jmp 0040C659
" m/ J( ?0 I- @5 u0040C7CE |> 83FD 46 cmp ebp, 46
5 c$ H" U# p- ~- Z* u# @: l6 S5 {+ Y0040C7D1 |. 7C 25 jl short 0040C7F85 \% [6 [& C9 B" K' N' [4 S+ v
0040C7D3 |. 81FD 8C000000 cmp ebp, 8C5 P! A m; W" Q7 W( Z
0040C7D9 |. 7F 1D jg short 0040C7F83 A- f2 M5 R% ~1 ]% P
0040C7DB |. 89EA mov edx, ebp3 N6 c/ t% U, G, V7 E' o$ q0 T3 u
0040C7DD |. 89E8 mov eax, ebp5 H. x+ K+ o, T0 ?3 ~" k5 ^: w3 y
0040C7DF |. C1FA 1F sar edx, 1F
! |$ G& k/ z+ s0040C7E2 |. 2BC2 sub eax, edx
# `3 I3 k; b1 ?$ w0040C7E4 |. D1F8 sar eax, 1% d( ?: g4 W& i( K0 F* |/ n
0040C7E6 |. C78424 040100>mov dword ptr [esp+104], 1
, F/ Y. I$ F0 y# u/ }0040C7F1 |. 89C7 mov edi, eax* t/ j, Z' P n
0040C7F3 |.^ E9 61FEFFFF jmp 0040C6591 A+ i0 ~; a! ?4 {
0040C7F8 |> 31D2 xor edx, edx
9 V& S; K3 `* j9 d3 W) k/ |9 l! @0040C7FA |. BF 46000000 mov edi, 46
" l4 P, d% ^6 C- _, B+ U8 O8 s0040C7FF |. 899424 040100>mov dword ptr [esp+104], edx2 \5 a! l1 G5 q2 A8 ?
0040C806 |.^ E9 4EFEFFFF jmp 0040C6599 G( \# g; @ G& ]
0040C80B |> 80F9 7C cmp cl, 7C
e, i& }6 v' ]4 h- L& |0040C80E |.^ 0F85 E9FEFFFF jnz 0040C6FD
/ ?0 Y! }, Z( [& k' j7 w* F: h0040C814 |. C602 20 mov byte ptr [edx], 20* `; F$ c1 q; M/ S3 t
0040C817 \.^ E9 E1FEFFFF jmp 0040C6FD' |# V. c8 L* K9 ]1 @
+ D5 w& x* S+ G& y# y' m在scratches.sc和scream.sc里面有lua的脚本,保存有字体文件名。+ N6 J5 G; f- o0 H
估计要汉化就要在上面的代码段下功夫了,以后继续研究。
/ _+ G' w6 v9 Y! D' m- X" [
; \4 J2 o: o% F6 }) x o& T找到2个俄文的补丁,也许对以后研究有用。
! D+ o1 i, x8 i: c. Chttp://www.megaupload.com/?d=EZH6X672
& l& B- v% U! bhttp://rapidshare.com/files/94227080/ScratchesDC.7z |