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

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

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

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

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

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

本帖最后由 shane007 于 2023-8-27 13:23 编辑
& M3 @7 E% i1 Q8 e3 g
% q5 U/ L) {, ]- b9 }0 Q7 }本游戏采用了CEGUI,该组件能采用directx和opengl。/ x# w* w* J* e. r$ W( m
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。8 z- a. N0 o' |' F( x3 {- {
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
, W& u$ J3 R$ p3 j- j- z, s(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
4 A7 t) ~) V! d- l- x
2 u# C) H2 ^, i1 p6 R  @2 L- d1 m- y% N/ p. d3 C8 W% m  c* q
在游戏中找一个字幕,在以下地方断下。
7 v8 L  a6 Y& S7 q6 m3 D由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),# l1 m) k7 C( h
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。2 l, T' B. [# z" R% F) c0 N* w) s
# i" G: @* o- I( B2 ]# h: u1 j
  1. NextLife.exe+11C5 - 42                    - inc edx& W' Y# C; i3 n* F
  2. 004011C5
复制代码

# Z" v8 \7 g9 j. }, `& d% m6 `9 U6 G, w2 u5 _1 _2 [
该地方的伪代码  z# `" f8 b7 k2 V
  1. void __thiscall sub_401160(char **this, const char *a2)/ u! W8 k# d9 r5 y: N2 u
  2. {
    ! g$ T; O4 R9 ~4 Z
  3.   char **v2; // esi
    2 M$ V  W9 }6 t4 g5 ]# F' T" [
  4.   char *v3; // eax/ R' e' T6 x# M3 z6 V# t
  5.   char *v4; // eax
    ! N5 Z. Y# m9 h

  6. ( G0 i  [- n, L0 S( q& c
  7.   v2 = this;" m; l# A% E: s! d; I* X! X
  8.   if ( a2 )
    4 _* r- q; P" b$ G- w; }& l/ F6 b! {
  9.   {3 W. e5 S0 B. h% y
  10.     v3 = *this;* h. w4 l  v& }: z+ j$ O
  11.     if ( a2 != *this )
    ! _, Z* l- c5 h3 d' i# V
  12.     {
    3 R- Z: r/ B. Z8 _
  13.       if ( *a2 )
      {/ r( k) b) m) h5 Y8 \! |, ?
  14.       {2 B2 |* [6 l! c& \& ~
  15.         sub_401030(strlen(a2));/ B2 ^+ f& {/ h9 h2 ~0 L' s
  16.         strcpy(*v2, a2);
    - t2 t0 f. }& ~) Q6 Q
  17.       }0 a3 g: H1 n0 d/ F
  18.       else
    . `+ D8 G. Z8 l6 @2 j) h
  19.       {
    , v) S# a( A) q( I
  20.         this[1] = (char *)1;. G. l* R* q, i
  21.         if ( v3 )
    . E  q6 j( ^0 r  z( Q$ ?, O5 o
  22.           operator delete[](v3);
    : d( N6 \2 ^# R0 s0 q, _- B
  23.         v4 = (char *)operator new(6u);6 b: y0 o# g9 n- Q9 }
  24.         *v2 = v4;
    ! [3 `4 Z% L. I
  25.         *(_DWORD *)v4 = 0;1 `5 G& I. P# l, ?  s  @
  26.       }. J6 ^5 j5 W* Q) X
  27.     }
    " o3 w+ m. A) y; n
  28.   }- d' J  F, C# N0 B7 ?
  29. }
复制代码
# h8 X7 \% i) x* A  I" I2 c, k+ K
汇编代码
3 ^: p  G* W. Q5 }; N4 H
  1. .text:004010F0: i6 i' b5 A, ?" ~! F8 G) x2 Y" Y9 Q
  2. .text:004010F0 ; =============== S U B R O U T I N E =======================================& T/ I: J9 w! P" ]4 r+ D
  3. .text:004010F0
    / M. N0 R0 m3 T+ l
  4. .text:004010F0& I' z* c4 s/ q; C& z2 j& \5 L. ]
  5. .text:004010F0 sub_4010F0      proc near               ; CODE XREF: _main+139↓p
    ! j) z$ n; d. w8 J- @
  6. .text:004010F0                                         ; sub_403240+97E↓p .... v, m" u; |6 q; k# R' M
  7. .text:004010F0
    3 _4 p0 F$ M$ q
  8. .text:004010F0 arg_0           = dword ptr  4
    3 ^1 @, Y- L; X2 X
  9. .text:004010F0
    & v+ \' |( b$ _1 }, ^5 K
  10. .text:004010F0                 mov     eax, [ecx]
    $ o# [7 u# n0 [7 N
  11. .text:004010F2                 test    eax, eax
    1 L% M  l' Y1 ^6 p2 }' X
  12. .text:004010F4                 mov     edx, [esp+arg_0]
    # [) R( N: S6 q' \
  13. .text:004010F8                 jz      short loc_401147
    0 F, O: a& u! B* ?+ }% ]
  14. .text:004010FA                 test    edx, edx2 J6 w( W( e) v
  15. .text:004010FC                 jz      short loc_401147/ w, B3 ?7 O6 j5 P/ D, e$ h# h
  16. .text:004010FE                 mov     cl, [eax]
    + _) z5 \( R; Q1 r$ f5 [9 }
  17. .text:00401100                 test    cl, cl$ {$ N* F! e7 n' S! E
  18. .text:00401102                 jnz     short loc_401116
    0 t/ X# t1 h( f6 e: M( [- B4 a
  19. .text:00401104                 cmp     byte ptr [edx], 0
    - {9 r: [' x0 i  e) `. o5 _; e- [* ~
  20. .text:00401107                 setz    al% l+ @1 G0 M; K$ n
  21. .text:0040110A                 xor     edx, edx
    & b2 Q7 ^5 J* E4 x+ _1 c
  22. .text:0040110C                 test    al, al
    " q& Z* x9 j4 t+ I
  23. .text:0040110E                 setz    dl
    ( e! q, E3 W& e0 {8 Q$ d4 k! W4 F8 _
  24. .text:00401111                 mov     al, dl1 X- g4 F- P9 W* Z( {1 |
  25. .text:00401113                 retn    44 H; r; ?4 E0 {1 \
  26. .text:00401116 ; ---------------------------------------------------------------------------
    9 F' J: p* ~$ `. |2 r2 v8 g
  27. .text:004011167 e4 V% I/ \8 c( S+ O
  28. .text:00401116 loc_401116:                             ; CODE XREF: sub_4010F0+12↑j; P  C; z8 T) Q, \' E; _1 {: j
  29. .text:00401116                 cmp     byte ptr [edx], 0
    # t1 D0 Y( F# e
  30. .text:00401119                 jz      short loc_401147
    , m" }1 R" V- w2 d& R* K
  31. .text:0040111B                 jmp     short loc_401120# _0 X/ Z  I- S' j
  32. .text:0040111B ; ---------------------------------------------------------------------------, `3 r2 p9 K$ |4 w, i! X) q; o5 g
  33. .text:0040111D                 align 10h) E3 E4 x" u7 [$ ?" P
  34. .text:00401120
    ! l7 O+ o9 B# p
  35. .text:00401120 loc_401120:                             ; CODE XREF: sub_4010F0+2B↑j
    - n& D& X) W9 y5 x9 \# [5 k# I+ m
  36. .text:00401120                                         ; sub_4010F0+3B↓j
    ) S! s7 B/ e* ?- Q" q* ?
  37. .text:00401120                 cmp     cl, [edx]7 o% B. N1 w: _* W
  38. .text:00401122                 jnz     short loc_40112D; r  x2 i" {, B8 O. F9 H8 j
  39. .text:00401124                 mov     cl, [eax+1]6 _' M% x/ X- f) K
  40. .text:00401127                 inc     eax
    % {4 x8 _& Z% O6 E. A7 o
  41. .text:00401128                 inc     edx
    ( ^# F5 g1 b' h
  42. .text:00401129                 test    cl, cl* Q3 f% T5 \. b  |, G$ t$ w; h
  43. .text:0040112B                 jnz     short loc_401120
    " {  i; N  T: v
  44. .text:0040112D4 a2 V$ p  U  t6 O+ C8 Q
  45. .text:0040112D loc_40112D:                             ; CODE XREF: sub_4010F0+32↑j7 c  j- Q/ e* K& L8 A( b- g) ?7 B
  46. .text:0040112D                 movzx   eax, byte ptr [eax]
      u4 N+ U  Y2 F. a/ h" y0 o7 Z
  47. .text:00401130                 movzx   ecx, byte ptr [edx]( g, ]7 Q) H4 h  d
  48. .text:00401133                 sub     eax, ecx( G0 r- C) P" F, d3 z; [
  49. .text:00401135                 neg     eax- A% Y* I7 i5 P
  50. .text:00401137                 sbb     al, al
    . F% N) X+ k( g6 @) M( h3 C
  51. .text:00401139                 inc     al
    , |: L( ^5 X# n/ W
  52. .text:0040113B                 xor     edx, edx" f3 W1 z0 e! `6 c! D
  53. .text:0040113D                 test    al, al
    6 X9 I5 |/ t0 r. L$ z% j( }
  54. .text:0040113F                 setz    dl8 S/ J7 Y$ v/ L+ m" h
  55. .text:00401142                 mov     al, dl( \" w+ ?5 K; k1 f1 U( Z
  56. .text:00401144                 retn    4
    : S! t7 Z; \$ G! p) `' m' X  f. S
  57. .text:00401147 ; ---------------------------------------------------------------------------: s' z$ f# P9 Z9 L& f( T
  58. .text:00401147
    9 l0 S( g8 y& |; q
  59. .text:00401147 loc_401147:                             ; CODE XREF: sub_4010F0+8↑j
    1 T2 t7 [$ |. }+ y  A. U
  60. .text:00401147                                         ; sub_4010F0+C↑j ...
    " `" P8 j# C! _
  61. .text:00401147                 xor     al, al
    8 b: a# Z: s/ o: L' L' u7 D8 w
  62. .text:00401149                 xor     edx, edx. t" ~9 ~" m$ _& o! j0 @$ ]
  63. .text:0040114B                 test    al, al
    - o/ W, P. d7 m* y8 g
  64. .text:0040114D                 setz    dl# B' D6 z, C3 e9 R
  65. .text:00401150                 mov     al, dl
    5 z$ D$ G* I* b, |
  66. .text:00401152                 retn    4
    , P. P: n7 d) m& s0 q
  67. .text:00401152 sub_4010F0      endp
    % F+ |3 l& M4 I
  68. .text:00401152
    9 f# H4 q1 t( l7 @
  69. .text:00401152 ; ---------------------------------------------------------------------------0 _% ~0 D( Z0 |3 K, `# A! [
  70. .text:00401155                 align 10h
      S- p! ?" h; P; @- g' b& @' U; d8 d' {
  71. .text:00401160  o3 q& A/ Q$ x2 t+ i( z% s- e
  72. .text:00401160 ; =============== S U B R O U T I N E =======================================; f, f# D) i' W- |: v: _& _- q9 |
  73. .text:00401160) `; g8 k4 [2 {. l- `( t7 h1 J
  74. .text:00401160
    3 d+ d  p, U1 p
  75. .text:00401160 sub_401160      proc near               ; CODE XREF: sub_4013D0+15↓p, m5 d9 G# o, T4 B
  76. .text:00401160                                         ; sub_4013F0+C↓p ...' J; B4 G9 k, \2 z% m6 c' g5 q2 B
  77. .text:00401160+ s% k  L% B) C, P% T5 f/ L
  78. .text:00401160 arg_0           = dword ptr  4
    . m- w2 G! O, L' H
  79. .text:00401160
    0 t, N. o7 p# c4 s9 j7 u
  80. .text:00401160                 push    esi
    ( `0 s5 E# k& b* Z
  81. .text:00401161                 push    edi
    ) g$ \4 m. s7 ~3 ^; B5 n; f
  82. .text:00401162                 mov     edi, [esp+8+arg_0]
    7 O* X$ j; a# H
  83. .text:00401166                 test    edi, edi
    . p1 v+ B" X( L% F5 E* m* O& W
  84. .text:00401168                 mov     esi, ecx
    3 ?! B  y% }, {3 F% D
  85. .text:0040116A                 jz      short loc_4011CA
    8 Y$ o3 b5 ?' S- c
  86. .text:0040116C                 mov     eax, [esi]
    , t; D- t$ d: g1 \
  87. .text:0040116E                 cmp     edi, eax( M2 j5 t9 _0 ~1 n4 v% L
  88. .text:00401170                 jz      short loc_4011CA8 t1 H1 @. ]( P  {+ h! q1 Y
  89. .text:00401172                 cmp     byte ptr [edi], 07 u, t4 i; a6 W, W7 a! U! W
  90. .text:00401175                 jnz     short loc_4011A2
    0 R. ?/ i% b% ?5 f& [4 R
  91. .text:00401177                 test    eax, eax. a  B8 K7 |7 s0 S* j
  92. .text:00401179                 mov     dword ptr [esi+4], 1
    ' W! z/ o5 H4 X1 B# m) Q  X
  93. .text:00401180                 jz      short loc_40118B. H$ c, _, B. s5 D9 Z+ b& R; ~0 V
  94. .text:00401182                 push    eax             ; void */ J. D: Q: H8 R4 f
  95. .text:00401183                 call    ??_V@YAXPAX@Z   ; operator delete[](void *)
    5 a- I6 _- a0 [
  96. .text:00401188                 add     esp, 46 ^- \" y6 L- D+ b0 C0 G/ c
  97. .text:0040118B$ Y0 Y; p% i; Z5 ^& R% J
  98. .text:0040118B loc_40118B:                             ; CODE XREF: sub_401160+20↑j* g- J9 I4 u+ `
  99. .text:0040118B                 push    6               ; Size2 t; l9 }7 g& |
  100. .text:0040118D                 call    j_??2@YAPAXI@Z  ; operator new(uint)
    6 P" T* ~% l3 l" d5 L; Q
  101. .text:00401192                 add     esp, 49 j6 M1 B4 J; m: u% x( s: k
  102. .text:00401195                 mov     [esi], eax3 y" N) y' D' |( ?& G9 c
  103. .text:00401197                 pop     edi
    % Z2 W& }! Y) }% m
  104. .text:00401198                 mov     dword ptr [eax], 0, c. I. `) ?/ H& }
  105. .text:0040119E                 pop     esi3 D) r" ]" M+ y5 F+ n: o
  106. .text:0040119F                 retn    4
    6 A0 Z1 F) w0 ]( Z
  107. .text:004011A2 ; ---------------------------------------------------------------------------: S, t2 \) B  M/ e$ O& g% t
  108. .text:004011A2- F( `9 o7 m7 ^7 G3 H
  109. .text:004011A2 loc_4011A2:                             ; CODE XREF: sub_401160+15↑j4 o. D  l* z8 `
  110. .text:004011A2                 mov     eax, edi
    + J/ q+ N# Q% l( B+ ~( }3 q
  111. .text:004011A4                 lea     edx, [eax+1]
    ) [. G4 y8 v: Q$ X0 M
  112. .text:004011A7( ?2 O1 a  W3 D$ Z4 {
  113. .text:004011A7 loc_4011A7:                             ; CODE XREF: sub_401160+4C↓j
    - ?0 m/ \7 w3 z& c
  114. .text:004011A7                 mov     cl, [eax]5 g9 g  }3 P3 A6 ?8 i/ R
  115. .text:004011A9                 inc     eax: J* d- x3 `) u% T6 v$ R; [
  116. .text:004011AA                 test    cl, cl7 N1 r; p+ }$ N. J" s5 E1 ^7 @
  117. .text:004011AC                 jnz     short loc_4011A78 T3 `! h6 ^4 A' [2 [
  118. .text:004011AE                 sub     eax, edx
    & I1 {6 i$ u7 |; d* T
  119. .text:004011B0                 push    eax
    9 V  K  Q6 x6 \) M/ ]% h) h' K3 L
  120. .text:004011B1                 mov     ecx, esi) C6 Q' s1 C/ N6 |. D% u1 z
  121. .text:004011B3                 call    sub_401030
    8 ]( f  x; _, F; V5 q9 K& m) E
  122. .text:004011B8                 mov     edx, [esi]
    9 ?% w" E. k- J; b( Z
  123. .text:004011BA                 mov     ecx, edi2 F/ c1 D6 L% F( r9 s# }. Z
  124. .text:004011BC                 lea     esp, [esp+0]
    ! ]' [& H9 ?1 O9 I. I4 k
  125. .text:004011C07 ^2 R4 G6 e1 v4 r( V2 p" }/ _
  126. .text:004011C0 loc_4011C0:                             ; CODE XREF: sub_401160+68↓j
    ) v1 I* `1 r3 x# A2 N  y9 C
  127. .text:004011C0                 mov     al, [ecx]
    5 O7 j8 z( l4 |& x6 X6 I
  128. .text:004011C2                 inc     ecx) P5 H" U4 V% H
  129. .text:004011C3                 mov     [edx], al0 F1 i" |( {* u  E$ p
  130. .text:004011C5                 inc     edx5 J" \% d6 ?; }& C5 \5 B. p
  131. .text:004011C6                 test    al, al9 s: c3 A1 ]1 }7 \: Z7 w
  132. .text:004011C8                 jnz     short loc_4011C0
    , e) Q+ _& C3 W+ i. R/ L
  133. .text:004011CA
    ( H- d% O' B8 c5 H
  134. .text:004011CA loc_4011CA:                             ; CODE XREF: sub_401160+A↑j
    1 k' F1 c+ F7 }' y+ }
  135. .text:004011CA                                         ; sub_401160+10↑j
    - X# K' d3 h; X" t' V% p0 X  g' W
  136. .text:004011CA                 pop     edi
    4 K- M$ s! {/ Q+ ]6 X
  137. .text:004011CB                 pop     esi, f* g% p$ s$ E' @
  138. .text:004011CC                 retn    4
    $ k+ Z0 F1 ?( ^, A2 D% V
  139. .text:004011CC sub_401160      endp* W; V4 M/ `6 [- e- a* e/ D
  140. .text:004011CC
    9 u& i; N4 R3 T+ E7 M! h! a9 O6 b
  141. .text:004011CC ; ---------------------------------------------------------------------------
复制代码

' O5 Z: w) M* r$ c6 b
' E; E% {5 q; x' c7 S0 Y9 H% D( ?  B
分享到:  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日,是全球华人共同的冒险解谜类游戏家园。我们致力于提供各类冒险游戏资讯供大家学习交流。本站所有资源均不用于商业用途。

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