本帖最后由 shane007 于 2023-8-27 13:23 编辑
/ V( w. `1 D( _ Z# M) M7 {" }5 q* C6 Z
本游戏采用了CEGUI,该组件能采用directx和opengl。% \9 Z: H- x9 C8 i, l
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。- l' V' ]' q/ m+ r$ `; |% p
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
" l; t' G( g3 O# N1 r(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)9 a2 M. g3 r3 E! o* A
( _; d; j$ S, d+ p& B
! T/ {3 t0 H9 A在游戏中找一个字幕,在以下地方断下。
1 v' W. j8 n! i/ J% x由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
, m$ j/ g5 r5 z2 A7 ]- e7 t因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。( ~. ^" f) A( V' U0 T# W. D# V
- o6 }/ U* |; V# _& U
- NextLife.exe+11C5 - 42 - inc edx* U0 x" U% A: y0 j
- 004011C5
复制代码
# A$ ]) o6 L" ]1 Y9 Q5 A
' E: k8 V5 F1 Q5 y& g! `* j该地方的伪代码
6 C$ e. A: n7 q9 O0 B' ]/ {- void __thiscall sub_401160(char **this, const char *a2)7 ^; a0 i% G) S; Z4 ^# q
- {
& t5 C) p- L2 S; D; B! Z - char **v2; // esi& {0 w. n# q! t
- char *v3; // eax
t/ ?* @$ y9 M- w ] - char *v4; // eax
" c. r" \; |) u- J - / G# Z; J5 o$ G2 K& |: `9 f; A4 u
- v2 = this;
7 ^1 n9 h5 C/ A9 u! g& T - if ( a2 )
" O/ l* ]" M) |# C - {0 y d! e, T' K0 |$ B. t3 ?, d6 y
- v3 = *this;9 u; [8 t5 v- D$ a& I
- if ( a2 != *this )+ a0 V3 k9 a& `! x6 K* T& g" D4 j
- {
- G& |* K$ D4 p8 m# e - if ( *a2 )- o' O& c( c' p, _; K
- {
) Z: B9 a& i) K! l- W( S% V$ c - sub_401030(strlen(a2));+ Z# q4 O1 |, s5 m2 n3 I
- strcpy(*v2, a2);
+ W! }0 `" q/ {3 \$ x% W - }: _ [! u. u/ j/ T+ H; i) D$ M* o
- else
! E2 S6 {) O- R/ i3 {; N: H - {
+ k( t- v% ^& J- H7 }+ ~+ @1 [ - this[1] = (char *)1;! N1 x& \- T$ t, p+ g
- if ( v3 )
6 o7 }! e3 Z- M; w% I% _ - operator delete[](v3);. e; O- B0 a3 @' f+ W$ L: a2 h
- v4 = (char *)operator new(6u);
( ~0 \" v) k: D - *v2 = v4;
8 B3 r' D0 Q- d7 p7 c1 A( j - *(_DWORD *)v4 = 0;+ s" t' d1 S" w) t) G1 C2 i
- }) p, @; r% p1 R' D* s
- }
; V" K3 f, t" W! U/ e - }
+ Z: d( z9 y z. u* ^ - }
复制代码 5 F0 Z8 ?8 Q0 m: x# B
汇编代码
7 q. z5 N0 G: C% _2 f# e- .text:004010F0# A) M6 `+ ~' v
- .text:004010F0 ; =============== S U B R O U T I N E =======================================
' |7 Y" o. j7 n2 p3 |9 L/ e - .text:004010F0! E7 T4 [7 v+ i
- .text:004010F0 J" y7 F) U. O' q" l% z' x
- .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p
- [. w7 c0 X. [# Z - .text:004010F0 ; sub_403240+97E↓p ...
& H* G/ a3 B/ d! t, ]8 l$ u - .text:004010F06 K* o- D$ x, S: e3 o& w3 d+ u
- .text:004010F0 arg_0 = dword ptr 4
/ v0 ?8 C9 r: `5 b2 K - .text:004010F0
; }: k% r( }4 J( J - .text:004010F0 mov eax, [ecx]* o: W( D% |! v- a7 T y6 o, F) u
- .text:004010F2 test eax, eax
5 Z9 x L( h& s9 d. A! N ? - .text:004010F4 mov edx, [esp+arg_0]& m/ E ]: y; q2 }5 A
- .text:004010F8 jz short loc_401147- g) X7 t) ~1 A+ k) _8 w3 y
- .text:004010FA test edx, edx
, _ h6 R. D) Q2 @' D* d& C8 T9 r - .text:004010FC jz short loc_401147" I/ B4 B; W! p# W& T9 R
- .text:004010FE mov cl, [eax]' ~% A5 S1 Y: p$ P0 r6 N
- .text:00401100 test cl, cl0 Q. t) u: m( s7 i/ V4 P* G- _& b" g
- .text:00401102 jnz short loc_4011160 v. r- d% f3 q' `8 \5 V
- .text:00401104 cmp byte ptr [edx], 0
# G* {# l& j# f; o# [5 k) N9 ?+ o - .text:00401107 setz al9 h) Y/ l) F0 ?, q6 r+ E
- .text:0040110A xor edx, edx r k: f) P. |" S& k! `' i W) R. ~
- .text:0040110C test al, al# O4 Q! C( v7 I
- .text:0040110E setz dl
# ?% c Q8 z* ` G. W5 ], ?* e1 A6 | - .text:00401111 mov al, dl
- a& C0 _1 C# t2 b% V - .text:00401113 retn 4# Q) @! ~) H$ _: [9 k# C ^- T
- .text:00401116 ; ---------------------------------------------------------------------------, S& R+ u& U: K* t
- .text:004011165 `! U" M, H$ T4 r; E
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
" U$ V6 m$ d) r# o- |4 V z n# F - .text:00401116 cmp byte ptr [edx], 09 `. Z e# B1 w- H, x
- .text:00401119 jz short loc_401147( H8 y( U- y' Q& z6 i
- .text:0040111B jmp short loc_401120
3 a# v) X9 y7 N& y- M. N \ - .text:0040111B ; ---------------------------------------------------------------------------
. `& f3 w( R8 D* t0 G - .text:0040111D align 10h
, L, u+ ]$ w: i2 `6 Z* d - .text:00401120/ `/ y3 {+ o+ P4 Y+ o0 l
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j* k" V7 R7 p4 s6 W6 A
- .text:00401120 ; sub_4010F0+3B↓j( ]# ^: V9 o6 n( C# D
- .text:00401120 cmp cl, [edx]
$ T$ _, O8 @" Y1 y9 ^# Q - .text:00401122 jnz short loc_40112D
7 D, j% F( I7 b* x - .text:00401124 mov cl, [eax+1], X' f! M- t1 x
- .text:00401127 inc eax
" p. N" }7 z7 f% r$ a - .text:00401128 inc edx
# d# {6 R5 Z+ y5 Q3 Y3 C/ V" `3 e) ] - .text:00401129 test cl, cl8 D/ |' J/ A/ d* P. y C! b
- .text:0040112B jnz short loc_401120
: t9 a: f$ X3 b5 R, `) n, n9 \" d - .text:0040112D( s) k6 P m+ S) v% Q
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j, ^$ f& z7 {* W
- .text:0040112D movzx eax, byte ptr [eax] C8 c7 R, s3 p2 i# p% v
- .text:00401130 movzx ecx, byte ptr [edx]& ?- M% K* H* G6 \+ i% r1 z4 C2 r
- .text:00401133 sub eax, ecx
! ?6 P9 k( G& z; T5 t' r) h' a0 z- G - .text:00401135 neg eax
3 l( A* P4 ~ p/ e4 ~' h# [ - .text:00401137 sbb al, al, x$ k$ C. n6 n7 j" J; B
- .text:00401139 inc al
, F3 p4 T5 g' b. [" g h2 Y3 K - .text:0040113B xor edx, edx
. c+ o1 E# c6 B" U( N- b - .text:0040113D test al, al$ ~" e. Y6 W8 ]; i7 X
- .text:0040113F setz dl
" i& G2 F; |. k$ t/ ^ - .text:00401142 mov al, dl
! @' h* m9 F' _! s - .text:00401144 retn 4# m! z. B3 l" i' n* s E, U8 j" d
- .text:00401147 ; ---------------------------------------------------------------------------0 J! ?8 B) o" S) g4 E. d
- .text:00401147
. a$ o# E* X0 @3 B& K+ B - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
' s; B z$ Y( [% r$ K% }" } - .text:00401147 ; sub_4010F0+C↑j ...
5 U: _- T% g+ N* Z3 P - .text:00401147 xor al, al z2 k, |/ t0 j) G! v Y3 D i
- .text:00401149 xor edx, edx" j- V2 O0 a7 ?) v% y( X$ P" V
- .text:0040114B test al, al& M; n: T [3 P# u. ]! ?1 C5 x& `
- .text:0040114D setz dl/ O2 h2 G) J/ h: I2 m
- .text:00401150 mov al, dl
! R W5 \, g6 {$ \8 H - .text:00401152 retn 4
+ B; }6 F( J+ a9 d9 N' N/ A - .text:00401152 sub_4010F0 endp' h$ @1 z- n* ]7 o* Y, d1 @& ~. k
- .text:004011523 U$ f( J r# M% k
- .text:00401152 ; ---------------------------------------------------------------------------" I' w! u. [5 q7 w
- .text:00401155 align 10h+ t' Q4 u2 m: o3 D3 E9 Y W
- .text:00401160! i& R- X! i; \& Z
- .text:00401160 ; =============== S U B R O U T I N E =======================================' } b) R2 J9 x
- .text:004011608 o' w1 p8 R) n: \
- .text:00401160% E( Z$ ?6 n( Y* \! M: v* u
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p6 c8 b! i) g+ f8 t% c
- .text:00401160 ; sub_4013F0+C↓p ...
# e6 E4 f1 W% _ e - .text:00401160
. u6 S$ }/ Q# p* u - .text:00401160 arg_0 = dword ptr 4
/ J/ A( E1 n6 B8 t3 _' W# X - .text:00401160
0 z% Z1 Q0 Y4 R6 V' S% h+ B6 _) y5 @8 B - .text:00401160 push esi
) C. {; s+ q4 o$ G+ M' K5 V - .text:00401161 push edi
( ^5 J, A$ x% L+ S1 l - .text:00401162 mov edi, [esp+8+arg_0]. h2 U$ l0 r- ~+ H# E
- .text:00401166 test edi, edi
; n! |' e, k2 K9 `( H! \: r9 F - .text:00401168 mov esi, ecx
( t5 x. {# ^! G1 C/ w0 N9 P - .text:0040116A jz short loc_4011CA
! n9 j0 e& v! C4 D- N& u - .text:0040116C mov eax, [esi]+ l! R' \: U) O# S% X( c# P. H
- .text:0040116E cmp edi, eax
( n7 ^" N3 j$ e1 M# N- l2 h - .text:00401170 jz short loc_4011CA
9 {+ G- z# f5 ^$ l" S' L+ p# P0 K - .text:00401172 cmp byte ptr [edi], 0: t: q4 p) b6 y7 P+ W% b
- .text:00401175 jnz short loc_4011A2
! ], a3 N+ H( n: ^ - .text:00401177 test eax, eax/ s p! S. h. m- {
- .text:00401179 mov dword ptr [esi+4], 1, f; s8 p) h4 L F
- .text:00401180 jz short loc_40118B
) }- f) H' I$ A* x1 Q) p - .text:00401182 push eax ; void *& f/ l( N# c. A
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
# `; S1 e8 S6 \: O/ S - .text:00401188 add esp, 4
4 Y: s8 z$ K! Q! w8 v" v8 L - .text:0040118B
' i+ ^" j7 ]/ t$ k) E! \1 q - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j+ a5 m$ Q5 f) C/ H. e
- .text:0040118B push 6 ; Size* M3 K, b9 U, i% D; z9 t6 ?, C9 h! F
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
! x* J2 ^3 L& \! F" p d - .text:00401192 add esp, 4
% h; y+ m/ Z$ ]* m$ w* s1 v - .text:00401195 mov [esi], eax
0 \. F, Y* Z" \3 Z0 m. g - .text:00401197 pop edi2 K2 }0 R- U# M
- .text:00401198 mov dword ptr [eax], 0
" D3 [! Q% m C4 j5 } - .text:0040119E pop esi
& q3 W% i' ]) e - .text:0040119F retn 4
" Q3 T% w' t# X - .text:004011A2 ; ---------------------------------------------------------------------------- `9 E- R' ^4 W2 E; o8 D# u6 }
- .text:004011A2) b- x. M' ?. R \ M3 c
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
1 U) g/ ?! @ x - .text:004011A2 mov eax, edi$ k' O3 E% I* w% o( n. r
- .text:004011A4 lea edx, [eax+1]
3 y* n' J1 \0 j S7 G0 Y# e$ F @ - .text:004011A7
9 a7 G; D0 B5 P& }7 t - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
6 C; S9 d. c; J* R9 w0 P7 M8 g - .text:004011A7 mov cl, [eax]
% b$ \# h+ s) c3 [' P7 N( y - .text:004011A9 inc eax
0 C% Q' i/ a0 v( p4 @4 c - .text:004011AA test cl, cl% t/ U3 r& M2 X/ ^. O2 S
- .text:004011AC jnz short loc_4011A7! S0 K9 q4 b! b( D. i
- .text:004011AE sub eax, edx
8 }& ^9 j. c% T( g7 `* s$ ? - .text:004011B0 push eax
) D" N0 o+ n+ h$ {# @$ V - .text:004011B1 mov ecx, esi, g$ v8 \0 I' |* X' e" Y7 L2 J1 }
- .text:004011B3 call sub_401030" `4 W7 T3 h8 N, c' e
- .text:004011B8 mov edx, [esi]
7 |$ |; i; ~; @ l( h7 d - .text:004011BA mov ecx, edi
Q/ I+ w; Q8 z$ a - .text:004011BC lea esp, [esp+0]
& \% |/ U2 @) O- N) T - .text:004011C0
& ?. T5 B: |0 P$ @# ` - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
( V! b, j2 h. W6 ^* M - .text:004011C0 mov al, [ecx]# J* z" S' ]% {! Y
- .text:004011C2 inc ecx
$ {& L/ r* N0 q1 C/ N - .text:004011C3 mov [edx], al
* w! u Z( ` A! k. v - .text:004011C5 inc edx
; c/ l% N5 I) e1 h" U! C. a, h - .text:004011C6 test al, al0 t! M. h, V& s) v$ H4 [% \! k9 c
- .text:004011C8 jnz short loc_4011C0- G; V3 d: y) e4 f
- .text:004011CA2 k9 h" G( P; v3 j1 A. N) R( q0 ?% H) j+ g6 E
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
2 o' b, a( L4 e* j' ^+ q - .text:004011CA ; sub_401160+10↑j' k! P) {; J/ r) g
- .text:004011CA pop edi2 d% |' {* K; Q3 @# j! }
- .text:004011CB pop esi+ h+ {5 R- j" d( c2 Z+ {& W6 {
- .text:004011CC retn 4$ a" c6 f6 {: a; P7 }( f! j
- .text:004011CC sub_401160 endp
r# }, F( L3 h& }: N - .text:004011CC
4 k# w$ `- P- m7 ?& L - .text:004011CC ; ---------------------------------------------------------------------------
复制代码 5 G1 h9 Z2 B) D3 U! R; G
6 E8 A1 X6 [, n* ^
9 z+ J. {- a3 i& h' a$ ] |