本帖最后由 shane007 于 2023-8-27 13:23 编辑
4 C; C+ o4 Z- G# r6 n. z: l9 c
# h% M5 L9 ? |本游戏采用了CEGUI,该组件能采用directx和opengl。
$ L$ n0 Y" E+ e2 F& {5 A经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
7 s' V3 U& b# F- U游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。! H' m3 x2 v6 K& P7 [( w0 ?
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)& d; B$ {) A) O; b4 n
' E, c& m" h/ v3 @' X) N
5 r+ a: ^2 a, R4 K1 D, `在游戏中找一个字幕,在以下地方断下。
0 f7 a* w+ S" }1 u7 A6 H. Y/ `! ^$ j由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
^# H" ?$ _3 {; e0 ]因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
/ `/ c/ X' @ D
! w- }5 z& E# A/ i% `& t P- NextLife.exe+11C5 - 42 - inc edx
& z6 {" q: V6 ?, P - 004011C5
复制代码 9 B& y8 b- k6 E0 t* I
% |1 F/ m# k! I ]/ ]+ _
该地方的伪代码
/ x: D' B- N% O1 r. G* T; {1 p- void __thiscall sub_401160(char **this, const char *a2)
, U. M6 Z$ l: \5 ] - {2 J* J. H, m( ]/ J6 d
- char **v2; // esi: p8 q" e* {9 l' m
- char *v3; // eax
4 n9 J V8 A) c" I: Q! Y( u+ c3 n - char *v4; // eax
+ z/ `. V. y+ l a& d5 f: j - 8 t, ]' F5 b9 R
- v2 = this;& X4 `, v2 I( B, U' t% W9 `
- if ( a2 )
, t9 F2 u! j. ?& r2 O: F+ g - {
% ]1 Y7 G; E+ M6 S9 G K+ ], A2 n! E - v3 = *this;! _& f, X/ _/ M3 h a
- if ( a2 != *this )" P1 K7 n4 x" r, v4 z
- {7 t; W z4 T1 w& C) z+ n
- if ( *a2 )
( E: S/ l& J/ K6 D3 t7 l+ O M - {+ e7 p4 F S7 I$ Z+ z
- sub_401030(strlen(a2));' f M) X5 q0 Z+ G+ Z* X- L
- strcpy(*v2, a2);
- }4 {: ^, ^: [ - }9 c5 o6 y/ D, q3 ^( y( Z
- else
& R' Y. |" V/ D0 w$ `) f - {; L) ?% J5 X" u: D4 ~; w/ q
- this[1] = (char *)1;
- D5 \& N' Z, R! @5 J - if ( v3 )' z; P% |! c) }2 }* Q% g W& i" w
- operator delete[](v3);
$ v3 w: V' U2 i2 C - v4 = (char *)operator new(6u);
4 j) [ W0 I* a - *v2 = v4;
3 [' _' H% v* z l% f - *(_DWORD *)v4 = 0;
6 X- t3 l( B( Q - }
# }' f' L4 r% a* @, `( G( E - }( L8 A% {; S, N! Y( _, |( k* u
- }
3 j8 a" O$ A# F3 S) G, T9 ~ - }
复制代码
/ `* L$ u* ?) h汇编代码
~( z: v" J/ W! k3 w- .text:004010F0
6 r, J0 N6 L6 U3 v - .text:004010F0 ; =============== S U B R O U T I N E =======================================
3 [3 L+ u% ]& \, _# x6 r - .text:004010F0; i+ w8 D6 m. W0 z5 m: ~9 z( J
- .text:004010F0
/ v) s* [1 c2 w1 x; z( h ]3 e - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p; n5 w6 z: a( F5 k) D
- .text:004010F0 ; sub_403240+97E↓p ...) W3 R/ O: M# m1 e* B
- .text:004010F0
+ W f6 @7 _0 W0 r! H" i1 \4 C - .text:004010F0 arg_0 = dword ptr 4( G$ g5 Z' _0 b# C6 y# u8 W L! A8 R
- .text:004010F04 u: s1 i, L9 d/ U
- .text:004010F0 mov eax, [ecx]
7 ]$ ` N6 U0 L8 @ - .text:004010F2 test eax, eax
5 K6 I/ v% d4 l9 W2 |" P - .text:004010F4 mov edx, [esp+arg_0]
, Q I% n3 \1 E0 E - .text:004010F8 jz short loc_401147
2 w; V M" w3 X' X$ o+ D9 Y2 A - .text:004010FA test edx, edx
+ \5 }) }# g3 v: K - .text:004010FC jz short loc_401147
- J: k5 D& X& e( D2 @ - .text:004010FE mov cl, [eax]
5 ^5 V5 e- ~7 S- [' v7 |; x - .text:00401100 test cl, cl. J+ J2 m+ l- T5 J5 k1 e
- .text:00401102 jnz short loc_401116
3 n3 o4 v5 {' f - .text:00401104 cmp byte ptr [edx], 0
* N" u( q3 ^8 D - .text:00401107 setz al; \2 z5 m' k) s0 U: e. N
- .text:0040110A xor edx, edx0 r: e! }1 c* F4 y
- .text:0040110C test al, al) _* \8 S4 D0 {8 }& q* ?
- .text:0040110E setz dl0 H. t& X9 D( p, L, B! M. k3 _7 q8 K
- .text:00401111 mov al, dl
; ^7 r: X7 q" u+ N6 q - .text:00401113 retn 4% k+ e- \2 b2 R T' N5 e
- .text:00401116 ; ---------------------------------------------------------------------------
3 o0 W' [( M3 Y( o5 g3 M - .text:00401116! ~+ `4 P2 L7 h( V& f, B) N1 B
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
1 D0 W3 d( Q6 ] - .text:00401116 cmp byte ptr [edx], 09 l4 E9 t `4 J3 z$ b
- .text:00401119 jz short loc_401147
; v6 r. \+ x8 T - .text:0040111B jmp short loc_401120
2 P1 F: h6 E! Y$ C! n - .text:0040111B ; ---------------------------------------------------------------------------6 ?8 _, f- l& ?; t( y
- .text:0040111D align 10h* M: C2 o( q% K8 l# o6 W* U- f
- .text:00401120
+ Z4 W* m8 r) ?1 B- M8 W: T - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j7 \; ]" o/ N$ b1 Z/ }
- .text:00401120 ; sub_4010F0+3B↓j, q3 r4 f+ X- w0 p; ?
- .text:00401120 cmp cl, [edx]
5 D; Q( V/ M8 L, Q7 D" ~% S - .text:00401122 jnz short loc_40112D
$ k; q q& M k, A* ?, J8 L - .text:00401124 mov cl, [eax+1]% _! [( g: O x/ b
- .text:00401127 inc eax/ L/ B) F+ m+ l8 h
- .text:00401128 inc edx
6 d& o L. L' Y- E O$ k - .text:00401129 test cl, cl& W: k' X4 l" j3 ]4 ~6 }
- .text:0040112B jnz short loc_401120
& n7 m" |9 W; B s5 A* { - .text:0040112D
- r$ V! Y! v9 [5 ^' `9 E; a - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
# L8 o5 | p7 h2 H - .text:0040112D movzx eax, byte ptr [eax]& w7 W8 Y( ^5 f# }
- .text:00401130 movzx ecx, byte ptr [edx]
$ V+ W+ S- o& V - .text:00401133 sub eax, ecx
4 i; o) X( G" d - .text:00401135 neg eax5 V0 W8 ]0 `. K" O9 Y+ p6 e z1 O% B
- .text:00401137 sbb al, al
9 h, A$ o0 m: s* o2 K - .text:00401139 inc al
3 F+ J! Z% o$ @$ Z4 }+ ? - .text:0040113B xor edx, edx
4 u. F& N, e! u( {, ? - .text:0040113D test al, al
2 q, K- {- {) }2 _) b - .text:0040113F setz dl+ ~ Y! f6 Q, S
- .text:00401142 mov al, dl% c8 e: y+ Q+ R8 Q1 y
- .text:00401144 retn 4
6 r# c6 h' J6 C* c - .text:00401147 ; --------------------------------------------------------------------------- y9 X- l6 l0 @$ R
- .text:00401147$ g% B9 I# K+ F8 C f0 l+ Z5 x% z
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
& e/ @4 M3 J- ? g8 P. M4 v - .text:00401147 ; sub_4010F0+C↑j ...
- j) p b0 o6 V# c% J - .text:00401147 xor al, al
. G" l+ b$ I" g( a$ ] - .text:00401149 xor edx, edx
9 y$ h+ z: _, b" h8 g) t0 P- w1 S2 i - .text:0040114B test al, al3 G' [( S& f; z3 M) b
- .text:0040114D setz dl! J% R! _" k# l4 L' p
- .text:00401150 mov al, dl
7 p$ L- `! y- D+ f7 ]3 Z5 G1 G - .text:00401152 retn 4/ w( l0 R0 |* x
- .text:00401152 sub_4010F0 endp! Y2 x0 b7 _) K: y
- .text:004011523 B9 o; r6 K; [
- .text:00401152 ; ---------------------------------------------------------------------------5 v% p* V# J r$ B
- .text:00401155 align 10h
( [0 a1 A9 W- ?* G/ e$ P - .text:00401160
# O2 r2 t+ \) v3 u# E0 z9 x1 i - .text:00401160 ; =============== S U B R O U T I N E =======================================0 }" L$ _3 b3 Z3 ^2 J3 q; ]
- .text:00401160; V& P! ?: r. ]1 e6 `
- .text:00401160
, I+ W# l* y, R3 L* \+ Y - .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
1 T0 P* u6 V) C0 u - .text:00401160 ; sub_4013F0+C↓p ...4 G( S% D4 N" g$ \* o' u9 P
- .text:00401160' {9 [* \' ]* `( U1 ^8 Y
- .text:00401160 arg_0 = dword ptr 4, A+ x* r8 U6 f0 l+ C: y
- .text:00401160
" |) U- R5 Z1 ~7 E( ?- e) ^ - .text:00401160 push esi
2 g) A. I8 g2 _3 v1 `* p - .text:00401161 push edi8 I" j. J; J+ F6 V; x) Q8 N9 R
- .text:00401162 mov edi, [esp+8+arg_0] q* m6 I6 h$ E( a H- D
- .text:00401166 test edi, edi, @! }1 k( e" n3 L, [
- .text:00401168 mov esi, ecx
; E' T' q, |, j; O) E) } - .text:0040116A jz short loc_4011CA
' U0 g& ~% v) Z' z. a - .text:0040116C mov eax, [esi]
" U! R2 e$ b' v( k - .text:0040116E cmp edi, eax6 b6 k s! P) A/ R2 Q4 g3 ~4 s
- .text:00401170 jz short loc_4011CA
5 l E5 ^$ F* w - .text:00401172 cmp byte ptr [edi], 0$ A! t* [4 s, D( k/ `
- .text:00401175 jnz short loc_4011A2
$ W; [6 D L5 s7 t - .text:00401177 test eax, eax
* v g$ r. u( @8 `* j8 e/ C - .text:00401179 mov dword ptr [esi+4], 1, _% o& Q- {0 ]' d' e4 e+ \8 a9 ^# E
- .text:00401180 jz short loc_40118B0 M1 B( X5 S* S% Z z) n
- .text:00401182 push eax ; void *0 v% N" c# d* P2 \ C3 A2 i8 m
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)9 S4 p: @6 a0 _) h7 c; ^: _( u/ K
- .text:00401188 add esp, 4$ x9 S( H; U5 q" m+ `6 H# T
- .text:0040118B" M! T. L, g5 W# w" W. m
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j- m# E4 |+ T. w8 M
- .text:0040118B push 6 ; Size
' ]; j: a4 v* E7 I; _/ ] - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
! c+ Z) F6 `' |5 I - .text:00401192 add esp, 4# h/ f0 F2 Q% ?9 c
- .text:00401195 mov [esi], eax" @/ l- s' e5 U9 t' K& D# t, U
- .text:00401197 pop edi. m. a& {: \( k* M
- .text:00401198 mov dword ptr [eax], 0
. i0 c- t% A( H! d6 K% j4 q' |0 w - .text:0040119E pop esi5 i/ ?# ^. c# R6 f
- .text:0040119F retn 4
& `- @0 e3 i* W/ K6 `" t" T+ p - .text:004011A2 ; ---------------------------------------------------------------------------5 K4 b/ `2 W9 h9 l+ R( d# ?7 J. p
- .text:004011A28 U# O: _( B0 w D3 y1 J
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
+ ~+ S4 r9 d& A* t4 D9 X. z' c# F - .text:004011A2 mov eax, edi
& c( ~3 G8 T% f; h5 J2 O - .text:004011A4 lea edx, [eax+1]
+ \3 o5 l1 m0 g! @ - .text:004011A7
- v+ Y0 m0 @7 F8 Y; f - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j5 e( O' K" [9 u1 V
- .text:004011A7 mov cl, [eax]
; A+ s& f3 D6 b% k [2 s$ V - .text:004011A9 inc eax5 T0 A2 N2 [* r* x2 x. ], X, ]: G
- .text:004011AA test cl, cl" o3 I& i" A8 c; U: W
- .text:004011AC jnz short loc_4011A7
/ w4 r! w/ Z% ` - .text:004011AE sub eax, edx, m5 i: [) k+ k( f/ P5 u+ A
- .text:004011B0 push eax
7 K% n3 w4 ^. d$ ^0 x3 W& U" N9 S) u - .text:004011B1 mov ecx, esi
! U. E& d7 `( q2 t* F+ q - .text:004011B3 call sub_401030
$ l9 N& R: I3 A0 m/ h - .text:004011B8 mov edx, [esi]
* H# z8 @( S5 E: |+ U, u# A% e" K - .text:004011BA mov ecx, edi
* d$ U. M8 R2 k3 L/ ^: ? - .text:004011BC lea esp, [esp+0]/ d! d! d$ M5 x' r5 Q. d
- .text:004011C0* G2 i# s: }' n
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
* u$ b% P' e ?: p1 r( L - .text:004011C0 mov al, [ecx]
7 X h* g/ w% K7 M' p" j8 u - .text:004011C2 inc ecx0 E' L& n4 T+ ?/ M4 o2 p
- .text:004011C3 mov [edx], al
, |8 V* X# @3 k" j' | - .text:004011C5 inc edx
8 J2 Z% F" Z) O0 D% L; X6 J5 H4 g - .text:004011C6 test al, al1 C) B0 s, S, \
- .text:004011C8 jnz short loc_4011C0( Z! Z) _% n, n- V0 S
- .text:004011CA' h9 d5 G$ A( C6 W
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j& g8 w9 i/ a0 w. t1 S7 A/ G
- .text:004011CA ; sub_401160+10↑j* S6 x1 t n1 V! I' x3 K
- .text:004011CA pop edi
- @2 t% U2 M3 h6 ^ - .text:004011CB pop esi
4 i' u2 x7 ^6 H0 E - .text:004011CC retn 4* [, a. G/ \# e, B7 G+ U1 m
- .text:004011CC sub_401160 endp/ l [8 C7 _/ w: a( x
- .text:004011CC; E7 e1 q1 X! V1 ^
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
4 z$ i) V/ m# j. i f. W8 u/ y4 z' Y3 d" J7 y
) Z' h1 I0 h ?9 r. Q+ j
|