设为首页收藏本站官方微博

建议 【Directx9游戏汉化 #9】来世(nextlife) 字幕显示函数

[复制链接]
查看: 377|回复: 0
打印 上一主题 下一主题

[建议] 【Directx9游戏汉化 #9】来世(nextlife) 字幕显示函数

跳转到指定楼层
楼主
发表于 2023-8-27 13:22 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

【Directx9游戏汉化 #9】来世(nextlife) 字幕显示函数

本帖最后由 shane007 于 2023-8-27 13:23 编辑
! e0 l( @5 M4 F" A& R/ E4 H7 I& N9 q( s
本游戏采用了CEGUI,该组件能采用directx和opengl。1 m, d% `: N+ d7 R, E$ h& z- Y
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
! d7 I, I& t2 M9 I  @游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。2 G. ^" G) B. Q
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
. ~1 Z, q5 E/ Z4 O/ _: w. O
1 N3 v+ g. Q+ j8 }% @9 J
( i2 @* a3 z! q& c, s7 a) u在游戏中找一个字幕,在以下地方断下。, c3 s  Y. J3 H, z
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
4 \# g8 d' n3 X  j, |/ ~因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。$ G9 u6 D, c8 u

. J/ L( j- w3 p/ u) T9 y/ v9 k
  1. NextLife.exe+11C5 - 42                    - inc edx
    ! ?$ C2 `0 p2 v" K$ r. g; T$ y
  2. 004011C5
复制代码

5 x7 t# q9 T- b- }% C$ O9 \% p7 J
4 V. U" b: n4 @4 I: N6 D该地方的伪代码4 t# Q' L8 J% R
  1. void __thiscall sub_401160(char **this, const char *a2)" I# ^4 B8 n9 R% W+ f3 H9 B7 {7 L
  2. {
    ) ?& |" S- Z) g7 ~9 Y0 \- m& v
  3.   char **v2; // esi
    / [1 b7 d' h9 u/ x' e% ^" b
  4.   char *v3; // eax
    0 M3 a+ ?, D$ i4 f8 M
  5.   char *v4; // eax
    % e) z% J2 q$ D; L
  6. 5 _4 `. ]; F# V) `
  7.   v2 = this;3 `3 b* a$ Q/ d0 I
  8.   if ( a2 )
    : T/ Z- J3 d# _
  9.   {
    ; l7 m* G: P) i1 f6 L
  10.     v3 = *this;4 c# U3 s7 @$ t- z% f" a+ q; X) \
  11.     if ( a2 != *this )
    ) L- E; s/ \5 l4 s% a8 X8 [
  12.     {6 p, q7 c4 u- C) e) K
  13.       if ( *a2 )
    + m" Q# @! N, j2 @8 g: r
  14.       {
    ; X7 \" @9 Y8 J, @: k5 j. K1 q& W
  15.         sub_401030(strlen(a2));; I2 ~( ]& [' v4 i# L1 r
  16.         strcpy(*v2, a2);2 V5 X4 B/ n( v& ^
  17.       }
    : J- h0 M" n3 R1 g1 i0 i
  18.       else
    8 k- ]; r7 W, S9 @9 H
  19.       {3 M% O, o1 X0 A/ \3 |
  20.         this[1] = (char *)1;
    5 K& j9 Q) U, `9 I
  21.         if ( v3 )
    + A8 H; e( ?, v
  22.           operator delete[](v3);
    1 S& p2 Z4 J4 L$ P! E' i! `
  23.         v4 = (char *)operator new(6u);# Y2 e, }8 E: O1 o- ^: o3 l& Y# @
  24.         *v2 = v4;6 s+ X: j+ `  P4 k; x$ u! Y
  25.         *(_DWORD *)v4 = 0;0 L* N( Q/ A* g
  26.       }
    ' U  p8 y  j" r
  27.     }; I0 h9 F1 A+ H  F& F
  28.   }2 V$ ?0 N* s" Y$ H
  29. }
复制代码
( B8 t4 L+ v7 P1 R+ U0 H' x* k
汇编代码
; v. ^6 p4 [" S# O, ^9 }$ e) b
  1. .text:004010F07 A# u1 U0 ?6 g
  2. .text:004010F0 ; =============== S U B R O U T I N E =======================================
    ; }( y9 D' [, b/ }: c7 m
  3. .text:004010F0& u; j; C/ K* V5 D0 u9 j2 g
  4. .text:004010F0
    0 [% |! M3 m7 T. t0 h! H( Z( v! b
  5. .text:004010F0 sub_4010F0      proc near               ; CODE XREF: _main+139↓p+ K; P; e7 g5 ?% Y" b* z5 ]
  6. .text:004010F0                                         ; sub_403240+97E↓p ...
    5 t0 z; e2 _/ K" T
  7. .text:004010F0
    9 ~/ T. [( c, I# w; f
  8. .text:004010F0 arg_0           = dword ptr  4: Q( w( e) d7 @1 U) O9 {0 r
  9. .text:004010F0, E2 ?" \9 s: S& `; P8 S* w; ^. i
  10. .text:004010F0                 mov     eax, [ecx]' s6 n, e  M" o% F, }- X( c5 p2 I" D7 x
  11. .text:004010F2                 test    eax, eax
    0 h) y; W0 a- k# z% A9 g
  12. .text:004010F4                 mov     edx, [esp+arg_0]
    7 i9 y8 ]$ U& u2 b
  13. .text:004010F8                 jz      short loc_401147
    & `( `6 D( x4 V8 y1 k. p
  14. .text:004010FA                 test    edx, edx
    ( p6 E& _( k/ `* ?
  15. .text:004010FC                 jz      short loc_401147" n1 `! a$ o  O& Q
  16. .text:004010FE                 mov     cl, [eax]
    7 @+ m+ ], u6 }) C# w
  17. .text:00401100                 test    cl, cl- b1 _6 \% p# x' z
  18. .text:00401102                 jnz     short loc_401116
    ; R$ u) c5 U; B' e& a. E
  19. .text:00401104                 cmp     byte ptr [edx], 0
    : t9 m4 n: C* N: r+ |' T) I
  20. .text:00401107                 setz    al
    7 o6 B1 V2 \8 x+ v* B
  21. .text:0040110A                 xor     edx, edx9 J3 p9 Q2 W+ s  U6 b. s; x3 ?2 I
  22. .text:0040110C                 test    al, al
    6 d, E6 R: R# Q4 f/ R
  23. .text:0040110E                 setz    dl
    ! a4 C4 q( l2 n. E, x
  24. .text:00401111                 mov     al, dl- n4 y: P1 i/ N
  25. .text:00401113                 retn    4
    ! u- ?7 C  @( K5 b& w
  26. .text:00401116 ; ---------------------------------------------------------------------------
    ' E: K: ~4 w: A- E
  27. .text:004011169 T, J" W: p, x) L) t% j( ^
  28. .text:00401116 loc_401116:                             ; CODE XREF: sub_4010F0+12↑j7 f4 @& f+ g; m" ^8 @" k
  29. .text:00401116                 cmp     byte ptr [edx], 0
    6 l  i" k6 |- y
  30. .text:00401119                 jz      short loc_401147
    " V( q# Z5 k& Y: j
  31. .text:0040111B                 jmp     short loc_401120' }! p' o* A8 K# R( ?
  32. .text:0040111B ; ---------------------------------------------------------------------------
    ( T, r1 \% s; {* q& |, y
  33. .text:0040111D                 align 10h0 h& `" V5 c& Z) l% I# O, M
  34. .text:00401120
    # Y; G& Q5 Y+ w
  35. .text:00401120 loc_401120:                             ; CODE XREF: sub_4010F0+2B↑j& Z7 O7 I4 U5 _+ }/ P
  36. .text:00401120                                         ; sub_4010F0+3B↓j" \4 y3 b' j, U1 y* N  l0 y! u( ^) m
  37. .text:00401120                 cmp     cl, [edx]
    6 f: |! T; {$ p- ]8 q$ ^
  38. .text:00401122                 jnz     short loc_40112D: M2 `- U, X. t* u3 R
  39. .text:00401124                 mov     cl, [eax+1]3 O# h8 c% N$ N, o7 d. e
  40. .text:00401127                 inc     eax
    . c7 x2 o, @# g  Z7 {* O+ o
  41. .text:00401128                 inc     edx
    # E) [% `; |) E. b' C
  42. .text:00401129                 test    cl, cl
    6 S9 A1 s$ V: c9 G. F
  43. .text:0040112B                 jnz     short loc_401120' r/ B/ w: u1 v" Z* U- I5 I$ y
  44. .text:0040112D  u! b# J. `( h$ Y9 R
  45. .text:0040112D loc_40112D:                             ; CODE XREF: sub_4010F0+32↑j
    0 w9 ~7 k. \6 V# X* x8 i
  46. .text:0040112D                 movzx   eax, byte ptr [eax]1 Q/ C& j$ d& x! W8 Q# @
  47. .text:00401130                 movzx   ecx, byte ptr [edx]
    9 P& `/ K- e- {. c* S* N
  48. .text:00401133                 sub     eax, ecx0 R" {3 F" S+ ~& L) Y) t
  49. .text:00401135                 neg     eax
    - W6 c$ t. D! O$ I5 s9 a; M
  50. .text:00401137                 sbb     al, al# D9 o* M* |  {% Z3 g. n! C) d
  51. .text:00401139                 inc     al' z' e0 p$ X; w- d9 s/ X
  52. .text:0040113B                 xor     edx, edx$ F, I7 N1 J! x2 u5 S3 O' W
  53. .text:0040113D                 test    al, al$ h# r' Z0 p; `! v0 B0 q; F
  54. .text:0040113F                 setz    dl
    * b; F4 t% O( T4 Q0 T! U+ _+ d6 I
  55. .text:00401142                 mov     al, dl/ S; ~, q" e8 U( F$ S9 U" g5 W
  56. .text:00401144                 retn    4
    & |* |* q1 B8 g  |8 O$ H
  57. .text:00401147 ; ---------------------------------------------------------------------------% {7 u" }9 S+ c, s( t
  58. .text:00401147
    / ~: ]% E* ?. n& U% n
  59. .text:00401147 loc_401147:                             ; CODE XREF: sub_4010F0+8↑j
    - P& j3 @( B1 y, y. C; B1 x
  60. .text:00401147                                         ; sub_4010F0+C↑j ...3 g, ~7 w6 l7 ?% t, n" b* K' p
  61. .text:00401147                 xor     al, al) J4 d3 g5 U/ ^2 R" }1 o  j
  62. .text:00401149                 xor     edx, edx0 Y; V' U8 Y! R$ a  E  J! k/ n' d
  63. .text:0040114B                 test    al, al
    5 M7 O/ @% L% P
  64. .text:0040114D                 setz    dl
    4 D2 f  w$ _% w7 Y6 T+ D
  65. .text:00401150                 mov     al, dl
    " v* V3 h0 l5 n) r% y
  66. .text:00401152                 retn    4
    $ y0 X% r: T' M
  67. .text:00401152 sub_4010F0      endp8 I2 ]2 v: S+ L. ?/ i
  68. .text:00401152
    6 w' G# @0 x& A+ l9 f# f
  69. .text:00401152 ; ---------------------------------------------------------------------------) X) C' |% I9 Z  O8 V" n: L
  70. .text:00401155                 align 10h
    ; z' q- v2 o9 P2 Q8 k
  71. .text:00401160' |6 p- L. }  A3 {+ b9 \9 i
  72. .text:00401160 ; =============== S U B R O U T I N E =======================================
      a6 C) i( S. d! l; }6 q, m
  73. .text:00401160) k! q3 r/ y) u/ m: E" a/ q, l3 I+ ?! t
  74. .text:00401160
    ! k* F5 j3 I/ \2 K, a- ^
  75. .text:00401160 sub_401160      proc near               ; CODE XREF: sub_4013D0+15↓p
    , Q  f, M& r+ }" X  g
  76. .text:00401160                                         ; sub_4013F0+C↓p ...
    0 ^6 A: d: ^* l
  77. .text:00401160. f0 H1 I6 j2 J1 T
  78. .text:00401160 arg_0           = dword ptr  4
    . `' `$ J: w6 w3 g, w- Z
  79. .text:00401160
    ; z- z) }5 O7 I
  80. .text:00401160                 push    esi
    + v% Q. D' B* E/ o
  81. .text:00401161                 push    edi" @+ k$ \9 l) k* \9 e- C& {
  82. .text:00401162                 mov     edi, [esp+8+arg_0]
    # c8 ?/ b$ ]3 _3 L8 t- e
  83. .text:00401166                 test    edi, edi$ H! v& z- c1 r8 \  i
  84. .text:00401168                 mov     esi, ecx
    9 y0 Z7 E7 I& @8 ^" T9 \6 O
  85. .text:0040116A                 jz      short loc_4011CA
      g- h7 J4 m3 X# l
  86. .text:0040116C                 mov     eax, [esi]
    ! f3 t) P- E3 R" E
  87. .text:0040116E                 cmp     edi, eax8 t8 _+ a% J1 t. |- b- @6 m& s
  88. .text:00401170                 jz      short loc_4011CA
    6 J; W- X/ ^5 N# K
  89. .text:00401172                 cmp     byte ptr [edi], 0, |) x( B& c$ w1 y( x0 \8 T
  90. .text:00401175                 jnz     short loc_4011A2
    & T; |) N6 y" i: m
  91. .text:00401177                 test    eax, eax
    " ~* r1 ?" z7 \8 |  d- O/ _
  92. .text:00401179                 mov     dword ptr [esi+4], 1
    9 H$ J* d8 K& s
  93. .text:00401180                 jz      short loc_40118B1 |! E: P& ?5 B. b; P4 U7 C
  94. .text:00401182                 push    eax             ; void *0 p8 L; D# E! d, p; v
  95. .text:00401183                 call    ??_V@YAXPAX@Z   ; operator delete[](void *)
    2 R' m+ P6 p5 v. I7 `7 P  d' g
  96. .text:00401188                 add     esp, 4$ G" y3 L" u* d" f& }0 T
  97. .text:0040118B# q9 @0 r- m. E2 f/ F0 r
  98. .text:0040118B loc_40118B:                             ; CODE XREF: sub_401160+20↑j2 L7 K1 b- `7 E3 J
  99. .text:0040118B                 push    6               ; Size4 C2 F& U+ X. Y5 o4 P
  100. .text:0040118D                 call    j_??2@YAPAXI@Z  ; operator new(uint)- G, z# w1 x7 `5 \2 T( W# \
  101. .text:00401192                 add     esp, 42 b, K8 Q! \! t+ ~
  102. .text:00401195                 mov     [esi], eax' I0 W" D) a7 j
  103. .text:00401197                 pop     edi
    * n- B9 H1 r- ~; x
  104. .text:00401198                 mov     dword ptr [eax], 0
    5 W( W2 ]: t8 \& N8 T. l. G4 v2 H
  105. .text:0040119E                 pop     esi
    ; h( Y+ ]  E5 M' W* a
  106. .text:0040119F                 retn    4
    . I" @% ^, u( I5 |6 ?
  107. .text:004011A2 ; ---------------------------------------------------------------------------
    , b2 b4 C+ O0 n
  108. .text:004011A2
    9 ~2 d  m; I& t4 e9 o
  109. .text:004011A2 loc_4011A2:                             ; CODE XREF: sub_401160+15↑j
    . p/ P' c( s* m9 m! D" K
  110. .text:004011A2                 mov     eax, edi/ ^( J0 H6 [) ]: i- y# K
  111. .text:004011A4                 lea     edx, [eax+1]
    0 q2 [3 e  h$ H0 v
  112. .text:004011A78 ^3 s1 b+ e$ w5 Q- Y1 E
  113. .text:004011A7 loc_4011A7:                             ; CODE XREF: sub_401160+4C↓j+ T" A: G" y! i$ d
  114. .text:004011A7                 mov     cl, [eax]
    * @/ C9 V$ ]+ L
  115. .text:004011A9                 inc     eax
    1 [0 F( m9 |, U8 J
  116. .text:004011AA                 test    cl, cl% p0 `; L3 _3 e, O
  117. .text:004011AC                 jnz     short loc_4011A7
    7 h5 F- c' y' ^, }2 h( p/ y- M. B
  118. .text:004011AE                 sub     eax, edx
    2 @5 l$ \6 H6 f: }2 F: b& e
  119. .text:004011B0                 push    eax" z' Y9 j9 r% f$ u
  120. .text:004011B1                 mov     ecx, esi
    : a2 `) P0 T# U- \* q
  121. .text:004011B3                 call    sub_401030
    6 ~( k& u& j$ ^- O* F" ~( Z7 s
  122. .text:004011B8                 mov     edx, [esi]
    6 |$ S, x3 n9 U8 R9 Z) }
  123. .text:004011BA                 mov     ecx, edi
    3 u3 N6 a9 Y6 c
  124. .text:004011BC                 lea     esp, [esp+0]
    ( g# c+ x4 N' L% O/ @+ C- p% U
  125. .text:004011C0. T* ^/ d( ]7 j' A3 c) b/ T3 t
  126. .text:004011C0 loc_4011C0:                             ; CODE XREF: sub_401160+68↓j; u3 F, q6 J8 c$ w5 Y: t
  127. .text:004011C0                 mov     al, [ecx]5 {2 G2 k' S' T. e0 w
  128. .text:004011C2                 inc     ecx
    5 n) g& l4 S! \1 J! E
  129. .text:004011C3                 mov     [edx], al
    % M1 t  Q' g0 |( s" w  t7 n2 m$ b+ O
  130. .text:004011C5                 inc     edx
    + `; `. _2 l& W7 e3 y* O
  131. .text:004011C6                 test    al, al! j( c3 t9 l) F: r$ c- N' h2 b
  132. .text:004011C8                 jnz     short loc_4011C04 R( G0 I- M3 i0 U( K' K
  133. .text:004011CA5 _8 T4 [& n7 O5 Z2 G
  134. .text:004011CA loc_4011CA:                             ; CODE XREF: sub_401160+A↑j# G9 `6 d) X0 o1 [
  135. .text:004011CA                                         ; sub_401160+10↑j9 \0 U9 Q- Y) ]* X
  136. .text:004011CA                 pop     edi* A- ^& Q- |) o% [
  137. .text:004011CB                 pop     esi
    4 @9 a" Z& L/ z: @# p! o1 F7 X3 u
  138. .text:004011CC                 retn    4
    ! `1 _! M" e, c
  139. .text:004011CC sub_401160      endp
    * O0 f5 Q  G% a, d$ h5 o! e
  140. .text:004011CC
    - l* ^. q; A; S2 y
  141. .text:004011CC ; ---------------------------------------------------------------------------
复制代码

" r" r0 N, h, _; {* ?/ G9 j8 f+ ]3 o

3 ~( Z1 ?7 Z4 t0 c  M# X2 q
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 很美好很美好 很差劲很差劲
回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

冒险解谜游戏中文网 ChinaAVG

官方微博官方微信号小黑屋 微信玩家群  

(C) ChinaAVG 2004 - 2019 All Right Reserved. Powered by Discuz! X3.2
辽ICP备11008827号 | 桂公网安备 45010702000051号

冒险,与你同在。 冒险解谜游戏中文网ChinaAVG诞生于2004年9月9日,是全球华人共同的冒险解谜类游戏家园。我们致力于提供各类冒险游戏资讯供大家学习交流。本站所有资源均不用于商业用途。

快速回复 返回顶部 返回列表