本帖最后由 shane007 于 2023-8-27 13:23 编辑
& M3 @7 E% i1 Q8 e3 g
% q5 U/ L) {, ]- b9 }0 Q7 }本游戏采用了CEGUI,该组件能采用directx和opengl。/ x# w* w* J* e. r$ W( m
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。8 z- a. N0 o' |' F( x3 {- {
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
, W& u$ J3 R$ p3 j- j- z, s(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
4 A7 t) ~) V! d- l- x
2 u# C) H2 ^, i1 p6 R @2 L- d1 m- y% N/ p. d3 C8 W% m c* q
在游戏中找一个字幕,在以下地方断下。
7 v8 L a6 Y& S7 q6 m3 D由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),# l1 m) k7 C( h
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。2 l, T' B. [# z" R% F) c0 N* w) s
# i" G: @* o- I( B2 ]# h: u1 j
- NextLife.exe+11C5 - 42 - inc edx& W' Y# C; i3 n* F
- 004011C5
复制代码
# Z" v8 \7 g9 j. }, `& d% m6 `9 U6 G, w2 u5 _1 _2 [
该地方的伪代码 z# `" f8 b7 k2 V
- void __thiscall sub_401160(char **this, const char *a2)/ u! W8 k# d9 r5 y: N2 u
- {
! g$ T; O4 R9 ~4 Z - char **v2; // esi
2 M$ V W9 }6 t4 g5 ]# F' T" [ - char *v3; // eax/ R' e' T6 x# M3 z6 V# t
- char *v4; // eax
! N5 Z. Y# m9 h
( G0 i [- n, L0 S( q& c- v2 = this;" m; l# A% E: s! d; I* X! X
- if ( a2 )
4 _* r- q; P" b$ G- w; }& l/ F6 b! { - {3 W. e5 S0 B. h% y
- v3 = *this;* h. w4 l v& }: z+ j$ O
- if ( a2 != *this )
! _, Z* l- c5 h3 d' i# V - {
3 R- Z: r/ B. Z8 _ - if ( *a2 )
{/ r( k) b) m) h5 Y8 \! |, ? - {2 B2 |* [6 l! c& \& ~
- sub_401030(strlen(a2));/ B2 ^+ f& {/ h9 h2 ~0 L' s
- strcpy(*v2, a2);
- t2 t0 f. }& ~) Q6 Q - }0 a3 g: H1 n0 d/ F
- else
. `+ D8 G. Z8 l6 @2 j) h - {
, v) S# a( A) q( I - this[1] = (char *)1;. G. l* R* q, i
- if ( v3 )
. E q6 j( ^0 r z( Q$ ?, O5 o - operator delete[](v3);
: d( N6 \2 ^# R0 s0 q, _- B - v4 = (char *)operator new(6u);6 b: y0 o# g9 n- Q9 }
- *v2 = v4;
! [3 `4 Z% L. I - *(_DWORD *)v4 = 0;1 `5 G& I. P# l, ? s @
- }. J6 ^5 j5 W* Q) X
- }
" o3 w+ m. A) y; n - }- d' J F, C# N0 B7 ?
- }
复制代码 # h8 X7 \% i) x* A I" I2 c, k+ K
汇编代码
3 ^: p G* W. Q5 }; N4 H- .text:004010F0: i6 i' b5 A, ?" ~! F8 G) x2 Y" Y9 Q
- .text:004010F0 ; =============== S U B R O U T I N E =======================================& T/ I: J9 w! P" ]4 r+ D
- .text:004010F0
/ M. N0 R0 m3 T+ l - .text:004010F0& I' z* c4 s/ q; C& z2 j& \5 L. ]
- .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p
! j) z$ n; d. w8 J- @ - .text:004010F0 ; sub_403240+97E↓p .... v, m" u; |6 q; k# R' M
- .text:004010F0
3 _4 p0 F$ M$ q - .text:004010F0 arg_0 = dword ptr 4
3 ^1 @, Y- L; X2 X - .text:004010F0
& v+ \' |( b$ _1 }, ^5 K - .text:004010F0 mov eax, [ecx]
$ o# [7 u# n0 [7 N - .text:004010F2 test eax, eax
1 L% M l' Y1 ^6 p2 }' X - .text:004010F4 mov edx, [esp+arg_0]
# [) R( N: S6 q' \ - .text:004010F8 jz short loc_401147
0 F, O: a& u! B* ?+ }% ] - .text:004010FA test edx, edx2 J6 w( W( e) v
- .text:004010FC jz short loc_401147/ w, B3 ?7 O6 j5 P/ D, e$ h# h
- .text:004010FE mov cl, [eax]
+ _) z5 \( R; Q1 r$ f5 [9 } - .text:00401100 test cl, cl$ {$ N* F! e7 n' S! E
- .text:00401102 jnz short loc_401116
0 t/ X# t1 h( f6 e: M( [- B4 a - .text:00401104 cmp byte ptr [edx], 0
- {9 r: [' x0 i e) `. o5 _; e- [* ~ - .text:00401107 setz al% l+ @1 G0 M; K$ n
- .text:0040110A xor edx, edx
& b2 Q7 ^5 J* E4 x+ _1 c - .text:0040110C test al, al
" q& Z* x9 j4 t+ I - .text:0040110E setz dl
( e! q, E3 W& e0 {8 Q$ d4 k! W4 F8 _ - .text:00401111 mov al, dl1 X- g4 F- P9 W* Z( {1 |
- .text:00401113 retn 44 H; r; ?4 E0 {1 \
- .text:00401116 ; ---------------------------------------------------------------------------
9 F' J: p* ~$ `. |2 r2 v8 g - .text:004011167 e4 V% I/ \8 c( S+ O
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j; P C; z8 T) Q, \' E; _1 {: j
- .text:00401116 cmp byte ptr [edx], 0
# t1 D0 Y( F# e - .text:00401119 jz short loc_401147
, m" }1 R" V- w2 d& R* K - .text:0040111B jmp short loc_401120# _0 X/ Z I- S' j
- .text:0040111B ; ---------------------------------------------------------------------------, `3 r2 p9 K$ |4 w, i! X) q; o5 g
- .text:0040111D align 10h) E3 E4 x" u7 [$ ?" P
- .text:00401120
! l7 O+ o9 B# p - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
- n& D& X) W9 y5 x9 \# [5 k# I+ m - .text:00401120 ; sub_4010F0+3B↓j
) S! s7 B/ e* ?- Q" q* ? - .text:00401120 cmp cl, [edx]7 o% B. N1 w: _* W
- .text:00401122 jnz short loc_40112D; r x2 i" {, B8 O. F9 H8 j
- .text:00401124 mov cl, [eax+1]6 _' M% x/ X- f) K
- .text:00401127 inc eax
% {4 x8 _& Z% O6 E. A7 o - .text:00401128 inc edx
( ^# F5 g1 b' h - .text:00401129 test cl, cl* Q3 f% T5 \. b |, G$ t$ w; h
- .text:0040112B jnz short loc_401120
" { i; N T: v - .text:0040112D4 a2 V$ p U t6 O+ C8 Q
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j7 c j- Q/ e* K& L8 A( b- g) ?7 B
- .text:0040112D movzx eax, byte ptr [eax]
u4 N+ U Y2 F. a/ h" y0 o7 Z - .text:00401130 movzx ecx, byte ptr [edx]( g, ]7 Q) H4 h d
- .text:00401133 sub eax, ecx( G0 r- C) P" F, d3 z; [
- .text:00401135 neg eax- A% Y* I7 i5 P
- .text:00401137 sbb al, al
. F% N) X+ k( g6 @) M( h3 C - .text:00401139 inc al
, |: L( ^5 X# n/ W - .text:0040113B xor edx, edx" f3 W1 z0 e! `6 c! D
- .text:0040113D test al, al
6 X9 I5 |/ t0 r. L$ z% j( } - .text:0040113F setz dl8 S/ J7 Y$ v/ L+ m" h
- .text:00401142 mov al, dl( \" w+ ?5 K; k1 f1 U( Z
- .text:00401144 retn 4
: S! t7 Z; \$ G! p) `' m' X f. S - .text:00401147 ; ---------------------------------------------------------------------------: s' z$ f# P9 Z9 L& f( T
- .text:00401147
9 l0 S( g8 y& |; q - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
1 T2 t7 [$ |. }+ y A. U - .text:00401147 ; sub_4010F0+C↑j ...
" `" P8 j# C! _ - .text:00401147 xor al, al
8 b: a# Z: s/ o: L' L' u7 D8 w - .text:00401149 xor edx, edx. t" ~9 ~" m$ _& o! j0 @$ ]
- .text:0040114B test al, al
- o/ W, P. d7 m* y8 g - .text:0040114D setz dl# B' D6 z, C3 e9 R
- .text:00401150 mov al, dl
5 z$ D$ G* I* b, | - .text:00401152 retn 4
, P. P: n7 d) m& s0 q - .text:00401152 sub_4010F0 endp
% F+ |3 l& M4 I - .text:00401152
9 f# H4 q1 t( l7 @ - .text:00401152 ; ---------------------------------------------------------------------------0 _% ~0 D( Z0 |3 K, `# A! [
- .text:00401155 align 10h
S- p! ?" h; P; @- g' b& @' U; d8 d' { - .text:00401160 o3 q& A/ Q$ x2 t+ i( z% s- e
- .text:00401160 ; =============== S U B R O U T I N E =======================================; f, f# D) i' W- |: v: _& _- q9 |
- .text:00401160) `; g8 k4 [2 {. l- `( t7 h1 J
- .text:00401160
3 d+ d p, U1 p - .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p, m5 d9 G# o, T4 B
- .text:00401160 ; sub_4013F0+C↓p ...' J; B4 G9 k, \2 z% m6 c' g5 q2 B
- .text:00401160+ s% k L% B) C, P% T5 f/ L
- .text:00401160 arg_0 = dword ptr 4
. m- w2 G! O, L' H - .text:00401160
0 t, N. o7 p# c4 s9 j7 u - .text:00401160 push esi
( `0 s5 E# k& b* Z - .text:00401161 push edi
) g$ \4 m. s7 ~3 ^; B5 n; f - .text:00401162 mov edi, [esp+8+arg_0]
7 O* X$ j; a# H - .text:00401166 test edi, edi
. p1 v+ B" X( L% F5 E* m* O& W - .text:00401168 mov esi, ecx
3 ?! B y% }, {3 F% D - .text:0040116A jz short loc_4011CA
8 Y$ o3 b5 ?' S- c - .text:0040116C mov eax, [esi]
, t; D- t$ d: g1 \ - .text:0040116E cmp edi, eax( M2 j5 t9 _0 ~1 n4 v% L
- .text:00401170 jz short loc_4011CA8 t1 H1 @. ]( P {+ h! q1 Y
- .text:00401172 cmp byte ptr [edi], 07 u, t4 i; a6 W, W7 a! U! W
- .text:00401175 jnz short loc_4011A2
0 R. ?/ i% b% ?5 f& [4 R - .text:00401177 test eax, eax. a B8 K7 |7 s0 S* j
- .text:00401179 mov dword ptr [esi+4], 1
' W! z/ o5 H4 X1 B# m) Q X - .text:00401180 jz short loc_40118B. H$ c, _, B. s5 D9 Z+ b& R; ~0 V
- .text:00401182 push eax ; void */ J. D: Q: H8 R4 f
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
5 a- I6 _- a0 [ - .text:00401188 add esp, 46 ^- \" y6 L- D+ b0 C0 G/ c
- .text:0040118B$ Y0 Y; p% i; Z5 ^& R% J
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j* g- J9 I4 u+ `
- .text:0040118B push 6 ; Size2 t; l9 }7 g& |
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
6 P" T* ~% l3 l" d5 L; Q - .text:00401192 add esp, 49 j6 M1 B4 J; m: u% x( s: k
- .text:00401195 mov [esi], eax3 y" N) y' D' |( ?& G9 c
- .text:00401197 pop edi
% Z2 W& }! Y) }% m - .text:00401198 mov dword ptr [eax], 0, c. I. `) ?/ H& }
- .text:0040119E pop esi3 D) r" ]" M+ y5 F+ n: o
- .text:0040119F retn 4
6 A0 Z1 F) w0 ]( Z - .text:004011A2 ; ---------------------------------------------------------------------------: S, t2 \) B M/ e$ O& g% t
- .text:004011A2- F( `9 o7 m7 ^7 G3 H
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j4 o. D l* z8 `
- .text:004011A2 mov eax, edi
+ J/ q+ N# Q% l( B+ ~( }3 q - .text:004011A4 lea edx, [eax+1]
) [. G4 y8 v: Q$ X0 M - .text:004011A7( ?2 O1 a W3 D$ Z4 {
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
- ?0 m/ \7 w3 z& c - .text:004011A7 mov cl, [eax]5 g9 g }3 P3 A6 ?8 i/ R
- .text:004011A9 inc eax: J* d- x3 `) u% T6 v$ R; [
- .text:004011AA test cl, cl7 N1 r; p+ }$ N. J" s5 E1 ^7 @
- .text:004011AC jnz short loc_4011A78 T3 `! h6 ^4 A' [2 [
- .text:004011AE sub eax, edx
& I1 {6 i$ u7 |; d* T - .text:004011B0 push eax
9 V K Q6 x6 \) M/ ]% h) h' K3 L - .text:004011B1 mov ecx, esi) C6 Q' s1 C/ N6 |. D% u1 z
- .text:004011B3 call sub_401030
8 ]( f x; _, F; V5 q9 K& m) E - .text:004011B8 mov edx, [esi]
9 ?% w" E. k- J; b( Z - .text:004011BA mov ecx, edi2 F/ c1 D6 L% F( r9 s# }. Z
- .text:004011BC lea esp, [esp+0]
! ]' [& H9 ?1 O9 I. I4 k - .text:004011C07 ^2 R4 G6 e1 v4 r( V2 p" }/ _
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
) v1 I* `1 r3 x# A2 N y9 C - .text:004011C0 mov al, [ecx]
5 O7 j8 z( l4 |& x6 X6 I - .text:004011C2 inc ecx) P5 H" U4 V% H
- .text:004011C3 mov [edx], al0 F1 i" |( {* u E$ p
- .text:004011C5 inc edx5 J" \% d6 ?; }& C5 \5 B. p
- .text:004011C6 test al, al9 s: c3 A1 ]1 }7 \: Z7 w
- .text:004011C8 jnz short loc_4011C0
, e) Q+ _& C3 W+ i. R/ L - .text:004011CA
( H- d% O' B8 c5 H - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
1 k' F1 c+ F7 }' y+ } - .text:004011CA ; sub_401160+10↑j
- X# K' d3 h; X" t' V% p0 X g' W - .text:004011CA pop edi
4 K- M$ s! {/ Q+ ]6 X - .text:004011CB pop esi, f* g% p$ s$ E' @
- .text:004011CC retn 4
$ k+ Z0 F1 ?( ^, A2 D% V - .text:004011CC sub_401160 endp* W; V4 M/ `6 [- e- a* e/ D
- .text:004011CC
9 u& i; N4 R3 T+ E7 M! h! a9 O6 b - .text:004011CC ; ---------------------------------------------------------------------------
复制代码
' O5 Z: w) M* r$ c6 b
' E; E% {5 q; x' c7 S0 Y9 H% D( ? B
|