看了一下惊恐鬼屋Scratches这个游戏。
% {' Z2 k) y( w0 ]) f2 E/ u9 @& n包文件有2个,scratches.res和scream.res,, P# X0 O# \1 s8 p" x; X/ _) r
包文件的格式如下,可以用Game Extractor来解开。; e/ \; ?" P/ _9 D' D
http://wiki.xentax.com/index.php/Scratches_RES
! O- m7 C7 i; C* e$ D) h: E/ v% @从scratches.res里面解出一个font-michael.tga文件,就是在游戏利用的字体。
8 A6 K) r7 x9 }* d4 L$ m7 t5 jscream.res里面也有一个字体文件,但是游戏好像没有用到。+ M3 R, B5 O8 \, F. \
8 r1 j$ {+ e0 M8 K5 A! ?; v1 {
用OD调试后,发现这是一个使用opengl API的游戏。6 x2 W- D& u0 A+ R1 k
在某句字幕上下了内存断点,断下来之后找到了和显示有关的代码段。, N& K& ~8 E M0 h; F- o; v
" s) I5 d( Z) T; B5 Q0 C% X7 h. V0040C5D0 /$ 53 push ebx
, z! O2 O: U# C$ W6 ?4 _4 [0040C5D1 |. 51 push ecx
8 q) Z1 s4 P- U4 S: U. S* q0040C5D2 |. 52 push edx
# ^' \8 D/ N# N e/ _0 F/ C0040C5D3 |. 56 push esi; I9 f \& k& Y4 ]
0040C5D4 |. 57 push edi
0 `7 y3 v _/ a! U7 B; h: y0040C5D5 |. 55 push ebp
( i1 V V p9 f- y, K8 ~* p* U/ T0040C5D6 |. 81EC 10010000 sub esp, 110+ }$ M1 D7 J" q; O, e, l% z
0040C5DC |. 89C6 mov esi, eax1 Q3 F& U3 R8 ?& J/ S
0040C5DE |. 89C7 mov edi, eax
; ^8 }. ^8 i" a0040C5E0 |. 29C9 sub ecx, ecx; A2 q9 ^$ n$ M+ J+ n$ l
0040C5E2 |. 49 dec ecx
E0 W& A" S) Z6 ?1 K3 M4 S0040C5E3 |. 31C0 xor eax, eax& m& @6 B* d4 p3 _7 m/ I! x
0040C5E5 |. F2:AE repne scas byte ptr es:[edi]
" @# f! a: @! G) p& }0040C5E7 |. F7D1 not ecx: b/ | }6 o" Q1 ]" M
0040C5E9 |. 49 dec ecx
2 J" ~; i! \6 R8 c0040C5EA |. 31DB xor ebx, ebx
) R; N+ i* G. U0040C5EC |. 31ED xor ebp, ebp' N1 p9 O* f. m# A: ^& [
0040C5EE |. 81F9 00010000 cmp ecx, 1006 O+ ]! D7 g* r2 i6 E
0040C5F4 |. 72 0D jb short 0040C603& W# i9 e7 ]) ] g/ V; [
0040C5F6 |. 81C4 10010000 add esp, 110/ v, ]6 }! s% P( s8 g
0040C5FC |. 5D pop ebp0 H4 o' J4 a+ ~* P8 k1 J2 \
0040C5FD |. 5F pop edi: n) j- b" J0 H6 ]: d( [) S% \
0040C5FE |. 5E pop esi% g6 l* i: E W
0040C5FF |. 5A pop edx7 r9 m. s+ ^3 A$ m N6 x! A+ _& @
0040C600 |. 59 pop ecx4 G- g$ }- M' M2 H$ k
0040C601 |. 5B pop ebx8 y4 @1 g. Y8 J; |
0040C602 |. C3 retn
: K# }) l/ U1 }! J. E0 A0040C603 |> 89E7 mov edi, esp
+ ?1 V% J0 ~2 |/ w" w0040C605 |. 57 push edi
& a1 h* A1 e6 B; W0040C606 |> 8A06 /mov al, byte ptr [esi]) K. j1 j! g' g% \
0040C608 |. 8807 |mov byte ptr [edi], al$ ?4 E3 [) c' f: D
0040C60A |. 3C 00 |cmp al, 0
7 ^$ D) m! R' j' i0 N& _0040C60C |. 74 10 |je short 0040C61E
" c4 k/ W+ P! o' Y0040C60E |. 8A46 01 |mov al, byte ptr [esi+1]! \3 x/ f6 a, I# H3 {$ ^4 C
0040C611 |. 83C6 02 |add esi, 2
) C( g/ A, W0 k0 I; q. E+ C) |1 x0040C614 |. 8847 01 |mov byte ptr [edi+1], al! k0 N- S' L6 F) S
0040C617 |. 83C7 02 |add edi, 2. ]7 F( q1 X% _$ v* C' S
0040C61A |. 3C 00 |cmp al, 0
. a v( ]6 B7 g7 \/ K0040C61C |.^ 75 E8 \jnz short 0040C606
. q/ ~& w! R' \, N7 N0040C61E |> 5F pop edi
6 @& i" P4 N5 T2 a$ s0040C61F |. 8A1424 mov dl, byte ptr [esp]
- H) {1 @* i( u4 Q0040C622 |. 89E0 mov eax, esp- p7 g5 N- Y! l3 Y# b
0040C624 |. 84D2 test dl, dl! R9 z1 I5 |! A/ v
0040C626 |. 74 09 je short 0040C631
* B( ~, Z+ T0 o2 K0040C628 |> 8A70 01 /mov dh, byte ptr [eax+1]
" r, G$ n2 t- ~8 m0040C62B |. 40 |inc eax
8 n% m4 u7 E" p1 p& w0040C62C |. 45 |inc ebp# s# V- h- X& k2 A% e6 o
0040C62D |. 84F6 |test dh, dh
" c5 ~% C: @1 d, M' g7 L0040C62F |.^ 75 F7 \jnz short 0040C628
% c- Y: q# L( i9 C( o' I8 ^# z0040C631 |> 81FD D2000000 cmp ebp, 0D2
: S2 Z1 M* s& I) ~( j2 i, y! E0040C637 |. 0F8E 61010000 jle 0040C79E
" _: N4 ]) F9 H$ v ], J, {2 ~0040C63D |. 89EA mov edx, ebp
: _ d1 p0 p/ u0040C63F |. 89E8 mov eax, ebp
: Z n! h+ t) E2 B- I+ p0040C641 |. C1FA 1F sar edx, 1F" g7 |0 ~- M( i5 j* O" ?
0040C644 |. C1E2 02 shl edx, 2
0 {" z* V$ j: N3 j3 m' n0040C647 |. 1BC2 sbb eax, edx6 n. _% i' M* j. W
0040C649 |. C1F8 02 sar eax, 2; r! T$ k+ q* e* F0 }: I
0040C64C |. 89C7 mov edi, eax: d7 t4 g/ B @2 P9 w7 A/ {
0040C64E |. C78424 040100>mov dword ptr [esp+104], 3' n) N2 u8 `! V9 P; w( y
0040C659 |> 89E0 mov eax, esp
0 j$ L! T5 g% _7 V4 t3 @( J& L0040C65B |. 31D2 xor edx, edx8 q* f, l% i7 p9 i9 {! N9 c
0040C65D |. 8A0C24 mov cl, byte ptr [esp]2 D! i# {+ u( T9 b
0040C660 |. 8915 8477EF02 mov dword ptr [2EF7784], edx
4 }6 y% A9 H9 J+ p0040C666 |. 8915 8C77EF02 mov dword ptr [2EF778C], edx8 u8 I$ q% c+ g" ] h# C2 H. J! P
0040C66C |. 899424 080100>mov dword ptr [esp+108], edx; O, [8 N1 r/ i, s- S) ~
0040C673 |. 89E2 mov edx, esp
, G2 Q# I0 Y' N7 _0040C675 |. 84C9 test cl, cl( ^$ I' z, {9 G( U
0040C677 |. 0F84 89000000 je 0040C706
7 D) z3 v0 r6 ~# i8 a0040C67D |. 8B8C24 040100>mov ecx, dword ptr [esp+104]
' j9 v3 U, H" L' a( I5 Q' y+ t0040C684 |. 4F dec edi
/ V; {* e4 V+ d6 Y7 }& b0040C685 |. C1E1 02 shl ecx, 2% E& M' `. e) ^0 p$ c
0040C688 |. 89BC24 000100>mov dword ptr [esp+100], edi
: N& ?5 d2 i" y( s. N2 S& h g0040C68F |. 898C24 0C0100>mov dword ptr [esp+10C], ecx
: Y' D! ^3 B2 s1 v/ a1 \$ B0040C696 |> 8A0A mov cl, byte ptr [edx]8 l7 }& p- A6 S2 G& f! o1 ]- x! j
0040C698 |. 80F9 20 cmp cl, 202 n0 q: J. a% {1 n' L3 ?* X5 S
0040C69B |. 0F85 6A010000 jnz 0040C80B' v4 C) w, t4 v5 `' r* E9 s1 L# p
0040C6A1 |. 3B9C24 000100>cmp ebx, dword ptr [esp+100]; D% d' c% a* b4 P* T
0040C6A8 |. 7C 53 jl short 0040C6FD
9 R7 e F# K9 q# O8 Q c) o, a0 v1 z0040C6AA |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]; t& d' a& y. s7 q0 H; c8 ^' D
0040C6B1 |. C602 00 mov byte ptr [edx], 0
' u. o7 p4 o0 M0040C6B4 |. 89C6 mov esi, eax1 H9 R2 C( G. F0 n$ v2 v
0040C6B6 |. 8BBF 7477EF02 mov edi, dword ptr [edi+2EF7774]
6 X9 N, b; ]7 l0040C6BC |. 31DB xor ebx, ebx- j% n' Z" R5 c9 o
0040C6BE |. 57 push edi; r, p2 o: f2 b" V' m+ S
0040C6BF |> 8A06 /mov al, byte ptr [esi]
& J/ ~3 C5 k. \4 \0040C6C1 |. 8807 |mov byte ptr [edi], al
# c2 f! }4 ]9 M, v( {7 I: S0040C6C3 |. 3C 00 |cmp al, 0+ r1 }5 B# n: O. h: v. a
0040C6C5 |. 74 10 |je short 0040C6D7& R$ s O2 L* b3 o
0040C6C7 |. 8A46 01 |mov al, byte ptr [esi+1]8 `% P" R X/ J% B2 e4 V, M: v/ o1 _
0040C6CA |. 83C6 02 |add esi, 2
! \! u/ ~$ P2 X' j* k0040C6CD |. 8847 01 |mov byte ptr [edi+1], al& o$ n5 D/ m. C- p3 @2 k! c
0040C6D0 |. 83C7 02 |add edi, 21 x7 q& j" n8 i2 v4 ?5 r' {
0040C6D3 |. 3C 00 |cmp al, 0
7 N) ~& Z9 D; M) R& ` z0040C6D5 |.^ 75 E8 \jnz short 0040C6BF3 j6 j% D6 e; m) N
0040C6D7 |> 5F pop edi
) O+ U7 c6 K- Q! P* ]( _0 U7 s1 H0040C6D8 |. 8D42 01 lea eax, dword ptr [edx+1]3 G7 a. H4 k! D
0040C6DB |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]
" y# r7 u2 Y7 ? l: X0040C6E2 |. 8B9424 080100>mov edx, dword ptr [esp+108]8 A. y# I) E- K; D! j7 o2 w# o8 e
0040C6E9 |. 83EF 04 sub edi, 4' g1 u/ V2 m" e4 ^& o
0040C6EC |. 42 inc edx# A5 @2 I8 A$ ^& e* a/ P8 {
0040C6ED |. 89BC24 0C0100>mov dword ptr [esp+10C], edi
6 `8 y' c6 Z% z$ f9 R, t4 O6 L0 J$ Z$ v0040C6F4 |. 899424 080100>mov dword ptr [esp+108], edx
; G7 M! y( D9 A3 Y0040C6FB |. 89C2 mov edx, eax4 J$ `' ^& y: Q) p1 q0 O
0040C6FD |> 43 inc ebx
n5 i9 L7 S, B N0040C6FE |. 8A6A 01 mov ch, byte ptr [edx+1]0 L/ X" J* D8 {" ?6 K
0040C701 |. 42 inc edx0 P/ U- [( [; r6 O9 l& a9 |' @3 X
0040C702 |. 84ED test ch, ch
2 A& D7 ] o9 T! S0040C704 |.^ 75 90 jnz short 0040C6963 a$ E7 Z* b( Z6 L' c3 h& R7 r! n+ o$ W
0040C706 |> 83FD 10 cmp ebp, 10
5 r: W1 `6 {# q* ]9 g* t, B( T0040C709 |. 7F 05 jg short 0040C710
A8 c6 K. b* }# V6 O' U0040C70B |. BD 20000000 mov ebp, 20$ b d0 s8 a0 b9 t8 i' d; \1 q
0040C710 |> 8B9424 040100>mov edx, dword ptr [esp+104]
' S8 C: ~$ r# T$ e0 M0040C717 |. 2B9424 080100>sub edx, dword ptr [esp+108]" q7 |) S; K# k8 h' {* N6 W
0040C71E |. 85D2 test edx, edx' r3 F1 p2 I* e7 v' g0 c9 E
0040C720 |. 7C 23 jl short 0040C745+ a4 @. {# v+ k$ G
0040C722 |. 89C6 mov esi, eax
' q A+ h; q6 M) e) I0040C724 |. 8B3C95 7477EF>mov edi, dword ptr [edx*4+2EF7774]
5 O& x4 z8 s. k9 q3 J0040C72B |. 57 push edi
5 Z2 w3 [. f# z4 `5 ^0 `- ^7 ]0040C72C |> 8A06 /mov al, byte ptr [esi]
8 U% d! A* @: E z9 s3 y0040C72E |. 8807 |mov byte ptr [edi], al
l. A( S2 P0 p: B0040C730 |. 3C 00 |cmp al, 0
1 z: G+ c8 j/ b1 t; s \0040C732 |. 74 10 |je short 0040C744
% |6 n; h8 c y& v% |. C1 ?0040C734 |. 8A46 01 |mov al, byte ptr [esi+1]1 h( i) j" B2 ]# B; l, D! ]
0040C737 |. 83C6 02 |add esi, 2
2 S* S$ P' n$ v3 u$ d% L9 J( B, | w0040C73A |. 8847 01 |mov byte ptr [edi+1], al% g& a; j9 v2 f- e9 K9 P
0040C73D |. 83C7 02 |add edi, 20 b8 a3 i a. u' w& k
0040C740 |. 3C 00 |cmp al, 0
( j5 ^ ]* F5 h1 T" Y0040C742 |.^ 75 E8 \jnz short 0040C72C/ N( q1 q2 U. s9 y
0040C744 |> 5F pop edi
/ e: T' d. i1 e6 [+ S0 P( ~0040C745 |> E8 E6500100 call 00421830& U2 s% l% y3 m8 O) N' q/ H
0040C74A |. A3 8877EF02 mov dword ptr [2EF7788], eax$ P! c) k. i. R8 ~7 o! h
0040C74F |. 8B8424 040100>mov eax, dword ptr [esp+104], F& {" G) n: V- p% s
0040C756 |. 40 inc eax
* {2 k6 i& ?9 K( I, [0040C757 |. A3 8477EF02 mov dword ptr [2EF7784], eax
- r l8 J8 d0 H# A& N J$ C: i0040C75C |. C705 8C77EF02>mov dword ptr [2EF778C], 1
5 O H) I3 ?9 n( B0040C766 |. B8 64000000 mov eax, 64$ z7 w1 e b# L; D# |. Q
0040C76B |. 89C2 mov edx, eax0 b( ^) z0 _: |% H3 R
0040C76D |. 8B0D E880EF02 mov ecx, dword ptr [2EF80E8]8 }. {# B4 Y; Q0 N& V
0040C773 |. C1FA 1F sar edx, 1F) Y+ U/ l" k2 m" j" y; r9 u
0040C776 |. F7F9 idiv ecx( J% S3 Y9 C4 N
0040C778 |. 89C3 mov ebx, eax
/ H+ a/ {' F) t0 i- V; [0040C77A |. 89EA mov edx, ebp
: R6 _, |" X: p4 p8 |' Z0 y9 P5 V0040C77C |. 89E8 mov eax, ebp9 N4 F9 u' N' M; ]0 o
0040C77E |. C1FA 1F sar edx, 1F3 g- @4 q! Q. G& P2 ^& [
0040C781 |. C1E2 04 shl edx, 46 _4 w9 U- D& a, h! i$ }. d
0040C784 |. 1BC2 sbb eax, edx4 z+ a; V4 _, e( p
0040C786 |. C1F8 04 sar eax, 4 C! g! i5 Q# l5 C/ n& Y& t
0040C789 |. 01C3 add ebx, eax
8 I1 _) q/ }/ l9 g: K1 Q o' @0040C78B |. 891D 9077EF02 mov dword ptr [2EF7790], ebx
" p; Z$ h6 p$ x6 a$ S0040C791 |. 81C4 10010000 add esp, 1106 x6 d1 A0 t7 S
0040C797 |. 5D pop ebp
* K% }5 ^0 ]( @) C0040C798 |. 5F pop edi3 o: ?0 U( w k; @9 E
0040C799 |. 5E pop esi
( S7 F" |, t7 t( o0040C79A |. 5A pop edx E& O+ r; W$ ?/ I; d
0040C79B |. 59 pop ecx
; I; d$ j( g# V# j" E0040C79C |. 5B pop ebx* k0 T' N! q2 \( s9 ]
0040C79D |. C3 retn1 N: s! R/ n# y9 n5 I5 r+ j& N
0040C79E |> 81FD 8C000000 cmp ebp, 8C3 l- U' ]0 B) F' E7 s
0040C7A4 |. 7C 28 jl short 0040C7CE
5 D+ |( V0 ]" \: K l+ f3 y5 C0 f0040C7A6 |. 81FD D2000000 cmp ebp, 0D2& Z8 @* x3 u$ b! g' Q
0040C7AC |. 7F 20 jg short 0040C7CE
4 o* ~: E" |0 ?8 I" C$ ~0040C7AE |. B9 03000000 mov ecx, 3
, ?5 K# ? `& a! W* c2 A0040C7B3 |. 89EA mov edx, ebp
. S( h- y9 b" x$ W- L2 K0040C7B5 |. 89E8 mov eax, ebp
: f0 G" b: Q0 d4 A6 M5 T0040C7B7 |. C1FA 1F sar edx, 1F# W7 J8 N2 t% V) [1 n' r
0040C7BA |. F7F9 idiv ecx3 S2 |/ [4 i5 M& M& y1 \0 n2 J6 m! S
0040C7BC |. C78424 040100>mov dword ptr [esp+104], 2' @. X; d4 ^6 \# o
0040C7C7 |. 89C7 mov edi, eax
0 f" e8 D" t) ^+ x0040C7C9 |.^ E9 8BFEFFFF jmp 0040C6591 q" p7 {% _ ?7 l8 ^0 |) n
0040C7CE |> 83FD 46 cmp ebp, 469 [% M6 e/ Z5 `4 j) ?) a
0040C7D1 |. 7C 25 jl short 0040C7F8
! c4 S; b3 Z0 c0040C7D3 |. 81FD 8C000000 cmp ebp, 8C
4 a. U0 r& z4 M$ u. N5 I3 T& b/ D0040C7D9 |. 7F 1D jg short 0040C7F8
% p2 ?5 H1 G; a! w4 G( r) s7 ?0040C7DB |. 89EA mov edx, ebp
+ x/ ^9 {. s9 }* Q- l$ e# B7 b0040C7DD |. 89E8 mov eax, ebp
; b4 x5 r/ ` I. h) e! k& P0040C7DF |. C1FA 1F sar edx, 1F8 G$ P) m; `* ]! q, H% F
0040C7E2 |. 2BC2 sub eax, edx, t( f& V! P; Z1 [0 P* u
0040C7E4 |. D1F8 sar eax, 10 z9 e1 _' f+ ? W) L( \) R, G1 j; |
0040C7E6 |. C78424 040100>mov dword ptr [esp+104], 1
! C) R& n: S- {( t! d0040C7F1 |. 89C7 mov edi, eax
0 ?% h: v0 m% Z& o* P0040C7F3 |.^ E9 61FEFFFF jmp 0040C659
# c1 g% m- ]: y, L u0040C7F8 |> 31D2 xor edx, edx
3 ~7 T3 h. Y2 ?' K# O; Y+ p0040C7FA |. BF 46000000 mov edi, 46
. \* X2 m0 [, a) r0040C7FF |. 899424 040100>mov dword ptr [esp+104], edx: f5 L0 _4 T! y* P1 {0 s( i c
0040C806 |.^ E9 4EFEFFFF jmp 0040C659
0 p- e% u+ l! C! C! O0040C80B |> 80F9 7C cmp cl, 7C w% S# V! S& f# a( r' t! L W
0040C80E |.^ 0F85 E9FEFFFF jnz 0040C6FD& |( |* ~3 J1 R* L+ F& ^' D
0040C814 |. C602 20 mov byte ptr [edx], 20
+ r' N1 g ]% ^! s# g- @5 ^( N0040C817 \.^ E9 E1FEFFFF jmp 0040C6FD8 V* J- P$ V) N" Q
2 I3 T: X ~# m6 N# M; K. }% }在scratches.sc和scream.sc里面有lua的脚本,保存有字体文件名。1 E; J2 I& L1 s" l$ w$ Q* ^
估计要汉化就要在上面的代码段下功夫了,以后继续研究。
: S! y: o6 }) r9 D# B# q' D! X, q& O" V6 d f+ }
找到2个俄文的补丁,也许对以后研究有用。
4 l0 q7 I. J: zhttp://www.megaupload.com/?d=EZH6X672( e* C% h) F7 n8 F0 W: M1 @
http://rapidshare.com/files/94227080/ScratchesDC.7z |