本帖最后由 shane007 于 2023-8-27 13:23 编辑 v! H4 A/ ^' A* s2 C M
1 Q1 [* y; M" ?3 j8 p2 k本游戏采用了CEGUI,该组件能采用directx和opengl。+ d+ s" \0 b9 [/ @' B1 v
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。; Z* `0 e' Y1 f g+ q2 c7 {7 Q% v0 p
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
. Y2 K6 k( M7 e/ m. _(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
4 d; v$ o4 A S( W7 ]! k6 h: M/ ? ]6 J& }( n- ^; X1 p4 [
/ M3 k* X. ^' X; o% R" L6 ]+ J
在游戏中找一个字幕,在以下地方断下。
$ ?, I; V8 S, y* x由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
3 P, W% G7 e, F9 u/ A0 j6 D. k因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。! N! R0 X( g7 o P; k
0 c& r8 Q9 P6 M$ m& Q- NextLife.exe+11C5 - 42 - inc edx
& X# w/ h. w2 J# b9 x6 l - 004011C5
复制代码 % q U4 r5 G; t" L" ]; c. d0 s
5 X l; C. C5 \% E$ T* R* c该地方的伪代码# J5 S7 x4 H' v1 D8 f
- void __thiscall sub_401160(char **this, const char *a2)- \, P+ X* U4 ^& z6 p: s
- {& D/ a' }0 B- |: \* V+ {9 I: T2 G
- char **v2; // esi
8 f& a4 ~ ^% n! v; M5 | - char *v3; // eax
5 E4 A4 \0 \+ O/ F; `6 ^) d - char *v4; // eax% N% d- x% {( Q! Q B! n
# O' {& M+ y0 f- v2 = this;/ `1 n. F% g6 i' O
- if ( a2 )
. Z7 D7 d6 W+ P# q5 @+ S% y6 n - {
+ G8 u! N0 ~5 g7 S3 L9 d - v3 = *this;% o z- Y( A/ V. \0 V
- if ( a2 != *this )8 G$ C9 c9 N M
- {. w" W) H3 a& n2 R* x/ g7 E
- if ( *a2 )
& O4 Y# a; b" a& L% h - {+ B: h2 c* f! F% k8 n4 a5 x7 N
- sub_401030(strlen(a2));9 B' s$ x+ `! z: ]! O4 U* Q& N
- strcpy(*v2, a2);
; k* d) B# ?9 z - }3 [ s) t8 h4 u% ~" n
- else) S) Z5 C" @6 m+ F8 m3 H5 c
- {
) w$ d3 l4 _3 z6 s - this[1] = (char *)1;% X, X% w4 h; d1 Q8 t% q) F
- if ( v3 )5 P( W* i. L3 @0 z
- operator delete[](v3);" X- [4 T6 z3 R3 R6 ?" M+ ~
- v4 = (char *)operator new(6u);
+ _) W# Y4 P& J' h) g: X! C! ? - *v2 = v4;& v9 w+ Q* e6 E% V) u0 j* P
- *(_DWORD *)v4 = 0;" a: M0 Y* a9 w4 F4 c! H
- }
6 |' M' w: z$ L: _ - }/ u+ ]. Y: w# Q& | }7 `3 G
- }
7 R' j. x& j& G% W( k9 g - }
复制代码
* I5 b, b& t1 O5 k- x汇编代码 V0 C: B- e1 D: v" D7 m. w1 ]7 J
- .text:004010F0' z& p `4 \6 _7 m/ T- x
- .text:004010F0 ; =============== S U B R O U T I N E =======================================$ \* c8 }0 n' t) K _9 G" B1 X
- .text:004010F0
9 E T' Y3 u L, Z/ q1 q: O - .text:004010F0
, I- P, d9 ^6 p: J. h% d - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p2 _' T9 a3 `1 A7 z; q; \" W
- .text:004010F0 ; sub_403240+97E↓p ...9 n$ G& S3 h% ^) _# B
- .text:004010F0
: t* L; a: F- O2 N1 Z. Q: W* T - .text:004010F0 arg_0 = dword ptr 4
1 v) o* ~( ~1 p+ L - .text:004010F0
$ {) E' o; J" h8 N( p% ~ - .text:004010F0 mov eax, [ecx]
6 z3 {% |, F& q - .text:004010F2 test eax, eax1 n/ d! {( t8 ~3 d1 C+ s+ ^
- .text:004010F4 mov edx, [esp+arg_0]/ S- @' {% ]& {
- .text:004010F8 jz short loc_401147' X# }; A& J, {" w; ?
- .text:004010FA test edx, edx2 D. ], w9 \- H6 H! {
- .text:004010FC jz short loc_401147' i9 r1 k% p$ ~3 k+ L5 E$ h2 ~( R' @
- .text:004010FE mov cl, [eax]$ D- K5 {$ H$ ]- v ~: J$ B" B5 \- o
- .text:00401100 test cl, cl+ u; s' o$ |" s5 K' F7 F8 y' I
- .text:00401102 jnz short loc_401116
% j, r, z6 S/ n! l; U$ L - .text:00401104 cmp byte ptr [edx], 0
! g0 m7 U$ q) c$ l - .text:00401107 setz al
7 L T0 N/ A9 X0 f - .text:0040110A xor edx, edx
; h7 Z4 N9 t j& q. E1 a - .text:0040110C test al, al- h" w7 z5 T3 D; l( V
- .text:0040110E setz dl! ~* _6 m& C7 w, v6 a- ]
- .text:00401111 mov al, dl5 N% U: ^0 B. }0 n
- .text:00401113 retn 4- i' E5 W# _; h2 Q. Q+ Y
- .text:00401116 ; ---------------------------------------------------------------------------
A2 W# c" K- A* D, j3 |* y - .text:00401116
* Z) _- R- ]9 i$ Z - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
" Q- Q' w" a9 W - .text:00401116 cmp byte ptr [edx], 0
, ~8 j1 c9 v/ v- `7 b! @8 _ - .text:00401119 jz short loc_401147" D( P5 @3 E1 ~6 v+ I
- .text:0040111B jmp short loc_401120$ Z% U6 Y7 F0 h4 }+ T& N
- .text:0040111B ; ---------------------------------------------------------------------------: z/ y7 y; I; O- _" v" q
- .text:0040111D align 10h
$ v+ z( N4 N* h! O - .text:00401120
- M0 N H C* J - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j0 ~: t. M- [- J3 m
- .text:00401120 ; sub_4010F0+3B↓j. I2 z3 V( r3 v# u; `
- .text:00401120 cmp cl, [edx]
4 v# R4 h. W2 w - .text:00401122 jnz short loc_40112D
9 R( d9 @ n8 L7 J - .text:00401124 mov cl, [eax+1]3 ^6 s+ U. W1 W2 p2 c/ c# C1 x
- .text:00401127 inc eax: k9 ], U& `0 y4 O
- .text:00401128 inc edx# f5 d, R4 G" v% l7 h
- .text:00401129 test cl, cl! s6 M5 p+ M' A; M7 C
- .text:0040112B jnz short loc_401120
, P( e9 h+ }7 @/ H+ b, ` - .text:0040112D
0 j: L# A( m9 V7 l% f5 d - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j- r0 e4 O; K1 P
- .text:0040112D movzx eax, byte ptr [eax]. D% n+ \1 v5 d! j Q: m
- .text:00401130 movzx ecx, byte ptr [edx]1 ]" S/ e6 z4 g2 t/ x/ r* `
- .text:00401133 sub eax, ecx
e, C0 A* F$ o5 _) c6 x3 t - .text:00401135 neg eax
# I1 ]6 [; t" B# @0 Q0 i: {- x - .text:00401137 sbb al, al
3 R+ l! P3 v* m6 I3 m/ I0 ? R - .text:00401139 inc al2 b% _! d& a8 Z
- .text:0040113B xor edx, edx
0 t+ A1 G5 }% `) z - .text:0040113D test al, al
% ]( ?2 W1 v* n* w* m8 M9 ] - .text:0040113F setz dl
# V T4 R+ c { - .text:00401142 mov al, dl8 `+ X2 F! J% c( i- K+ R3 D0 a8 {
- .text:00401144 retn 4 c/ m o/ @' d: z( o" v7 S+ N2 m) e% P
- .text:00401147 ; ---------------------------------------------------------------------------* b4 [1 S7 I+ G0 R3 r% U
- .text:00401147* n! K$ \7 |; S. n% `2 z( g- ]
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
' p1 P& J/ B# e8 v w" y1 s - .text:00401147 ; sub_4010F0+C↑j ..." D3 E% f% J, z8 P8 ]9 s: D
- .text:00401147 xor al, al$ ^, { A4 g/ W# } D( k" T
- .text:00401149 xor edx, edx1 s. ]% P/ |9 M; L& |7 e5 E
- .text:0040114B test al, al W, a8 V, t# D9 [
- .text:0040114D setz dl
& ?& ^/ ~$ p7 p- Y* A* S4 c" d8 U, z - .text:00401150 mov al, dl# h: `' ^, k1 E
- .text:00401152 retn 4
* x9 `5 G. Q! w5 r1 }* F - .text:00401152 sub_4010F0 endp
+ n" n* [' K8 o& Y5 Z2 L - .text:00401152& `' V2 ~+ E! g, |
- .text:00401152 ; ---------------------------------------------------------------------------$ P1 h) }1 C5 s5 G9 r: q
- .text:00401155 align 10h
0 N2 \% N- {+ F& b) D6 [* q - .text:00401160! ^5 x2 o' V; \4 _, Y* u" z3 X4 N9 v
- .text:00401160 ; =============== S U B R O U T I N E =======================================. | U7 r/ d4 G5 j
- .text:00401160. [6 z9 W0 y' X; t' L# r
- .text:00401160
1 }9 F, Y- g; R& s- ~$ ~ - .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
; Y3 S0 I0 u5 G - .text:00401160 ; sub_4013F0+C↓p ...9 K9 @# Z' C2 s% @ y7 j0 O
- .text:00401160
; S, \3 U' k* p4 @ - .text:00401160 arg_0 = dword ptr 4
- p$ W( O1 x4 Y. N$ p- Y - .text:00401160' D: D# ?1 ^: Q1 N; a8 `5 w
- .text:00401160 push esi" Y! o; o2 b- b6 s0 K
- .text:00401161 push edi
/ u: N" I: |& e. F C! ` [ - .text:00401162 mov edi, [esp+8+arg_0]1 P0 y7 I. ]7 @0 C/ S* f0 Q- E
- .text:00401166 test edi, edi
/ g* @% [) O9 _$ `- S - .text:00401168 mov esi, ecx
R1 @0 u6 R, N1 j. D: c; }% X6 F) H - .text:0040116A jz short loc_4011CA& h; [2 G$ C" @
- .text:0040116C mov eax, [esi]
1 l* |3 @, X, f - .text:0040116E cmp edi, eax: ~% R$ T3 T+ I; D7 \7 |: t) i$ V
- .text:00401170 jz short loc_4011CA6 }7 ]9 \7 J+ F I2 a+ c; ?
- .text:00401172 cmp byte ptr [edi], 05 Z) v4 J3 s) o0 i) G' j7 a$ Y* _
- .text:00401175 jnz short loc_4011A2
7 I5 [# O# r3 N* O8 M - .text:00401177 test eax, eax
9 ~6 F& p! x8 s2 Z9 Z5 X - .text:00401179 mov dword ptr [esi+4], 16 e% H% T# o0 k, v0 R
- .text:00401180 jz short loc_40118B
4 q; @' {0 ?/ P- k( ~# ? - .text:00401182 push eax ; void *
1 Z/ V+ x% x1 ?/ Z" I: G6 u6 l- q - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)+ H" r+ n a" L: t8 b% t) [# A" q, W% n
- .text:00401188 add esp, 4
4 E. S/ |# p8 ]8 w8 L! m* S - .text:0040118B3 T3 m& d, ]3 r8 g! Z
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j! [$ k) Y u/ d
- .text:0040118B push 6 ; Size
1 ]% M$ N$ x' Z. V2 p: m - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
$ b- L+ [6 p0 {2 u% A - .text:00401192 add esp, 4) `3 ?0 d# I, C% Y# p3 j
- .text:00401195 mov [esi], eax
0 w* B5 T6 \+ A: z3 f - .text:00401197 pop edi- P) z8 p* U' Q4 B9 j
- .text:00401198 mov dword ptr [eax], 0
( S5 C. D4 Q0 e1 ~' y1 } - .text:0040119E pop esi
* V( Z! y) U+ D4 J4 ` - .text:0040119F retn 4/ _8 m& M$ P5 i* q& @1 @ s
- .text:004011A2 ; ---------------------------------------------------------------------------- f: ], b2 i0 G0 L+ C: o! J: z
- .text:004011A2: b9 i1 ~7 z5 ]8 f* Q; y! e! H
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j% F4 A. A; s: [
- .text:004011A2 mov eax, edi
/ u/ l u4 d, E5 L - .text:004011A4 lea edx, [eax+1]5 z9 L) D* i. a& \
- .text:004011A7/ ~3 ^: k8 p" A2 |
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j; M2 a. n( A7 o9 j) {* v6 x7 C
- .text:004011A7 mov cl, [eax]
' \. s: g1 P% y; e. z4 N - .text:004011A9 inc eax
0 p9 d7 c' U3 P8 }" C9 { - .text:004011AA test cl, cl
3 M8 F. U) p2 ` G! d+ S - .text:004011AC jnz short loc_4011A7
( G9 Z5 U* s% B4 A9 Q# H - .text:004011AE sub eax, edx) x7 {4 U, X: J- S( \. B
- .text:004011B0 push eax
' u R0 M5 d R# K - .text:004011B1 mov ecx, esi9 x3 y; ~' H+ X
- .text:004011B3 call sub_401030
8 y6 [ \7 _: v - .text:004011B8 mov edx, [esi]
( ~4 c) } I2 b8 j- |- N* N - .text:004011BA mov ecx, edi
! s% n* }* f8 Y1 x1 E/ f6 M - .text:004011BC lea esp, [esp+0]
) B; R# I8 A- {$ G" j: m: J8 M9 r - .text:004011C0
4 k' D& K4 G' D' U) @ - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j# \1 ^% D+ U, f5 ^1 [& t- x u
- .text:004011C0 mov al, [ecx]
) U d+ A( W) O$ \1 M( A: c& X% B! C - .text:004011C2 inc ecx- `% y& [& E: h( T6 j
- .text:004011C3 mov [edx], al
6 k z* ~5 \- L. O, P* q! T8 e - .text:004011C5 inc edx Z; o4 y9 G* y1 P
- .text:004011C6 test al, al0 X- y1 O) M' b# X
- .text:004011C8 jnz short loc_4011C0
; J* s. w/ @1 |0 | - .text:004011CA: U, L- [2 s" W4 d) w0 L
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
& j$ s' L+ g7 k - .text:004011CA ; sub_401160+10↑j
: Z7 d" }3 n* C1 ~( }3 _3 t* _; w - .text:004011CA pop edi" K6 P0 H9 ?# D$ S
- .text:004011CB pop esi- F* @! q* x1 ` v& W- B
- .text:004011CC retn 4
6 Y/ a( Q; U1 E3 v; Z: E+ i3 L1 q - .text:004011CC sub_401160 endp
7 @+ ?6 b: p% n6 N4 c) J - .text:004011CC
4 h3 N& o7 {' L2 C - .text:004011CC ; ---------------------------------------------------------------------------
复制代码 & @! N; |6 o3 @8 B8 r4 P
0 H. i5 u; W I
( F1 e ^4 y' n% k' y
|