冒险解谜游戏中文网 ChinaAVG
标题:
【Directx9游戏汉化 #7】莫嘉娜船长与金海龟(Captain Morgane and the Golden Turt...
[打印本页]
作者:
shane007
时间:
2023-8-26 16:09
标题:
【Directx9游戏汉化 #7】莫嘉娜船长与金海龟(Captain Morgane and the Golden Turt...
本帖最后由 shane007 于 2023-8-26 16:14 编辑
( U0 n0 d$ } m
- _# H" l+ A3 u$ w
我用代理dll的方式,让这个游戏窗口化了。
* C* b6 u/ {9 C9 W! U* [" I1 ]# W
随后用cheat engine(用其他工具老是出异常,无法正常调试)在内存中检索一句字幕,下内存方位断点。
' i+ k- J+ ~* F5 ?, H/ c9 Y
在以下地方断下。
8 k1 P0 N! C% R$ h$ |4 i2 K
& a7 {9 R( e6 N I1 U4 T' O
CaptainMorgane.exe+96F5 - 83 C0 01 - add eax,01
% T( `* M% `1 G! B: Y
地址004096F5
复制代码
3 U4 x% t6 X: O
% o/ s- m8 i' _
随后,在ida pro中查看伪代码,感觉这是一个字符串长度的check函数,
/ P F! [$ l& G1 B
真正的字幕显示函数需要追到上一层,后续再继续分析
\0 L5 q$ o- \% n* c1 ]$ A
. j3 E$ y% W2 R$ x0 f% K
& f$ y0 `4 ~9 m2 i
void __usercall sub_409670(char a1@<dil>, const char *a2@<esi>)
0 e) [9 k+ L/ t9 ^: E4 r
{
/ E& a" y, X8 ~3 D! M( o$ o/ {# k
_DWORD *v2; // eax
. u* T1 ^# G9 l, d L
3 E. K' E9 o6 w; n
if ( !dword_5D9B50 )
' A& \9 c5 E* c: @
{
8 P( z9 ], N2 D! |6 D( B0 t
if ( !a2 )
, l- ?1 d0 A* O3 B; m- s* |9 v. F
goto LABEL_7;
0 U5 e: e& s+ d1 v2 W
if ( strlen(a2) >= 0x80 )
& F7 R% Z+ I- f! h7 e6 D
{
$ P, q' [+ R2 ~& z0 T) ~7 p( r5 s
sub_51AEC6("ASSERT\n", a1);
7 L( K3 h9 P0 z5 [9 L+ n2 z
sub_51AEC6("file: %s(%d)\n", (unsigned int)"..\\..\\Source\\Dialogs\\Common\\DialogInterface.cpp");
% u, @$ L$ L$ r+ Y
sub_51AEC6("function: %s\n", (unsigned int)"DialogInterface::SetCaptionDisplayed");
- p1 E0 r0 T1 o4 Y! Y( z- g
sub_51AEC6("condition: %s\n", (unsigned int)"sCaption==NULL || strlen(sCaption)< NB_CHAR_MAX");
- J4 O1 J2 ]% A
}
7 X4 o; @- j- A/ |
}
# o7 p$ _% L4 ]0 S( D% }3 ]
if ( a2 )
2 k' S1 Y2 o0 C# q7 y. C
{
) m+ x! D+ @5 F6 M
strcpy((char *)&unk_5D3370, a2);
4 c4 i5 q p. j$ l
v2 = (_DWORD *)dword_5D3E6C;
8 u) e6 L! v1 j! F, a1 Y
byte_5D33F0 = 1;
3 @: f' x6 |3 i4 Z6 b4 I7 E
*(_BYTE *)(dword_5D3E6C + 4) = 1;
3 f; O I, Z: c+ c- P4 S% `
v2[2] = 0;
! ~0 ^ F' f X$ O" x! k$ S
v2[4] = 0x100000;
& m4 {: j& B, x/ q" R
v2[3] = 0;
( }" B2 m1 E0 ?- }1 V2 i
v2[5] = 786432;
! c. D1 E& C \+ ?; C
return;
7 w& O/ P6 c6 o! C7 E x. v8 d
}
8 W5 K8 z4 H z& E3 A/ |9 e' E
LABEL_7:
! z! g; o) ] G+ v2 V: |
byte_5D33F0 = 0;
% ^! D7 i: L% v1 c, H$ ^
}
复制代码
.text:004096EB ; ---------------------------------------------------------------------------
0 G& T+ }9 C; r* J6 T/ }/ v# `
.text:004096ED align 10h
$ m. h. A! t1 I
.text:004096F0
& L' I3 Q7 v6 J; g: Z- L) X
.text:004096F0 loc_4096F0: ; CODE XREF: sub_409670+7B↑j
; w7 K: m9 T% b, f' K, [; a3 E& k
.text:004096F0 ; sub_409670+8A↓j
7 ^4 y, i$ Q* X t1 V( }, X
.text:004096F0 mov cl, [eax]
+ }7 g! F) g+ D7 f0 K
.text:004096F2 mov [edx+eax], cl
( t6 l, V v* ?3 G( Q7 j( ^
.text:004096F5 add eax, 1
! u/ j9 \! X+ C* d, [7 G0 {
.text:004096F8 test cl, cl
1 W/ ^7 N" q) V, U- ^9 ~
.text:004096FA jnz short loc_4096F0
6 ?( J. y" c1 r4 [* l
.text:004096FC mov eax, dword_5D3E6C
8 w: L; D' E- U. Y. F) r2 c6 N
.text:00409701 mov byte_5D33F0, 1
' u! `. j- @ Z3 I4 ?- h
.text:00409708 mov byte ptr [eax+4], 1
( g# ~- \4 K- S) @7 r& {5 l
.text:0040970C mov dword ptr [eax+8], 0
5 E7 }7 K" y- l# y9 X1 \
.text:00409713 mov dword ptr [eax+10h], 100000h
- ^7 \$ j; Q1 q7 c2 V
.text:0040971A mov dword ptr [eax+0Ch], 0
* V5 `+ q* q: t) w' N
.text:00409721 mov dword ptr [eax+14h], 0C0000h
. R2 q7 R' V% P6 W0 n# u) o
.text:00409728 retn
+ r' e1 e1 f+ c. i& J: x: A
.text:00409729 ; ---------------------------------------------------------------------------
复制代码
/ x+ @; Z& k6 L. {& j' ^9 W
作者:
星之韶华
时间:
2025-4-14 09:41
学习学习一下
欢迎光临 冒险解谜游戏中文网 ChinaAVG (https://chinaavg.com/)
Powered by Discuz! X3.2