本帖最后由 shane007 于 2023-8-27 13:23 编辑
: d# d. D( q: K& `: F* u* D0 o; B" I4 I* w6 s* D! k' X) w
本游戏采用了CEGUI,该组件能采用directx和opengl。
' n1 J" t) L( J, w经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。3 u. E" M) u0 H+ W" \9 q5 r
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。- E7 V4 K3 K( R7 X3 I
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
" y {0 K" t1 V3 {( N l; o, g9 d% p6 ?8 |* B
0 z& ]: X( _, E* u& C8 p在游戏中找一个字幕,在以下地方断下。( S7 s7 [: b! Y f* Q: ] [9 Y
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
/ X! V! L2 x6 N因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。2 G* \. K. R" M( U) ]
8 {6 N2 C# d9 _/ S- NextLife.exe+11C5 - 42 - inc edx
5 K4 K6 @+ f: z- s. n2 \( N! ], _) | - 004011C5
复制代码 ! Z) S+ d' C/ A0 c5 a; O
# r- |, y* p& `4 C6 o/ t# N
该地方的伪代码
( [+ q1 g6 q" O, P4 N$ `- void __thiscall sub_401160(char **this, const char *a2)
: f/ l3 Z2 R& W7 m) u7 J9 B: G- U - {
4 G u* l4 M; D: q0 t2 B - char **v2; // esi- D, \8 X. U, @4 L( G5 T
- char *v3; // eax
J& E; r, _2 I% m- k - char *v4; // eax2 }$ C Z: C% t6 J' M- l
- w$ h+ f/ U2 N7 f$ b7 ~
- v2 = this;* w4 U& C) w) g1 C6 t/ T; V
- if ( a2 )* ]* ?4 b# U, m2 [) i3 Y
- {- R5 w; D6 m; I' G3 m
- v3 = *this;9 c) N" t% Z$ y. m; v P
- if ( a2 != *this ): z- T F: R6 V. ^2 D' S5 Z3 f! T9 i
- {
: j% `; h& W' H" B - if ( *a2 )
6 Q9 I4 i& E. g' L - {
6 z7 ]. b; n( H& K/ a" r( l - sub_401030(strlen(a2));
& g, S' K4 M, }3 F% T - strcpy(*v2, a2);. h/ U8 R( P: L
- }
. ? l* W* T* u+ M& y1 K; F - else7 ~0 Z: N$ d( u! l! G g
- {$ ^ t8 Z7 z' d7 `# i
- this[1] = (char *)1;
O" A) U- ?" Y/ | - if ( v3 )
; O" P6 U I2 G) ? B p9 `. v - operator delete[](v3);
( J4 Y6 C% \/ t& Z1 H% S; B - v4 = (char *)operator new(6u);
$ B: b5 }1 o( }' N! M - *v2 = v4;4 H3 ^9 z; V% ^% J$ r/ ^& _
- *(_DWORD *)v4 = 0;
) E% k( E8 ?2 U - }) F4 W; S8 ~6 |! ~! Z# z" b+ \5 H& I" `
- }7 |2 x0 K5 H2 s; f0 Z
- }
: i1 D. L9 k, A$ ` - }
复制代码 " O7 K0 K$ H- m7 l
汇编代码
- a0 G0 v( B+ L; D- .text:004010F0
3 B% j" w6 `3 [, K) k) [* Y - .text:004010F0 ; =============== S U B R O U T I N E =======================================& N/ Q; ~5 t3 ]$ m9 b
- .text:004010F0
. J) U* v* C) ~3 F% R/ k1 V$ g9 F - .text:004010F07 t* e3 b( a: Q" f P' b
- .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p2 x$ k: @+ N8 J3 I k
- .text:004010F0 ; sub_403240+97E↓p ..., G* b& J9 h ~1 k
- .text:004010F0
% R4 ]9 k j9 z* Q: y( r$ U- K - .text:004010F0 arg_0 = dword ptr 48 y& N( w7 F& s* O+ j
- .text:004010F0
* i9 F6 r1 f# W# S# O - .text:004010F0 mov eax, [ecx]
$ \6 q( d' t* g% @! n) s - .text:004010F2 test eax, eax; F: _8 j4 G& d$ `2 Q5 Q8 g
- .text:004010F4 mov edx, [esp+arg_0]
3 X* K( M! r0 e) W; t0 |$ y - .text:004010F8 jz short loc_4011477 [, ?; h& _& H0 i# |3 b% K+ F
- .text:004010FA test edx, edx5 b( ?- B# M- ~/ r
- .text:004010FC jz short loc_401147 c+ |$ v( o9 y- _! }9 f( m
- .text:004010FE mov cl, [eax]
3 K$ i) C' e! ? - .text:00401100 test cl, cl
0 R& R" I% `2 O - .text:00401102 jnz short loc_401116! w# X4 B. j8 t R4 K5 g
- .text:00401104 cmp byte ptr [edx], 0
+ ~: J: v( F! N, [ - .text:00401107 setz al; f) V7 { |& J' [
- .text:0040110A xor edx, edx
o( C# @) _/ G+ ^2 X% O - .text:0040110C test al, al
8 a; e' C2 ]" l8 k - .text:0040110E setz dl- V1 C1 J5 m- g) Q& g
- .text:00401111 mov al, dl
) d. w! s2 f$ R! v - .text:00401113 retn 4
: ]" M5 x n! y E; E - .text:00401116 ; ---------------------------------------------------------------------------6 \% S0 `( O3 J% l m
- .text:00401116( H4 ^6 T* f1 K4 B8 r$ Y( a
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
& q/ ^9 v! K7 L1 W/ f1 {$ J* ] - .text:00401116 cmp byte ptr [edx], 0& T1 R8 k* @ _2 h2 s
- .text:00401119 jz short loc_401147; F% ?* T! l, h) ~* ~* r
- .text:0040111B jmp short loc_401120; w" c- c: }: Q
- .text:0040111B ; ---------------------------------------------------------------------------5 W3 C; B5 E9 a3 ~# z; f
- .text:0040111D align 10h1 p- m, R" U3 E- ^, c! N& n5 m
- .text:004011206 W5 B: `) p" s) y5 ]: q4 B
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
" `2 L% _1 \, b; T - .text:00401120 ; sub_4010F0+3B↓j
& e t' I# p% L" {4 j1 ~+ L - .text:00401120 cmp cl, [edx]
0 ~8 {7 F! ?9 B( X; }; y3 b9 R( p9 b - .text:00401122 jnz short loc_40112D
# t: X1 ^; w- W& y# v - .text:00401124 mov cl, [eax+1]
1 ]5 A' O" I/ q9 f: \ - .text:00401127 inc eax6 ]# T1 w7 h& ] H
- .text:00401128 inc edx+ w) ~. z4 Y0 S8 ^. c
- .text:00401129 test cl, cl7 D' w2 r: `5 f5 U$ U9 \* I; Z
- .text:0040112B jnz short loc_401120
9 k7 X6 l$ j0 L& o& C( F' c, A) b - .text:0040112D" ]5 s4 I) v! ^; M5 N+ e
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
4 U$ B3 X# A, B4 J. f7 b - .text:0040112D movzx eax, byte ptr [eax]
h9 _' W: l& R5 s* c4 V - .text:00401130 movzx ecx, byte ptr [edx]7 }& K) D" Q( n; c& F- g: n5 y2 D
- .text:00401133 sub eax, ecx
9 p& I4 l+ n7 Z# C" Z, X - .text:00401135 neg eax
, T7 L( a9 E- n) _! `& P) q - .text:00401137 sbb al, al
. ?! D# h. W$ s# S/ j - .text:00401139 inc al
# `4 L& b" n N8 H - .text:0040113B xor edx, edx' S) X/ k5 g c7 Y3 t& Y9 v+ |; |
- .text:0040113D test al, al
, M' P8 q. w( x' Z; R& Q( ] - .text:0040113F setz dl
, d& F: I- |8 j9 Z - .text:00401142 mov al, dl
$ B4 {) D1 [& D& k& t. @ - .text:00401144 retn 4 e( B7 _' H* i6 N- P: N
- .text:00401147 ; ---------------------------------------------------------------------------
% h6 G+ a; Q! @7 N1 ~7 s4 H - .text:00401147
2 G7 [% H5 V/ S, _ - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j/ K% V4 P$ |7 E6 J
- .text:00401147 ; sub_4010F0+C↑j ...
@$ N: `) ^: Q: L0 @9 k) |$ ~ - .text:00401147 xor al, al
( a2 A( a8 `' |* b* J - .text:00401149 xor edx, edx
& I# v& C! k$ d0 V3 u4 Y& w, t7 b6 J - .text:0040114B test al, al2 A& K" p ^9 ]9 D& @1 {! O: D9 i
- .text:0040114D setz dl
& e9 L' v A" b# w3 x - .text:00401150 mov al, dl
$ u% D4 @9 [1 Z - .text:00401152 retn 40 o2 n8 A7 s+ G+ w; K# D
- .text:00401152 sub_4010F0 endp& q* _ y) ? ?+ G: n% ~
- .text:00401152
% R. [5 E8 O+ A# X - .text:00401152 ; ---------------------------------------------------------------------------5 f! `; s# F m! o7 `! t
- .text:00401155 align 10h
8 \) U# A2 Q, c0 Q2 G7 X - .text:00401160
! ^! S# _* g6 Y - .text:00401160 ; =============== S U B R O U T I N E =======================================) g( k) n! u4 V+ b7 T, {0 u
- .text:00401160
. I) |. @& O/ a0 z - .text:00401160& L) ^$ h, o. J/ Z# J/ E
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p: C) R" O& n" @
- .text:00401160 ; sub_4013F0+C↓p ...; B7 Y9 T/ Z/ g! \5 e
- .text:00401160
5 [ i/ T+ j' G2 |% R( D& j r - .text:00401160 arg_0 = dword ptr 4
0 r D8 @# E# W. m: v - .text:00401160
0 X2 A7 n" ~4 m# } - .text:00401160 push esi
$ w3 `$ n% l- q: S - .text:00401161 push edi
+ f7 [5 I* o. |. x - .text:00401162 mov edi, [esp+8+arg_0]! Z/ q5 {1 d0 ?, e5 C5 B
- .text:00401166 test edi, edi: Z. B; c! O1 z6 [
- .text:00401168 mov esi, ecx! {4 a, r; O/ X" N% X' w4 x* S
- .text:0040116A jz short loc_4011CA2 E0 L% V5 j$ D4 r& G8 [ @8 W
- .text:0040116C mov eax, [esi]
" u9 J# n. R' c - .text:0040116E cmp edi, eax1 j9 e4 ?8 Z# B
- .text:00401170 jz short loc_4011CA, i: w+ x: q) ^( Q( B: K, D% s$ ]
- .text:00401172 cmp byte ptr [edi], 0
' T# W: z. I; N% B' C: e - .text:00401175 jnz short loc_4011A21 L2 Z. G$ T5 ~ e5 ?4 N
- .text:00401177 test eax, eax
8 _, ~1 ~" y' \: ^ - .text:00401179 mov dword ptr [esi+4], 1/ K/ E' o9 r( l
- .text:00401180 jz short loc_40118B- V( Z3 p' N* L7 B4 Z! ] S
- .text:00401182 push eax ; void *
; }; F7 P$ W2 z+ z5 { - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)* m* B$ `$ D+ U% t
- .text:00401188 add esp, 4) G' g. ?: Y% j0 I* O! V
- .text:0040118B7 B, P1 V/ j5 g
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j. A7 I7 M& ?' {- w0 c
- .text:0040118B push 6 ; Size# L2 w' \& O+ [4 z
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
" P9 @6 B, X9 n1 u& ? - .text:00401192 add esp, 4
8 S8 D6 z% W# I - .text:00401195 mov [esi], eax
6 I% g$ {2 Y! ]9 d - .text:00401197 pop edi5 Q( D- T b: E( x
- .text:00401198 mov dword ptr [eax], 0
. n$ M) o) }$ \( F - .text:0040119E pop esi- {7 x1 w- W C, d
- .text:0040119F retn 4
9 y9 W' |$ K" z - .text:004011A2 ; ---------------------------------------------------------------------------
2 D; Y0 P4 X" g, l - .text:004011A23 W5 \8 b; J) {- [" G3 Z( b+ K
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j6 R- O8 y+ r0 T0 R& f
- .text:004011A2 mov eax, edi( Q9 [: ?! x" D- q$ z' g
- .text:004011A4 lea edx, [eax+1]
8 O$ ]/ V7 e: `$ U1 B0 D - .text:004011A7
* t8 _6 d: r6 f) x - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
; d" I- u* g: U5 T1 B4 M+ q+ O - .text:004011A7 mov cl, [eax]( k6 G; V7 i/ B- |
- .text:004011A9 inc eax L1 f" Y: a, z {
- .text:004011AA test cl, cl
0 D7 s" r- A# q/ k. T2 A7 v - .text:004011AC jnz short loc_4011A73 p( ~* o3 d/ E& C
- .text:004011AE sub eax, edx0 [: D5 S8 g( L! r
- .text:004011B0 push eax6 m& X1 J# O/ q4 l, F( g
- .text:004011B1 mov ecx, esi
J- I0 Z- C0 t4 h: p W$ ~. ]( R - .text:004011B3 call sub_401030
/ R/ _2 {* k1 D - .text:004011B8 mov edx, [esi]+ J* o% v, s/ L0 I" ]
- .text:004011BA mov ecx, edi6 n0 j- F2 f) I) E* h, a
- .text:004011BC lea esp, [esp+0]
( B: B7 [+ C3 Z. i! X1 o - .text:004011C0
, l8 E" t q6 W' { - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
+ r4 ~' z1 ~* v# b+ \ - .text:004011C0 mov al, [ecx], h9 F/ j, k$ a' f$ P u
- .text:004011C2 inc ecx
/ a$ b; O$ r. C( [; q; Q: h0 D - .text:004011C3 mov [edx], al0 h& V) a3 |" C+ `
- .text:004011C5 inc edx, d: h) C3 Z3 R5 ~+ G. }6 j) x
- .text:004011C6 test al, al
- f$ N* R& N8 }0 ~- h7 N* K( M$ d - .text:004011C8 jnz short loc_4011C0+ d5 g) v4 Z+ ^# d, Q
- .text:004011CA
( W4 d" j+ N, X5 r/ H* j4 S - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j; R8 ~4 ~: j5 S% z7 e
- .text:004011CA ; sub_401160+10↑j, S$ }+ w" |7 |9 [
- .text:004011CA pop edi
9 `: C* u: G1 u! s* L' c- c2 v - .text:004011CB pop esi) V. X# T+ |, }2 }$ R/ }7 `
- .text:004011CC retn 4
1 s* x' y9 _6 k" M$ D; ~! t - .text:004011CC sub_401160 endp
! O+ _9 q" ^$ M( E5 ]6 C* a - .text:004011CC
3 e4 c5 d [# k. A) y) I - .text:004011CC ; ---------------------------------------------------------------------------
复制代码
. R* z; d( M) x3 U
& E4 X2 D+ h/ I, [; Z" w5 s4 U* z- q+ w$ K/ o# o
|