本帖最后由 shane007 于 2023-8-27 13:23 编辑 6 l) b2 I7 g, O) D6 |
6 s' i5 D9 [7 C" v1 S+ g9 `
本游戏采用了CEGUI,该组件能采用directx和opengl。
: a( m; t- w' \0 T经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
* A( D8 }! ?2 `# v* \ `游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。: W I* A% d' u, K2 F- {
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
" \3 D$ e2 S4 v" {% a$ }& u) a8 @/ K2 ?' _1 ^# y7 [
7 z2 x8 h+ R8 X: j! Y
在游戏中找一个字幕,在以下地方断下。
9 x* c; P5 F* Z- s! `由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
0 `- {9 A& v, p' r) l7 r. Y; e3 Q( M因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
4 J( @5 [$ s2 U7 X9 a6 c+ u
3 m* a/ R( J& t' j, U- NextLife.exe+11C5 - 42 - inc edx
" j6 x/ r, A0 C; Q0 n - 004011C5
复制代码
4 E- E: w& h! D! \3 [+ G
8 U3 d Y Z K1 C4 ]7 ^( k6 ]该地方的伪代码
. \7 X4 F( [2 W% _& u- void __thiscall sub_401160(char **this, const char *a2)
/ m8 |. g" v+ p - {
4 p# Z( x, e( A$ K7 B9 ^; C - char **v2; // esi; B+ v& g4 {% t* p; Q# X5 W% N
- char *v3; // eax2 l3 n4 E8 p& U! @+ q. \! G4 {
- char *v4; // eax
+ f, r: P8 [( c- A, y
4 p: M( N8 @7 y, G# {9 k5 o m- v2 = this;8 J$ I% A5 o3 b$ J3 b1 B7 C( T# A
- if ( a2 )6 ?; D4 g, Z. B
- {4 x. ^/ p6 J7 C5 U$ V0 H
- v3 = *this;' R) H1 }6 w/ D4 F% J0 W
- if ( a2 != *this )' ]5 r' T d% T0 A$ Z3 P3 d
- {
$ I5 B, s, K: I: m% p s0 J# O' G - if ( *a2 )
) ~+ r& A# `. d U+ Y& z - {
7 n0 m9 A5 R- q. k/ V" ? - sub_401030(strlen(a2));/ g0 ^4 j9 t4 O/ e
- strcpy(*v2, a2);
& ~, R% j( i! P$ p* f - }" R) D0 ~3 [. A1 N- O* h
- else+ [ b' M2 y5 u- h# q' U w6 \
- {' d& U2 y) m/ z& I; M* I6 O& X
- this[1] = (char *)1;5 Z5 i7 w% w R3 @; G
- if ( v3 )* z! o) n9 W$ p) V2 T" M$ t
- operator delete[](v3);- J7 T. S( j6 f# `; _1 H
- v4 = (char *)operator new(6u);: @1 y/ C8 P* W# {$ X, N3 I0 h
- *v2 = v4;
2 i! U% m9 ^& D9 |% p& F" t' u1 V - *(_DWORD *)v4 = 0;; F7 ` G- {) q
- }
# Y6 v- W. A2 D: ~8 [) M, a - }* V e8 ^) ]5 U* I& R+ O0 ]
- }
% M2 P' W6 u+ ?' L: P/ q" ]0 M | - }
复制代码 8 w" M E" j/ L* I3 d
汇编代码/ ^1 `- o: C5 p6 Q) p# S# E
- .text:004010F06 ~5 a( F2 \3 x3 K( W
- .text:004010F0 ; =============== S U B R O U T I N E =======================================
% g C0 `' G' w; J7 E8 u - .text:004010F0
: V( Z1 c) W5 C8 A0 r" f - .text:004010F0
$ H% `6 Z6 \/ v. B - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p+ I9 K+ s @; t, K5 D8 [
- .text:004010F0 ; sub_403240+97E↓p ...; F: u; h/ s- p$ x7 }0 B, V. \1 M
- .text:004010F0
; J: d% h& X) w% r/ }% i. s4 U - .text:004010F0 arg_0 = dword ptr 4
- n# k; r$ [$ n' w - .text:004010F0% S& G9 o7 }8 W% v; u T. G
- .text:004010F0 mov eax, [ecx]) l8 R5 u& N8 q
- .text:004010F2 test eax, eax \" P" c" k3 U: U0 G( j
- .text:004010F4 mov edx, [esp+arg_0]/ W/ J8 l$ | E
- .text:004010F8 jz short loc_4011475 }- L+ Y5 D% j2 k! i
- .text:004010FA test edx, edx
4 N$ h6 _3 U- o4 h9 t6 B - .text:004010FC jz short loc_401147- ` W0 ` b. Y. M7 ]
- .text:004010FE mov cl, [eax]$ {% a" P0 Q8 a( z* V
- .text:00401100 test cl, cl8 E# b" ^: q$ s7 X' b+ U3 A$ S. r/ {3 X7 W
- .text:00401102 jnz short loc_401116& I! f* _0 ?& S. L. E7 v$ |# a. i
- .text:00401104 cmp byte ptr [edx], 0
: ? f0 a, _/ p6 O, ?3 s5 H3 k - .text:00401107 setz al
, q, P6 \, V/ K/ r - .text:0040110A xor edx, edx ^# e; f' k( h. |1 H
- .text:0040110C test al, al
% c5 m! t; Y9 f' z( L1 T - .text:0040110E setz dl' y' L1 x/ K4 |6 Y% e
- .text:00401111 mov al, dl
. V4 \' }( B% h - .text:00401113 retn 4
. P! `; ]/ l4 I; K - .text:00401116 ; ---------------------------------------------------------------------------2 a) \5 x3 ]7 Z# W+ k+ f
- .text:00401116 T. g8 v$ F8 I# X9 G! O
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j9 N9 k+ L' }1 \7 L
- .text:00401116 cmp byte ptr [edx], 0$ `4 _( A' K: @ B/ e
- .text:00401119 jz short loc_401147; a; V. ^3 v+ _ `3 m7 R8 d
- .text:0040111B jmp short loc_401120
: ]8 S F8 X1 T# Y* Y6 T4 c - .text:0040111B ; ---------------------------------------------------------------------------
* H' w# c0 G+ h - .text:0040111D align 10h
1 _! B* l; B8 N0 E - .text:00401120$ V7 O7 O6 |$ i
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
& p1 [) g' C& l6 K; }4 j - .text:00401120 ; sub_4010F0+3B↓j
z1 [8 d; H4 { U1 ]/ [ v - .text:00401120 cmp cl, [edx]! T3 Q* p: S1 N
- .text:00401122 jnz short loc_40112D
% l4 ~0 `" s' E4 X$ b - .text:00401124 mov cl, [eax+1]& N! w! j0 t A3 h5 h
- .text:00401127 inc eax; f Y" a3 ]4 w& w: S L
- .text:00401128 inc edx
- S; J: M1 {& t' H# q: \% G - .text:00401129 test cl, cl, F$ o% N- m- S4 J
- .text:0040112B jnz short loc_401120
: F, e! y' n) p - .text:0040112D
7 m, y8 y2 q) a - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
* u4 _0 ^' ?; P" [ q+ Y' D1 K+ r - .text:0040112D movzx eax, byte ptr [eax] E( |0 g6 T! i1 @" J; u% T* t
- .text:00401130 movzx ecx, byte ptr [edx]$ x6 K9 {% {9 U, A$ _3 ~+ b# `, Y
- .text:00401133 sub eax, ecx
5 ]1 Q3 P- I* f* W0 g6 Z$ G4 L - .text:00401135 neg eax& ]3 c0 _+ d3 u: d! D6 @; a
- .text:00401137 sbb al, al
( _$ |7 W+ ?6 p6 ?5 f+ k3 [/ Y! u) h - .text:00401139 inc al5 ~: V. l4 o$ H- a. i
- .text:0040113B xor edx, edx
5 F8 \6 [9 U" b n0 N8 f& z - .text:0040113D test al, al" b- n; V) q: T! H" Z0 g
- .text:0040113F setz dl
Z! x X' t! N, V - .text:00401142 mov al, dl
- C* b6 A2 _& b, @! D - .text:00401144 retn 47 k5 A* d8 ~4 q
- .text:00401147 ; ---------------------------------------------------------------------------1 k6 s7 L+ c7 E7 x9 K
- .text:00401147
6 b8 j7 Y& O3 \' b8 C: m/ x - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
. v- a! G8 P9 u) a7 m b2 M6 d - .text:00401147 ; sub_4010F0+C↑j ..., O. Y) w: H% L6 ]/ \
- .text:00401147 xor al, al' |9 u4 F, [8 N6 ^; c* x8 r3 g
- .text:00401149 xor edx, edx0 Y1 `4 f0 a2 G C* r. Q
- .text:0040114B test al, al$ U; v2 t/ ^& m: f$ p
- .text:0040114D setz dl# u# O1 r- P! k8 }
- .text:00401150 mov al, dl
+ w8 R7 N5 j/ I& c. j& s0 g( R& ]7 n, I - .text:00401152 retn 4
# K9 i$ z8 z2 u - .text:00401152 sub_4010F0 endp8 Q( \) R; y, m5 d( a1 b% o
- .text:00401152
0 I( f# _5 H K, f - .text:00401152 ; ---------------------------------------------------------------------------7 ~1 M6 J( D5 c9 f% l7 G+ M
- .text:00401155 align 10h! Q* S" `) F1 {2 I5 b
- .text:00401160
b8 a0 g `# ` - .text:00401160 ; =============== S U B R O U T I N E =======================================9 s; |0 X4 i5 J: A& K ?7 z* ^
- .text:004011601 J( G# b+ |/ r0 X v5 }8 J
- .text:004011603 A9 G. U2 n3 c7 }
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p6 g2 N" O3 c0 Y$ o
- .text:00401160 ; sub_4013F0+C↓p ...
% [6 ]% L- G3 o4 D" z - .text:00401160
0 e* ]! m3 C6 L5 S* I. N1 p7 ? - .text:00401160 arg_0 = dword ptr 4
% X# p5 e1 N& ^+ V' B - .text:00401160
1 A5 _4 R* @% [$ B - .text:00401160 push esi
. M6 ^8 y: K& B, t - .text:00401161 push edi0 K2 B( n% G% y) A2 _4 i
- .text:00401162 mov edi, [esp+8+arg_0]" B" b# T; Z7 V% {" G0 C
- .text:00401166 test edi, edi
5 C& {% k. a% |5 w - .text:00401168 mov esi, ecx
" e l6 r4 {$ X3 B, V - .text:0040116A jz short loc_4011CA- b9 y, W) K. Q' V7 W$ D L
- .text:0040116C mov eax, [esi]( P9 f* d0 p9 k) y1 d
- .text:0040116E cmp edi, eax* M2 x$ t3 Q* z8 b
- .text:00401170 jz short loc_4011CA' G7 o8 E7 ~8 S2 f
- .text:00401172 cmp byte ptr [edi], 0
6 P6 u( p) ]& s$ p3 M* n) ? - .text:00401175 jnz short loc_4011A23 t. A1 e5 g& I) d( c" M) |! Z+ z1 x
- .text:00401177 test eax, eax& A j4 y4 n5 z
- .text:00401179 mov dword ptr [esi+4], 1
* B# A+ J- Y2 d; K+ m6 r( o - .text:00401180 jz short loc_40118B
. s m7 E4 ?( G, P - .text:00401182 push eax ; void * @! t/ ]# o0 y7 f
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
+ g9 a1 R% P7 X - .text:00401188 add esp, 4
4 x1 g! a- N2 s0 M8 n1 n& u - .text:0040118B, k7 t9 q0 Y6 V; y- d+ Z! ?
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
8 j# ^. s& [+ o2 s5 ]0 ?6 n - .text:0040118B push 6 ; Size
5 }3 r ]; c: z. }* {& _ - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint). U; f9 h' P0 c$ w: K3 K
- .text:00401192 add esp, 4; G! v( d3 |' w; \
- .text:00401195 mov [esi], eax
( z! M& Q* K$ U$ f2 G; S - .text:00401197 pop edi
& c; P3 E) n/ `1 D - .text:00401198 mov dword ptr [eax], 0
4 _3 ~7 k8 n2 `0 a* i) w5 H - .text:0040119E pop esi
3 v- j8 O# A$ z! L - .text:0040119F retn 4
; R4 k4 W4 S/ d, T- H) {! ~ - .text:004011A2 ; ---------------------------------------------------------------------------5 ~% B. ^. L" Z, d9 w# p8 \4 @
- .text:004011A2( p9 { E7 _* f0 `0 D, n9 |
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j' R2 C/ D. u& F: K
- .text:004011A2 mov eax, edi
0 s: M0 e5 p) [+ }. ]* [ - .text:004011A4 lea edx, [eax+1]' x, l6 P2 ?1 ?, U n: Z
- .text:004011A7. i5 W: P. l i) w+ s4 b: r
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j- K( t9 L9 w. L) Z% g$ p/ q
- .text:004011A7 mov cl, [eax]1 c8 h# [8 T5 Z2 m: k" F
- .text:004011A9 inc eax3 t3 Y1 X% I% o# V
- .text:004011AA test cl, cl
' y9 s% \6 @% Z5 {9 N$ ~ - .text:004011AC jnz short loc_4011A70 c, @! H+ i4 E' g9 n/ {0 ?
- .text:004011AE sub eax, edx. F6 V8 E2 k3 ~9 q1 i& ^0 \
- .text:004011B0 push eax6 W% |* G) Z5 o. _' ]$ u4 }
- .text:004011B1 mov ecx, esi
, l9 ]8 d* Z0 u- O - .text:004011B3 call sub_401030) q) G' q( y4 X# L5 ?: P& H
- .text:004011B8 mov edx, [esi]% C' W+ ~0 m7 ?$ g6 h( }
- .text:004011BA mov ecx, edi7 `$ L7 ?0 V, W9 h1 `
- .text:004011BC lea esp, [esp+0]$ d1 h1 l# Q! h4 v% `
- .text:004011C0; I7 }% ~3 n2 N: \; b/ P( Y
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j. H& y' P6 u$ J4 _& x
- .text:004011C0 mov al, [ecx], m) |$ [9 M) D+ p
- .text:004011C2 inc ecx Z- a9 |3 S! C
- .text:004011C3 mov [edx], al
9 {1 G7 v6 Q) [9 L# t! o - .text:004011C5 inc edx; t& a+ ]( z5 ~$ t
- .text:004011C6 test al, al8 o8 N4 {' M% ?8 K
- .text:004011C8 jnz short loc_4011C03 U. [- b5 {! }. M
- .text:004011CA
4 p" g( u" |8 M' Y$ }1 W- [2 L0 Q - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j, c- ^! ^3 \$ Y9 ~* k; d) `; ^# Y3 E
- .text:004011CA ; sub_401160+10↑j
: h% E' K2 w/ v: Y6 A9 W) o - .text:004011CA pop edi: U& u' o8 [' R# c: z2 _
- .text:004011CB pop esi
6 V2 T, x0 U. l5 I5 n - .text:004011CC retn 4
, m9 `* m9 A$ F# I \; n$ G - .text:004011CC sub_401160 endp0 d+ V! y% S5 ]0 a+ c+ T2 y/ }
- .text:004011CC" j: n4 f. L; u. |! ~3 v) i
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码 % E! ~) n# W" ~! {5 o% J; l* {! k
8 B/ {2 k% ^1 n6 ]$ \; H' T
7 T7 t' n1 m- a; d1 s |