本帖最后由 shane007 于 2023-8-27 13:23 编辑
9 W5 j+ Z7 Z, w2 h; R+ U4 X) \% f4 _1 [4 P6 P9 e: V
本游戏采用了CEGUI,该组件能采用directx和opengl。
; h; k( D- u |: `7 k经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。- f$ [& s, Z: I
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。0 o6 ?0 w' x9 t% X7 I0 H
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)7 \+ [8 ^4 a/ A1 \# N# V! N) d
7 }/ e$ K D9 z* g5 w
0 `* m- b1 W3 p在游戏中找一个字幕,在以下地方断下。5 `5 I9 x) p! i `% u) `4 @# t
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中)," R! |) k3 S8 q2 o$ z
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
( o- [: W; b# {; d2 f% t( p$ A+ w$ l( T3 m
- NextLife.exe+11C5 - 42 - inc edx: X6 K) j/ L. B# z
- 004011C5
复制代码 8 s1 }: r v* K" E
/ `- f& F% I o
该地方的伪代码' |) t7 N& s. e7 \5 W( P% D
- void __thiscall sub_401160(char **this, const char *a2)* B* Y: z+ n% |
- {
4 a" p. S: X7 D" G4 _# m6 Y - char **v2; // esi
. U, `0 e" T1 v; m$ H( \ - char *v3; // eax1 h: C& q Q0 T* K9 w h$ I6 w
- char *v4; // eax
+ s8 h- ~6 o7 q7 q* V& o8 a4 | - ; }. J& M0 B; U
- v2 = this;
* T! _- l3 c3 o- ]; B - if ( a2 ): P" g) S# J% a/ h# j8 S
- {+ B0 _) p7 X& X, \+ r
- v3 = *this;
6 [ ]8 |& c( C - if ( a2 != *this )! k$ W S: m1 e/ \0 [
- {$ c6 G5 h, V# I% |
- if ( *a2 )( L8 d7 i7 X& B8 y2 Q
- {
4 F" S1 r/ D( J* x" e" t3 s - sub_401030(strlen(a2));" i4 g E, _" h3 T
- strcpy(*v2, a2);$ f0 d6 B0 u: [( N- K% _
- }5 g Z3 ~% U1 @5 t0 Q( I- [
- else! d- [ N+ P8 n" U8 M: A. _: l4 }
- {: ]- j( T( ^- w/ U: h0 [
- this[1] = (char *)1;
: G8 M% P/ y& d8 j1 N - if ( v3 )$ y+ V/ s3 n4 W0 J) T Q' h
- operator delete[](v3);( S1 T# e) M: f: c: ~5 u5 o4 w
- v4 = (char *)operator new(6u);* a* p1 G A6 O) X T/ d& N
- *v2 = v4;, @) W/ i* Z0 n# q" h+ |" j
- *(_DWORD *)v4 = 0;
" i7 v; v7 c3 x- t - }
2 q( b4 R* y% l' L: A - }6 P2 u2 k) |' Y7 p3 Z
- }# T# O$ R1 U7 H: K% O
- }
复制代码 6 q" l, Q- ]3 ?/ z1 N
汇编代码. r4 [3 Y& Q5 m/ w# ], U; p
- .text:004010F0+ B4 W$ p$ s( |
- .text:004010F0 ; =============== S U B R O U T I N E =======================================
" K3 |. f4 ]8 p% P* T0 | - .text:004010F0) m- I% N% m5 F" v
- .text:004010F09 N# Q( V- K! q1 _* G5 b
- .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p
' x: n3 N6 P) v% h* G0 X - .text:004010F0 ; sub_403240+97E↓p ...
! G8 B5 y( T0 u - .text:004010F0
8 P2 h* W4 ~/ Y* g' _- V N - .text:004010F0 arg_0 = dword ptr 4! {* ]$ E" p" |, ^) t
- .text:004010F05 O( ~/ W3 L( G" a8 s K
- .text:004010F0 mov eax, [ecx]
! `% `' |6 c- R7 b3 w - .text:004010F2 test eax, eax
7 n/ x$ P8 `- P5 I, | - .text:004010F4 mov edx, [esp+arg_0]' N9 G& c# } _) w( U: o
- .text:004010F8 jz short loc_4011475 m! G/ B# z. m! h
- .text:004010FA test edx, edx6 ?: |: T! y4 K
- .text:004010FC jz short loc_401147
7 M8 c/ m) v8 X' I - .text:004010FE mov cl, [eax]$ B# g/ F9 o( [) ~( q* Z4 |5 j+ ^4 e5 Q2 D
- .text:00401100 test cl, cl" D& z( E" S3 b- r
- .text:00401102 jnz short loc_401116- x1 p' |4 D. A) Q4 f# Y
- .text:00401104 cmp byte ptr [edx], 0
: X1 i1 L& W+ T - .text:00401107 setz al+ D) e& }1 }8 r
- .text:0040110A xor edx, edx2 D5 d4 p8 u. F" V+ M0 O
- .text:0040110C test al, al7 w& {- e5 t0 s
- .text:0040110E setz dl8 Y% O% t, I* e0 g
- .text:00401111 mov al, dl
2 g5 R) k6 j3 t/ Z5 K. Q/ W. m% ] - .text:00401113 retn 42 G0 p( Q* I4 \% d
- .text:00401116 ; ---------------------------------------------------------------------------
, Z" i% z4 n1 d - .text:00401116
' D% x, o" w9 L, U: [ - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j3 Z5 d: x" o+ H/ t! v. i) m9 P
- .text:00401116 cmp byte ptr [edx], 0
& @0 O: D8 f% ~: `# n - .text:00401119 jz short loc_401147! ~; [. y R5 U. b, d
- .text:0040111B jmp short loc_4011205 d$ X- U- p( D7 @. d) Q
- .text:0040111B ; ---------------------------------------------------------------------------
* x! _9 L/ d; z' { - .text:0040111D align 10h
. Y4 K" p% G' t% a* S" s, [ - .text:00401120
6 v3 F0 k; c4 a* |, W - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
* Y0 {* A+ Y, [ - .text:00401120 ; sub_4010F0+3B↓j
1 C& ]4 t9 u: h( M, d - .text:00401120 cmp cl, [edx]$ V1 ~9 Q! U7 L) t9 m
- .text:00401122 jnz short loc_40112D
' F) k* v* u# T# g& A8 n; X - .text:00401124 mov cl, [eax+1]
- l8 C! O) K9 H6 W1 T7 w - .text:00401127 inc eax
7 x' \5 ?% i! M M) B% } - .text:00401128 inc edx. d7 c8 [+ ?) F+ l! h
- .text:00401129 test cl, cl
- R# T' w5 a7 R' g) N: x - .text:0040112B jnz short loc_401120
% F2 N: T/ k1 H' O. E7 V* R - .text:0040112D) D# ^( J! g% r- l
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
3 y& X, x7 h$ V% T- g - .text:0040112D movzx eax, byte ptr [eax]
7 U8 t/ A: `- W" K+ x' } - .text:00401130 movzx ecx, byte ptr [edx]
6 n/ n, O2 B S8 f3 p* Y - .text:00401133 sub eax, ecx2 V. f S5 R" r1 k4 |
- .text:00401135 neg eax* |' k, f. W% c$ N2 M. c8 Z
- .text:00401137 sbb al, al2 V2 u6 ^, \5 M7 h, |; f
- .text:00401139 inc al' S+ r+ O4 S; @$ @$ p: l8 r. y
- .text:0040113B xor edx, edx' Y3 g: |* L8 m2 F
- .text:0040113D test al, al! ~3 W6 A/ L3 y, ?; ]5 @9 ?* c
- .text:0040113F setz dl4 u. l Y" r# H' u+ ~
- .text:00401142 mov al, dl" {/ M: v8 s g5 j. L
- .text:00401144 retn 4! Q, q3 `& Z8 e8 `* }
- .text:00401147 ; ---------------------------------------------------------------------------
- E" O( z+ z$ v/ v% Q I - .text:00401147& Z4 o" D+ W5 P ]" N3 S2 C$ k4 o/ M
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
. Z1 c9 c U9 V% `4 F$ a - .text:00401147 ; sub_4010F0+C↑j ... W6 l& r& ?9 I+ J
- .text:00401147 xor al, al8 h4 h* z, I! {; h
- .text:00401149 xor edx, edx1 u' _; \' h# v2 R( I
- .text:0040114B test al, al
{- Q/ X4 l- m7 ?0 G. E( @! `8 l - .text:0040114D setz dl9 y/ _( u+ a2 L% V; C; s$ J' F
- .text:00401150 mov al, dl1 j, G/ K5 x9 @$ P- H) l$ ?
- .text:00401152 retn 4. G# j3 n; ]# T; ?; L# Z% _
- .text:00401152 sub_4010F0 endp
& R5 v/ F( C4 } - .text:00401152
6 Q8 j% m! D$ B, k( S1 G( m - .text:00401152 ; ---------------------------------------------------------------------------
0 L Y3 ]7 H: P5 G2 a9 c - .text:00401155 align 10h* z$ u$ O# L) r3 _. v3 O
- .text:00401160' |; i9 o1 m. p W3 [9 j- C8 P
- .text:00401160 ; =============== S U B R O U T I N E =======================================
% X9 r4 }4 L$ }; t - .text:004011603 f. K0 _' K9 G+ Y! f; r
- .text:004011605 u2 L( R9 M5 t7 [0 E, P
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
8 R9 z, v* L1 e# w! l( L6 V - .text:00401160 ; sub_4013F0+C↓p ...% }8 \5 G% P2 l/ ~" [
- .text:00401160
4 K8 d% s3 C3 f: B" Y - .text:00401160 arg_0 = dword ptr 4
$ Y9 Z$ J. m) K3 y6 b& O, O' O4 [# b - .text:00401160( U7 G1 R, K8 A( ?8 g
- .text:00401160 push esi
5 K/ t: N# W! u! G; P$ i s - .text:00401161 push edi
2 x, p" n8 D% R - .text:00401162 mov edi, [esp+8+arg_0]+ y& }1 ~8 {( A& x6 `
- .text:00401166 test edi, edi5 e3 `( J1 q* @$ Q. b5 {
- .text:00401168 mov esi, ecx
8 U1 J |# |; ^) [! K9 a - .text:0040116A jz short loc_4011CA
7 w0 U( z, H1 i, v - .text:0040116C mov eax, [esi]$ n$ M, o$ ?1 F2 |% j
- .text:0040116E cmp edi, eax. A2 o' Z, H# v6 Z s4 K& z
- .text:00401170 jz short loc_4011CA
' D. ]/ s. X7 A9 d - .text:00401172 cmp byte ptr [edi], 0
# v/ Y9 l7 Y1 E8 S - .text:00401175 jnz short loc_4011A2
0 ?& B- a: G9 D% v5 h, |) ~1 e" n - .text:00401177 test eax, eax
) H% x$ b8 b2 a4 q - .text:00401179 mov dword ptr [esi+4], 1& d, P1 X3 {2 V4 v# x K5 d
- .text:00401180 jz short loc_40118B
+ s# D: c8 i" u2 X+ _+ K - .text:00401182 push eax ; void *: X. j d Y7 b- @2 e
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *): E( N& j2 l4 C0 u5 Z" W7 S6 _
- .text:00401188 add esp, 4
) i% k9 u) u& O7 ? - .text:0040118B/ G" }1 U* g" [# F% M u
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j' ]8 C+ N" f) f2 h4 Z5 o7 t
- .text:0040118B push 6 ; Size" c% \: C7 \/ Q/ j6 R, _- B
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)6 M9 y1 C% T( y. i- j& y% _
- .text:00401192 add esp, 4
- }+ b1 m4 z- ? - .text:00401195 mov [esi], eax' H! b4 h) f! z- ?2 D* ?: H E
- .text:00401197 pop edi/ M( I9 k6 C" B8 C
- .text:00401198 mov dword ptr [eax], 0
, ]6 H I- E$ N R# k - .text:0040119E pop esi9 o) i5 S9 _8 G/ l4 \
- .text:0040119F retn 46 m0 ^; N) ~8 N3 [, |: p
- .text:004011A2 ; ---------------------------------------------------------------------------* O' \/ R. `. N8 }- c! M% [2 a' S' Q
- .text:004011A2
7 ]' W( ?1 e- c! _2 O3 F* E, b' k - .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
5 p( P, Z n2 C. v# @+ t! V - .text:004011A2 mov eax, edi
+ Y5 b; }3 a- t- i0 ~- U - .text:004011A4 lea edx, [eax+1]
$ w6 G. @; {7 U5 v9 \# U - .text:004011A7
; R/ `3 E( Y& X5 F+ W8 u$ K5 g - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j& w1 @6 H% Q/ t+ H: A
- .text:004011A7 mov cl, [eax]
" v. h0 W; x8 m) r; @ - .text:004011A9 inc eax
/ j0 W+ y1 ~4 V - .text:004011AA test cl, cl
0 U+ q& X+ A; v, _5 ~6 }& F! N4 e - .text:004011AC jnz short loc_4011A7
+ ^1 O6 h) S! u, ?1 { - .text:004011AE sub eax, edx! ^: k/ k. F: i8 F& T$ X0 |5 Q
- .text:004011B0 push eax
; s. f$ S: H2 h - .text:004011B1 mov ecx, esi9 I6 i: a0 Z+ B( p7 e
- .text:004011B3 call sub_401030, r# Z2 \& i7 L3 ?, v! p
- .text:004011B8 mov edx, [esi]1 U0 }* o- a9 q+ s' X5 C: n- }- E
- .text:004011BA mov ecx, edi8 X" d, u9 b4 ^ Q3 W! p; Q
- .text:004011BC lea esp, [esp+0]) n' L- |4 k7 `6 Y! r4 L
- .text:004011C0% g. d" M& y; Z1 A2 ?+ Y9 A
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j# W9 e$ P- i7 |3 E! T, G4 P5 S, X
- .text:004011C0 mov al, [ecx]3 O' ~6 H1 H3 l0 ^- X5 v
- .text:004011C2 inc ecx% Z* o3 |( O& l: K, T
- .text:004011C3 mov [edx], al
i/ \' E0 ]. j6 G* W1 r& q% C- E' U - .text:004011C5 inc edx! Y) }5 L9 Z7 k4 p4 P6 y1 q
- .text:004011C6 test al, al
. u b" r* a* _- @/ i( m - .text:004011C8 jnz short loc_4011C0
4 U. Q4 y/ d0 h! m, b" F. J; F. {" x - .text:004011CA
: V) m0 ]% ]" C( t0 i. S3 m9 h - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
* z" e3 }# w& ~% U4 x8 i - .text:004011CA ; sub_401160+10↑j
* n1 L( p; k. @: l: E; b( Q - .text:004011CA pop edi, l8 ~8 P1 S9 Z9 L; f
- .text:004011CB pop esi$ [. o' j% T C8 C% F! O6 A' O
- .text:004011CC retn 43 i V2 V7 G/ a8 O* d U
- .text:004011CC sub_401160 endp
, _( F/ U& T6 L - .text:004011CC3 n7 O4 O+ f9 t" Z- } k
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
9 m4 N' l: |1 s: c) d! I8 O" ^. Q- @
- L7 R% K- ?. r! Y. N |