看了一下惊恐鬼屋Scratches这个游戏。
2 ~4 W( O- F) ~ {5 W" i7 d9 B包文件有2个,scratches.res和scream.res,
: Z* A) W% n4 G包文件的格式如下,可以用Game Extractor来解开。2 k( M; I+ f1 s: X, \
http://wiki.xentax.com/index.php/Scratches_RES
! B( [1 @. n, ~1 z+ s从scratches.res里面解出一个font-michael.tga文件,就是在游戏利用的字体。5 G x8 r7 R% f7 K0 k* |6 Y
scream.res里面也有一个字体文件,但是游戏好像没有用到。
" |- K7 {( v; X% L2 z& l
# m( k. G) z( s& y+ C& K用OD调试后,发现这是一个使用opengl API的游戏。
% i+ r; U& y7 V- p在某句字幕上下了内存断点,断下来之后找到了和显示有关的代码段。6 u) D3 f/ s, u9 d9 M; _! {1 L
% ~+ i9 k/ A2 E- o" ]2 y0040C5D0 /$ 53 push ebx( h9 w6 y9 [% q, F2 n) T6 I
0040C5D1 |. 51 push ecx
X; M7 G4 h% j4 D; }! i& E0040C5D2 |. 52 push edx
( \$ ]- F; O- E: P7 ~2 _' y9 r0040C5D3 |. 56 push esi$ m2 r' a, }: q- Q8 ], x1 Z
0040C5D4 |. 57 push edi
! M% n6 f$ A! ?2 v- ?0040C5D5 |. 55 push ebp
6 i3 @- Y, C3 }& }4 ~0040C5D6 |. 81EC 10010000 sub esp, 110
9 J8 @6 K+ W0 r- h( K, k0040C5DC |. 89C6 mov esi, eax
& p5 E; Z- n0 ?' a: c; t d9 H0040C5DE |. 89C7 mov edi, eax
" p ^; ]# I/ S: s3 ^0040C5E0 |. 29C9 sub ecx, ecx0 C [# I0 x7 l7 Q( ?
0040C5E2 |. 49 dec ecx' H( B3 a. c# X2 d, _% f
0040C5E3 |. 31C0 xor eax, eax/ j+ @* n6 H# n9 I
0040C5E5 |. F2:AE repne scas byte ptr es:[edi]6 B+ E6 n2 S) `- H2 W" B' N
0040C5E7 |. F7D1 not ecx
3 e& O; E( B, O0040C5E9 |. 49 dec ecx
% t& E- E1 k* w2 f0040C5EA |. 31DB xor ebx, ebx' x; [3 O* G# @( {) p# t0 @9 N, u
0040C5EC |. 31ED xor ebp, ebp9 |" B2 h; y# f: j
0040C5EE |. 81F9 00010000 cmp ecx, 100! v5 x3 M3 N) q# Y4 g7 p
0040C5F4 |. 72 0D jb short 0040C603" m3 v0 f' h/ f6 T! l! e! E
0040C5F6 |. 81C4 10010000 add esp, 110
( X% \8 T& F+ q1 k/ w; S; Z0040C5FC |. 5D pop ebp
3 V" O; l! t$ ~7 T9 F+ R2 u0040C5FD |. 5F pop edi+ i) y8 v6 N6 e3 M6 F$ M5 n
0040C5FE |. 5E pop esi
6 V9 j; }8 M+ k4 d Y% x1 `0040C5FF |. 5A pop edx9 m- C3 a8 R( p' _- [0 t- _
0040C600 |. 59 pop ecx! f/ \6 A$ a* k2 v6 G1 P1 F
0040C601 |. 5B pop ebx0 b9 C! ~: |1 }% g$ d6 M: F
0040C602 |. C3 retn
2 \4 {+ w9 \& G% h; ^3 o0040C603 |> 89E7 mov edi, esp
9 R6 O+ W: |/ k; @! w- U0040C605 |. 57 push edi: {2 z* X X' v
0040C606 |> 8A06 /mov al, byte ptr [esi]
+ \* i) H0 `2 D! s* b/ Y8 x0040C608 |. 8807 |mov byte ptr [edi], al6 U! \% o c% w; `
0040C60A |. 3C 00 |cmp al, 04 r, D5 D2 ~+ P1 r# O+ ^
0040C60C |. 74 10 |je short 0040C61E
+ P2 W" `6 [. @! t- G0040C60E |. 8A46 01 |mov al, byte ptr [esi+1]
$ G7 w; C; k& n, u" o0040C611 |. 83C6 02 |add esi, 22 h6 `* f# N" J4 i z6 w7 o
0040C614 |. 8847 01 |mov byte ptr [edi+1], al
: k; Q1 @7 g) W3 P, V& [" t: Y0040C617 |. 83C7 02 |add edi, 2
. d W& }2 W! ~- W/ y! @$ v0040C61A |. 3C 00 |cmp al, 0( H' {& k4 Y$ B- S' _! r' q i# `
0040C61C |.^ 75 E8 \jnz short 0040C606
0 G/ b/ a$ ?1 l) b1 P0040C61E |> 5F pop edi5 u8 Q# B+ ? `+ v
0040C61F |. 8A1424 mov dl, byte ptr [esp]( `* B) t6 x9 N* }6 A
0040C622 |. 89E0 mov eax, esp9 C, C5 |" V b& ?. v
0040C624 |. 84D2 test dl, dl( K: t4 x! o1 T: ]9 b
0040C626 |. 74 09 je short 0040C631
* C% b0 y8 }2 ]' U1 I, h4 X0040C628 |> 8A70 01 /mov dh, byte ptr [eax+1]* {+ ]' l1 ~. M9 x& T, L
0040C62B |. 40 |inc eax
1 N9 `# ]( ^! o* }( {* A! Q* x0040C62C |. 45 |inc ebp) v) T' w: l+ q$ |% ^. G9 j5 l0 p: [ K
0040C62D |. 84F6 |test dh, dh
: m# ~ f \, n# d4 N' r1 n0040C62F |.^ 75 F7 \jnz short 0040C628
6 e0 j% T1 {% E8 ?8 {' g0040C631 |> 81FD D2000000 cmp ebp, 0D2
2 j1 i1 U; W6 L% D N/ a0040C637 |. 0F8E 61010000 jle 0040C79E) `" \7 e: t# |! E
0040C63D |. 89EA mov edx, ebp
4 X5 A6 I5 D3 @2 m; l0040C63F |. 89E8 mov eax, ebp ^9 i% w" a& ~
0040C641 |. C1FA 1F sar edx, 1F
& n' g, K" v& F, b3 v4 P0040C644 |. C1E2 02 shl edx, 2
5 x5 ^& v, }9 P6 F- M# X+ f0040C647 |. 1BC2 sbb eax, edx& J9 c: k5 O1 ?8 _
0040C649 |. C1F8 02 sar eax, 2
, k/ E% M+ z% V) ~ W: s. x( ?0040C64C |. 89C7 mov edi, eax0 r3 \2 }, g6 u- k- a) |! a
0040C64E |. C78424 040100>mov dword ptr [esp+104], 3
! v3 h% o* O. a! t N9 k0040C659 |> 89E0 mov eax, esp
3 A" u# X6 o: Z7 j! h0040C65B |. 31D2 xor edx, edx
k0 S! \6 [4 |1 H$ u# {; k0040C65D |. 8A0C24 mov cl, byte ptr [esp]
- O/ b9 j+ P' A8 \3 K) ~, e4 c0040C660 |. 8915 8477EF02 mov dword ptr [2EF7784], edx
% _' g* F5 x" F3 O" R' Q& A; j0040C666 |. 8915 8C77EF02 mov dword ptr [2EF778C], edx: b# _1 u4 x1 B, x: l' \
0040C66C |. 899424 080100>mov dword ptr [esp+108], edx
; d @2 Y! T+ ^/ W6 X; T6 j2 U3 K0040C673 |. 89E2 mov edx, esp
$ v# _5 r/ X$ {: M, }' S0040C675 |. 84C9 test cl, cl' k: e& U. u' N2 J0 \3 u1 ^. s
0040C677 |. 0F84 89000000 je 0040C7066 D2 g3 k9 S3 x5 E4 v2 l7 q# P4 T
0040C67D |. 8B8C24 040100>mov ecx, dword ptr [esp+104]
& V& _ {9 l( A3 J f C$ C0040C684 |. 4F dec edi
; Q8 Z+ Z% u }0040C685 |. C1E1 02 shl ecx, 2! j2 h* m p9 n/ d, d7 s
0040C688 |. 89BC24 000100>mov dword ptr [esp+100], edi) m7 G' E2 @' K. f, \
0040C68F |. 898C24 0C0100>mov dword ptr [esp+10C], ecx
# U& L! H4 o0 c- q- E9 t0040C696 |> 8A0A mov cl, byte ptr [edx]
( [8 l% U% }2 g( r, I ?& u4 D0040C698 |. 80F9 20 cmp cl, 20; h% s0 E' v* W+ p; l) i! j* H$ f
0040C69B |. 0F85 6A010000 jnz 0040C80B
M1 d; {6 I0 X; Q3 d0040C6A1 |. 3B9C24 000100>cmp ebx, dword ptr [esp+100]
2 \" W1 m3 a7 x. `" Y0040C6A8 |. 7C 53 jl short 0040C6FD
: w* F' ]5 s8 y7 n0040C6AA |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]: O; V' c9 J9 d6 w# X
0040C6B1 |. C602 00 mov byte ptr [edx], 0
6 s$ U! A$ O$ u" h1 J6 P. b0040C6B4 |. 89C6 mov esi, eax- m( w! O4 }( |( {
0040C6B6 |. 8BBF 7477EF02 mov edi, dword ptr [edi+2EF7774]
4 l- L( Y, v4 U5 `! f' S `0040C6BC |. 31DB xor ebx, ebx
' g/ F4 X/ \: @" L% x+ E0 C0040C6BE |. 57 push edi+ t3 }; I# s7 A% G; W# b
0040C6BF |> 8A06 /mov al, byte ptr [esi]8 @; L4 _1 S; c* L" P& S& ^6 o
0040C6C1 |. 8807 |mov byte ptr [edi], al6 }1 i8 B1 O7 x( l. |
0040C6C3 |. 3C 00 |cmp al, 0 K6 E) e; o( U) B1 n+ D
0040C6C5 |. 74 10 |je short 0040C6D7 Y. n7 H+ N4 x0 g3 B
0040C6C7 |. 8A46 01 |mov al, byte ptr [esi+1]5 s6 Y; }& m* p$ Y' _. i( x
0040C6CA |. 83C6 02 |add esi, 22 W6 K! D, C/ ?4 _. D- u3 M
0040C6CD |. 8847 01 |mov byte ptr [edi+1], al
; E$ e' F/ U4 g! k0 n0040C6D0 |. 83C7 02 |add edi, 2# C. J/ r! I6 P/ @
0040C6D3 |. 3C 00 |cmp al, 0
8 n7 [' N7 [1 @" F0040C6D5 |.^ 75 E8 \jnz short 0040C6BF- m3 J4 Q- Y! u" j
0040C6D7 |> 5F pop edi
% C1 U) J0 G! v* V: _- u. ^0040C6D8 |. 8D42 01 lea eax, dword ptr [edx+1]3 j/ R# o5 M7 @# F4 r3 a8 c
0040C6DB |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]
6 L, ]% a$ h% I$ E( y" T8 Z! U0040C6E2 |. 8B9424 080100>mov edx, dword ptr [esp+108]3 W. d% s Y: v0 ?6 A) T
0040C6E9 |. 83EF 04 sub edi, 43 ~- k7 P2 }1 U1 X" c3 N
0040C6EC |. 42 inc edx
: f F/ n* j* w' p( i6 b0040C6ED |. 89BC24 0C0100>mov dword ptr [esp+10C], edi
6 c+ B% _# p* Q" _1 o( i0040C6F4 |. 899424 080100>mov dword ptr [esp+108], edx
! o! Q1 U+ t9 s' t$ c. K% y! y0040C6FB |. 89C2 mov edx, eax
' [2 d9 U, t- ^0040C6FD |> 43 inc ebx
D! e4 U% G) ^' U* [: C) N0040C6FE |. 8A6A 01 mov ch, byte ptr [edx+1]9 U. B2 v; @/ O; r$ Y2 k
0040C701 |. 42 inc edx
/ J3 z2 h$ M# d! B% s0040C702 |. 84ED test ch, ch1 R& n8 r. U+ _3 t
0040C704 |.^ 75 90 jnz short 0040C696
+ Z/ T7 z6 C4 q: c+ k0 u0040C706 |> 83FD 10 cmp ebp, 10
5 B; x( G) U; {2 G* x4 M0 d0040C709 |. 7F 05 jg short 0040C7101 N" e7 X% ~8 I) s1 q( {$ ]( X
0040C70B |. BD 20000000 mov ebp, 201 g1 L, h( f' r z$ }
0040C710 |> 8B9424 040100>mov edx, dword ptr [esp+104]
4 L" b' c- }1 T. u! r6 S4 `; @; M0040C717 |. 2B9424 080100>sub edx, dword ptr [esp+108]4 c: d2 r% q6 P( m
0040C71E |. 85D2 test edx, edx/ B7 B% G) Y7 N% |- Z3 V s$ w
0040C720 |. 7C 23 jl short 0040C745$ m# L' h; j6 k
0040C722 |. 89C6 mov esi, eax% S! D9 t& S% T
0040C724 |. 8B3C95 7477EF>mov edi, dword ptr [edx*4+2EF7774]7 |- ~* R: N+ i: O7 {" Y
0040C72B |. 57 push edi
# B/ f( N( F/ |0 _" i0040C72C |> 8A06 /mov al, byte ptr [esi]) \$ ~7 a$ h, W0 t5 A- \
0040C72E |. 8807 |mov byte ptr [edi], al" Z9 y1 a; z h. A' [0 X* s
0040C730 |. 3C 00 |cmp al, 0
6 M8 a! E6 H* x# b- w8 v; A0040C732 |. 74 10 |je short 0040C7442 r# |0 b* c2 o) i* f' @* J
0040C734 |. 8A46 01 |mov al, byte ptr [esi+1]4 I6 b, r9 f* B5 t
0040C737 |. 83C6 02 |add esi, 2- P! {, y: K; u1 `( m
0040C73A |. 8847 01 |mov byte ptr [edi+1], al
p! t6 l7 a7 r0040C73D |. 83C7 02 |add edi, 2% G: P3 d) ^! I) t
0040C740 |. 3C 00 |cmp al, 0
2 A |* R# P7 @6 M* X0040C742 |.^ 75 E8 \jnz short 0040C72C: |1 y" u$ p* U$ K& B" J3 U
0040C744 |> 5F pop edi. @# A. T5 `! m# T7 d0 c+ {
0040C745 |> E8 E6500100 call 004218308 C, ~. a. @4 n
0040C74A |. A3 8877EF02 mov dword ptr [2EF7788], eax
$ H; @" }- _& @' l0 y- U& o; n0040C74F |. 8B8424 040100>mov eax, dword ptr [esp+104]
2 d. h* K( d/ ^* z( L* d1 Y- s0040C756 |. 40 inc eax
( q& e0 M$ d8 N; p. h# {0040C757 |. A3 8477EF02 mov dword ptr [2EF7784], eax
% h- t! N5 n" y. B/ e0040C75C |. C705 8C77EF02>mov dword ptr [2EF778C], 11 s5 q+ P. Z% ~" D
0040C766 |. B8 64000000 mov eax, 64
0 D3 h4 Q! K' L- u, y0040C76B |. 89C2 mov edx, eax) ?. I1 b0 K8 B2 e
0040C76D |. 8B0D E880EF02 mov ecx, dword ptr [2EF80E8]7 G* S& [( c- }$ Z* s5 `
0040C773 |. C1FA 1F sar edx, 1F
* I; X7 Z/ W( j, C9 p) Q& f0040C776 |. F7F9 idiv ecx4 N& g( ]/ u. t9 R/ ?# H
0040C778 |. 89C3 mov ebx, eax) ~. `' }& R0 i
0040C77A |. 89EA mov edx, ebp& _ m/ X) p4 N& b( ?: X1 h
0040C77C |. 89E8 mov eax, ebp
+ ]% R4 w. o/ r! ^' y0040C77E |. C1FA 1F sar edx, 1F
, s5 w1 U' C$ |) |7 X" C0040C781 |. C1E2 04 shl edx, 4: W# ^+ u6 j0 ?& v! e# P) e: u
0040C784 |. 1BC2 sbb eax, edx
- x! R2 |5 {; ]# ^0 s" `9 t/ Q0040C786 |. C1F8 04 sar eax, 4
/ v+ y* l! R R& V, D) B4 g3 ^$ H0040C789 |. 01C3 add ebx, eax8 n3 r5 E3 ~9 U7 V
0040C78B |. 891D 9077EF02 mov dword ptr [2EF7790], ebx
6 A% H' E5 Z( w/ V7 I( c4 y0040C791 |. 81C4 10010000 add esp, 110
, \8 f: ~ X( i* y C1 a0040C797 |. 5D pop ebp
2 U' u& Y' p4 _: X& c8 D0040C798 |. 5F pop edi% d- {6 H3 X' Q6 U
0040C799 |. 5E pop esi
9 m( u) V$ j5 E/ U% d0040C79A |. 5A pop edx6 C* V, D- h( J9 z/ V& a a
0040C79B |. 59 pop ecx4 T4 W5 W: u9 `' ~% B# q
0040C79C |. 5B pop ebx
' @: n2 J' U' K/ k# r0040C79D |. C3 retn
# ?. W! f: u7 r4 K3 B# D0040C79E |> 81FD 8C000000 cmp ebp, 8C& A' ~# ^' U" H% S6 B H& r1 ~
0040C7A4 |. 7C 28 jl short 0040C7CE0 S5 d8 x9 U, V
0040C7A6 |. 81FD D2000000 cmp ebp, 0D2
' w, z) E7 c' x0040C7AC |. 7F 20 jg short 0040C7CE1 p& I/ Z+ \; I; J/ o& I: n3 h6 W
0040C7AE |. B9 03000000 mov ecx, 3) o8 ~4 b- N7 s' i2 j! S2 G
0040C7B3 |. 89EA mov edx, ebp# y! t) e0 W# E$ A! c& y
0040C7B5 |. 89E8 mov eax, ebp
x: m# g6 G9 M, Q. l3 g0040C7B7 |. C1FA 1F sar edx, 1F0 C% R" q/ z2 g1 K6 x9 ]! q
0040C7BA |. F7F9 idiv ecx- T/ S( \, u$ n ~( [! t0 G
0040C7BC |. C78424 040100>mov dword ptr [esp+104], 2
% O m: y, k1 x0040C7C7 |. 89C7 mov edi, eax% a7 A) a% G Z1 d, q: }
0040C7C9 |.^ E9 8BFEFFFF jmp 0040C659
6 @2 s3 f. O" N& p4 M( l# h- D0040C7CE |> 83FD 46 cmp ebp, 464 |) ~( L5 b3 w2 G y! H9 c. l
0040C7D1 |. 7C 25 jl short 0040C7F8
/ c1 I" ?9 F2 w2 @0040C7D3 |. 81FD 8C000000 cmp ebp, 8C/ o# ]- V( W6 I6 D, j+ Z
0040C7D9 |. 7F 1D jg short 0040C7F89 ]$ x% v- k' c, V \3 R
0040C7DB |. 89EA mov edx, ebp
0 S! q, X& l( W: |1 G- E: J0 P0040C7DD |. 89E8 mov eax, ebp
3 y( v* P1 [- U/ @6 f; @0040C7DF |. C1FA 1F sar edx, 1F& {( n1 K1 `2 u L
0040C7E2 |. 2BC2 sub eax, edx
( [4 h$ Y- z( g) l; U) i0040C7E4 |. D1F8 sar eax, 10 T. T* q8 t9 g
0040C7E6 |. C78424 040100>mov dword ptr [esp+104], 1
. \ O. t; \$ B+ E0040C7F1 |. 89C7 mov edi, eax- l& r6 [# D o- }6 s
0040C7F3 |.^ E9 61FEFFFF jmp 0040C659
- k9 t3 G5 {8 V, O" M0040C7F8 |> 31D2 xor edx, edx
, M o6 G, |, i" y! D0040C7FA |. BF 46000000 mov edi, 46& O) S: H' k6 l7 d) _8 q4 }
0040C7FF |. 899424 040100>mov dword ptr [esp+104], edx: p& U8 q6 H; q
0040C806 |.^ E9 4EFEFFFF jmp 0040C659
& E6 Y' n' `5 |! A# C' U0040C80B |> 80F9 7C cmp cl, 7C& E4 @+ o" ?: S) A- S
0040C80E |.^ 0F85 E9FEFFFF jnz 0040C6FD
. L4 O0 f3 a$ `0040C814 |. C602 20 mov byte ptr [edx], 20
* P5 Q6 s) d; G, @/ z. R0040C817 \.^ E9 E1FEFFFF jmp 0040C6FD4 u7 ?: N7 ], H- o2 _4 r: j+ P/ P
) x9 t1 b# |6 A; P% n* d* [$ I
在scratches.sc和scream.sc里面有lua的脚本,保存有字体文件名。& T5 D" M( C, q7 b W! |
估计要汉化就要在上面的代码段下功夫了,以后继续研究。
; {. v1 Z: ]4 T% g8 f: i( s6 I. Z/ F, u. M% q2 G& m% D
找到2个俄文的补丁,也许对以后研究有用。( z5 g+ e' ~1 h. _
http://www.megaupload.com/?d=EZH6X672
2 P7 _: L* ]9 K8 zhttp://rapidshare.com/files/94227080/ScratchesDC.7z |