本帖最后由 shane007 于 2023-8-27 13:23 编辑
2 o; b! r3 Z- s; P% }1 e: V+ J; J1 @5 E4 ^8 S8 G
本游戏采用了CEGUI,该组件能采用directx和opengl。
% M7 k6 _/ T$ W! S经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
( |# G# c3 S, J7 B6 v游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。. |& w4 K* K @% l1 v' s. ~9 W
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
6 e: c, w- `1 }2 u) t
8 n! Q$ W5 P$ M# F# Y1 n7 ]% Q$ z
在游戏中找一个字幕,在以下地方断下。
' z+ L- f% Z" H) n" j/ H由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
+ t; j) {* b0 o' d因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。( M& B& i0 [( \5 G% F
* v! l+ U. a* e+ O6 b; A! s- NextLife.exe+11C5 - 42 - inc edx; b O# {5 L4 ^- }7 R' f
- 004011C5
复制代码 0 o; q/ N. @# g6 U, A4 C8 B
4 N" N0 T. [( m) [3 w
该地方的伪代码
, A9 A) \: K2 [5 C# P: r% h" `+ @0 Z- void __thiscall sub_401160(char **this, const char *a2)( ~4 Y+ ^# z/ Z" u8 U
- {* E$ W, Z" q+ g+ F i$ D
- char **v2; // esi/ I b, n9 N2 M% k% J e$ L
- char *v3; // eax4 `( c3 ?, i. n0 ?# B: O& F9 A
- char *v4; // eax" S0 t1 @1 u+ B0 x; [
9 S3 |( x% m3 V7 l- v2 = this;: w; F1 P( H- |- `6 Q" F3 R
- if ( a2 )
; y& e0 F$ L$ e, h# D6 W - {
6 K) K* W m: S- M" e6 v+ t - v3 = *this;
- `6 Y& p2 b( H9 _, r) }( ? - if ( a2 != *this )
O: `! L# R+ \# l - { ^, Q9 K# b$ I g8 q, d" n
- if ( *a2 )" d2 _1 m& K* D' `/ `1 P/ N
- {( A, Q( e- W; |: \% J8 g
- sub_401030(strlen(a2));" G* t- \) T( j* P" r
- strcpy(*v2, a2);/ R! v5 j* P, Y" j& {
- }
' a) _* X; k+ C( N4 x" Y5 V. r) O! g - else8 e3 M/ n9 M; ? A
- {
$ a% _- t$ O1 D3 F% p6 i - this[1] = (char *)1;
/ o: Q+ x4 i4 q) s8 a; b* `" F: F6 A G - if ( v3 )& Y5 x! ?- h" U! {. [- i+ w: e
- operator delete[](v3);
# A0 O& g4 \% L. U" | N5 U - v4 = (char *)operator new(6u);" x7 l& r1 F8 q. p
- *v2 = v4;
4 b% \5 m" n1 M2 H - *(_DWORD *)v4 = 0;5 q$ y ~8 N( x& [! B0 L1 {+ a" N
- }
- l. [( e: K% Q& L. r% \# `% j2 f - }8 g+ W& L; |6 D7 o2 w
- }
) H! ^- W0 u& a& P$ b - }
复制代码
$ h4 d" S) r H* q) L汇编代码8 G4 P6 N( F H- A0 y4 t9 `
- .text:004010F0
) u# t" P1 u4 B3 A - .text:004010F0 ; =============== S U B R O U T I N E =======================================
" S1 a: E# J$ y' @, i# f+ L; C- | - .text:004010F0
" A0 n* u5 b; e1 K {/ ~ - .text:004010F0
0 D1 B5 x; P2 D+ b+ m) @# k! I+ d - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p/ H9 [* [, z6 q( j' g
- .text:004010F0 ; sub_403240+97E↓p ..., g, o1 E) C: ]: v
- .text:004010F0
6 X3 N8 f3 ^, N3 Q% A/ W6 S( u( o - .text:004010F0 arg_0 = dword ptr 4
2 L: [! S, P/ P" l - .text:004010F0
8 x5 b6 P# {' Q7 | - .text:004010F0 mov eax, [ecx]
% V, S# ^& @9 L8 K - .text:004010F2 test eax, eax0 y8 {+ Z' Q7 X8 E' X1 P9 G, D
- .text:004010F4 mov edx, [esp+arg_0]
* z1 j. k+ o$ u! z - .text:004010F8 jz short loc_401147; i5 c, r. _' y3 n3 H1 `3 b8 V
- .text:004010FA test edx, edx- d5 K1 A/ a" d
- .text:004010FC jz short loc_4011472 y1 b5 ?# \/ y: g4 M
- .text:004010FE mov cl, [eax]/ y: x' a! `' D1 s# q% c4 S' i
- .text:00401100 test cl, cl
: P1 \5 U/ s, ?0 T - .text:00401102 jnz short loc_401116
- W8 }. X) U+ _+ J8 g, o4 N0 W - .text:00401104 cmp byte ptr [edx], 0
% b, M! U( B9 Z* o' O' A - .text:00401107 setz al
# M1 Q7 a8 j/ X' A( ]; U - .text:0040110A xor edx, edx6 H0 \( U8 q- X$ w' q" S5 K1 X0 K; N
- .text:0040110C test al, al% o* b5 ~! l* Q8 N( D, D
- .text:0040110E setz dl' _5 N& s% F$ C+ ?3 Z
- .text:00401111 mov al, dl
Z* d+ W; v; T2 c1 W - .text:00401113 retn 4
. l# u, p3 K7 | - .text:00401116 ; ---------------------------------------------------------------------------
: N2 z9 Q* U8 y - .text:00401116
8 t6 S/ d+ l. `5 o - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j7 y4 Y0 u2 k3 e6 O( O4 r* I) v
- .text:00401116 cmp byte ptr [edx], 0
0 i; u% Q/ \9 C9 ^- B - .text:00401119 jz short loc_401147
$ z' m; `9 T: ]* w& |' j9 k2 k - .text:0040111B jmp short loc_4011205 d4 I. O) s6 `( _) u: ~* \% o% q. J
- .text:0040111B ; ---------------------------------------------------------------------------
+ s, q9 Q" g6 a2 P/ n( Q - .text:0040111D align 10h
O; M, J2 q7 k+ w6 X - .text:00401120
q9 ]# f' Z! \' j: ^5 @ - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j! D7 x h: |: V9 J4 G& F; O
- .text:00401120 ; sub_4010F0+3B↓j
5 K3 j3 U/ e' x- ^6 e2 c4 V% s - .text:00401120 cmp cl, [edx]
" f5 i( F7 `: B( a1 u9 q - .text:00401122 jnz short loc_40112D) u) C4 I3 E( }; M% `5 ?& Y' d/ Q, T
- .text:00401124 mov cl, [eax+1], O" w" b; ~# Q5 F6 E% V d6 d: B
- .text:00401127 inc eax
# c/ d/ k" X- a/ [( N - .text:00401128 inc edx% g- r8 ?& s: O/ I' r7 v7 \! f
- .text:00401129 test cl, cl' L U5 z; o. }) N, o
- .text:0040112B jnz short loc_401120
0 ~1 U4 w% h; [6 k1 q - .text:0040112D
9 O4 ~. h6 ?5 @# ] - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j( K V7 d5 V+ h" f" D- B& ^
- .text:0040112D movzx eax, byte ptr [eax]
4 T/ u! \- j! w+ \ - .text:00401130 movzx ecx, byte ptr [edx]7 B) \8 ?8 ~) Z6 k3 H
- .text:00401133 sub eax, ecx6 f2 q* l: Y$ M+ j) F! j
- .text:00401135 neg eax+ V1 Q% d6 {$ a" k* H' z5 N
- .text:00401137 sbb al, al G$ p- B/ ~, J$ ^
- .text:00401139 inc al6 S6 x; B: S( j8 u
- .text:0040113B xor edx, edx
- z7 t* W- Z/ R! q( E - .text:0040113D test al, al
% e' B1 M' Y6 K) \7 b0 ` - .text:0040113F setz dl
. x/ d) e: z7 { - .text:00401142 mov al, dl; s9 H3 k2 b. U3 i; H! b
- .text:00401144 retn 40 O, t, a- W" v& K+ b: w4 ^8 e
- .text:00401147 ; ---------------------------------------------------------------------------# O3 E& |- c0 E' |% Z" W+ k# P% x
- .text:004011475 ^4 z' }; a" j+ N) @; w
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
5 D* o5 s5 P! P% v - .text:00401147 ; sub_4010F0+C↑j ...
: |- z/ s& j/ A) y" ~ ~9 g3 @ - .text:00401147 xor al, al6 C. M" o; s# |! H( G ]
- .text:00401149 xor edx, edx
% ^( \9 Q! ]* F2 |; t+ J8 w+ o2 {5 E. B - .text:0040114B test al, al
* ]& D+ O/ y4 `" j8 ~ - .text:0040114D setz dl2 x0 ? u, Q6 N! F) J
- .text:00401150 mov al, dl- ~) W, F( q: q1 E: U% q% A5 s% c
- .text:00401152 retn 4
, r0 I3 h& @6 t - .text:00401152 sub_4010F0 endp
4 @3 Q6 U! s z% s7 m5 R4 y - .text:00401152
' }: {/ M+ W3 B9 O/ x4 ?0 _) t - .text:00401152 ; ---------------------------------------------------------------------------$ Y- t) s" e8 J0 j7 ~, x
- .text:00401155 align 10h2 C2 _; a( u$ U# Y2 _9 o y- @
- .text:00401160
3 ~4 P# B' e: i$ b - .text:00401160 ; =============== S U B R O U T I N E =======================================' @2 e7 F$ a) H: K
- .text:004011603 a/ z w7 S1 o8 S2 h3 D& s
- .text:00401160: B4 o/ `( @4 F3 r/ x3 c
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
# x3 V; F- R% q1 c6 M/ E - .text:00401160 ; sub_4013F0+C↓p ...
' s9 R8 C: ]- ^. H( W8 { - .text:00401160
* u/ H/ g3 }+ r6 ]4 ` - .text:00401160 arg_0 = dword ptr 4+ ?& x7 F# T& J
- .text:00401160" n5 _) ~. A. y7 u5 F
- .text:00401160 push esi
4 ]' J( O* L M8 P( J - .text:00401161 push edi
" k) t, P) m; w) } - .text:00401162 mov edi, [esp+8+arg_0]2 q3 x$ W8 E7 r
- .text:00401166 test edi, edi
% t, T1 j3 d" E! y" L/ r* u6 ? - .text:00401168 mov esi, ecx3 c- g! {) Q/ r0 |/ q
- .text:0040116A jz short loc_4011CA% p6 ?% u% a5 Y7 M/ l; g
- .text:0040116C mov eax, [esi]
$ z# B. D. G) V( x n% Y) K - .text:0040116E cmp edi, eax
7 |% Q/ h# w3 q7 F8 G1 y - .text:00401170 jz short loc_4011CA
& p7 u. E0 I, ]/ [* W9 E - .text:00401172 cmp byte ptr [edi], 01 f4 b: H% |, g# G. t
- .text:00401175 jnz short loc_4011A2; G- r# H6 r7 n( }
- .text:00401177 test eax, eax1 E& O0 Y. x; c% {- M# Y# U- s$ t
- .text:00401179 mov dword ptr [esi+4], 1# ], {7 U& g2 b. q( c# I$ Y
- .text:00401180 jz short loc_40118B6 z' s: M5 C. [; N) z
- .text:00401182 push eax ; void *
+ b; f( Z$ T% E- g6 G1 A - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)& J5 R, w' X. |- j4 n% a% g' v
- .text:00401188 add esp, 45 i* l9 J+ ?: D; d8 H& R* s
- .text:0040118B
# z: ]$ O5 Q6 e7 s - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
7 J2 Y: y4 Q1 }4 A ]0 C8 F - .text:0040118B push 6 ; Size
- a$ W. ?7 l6 T: B7 L5 p9 ?9 n+ C - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)% W! a+ k2 [8 E! Z v
- .text:00401192 add esp, 4% w2 H2 C+ Z9 c1 c, G0 x5 r
- .text:00401195 mov [esi], eax0 W" U! Y: q+ F; \
- .text:00401197 pop edi. N( ?/ U9 [( @
- .text:00401198 mov dword ptr [eax], 00 C0 X! x0 T& e6 f- `0 C5 [) y
- .text:0040119E pop esi
$ c" S: J: ^: W - .text:0040119F retn 46 ?2 d" J M8 [' I4 w$ r" Y
- .text:004011A2 ; ---------------------------------------------------------------------------5 r3 }: b1 x: r4 S7 \% S0 N
- .text:004011A2
% a0 [7 I6 f& {- H( z n - .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
& q$ t. I |& `: H. O - .text:004011A2 mov eax, edi' u) E0 H" ]2 |2 `( E9 o! r
- .text:004011A4 lea edx, [eax+1]2 ^4 O$ H, R1 \/ v9 u
- .text:004011A7/ K R# c7 x; p
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j4 X9 C+ z& _' E( t0 V
- .text:004011A7 mov cl, [eax]
5 t ]2 s. ?, Y& n3 O: {. K - .text:004011A9 inc eax- x8 F3 w) b2 Q! P
- .text:004011AA test cl, cl
6 f6 B: N0 W! ?) l - .text:004011AC jnz short loc_4011A7" F) J! g1 m7 q
- .text:004011AE sub eax, edx3 p: ?) t$ {! M. W, k" Y$ q" p+ O
- .text:004011B0 push eax
. C5 @: S; v \% i+ I0 _ - .text:004011B1 mov ecx, esi
. Z) x1 J3 |9 H: T+ M$ \* q - .text:004011B3 call sub_401030. x( F7 t- N$ f& C- R$ w7 Z; E
- .text:004011B8 mov edx, [esi]5 W E- Y; @2 E- E2 y: z
- .text:004011BA mov ecx, edi
6 ^( S/ ]7 N0 u+ x' ~2 b - .text:004011BC lea esp, [esp+0]6 C1 L+ R# V- D, G9 G& f6 M$ W
- .text:004011C0
; a0 f+ |! t0 K, {/ v! g9 \, L - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
! `% }* ^5 }( L1 e: W& G* }+ ^/ o) P# E - .text:004011C0 mov al, [ecx]" E+ g3 I+ r, x8 E- f5 A {- z
- .text:004011C2 inc ecx& L. ~( I" }3 \$ P8 N
- .text:004011C3 mov [edx], al
; i1 N5 h' R; C- C) c - .text:004011C5 inc edx1 c. \5 e0 n) I; s
- .text:004011C6 test al, al
. v0 n Z& B: y: \ - .text:004011C8 jnz short loc_4011C0
. P* _+ Y4 [/ u3 X% Q0 S# s& C - .text:004011CA5 g3 X8 O/ `. J$ I% K# |
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
1 p1 Z8 M" \. r7 } - .text:004011CA ; sub_401160+10↑j
4 D4 q+ C) j$ U - .text:004011CA pop edi
. S* R6 i& k$ a. F4 W - .text:004011CB pop esi
# [/ ^, |: b- R. @- ?9 _: _( A9 r2 r - .text:004011CC retn 4
8 L9 i* ~8 l" k; Z4 v - .text:004011CC sub_401160 endp; x6 M1 |/ {2 {1 w4 d) ~* R
- .text:004011CC) L* v7 t0 V7 ?, F
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
! r1 G L$ u" P; ^0 f% q' n" C3 \2 e8 A) J( D
- f$ ]/ i! j' e3 j& y
|