本帖最后由 shane007 于 2023-8-27 13:23 编辑 g6 t5 G) c& S& m* ?
9 ?( N% L+ Z7 z+ J; [7 ]本游戏采用了CEGUI,该组件能采用directx和opengl。
, ^7 B4 r# J& C" @" J" N( G经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
: H0 T3 v2 V$ `' a7 m游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
. U$ l4 _+ X, p9 n" D( A) z(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)2 h [- F! v: i2 M# U i* G
. y y1 E# O% e( i8 f. L8 K8 \& ^
8 ?* h) J9 }4 S在游戏中找一个字幕,在以下地方断下。) [2 V6 h1 D) p: u" h7 e4 X. l
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
. P1 S! `! b v- ^因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。8 t! ]9 N1 H- d8 l
U4 R$ ?! [' Y) i2 o T- NextLife.exe+11C5 - 42 - inc edx
5 S3 f7 e) j; e/ k D - 004011C5
复制代码
; i$ F3 A9 T7 Y
9 p8 }6 A: h( g- H9 ]该地方的伪代码
( D0 I4 [7 [# x5 \+ \) v s- void __thiscall sub_401160(char **this, const char *a2): J7 m5 N& R% e1 v
- {& c" g3 B5 t9 v7 C9 U
- char **v2; // esi
4 I7 M* @$ z' N" w$ E - char *v3; // eax8 H* V% I2 ^8 T# h# v0 A
- char *v4; // eax
! a, K7 F ] r2 q. w3 T+ |
" N5 l4 X- T0 h2 U9 j1 z- v2 = this;
/ U% `2 p4 q0 ~1 S4 h - if ( a2 )
2 E b& o D/ A/ W g3 q* V - {/ K5 L7 S4 O& B+ n4 U
- v3 = *this;2 {6 L+ W( C2 Q* k: ]
- if ( a2 != *this )+ Y; `8 U T. z K M
- {
$ P) i5 n4 i2 [# w - if ( *a2 )
# E% }4 C7 S* }/ C/ T: o - {( J& w( o8 e t2 Z1 @" j9 o
- sub_401030(strlen(a2));4 [. P; L. w, T1 h* z
- strcpy(*v2, a2);
R# n0 O' O c. c - }
0 {5 @% L( h1 T4 \! c, L - else
0 R. ^. V; G0 v/ o% Q - {* s& F+ z" l: C! @" s" a5 B
- this[1] = (char *)1;( k$ U$ C% ~# Z9 z8 Y
- if ( v3 ); h8 b( ~. H) f- j0 w6 G+ k& F
- operator delete[](v3);* X. L. F5 b- O; A; G4 v
- v4 = (char *)operator new(6u);: i! j" i: F3 @/ @% N$ p1 E
- *v2 = v4;% g/ O: Z2 _6 N4 W" b
- *(_DWORD *)v4 = 0;
6 z8 z- N. T: V& y: Q# ^ - }0 x( J/ F- C8 E
- }
) `7 q8 o- W( Z. R1 J6 f3 G - }$ k* n( |/ W9 H ^) P. W2 n1 I
- }
复制代码
! N) o7 g- S) e( P; t# c2 B! L汇编代码$ n3 S! P! @& z' W7 ^
- .text:004010F0
% }' [/ k0 }. Y% H& B P - .text:004010F0 ; =============== S U B R O U T I N E =======================================
& w/ Q9 z+ ~0 V9 }) x - .text:004010F0
# L. o) F7 D1 ~$ c - .text:004010F0
/ B- ]; T# n7 ^2 G- G, P8 c5 o/ Z* u - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p9 s X! P& K1 {3 `& P0 `
- .text:004010F0 ; sub_403240+97E↓p ...0 \0 X% C/ K8 t. D0 ^
- .text:004010F05 C8 N$ @" x' }* p% d
- .text:004010F0 arg_0 = dword ptr 4
) @/ {) |" n b% C6 P% F* d2 ^2 H - .text:004010F0
% B9 U4 `' x: K - .text:004010F0 mov eax, [ecx]
Q4 H6 L& H+ w- V/ t6 S4 T+ \' F - .text:004010F2 test eax, eax
/ g R5 R$ H( {5 E- W3 U4 k - .text:004010F4 mov edx, [esp+arg_0]
6 K0 D. L ]$ T! N4 S - .text:004010F8 jz short loc_401147
4 W0 ~* L" c0 s* Q. n - .text:004010FA test edx, edx
2 {4 [" Q E* ~, J: W0 h - .text:004010FC jz short loc_401147
1 F2 T2 m" G0 m3 E - .text:004010FE mov cl, [eax]. A H9 [' V/ _2 v: p0 M3 g
- .text:00401100 test cl, cl
9 i! w5 y e+ C/ t J - .text:00401102 jnz short loc_401116
9 }7 ~7 |1 b+ g% Q - .text:00401104 cmp byte ptr [edx], 0
: ^! @1 M$ ?0 g2 J' G - .text:00401107 setz al
g% U( Z+ U: ?& k4 `- e0 K) s - .text:0040110A xor edx, edx8 P6 O: @/ O2 @2 x& G* N$ j
- .text:0040110C test al, al, }+ i! S: s/ R& N9 j2 x
- .text:0040110E setz dl
1 d/ S, }- O& V+ ? - .text:00401111 mov al, dl& [- s* q- ] f* y4 ]4 d
- .text:00401113 retn 4
0 A" Q8 m% P' y E/ ]0 i, O! | - .text:00401116 ; ---------------------------------------------------------------------------- ` P8 A0 G9 [: V* r, _! ^
- .text:00401116
/ `" M- S6 i& A" {8 ^# |2 f - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j8 g1 C/ @1 E9 n; X
- .text:00401116 cmp byte ptr [edx], 0
5 m0 K& S7 V5 c: v+ k - .text:00401119 jz short loc_401147; g3 k4 t/ n& T' ~8 [! a
- .text:0040111B jmp short loc_401120# C e+ W6 z- a: ~$ A* h1 P
- .text:0040111B ; ---------------------------------------------------------------------------4 Z l1 t6 T0 P, c0 y( P6 ~3 X4 _
- .text:0040111D align 10h) M5 O! W! a( _/ E) N8 T
- .text:00401120 O# v% ^5 ?( j, w
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j6 \4 N9 R8 d9 m% V# B9 S4 J/ L$ V
- .text:00401120 ; sub_4010F0+3B↓j
3 P) D( }) L t$ ]+ n+ z" @, C7 h - .text:00401120 cmp cl, [edx]
3 p! L J+ R) D0 q6 m - .text:00401122 jnz short loc_40112D; E8 p0 W8 `% h- ~
- .text:00401124 mov cl, [eax+1]
' s: r' p+ Y4 i5 k, C - .text:00401127 inc eax3 Q, `7 N, F% f' f$ Z, A. `/ v
- .text:00401128 inc edx
. E/ x, B! U& l$ J2 y+ @ - .text:00401129 test cl, cl
& X9 `! {. a3 a( u$ M6 a - .text:0040112B jnz short loc_401120. C+ p( K5 _; _
- .text:0040112D
' q' \) H! X) h# C - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j1 e8 y0 n; m4 J1 j: } f
- .text:0040112D movzx eax, byte ptr [eax]; ^- Z9 o, w5 z
- .text:00401130 movzx ecx, byte ptr [edx]
, g% n% e8 ^3 Q* j4 r* w - .text:00401133 sub eax, ecx
$ }, k# `/ X# c4 K- r" j* F - .text:00401135 neg eax
. ~. R6 @# t0 ^& |5 f; o - .text:00401137 sbb al, al
' c) Y8 r( L6 g, W& H; I8 u - .text:00401139 inc al; [: y% H g. m2 a$ ^
- .text:0040113B xor edx, edx' s8 Z. F6 ?2 O5 d: a% o
- .text:0040113D test al, al
) E2 \, X, k4 R9 u8 w. i( h( q - .text:0040113F setz dl
# w, M: y/ D% ~" x0 f3 Q; b6 s; N - .text:00401142 mov al, dl
5 j l" F" r" f9 T8 {% S4 b - .text:00401144 retn 43 N0 J1 ~. c$ A7 ]0 R, I
- .text:00401147 ; ---------------------------------------------------------------------------
; w& k% [9 A1 Q - .text:004011477 S# a0 @7 u3 r0 ]
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
. {9 U% m' R+ l; C& Y# H$ Q' w5 ^) g - .text:00401147 ; sub_4010F0+C↑j ...0 e% w* J1 L6 F; L2 R& K
- .text:00401147 xor al, al8 |. a! ^+ M9 J- _% k
- .text:00401149 xor edx, edx, v2 O, T" d+ D, ]
- .text:0040114B test al, al" v! |1 L3 F. N0 @. [# ~' g; n2 B
- .text:0040114D setz dl$ @ m" m6 B+ U
- .text:00401150 mov al, dl" a# Q* b7 F9 n+ M" E! l0 u
- .text:00401152 retn 4
! p) c. {! Q% |) y4 O - .text:00401152 sub_4010F0 endp% j( O1 O7 `- Y5 }( P
- .text:00401152
2 z6 c. B6 a& S* G) g/ c e - .text:00401152 ; ---------------------------------------------------------------------------
4 v' ^1 {8 u. H% s1 R& ~. K, z - .text:00401155 align 10h
% l- K5 M$ v# T& K( M; M4 u/ p+ [ - .text:00401160
* \: d& H5 g% f( [ - .text:00401160 ; =============== S U B R O U T I N E =======================================
. {: S F, [* L7 k - .text:00401160. }" ?( ?- r/ J# D# i. R% Z
- .text:004011609 s6 \% D* l: b9 j% M2 G
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p: t! ]4 C/ Y& t5 J$ d/ p
- .text:00401160 ; sub_4013F0+C↓p ...* A4 N l; E, o, k& j9 l, e! ~
- .text:00401160
) f; h6 h+ V; Q9 x - .text:00401160 arg_0 = dword ptr 4
; G1 }$ u+ O' T/ K( v# D1 X" l* W - .text:004011608 R. m5 R: e/ h( E
- .text:00401160 push esi
# H: s$ [0 g( V - .text:00401161 push edi8 J: E4 ~" _+ s$ A( [! Q6 [8 `
- .text:00401162 mov edi, [esp+8+arg_0]
2 H7 T4 \/ U# ^, }% M) H* T# f - .text:00401166 test edi, edi
1 e, G8 S7 @- w) e1 Z& [7 R# `' [& _ - .text:00401168 mov esi, ecx* q: D O* Q0 ]$ W
- .text:0040116A jz short loc_4011CA
1 N( E9 O2 W0 e1 O- C - .text:0040116C mov eax, [esi]
: z- {+ i! e% b - .text:0040116E cmp edi, eax! Y* h7 u# t- q5 I
- .text:00401170 jz short loc_4011CA! c; [; Z! `7 |% l. c( W
- .text:00401172 cmp byte ptr [edi], 0! H @& `9 u& [
- .text:00401175 jnz short loc_4011A24 h2 a' |) J$ `! r
- .text:00401177 test eax, eax y$ \9 z9 b, n' n
- .text:00401179 mov dword ptr [esi+4], 1
3 s' A+ k" a5 \! Z) ^9 ^ - .text:00401180 jz short loc_40118B
# n/ @$ ?& k" c) z: M/ U9 s- r - .text:00401182 push eax ; void *- [6 J! h5 X, `4 P2 C! n1 u5 ~
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
/ @& ?/ @# m5 }1 l- n% n - .text:00401188 add esp, 4
+ Q+ n( K2 u* c* |$ h# T( A - .text:0040118B5 e1 a; v' w# Q- D* M6 v
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j0 t$ o& m* z6 Y, _- F, S
- .text:0040118B push 6 ; Size0 \" [$ c( V# g
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)7 r$ V$ O% D( O" d
- .text:00401192 add esp, 4
! J8 L4 i, ~2 m% }9 @3 X - .text:00401195 mov [esi], eax
/ W" Y/ A- e5 X- c- q2 I2 B - .text:00401197 pop edi
2 _! f( U' N3 t0 }; v4 O- t* _/ |, p; a - .text:00401198 mov dword ptr [eax], 0* ^- i9 r0 `. G, K6 N
- .text:0040119E pop esi
E! k x9 r9 g' Z& o$ f3 C s# s - .text:0040119F retn 4
) u6 h* _0 ?( u% t; B - .text:004011A2 ; ---------------------------------------------------------------------------
: D. @. I# q+ `, f% z1 \ - .text:004011A29 c7 X) Z3 b7 Q/ T9 ~) B
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j7 J" H7 L% {3 @/ }* P
- .text:004011A2 mov eax, edi' t6 Z# }8 ]9 _
- .text:004011A4 lea edx, [eax+1]
: b5 R; Q: J/ H) d, C - .text:004011A74 g% z- S' ]+ C8 l' c" A2 ^+ _0 Q
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
( S/ ^' z! Y9 d: U- G6 ? - .text:004011A7 mov cl, [eax]# t8 K6 @" E1 X$ I) q# L# e
- .text:004011A9 inc eax8 h4 c. \1 u% s5 K, [0 B* \
- .text:004011AA test cl, cl: A6 n) b$ e. ^! @" \$ f) L
- .text:004011AC jnz short loc_4011A7/ _4 ^' c% z3 T7 ~( q
- .text:004011AE sub eax, edx
* k% v3 Y9 z) { J8 Y8 t: j. \2 a - .text:004011B0 push eax8 O: T. L$ M l& r9 c: u% e6 z
- .text:004011B1 mov ecx, esi8 W$ c: Z7 ]8 I6 }
- .text:004011B3 call sub_4010300 \6 K% i/ M$ F6 E' ^
- .text:004011B8 mov edx, [esi]
( a7 [ Q( s& ]* ^ - .text:004011BA mov ecx, edi
2 P5 ?; t) [7 e+ w# e* G* v - .text:004011BC lea esp, [esp+0]7 D: @ Z! [2 W: t& \* n
- .text:004011C0
: L% P& g# j; F - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
* ?4 \6 z$ F- {& J! j) e M - .text:004011C0 mov al, [ecx]5 C F4 a. s4 O# W |
- .text:004011C2 inc ecx* g7 E$ `, m& S& e
- .text:004011C3 mov [edx], al V q7 h2 x2 K+ y$ g& ]; y
- .text:004011C5 inc edx
$ B/ g# b0 G _& }% C - .text:004011C6 test al, al
$ N3 M- f' Z* M: B9 Q - .text:004011C8 jnz short loc_4011C0
$ [) o/ }- I& p/ i# w - .text:004011CA) u" q6 u( q [7 L
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j3 R2 i- d' j6 n8 ]1 f$ z; L+ O
- .text:004011CA ; sub_401160+10↑j3 S. L! F. {! ]9 G( K0 j+ S: T3 `7 V
- .text:004011CA pop edi
6 j( e. u2 X* l: i( R& `6 c2 L. L - .text:004011CB pop esi
/ o+ l* S" B, h: B8 A0 R* E% M - .text:004011CC retn 4
. j. _$ B& i& t6 W2 C7 O4 Z4 s' b - .text:004011CC sub_401160 endp) j8 Y Y! Y. o& \) R
- .text:004011CC( R+ J8 E, |% o" `
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码 7 C/ X% b. F+ W' w. k
4 L2 K: K; V6 @) o" S) v
- m1 S$ y- d! F% m9 n
|