看了一下惊恐鬼屋Scratches这个游戏。
# d8 q9 p7 t2 U& ^包文件有2个,scratches.res和scream.res,6 o, I5 J" F! Y1 i, m# J7 i
包文件的格式如下,可以用Game Extractor来解开。6 h* A; L2 U) l( ?: M
http://wiki.xentax.com/index.php/Scratches_RES$ r+ V8 v1 h, M: c$ n7 u
从scratches.res里面解出一个font-michael.tga文件,就是在游戏利用的字体。" L( F8 s/ H. M
scream.res里面也有一个字体文件,但是游戏好像没有用到。
2 E" B2 l7 D" W1 A4 I
- k7 O; v) _: Z8 o用OD调试后,发现这是一个使用opengl API的游戏。
- w( K8 [9 g& h" n% S! N在某句字幕上下了内存断点,断下来之后找到了和显示有关的代码段。
5 p$ B" i1 O0 @) u3 V( v
. U0 D) K. p" h% j! f% T; t0040C5D0 /$ 53 push ebx
; K3 S( f4 O4 V0040C5D1 |. 51 push ecx! \5 y" u. i6 {% g, P( R
0040C5D2 |. 52 push edx1 y. ~# C% ~0 p
0040C5D3 |. 56 push esi: l" X' R# i* ~
0040C5D4 |. 57 push edi
9 v" w( ]2 k. R* g+ y+ Z6 s2 _0040C5D5 |. 55 push ebp
8 K8 B8 m, m; g# w3 ^. t/ M0040C5D6 |. 81EC 10010000 sub esp, 110
; U0 z8 T4 d7 S1 ]0040C5DC |. 89C6 mov esi, eax) @: H: h" H0 j; n; K/ ]
0040C5DE |. 89C7 mov edi, eax: ^; K$ O) v) y- u9 w
0040C5E0 |. 29C9 sub ecx, ecx2 U5 B6 F" y0 N, G2 j
0040C5E2 |. 49 dec ecx& P0 i% ^1 G0 Q/ C' {: L
0040C5E3 |. 31C0 xor eax, eax
( R4 z1 s j" P: ]* N0040C5E5 |. F2:AE repne scas byte ptr es:[edi]
- x9 L: `8 \+ ?7 w9 i+ c/ g0040C5E7 |. F7D1 not ecx4 \" I2 A6 p! a" h' X6 Q
0040C5E9 |. 49 dec ecx
' E, v" s) _1 v) }. y6 w5 }0040C5EA |. 31DB xor ebx, ebx
/ a! G* o G3 Y! V* P0040C5EC |. 31ED xor ebp, ebp) ?7 _* D5 q6 i7 _+ A/ B: f' E
0040C5EE |. 81F9 00010000 cmp ecx, 100- O8 U6 g! W* P3 ~
0040C5F4 |. 72 0D jb short 0040C603
2 b7 a& F# o- E% O( I7 g0040C5F6 |. 81C4 10010000 add esp, 110
1 }5 d2 a* l% I; D$ E' H0040C5FC |. 5D pop ebp1 t$ i1 S3 I3 Q* t4 q7 O
0040C5FD |. 5F pop edi# T& K! A+ q/ Q! p
0040C5FE |. 5E pop esi
# i5 I; [+ s! a. G& m( d9 |: h0040C5FF |. 5A pop edx$ q6 b, Z& y8 o- |3 A$ v' J4 A$ U% Y
0040C600 |. 59 pop ecx
2 w4 Y3 S: J& B# M: i0040C601 |. 5B pop ebx
! b! X+ n3 W$ t% \9 @" S0040C602 |. C3 retn, C8 _) X- h) \% l7 U" ~
0040C603 |> 89E7 mov edi, esp& Z4 P( `0 V" w+ e8 T
0040C605 |. 57 push edi
& t& A7 I: v: q0040C606 |> 8A06 /mov al, byte ptr [esi]
, V$ m% r. z5 [! |0040C608 |. 8807 |mov byte ptr [edi], al5 D3 l. ^/ W5 D- ?) Z0 Z
0040C60A |. 3C 00 |cmp al, 0' p% q6 e0 {0 N" l8 i, \) @
0040C60C |. 74 10 |je short 0040C61E0 h* o! w! W' H5 e& Y
0040C60E |. 8A46 01 |mov al, byte ptr [esi+1]' L) K2 z [4 _3 @6 _$ r
0040C611 |. 83C6 02 |add esi, 2
: M& n, z7 |! g4 i1 n- R; d3 S# H0040C614 |. 8847 01 |mov byte ptr [edi+1], al D- g( A# D8 H7 s
0040C617 |. 83C7 02 |add edi, 29 I; {1 x, `. o6 J9 k$ l
0040C61A |. 3C 00 |cmp al, 0
( e$ L6 S' z7 L) r) @4 y7 f: P7 @3 [0040C61C |.^ 75 E8 \jnz short 0040C606
* Z- g3 K4 c0 T, B+ P0040C61E |> 5F pop edi
8 o# l& |# T, S/ R0040C61F |. 8A1424 mov dl, byte ptr [esp], ?# B( g- w6 q' k
0040C622 |. 89E0 mov eax, esp: i5 I/ U2 b# z* z1 b C5 _
0040C624 |. 84D2 test dl, dl
. p4 o# S; n- F2 q& D4 P$ ^0040C626 |. 74 09 je short 0040C6311 s7 M3 C; [3 `/ K) }
0040C628 |> 8A70 01 /mov dh, byte ptr [eax+1]
/ n. G" j9 l0 ~0040C62B |. 40 |inc eax9 e$ q- I) u1 q( ^; u7 I, A
0040C62C |. 45 |inc ebp
2 p/ G% I; {) [1 v; d" k0040C62D |. 84F6 |test dh, dh0 ] k! K. G8 [8 O% W2 n$ H
0040C62F |.^ 75 F7 \jnz short 0040C628
( E/ \* v2 F5 r0 g0040C631 |> 81FD D2000000 cmp ebp, 0D20 h: s& {) d# c2 |* X1 T# l
0040C637 |. 0F8E 61010000 jle 0040C79E
x4 @5 r) S% P5 T# N# C) x V T6 f2 z0040C63D |. 89EA mov edx, ebp
9 v* G" g1 w* ~7 |2 Q0040C63F |. 89E8 mov eax, ebp
1 W. G( t" a# x1 x& g$ Y* m5 _0040C641 |. C1FA 1F sar edx, 1F- t! M7 d2 C X1 N
0040C644 |. C1E2 02 shl edx, 2
- M/ l" a- z5 T1 L0040C647 |. 1BC2 sbb eax, edx
, @3 y" L+ P: W! x$ m0040C649 |. C1F8 02 sar eax, 2
& |: O, W4 F5 a+ q8 a s0040C64C |. 89C7 mov edi, eax
, T6 I: r8 t* l3 t/ M! o7 J ^0040C64E |. C78424 040100>mov dword ptr [esp+104], 3
2 q+ {4 |. t$ I; J) i0040C659 |> 89E0 mov eax, esp
9 u- W& X V: j6 r4 s) t% T4 b0040C65B |. 31D2 xor edx, edx$ F# M, `6 ?. E4 J
0040C65D |. 8A0C24 mov cl, byte ptr [esp]' N( M' j! U9 T) h8 R. g i
0040C660 |. 8915 8477EF02 mov dword ptr [2EF7784], edx( _; c1 P$ U7 J* W% e; G
0040C666 |. 8915 8C77EF02 mov dword ptr [2EF778C], edx9 x: ?7 I4 V3 {& _. O
0040C66C |. 899424 080100>mov dword ptr [esp+108], edx, f" b9 W' h# V5 \9 \
0040C673 |. 89E2 mov edx, esp
* ?1 H; k7 |* R% M3 _* c0040C675 |. 84C9 test cl, cl
- x2 k+ u1 p+ H. ^0040C677 |. 0F84 89000000 je 0040C706, G" \- P" h8 E
0040C67D |. 8B8C24 040100>mov ecx, dword ptr [esp+104]- Y- b2 h. E8 \ s {6 a
0040C684 |. 4F dec edi! Q6 S. D* y- A5 P1 j" p
0040C685 |. C1E1 02 shl ecx, 2
) U, N s" B% @" E2 ~% t0040C688 |. 89BC24 000100>mov dword ptr [esp+100], edi
) s0 q& ?. t ~2 G8 l0040C68F |. 898C24 0C0100>mov dword ptr [esp+10C], ecx
6 O* f* v- S7 l4 s# d6 l0040C696 |> 8A0A mov cl, byte ptr [edx], D4 N8 \" D; u# m" A3 E. w- d8 T" e
0040C698 |. 80F9 20 cmp cl, 20; m3 z; Q8 ^( m( Z9 e. o0 @
0040C69B |. 0F85 6A010000 jnz 0040C80B
- N- S+ }. T7 q+ L% x7 W, v( `0040C6A1 |. 3B9C24 000100>cmp ebx, dword ptr [esp+100]7 l l6 X) J4 ~- y6 F9 T+ m4 t
0040C6A8 |. 7C 53 jl short 0040C6FD
$ X. @7 r K+ B( O( B* ], f' A2 V0040C6AA |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]
+ ~9 _! i3 [7 N6 j3 O; U! u9 P0040C6B1 |. C602 00 mov byte ptr [edx], 0
! c( h( M0 z% D. ~; l0040C6B4 |. 89C6 mov esi, eax0 m9 v6 D( g0 H a# A% u
0040C6B6 |. 8BBF 7477EF02 mov edi, dword ptr [edi+2EF7774]
7 W5 C4 \/ k* g: {, m5 s4 ?" G0040C6BC |. 31DB xor ebx, ebx
' I" {! l. r" |7 o1 r Q+ |4 a9 G0 L0040C6BE |. 57 push edi# Q+ Z3 C. Q3 b, {6 S9 s% V
0040C6BF |> 8A06 /mov al, byte ptr [esi]! }3 b6 ~' S$ y1 [9 Z! T( `5 W' e
0040C6C1 |. 8807 |mov byte ptr [edi], al
+ }+ N% n: M; u5 U* n0040C6C3 |. 3C 00 |cmp al, 0( B, S& ~, c' _
0040C6C5 |. 74 10 |je short 0040C6D7
7 D& o( ]. K7 U0 Z# H0040C6C7 |. 8A46 01 |mov al, byte ptr [esi+1]: z( J- z/ s8 E, z/ o
0040C6CA |. 83C6 02 |add esi, 22 I; Y Y$ I: h6 T# o& r6 _
0040C6CD |. 8847 01 |mov byte ptr [edi+1], al6 b. ? N5 r' C: ]" a; C: ~2 G
0040C6D0 |. 83C7 02 |add edi, 20 I$ [2 y" M; A( L `% W+ q
0040C6D3 |. 3C 00 |cmp al, 0
7 A9 Z5 t9 \4 X& f8 H2 ?. Q0040C6D5 |.^ 75 E8 \jnz short 0040C6BF
. k" s+ T- q# P0040C6D7 |> 5F pop edi1 A+ T8 }) T9 Y( P- j5 e
0040C6D8 |. 8D42 01 lea eax, dword ptr [edx+1]
0 C' s% y6 V5 ~; b2 K4 `0 [: b5 T0040C6DB |. 8BBC24 0C0100>mov edi, dword ptr [esp+10C]# r1 T& F x k) U9 a
0040C6E2 |. 8B9424 080100>mov edx, dword ptr [esp+108]
& E0 N- Q: I% D/ I! H2 O% d0040C6E9 |. 83EF 04 sub edi, 4
, O, n( \$ u8 p" z0040C6EC |. 42 inc edx6 J1 x4 M. A& y) n& K: d' x
0040C6ED |. 89BC24 0C0100>mov dword ptr [esp+10C], edi
* K; E$ h% {3 \- b: x2 {! A. g% n! q0040C6F4 |. 899424 080100>mov dword ptr [esp+108], edx% Z) o& w. H: p8 L8 {
0040C6FB |. 89C2 mov edx, eax# E: L1 f9 Q3 n& X1 h( L! M
0040C6FD |> 43 inc ebx
5 `( C) D: }1 u# m Y, Q/ y2 X. L" _0040C6FE |. 8A6A 01 mov ch, byte ptr [edx+1]% i9 @# W, D$ b' ~- f8 E5 z. m
0040C701 |. 42 inc edx: y) w' z6 f& f+ C8 J
0040C702 |. 84ED test ch, ch
9 Y+ q) n {5 j1 ?# W1 Y: K6 }0040C704 |.^ 75 90 jnz short 0040C6961 q& g9 G, B' W0 b, t
0040C706 |> 83FD 10 cmp ebp, 10+ M4 u! C! u1 P; V7 Z& n" b6 [) r# {
0040C709 |. 7F 05 jg short 0040C710
6 _/ j6 l" Y3 _ \5 S8 D0040C70B |. BD 20000000 mov ebp, 20
' M9 U- O' H( V0 P0040C710 |> 8B9424 040100>mov edx, dword ptr [esp+104]; G6 ^6 C' i8 a$ o& _+ c9 {# ^
0040C717 |. 2B9424 080100>sub edx, dword ptr [esp+108]
& Z0 x7 B6 Y5 B$ o; i0040C71E |. 85D2 test edx, edx
, i7 N7 d- P7 G$ T1 k. T0040C720 |. 7C 23 jl short 0040C745
8 I q' M" a$ X) h! D: x- J5 M* q0040C722 |. 89C6 mov esi, eax
, _6 `7 o2 r2 i0040C724 |. 8B3C95 7477EF>mov edi, dword ptr [edx*4+2EF7774]1 O$ l" S, s8 Y3 |! I" T
0040C72B |. 57 push edi
" l' r A' D$ _0040C72C |> 8A06 /mov al, byte ptr [esi]
( {- F, c6 ~* t: R4 n( d" Z0040C72E |. 8807 |mov byte ptr [edi], al
! v: R( Y5 ~' T0040C730 |. 3C 00 |cmp al, 0
7 U3 @% X) X( o" W& g0040C732 |. 74 10 |je short 0040C744
' B& r. k2 W4 [: R0 _0040C734 |. 8A46 01 |mov al, byte ptr [esi+1]0 F' g; q: a3 G) n- z! q% S
0040C737 |. 83C6 02 |add esi, 2" Q' x" ^3 V9 J% A+ P* R
0040C73A |. 8847 01 |mov byte ptr [edi+1], al
7 V. W" D+ N, D3 c: i! O0040C73D |. 83C7 02 |add edi, 2
* ]$ p' E# H/ ^0040C740 |. 3C 00 |cmp al, 0, Z2 T' @2 S+ v, t/ N
0040C742 |.^ 75 E8 \jnz short 0040C72C
+ J( }4 j* ^# a+ l5 \) J, Z0040C744 |> 5F pop edi
) z/ v8 T. _" |/ ]' W2 a/ i3 g0040C745 |> E8 E6500100 call 00421830
4 C4 o+ u) s! F H/ q; a. w0040C74A |. A3 8877EF02 mov dword ptr [2EF7788], eax' C% U* f7 L5 m) H* B0 d& f! m* z
0040C74F |. 8B8424 040100>mov eax, dword ptr [esp+104]& N+ }- g. k" ~; ~! d8 m a
0040C756 |. 40 inc eax
( c/ L) U/ h3 Z, D9 m/ ?& B0040C757 |. A3 8477EF02 mov dword ptr [2EF7784], eax
5 b: m5 E8 c1 n4 K; |, J0040C75C |. C705 8C77EF02>mov dword ptr [2EF778C], 1
" w( f* C8 R7 a( O7 n+ |6 b4 q' }0040C766 |. B8 64000000 mov eax, 64
: t" r- x! `' o+ m! k0040C76B |. 89C2 mov edx, eax5 ?7 O. K. A1 z: Y
0040C76D |. 8B0D E880EF02 mov ecx, dword ptr [2EF80E8]: o7 b7 _0 W% J4 q. K
0040C773 |. C1FA 1F sar edx, 1F% i9 S2 B! u& Q: n4 J2 d" L' J0 \
0040C776 |. F7F9 idiv ecx
/ R9 E8 S0 M% j3 Y6 J! d0040C778 |. 89C3 mov ebx, eax" Z y6 M/ n- s* g: n( Y
0040C77A |. 89EA mov edx, ebp5 b- v. j0 R& ^, v; W# L; B
0040C77C |. 89E8 mov eax, ebp# d8 i4 W' j3 e' s/ Q9 ~
0040C77E |. C1FA 1F sar edx, 1F
& ~1 P# Q3 x$ H+ G0040C781 |. C1E2 04 shl edx, 4
* h) ^0 v7 M" Y6 o2 y. y0040C784 |. 1BC2 sbb eax, edx6 z- V2 a g& z6 Q$ X$ e7 u& f
0040C786 |. C1F8 04 sar eax, 4( x4 P2 j& `) a, I# i( B0 L$ v
0040C789 |. 01C3 add ebx, eax0 X# m3 |# g- @( v( ]5 `. Y' a
0040C78B |. 891D 9077EF02 mov dword ptr [2EF7790], ebx! l* h5 R6 c2 n# d+ V
0040C791 |. 81C4 10010000 add esp, 1106 {9 h2 d4 _6 X; \; Q* R
0040C797 |. 5D pop ebp, W5 r& V4 o h( T7 U) A7 z& q4 y
0040C798 |. 5F pop edi
( k) O( c$ W; h) f! p/ p0040C799 |. 5E pop esi
2 V' @- c4 }6 n0040C79A |. 5A pop edx) J5 P5 W7 ~% Z! U% r
0040C79B |. 59 pop ecx2 Q, n/ E: o- l Z1 I
0040C79C |. 5B pop ebx3 Z" |7 h& \3 ?( @
0040C79D |. C3 retn
7 P& ^5 v5 c- {1 D4 o8 p( v0040C79E |> 81FD 8C000000 cmp ebp, 8C
6 q- A% ^3 p- g. q4 u. R0040C7A4 |. 7C 28 jl short 0040C7CE( C& g: ^) y2 `
0040C7A6 |. 81FD D2000000 cmp ebp, 0D2- E$ W( t+ k+ b5 n+ `
0040C7AC |. 7F 20 jg short 0040C7CE
& o; C+ P- a' O0040C7AE |. B9 03000000 mov ecx, 3
+ g: g! }( z* c5 ]2 f% f$ i0040C7B3 |. 89EA mov edx, ebp7 S1 ?1 T9 R1 z* W8 q
0040C7B5 |. 89E8 mov eax, ebp5 Y4 k2 i& P3 ^5 L$ h
0040C7B7 |. C1FA 1F sar edx, 1F
: t; T. [8 f: |- S) S& S0040C7BA |. F7F9 idiv ecx
" Z4 Z5 d6 M7 G- ~( b$ D0040C7BC |. C78424 040100>mov dword ptr [esp+104], 2. s" r7 `$ [7 J% a8 F4 x
0040C7C7 |. 89C7 mov edi, eax8 a: ?/ R6 ~9 o- L1 A3 K' U
0040C7C9 |.^ E9 8BFEFFFF jmp 0040C659
- e& T. g6 |: r4 u: Y5 s: o3 y0040C7CE |> 83FD 46 cmp ebp, 468 N+ p+ c) R3 F/ a
0040C7D1 |. 7C 25 jl short 0040C7F8
2 P) ]$ k3 u. m8 }1 z/ L0040C7D3 |. 81FD 8C000000 cmp ebp, 8C6 f8 b( \5 X4 [
0040C7D9 |. 7F 1D jg short 0040C7F82 K$ m4 d& s' z0 |. F
0040C7DB |. 89EA mov edx, ebp
/ ^# t g% D% B7 z; z: o0040C7DD |. 89E8 mov eax, ebp- e7 z8 P) J. p. n) l! x3 K
0040C7DF |. C1FA 1F sar edx, 1F
) H4 O, D2 Z9 o% k0040C7E2 |. 2BC2 sub eax, edx
; }/ {& E# c- T6 N. t; ~! c! k8 U0040C7E4 |. D1F8 sar eax, 1
, R+ D& p$ g: P( v" P0040C7E6 |. C78424 040100>mov dword ptr [esp+104], 1% q3 c1 O( ^1 C7 f! T' T
0040C7F1 |. 89C7 mov edi, eax
& d, c! H" Y. n: p" k0040C7F3 |.^ E9 61FEFFFF jmp 0040C659% O' Q( ] Q% c- S7 m9 K0 P
0040C7F8 |> 31D2 xor edx, edx C5 {! M* t( O0 v, o( Q
0040C7FA |. BF 46000000 mov edi, 46" u, R7 ], _/ [3 K+ C/ y* ?
0040C7FF |. 899424 040100>mov dword ptr [esp+104], edx* d5 c+ q; a! n3 _4 T: A
0040C806 |.^ E9 4EFEFFFF jmp 0040C659$ @! A8 `, O8 H/ B4 s2 y. @8 Q j
0040C80B |> 80F9 7C cmp cl, 7C x( o6 E. m$ e# e1 w* c
0040C80E |.^ 0F85 E9FEFFFF jnz 0040C6FD$ M0 H0 K% f E' j" X
0040C814 |. C602 20 mov byte ptr [edx], 20
5 F0 q. E* C' a4 z" n! V0040C817 \.^ E9 E1FEFFFF jmp 0040C6FD2 ~9 H4 R! Z6 I0 p
r# e4 o% {2 r# S3 E
在scratches.sc和scream.sc里面有lua的脚本,保存有字体文件名。
: {1 x/ C+ J$ o' w4 Y4 ~0 S估计要汉化就要在上面的代码段下功夫了,以后继续研究。1 x8 e) H7 t, O5 `' q8 h
$ p: s; k |7 K* o+ M
找到2个俄文的补丁,也许对以后研究有用。& v/ V9 h4 V* s; B$ d
http://www.megaupload.com/?d=EZH6X672
% C) z0 y$ r0 K1 ]7 whttp://rapidshare.com/files/94227080/ScratchesDC.7z |