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

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

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

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

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

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

本帖最后由 shane007 于 2023-8-27 13:23 编辑
/ V( w. `1 D( _  Z# M) M7 {" }5 q* C6 Z
本游戏采用了CEGUI,该组件能采用directx和opengl。% \9 Z: H- x9 C8 i, l
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。- l' V' ]' q/ m+ r$ `; |% p
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
" l; t' G( g3 O# N1 r(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)9 a2 M. g3 r3 E! o* A
( _; d; j$ S, d+ p& B

! T/ {3 t0 H9 A在游戏中找一个字幕,在以下地方断下。
1 v' W. j8 n! i/ J% x由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
, m$ j/ g5 r5 z2 A7 ]- e7 t因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。( ~. ^" f) A( V' U0 T# W. D# V
- o6 }/ U* |; V# _& U
  1. NextLife.exe+11C5 - 42                    - inc edx* U0 x" U% A: y0 j
  2. 004011C5
复制代码

# A$ ]) o6 L" ]1 Y9 Q5 A
' E: k8 V5 F1 Q5 y& g! `* j该地方的伪代码
6 C$ e. A: n7 q9 O0 B' ]/ {
  1. void __thiscall sub_401160(char **this, const char *a2)7 ^; a0 i% G) S; Z4 ^# q
  2. {
    & t5 C) p- L2 S; D; B! Z
  3.   char **v2; // esi& {0 w. n# q! t
  4.   char *v3; // eax
      t/ ?* @$ y9 M- w  ]
  5.   char *v4; // eax
    " c. r" \; |) u- J
  6. / G# Z; J5 o$ G2 K& |: `9 f; A4 u
  7.   v2 = this;
    7 ^1 n9 h5 C/ A9 u! g& T
  8.   if ( a2 )
    " O/ l* ]" M) |# C
  9.   {0 y  d! e, T' K0 |$ B. t3 ?, d6 y
  10.     v3 = *this;9 u; [8 t5 v- D$ a& I
  11.     if ( a2 != *this )+ a0 V3 k9 a& `! x6 K* T& g" D4 j
  12.     {
    - G& |* K$ D4 p8 m# e
  13.       if ( *a2 )- o' O& c( c' p, _; K
  14.       {
    ) Z: B9 a& i) K! l- W( S% V$ c
  15.         sub_401030(strlen(a2));+ Z# q4 O1 |, s5 m2 n3 I
  16.         strcpy(*v2, a2);
    + W! }0 `" q/ {3 \$ x% W
  17.       }: _  [! u. u/ j/ T+ H; i) D$ M* o
  18.       else
    ! E2 S6 {) O- R/ i3 {; N: H
  19.       {
    + k( t- v% ^& J- H7 }+ ~+ @1 [
  20.         this[1] = (char *)1;! N1 x& \- T$ t, p+ g
  21.         if ( v3 )
    6 o7 }! e3 Z- M; w% I% _
  22.           operator delete[](v3);. e; O- B0 a3 @' f+ W$ L: a2 h
  23.         v4 = (char *)operator new(6u);
    ( ~0 \" v) k: D
  24.         *v2 = v4;
    8 B3 r' D0 Q- d7 p7 c1 A( j
  25.         *(_DWORD *)v4 = 0;+ s" t' d1 S" w) t) G1 C2 i
  26.       }) p, @; r% p1 R' D* s
  27.     }
    ; V" K3 f, t" W! U/ e
  28.   }
    + Z: d( z9 y  z. u* ^
  29. }
复制代码
5 F0 Z8 ?8 Q0 m: x# B
汇编代码
7 q. z5 N0 G: C% _2 f# e
  1. .text:004010F0# A) M6 `+ ~' v
  2. .text:004010F0 ; =============== S U B R O U T I N E =======================================
    ' |7 Y" o. j7 n2 p3 |9 L/ e
  3. .text:004010F0! E7 T4 [7 v+ i
  4. .text:004010F0  J" y7 F) U. O' q" l% z' x
  5. .text:004010F0 sub_4010F0      proc near               ; CODE XREF: _main+139↓p
    - [. w7 c0 X. [# Z
  6. .text:004010F0                                         ; sub_403240+97E↓p ...
    & H* G/ a3 B/ d! t, ]8 l$ u
  7. .text:004010F06 K* o- D$ x, S: e3 o& w3 d+ u
  8. .text:004010F0 arg_0           = dword ptr  4
    / v0 ?8 C9 r: `5 b2 K
  9. .text:004010F0
    ; }: k% r( }4 J( J
  10. .text:004010F0                 mov     eax, [ecx]* o: W( D% |! v- a7 T  y6 o, F) u
  11. .text:004010F2                 test    eax, eax
    5 Z9 x  L( h& s9 d. A! N  ?
  12. .text:004010F4                 mov     edx, [esp+arg_0]& m/ E  ]: y; q2 }5 A
  13. .text:004010F8                 jz      short loc_401147- g) X7 t) ~1 A+ k) _8 w3 y
  14. .text:004010FA                 test    edx, edx
    , _  h6 R. D) Q2 @' D* d& C8 T9 r
  15. .text:004010FC                 jz      short loc_401147" I/ B4 B; W! p# W& T9 R
  16. .text:004010FE                 mov     cl, [eax]' ~% A5 S1 Y: p$ P0 r6 N
  17. .text:00401100                 test    cl, cl0 Q. t) u: m( s7 i/ V4 P* G- _& b" g
  18. .text:00401102                 jnz     short loc_4011160 v. r- d% f3 q' `8 \5 V
  19. .text:00401104                 cmp     byte ptr [edx], 0
    # G* {# l& j# f; o# [5 k) N9 ?+ o
  20. .text:00401107                 setz    al9 h) Y/ l) F0 ?, q6 r+ E
  21. .text:0040110A                 xor     edx, edx  r  k: f) P. |" S& k! `' i  W) R. ~
  22. .text:0040110C                 test    al, al# O4 Q! C( v7 I
  23. .text:0040110E                 setz    dl
    # ?% c  Q8 z* `  G. W5 ], ?* e1 A6 |
  24. .text:00401111                 mov     al, dl
    - a& C0 _1 C# t2 b% V
  25. .text:00401113                 retn    4# Q) @! ~) H$ _: [9 k# C  ^- T
  26. .text:00401116 ; ---------------------------------------------------------------------------, S& R+ u& U: K* t
  27. .text:004011165 `! U" M, H$ T4 r; E
  28. .text:00401116 loc_401116:                             ; CODE XREF: sub_4010F0+12↑j
    " U$ V6 m$ d) r# o- |4 V  z  n# F
  29. .text:00401116                 cmp     byte ptr [edx], 09 `. Z  e# B1 w- H, x
  30. .text:00401119                 jz      short loc_401147( H8 y( U- y' Q& z6 i
  31. .text:0040111B                 jmp     short loc_401120
    3 a# v) X9 y7 N& y- M. N  \
  32. .text:0040111B ; ---------------------------------------------------------------------------
    . `& f3 w( R8 D* t0 G
  33. .text:0040111D                 align 10h
    , L, u+ ]$ w: i2 `6 Z* d
  34. .text:00401120/ `/ y3 {+ o+ P4 Y+ o0 l
  35. .text:00401120 loc_401120:                             ; CODE XREF: sub_4010F0+2B↑j* k" V7 R7 p4 s6 W6 A
  36. .text:00401120                                         ; sub_4010F0+3B↓j( ]# ^: V9 o6 n( C# D
  37. .text:00401120                 cmp     cl, [edx]
    $ T$ _, O8 @" Y1 y9 ^# Q
  38. .text:00401122                 jnz     short loc_40112D
    7 D, j% F( I7 b* x
  39. .text:00401124                 mov     cl, [eax+1], X' f! M- t1 x
  40. .text:00401127                 inc     eax
    " p. N" }7 z7 f% r$ a
  41. .text:00401128                 inc     edx
    # d# {6 R5 Z+ y5 Q3 Y3 C/ V" `3 e) ]
  42. .text:00401129                 test    cl, cl8 D/ |' J/ A/ d* P. y  C! b
  43. .text:0040112B                 jnz     short loc_401120
    : t9 a: f$ X3 b5 R, `) n, n9 \" d
  44. .text:0040112D( s) k6 P  m+ S) v% Q
  45. .text:0040112D loc_40112D:                             ; CODE XREF: sub_4010F0+32↑j, ^$ f& z7 {* W
  46. .text:0040112D                 movzx   eax, byte ptr [eax]  C8 c7 R, s3 p2 i# p% v
  47. .text:00401130                 movzx   ecx, byte ptr [edx]& ?- M% K* H* G6 \+ i% r1 z4 C2 r
  48. .text:00401133                 sub     eax, ecx
    ! ?6 P9 k( G& z; T5 t' r) h' a0 z- G
  49. .text:00401135                 neg     eax
    3 l( A* P4 ~  p/ e4 ~' h# [
  50. .text:00401137                 sbb     al, al, x$ k$ C. n6 n7 j" J; B
  51. .text:00401139                 inc     al
    , F3 p4 T5 g' b. [" g  h2 Y3 K
  52. .text:0040113B                 xor     edx, edx
    . c+ o1 E# c6 B" U( N- b
  53. .text:0040113D                 test    al, al$ ~" e. Y6 W8 ]; i7 X
  54. .text:0040113F                 setz    dl
    " i& G2 F; |. k$ t/ ^
  55. .text:00401142                 mov     al, dl
    ! @' h* m9 F' _! s
  56. .text:00401144                 retn    4# m! z. B3 l" i' n* s  E, U8 j" d
  57. .text:00401147 ; ---------------------------------------------------------------------------0 J! ?8 B) o" S) g4 E. d
  58. .text:00401147
    . a$ o# E* X0 @3 B& K+ B
  59. .text:00401147 loc_401147:                             ; CODE XREF: sub_4010F0+8↑j
    ' s; B  z$ Y( [% r$ K% }" }
  60. .text:00401147                                         ; sub_4010F0+C↑j ...
    5 U: _- T% g+ N* Z3 P
  61. .text:00401147                 xor     al, al  z2 k, |/ t0 j) G! v  Y3 D  i
  62. .text:00401149                 xor     edx, edx" j- V2 O0 a7 ?) v% y( X$ P" V
  63. .text:0040114B                 test    al, al& M; n: T  [3 P# u. ]! ?1 C5 x& `
  64. .text:0040114D                 setz    dl/ O2 h2 G) J/ h: I2 m
  65. .text:00401150                 mov     al, dl
    ! R  W5 \, g6 {$ \8 H
  66. .text:00401152                 retn    4
    + B; }6 F( J+ a9 d9 N' N/ A
  67. .text:00401152 sub_4010F0      endp' h$ @1 z- n* ]7 o* Y, d1 @& ~. k
  68. .text:004011523 U$ f( J  r# M% k
  69. .text:00401152 ; ---------------------------------------------------------------------------" I' w! u. [5 q7 w
  70. .text:00401155                 align 10h+ t' Q4 u2 m: o3 D3 E9 Y  W
  71. .text:00401160! i& R- X! i; \& Z
  72. .text:00401160 ; =============== S U B R O U T I N E =======================================' }  b) R2 J9 x
  73. .text:004011608 o' w1 p8 R) n: \
  74. .text:00401160% E( Z$ ?6 n( Y* \! M: v* u
  75. .text:00401160 sub_401160      proc near               ; CODE XREF: sub_4013D0+15↓p6 c8 b! i) g+ f8 t% c
  76. .text:00401160                                         ; sub_4013F0+C↓p ...
    # e6 E4 f1 W% _  e
  77. .text:00401160
    . u6 S$ }/ Q# p* u
  78. .text:00401160 arg_0           = dword ptr  4
    / J/ A( E1 n6 B8 t3 _' W# X
  79. .text:00401160
    0 z% Z1 Q0 Y4 R6 V' S% h+ B6 _) y5 @8 B
  80. .text:00401160                 push    esi
    ) C. {; s+ q4 o$ G+ M' K5 V
  81. .text:00401161                 push    edi
    ( ^5 J, A$ x% L+ S1 l
  82. .text:00401162                 mov     edi, [esp+8+arg_0]. h2 U$ l0 r- ~+ H# E
  83. .text:00401166                 test    edi, edi
    ; n! |' e, k2 K9 `( H! \: r9 F
  84. .text:00401168                 mov     esi, ecx
    ( t5 x. {# ^! G1 C/ w0 N9 P
  85. .text:0040116A                 jz      short loc_4011CA
    ! n9 j0 e& v! C4 D- N& u
  86. .text:0040116C                 mov     eax, [esi]+ l! R' \: U) O# S% X( c# P. H
  87. .text:0040116E                 cmp     edi, eax
    ( n7 ^" N3 j$ e1 M# N- l2 h
  88. .text:00401170                 jz      short loc_4011CA
    9 {+ G- z# f5 ^$ l" S' L+ p# P0 K
  89. .text:00401172                 cmp     byte ptr [edi], 0: t: q4 p) b6 y7 P+ W% b
  90. .text:00401175                 jnz     short loc_4011A2
    ! ], a3 N+ H( n: ^
  91. .text:00401177                 test    eax, eax/ s  p! S. h. m- {
  92. .text:00401179                 mov     dword ptr [esi+4], 1, f; s8 p) h4 L  F
  93. .text:00401180                 jz      short loc_40118B
    ) }- f) H' I$ A* x1 Q) p
  94. .text:00401182                 push    eax             ; void *& f/ l( N# c. A
  95. .text:00401183                 call    ??_V@YAXPAX@Z   ; operator delete[](void *)
    # `; S1 e8 S6 \: O/ S
  96. .text:00401188                 add     esp, 4
    4 Y: s8 z$ K! Q! w8 v" v8 L
  97. .text:0040118B
    ' i+ ^" j7 ]/ t$ k) E! \1 q
  98. .text:0040118B loc_40118B:                             ; CODE XREF: sub_401160+20↑j+ a5 m$ Q5 f) C/ H. e
  99. .text:0040118B                 push    6               ; Size* M3 K, b9 U, i% D; z9 t6 ?, C9 h! F
  100. .text:0040118D                 call    j_??2@YAPAXI@Z  ; operator new(uint)
    ! x* J2 ^3 L& \! F" p  d
  101. .text:00401192                 add     esp, 4
    % h; y+ m/ Z$ ]* m$ w* s1 v
  102. .text:00401195                 mov     [esi], eax
    0 \. F, Y* Z" \3 Z0 m. g
  103. .text:00401197                 pop     edi2 K2 }0 R- U# M
  104. .text:00401198                 mov     dword ptr [eax], 0
    " D3 [! Q% m  C4 j5 }
  105. .text:0040119E                 pop     esi
    & q3 W% i' ]) e
  106. .text:0040119F                 retn    4
    " Q3 T% w' t# X
  107. .text:004011A2 ; ---------------------------------------------------------------------------- `9 E- R' ^4 W2 E; o8 D# u6 }
  108. .text:004011A2) b- x. M' ?. R  \  M3 c
  109. .text:004011A2 loc_4011A2:                             ; CODE XREF: sub_401160+15↑j
    1 U) g/ ?! @  x
  110. .text:004011A2                 mov     eax, edi$ k' O3 E% I* w% o( n. r
  111. .text:004011A4                 lea     edx, [eax+1]
    3 y* n' J1 \0 j  S7 G0 Y# e$ F  @
  112. .text:004011A7
    9 a7 G; D0 B5 P& }7 t
  113. .text:004011A7 loc_4011A7:                             ; CODE XREF: sub_401160+4C↓j
    6 C; S9 d. c; J* R9 w0 P7 M8 g
  114. .text:004011A7                 mov     cl, [eax]
    % b$ \# h+ s) c3 [' P7 N( y
  115. .text:004011A9                 inc     eax
    0 C% Q' i/ a0 v( p4 @4 c
  116. .text:004011AA                 test    cl, cl% t/ U3 r& M2 X/ ^. O2 S
  117. .text:004011AC                 jnz     short loc_4011A7! S0 K9 q4 b! b( D. i
  118. .text:004011AE                 sub     eax, edx
    8 }& ^9 j. c% T( g7 `* s$ ?
  119. .text:004011B0                 push    eax
    ) D" N0 o+ n+ h$ {# @$ V
  120. .text:004011B1                 mov     ecx, esi, g$ v8 \0 I' |* X' e" Y7 L2 J1 }
  121. .text:004011B3                 call    sub_401030" `4 W7 T3 h8 N, c' e
  122. .text:004011B8                 mov     edx, [esi]
    7 |$ |; i; ~; @  l( h7 d
  123. .text:004011BA                 mov     ecx, edi
      Q/ I+ w; Q8 z$ a
  124. .text:004011BC                 lea     esp, [esp+0]
    & \% |/ U2 @) O- N) T
  125. .text:004011C0
    & ?. T5 B: |0 P$ @# `
  126. .text:004011C0 loc_4011C0:                             ; CODE XREF: sub_401160+68↓j
    ( V! b, j2 h. W6 ^* M
  127. .text:004011C0                 mov     al, [ecx]# J* z" S' ]% {! Y
  128. .text:004011C2                 inc     ecx
    $ {& L/ r* N0 q1 C/ N
  129. .text:004011C3                 mov     [edx], al
    * w! u  Z( `  A! k. v
  130. .text:004011C5                 inc     edx
    ; c/ l% N5 I) e1 h" U! C. a, h
  131. .text:004011C6                 test    al, al0 t! M. h, V& s) v$ H4 [% \! k9 c
  132. .text:004011C8                 jnz     short loc_4011C0- G; V3 d: y) e4 f
  133. .text:004011CA2 k9 h" G( P; v3 j1 A. N) R( q0 ?% H) j+ g6 E
  134. .text:004011CA loc_4011CA:                             ; CODE XREF: sub_401160+A↑j
    2 o' b, a( L4 e* j' ^+ q
  135. .text:004011CA                                         ; sub_401160+10↑j' k! P) {; J/ r) g
  136. .text:004011CA                 pop     edi2 d% |' {* K; Q3 @# j! }
  137. .text:004011CB                 pop     esi+ h+ {5 R- j" d( c2 Z+ {& W6 {
  138. .text:004011CC                 retn    4$ a" c6 f6 {: a; P7 }( f! j
  139. .text:004011CC sub_401160      endp
      r# }, F( L3 h& }: N
  140. .text:004011CC
    4 k# w$ `- P- m7 ?& L
  141. .text:004011CC ; ---------------------------------------------------------------------------
复制代码
5 G1 h9 Z2 B) D3 U! R; G

6 E8 A1 X6 [, n* ^
9 z+ J. {- a3 i& h' a$ ]
分享到:  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日,是全球华人共同的冒险解谜类游戏家园。我们致力于提供各类冒险游戏资讯供大家学习交流。本站所有资源均不用于商业用途。

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