本帖最后由 shane007 于 2023-8-27 13:23 编辑
4 y& Y2 J6 r! M2 g) Z8 s
I3 G8 K" h y H9 ?本游戏采用了CEGUI,该组件能采用directx和opengl。% q! D' |# T% A% C# I2 a `
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。/ A8 u. ~% o6 `, S a* k$ X( |
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
4 S: t- z- v( M @2 W(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)3 o$ q& r/ k" P. B/ ]5 j p1 N" \! k
% C$ Y2 E+ }, @) T& p0 X9 D
1 i, W, w4 l! x: d3 H: S# ]在游戏中找一个字幕,在以下地方断下。$ E& Y. k' K$ E E
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
1 A2 b) V+ U$ ~因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
9 A4 S) l; A9 X& N8 O4 H
- T% U& w: U; ?- NextLife.exe+11C5 - 42 - inc edx
/ X6 a* P0 a8 f - 004011C5
复制代码 2 y, W2 _# Y, J1 x
3 N9 Y$ ?& N0 `1 }1 _
该地方的伪代码- R, g y6 Z" t7 b! W" H
- void __thiscall sub_401160(char **this, const char *a2)
; B" T& m3 r4 g9 D, c - {$ [; N: v1 f; u/ a8 D: S
- char **v2; // esi9 \9 d9 f( {$ T; c4 V- j
- char *v3; // eax5 Y* C" r( z: i; J8 ~& x- z, h
- char *v4; // eax
: S c; _ q& p% l0 w$ w* b' N - # i7 Y, g' w- X
- v2 = this;
1 ?' P7 P; N9 H7 }- ?$ T1 L2 s - if ( a2 )
: g8 \' U+ i7 U. E, l( ^. e2 F - {; b. v! a* k% n/ P8 ^
- v3 = *this;
" c; [# u/ ?% _0 i/ d& l - if ( a2 != *this )
& T! q( l5 z$ p e3 m& m. ` - {) K2 O2 w- N) ?0 V- m" v8 u( a# X1 _
- if ( *a2 )
! N3 S, r- t& e( C - {0 M6 N; C) f7 Z6 z0 x3 E
- sub_401030(strlen(a2));
7 ~$ X @3 h# d/ V- v+ I4 C - strcpy(*v2, a2);
5 i2 J. I, L' i& F1 o - }
% Z! L# z0 Y6 w3 W) D$ B4 ~# Q9 a - else
) m' h: A2 C# A# d% l6 J$ v - {
" C! g- j, A7 m7 ^8 v) n% Q/ Y4 T - this[1] = (char *)1;' H! k6 v; n; @5 ^+ @3 a4 e
- if ( v3 )& E; s- t4 ^( b( w% N7 N. w
- operator delete[](v3);
" B% }8 G! T0 Y/ [+ ? - v4 = (char *)operator new(6u);
" `% l7 C4 j: T2 B1 x% U1 J - *v2 = v4;
! Z9 V' v4 L1 D& C - *(_DWORD *)v4 = 0;/ m h0 X) _1 |/ J4 i/ U N3 m# \
- }( C, y; s6 d* }# V2 j2 Q% s
- }3 u9 K5 T2 w! c, ]' g# H
- }
$ P: T( z8 V; I: Y: | - }
复制代码 5 \9 K. n+ Z5 x$ M4 q$ J/ {& j# d
汇编代码
4 z# e# R8 h4 S( f- .text:004010F0+ m# l% ^+ Z1 y0 R' z# i1 T& J
- .text:004010F0 ; =============== S U B R O U T I N E =======================================: y+ u0 z; M) p5 d R
- .text:004010F0
* ^5 y3 p3 [0 t! M - .text:004010F0. \5 r& |4 \# u! D# G- p% A, @8 Z3 r+ e# u
- .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p! W. A( A* H" v( M. ]0 n, [
- .text:004010F0 ; sub_403240+97E↓p ...- n9 R y' g5 p5 K8 H) V
- .text:004010F0" | d( ^# N$ l5 J; U/ P( [$ {
- .text:004010F0 arg_0 = dword ptr 4
4 K+ x: W5 Y3 E+ g; P" e - .text:004010F04 p7 |' N; {; s0 n
- .text:004010F0 mov eax, [ecx]
: L9 c- T0 D! I; Q' @" ?; Q. f6 e9 Y - .text:004010F2 test eax, eax' q9 v& s- t( s# ~
- .text:004010F4 mov edx, [esp+arg_0]5 C+ T* e; g1 z' k0 o1 D+ D3 \
- .text:004010F8 jz short loc_401147
1 G$ n& K2 t D8 G' a/ n! [+ d - .text:004010FA test edx, edx' V+ Q& S) X& z! z% m
- .text:004010FC jz short loc_401147 z9 P- Q1 O* c+ w1 c* Q
- .text:004010FE mov cl, [eax]" V8 O3 [& t+ D) F* Z" C
- .text:00401100 test cl, cl/ J5 n. Y/ @' O/ C
- .text:00401102 jnz short loc_4011162 A- s" k! S: H* P( q
- .text:00401104 cmp byte ptr [edx], 04 L3 q/ D; k! n3 m
- .text:00401107 setz al
7 E( i" v+ z6 g/ p( Z3 R+ m - .text:0040110A xor edx, edx
+ H" A! T% L7 s/ \3 e/ ? - .text:0040110C test al, al
# L5 ~/ [* c9 @# u, s$ E4 \ - .text:0040110E setz dl
% F; K- u+ t" K# [2 h - .text:00401111 mov al, dl
& \3 j7 i$ H/ ~/ t$ Y- e - .text:00401113 retn 4
, y- R8 s6 ^% e( x+ p& j - .text:00401116 ; ---------------------------------------------------------------------------
6 [9 m) y# |/ L2 j! Z1 ? - .text:00401116
) C$ J; E# h+ j, t* D - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
# e8 N7 W8 [; s5 A1 K - .text:00401116 cmp byte ptr [edx], 0, Q, j! w% n# W; \
- .text:00401119 jz short loc_401147
9 R9 |5 L3 }1 a' C' G; N - .text:0040111B jmp short loc_4011204 W1 }7 D. g( w$ C# {
- .text:0040111B ; ---------------------------------------------------------------------------+ \4 y) \, Q5 w
- .text:0040111D align 10h/ l% Q) a- z9 c/ l: Z: }1 ~
- .text:00401120
( c4 l# [1 Y* `) s$ v' f" _. n - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
; K9 l( A9 ?3 b, A - .text:00401120 ; sub_4010F0+3B↓j0 A' O; I; T4 H# W% `
- .text:00401120 cmp cl, [edx]
8 c5 a/ R0 w$ f# I! H - .text:00401122 jnz short loc_40112D
1 D3 S, b/ S5 g0 O' _2 w7 b' ` - .text:00401124 mov cl, [eax+1] Y3 \! K4 j5 l! A5 X, O) \
- .text:00401127 inc eax
7 j* c* O% g8 A, W9 A% k% r - .text:00401128 inc edx1 _, M- [0 C, D$ }
- .text:00401129 test cl, cl# T- j& X7 F& w/ p: K0 V
- .text:0040112B jnz short loc_401120
8 w' l2 U+ x3 M4 V1 n - .text:0040112D3 D+ W6 n* l6 n! h1 L
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j0 ?9 ^/ n7 u5 |
- .text:0040112D movzx eax, byte ptr [eax]* i5 d) h9 s5 X+ S" s4 K
- .text:00401130 movzx ecx, byte ptr [edx]& G# O( o- u: p6 d0 z& w
- .text:00401133 sub eax, ecx$ [1 t2 z# `0 l/ ?( ^6 L7 ?
- .text:00401135 neg eax
' n1 X; D- W S8 W! @; l; `0 ^0 L - .text:00401137 sbb al, al7 D! z$ N2 @- F
- .text:00401139 inc al
$ ~3 p# m7 j0 E6 j: d9 P) ? - .text:0040113B xor edx, edx
! L0 x& C* b0 }. z8 L' R1 F2 X - .text:0040113D test al, al
. A9 p+ J, {' u# W: A - .text:0040113F setz dl
& ?% m1 n7 \8 s3 H" _3 y - .text:00401142 mov al, dl
0 G# l% ^7 I2 Q/ U! I5 r - .text:00401144 retn 41 T. m# s; D0 y2 \2 P/ @- e. O7 w' G- E. r
- .text:00401147 ; ---------------------------------------------------------------------------
( k; p3 X# @3 l% z+ g - .text:00401147# C8 p9 | t5 W4 ]
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
G" _7 Z2 Y9 D - .text:00401147 ; sub_4010F0+C↑j ...
# z/ w; d8 j6 P1 b9 ^ - .text:00401147 xor al, al% G7 y E# Q! M
- .text:00401149 xor edx, edx
0 S A2 b3 O$ G - .text:0040114B test al, al
) q- d8 a j5 u - .text:0040114D setz dl
6 y3 N, V! b, [+ U0 { - .text:00401150 mov al, dl3 V$ {5 [2 _& H
- .text:00401152 retn 40 n% ^* X7 S# R) f
- .text:00401152 sub_4010F0 endp g$ i% m) ]- Y& ?' F9 [& t N
- .text:00401152& I% Y/ z# k" Q: j
- .text:00401152 ; ---------------------------------------------------------------------------
p. P! k6 n8 |9 K2 ]7 V' V4 e - .text:00401155 align 10h( K8 U9 }. c- v/ n
- .text:00401160
) j6 @! G# s7 h* X* c: Y/ [% p2 X( O - .text:00401160 ; =============== S U B R O U T I N E =======================================
* H9 Y) J8 \1 ?2 c7 D - .text:00401160
) c" m0 h; A$ B; L - .text:004011600 n" O) Q; L: _3 w1 O+ }
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
: i& G( y! X( n" c - .text:00401160 ; sub_4013F0+C↓p ...
+ S; }1 Z# u2 w0 h! s* B - .text:004011609 X! ~" e- s. c8 r
- .text:00401160 arg_0 = dword ptr 4
) R. k; q' N" V3 p9 A$ c$ Q - .text:00401160
+ Q$ Y2 Y6 S- P - .text:00401160 push esi
% B. ^9 Y; _8 X) F - .text:00401161 push edi, P) n4 S8 h( D) J/ A! s
- .text:00401162 mov edi, [esp+8+arg_0]
) m8 U5 T* b6 G2 f9 x* G: C2 f9 f- T - .text:00401166 test edi, edi
5 E2 S6 x' Z. h/ _) I* Z - .text:00401168 mov esi, ecx
$ {/ U/ V( ^+ X+ P - .text:0040116A jz short loc_4011CA
2 L7 ?/ N4 A) D' y* D- Y - .text:0040116C mov eax, [esi]' h) ~( a+ j* R) R9 w
- .text:0040116E cmp edi, eax
1 W# t2 W* r, d+ [ - .text:00401170 jz short loc_4011CA
9 E8 s6 B; O1 A) D) e& ` - .text:00401172 cmp byte ptr [edi], 0$ a7 s, j4 V( p! j( V- p
- .text:00401175 jnz short loc_4011A21 Q5 A' j+ x( W4 u; ^ p/ ^# A
- .text:00401177 test eax, eax
1 j# m5 E( h# s5 K7 F5 {0 b8 ~ - .text:00401179 mov dword ptr [esi+4], 1
. j/ C( j2 @1 R j - .text:00401180 jz short loc_40118B
, J. { Q3 P# a6 Y4 [- a& U - .text:00401182 push eax ; void *( ?' u5 @/ n; l5 D! J! j
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
9 H* L5 C7 t8 B! T' J* t - .text:00401188 add esp, 4
3 P+ o! R& l% m4 W. e4 G$ S - .text:0040118B
, O* l# J0 M/ P2 K) V - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
) u: h* A; r6 s2 i' f2 G% ~ - .text:0040118B push 6 ; Size$ I" s4 x4 g1 d# l* n- r8 w& B2 E' X
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
7 a* Q( B. w, B e( G* }2 u - .text:00401192 add esp, 4# z+ ?: F$ m6 N; ?
- .text:00401195 mov [esi], eax
% y; d. O( K5 m* g: i F - .text:00401197 pop edi
8 @) a& V2 {# o& h+ w: [- n - .text:00401198 mov dword ptr [eax], 0: k! T* F9 p+ ?0 E( J$ y& V
- .text:0040119E pop esi* b- `7 A# c9 [' P
- .text:0040119F retn 46 f' q, J) @% B/ }2 L9 _
- .text:004011A2 ; ---------------------------------------------------------------------------
2 }: B$ C( i* h( n! L& j" [* Q - .text:004011A2+ C7 q) Q7 V; S1 D! z- m
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j8 b: g2 ^& V# L" c
- .text:004011A2 mov eax, edi: o! b$ |! D0 s
- .text:004011A4 lea edx, [eax+1]
& C& I! n3 i6 V1 c" F6 R - .text:004011A7
7 S0 D6 X# v* z. a% n1 k - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
1 t, |/ a! q2 U2 u, w - .text:004011A7 mov cl, [eax]/ o, I0 Z( h% g7 w3 J
- .text:004011A9 inc eax
8 |" y/ i' s7 D! @6 O" C+ |1 u - .text:004011AA test cl, cl
5 x! P% {+ c% V: m: e - .text:004011AC jnz short loc_4011A7
2 N& {# p9 ~# e - .text:004011AE sub eax, edx# @, D6 P7 s2 O! F. m
- .text:004011B0 push eax- u# Z" I2 |/ l- I$ i9 c
- .text:004011B1 mov ecx, esi/ P0 ^7 c! h1 J* |! Z: U8 D5 C
- .text:004011B3 call sub_401030
2 \2 K; S7 R% J5 b - .text:004011B8 mov edx, [esi]9 U& |' |, G2 |' Z
- .text:004011BA mov ecx, edi
& r( o* V7 s: |" K9 [' L - .text:004011BC lea esp, [esp+0]- k+ J& p3 E1 ?! `1 i! Y
- .text:004011C0
: \5 H/ {* N0 J, ?) Y5 ?9 s4 v - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
- H) {$ d; p) t j8 @ - .text:004011C0 mov al, [ecx]
0 Z( w$ }5 ^8 X8 I - .text:004011C2 inc ecx2 S6 ?; k& K- T- `9 O
- .text:004011C3 mov [edx], al0 s9 |9 U2 J/ n" ^. y
- .text:004011C5 inc edx# P+ n8 |# ~+ d/ k$ [
- .text:004011C6 test al, al1 \% O G' Z# {5 u
- .text:004011C8 jnz short loc_4011C0
3 D2 m) N4 @( g* m' s" A - .text:004011CA: H1 q8 Z6 l; {' h# Z. ~/ v
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
; W1 I2 l1 `2 _3 }' |$ O - .text:004011CA ; sub_401160+10↑j1 t$ H% W! V- t r) c' G
- .text:004011CA pop edi6 }9 j( n0 w* T1 L1 H$ i
- .text:004011CB pop esi
3 ?0 M1 y' Y H4 O6 t2 N$ J - .text:004011CC retn 4" H3 F0 Y( K! a/ j* o8 f
- .text:004011CC sub_401160 endp
6 ^. T+ X! M7 b1 ` - .text:004011CC- R; O% o+ w# O+ Z0 l; l& z( u
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码 $ }' h9 q. R' B: \' Z# c, N1 w! q! U9 ]
# o2 j6 R! x$ L& Q7 y! k% I) h5 k& T8 N* m
|