本帖最后由 shane007 于 2023-8-27 13:23 编辑
: M' R. g( h; |) n \* F! ~4 P% i. p' P b
本游戏采用了CEGUI,该组件能采用directx和opengl。9 U2 i: N. c& x+ h. d
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
- Q" n3 q( g0 b* i/ y游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
7 z/ K7 J9 h$ d" W! d(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
8 \1 r2 M0 b. z. N3 p9 {) |
8 T: E* g- [/ |1 k1 t
/ t3 T2 O0 X; p; t* v' C在游戏中找一个字幕,在以下地方断下。- r! G8 n* l0 J, @% f+ \4 ^
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),9 c8 l1 T' B9 J* c, K. |
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
! x- S& m; J, T+ { [) }. w5 [1 w0 j' R7 Q0 U+ b4 p. K
- NextLife.exe+11C5 - 42 - inc edx
3 b! T6 B7 C% N, Q+ O - 004011C5
复制代码 ; W9 b. W2 v' l* N9 S3 T1 O
7 p8 V5 ^2 b/ y' K
该地方的伪代码1 E# V1 G8 k* H4 g% D
- void __thiscall sub_401160(char **this, const char *a2)
7 ^# ^6 E3 r9 L* ~' y) `+ j0 c8 B - {
1 A: K8 J; |; Q$ X1 {" u - char **v2; // esi
4 n& y7 j/ Q3 a# M1 K - char *v3; // eax
% ?# X6 j, G7 ^5 i; c - char *v4; // eax0 Y- A+ A* ]' _% W5 K8 P% O5 B+ ^
4 ]+ [0 H1 Y' O- ?2 m- v2 = this;- _% G) J$ M s) q
- if ( a2 ): [% h8 ]& K5 {
- {5 s% ~: |4 _, r8 V$ Q
- v3 = *this;
4 A+ E, R- d7 h2 o+ ~ - if ( a2 != *this )9 K0 H0 `7 X3 d P- G
- {
1 @& o! i- E1 c, {; a% }7 |9 J - if ( *a2 )
, j9 A' q5 Z; I( D5 C - {
/ m9 W5 y+ s/ W. x* g8 I - sub_401030(strlen(a2));; W7 @/ F$ n" X3 Q& p
- strcpy(*v2, a2);
! l7 b6 a9 B& _ - }2 P! ~' j0 H: b% W; K
- else
$ ~0 N% N% b5 n1 n3 [5 B/ Y - {1 j4 x. u" E: f( j- v
- this[1] = (char *)1;) R* n( |+ r8 m2 \+ {/ Y
- if ( v3 )) @1 p' \( Y9 ?9 W) F, D3 X- |
- operator delete[](v3);
: |7 m }# N! l& j( Z+ y - v4 = (char *)operator new(6u);
: i$ J4 R/ u8 L8 M3 l) c - *v2 = v4;3 A6 D* z3 K6 z8 S7 J: T
- *(_DWORD *)v4 = 0;1 a0 M1 Q$ m$ F; s9 I
- }
" P0 k" P& r. Y% m8 k0 | - }
+ c) p N& T% T# Z1 k1 U4 j) W - }
/ @, M+ ?$ `5 X- M8 @: Q* N& m - }
复制代码
: C" S2 e p; `: i( [% `- Y汇编代码2 D" L$ x4 @& L. |1 `( w5 T, r9 f
- .text:004010F0. s; P# d Y* Z9 ~# {! g. s' G
- .text:004010F0 ; =============== S U B R O U T I N E =======================================
) E% f0 c& f* s5 {2 f" h& ? - .text:004010F0
: k" @. S3 @& f& D% o; b: A - .text:004010F0
( o4 A8 a B6 ^, S; h3 {1 G - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p
+ a3 r0 K$ e9 g" t& N - .text:004010F0 ; sub_403240+97E↓p ...
" h g$ X; a2 E$ L - .text:004010F0! g( y u& O1 ? M" Z9 [
- .text:004010F0 arg_0 = dword ptr 4) D M3 N# G8 h& R
- .text:004010F0
5 A4 D; X& K3 T$ V/ x% {' x - .text:004010F0 mov eax, [ecx]4 C( P& C8 l; b* O' A
- .text:004010F2 test eax, eax9 b# C! `2 l [- ]: e
- .text:004010F4 mov edx, [esp+arg_0]# k& m+ a' S2 w$ l# E5 v* `5 F$ \
- .text:004010F8 jz short loc_401147% J+ \& S7 q: b2 S; F; v
- .text:004010FA test edx, edx
. s& j) e" c+ l) ^& H9 }- X - .text:004010FC jz short loc_401147) I( g9 C" d/ T
- .text:004010FE mov cl, [eax]3 k/ Z0 {+ b1 r" A
- .text:00401100 test cl, cl
/ h8 `7 J3 y! c. c - .text:00401102 jnz short loc_401116
9 L' [+ ~) o3 L& P - .text:00401104 cmp byte ptr [edx], 0
# T0 a3 \' [: O- i$ Q. L0 P - .text:00401107 setz al
( U4 G; ^6 K1 y4 } - .text:0040110A xor edx, edx
7 v( A) U7 _- ~& c* E3 m - .text:0040110C test al, al
6 u( p' Y6 b/ B2 w% u5 Z - .text:0040110E setz dl0 X) q/ g ^% y: @
- .text:00401111 mov al, dl
H+ f: y1 R3 i7 }" t3 C - .text:00401113 retn 4$ |, t, O) V3 |5 M5 N. d
- .text:00401116 ; ---------------------------------------------------------------------------) d$ ~ w: T0 k1 x8 w% J
- .text:004011167 x& i! E4 \) B- u/ c
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
, }1 q! b, R. g, X# F. f - .text:00401116 cmp byte ptr [edx], 08 {# W! [" V3 o- }
- .text:00401119 jz short loc_4011478 V. I& k2 I8 a& P0 s7 ]3 h$ z4 W
- .text:0040111B jmp short loc_4011204 r$ Q; @/ A% ?* [8 B4 f0 F
- .text:0040111B ; ---------------------------------------------------------------------------
& C' w+ b. X8 n9 [8 Y - .text:0040111D align 10h
! T" T1 A) J* ^1 h9 G& @/ ~ - .text:00401120
- ^5 Z/ i" H' F2 H - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
$ I9 U" m( U. R I - .text:00401120 ; sub_4010F0+3B↓j: _* U" ^% c- y* g; Z
- .text:00401120 cmp cl, [edx]
/ u+ Q0 A3 V) W - .text:00401122 jnz short loc_40112D3 m. E- u2 e6 |( D" U" C' S
- .text:00401124 mov cl, [eax+1], t: r3 l m5 t; r/ b2 G7 C& \
- .text:00401127 inc eax4 U4 B8 s' A' b6 y
- .text:00401128 inc edx
) y( r, Y1 r7 S3 M2 |6 i* J - .text:00401129 test cl, cl
$ @9 \! L, s6 v* M) [$ \6 m ^* K - .text:0040112B jnz short loc_401120
; ^) |3 V1 G/ T6 K - .text:0040112D
" P% R: G$ e: d% l; }; u9 W - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
! Z* z! o! z* U+ k7 d% S - .text:0040112D movzx eax, byte ptr [eax]0 W g$ O/ N, a7 {' v% m) b$ e
- .text:00401130 movzx ecx, byte ptr [edx]
' Y X: X2 C9 @9 O3 H" j8 E - .text:00401133 sub eax, ecx6 ~/ i7 P8 D( q7 Z+ p- [5 }8 B0 Y
- .text:00401135 neg eax& m) {! Y; v" E' V$ Q( O/ t: K: c
- .text:00401137 sbb al, al
! K, D$ W: o2 [. D, l7 p/ V - .text:00401139 inc al
. }' m0 C5 f. l - .text:0040113B xor edx, edx6 i, |) R/ Q6 P# u
- .text:0040113D test al, al0 m5 |3 T: ?8 G9 T
- .text:0040113F setz dl- o" p, ~# S# o, `: P0 v
- .text:00401142 mov al, dl5 U6 g8 D$ j* \( ^# O; R) \
- .text:00401144 retn 49 Y* Z' s! ^$ U( Z' {
- .text:00401147 ; ---------------------------------------------------------------------------1 B* U% l2 A9 ]8 \8 k0 N: O1 d; u
- .text:00401147
, q5 p% m9 E5 I+ y: E. e; @! y0 o6 r; e - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j; O+ Q0 K t- f3 }1 E" H
- .text:00401147 ; sub_4010F0+C↑j ...
, ~. I `3 d: b" T; k - .text:00401147 xor al, al
" E, d% u2 I# W - .text:00401149 xor edx, edx* ]: O7 V# Q. K$ O
- .text:0040114B test al, al
I; k3 u ]2 g# D4 c, r& X9 | - .text:0040114D setz dl
9 Y2 W# x" \4 i% y# J$ _0 w - .text:00401150 mov al, dl
* A2 t' X/ S, x* J) [ - .text:00401152 retn 4( E( Y* k- [5 F
- .text:00401152 sub_4010F0 endp
5 j+ w) x' ]7 K4 u - .text:00401152
% m5 s- j# O- j) z8 ^) S* s - .text:00401152 ; ---------------------------------------------------------------------------
: H6 T3 _5 Z7 U# V6 J - .text:00401155 align 10h
# M" F$ P) j2 n4 F. I; @3 a7 E - .text:004011602 a6 b8 r, y! q* e5 C( X/ C" Y! [4 O
- .text:00401160 ; =============== S U B R O U T I N E =======================================
7 l8 }2 S% I1 K6 e0 h. b! o - .text:00401160
, H0 k' |/ b( V' R - .text:004011605 S! I: K2 K* d- [+ Q+ f9 \# y- m
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p" ^9 I! o' l, K: X. }$ M
- .text:00401160 ; sub_4013F0+C↓p ...
( ^$ h1 E. M' y8 j* ~ - .text:004011604 \4 N9 ~4 U! T6 X7 F
- .text:00401160 arg_0 = dword ptr 4
7 ~6 A4 i2 ?- Y1 I5 m6 s0 x - .text:00401160. q. Y( i9 x F/ [$ ~8 ^0 v
- .text:00401160 push esi/ @: K! S+ i5 C1 K Z: g/ J
- .text:00401161 push edi; ?/ u0 J1 [' O5 W) W
- .text:00401162 mov edi, [esp+8+arg_0]
, C4 N1 k( q, ]8 M - .text:00401166 test edi, edi2 Y; a( k3 b7 O9 w/ D9 Z( J+ c6 G
- .text:00401168 mov esi, ecx
: r& [7 J% L( Z" Y - .text:0040116A jz short loc_4011CA: J4 \7 m$ V% a7 y; q
- .text:0040116C mov eax, [esi]( L% M1 g4 P$ C. V
- .text:0040116E cmp edi, eax
3 s1 ^$ n I! F9 j, t, U - .text:00401170 jz short loc_4011CA% v, A& w! w$ j) U; s9 e7 p6 W
- .text:00401172 cmp byte ptr [edi], 0
7 _/ D7 I1 j8 S4 s/ \5 _6 a - .text:00401175 jnz short loc_4011A2
' u5 g& @" q: Q0 ^ e9 ^ - .text:00401177 test eax, eax
- Y2 W& Q$ F" o - .text:00401179 mov dword ptr [esi+4], 1* {2 Q6 L+ S/ q4 `5 T# w z
- .text:00401180 jz short loc_40118B
/ W# v& p" z5 d, [' C, P. P - .text:00401182 push eax ; void *
( _1 p& i8 g; X* n& ^) Z: L; ` - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
+ S: w8 G4 u2 {$ ~) ]& C; N2 C( G - .text:00401188 add esp, 4$ O8 z3 d$ ~+ I* g D' v3 f2 a- Z
- .text:0040118B, _9 X; ?4 }; j
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j) u7 S) B9 E' S- x
- .text:0040118B push 6 ; Size
% b& q" o4 j6 b: _* Q - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
; {9 e) ]$ Z1 g% q0 [9 a - .text:00401192 add esp, 43 h' F2 s) _6 s5 H
- .text:00401195 mov [esi], eax- v/ E$ S: L6 n- _ `
- .text:00401197 pop edi, s( X1 i' k2 B1 t: a
- .text:00401198 mov dword ptr [eax], 0
/ ]; \3 c0 b% f7 [* p5 z/ M - .text:0040119E pop esi
: u) c# y% d( \( N - .text:0040119F retn 4 J) o9 w R" b% \, R
- .text:004011A2 ; ---------------------------------------------------------------------------
0 v0 k+ m* _5 Z1 J - .text:004011A29 w8 h9 U- a3 P5 x
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
/ O: Y: ]% u7 T! h - .text:004011A2 mov eax, edi( U, @0 K6 F/ d+ b
- .text:004011A4 lea edx, [eax+1]/ x) I3 v- ]# [* y& p" k
- .text:004011A7
( b# i0 Q0 e1 d - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j, d+ H( |" ^5 s0 F2 [" [4 T
- .text:004011A7 mov cl, [eax]
, U) }( d) x! k$ D - .text:004011A9 inc eax
' o W0 Q G8 C- z6 t/ ]- t - .text:004011AA test cl, cl% b5 a# J' `5 S- M/ T0 c
- .text:004011AC jnz short loc_4011A7
8 `* _ Q" G) t$ U% L$ | - .text:004011AE sub eax, edx( y% y+ C' f0 h# a9 f. |
- .text:004011B0 push eax
4 q6 r7 j X$ N - .text:004011B1 mov ecx, esi4 _6 W% o1 Z, I
- .text:004011B3 call sub_4010306 a( s: p0 i8 X0 r
- .text:004011B8 mov edx, [esi]; H7 J" T1 @- |
- .text:004011BA mov ecx, edi
9 V5 s3 I; k0 z# J# p/ q - .text:004011BC lea esp, [esp+0]
% {5 Z0 j# [* z" F - .text:004011C09 O- L: B6 s" X8 v9 W
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j6 Z/ L1 v$ |4 L& Y @: q
- .text:004011C0 mov al, [ecx]
3 U& w3 n/ X& V- C3 C% V8 S2 P - .text:004011C2 inc ecx6 u4 J2 [# \. b7 ^7 c; k
- .text:004011C3 mov [edx], al
; a- c! C2 r% @ K Q! D+ d - .text:004011C5 inc edx; Q! i7 D; ]+ s* [ x4 P! d
- .text:004011C6 test al, al
( x% t+ s' `$ L$ ~* O6 F - .text:004011C8 jnz short loc_4011C0
) {9 m8 R/ M6 h7 I1 }9 y - .text:004011CA4 G9 n- |& {& @+ x
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
" g: @( \1 r9 c4 k6 i' v6 V3 j - .text:004011CA ; sub_401160+10↑j( Q. j a. {* m7 `, \8 `! a
- .text:004011CA pop edi$ m+ f' n- c2 D. E% T, m
- .text:004011CB pop esi; ?1 q# M4 y/ \; b* G/ w
- .text:004011CC retn 4
& G1 {7 u3 y. Y) C- r$ J) M - .text:004011CC sub_401160 endp
+ |$ A4 Z0 U; T/ ~ - .text:004011CC2 h- r4 A6 V6 D7 [) q
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码 . `* ]7 q L6 i0 Z
: _1 [. }" {% o; L( X7 W
) K9 [4 s1 s; W, ]; |3 |( X4 q# W/ z
|