本帖最后由 shane007 于 2023-8-27 13:23 编辑 + \! N% U5 u, `9 g# a$ a
$ j: h, h) }* P& v
本游戏采用了CEGUI,该组件能采用directx和opengl。8 k0 ~+ P8 P) X7 f
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
7 M, ^: U' W' e6 _" x1 n- u$ M游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。* N- }+ V: E+ a7 v6 a9 t
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
! [# W1 {+ n. q# Y" Y ^) ^3 J0 D- r4 m! ]/ X- K$ D% ~, x0 \
0 r1 e+ c, |. u3 s5 L( F在游戏中找一个字幕,在以下地方断下。
0 r% i5 p* E2 p" @9 N& W7 S由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
0 L+ k' ^) N; x9 X0 r* i1 R因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
+ y! K5 Y/ c+ d: d7 |( M+ W8 _" c3 w. ?. C" V! F$ o
- NextLife.exe+11C5 - 42 - inc edx
1 L9 e* ~' Y' O: _% G* y - 004011C5
复制代码
0 B: W8 l6 {, h$ b+ {
G7 d# j2 U2 \该地方的伪代码
, R: w& Z/ e3 ?" O7 S- void __thiscall sub_401160(char **this, const char *a2)! p* S! N& J0 g% @
- {
2 G! w; U7 r5 U* O$ E - char **v2; // esi
/ O1 ]8 D+ d" z/ G - char *v3; // eax \6 \1 ~) I4 x
- char *v4; // eax
4 p8 e# V: R" G" \$ X7 I
# v! R8 r5 z. W8 w- h0 }% f- v2 = this;4 {8 q2 F- G- d( z' y, D* l
- if ( a2 ): u! V( O" r* W. B) T' j
- {
- |* j$ o2 l1 a - v3 = *this;* |) w! I8 A. x3 J
- if ( a2 != *this )2 a- X3 t2 u6 z. m4 D
- {
5 y7 I6 U0 H q0 J' ? - if ( *a2 )
' Y6 V4 w( f1 S* n - {
9 ^/ M2 @0 E# ~1 E3 ~+ l4 Q. | - sub_401030(strlen(a2));
" T! n7 Y% O3 v5 ~; f - strcpy(*v2, a2);# T; K7 u7 }- d5 O* T( m/ |; k( `& i' j$ D
- }/ l+ y- f. L7 q3 j' G- Y, Q. r' W
- else
. e3 F& y1 D; K( N. Z - {* ^- R& a) `) }4 |
- this[1] = (char *)1;' |0 W3 U5 k2 P
- if ( v3 )4 O) f* h; W% f2 e+ A
- operator delete[](v3);4 D; C4 w/ L; m& s5 ]
- v4 = (char *)operator new(6u);
& S% C) t9 t A) i - *v2 = v4;
6 K; a0 f. [ ]6 i6 N - *(_DWORD *)v4 = 0;
8 s0 z1 u. X$ C l. B6 D$ i - }
9 }, R( I% ~! o% x - }
! N( I$ |: E4 C* `8 t - }4 E/ e/ N4 e+ v! z
- }
复制代码
8 F& \+ B, M% }; Z1 V9 V. d- V* a汇编代码" r C* b: J) t# N! t* ?3 C
- .text:004010F0/ ~& h& I" u' J$ w' L X
- .text:004010F0 ; =============== S U B R O U T I N E =======================================
1 Q! i2 _3 c$ s- Y3 F$ {7 \: G - .text:004010F0
2 X% _' J1 K8 ?. ]/ f- B3 g - .text:004010F0
# O) L1 o3 D" ~* n- y: m; G, U - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p9 D. G+ u; w' K( J* y
- .text:004010F0 ; sub_403240+97E↓p ... c! g5 h b- ^; ], P- E: s' j
- .text:004010F0
0 W2 [ D: ^" h - .text:004010F0 arg_0 = dword ptr 4
U7 X% A! T5 Z - .text:004010F00 B* {! \( p- F/ r! ~
- .text:004010F0 mov eax, [ecx]
( K: X9 ]& J2 t5 g, I& V; [' [8 p - .text:004010F2 test eax, eax+ ~- ] @, S1 x* r- {/ R
- .text:004010F4 mov edx, [esp+arg_0], q- K( H0 |. k0 U" W
- .text:004010F8 jz short loc_401147
8 N8 v1 E/ v* g& R" G! }; [ - .text:004010FA test edx, edx# }3 E$ Q3 F( e# H7 `/ F7 {2 m
- .text:004010FC jz short loc_401147
1 ^- D. B9 y* d& X3 E0 H - .text:004010FE mov cl, [eax]
0 Q* D `1 B/ r5 V0 _! V f7 E4 b" R - .text:00401100 test cl, cl H5 ^6 J7 P2 Q
- .text:00401102 jnz short loc_401116
- m+ P( q5 B, _' U/ @$ B - .text:00401104 cmp byte ptr [edx], 0$ y: U5 {$ S, [7 \7 A; o6 U
- .text:00401107 setz al( L$ z) f7 b5 s! F5 r
- .text:0040110A xor edx, edx6 t4 j5 P# t$ Y! A# a' W
- .text:0040110C test al, al
O% v$ g. L" G - .text:0040110E setz dl
( ?. t' J: y& R' Q2 r; s8 F - .text:00401111 mov al, dl, O' V$ g3 [8 C7 R) X* [
- .text:00401113 retn 44 E: z! J! z6 ^# a
- .text:00401116 ; ---------------------------------------------------------------------------
* u/ t x3 S- t+ h6 p - .text:00401116& K1 I3 ?' C2 x' f! w' ]
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
7 J$ y$ ]9 a/ \2 d6 o! t" z - .text:00401116 cmp byte ptr [edx], 0
3 H1 u/ o8 j' p) n - .text:00401119 jz short loc_4011473 [0 C5 T$ u ^* e& D
- .text:0040111B jmp short loc_401120* Q0 R+ H9 _! s
- .text:0040111B ; ---------------------------------------------------------------------------
# J6 w. N5 b% R! Q/ O% i - .text:0040111D align 10h9 n8 ^. z) Q9 c4 g6 Q7 l
- .text:00401120
. }% d4 B5 Q/ r6 `$ h" } - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
& d3 S5 ^* l! s* t& Y - .text:00401120 ; sub_4010F0+3B↓j1 t. f, C$ X1 E; s; l
- .text:00401120 cmp cl, [edx]
0 Q' {- d1 i) g L3 | - .text:00401122 jnz short loc_40112D/ @) a3 s5 \9 C+ Q
- .text:00401124 mov cl, [eax+1]
" ~) i( t. h) _' ^$ J3 H0 d% B - .text:00401127 inc eax
# Y& q% \7 M' s7 H - .text:00401128 inc edx0 o( @4 g1 J; L: i9 b
- .text:00401129 test cl, cl. {% B0 u( r; C
- .text:0040112B jnz short loc_4011203 e1 _* p" t( g6 Z' T X
- .text:0040112D( _! i% ^1 O6 K. b }
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j$ v1 w- F/ T7 t1 @. E8 r4 K
- .text:0040112D movzx eax, byte ptr [eax]$ _0 c# u( s% @' s
- .text:00401130 movzx ecx, byte ptr [edx]
1 d# \7 B4 h8 S8 A: c T - .text:00401133 sub eax, ecx
H- ^0 J; y! t4 E7 H: L - .text:00401135 neg eax
2 P+ c, z; X3 n; ^, `* {7 N. z2 C - .text:00401137 sbb al, al/ U% m& \/ M9 k) L( ^0 p a1 c& A' x
- .text:00401139 inc al8 U9 B! p9 t# o5 @8 I x
- .text:0040113B xor edx, edx
& D4 n4 j- \! E& v* K - .text:0040113D test al, al q4 `! w* f% N7 ?+ T4 E2 a2 v8 S
- .text:0040113F setz dl
5 k9 T# v7 `8 a8 q5 f - .text:00401142 mov al, dl9 b$ B, s* ]6 X: b% W3 t
- .text:00401144 retn 4
6 f& e2 I+ F, l( s2 ^ - .text:00401147 ; ---------------------------------------------------------------------------
+ V5 H+ p. K4 S9 q: ? - .text:00401147
& [- u! g0 S+ Z( c1 z, L - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
5 g7 \6 I1 ~' }) ?2 p% P - .text:00401147 ; sub_4010F0+C↑j ...
/ \- K. P9 h8 ]( I - .text:00401147 xor al, al
5 k$ ]/ S$ ?7 S* n - .text:00401149 xor edx, edx
( W9 O3 u" z$ S - .text:0040114B test al, al& h: @: L! j! u% W, c
- .text:0040114D setz dl7 e/ P( C7 m: k$ v
- .text:00401150 mov al, dl
' M: k- P `3 O* i$ F - .text:00401152 retn 4
1 [2 x, m2 D+ Y! h7 q - .text:00401152 sub_4010F0 endp
w& k+ J/ w+ Z - .text:004011526 J& K j& D' U/ M8 `& S
- .text:00401152 ; ---------------------------------------------------------------------------
3 v. A8 Z3 V- K6 j9 b - .text:00401155 align 10h2 _4 T# D% I, @0 q1 r H3 W, N
- .text:00401160
- S% p3 X5 d8 o3 \# J& ] - .text:00401160 ; =============== S U B R O U T I N E =======================================' s- h( Y M M k' J3 c
- .text:004011609 `$ Y+ J0 Y `1 X# S# ~: b
- .text:00401160
$ X2 A' X3 M# c, H2 u% M+ g - .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p- m/ A' Y% i, Y& B7 `; q; }
- .text:00401160 ; sub_4013F0+C↓p ...
5 e& F, S3 z7 m5 X8 O# B - .text:00401160) `3 }$ A4 ?& A
- .text:00401160 arg_0 = dword ptr 4
k! \4 m1 q4 @7 Q - .text:00401160; T5 L) v( g2 O. w1 ^- F
- .text:00401160 push esi
1 r0 O& @. r: w# J& e) I' r - .text:00401161 push edi1 C2 _( a6 u& \4 h
- .text:00401162 mov edi, [esp+8+arg_0]2 ?0 K) z: L( d( R: {( s" B- q
- .text:00401166 test edi, edi
7 N. d& ]0 r8 d0 y0 Z - .text:00401168 mov esi, ecx
; U" N7 P0 X6 u/ g( `& I - .text:0040116A jz short loc_4011CA
, V& k2 T" n$ u9 o& Y E - .text:0040116C mov eax, [esi]) o0 F* c1 w9 {- A6 w
- .text:0040116E cmp edi, eax( M* K5 i7 o. f4 L8 o; Y" n0 c. s
- .text:00401170 jz short loc_4011CA! p0 P, x# D& p5 \ e8 _
- .text:00401172 cmp byte ptr [edi], 0
" q4 Y0 j: I* G$ g9 n - .text:00401175 jnz short loc_4011A2
2 V2 K/ i, {( W9 w3 R - .text:00401177 test eax, eax
- w& }6 ^ H$ T - .text:00401179 mov dword ptr [esi+4], 1
1 ~3 P# {9 W1 z - .text:00401180 jz short loc_40118B) p6 i$ ]8 s: Z3 f1 l
- .text:00401182 push eax ; void *6 ? A- K5 }) X9 Q
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
; L7 ~3 o3 M L8 w/ A - .text:00401188 add esp, 4' c( C6 k/ D% p( M- p
- .text:0040118B- _4 O1 v! Y& Z
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
# c, B b' L- E- h; N* X) j - .text:0040118B push 6 ; Size
+ M2 T1 p# ^+ f$ q( P - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
k2 s# @. m0 r# [6 y - .text:00401192 add esp, 4
$ G( m4 L- v! X - .text:00401195 mov [esi], eax
0 U. H& ?4 ~6 D2 \ - .text:00401197 pop edi% w9 y3 n2 }4 l; [' p5 ]
- .text:00401198 mov dword ptr [eax], 0. m4 a/ ]: r. P' V' ?6 X5 M- U5 y
- .text:0040119E pop esi
' ]' z( T( @6 |' {2 [ K - .text:0040119F retn 4
- e' d+ V$ H) ^& `: l0 D! L - .text:004011A2 ; ---------------------------------------------------------------------------
3 k q3 M5 L C2 s - .text:004011A2
: ]# Q/ h1 u K. k* x - .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
( b5 x* b6 W' l2 n- \ - .text:004011A2 mov eax, edi$ Q3 G1 S' Z; @2 l% V& I
- .text:004011A4 lea edx, [eax+1]
9 Q" P3 @9 q9 z9 D. { - .text:004011A7# D2 b. o! B& h% n Z
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
$ E y) ~; ^9 H5 D% E - .text:004011A7 mov cl, [eax]
* U7 V* i# m! F: _9 V - .text:004011A9 inc eax' `, t( g l, y) }7 z0 v( J# `# [
- .text:004011AA test cl, cl
% |- C( P: `/ r7 q6 m5 \ n, R - .text:004011AC jnz short loc_4011A7% U# l- h& l) h+ a7 y
- .text:004011AE sub eax, edx2 t) g7 a% J( s4 Z/ D6 G/ u
- .text:004011B0 push eax
& r# x! E7 s2 i% H/ x- g - .text:004011B1 mov ecx, esi
) ?: _) C9 y( A7 y, L - .text:004011B3 call sub_401030; W/ u( e9 M" R& p5 g/ h6 A
- .text:004011B8 mov edx, [esi]- ?6 v* i' r5 V0 F4 V# I2 m
- .text:004011BA mov ecx, edi/ i E% k' S1 q& P! p! b+ J5 {
- .text:004011BC lea esp, [esp+0]) R2 a6 d4 p6 | e) _' p' [: c
- .text:004011C02 J! g5 u, r6 \
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j& U7 }6 }2 B5 ~/ x3 j
- .text:004011C0 mov al, [ecx]
- F9 q9 q5 r* B; z - .text:004011C2 inc ecx
5 K9 z- I" p( u3 c6 E6 O. c; T/ g7 l [ - .text:004011C3 mov [edx], al
# D: `5 U- b+ M7 c - .text:004011C5 inc edx9 F: H% x9 O: |
- .text:004011C6 test al, al2 s1 Q3 A' u0 ^) j, V
- .text:004011C8 jnz short loc_4011C05 l2 R* B5 O* G
- .text:004011CA" J. d, }/ W$ R% P+ |' |! e* J0 W9 J
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j9 Y3 n9 `5 f* y7 B
- .text:004011CA ; sub_401160+10↑j6 |0 S3 r# v5 Z" Y8 t
- .text:004011CA pop edi
0 g5 c) t3 S+ E - .text:004011CB pop esi+ R' y1 `* }' @9 ?
- .text:004011CC retn 4
# K8 t: W0 L! l: D B" ]# o - .text:004011CC sub_401160 endp
7 f" d2 q' M2 E6 }/ o" s0 W- f4 l - .text:004011CC6 U/ w. f2 \* O `
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
3 U! c7 ~' m& f( C8 Y8 |
& `% l3 `' |1 h' b( U0 Q
1 K/ T ]1 [& a Q& }9 c/ L1 B |