本帖最后由 shane007 于 2023-8-27 13:23 编辑
4 s3 p; F! w# D& `. }( F. Y; \% a4 ~. o- q6 U$ A9 a4 h7 p
本游戏采用了CEGUI,该组件能采用directx和opengl。
: r8 \# L- s, Z6 l" C& v6 z经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。) [3 V- C6 u3 L$ {" O8 a
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。4 W# ^" {8 M% _: a ^3 l l
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
% p* t# V+ f1 `. `) l
2 D( ~9 o% `! l9 B
, L& N7 f1 M" {在游戏中找一个字幕,在以下地方断下。
& v5 p/ M# K _4 \8 o由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),: U: N3 t, c' X, V8 S" M' I r& `
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。* ]0 R( {, E8 _2 i% a, ~7 @& P
9 f1 P% X( u F
- NextLife.exe+11C5 - 42 - inc edx' |3 ]9 E3 D8 h- d, o5 }5 t `% w
- 004011C5
复制代码 ) d1 S" s5 e/ j1 D O0 J
# ?6 n) M3 h6 [( i该地方的伪代码. f1 N3 ]9 G* l5 B6 J5 y
- void __thiscall sub_401160(char **this, const char *a2)
$ c Q. c% _& Y( p+ u - {( [1 ]8 U* I4 I+ {
- char **v2; // esi/ l9 I7 p1 O1 B& T
- char *v3; // eax
/ @" g- w5 F* [% F - char *v4; // eax% X7 |, M! [2 D4 T
% M" D- {4 O. |' K- v2 = this;
) N9 i( J1 L& s* Y4 X2 J3 N - if ( a2 ): l# q& O# O6 C1 t& v2 ^/ e h
- {
' ?% Y% s' I1 g9 L9 V: w - v3 = *this;( C h) Q' Y# d% ]
- if ( a2 != *this )2 P( P: }0 k7 ?3 W
- {. {) i/ e' y- U% R
- if ( *a2 )/ w6 ], _4 [* [4 f5 y" Q2 r3 S
- {/ M0 A# S7 E8 ^6 ~; f
- sub_401030(strlen(a2));" _* r* Q1 K! |8 P* d# z! d9 r
- strcpy(*v2, a2);' j6 {. H+ r( g! e# A- _
- }
, _5 P T; l/ u( h( K) Z& I - else
! B& y6 D5 z/ X A3 [2 R5 X2 b - {/ ?# p+ ^- V& d( d, v
- this[1] = (char *)1;
) n% d( T* s( }" j$ W - if ( v3 )" O3 A: ^1 E/ T4 T
- operator delete[](v3);
6 v" p4 {4 h2 [0 e% ~1 k3 u& n0 D o - v4 = (char *)operator new(6u);' `5 f$ N2 ]1 _/ D# v' {% p
- *v2 = v4;
/ ^- a) r1 z8 R* w9 S - *(_DWORD *)v4 = 0;8 Q/ `" |3 _/ R
- }" g) W8 R9 H/ y" _; J: C8 M
- }8 D. Y0 q( n. Y7 w3 A3 L
- }
' O! z5 E( U9 g. e0 x8 v2 v - }
复制代码 0 b% Z" g4 }/ q+ M5 a. U, k N
汇编代码- ]' D- T% v1 Y k$ y; x
- .text:004010F0
" ~) T, Z0 g+ Y& g' }8 p& t H - .text:004010F0 ; =============== S U B R O U T I N E =======================================
1 C- ]* f: e! { - .text:004010F0
3 L$ R; @, N8 }, n. F2 J1 Q - .text:004010F0
- c$ d% ^+ _7 @0 o f" q7 D8 k& [ - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p# p9 r* B# @3 l# j' t) k
- .text:004010F0 ; sub_403240+97E↓p ...
# m; m" w1 d2 D+ r/ _0 h0 w3 P7 N - .text:004010F02 u) c7 @; r) S. Z! V6 S4 P/ z
- .text:004010F0 arg_0 = dword ptr 4" A: V+ j- j, E' T5 n! o% X
- .text:004010F0' J1 T7 J; P" v0 s/ Q; h
- .text:004010F0 mov eax, [ecx]7 b& N0 O0 q5 q# w
- .text:004010F2 test eax, eax4 T% n( \$ u$ [0 K1 ]! a
- .text:004010F4 mov edx, [esp+arg_0]2 \/ T I* }" x/ P% P
- .text:004010F8 jz short loc_401147% V: y% C3 E$ L$ M% g9 i( K
- .text:004010FA test edx, edx
8 b r E! T- U6 ]& Z4 Y - .text:004010FC jz short loc_401147
) w3 I G8 T: C8 q* g5 e! ^# Q - .text:004010FE mov cl, [eax] M& Z; V; T/ a* |
- .text:00401100 test cl, cl
8 v! K' T. s' ~6 @, Y2 L. P8 G4 r. | - .text:00401102 jnz short loc_401116
* [/ i* {9 X2 F3 J( Q0 z) f$ s - .text:00401104 cmp byte ptr [edx], 06 k4 I6 _, c" l0 Z4 B
- .text:00401107 setz al
( A3 t8 t! x$ H8 o4 X0 W+ r. @ - .text:0040110A xor edx, edx
" ]5 |0 ^' S7 j8 e; f4 L# y3 P( N! M - .text:0040110C test al, al) W# I0 c4 ]6 _5 j5 v
- .text:0040110E setz dl
, Z0 C# g' I9 \5 G - .text:00401111 mov al, dl: q0 O' n; ?( p" Q8 _+ u/ b( w( A
- .text:00401113 retn 4$ C; S1 K! ?) K, V8 h
- .text:00401116 ; ---------------------------------------------------------------------------& G/ w' @7 ^8 k4 {4 Z5 V
- .text:004011167 \4 [2 |2 F2 s: J
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j" s) y6 j/ F6 x6 c6 j7 N
- .text:00401116 cmp byte ptr [edx], 0
, `8 p# h- E4 v; y7 X - .text:00401119 jz short loc_401147
! Y1 T s/ M! u, ?& o. f - .text:0040111B jmp short loc_401120
: s/ p$ G/ n4 `2 m1 t - .text:0040111B ; ---------------------------------------------------------------------------: x }5 F( Q# D2 ^. i* D$ n
- .text:0040111D align 10h
9 Y! x" K3 b/ E( Y+ s( n" \1 h6 ` - .text:004011200 U: ?! U+ }0 r! m+ j3 {3 A! y+ j; h
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
" E Q; y8 }& M - .text:00401120 ; sub_4010F0+3B↓j7 U- n# C8 d* W2 }) J" k
- .text:00401120 cmp cl, [edx]
0 L8 _0 i- z- a: U5 l; h. x - .text:00401122 jnz short loc_40112D5 @7 c/ ~* o; H( X0 ^
- .text:00401124 mov cl, [eax+1]6 W6 {8 j, }" R5 d5 S* }
- .text:00401127 inc eax& A, b7 N) P$ e0 ^
- .text:00401128 inc edx
5 M: {/ A( l% Q Q# u9 w' G - .text:00401129 test cl, cl/ r- D$ L: l. o
- .text:0040112B jnz short loc_401120
% Z% S& i9 u. d) S( R - .text:0040112D
* a& H3 m* Y. h B" \0 a - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j& N( O& q+ s5 p/ A, H3 E1 |: m
- .text:0040112D movzx eax, byte ptr [eax]
' }0 T3 p' F1 d9 ^1 D5 o - .text:00401130 movzx ecx, byte ptr [edx]
4 |, S* y, W3 y1 A" n - .text:00401133 sub eax, ecx1 D' y; {6 a" Q9 W7 |9 u: K; a, {
- .text:00401135 neg eax
4 H- d1 t2 V' x- q; Y* @* D0 G - .text:00401137 sbb al, al4 K! X. ^: ^ P2 A# m5 I6 c% }
- .text:00401139 inc al) p1 q4 k6 g+ Q& v
- .text:0040113B xor edx, edx$ }( L& y3 q) u M; r2 m
- .text:0040113D test al, al2 L( n) {6 A' p* ^' B
- .text:0040113F setz dl
' C, q/ W$ R7 ]4 e( Y: m - .text:00401142 mov al, dl
: Y7 |) @+ o. U - .text:00401144 retn 45 o' O! @ p$ Y: K- m e. a
- .text:00401147 ; ---------------------------------------------------------------------------
/ M) ]5 Z% ~- o& h! k - .text:004011475 S( ?' y# j9 _3 ^4 K
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
3 Q/ E8 o7 o `. b- S9 ~# R0 e- x - .text:00401147 ; sub_4010F0+C↑j .../ j* _2 }' R! n7 V! _) b
- .text:00401147 xor al, al3 e" ^& K( e9 O. J/ j( Z
- .text:00401149 xor edx, edx
: Z) O* c+ G; T# r0 f$ J, } - .text:0040114B test al, al
7 @0 |* p0 B4 s4 H4 q0 M2 i - .text:0040114D setz dl7 f+ i9 P* R8 ~9 {' I8 L
- .text:00401150 mov al, dl1 X1 N/ q8 m: d. {
- .text:00401152 retn 4
! g4 h7 R; k( y& I6 Y0 w J) t - .text:00401152 sub_4010F0 endp
; Z: r0 |; H+ T* c# J! A# R3 O - .text:00401152
- c$ s4 a; e+ c1 |$ Y. D - .text:00401152 ; ---------------------------------------------------------------------------
- f) i! P. E, O% ~6 B8 ]" h8 ]1 v3 _ - .text:00401155 align 10h% W3 [0 @( ]$ _
- .text:00401160: f8 z' W! w1 V, v
- .text:00401160 ; =============== S U B R O U T I N E =======================================
& m1 r4 P9 Q' Y }& `1 h. S" O - .text:00401160* V, U2 g y1 l
- .text:00401160' Z' b5 V! `; c# E
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
, g' A3 Z, W& h+ g* E1 Q) q9 Z9 R - .text:00401160 ; sub_4013F0+C↓p ...
7 O1 o. V# E) \" @2 K2 _ - .text:00401160/ I8 H( f! U" {' ?9 b
- .text:00401160 arg_0 = dword ptr 4: t# N% T/ ?, ?9 Q0 ?
- .text:00401160* J( ~' e2 Q& G$ S6 o, G: F4 \( b
- .text:00401160 push esi
5 u# Y% H3 f- m; \+ D - .text:00401161 push edi
: \) g* z1 @# i) i% w! O% y - .text:00401162 mov edi, [esp+8+arg_0]; x* q' Q$ ]" F3 r% B" n: H8 n
- .text:00401166 test edi, edi1 W+ F8 c; g& C9 m9 [: o
- .text:00401168 mov esi, ecx. g' n/ V2 }; h# F) c/ o% Z9 v) b n
- .text:0040116A jz short loc_4011CA
+ B7 z9 y' H' c - .text:0040116C mov eax, [esi]/ D" K1 Q6 o1 U4 [4 F
- .text:0040116E cmp edi, eax
# S- }* V. s' f9 ^ - .text:00401170 jz short loc_4011CA
+ h }" @& X8 e& C5 i+ j - .text:00401172 cmp byte ptr [edi], 0
& H( w4 j) S6 ]. h. `/ u - .text:00401175 jnz short loc_4011A2$ k) i7 {6 j% V5 I' [7 H# g
- .text:00401177 test eax, eax" f, s. y( g) X
- .text:00401179 mov dword ptr [esi+4], 1
" t6 R( c( v5 b( P- {, ? - .text:00401180 jz short loc_40118B
3 C4 Q+ t3 ]' J. Q% S4 W - .text:00401182 push eax ; void *5 i, b P" r0 m- J6 C7 J
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)4 R3 U$ ~7 j$ {; m# U7 m1 o4 A2 T, e
- .text:00401188 add esp, 47 j2 ~! X U. h1 t+ _
- .text:0040118B
?7 h% b' ]$ p4 o! P+ F - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
! w$ M; L! P. m( N8 h - .text:0040118B push 6 ; Size
4 C+ \. |1 i8 i4 T: c( x6 h - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)! |+ M! K* ?# ~
- .text:00401192 add esp, 4
& u; y4 _# j# S - .text:00401195 mov [esi], eax+ S- @& [& I& W3 J' {% a
- .text:00401197 pop edi
A4 k, Y) Q) q; @8 O: c1 r - .text:00401198 mov dword ptr [eax], 0
" k5 x3 \# a8 u - .text:0040119E pop esi
5 ^" e3 M- T& e$ H' ^' A+ E - .text:0040119F retn 4
2 D, q6 L2 a9 r+ |4 a - .text:004011A2 ; ---------------------------------------------------------------------------
8 L. D, {) P1 o- z) U8 v - .text:004011A2( T& |, ~0 l' w
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j8 w/ J" E) c7 B. X( a* F0 X
- .text:004011A2 mov eax, edi
+ B0 e9 I& w3 u+ M; B4 l- A% q/ e - .text:004011A4 lea edx, [eax+1]
! y: U" ^5 {4 k9 ^ - .text:004011A7
4 h6 F! c# R. |2 B3 ?. c$ E: u& W - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j8 r ^8 ?$ y: U p7 S5 U. M& _
- .text:004011A7 mov cl, [eax]% x; @" V v3 o% V4 t
- .text:004011A9 inc eax; _- \' g' o; w8 ^: U
- .text:004011AA test cl, cl: ] G. T% D5 D1 ]9 E4 W( D
- .text:004011AC jnz short loc_4011A7
0 [! s; c& `9 q! p/ |! L. L - .text:004011AE sub eax, edx
. d' j7 i$ b* m [0 O8 {* w - .text:004011B0 push eax
& [( P& ^" B/ J5 A, F$ u - .text:004011B1 mov ecx, esi
+ ~! v1 ?! s- g P4 [ - .text:004011B3 call sub_401030' K3 F! g' ]/ A( j1 s
- .text:004011B8 mov edx, [esi]
( ^2 R7 |$ I; G9 C9 c - .text:004011BA mov ecx, edi, i6 D7 g1 x& F5 B2 }! T
- .text:004011BC lea esp, [esp+0]
- U1 B1 z9 @# B# h) G+ K6 O: i - .text:004011C0
! n. C) y" u6 d* V3 q& l+ o - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
" R& o! ^! e- C. y$ Y+ w- V M - .text:004011C0 mov al, [ecx]4 m; q3 D. k6 l i6 M8 I8 {
- .text:004011C2 inc ecx ]# {" p' k+ E1 P3 s* W: p
- .text:004011C3 mov [edx], al' O6 |7 M) {2 G" L0 R
- .text:004011C5 inc edx
8 P! q1 r% y6 C8 f) p' {* `8 o - .text:004011C6 test al, al& A! g# c% O% ]3 A$ J/ r
- .text:004011C8 jnz short loc_4011C0
; B$ L+ p: }. u6 U - .text:004011CA b) J9 k5 N4 d% Z1 I
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
i1 r1 v$ o% v8 m; q \8 a+ f, D - .text:004011CA ; sub_401160+10↑j: t! D' p/ H6 N, Q+ ]/ e# I
- .text:004011CA pop edi
; J: ^, J% n5 I5 o - .text:004011CB pop esi
6 Q& _% B, I% X* s% }$ F% Y: A - .text:004011CC retn 4) D2 F9 S' f9 U" w0 d: g2 v8 N
- .text:004011CC sub_401160 endp: U" x* `5 J* L, s) ^* Y
- .text:004011CC
" W+ W4 H4 U; _( h$ g- n" V& I, W - .text:004011CC ; ---------------------------------------------------------------------------
复制代码 $ n0 ?% S2 y7 X L3 D# ]
5 v [0 @6 x4 j p3 N
7 z1 H8 Y+ G7 ~8 m T" x W |