本帖最后由 shane007 于 2023-8-27 13:23 编辑 . k9 G' D" l. y$ u
8 D) B( _8 A, ]本游戏采用了CEGUI,该组件能采用directx和opengl。
9 t' x- @! O p. F经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。& C$ k3 o, \3 R3 e) q r* G! N
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
! U: Q/ k2 f! A0 X; R(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。): X# v, l; B7 \& K, G7 a: D
1 q! t6 i R0 r/ d, F& R
% L, }5 l1 ?& d5 A在游戏中找一个字幕,在以下地方断下。
" j; h( R6 u6 G% F4 Q Y1 {0 O由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
( D9 t4 ?/ D6 `2 g4 \因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。5 f0 Z+ r/ [( l" O I
' \9 |9 P" L. r3 S9 s4 @& A8 H
- NextLife.exe+11C5 - 42 - inc edx
% m) L: E3 v; V, D: u; ]7 c: c9 P - 004011C5
复制代码
! \5 u$ F8 X3 v1 H0 G/ \1 q+ M5 v& A# w; j8 T
该地方的伪代码8 k H2 X" G+ t9 i4 c0 n" _8 ]
- void __thiscall sub_401160(char **this, const char *a2)
. r5 w& [9 N' i. A( E/ S# K - {
1 ? _; `( E0 O: i4 }2 s - char **v2; // esi
! I7 t, O* V6 O% C8 E* P0 H - char *v3; // eax, ?) I5 `0 i, o" b7 |! i# w
- char *v4; // eax
" o `6 r( h4 M1 b( j - ; q+ `7 s, [5 u8 E1 ?. Y
- v2 = this;2 i/ B$ E% x( f2 K( V0 J
- if ( a2 )
. E* i: b5 p5 f+ J; L6 b# a - {
' m" E$ a' `7 R7 E9 W% L4 _# h% x! p - v3 = *this;
2 v/ F% w, [" l& q* l6 o" B - if ( a2 != *this )1 E6 P: M$ A& g7 Z2 @9 ^7 ^0 t
- {
' b/ [' h% z/ |+ {- M1 }. H& A' k - if ( *a2 )+ ^1 e- S" W Q/ }; q
- {
3 M/ E" j d$ V5 ?& K' a - sub_401030(strlen(a2)); M# _ {6 m I n( Z3 H2 z# B
- strcpy(*v2, a2); {" q6 O( r1 \8 N4 U, y
- }
4 D' j# ]6 r# o# r- K4 B7 P - else D3 Y5 R4 I; P9 ^) j% _ {9 y, `
- {! m) x# f) q4 [& d2 z
- this[1] = (char *)1;. K; N, V' f/ U U
- if ( v3 )& W; \! G$ B1 Q i0 ^ a0 Z/ H1 V$ C
- operator delete[](v3);
7 E8 {3 L' d- ^* l5 ^6 u - v4 = (char *)operator new(6u);
3 s C' }* D6 x' S+ v8 e3 {, ] - *v2 = v4;
0 ]& J+ S. Z2 F. E E$ o7 l - *(_DWORD *)v4 = 0;' o* Y3 a& L0 @9 l& o1 F" _
- }
% O1 \2 e& o% b, }1 S% h7 _9 Y - }
1 Q# C* ?) M' \' D4 ^1 E - }% T5 I. p' o9 {1 {4 J
- }
复制代码 # X: ~* R2 Y( z, G4 {' f6 f- g; F; r
汇编代码% g) O& R+ f; b
- .text:004010F06 N6 V6 h4 g& f( ]' ~
- .text:004010F0 ; =============== S U B R O U T I N E =======================================- Q& M/ |; P+ u6 C
- .text:004010F00 [. R8 B* e, h( Y2 ^
- .text:004010F0
# Z, }0 l6 X3 t - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p- [2 r8 z- ]$ M: N, L& Z
- .text:004010F0 ; sub_403240+97E↓p ...' D+ J3 j5 s. n: k
- .text:004010F0
7 }: R: P5 z$ K( o - .text:004010F0 arg_0 = dword ptr 4# J- ]8 ^: `9 c, T; \4 M `
- .text:004010F0( f$ {0 `! y) f7 i1 f
- .text:004010F0 mov eax, [ecx]$ j$ v' R4 H# D" r; c3 K- U; B
- .text:004010F2 test eax, eax
4 k( E4 L4 i" H+ w. x - .text:004010F4 mov edx, [esp+arg_0]
" {; K! P) I" m1 y4 g; X - .text:004010F8 jz short loc_4011478 n4 F! h; O6 G8 _
- .text:004010FA test edx, edx
; i4 Y0 @# | j, [! Z* k+ p - .text:004010FC jz short loc_401147: F* d) Z. E$ U
- .text:004010FE mov cl, [eax]( |- |3 r% \% \2 T2 s: f+ u
- .text:00401100 test cl, cl
6 U( P* Q5 w! `, i2 K0 p: _ - .text:00401102 jnz short loc_4011169 n: m0 @8 F+ Z; X7 n2 _ ^1 Q
- .text:00401104 cmp byte ptr [edx], 0
/ D; c$ |1 [/ e/ f: J7 _: ?4 j - .text:00401107 setz al) Q7 M& v6 ^# M8 Z, x) f h: h: \- g
- .text:0040110A xor edx, edx
. ^- j$ Y2 P: U+ Z% \4 @9 B - .text:0040110C test al, al0 l. Z* |& H# S, F6 I7 _
- .text:0040110E setz dl( b9 n" k* j: Z* p: U
- .text:00401111 mov al, dl
; j" \, T8 O) F5 b" S) Z! Y) L - .text:00401113 retn 4: H# x6 t, T6 v- o& ^9 K$ l
- .text:00401116 ; ---------------------------------------------------------------------------- w! [8 }! ]) v0 O
- .text:00401116
# c( g$ E; Q- ^+ ^1 P; d k - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
: Q+ Y& v9 [, i - .text:00401116 cmp byte ptr [edx], 0) l8 |6 q) E( L
- .text:00401119 jz short loc_401147
9 H. {! F: {' L - .text:0040111B jmp short loc_4011206 E& n7 R; b2 M+ V( n% `
- .text:0040111B ; ---------------------------------------------------------------------------; ~0 M9 x# \: ^; j' y$ x
- .text:0040111D align 10h
) c- H/ y- y2 _, T - .text:00401120& f- ~1 l4 G! x- h/ X5 D
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
" [( y$ w# x% W K2 Q( P2 ^ - .text:00401120 ; sub_4010F0+3B↓j
. x, P5 |. u7 X, b9 o" {# U - .text:00401120 cmp cl, [edx]) u5 r; O0 O. s* I8 z7 `/ R
- .text:00401122 jnz short loc_40112D
7 I& x0 t4 E: v/ v% W5 c% ` - .text:00401124 mov cl, [eax+1]4 _' t( o0 J5 I
- .text:00401127 inc eax
f1 i. g0 f! O1 I5 m9 L. c - .text:00401128 inc edx
1 y0 Q4 @ h3 J7 t3 J( A - .text:00401129 test cl, cl
& Z5 a) x$ n) W: |8 x5 Q/ q - .text:0040112B jnz short loc_401120, y! y$ }, Y8 T) P' W9 t M
- .text:0040112D' v) W9 {6 c& e) ~' L0 b# k
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
3 T" H. T9 S7 F& E2 v+ s! ? - .text:0040112D movzx eax, byte ptr [eax]; V9 }# ^2 f" D! e
- .text:00401130 movzx ecx, byte ptr [edx]
) H2 X M, d* n0 l3 v# q7 I - .text:00401133 sub eax, ecx
* m z x' i. i* z: N) U+ a& \ - .text:00401135 neg eax+ e7 |; S1 h6 t2 q
- .text:00401137 sbb al, al' h: F+ z, ^ O5 a' k( f2 L
- .text:00401139 inc al
2 m# n* h+ k2 v( I. i& H5 c - .text:0040113B xor edx, edx4 w' |5 e& r3 n8 N
- .text:0040113D test al, al
G! M: k& W4 ]* p - .text:0040113F setz dl3 n5 `% f$ g9 @! `5 i
- .text:00401142 mov al, dl a" Q4 k L6 M, f, P
- .text:00401144 retn 4
. ~* e" |0 d1 ^9 w' j- f( q - .text:00401147 ; ---------------------------------------------------------------------------
. c! k4 l: U$ W' ^ - .text:00401147
) a3 m# C$ v4 d4 Q. s; l" _ - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j3 u) e! {. |* y5 H) o; d
- .text:00401147 ; sub_4010F0+C↑j ...
- m$ J7 T) @0 K, h - .text:00401147 xor al, al; a! O. ]$ u0 r$ a' E) x, |4 Y, n
- .text:00401149 xor edx, edx
- h' y# w4 S. h- N" j1 x - .text:0040114B test al, al, D% F8 x% w+ G# Y
- .text:0040114D setz dl; h% k; l# K3 i' i6 R h; ~
- .text:00401150 mov al, dl8 z/ b7 I7 ^: y/ e- v! c5 |
- .text:00401152 retn 44 W8 u$ ~2 i3 E* i
- .text:00401152 sub_4010F0 endp( r, E1 G5 v9 X, ^2 I8 B
- .text:00401152
4 h# j" }: y. o - .text:00401152 ; ---------------------------------------------------------------------------: d+ }4 i# D4 P4 }9 k$ p' K2 G8 C; n4 ^! E% k
- .text:00401155 align 10h9 ?' k2 Y% t% j* ^8 j) v
- .text:00401160
% s1 o0 n: j. k6 V5 C* y4 A( { - .text:00401160 ; =============== S U B R O U T I N E =======================================
" s# q: B) V. k; @+ h - .text:00401160
0 L8 O* }. L6 D. n5 U6 d - .text:00401160' V9 k! E3 g ^9 `5 O/ e
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p& W" ]) d. J! s' f$ N& q
- .text:00401160 ; sub_4013F0+C↓p ...
* Y+ o# |8 R8 b( F+ V8 X3 M - .text:00401160
f5 K8 y' e3 p9 H) G9 B* F9 s4 s - .text:00401160 arg_0 = dword ptr 4
4 G/ ]2 ]( r! v: e. V V L" ] - .text:004011606 A2 Z h( s: ?- p
- .text:00401160 push esi3 T1 u, W$ s0 H- a$ p j$ u8 \
- .text:00401161 push edi
Q' ]1 X6 x7 Y. ~* H7 T - .text:00401162 mov edi, [esp+8+arg_0]
( P, T* P3 P5 J- M5 n - .text:00401166 test edi, edi! J* s; K) i5 \* h5 s
- .text:00401168 mov esi, ecx$ D* p1 ~1 [" r/ e: h- j& y
- .text:0040116A jz short loc_4011CA. b/ W4 d' u' j4 k/ j7 H9 E7 v
- .text:0040116C mov eax, [esi]# N" Q* c5 b+ E7 g6 ^$ `
- .text:0040116E cmp edi, eax
- O: p0 G4 W- W/ A$ B* \ - .text:00401170 jz short loc_4011CA6 _- j4 E4 [. o4 j
- .text:00401172 cmp byte ptr [edi], 0
4 M r) g" }; J: T x$ x9 a - .text:00401175 jnz short loc_4011A2, `; m; j+ H L8 n& i' p; E+ E8 V @
- .text:00401177 test eax, eax2 }: [) L5 B5 e/ b5 ]6 ]" n
- .text:00401179 mov dword ptr [esi+4], 13 i# n8 M1 n1 p6 Q/ P4 p9 m
- .text:00401180 jz short loc_40118B
- M" \. [- U6 F1 r6 | - .text:00401182 push eax ; void *
) @% X( L/ w% b+ C- j4 ~7 w& H - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
: W, ~$ |0 X3 i. d8 i2 T; F7 r - .text:00401188 add esp, 44 b( K# d5 X% N# t7 I/ K; w
- .text:0040118B
; `. G; g# B1 L - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j; ]$ H9 @. W% `. \
- .text:0040118B push 6 ; Size1 V+ O2 P# ?& `
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
% Z8 Z$ h3 l1 J3 r: M# [* b - .text:00401192 add esp, 4
/ D" p$ N) F+ B" A2 I - .text:00401195 mov [esi], eax2 f9 i) X& W/ z, c7 F
- .text:00401197 pop edi2 H2 q& s- F9 z" Y
- .text:00401198 mov dword ptr [eax], 0
6 j0 n; H8 W$ x0 E! c7 s5 Y - .text:0040119E pop esi0 B# Z: @: a4 v$ a$ k8 u
- .text:0040119F retn 45 F+ @& Z" c" d/ e2 U% ^& r5 U% I
- .text:004011A2 ; ---------------------------------------------------------------------------# L: D( H! D/ d& R9 n/ |
- .text:004011A20 S0 R1 ?5 I( X. R3 a3 ]/ h
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
- J5 [8 a+ ^3 C8 p1 o" W* E - .text:004011A2 mov eax, edi7 ]7 G0 B2 R8 |0 J% B0 }
- .text:004011A4 lea edx, [eax+1]
- q" @# o, n' j% I - .text:004011A7. o: |/ T, k, A
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j+ a/ g+ X: m3 o2 x# ?2 G
- .text:004011A7 mov cl, [eax]0 [ ]3 @% r ]' M6 k& [
- .text:004011A9 inc eax- w- k) V5 E2 v1 r
- .text:004011AA test cl, cl5 V) P- B$ i5 \3 g/ o" B2 a, a, a
- .text:004011AC jnz short loc_4011A7( X/ x4 j: M4 A2 _4 h9 E& m8 s7 Q) c
- .text:004011AE sub eax, edx P1 A& I$ Q# t& Q
- .text:004011B0 push eax
g. j- ?2 K+ O5 V7 O g/ | - .text:004011B1 mov ecx, esi) |6 L2 W& d# ` L! V7 g
- .text:004011B3 call sub_401030 C, k( s7 ?4 n) d. A: o
- .text:004011B8 mov edx, [esi]
8 q' _' f% [% T! S u - .text:004011BA mov ecx, edi2 c; u j( L4 Z6 M8 B
- .text:004011BC lea esp, [esp+0]& U- }$ e4 w# m5 [3 \$ x H: J5 F
- .text:004011C0
/ S$ E7 q! }9 a+ e: u( R. [' n" H - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
2 w5 V6 w8 P. g8 y6 l! e) r, ` - .text:004011C0 mov al, [ecx]
$ z6 A$ Y' ~$ t. R; r; t/ m - .text:004011C2 inc ecx
3 S# n5 r9 J7 |1 N2 y9 D - .text:004011C3 mov [edx], al
* u, g/ T$ u) U4 O+ b - .text:004011C5 inc edx
- @8 U4 w8 Z. e# V - .text:004011C6 test al, al
* `( E+ N- U4 J3 \) v - .text:004011C8 jnz short loc_4011C08 {5 Q9 G' m8 Q. J5 t4 N
- .text:004011CA# Q+ ` H( t( W7 T
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j! G1 w' R& ^8 p4 K+ Q
- .text:004011CA ; sub_401160+10↑j
# d* [! n5 l' d" I D - .text:004011CA pop edi
/ Y8 F! _/ ?1 z) O - .text:004011CB pop esi
/ v5 Y! I! t: L! h0 r* H - .text:004011CC retn 4
" s+ ~9 G, \8 v c( E4 A% ~ - .text:004011CC sub_401160 endp
3 Y9 A7 x8 {' H" Z/ q8 B4 ^ t - .text:004011CC) {, G0 Z/ C* }& x1 ]4 Q
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码 8 k ^7 K, ^/ ^8 U# L' M' f
' X* v; n6 [2 T8 O: Z$ `) x
0 S* I8 \5 N; m& U! @ |