本帖最后由 shane007 于 2023-8-27 13:23 编辑
7 D0 d; }/ V* M: Z' T+ ^/ Z, a/ L, H2 D" r& g
本游戏采用了CEGUI,该组件能采用directx和opengl。
8 a9 ^- S* ?3 X8 ?; `- p8 i. d经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。9 \" a8 _; ?7 S, X6 l
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。8 e& }* f& ] w# H: ?% `
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。); y+ W, b4 v4 W9 t, m# Y$ ?9 b
& ?* C0 I2 R( O' _
' r. `( R3 R8 H$ R/ G4 _在游戏中找一个字幕,在以下地方断下。
8 A7 B% O! {0 J( O由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),* k8 B( q9 }# w
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。/ W E9 B* S% c* l) {
[4 l6 r! f7 k' M0 @- T
- NextLife.exe+11C5 - 42 - inc edx
! o: _ X2 n: B/ C# E - 004011C5
复制代码 , X1 k z" |# T' a6 L
* n3 G* [* t V( s
该地方的伪代码$ K- X! ^" W3 f/ v! a
- void __thiscall sub_401160(char **this, const char *a2)/ G4 E: V3 B7 j+ S9 e
- {
2 V x( \ n) U! _( Q - char **v2; // esi
9 u0 E8 S) J! i - char *v3; // eax2 C4 X) K1 y, M3 c3 \4 W. q
- char *v4; // eax
1 s0 N) K/ f8 M* a4 a r; C7 P: [
) A- q/ O: t6 n. a- v2 = this;3 ^3 a$ V" i, q) b2 R0 P
- if ( a2 )
1 G( Q" w: {% w- N* t - {5 f4 a! P1 @5 F. K
- v3 = *this;
3 A) u/ Z4 d$ W9 u* K6 P - if ( a2 != *this )
# ?, H5 s6 F1 a" I - {6 s; `; U3 w* h. n$ i/ p( v# g9 n
- if ( *a2 )
9 b9 `) D- \5 V2 y - {
2 R# m# v/ \; R+ \) X3 q: } - sub_401030(strlen(a2));
3 j% a$ @, s- f3 V - strcpy(*v2, a2);, o+ d# L& H- I
- }" x0 t: c- K- L" ?, n
- else# Q* _: V: \' Y, m6 Q, H
- {7 }! j; [% k! @( a, ]5 O/ O4 d# b
- this[1] = (char *)1;
6 R; F8 a+ d; t; N& F - if ( v3 )0 v' {' |) D& ?, A1 N8 N
- operator delete[](v3);+ I- { a% H# J) B1 X
- v4 = (char *)operator new(6u);9 I: w+ O* \. e# i
- *v2 = v4;+ S4 }- s* b* q& C1 e' ^3 u
- *(_DWORD *)v4 = 0;
& @5 [+ |0 z- i" @" W - }
9 _( T$ w7 {. T, p, E8 Z - }
+ a' D# V. V- ]% ^! O - }
8 p }. P# g- v! y - }
复制代码 . o _! s% H6 c/ i) I
汇编代码
" ^. H/ ], p5 ^- .text:004010F0
8 U3 S5 C! Q: l* R - .text:004010F0 ; =============== S U B R O U T I N E =======================================! I$ D( k9 H- C, P
- .text:004010F0
6 u; v3 h! E2 S/ h. A- k- X - .text:004010F0
. h' X8 w5 X# u# X ]+ q: [' E, @5 C - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p
w5 w/ H; _& t3 y/ Y) ^! f9 j - .text:004010F0 ; sub_403240+97E↓p ...
# I/ [6 {' G1 J$ L% B! a - .text:004010F09 c& J) L/ D. y8 R
- .text:004010F0 arg_0 = dword ptr 4
; A" }6 J, g& I% @ Y. Y - .text:004010F0; N- h3 ], T3 @1 P$ N* h4 \
- .text:004010F0 mov eax, [ecx]
0 q$ W: e# \. y: L1 c9 ~ - .text:004010F2 test eax, eax
1 F3 m3 E% P* V' y - .text:004010F4 mov edx, [esp+arg_0]+ M: v/ P% e3 t! T
- .text:004010F8 jz short loc_401147
- F6 V/ i9 L& H6 y! v - .text:004010FA test edx, edx5 v3 R$ a f; H% w
- .text:004010FC jz short loc_401147
: ]. D4 |" f: ? - .text:004010FE mov cl, [eax]
( ]7 f1 ~8 [" r$ f - .text:00401100 test cl, cl! m) V- x6 S5 a: O1 m' g
- .text:00401102 jnz short loc_401116
4 z4 u$ {% V+ E" N2 t - .text:00401104 cmp byte ptr [edx], 0
4 S8 m0 Z5 f3 ^ - .text:00401107 setz al2 }3 u1 H5 z. w# u7 F% K
- .text:0040110A xor edx, edx+ ^7 R& [& p/ W6 Z6 S! {
- .text:0040110C test al, al$ Q) z( q( m, o, F- B+ b; i$ H
- .text:0040110E setz dl
2 j' [% J# d$ Z, j/ r - .text:00401111 mov al, dl+ C# P! c/ O' j% p2 G" f
- .text:00401113 retn 49 x7 d: A; P. x8 z
- .text:00401116 ; ---------------------------------------------------------------------------2 H7 _* ?+ w. E# d
- .text:004011168 E+ M# a: _4 g4 s; e2 y* J
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j0 i) i* j* F" y: ~( q" ]- T
- .text:00401116 cmp byte ptr [edx], 0
8 ]1 h+ R4 f/ s( x - .text:00401119 jz short loc_401147
- ~! i9 ?# W+ D d - .text:0040111B jmp short loc_4011201 z# I0 J7 O- S+ T
- .text:0040111B ; ---------------------------------------------------------------------------
& e/ c$ S. G$ Y7 M) J" \ - .text:0040111D align 10h% X1 R3 {+ {9 V) L
- .text:00401120
& [* P7 I, a3 T3 @1 Z; q4 j9 H - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j/ D C$ u% ]% f; K, ~
- .text:00401120 ; sub_4010F0+3B↓j
( ^' J9 k. ~8 s5 z - .text:00401120 cmp cl, [edx]
9 z: {4 B/ \* g) h1 a8 D - .text:00401122 jnz short loc_40112D6 K! a" @/ g8 G. o4 k( O
- .text:00401124 mov cl, [eax+1]+ y- G0 L. t- t L3 A0 o' ^. {
- .text:00401127 inc eax. P# D& ?, ?, }0 u6 r1 H
- .text:00401128 inc edx' P7 \. G- m8 N9 r4 u5 s* \
- .text:00401129 test cl, cl$ G2 z( t5 R- W; z3 u6 G
- .text:0040112B jnz short loc_401120; H, m8 S0 f: L1 B
- .text:0040112D- b$ D& Q' z+ E
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j8 y/ W1 }5 l1 _; }( W9 y3 c: Q
- .text:0040112D movzx eax, byte ptr [eax]; _5 n+ T0 b% M7 Q( p" T4 E: P0 S! H
- .text:00401130 movzx ecx, byte ptr [edx]6 q9 r1 c2 K! r- s% Q
- .text:00401133 sub eax, ecx
% c$ o7 W9 v% f: N7 T" x - .text:00401135 neg eax1 n! l* D: b' |
- .text:00401137 sbb al, al
4 U0 J# k3 X4 R - .text:00401139 inc al2 x+ e# C$ I8 k+ _
- .text:0040113B xor edx, edx( C) ?% R+ C n, j! \
- .text:0040113D test al, al
+ e( ^7 S' C" @ - .text:0040113F setz dl
3 w& O) O+ _0 A' L+ w- b - .text:00401142 mov al, dl
& o; l* [4 ~4 f k - .text:00401144 retn 4; J' t- N4 [1 O
- .text:00401147 ; ---------------------------------------------------------------------------
7 h$ l% k& {9 e4 X) d - .text:00401147# j: H7 _) r) k7 P
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
! Z1 ~) T1 e3 e" m - .text:00401147 ; sub_4010F0+C↑j ...- ]2 f( j- Z+ C9 W$ v6 l
- .text:00401147 xor al, al& `- I, A6 y( E4 j0 M! s6 I/ _5 {
- .text:00401149 xor edx, edx, l8 C6 q# z9 J
- .text:0040114B test al, al$ M2 s+ S3 t& A. j# c4 a0 W$ v/ n
- .text:0040114D setz dl
& F6 J0 q' d, L+ `# _ - .text:00401150 mov al, dl v# `- O6 v& B
- .text:00401152 retn 4
S5 \2 H- d0 B- O" ], [ - .text:00401152 sub_4010F0 endp
+ z9 Q" B& w* w, Y$ l/ l% y - .text:00401152
$ u N4 I0 r) G8 N - .text:00401152 ; ---------------------------------------------------------------------------8 V9 F. E; [ R* V; H
- .text:00401155 align 10h5 q6 i/ ~; U* @( [
- .text:004011606 {' D7 a& M/ U! |. C
- .text:00401160 ; =============== S U B R O U T I N E =======================================
3 i9 j7 d% L0 T5 K6 y$ ~& [" t! a - .text:004011600 I D% c8 `$ O( I5 Z3 P
- .text:004011600 b$ S! g3 K4 i* \
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p; L( S; `" e8 x5 ]' T
- .text:00401160 ; sub_4013F0+C↓p ...7 W8 l2 u9 q) d9 d5 z5 t& T M
- .text:00401160
0 z X. k2 t7 a8 y) V - .text:00401160 arg_0 = dword ptr 4
+ }; x, N/ Q. @ - .text:00401160
1 Z s; f& ?, ~5 ^* W7 j - .text:00401160 push esi
: Q4 _/ Z+ h. h$ `* K1 P - .text:00401161 push edi
5 W! X, t! D) }1 g2 v* [8 p - .text:00401162 mov edi, [esp+8+arg_0]
4 x7 c6 S( e4 \ - .text:00401166 test edi, edi
0 c. {* n& q% R, F* D# v - .text:00401168 mov esi, ecx, W; G; U O/ G. ?* B& X
- .text:0040116A jz short loc_4011CA
. T: m( b( [1 _1 n - .text:0040116C mov eax, [esi]1 A6 m3 N1 G- E+ |
- .text:0040116E cmp edi, eax) [/ R) {1 |, v) N v/ w
- .text:00401170 jz short loc_4011CA9 b9 f' ^+ f7 j! L) G
- .text:00401172 cmp byte ptr [edi], 0
/ j5 n/ W/ G. c - .text:00401175 jnz short loc_4011A2. n8 S, M8 D& L$ k* M/ D
- .text:00401177 test eax, eax
$ q% z k7 v. I) P2 L' K - .text:00401179 mov dword ptr [esi+4], 18 L: T+ k4 v! r' T5 D
- .text:00401180 jz short loc_40118B
. J# X4 g: V# d5 p4 I- |5 [ - .text:00401182 push eax ; void *" Z; G& U3 I8 k3 T* X( G
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)1 T$ q0 J) S! u4 J
- .text:00401188 add esp, 4- `0 ^1 S' t8 ?! ]
- .text:0040118B
s4 Z+ w' U h5 i - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j- Z/ j6 ~: W& A
- .text:0040118B push 6 ; Size
9 `& b* q" `7 s$ J; [/ d s7 t - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
# K# K G) P5 h6 W - .text:00401192 add esp, 4
3 T4 H$ g$ D4 ~5 x1 m* J - .text:00401195 mov [esi], eax
& }* m- k. \5 K9 m' b$ @& N9 r - .text:00401197 pop edi- Z9 N# P' l" N
- .text:00401198 mov dword ptr [eax], 0
( L; D2 Y! b. Y. q" L2 z0 x - .text:0040119E pop esi
* F0 u1 P! k! m% t8 E - .text:0040119F retn 47 ^; { t1 z7 W$ F! J0 G' t
- .text:004011A2 ; ---------------------------------------------------------------------------6 \8 T8 N, T8 Q- o
- .text:004011A2
* l) K4 |- h7 P0 v! Y8 g! T - .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
C7 H# U( v1 Q+ Y - .text:004011A2 mov eax, edi
0 T; [1 H2 F9 D2 [# A0 v/ A - .text:004011A4 lea edx, [eax+1]
1 K& s4 ]' v% t( a: Y% Q - .text:004011A7
+ f9 s' M7 T+ x - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
. I2 X2 k& W% F2 z- y5 y - .text:004011A7 mov cl, [eax]" {1 h* W b2 Y; R( ?
- .text:004011A9 inc eax- Q+ G5 a8 z2 P) E# s, R: i- [
- .text:004011AA test cl, cl
/ _' _/ Z j$ n8 J - .text:004011AC jnz short loc_4011A7
1 P/ G C; `2 ] - .text:004011AE sub eax, edx0 N( M( t) \( P3 h, N7 ?. D* ~
- .text:004011B0 push eax; K4 F/ P; q4 K( X
- .text:004011B1 mov ecx, esi
$ c1 A% A* O" k% S2 B2 l - .text:004011B3 call sub_401030$ c6 |# R y Q3 F" t
- .text:004011B8 mov edx, [esi]2 O! U+ x# ?/ j$ A5 N0 I* ?3 N
- .text:004011BA mov ecx, edi
& M% Q1 j3 Q: n, o3 W - .text:004011BC lea esp, [esp+0]' C' P C/ c/ t
- .text:004011C07 v" ^- d- \: Q
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
`5 k7 R9 v! Y6 `5 P* e7 E: F - .text:004011C0 mov al, [ecx]9 X5 X- R( q3 a: ~. p. T
- .text:004011C2 inc ecx
0 ? ]) }6 L! C3 x s: i$ r - .text:004011C3 mov [edx], al5 p9 @% n2 S( h6 v F6 ?
- .text:004011C5 inc edx! p7 d" n7 t+ H' Y8 B! K' M* A
- .text:004011C6 test al, al: f; a9 [ s) A7 P- |+ Z
- .text:004011C8 jnz short loc_4011C0 V- Y" l; i, N1 U
- .text:004011CA
( I0 {* t! y. O* l* Z: b - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
! S+ l3 k+ y# K$ q( ~ - .text:004011CA ; sub_401160+10↑j- q e) N* l5 L7 W/ _- ^1 \0 `9 P
- .text:004011CA pop edi
& u- K9 g: ~# C0 L5 J - .text:004011CB pop esi
$ m1 b8 c3 E! u - .text:004011CC retn 4
* z5 Q; R# F1 v2 a7 A# z, \+ k - .text:004011CC sub_401160 endp
1 f- Q* A3 Y5 T t) d1 A - .text:004011CC
4 p1 a4 l% x C2 s; @" C9 d, Y7 w - .text:004011CC ; ---------------------------------------------------------------------------
复制代码 7 u0 ^4 _8 ^/ L" \$ O ]
; [" g4 Y) v0 z, P" I7 N+ H
+ F* u& [; B6 u8 o- G4 Q |