本帖最后由 shane007 于 2023-8-27 13:23 编辑 4 [1 A1 k7 v2 L1 V
$ b* }( Z+ `5 T
本游戏采用了CEGUI,该组件能采用directx和opengl。8 P1 e6 B% f# W
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。( C5 _/ E7 A2 E6 U* |! I
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
2 s$ M; J; S( D2 c(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
: m( c. a1 U6 \. b& l
5 V: v# n0 s5 V ]! `
5 o: M; s C" A/ r在游戏中找一个字幕,在以下地方断下。' U5 U, o, i- ]4 o. j, a. G- T
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
# G2 ^+ S+ B7 K* X% A3 ~! a3 ?2 P因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。# Q; X* {' G' r2 x% L3 j5 G4 C
v! D! l3 L3 l
- NextLife.exe+11C5 - 42 - inc edx
7 p \+ X; x$ s* t: K" k6 o0 \- e - 004011C5
复制代码
1 y) p- ~" Z" s) p
! j( W3 S+ t% E a F+ D该地方的伪代码* L$ j, k9 F8 q
- void __thiscall sub_401160(char **this, const char *a2)
: F" k8 @, z! n - {
( F: x$ [( [. N p( N - char **v2; // esi
1 j1 i* z- F+ r; d - char *v3; // eax
. o0 x3 [! j) J9 D/ | - char *v4; // eax
! C) w8 h8 f5 x0 K, `4 K
5 l0 Q2 I2 x$ Y5 u, y4 J- v2 = this;% M/ V$ p1 C; Q t" y* w
- if ( a2 )
$ _6 o" c' x( o/ N R o9 o- T - {3 h5 H) M/ Z: c, Y: @$ K* h5 P& b& Z
- v3 = *this;: h2 B9 | T7 s+ D
- if ( a2 != *this )
; k. c# A: w+ u! l - {' h+ A- j" f2 T) a$ i% F- Q
- if ( *a2 )
: l. G0 E) L2 |( U8 A# f - {
/ J; q# }3 ], F5 O% Y6 w% ~ - sub_401030(strlen(a2));
9 r' m. V3 h! ?% V- I# u - strcpy(*v2, a2);
7 _& @8 E* Y& g3 n - }
$ M/ I& G A2 p: {) m! b/ v( @" P - else9 |) o h4 [) b5 k- v: ~ |7 K7 {7 s5 x
- {
& n: M! r& c6 p' ^ - this[1] = (char *)1;# s2 b# t" c8 O9 {2 w9 \0 e1 u" v
- if ( v3 )
, r S7 p- u* l1 D9 \' r' F - operator delete[](v3);
& I. m* |9 a: W! b4 v - v4 = (char *)operator new(6u);% X6 P# ?5 o$ F: c
- *v2 = v4;
; D; {+ D: Z* N g j. k/ Q! T& T% N - *(_DWORD *)v4 = 0;
% t, @- }! m# b `0 p4 f - }
- b) F S- h; U: ^* {' E* X - }
1 m/ V6 ^3 t) o" c - }
* |/ F4 f. [/ l3 W6 T - }
复制代码
& Z; K% W* u! O% K: }' i* I9 q汇编代码) H4 H6 }3 m1 d d1 r; d* Y7 k9 j
- .text:004010F0
% T7 R( E) ^- ]7 P+ p, ? - .text:004010F0 ; =============== S U B R O U T I N E =======================================6 J0 N- y& N. Q. `. Z( A
- .text:004010F0
) z6 Y1 k( Q9 R2 ]$ K - .text:004010F0
" T6 G. B4 c2 ?( w8 J2 _4 f - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p: p& o8 P7 G9 O% R: I
- .text:004010F0 ; sub_403240+97E↓p ...
: q X2 a% W. V8 W - .text:004010F0" h' ?/ L! L2 Z0 T3 z% p' _
- .text:004010F0 arg_0 = dword ptr 4
( u, X1 t- i1 U3 `8 d - .text:004010F0
8 m4 f" v' J6 k2 L5 d% u. M - .text:004010F0 mov eax, [ecx]
~0 l; x, q& g - .text:004010F2 test eax, eax
4 |! F+ a0 e# z8 s3 m+ J6 V - .text:004010F4 mov edx, [esp+arg_0]
2 n6 W# c* C$ \- l5 k - .text:004010F8 jz short loc_401147
: E9 }" p5 i7 h$ V# I - .text:004010FA test edx, edx
" u$ R Y3 g$ n3 |0 C/ ~* V - .text:004010FC jz short loc_401147
' X# f9 P- G% a- A( Z& Y7 J/ f( ? - .text:004010FE mov cl, [eax]
1 w& \: H) v4 d! o - .text:00401100 test cl, cl; c$ \2 o# o% t& l
- .text:00401102 jnz short loc_4011165 f. [" y8 A4 p {: E2 u8 y
- .text:00401104 cmp byte ptr [edx], 0
- e% x% J. a6 P( j( ^9 E6 G# v - .text:00401107 setz al
( x2 |, X) t( b - .text:0040110A xor edx, edx |$ {1 m+ c7 |5 e+ m8 r& U
- .text:0040110C test al, al9 e# E/ a& c. v" g7 o
- .text:0040110E setz dl7 P4 q6 I% @) M; ]4 K
- .text:00401111 mov al, dl- z: k9 H$ n5 g5 O
- .text:00401113 retn 46 i. W9 d0 b$ m8 b# a4 u
- .text:00401116 ; ---------------------------------------------------------------------------
+ b! h! T8 A: g - .text:00401116
/ [& C# \: J, k9 f - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
7 d# m! o0 |4 V6 ~ - .text:00401116 cmp byte ptr [edx], 0# T, q( A; L" U" R
- .text:00401119 jz short loc_4011470 s5 C3 H5 e& R6 S. _
- .text:0040111B jmp short loc_401120
2 G3 I8 \8 H7 V4 G% p - .text:0040111B ; ---------------------------------------------------------------------------
; d1 P+ Y" E5 ~: V) }, n2 C - .text:0040111D align 10h" g1 ^3 B, c9 T8 T! L
- .text:00401120) P' z, R5 F# \' `/ V
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
, |& A/ l! }) h( T+ B - .text:00401120 ; sub_4010F0+3B↓j3 N3 z( R f1 R7 }
- .text:00401120 cmp cl, [edx]3 g" e1 y, X$ j
- .text:00401122 jnz short loc_40112D
7 {. x0 N. n6 \1 k9 t0 @1 G n - .text:00401124 mov cl, [eax+1]
+ l+ e/ K9 a$ }: V) G+ P; d - .text:00401127 inc eax! J) b4 c6 E4 v5 [" X h5 j0 b% Z
- .text:00401128 inc edx* ^" q( U9 b0 b
- .text:00401129 test cl, cl& ^# w c$ ?7 ] U! c. x+ R0 i/ p+ J
- .text:0040112B jnz short loc_401120
( V$ M; A2 V# E - .text:0040112D3 z' @% e( A# q1 A5 _8 w
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
! S: P3 q0 q7 U% F2 j - .text:0040112D movzx eax, byte ptr [eax]
# V0 p5 b8 j- D0 m - .text:00401130 movzx ecx, byte ptr [edx]7 s2 W5 J: g3 n5 D
- .text:00401133 sub eax, ecx7 {2 G/ v7 G& \8 J. Q
- .text:00401135 neg eax
( b# F4 D0 c; f - .text:00401137 sbb al, al, Q& P" ?, r5 t% c3 y
- .text:00401139 inc al
0 q, \7 M! G5 G, l* N( m - .text:0040113B xor edx, edx4 O( m8 x3 q9 `' R$ C7 k. q
- .text:0040113D test al, al% a( _5 i6 o( F# j% S5 C$ q7 U6 q
- .text:0040113F setz dl
- w" L' y* A" l. t0 |) F; [4 { - .text:00401142 mov al, dl
3 L$ ?& e% E1 w% t2 Z+ J3 f/ X0 Q - .text:00401144 retn 4' Q# [! ^5 g# r8 m( Y# q8 m
- .text:00401147 ; ---------------------------------------------------------------------------
+ A7 ?( H! M) S/ b/ x! R5 Q: [ - .text:004011475 i f( C/ K2 M" O
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
- i2 W$ d0 u# t7 [0 o - .text:00401147 ; sub_4010F0+C↑j ...
* X8 w: D" x8 i& g+ T - .text:00401147 xor al, al
0 \' s: S4 C& m* i1 S5 A" @ - .text:00401149 xor edx, edx
, k' F1 N- Q f& ]7 J2 G5 ~ - .text:0040114B test al, al
. y3 u5 J) N% v7 W) t2 q4 \ - .text:0040114D setz dl
9 P) k" {$ f5 Y, X2 U: ~1 j - .text:00401150 mov al, dl
# L% R9 ~+ C. @: `# | - .text:00401152 retn 4
' Y. V# r+ ?; w1 P - .text:00401152 sub_4010F0 endp& D% d0 m$ a8 Z! O
- .text:00401152( g% s( i" I: d, n0 `' ^! F/ y
- .text:00401152 ; ---------------------------------------------------------------------------4 O) k) _2 \! _5 _
- .text:00401155 align 10h) U0 m- L, S! ~. N3 X/ s# n1 O
- .text:00401160
7 x# Z4 c# `; t/ p6 I - .text:00401160 ; =============== S U B R O U T I N E =======================================" H8 ]' F# O/ L* ~1 L W& T; q
- .text:00401160
. p" K, l+ L) f7 ?" R - .text:004011602 @. O0 X }6 ^8 T5 P
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p' P2 \6 P' a1 h9 E
- .text:00401160 ; sub_4013F0+C↓p ...
@* G; x) y8 j. Z8 _3 M8 ?, J - .text:00401160# @9 k3 h1 k" e# |6 n1 ~6 w
- .text:00401160 arg_0 = dword ptr 4; @3 Z3 C4 ^6 d5 t' J& ^3 y
- .text:004011607 r1 g, N; o3 E/ b9 C' P6 c6 D
- .text:00401160 push esi. \6 h! I8 f+ ^& b4 [8 x
- .text:00401161 push edi
( f' Y' _6 H# m% q: K# S - .text:00401162 mov edi, [esp+8+arg_0]
& g8 r) s1 \9 r X* t; e6 L - .text:00401166 test edi, edi
; B7 |" V( j7 Y, H7 { - .text:00401168 mov esi, ecx
`1 o& a/ p) z/ W6 P1 y - .text:0040116A jz short loc_4011CA
( K) o: W5 A/ x. s5 e' z) f6 z - .text:0040116C mov eax, [esi], a( g) A5 H6 O% `3 J
- .text:0040116E cmp edi, eax
( z! \) C3 d& b& p, \ - .text:00401170 jz short loc_4011CA g! O: u0 H$ h1 O# T& d
- .text:00401172 cmp byte ptr [edi], 0
8 ]2 R. ?7 u, @0 @, a9 B) K9 U - .text:00401175 jnz short loc_4011A2
7 J' k9 T$ u) `' w - .text:00401177 test eax, eax
- b5 g2 v0 Z7 s; I q, E. r3 x4 u - .text:00401179 mov dword ptr [esi+4], 1
: s$ ?: _9 Y& ~) u+ p - .text:00401180 jz short loc_40118B
. i4 R. |. U; i2 x, M5 Y - .text:00401182 push eax ; void *
0 z7 L+ Z) L+ R" {2 H - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
& b& V$ Z" M1 _ - .text:00401188 add esp, 4: S! e) I1 U9 ~! ~$ H9 d* Y/ P
- .text:0040118B
* p5 o% K7 M: m1 H: O$ t - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j0 d5 ]5 ` R& D+ i/ u9 H1 L! Q5 V: v
- .text:0040118B push 6 ; Size/ h7 e4 x% x P+ X: p# ?) n% g
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)3 K0 B, q8 b& U% l% U9 C, E
- .text:00401192 add esp, 4# q. o8 U9 ] }: N( |1 @0 {8 h
- .text:00401195 mov [esi], eax
5 D. c: v8 c3 R7 I) z - .text:00401197 pop edi
3 H0 c( b: a2 U0 l- y - .text:00401198 mov dword ptr [eax], 0
3 U {# P. C( f7 q - .text:0040119E pop esi
6 T3 e$ O7 g ~1 i" l6 {/ g - .text:0040119F retn 4
7 X8 `$ M& i! D - .text:004011A2 ; ---------------------------------------------------------------------------
+ d0 d' z/ N- o4 V% _ - .text:004011A2% i2 I* j, P% ]
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j! Z" x, O# `$ P8 s
- .text:004011A2 mov eax, edi
, ]) B! {2 r! l; P1 B5 A - .text:004011A4 lea edx, [eax+1]
( v: s1 `) ?( B( A; p9 F - .text:004011A7 P& y+ `+ @) k7 |. {, o0 W8 M! g
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j; B+ v. o# x9 H3 w
- .text:004011A7 mov cl, [eax]9 m: {% }( {5 ^1 q8 q6 j; e
- .text:004011A9 inc eax
) S* G& S7 N) p5 e/ H* s% T2 ]3 ? - .text:004011AA test cl, cl3 \+ S% s: W2 Q0 o4 q2 d, }
- .text:004011AC jnz short loc_4011A7# f' v9 W0 j' ^* X
- .text:004011AE sub eax, edx1 |$ O9 o! S, w1 r# @* Y
- .text:004011B0 push eax
+ l% i0 _; f2 j+ ]6 R+ `9 P/ G - .text:004011B1 mov ecx, esi
& M! x( O% d7 {$ r: p3 I( p - .text:004011B3 call sub_4010302 N5 @ _+ p5 J# ^( `& ^
- .text:004011B8 mov edx, [esi]1 g6 W. b& Y2 _. f8 P% z
- .text:004011BA mov ecx, edi2 T1 s+ ?# c7 W, T
- .text:004011BC lea esp, [esp+0]
1 s6 S+ Z" R+ o. M7 G - .text:004011C0
9 e& A5 g P: ?( n - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
: I! {! @$ G& R, H - .text:004011C0 mov al, [ecx]3 x& a( w8 [, k- ~1 E
- .text:004011C2 inc ecx- f6 ]" c3 w. q9 f4 N" S m u
- .text:004011C3 mov [edx], al2 M- d5 q( F* J3 ~5 w) Z
- .text:004011C5 inc edx
1 i) ^) v/ u2 d/ F* |9 J& u - .text:004011C6 test al, al9 F3 S7 A1 b) f" g; w' F
- .text:004011C8 jnz short loc_4011C0
; Z2 q% X( n! W* ]( W4 [! s8 w - .text:004011CA
: @: d8 C8 {* W4 D4 i' f" _ - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j7 L: E- x. F1 A% |9 m4 J
- .text:004011CA ; sub_401160+10↑j* a8 z: Q( o+ M' [ s; x% U
- .text:004011CA pop edi
9 _3 J& T0 o, h& Y - .text:004011CB pop esi
9 y4 N# R+ d* H - .text:004011CC retn 4
( Q6 F* n1 J) ?! E6 k E - .text:004011CC sub_401160 endp
& K8 d. e8 X7 W* K3 f- \! [2 O - .text:004011CC. W6 R7 X7 ~/ S! L( {
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
# |" M+ c0 f% Q3 r7 Y$ c
' t8 X/ u7 t8 ?7 ~+ |" A! l# ]' N3 c+ L3 \7 E v. D2 v" y& ]
|