本帖最后由 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- NextLife.exe+11C5 - 42 - inc edx
! ?$ C2 `0 p2 v" K$ r. g; T$ y - 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
- void __thiscall sub_401160(char **this, const char *a2)" I# ^4 B8 n9 R% W+ f3 H9 B7 {7 L
- {
) ?& |" S- Z) g7 ~9 Y0 \- m& v - char **v2; // esi
/ [1 b7 d' h9 u/ x' e% ^" b - char *v3; // eax
0 M3 a+ ?, D$ i4 f8 M - char *v4; // eax
% e) z% J2 q$ D; L - 5 _4 `. ]; F# V) `
- v2 = this;3 `3 b* a$ Q/ d0 I
- if ( a2 )
: T/ Z- J3 d# _ - {
; l7 m* G: P) i1 f6 L - v3 = *this;4 c# U3 s7 @$ t- z% f" a+ q; X) \
- if ( a2 != *this )
) L- E; s/ \5 l4 s% a8 X8 [ - {6 p, q7 c4 u- C) e) K
- if ( *a2 )
+ m" Q# @! N, j2 @8 g: r - {
; X7 \" @9 Y8 J, @: k5 j. K1 q& W - sub_401030(strlen(a2));; I2 ~( ]& [' v4 i# L1 r
- strcpy(*v2, a2);2 V5 X4 B/ n( v& ^
- }
: J- h0 M" n3 R1 g1 i0 i - else
8 k- ]; r7 W, S9 @9 H - {3 M% O, o1 X0 A/ \3 |
- this[1] = (char *)1;
5 K& j9 Q) U, `9 I - if ( v3 )
+ A8 H; e( ?, v - operator delete[](v3);
1 S& p2 Z4 J4 L$ P! E' i! ` - v4 = (char *)operator new(6u);# Y2 e, }8 E: O1 o- ^: o3 l& Y# @
- *v2 = v4;6 s+ X: j+ ` P4 k; x$ u! Y
- *(_DWORD *)v4 = 0;0 L* N( Q/ A* g
- }
' U p8 y j" r - }; I0 h9 F1 A+ H F& F
- }2 V$ ?0 N* s" Y$ H
- }
复制代码 ( B8 t4 L+ v7 P1 R+ U0 H' x* k
汇编代码
; v. ^6 p4 [" S# O, ^9 }$ e) b- .text:004010F07 A# u1 U0 ?6 g
- .text:004010F0 ; =============== S U B R O U T I N E =======================================
; }( y9 D' [, b/ }: c7 m - .text:004010F0& u; j; C/ K* V5 D0 u9 j2 g
- .text:004010F0
0 [% |! M3 m7 T. t0 h! H( Z( v! b - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p+ K; P; e7 g5 ?% Y" b* z5 ]
- .text:004010F0 ; sub_403240+97E↓p ...
5 t0 z; e2 _/ K" T - .text:004010F0
9 ~/ T. [( c, I# w; f - .text:004010F0 arg_0 = dword ptr 4: Q( w( e) d7 @1 U) O9 {0 r
- .text:004010F0, E2 ?" \9 s: S& `; P8 S* w; ^. i
- .text:004010F0 mov eax, [ecx]' s6 n, e M" o% F, }- X( c5 p2 I" D7 x
- .text:004010F2 test eax, eax
0 h) y; W0 a- k# z% A9 g - .text:004010F4 mov edx, [esp+arg_0]
7 i9 y8 ]$ U& u2 b - .text:004010F8 jz short loc_401147
& `( `6 D( x4 V8 y1 k. p - .text:004010FA test edx, edx
( p6 E& _( k/ `* ? - .text:004010FC jz short loc_401147" n1 `! a$ o O& Q
- .text:004010FE mov cl, [eax]
7 @+ m+ ], u6 }) C# w - .text:00401100 test cl, cl- b1 _6 \% p# x' z
- .text:00401102 jnz short loc_401116
; R$ u) c5 U; B' e& a. E - .text:00401104 cmp byte ptr [edx], 0
: t9 m4 n: C* N: r+ |' T) I - .text:00401107 setz al
7 o6 B1 V2 \8 x+ v* B - .text:0040110A xor edx, edx9 J3 p9 Q2 W+ s U6 b. s; x3 ?2 I
- .text:0040110C test al, al
6 d, E6 R: R# Q4 f/ R - .text:0040110E setz dl
! a4 C4 q( l2 n. E, x - .text:00401111 mov al, dl- n4 y: P1 i/ N
- .text:00401113 retn 4
! u- ?7 C @( K5 b& w - .text:00401116 ; ---------------------------------------------------------------------------
' E: K: ~4 w: A- E - .text:004011169 T, J" W: p, x) L) t% j( ^
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j7 f4 @& f+ g; m" ^8 @" k
- .text:00401116 cmp byte ptr [edx], 0
6 l i" k6 |- y - .text:00401119 jz short loc_401147
" V( q# Z5 k& Y: j - .text:0040111B jmp short loc_401120' }! p' o* A8 K# R( ?
- .text:0040111B ; ---------------------------------------------------------------------------
( T, r1 \% s; {* q& |, y - .text:0040111D align 10h0 h& `" V5 c& Z) l% I# O, M
- .text:00401120
# Y; G& Q5 Y+ w - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j& Z7 O7 I4 U5 _+ }/ P
- .text:00401120 ; sub_4010F0+3B↓j" \4 y3 b' j, U1 y* N l0 y! u( ^) m
- .text:00401120 cmp cl, [edx]
6 f: |! T; {$ p- ]8 q$ ^ - .text:00401122 jnz short loc_40112D: M2 `- U, X. t* u3 R
- .text:00401124 mov cl, [eax+1]3 O# h8 c% N$ N, o7 d. e
- .text:00401127 inc eax
. c7 x2 o, @# g Z7 {* O+ o - .text:00401128 inc edx
# E) [% `; |) E. b' C - .text:00401129 test cl, cl
6 S9 A1 s$ V: c9 G. F - .text:0040112B jnz short loc_401120' r/ B/ w: u1 v" Z* U- I5 I$ y
- .text:0040112D u! b# J. `( h$ Y9 R
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
0 w9 ~7 k. \6 V# X* x8 i - .text:0040112D movzx eax, byte ptr [eax]1 Q/ C& j$ d& x! W8 Q# @
- .text:00401130 movzx ecx, byte ptr [edx]
9 P& `/ K- e- {. c* S* N - .text:00401133 sub eax, ecx0 R" {3 F" S+ ~& L) Y) t
- .text:00401135 neg eax
- W6 c$ t. D! O$ I5 s9 a; M - .text:00401137 sbb al, al# D9 o* M* | {% Z3 g. n! C) d
- .text:00401139 inc al' z' e0 p$ X; w- d9 s/ X
- .text:0040113B xor edx, edx$ F, I7 N1 J! x2 u5 S3 O' W
- .text:0040113D test al, al$ h# r' Z0 p; `! v0 B0 q; F
- .text:0040113F setz dl
* b; F4 t% O( T4 Q0 T! U+ _+ d6 I - .text:00401142 mov al, dl/ S; ~, q" e8 U( F$ S9 U" g5 W
- .text:00401144 retn 4
& |* |* q1 B8 g |8 O$ H - .text:00401147 ; ---------------------------------------------------------------------------% {7 u" }9 S+ c, s( t
- .text:00401147
/ ~: ]% E* ?. n& U% n - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
- P& j3 @( B1 y, y. C; B1 x - .text:00401147 ; sub_4010F0+C↑j ...3 g, ~7 w6 l7 ?% t, n" b* K' p
- .text:00401147 xor al, al) J4 d3 g5 U/ ^2 R" }1 o j
- .text:00401149 xor edx, edx0 Y; V' U8 Y! R$ a E J! k/ n' d
- .text:0040114B test al, al
5 M7 O/ @% L% P - .text:0040114D setz dl
4 D2 f w$ _% w7 Y6 T+ D - .text:00401150 mov al, dl
" v* V3 h0 l5 n) r% y - .text:00401152 retn 4
$ y0 X% r: T' M - .text:00401152 sub_4010F0 endp8 I2 ]2 v: S+ L. ?/ i
- .text:00401152
6 w' G# @0 x& A+ l9 f# f - .text:00401152 ; ---------------------------------------------------------------------------) X) C' |% I9 Z O8 V" n: L
- .text:00401155 align 10h
; z' q- v2 o9 P2 Q8 k - .text:00401160' |6 p- L. } A3 {+ b9 \9 i
- .text:00401160 ; =============== S U B R O U T I N E =======================================
a6 C) i( S. d! l; }6 q, m - .text:00401160) k! q3 r/ y) u/ m: E" a/ q, l3 I+ ?! t
- .text:00401160
! k* F5 j3 I/ \2 K, a- ^ - .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
, Q f, M& r+ }" X g - .text:00401160 ; sub_4013F0+C↓p ...
0 ^6 A: d: ^* l - .text:00401160. f0 H1 I6 j2 J1 T
- .text:00401160 arg_0 = dword ptr 4
. `' `$ J: w6 w3 g, w- Z - .text:00401160
; z- z) }5 O7 I - .text:00401160 push esi
+ v% Q. D' B* E/ o - .text:00401161 push edi" @+ k$ \9 l) k* \9 e- C& {
- .text:00401162 mov edi, [esp+8+arg_0]
# c8 ?/ b$ ]3 _3 L8 t- e - .text:00401166 test edi, edi$ H! v& z- c1 r8 \ i
- .text:00401168 mov esi, ecx
9 y0 Z7 E7 I& @8 ^" T9 \6 O - .text:0040116A jz short loc_4011CA
g- h7 J4 m3 X# l - .text:0040116C mov eax, [esi]
! f3 t) P- E3 R" E - .text:0040116E cmp edi, eax8 t8 _+ a% J1 t. |- b- @6 m& s
- .text:00401170 jz short loc_4011CA
6 J; W- X/ ^5 N# K - .text:00401172 cmp byte ptr [edi], 0, |) x( B& c$ w1 y( x0 \8 T
- .text:00401175 jnz short loc_4011A2
& T; |) N6 y" i: m - .text:00401177 test eax, eax
" ~* r1 ?" z7 \8 | d- O/ _ - .text:00401179 mov dword ptr [esi+4], 1
9 H$ J* d8 K& s - .text:00401180 jz short loc_40118B1 |! E: P& ?5 B. b; P4 U7 C
- .text:00401182 push eax ; void *0 p8 L; D# E! d, p; v
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
2 R' m+ P6 p5 v. I7 `7 P d' g - .text:00401188 add esp, 4$ G" y3 L" u* d" f& }0 T
- .text:0040118B# q9 @0 r- m. E2 f/ F0 r
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j2 L7 K1 b- `7 E3 J
- .text:0040118B push 6 ; Size4 C2 F& U+ X. Y5 o4 P
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)- G, z# w1 x7 `5 \2 T( W# \
- .text:00401192 add esp, 42 b, K8 Q! \! t+ ~
- .text:00401195 mov [esi], eax' I0 W" D) a7 j
- .text:00401197 pop edi
* n- B9 H1 r- ~; x - .text:00401198 mov dword ptr [eax], 0
5 W( W2 ]: t8 \& N8 T. l. G4 v2 H - .text:0040119E pop esi
; h( Y+ ] E5 M' W* a - .text:0040119F retn 4
. I" @% ^, u( I5 |6 ? - .text:004011A2 ; ---------------------------------------------------------------------------
, b2 b4 C+ O0 n - .text:004011A2
9 ~2 d m; I& t4 e9 o - .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
. p/ P' c( s* m9 m! D" K - .text:004011A2 mov eax, edi/ ^( J0 H6 [) ]: i- y# K
- .text:004011A4 lea edx, [eax+1]
0 q2 [3 e h$ H0 v - .text:004011A78 ^3 s1 b+ e$ w5 Q- Y1 E
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j+ T" A: G" y! i$ d
- .text:004011A7 mov cl, [eax]
* @/ C9 V$ ]+ L - .text:004011A9 inc eax
1 [0 F( m9 |, U8 J - .text:004011AA test cl, cl% p0 `; L3 _3 e, O
- .text:004011AC jnz short loc_4011A7
7 h5 F- c' y' ^, }2 h( p/ y- M. B - .text:004011AE sub eax, edx
2 @5 l$ \6 H6 f: }2 F: b& e - .text:004011B0 push eax" z' Y9 j9 r% f$ u
- .text:004011B1 mov ecx, esi
: a2 `) P0 T# U- \* q - .text:004011B3 call sub_401030
6 ~( k& u& j$ ^- O* F" ~( Z7 s - .text:004011B8 mov edx, [esi]
6 |$ S, x3 n9 U8 R9 Z) } - .text:004011BA mov ecx, edi
3 u3 N6 a9 Y6 c - .text:004011BC lea esp, [esp+0]
( g# c+ x4 N' L% O/ @+ C- p% U - .text:004011C0. T* ^/ d( ]7 j' A3 c) b/ T3 t
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j; u3 F, q6 J8 c$ w5 Y: t
- .text:004011C0 mov al, [ecx]5 {2 G2 k' S' T. e0 w
- .text:004011C2 inc ecx
5 n) g& l4 S! \1 J! E - .text:004011C3 mov [edx], al
% M1 t Q' g0 |( s" w t7 n2 m$ b+ O - .text:004011C5 inc edx
+ `; `. _2 l& W7 e3 y* O - .text:004011C6 test al, al! j( c3 t9 l) F: r$ c- N' h2 b
- .text:004011C8 jnz short loc_4011C04 R( G0 I- M3 i0 U( K' K
- .text:004011CA5 _8 T4 [& n7 O5 Z2 G
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j# G9 `6 d) X0 o1 [
- .text:004011CA ; sub_401160+10↑j9 \0 U9 Q- Y) ]* X
- .text:004011CA pop edi* A- ^& Q- |) o% [
- .text:004011CB pop esi
4 @9 a" Z& L/ z: @# p! o1 F7 X3 u - .text:004011CC retn 4
! `1 _! M" e, c - .text:004011CC sub_401160 endp
* O0 f5 Q G% a, d$ h5 o! e - .text:004011CC
- l* ^. q; A; S2 y - .text:004011CC ; ---------------------------------------------------------------------------
复制代码
" r" r0 N, h, _; {* ?/ G9 j8 f+ ]3 o
3 ~( Z1 ?7 Z4 t0 c M# X2 q |