冒险解谜游戏中文网 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
  1. CaptainMorgane.exe+96F5 - 83 C0 01              - add eax,01% T( `* M% `1 G! B: Y
  2. 地址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

  1. & f$ y0 `4 ~9 m2 i
  2. void __usercall sub_409670(char a1@<dil>, const char *a2@<esi>)0 e) [9 k+ L/ t9 ^: E4 r
  3. {
    / E& a" y, X8 ~3 D! M( o$ o/ {# k
  4.   _DWORD *v2; // eax
    . u* T1 ^# G9 l, d  L

  5. 3 E. K' E9 o6 w; n
  6.   if ( !dword_5D9B50 )' A& \9 c5 E* c: @
  7.   {
    8 P( z9 ], N2 D! |6 D( B0 t
  8.     if ( !a2 ), l- ?1 d0 A* O3 B; m- s* |9 v. F
  9.       goto LABEL_7;0 U5 e: e& s+ d1 v2 W
  10.     if ( strlen(a2) >= 0x80 )& F7 R% Z+ I- f! h7 e6 D
  11.     {
    $ P, q' [+ R2 ~& z0 T) ~7 p( r5 s
  12.       sub_51AEC6("ASSERT\n", a1);7 L( K3 h9 P0 z5 [9 L+ n2 z
  13.       sub_51AEC6("file:      %s(%d)\n", (unsigned int)"..\\..\\Source\\Dialogs\\Common\\DialogInterface.cpp");% u, @$ L$ L$ r+ Y
  14.       sub_51AEC6("function:  %s\n", (unsigned int)"DialogInterface::SetCaptionDisplayed");- p1 E0 r0 T1 o4 Y! Y( z- g
  15.       sub_51AEC6("condition: %s\n", (unsigned int)"sCaption==NULL || strlen(sCaption)< NB_CHAR_MAX");- J4 O1 J2 ]% A
  16.     }
    7 X4 o; @- j- A/ |
  17.   }# o7 p$ _% L4 ]0 S( D% }3 ]
  18.   if ( a2 )2 k' S1 Y2 o0 C# q7 y. C
  19.   {) m+ x! D+ @5 F6 M
  20.     strcpy((char *)&unk_5D3370, a2);4 c4 i5 q  p. j$ l
  21.     v2 = (_DWORD *)dword_5D3E6C;8 u) e6 L! v1 j! F, a1 Y
  22.     byte_5D33F0 = 1;
    3 @: f' x6 |3 i4 Z6 b4 I7 E
  23.     *(_BYTE *)(dword_5D3E6C + 4) = 1;3 f; O  I, Z: c+ c- P4 S% `
  24.     v2[2] = 0;
    ! ~0 ^  F' f  X$ O" x! k$ S
  25.     v2[4] = 0x100000;& m4 {: j& B, x/ q" R
  26.     v2[3] = 0;( }" B2 m1 E0 ?- }1 V2 i
  27.     v2[5] = 786432;! c. D1 E& C  \+ ?; C
  28.     return;7 w& O/ P6 c6 o! C7 E  x. v8 d
  29.   }
    8 W5 K8 z4 H  z& E3 A/ |9 e' E
  30. LABEL_7:
    ! z! g; o) ]  G+ v2 V: |
  31.   byte_5D33F0 = 0;% ^! D7 i: L% v1 c, H$ ^
  32. }
复制代码
  1. .text:004096EB ; ---------------------------------------------------------------------------0 G& T+ }9 C; r* J6 T/ }/ v# `
  2. .text:004096ED                 align 10h$ m. h. A! t1 I
  3. .text:004096F0& L' I3 Q7 v6 J; g: Z- L) X
  4. .text:004096F0 loc_4096F0:                             ; CODE XREF: sub_409670+7B↑j
    ; w7 K: m9 T% b, f' K, [; a3 E& k
  5. .text:004096F0                                         ; sub_409670+8A↓j
    7 ^4 y, i$ Q* X  t1 V( }, X
  6. .text:004096F0                 mov     cl, [eax]
    + }7 g! F) g+ D7 f0 K
  7. .text:004096F2                 mov     [edx+eax], cl
    ( t6 l, V  v* ?3 G( Q7 j( ^
  8. .text:004096F5                 add     eax, 1! u/ j9 \! X+ C* d, [7 G0 {
  9. .text:004096F8                 test    cl, cl
    1 W/ ^7 N" q) V, U- ^9 ~
  10. .text:004096FA                 jnz     short loc_4096F06 ?( J. y" c1 r4 [* l
  11. .text:004096FC                 mov     eax, dword_5D3E6C8 w: L; D' E- U. Y. F) r2 c6 N
  12. .text:00409701                 mov     byte_5D33F0, 1' u! `. j- @  Z3 I4 ?- h
  13. .text:00409708                 mov     byte ptr [eax+4], 1( g# ~- \4 K- S) @7 r& {5 l
  14. .text:0040970C                 mov     dword ptr [eax+8], 0
    5 E7 }7 K" y- l# y9 X1 \
  15. .text:00409713                 mov     dword ptr [eax+10h], 100000h
    - ^7 \$ j; Q1 q7 c2 V
  16. .text:0040971A                 mov     dword ptr [eax+0Ch], 0* V5 `+ q* q: t) w' N
  17. .text:00409721                 mov     dword ptr [eax+14h], 0C0000h
    . R2 q7 R' V% P6 W0 n# u) o
  18. .text:00409728                 retn
    + r' e1 e1 f+ c. i& J: x: A
  19. .text:00409729 ; ---------------------------------------------------------------------------
复制代码
/ x+ @; Z& k6 L. {& j' ^9 W

作者: 星之韶华    时间: 2025-4-14 09:41
学习学习一下




欢迎光临 冒险解谜游戏中文网 ChinaAVG (https://chinaavg.com/) Powered by Discuz! X3.2