本帖最后由 shane007 于 2023-8-27 13:23 编辑
2 W0 T/ r6 h8 c( R. F
) q1 R" d6 v p: H本游戏采用了CEGUI,该组件能采用directx和opengl。
; n' g U, k0 u! i+ J% I5 @经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
+ P9 Q q) D8 Z J Z8 }4 \( i" C0 B游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
. H7 E0 d. Z% ]# J1 |! R* X(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。) \& b% t7 R* U. y# ], C
; D7 i/ ]+ d1 d. m3 k C
* L- V7 k3 M* q6 K _在游戏中找一个字幕,在以下地方断下。
& a; o3 i( g- n/ P, D由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
* @* ?3 m5 Y/ z$ o# ]因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
+ M! w6 s! J* |; Y9 T# t: D' w5 X$ n0 p# R% [
- NextLife.exe+11C5 - 42 - inc edx
5 ?: p# B1 e, F' h' [ - 004011C5
复制代码
0 [ {- T: m" E0 D" u$ @
7 C' f3 C; C" t. ]' \该地方的伪代码
6 P; z, d. q6 ?- void __thiscall sub_401160(char **this, const char *a2)6 B% x" c% T/ m8 E0 [" q
- {
, Y* N) `3 ~; F9 N - char **v2; // esi
2 F7 c- d: h) E4 S - char *v3; // eax
6 V' ^0 V) ?' q - char *v4; // eax
. ~7 k* ~1 W' {& e7 P" C - ; R4 B# j1 ~# ?' \2 o
- v2 = this;, `3 b d |; o6 P) E
- if ( a2 )8 u- l) c) ~* g' G- l7 {6 C
- {
+ d% J. R- l0 g- |7 j0 c - v3 = *this;
! C* S, Q5 `; g5 M/ x) |, C - if ( a2 != *this )( p6 f% ^0 d( H0 b
- {
7 |9 v8 M# R+ E7 m% }& | - if ( *a2 )
/ _3 m) _. K6 l" b* K - {
1 j3 t5 I p g - sub_401030(strlen(a2));/ ?5 G& G: e( C
- strcpy(*v2, a2);
% {. s7 D) q* w) V/ w3 H( Z - }9 ~' L, ]" B M1 B* h" V% ?( T
- else
/ w& m4 e0 B' e1 Q( d* q, i/ F - {8 e$ M! y0 n9 `" Z5 {& r) A
- this[1] = (char *)1;
/ o- G6 ]- W6 l, Z7 u3 D o3 S2 { - if ( v3 )5 d5 j0 }! w: T# o' R
- operator delete[](v3);
0 ^2 N& v+ q3 I! E - v4 = (char *)operator new(6u);) k8 s3 ]: W9 D7 t
- *v2 = v4;. m3 Z2 Q# c$ w9 Z# _ A5 ^: Y. @7 b
- *(_DWORD *)v4 = 0;
$ p1 f {) Q, {. M* l - } L4 Y4 [+ Y& b- T2 ~" ^# E
- }- z, m" d5 ?0 z9 C2 a
- }
4 m L$ f" p1 a - }
复制代码
' e( Z* ^8 g" Z, T- x汇编代码5 C6 T: Y6 _ u
- .text:004010F0
7 Y0 D3 G+ M- J; u - .text:004010F0 ; =============== S U B R O U T I N E =======================================
& o# U$ d7 k1 N# h$ K8 h6 [ - .text:004010F0
* v" e! J! x. V$ G# [ - .text:004010F0
8 g+ ^' J5 M2 |1 ] - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p# C. Y# b1 p" K4 K( T! }
- .text:004010F0 ; sub_403240+97E↓p ...
) U5 K0 c' V" C5 S - .text:004010F02 L9 k, u) w% r* {
- .text:004010F0 arg_0 = dword ptr 4
' x3 @- ^& x( l# O/ A) F: p - .text:004010F0
2 O; ?; a/ d `% g$ g - .text:004010F0 mov eax, [ecx]
. [; f1 q9 A- }' [% |7 L1 N, J - .text:004010F2 test eax, eax
6 r7 D3 u9 |& ? m3 x) ] - .text:004010F4 mov edx, [esp+arg_0]
; s$ j" d3 h* O! O - .text:004010F8 jz short loc_4011470 ^* m1 |4 z/ ~6 ^4 G. L
- .text:004010FA test edx, edx
9 m, G: ?( c/ M; F4 S - .text:004010FC jz short loc_401147/ P; G% ^( m1 y- Z
- .text:004010FE mov cl, [eax]
% R/ F2 Q' S7 ~ - .text:00401100 test cl, cl* j, q/ Z; a1 B! ]$ M
- .text:00401102 jnz short loc_4011161 n. \+ f- M4 W4 C- H
- .text:00401104 cmp byte ptr [edx], 05 Y' J% {# I) }; H: @9 [) V3 G8 [
- .text:00401107 setz al
/ ~! `! e& b& N+ D7 c# M - .text:0040110A xor edx, edx
3 r8 Q6 I5 w; V1 Z+ \/ [' | - .text:0040110C test al, al- e$ R& N1 ]* y/ e
- .text:0040110E setz dl
3 {- l% n% y+ P/ [ - .text:00401111 mov al, dl( @6 h! Y% ^- B3 k8 c) \0 c
- .text:00401113 retn 4
* b( J" |! `; F3 r/ j2 L8 w4 [ - .text:00401116 ; ---------------------------------------------------------------------------$ }# i; W1 L6 J2 Z T( y0 m
- .text:00401116
0 N) C! @) T4 d3 \! p. L - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
* l1 ~3 T8 ]8 D) M+ n8 ? - .text:00401116 cmp byte ptr [edx], 0' {8 P7 f U0 w
- .text:00401119 jz short loc_401147
6 J, Z/ d( y4 |5 p, g - .text:0040111B jmp short loc_401120& ?3 O7 l s+ l- E& I% F
- .text:0040111B ; ---------------------------------------------------------------------------
8 A6 k' v, C; @6 W - .text:0040111D align 10h
* L; A# Z: K8 w& ~% q* X - .text:00401120
- p+ T3 @6 b# X+ P0 U+ P - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
$ ~4 {8 C) n& p - .text:00401120 ; sub_4010F0+3B↓j+ y' q o0 v6 w9 e0 J. k. z
- .text:00401120 cmp cl, [edx]
1 ^- G2 c+ J+ u7 @. Q) q5 d - .text:00401122 jnz short loc_40112D
' W, y1 I! T5 F - .text:00401124 mov cl, [eax+1]2 Y' U. n* o" q+ k
- .text:00401127 inc eax
! f! Z* Z' J* |# e7 p- o3 w/ ] - .text:00401128 inc edx7 v" }0 Z, Q* z4 q2 s# _
- .text:00401129 test cl, cl6 d! z9 J) C! T4 C2 c5 {
- .text:0040112B jnz short loc_401120& I0 x, f1 e& S0 v- X* L
- .text:0040112D
5 @: G9 V- W- M: F - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j3 S5 u# o" Y/ `0 }( _9 @# `5 }
- .text:0040112D movzx eax, byte ptr [eax]9 H6 T1 S- t$ y, `" | H( t! \/ H( ?' V
- .text:00401130 movzx ecx, byte ptr [edx]
+ T) y: _" i% D4 z, c) H3 I! S) h, u* y - .text:00401133 sub eax, ecx
' v: r8 Y; _6 ~* C: J& A - .text:00401135 neg eax
7 g' E5 ]& H o - .text:00401137 sbb al, al9 x8 h/ ?' y f- K
- .text:00401139 inc al
! T) _! ~+ v2 N: R4 l - .text:0040113B xor edx, edx
$ q. }6 b }* e5 r2 ~ - .text:0040113D test al, al
5 n1 S( r, p4 r6 i( z - .text:0040113F setz dl$ ]: @! ~$ a! i$ B6 G. v/ {; _/ Q
- .text:00401142 mov al, dl
/ s/ b( ^, h) m! y+ |) D0 N2 F3 | - .text:00401144 retn 4$ E1 Y2 B) O6 h9 W6 r
- .text:00401147 ; ---------------------------------------------------------------------------! s* ?. T- ]* ?
- .text:00401147
- c' C2 _8 w7 O - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j E3 ?, X: O1 Z6 U9 I* f
- .text:00401147 ; sub_4010F0+C↑j ...
5 H5 N% m( S- u. y* p9 h - .text:00401147 xor al, al
" e; Y8 @# D6 r# d$ u, C4 Z4 M) D( G - .text:00401149 xor edx, edx6 ?; d' y6 d" Z% `' M
- .text:0040114B test al, al
1 D" y9 z1 ~/ O9 E# U, l | - .text:0040114D setz dl. X3 F6 m5 x& r: x3 \+ s
- .text:00401150 mov al, dl6 c9 L! [3 @. W6 _2 E# A& D! r
- .text:00401152 retn 4
& C( W0 s2 I5 k7 t) U- k$ a7 W% _ - .text:00401152 sub_4010F0 endp
# l+ R. v5 ^! F3 P: m- y - .text:00401152
5 M3 h/ a4 |# h6 ^& H7 q4 f) s - .text:00401152 ; ---------------------------------------------------------------------------
3 g2 _% e, \9 E - .text:00401155 align 10h
: s3 {8 w7 E- @0 G( C2 G- a/ E4 k - .text:004011608 g. K+ @( s( r$ w0 B `8 X
- .text:00401160 ; =============== S U B R O U T I N E =======================================
& c$ c8 u- i" ]9 G0 ~ - .text:00401160) H: j2 c2 [( X# ~+ S; }2 d
- .text:00401160
- w" p8 `/ Z- G0 n' I - .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
* }" q. w2 S; G( q - .text:00401160 ; sub_4013F0+C↓p ...
) r4 U2 d* D, D* ?& K$ A - .text:00401160
6 d6 B8 O8 r4 `* Y1 {$ I( S# _ - .text:00401160 arg_0 = dword ptr 4
h: s; A( X9 D# {. o- m - .text:00401160) s1 V" [0 B9 G( y
- .text:00401160 push esi8 d( R& ?9 |, s% O) R
- .text:00401161 push edi
# t r t& E3 |1 _0 P$ R% X - .text:00401162 mov edi, [esp+8+arg_0]
5 l0 a: i! }$ Y: | - .text:00401166 test edi, edi$ F. `8 ~2 n6 f. B! j
- .text:00401168 mov esi, ecx
6 w3 l# t9 v/ W ]3 O9 t - .text:0040116A jz short loc_4011CA
# D0 l0 X/ S' J3 b - .text:0040116C mov eax, [esi]
) V6 O0 T" M0 E/ `7 M8 W3 k% R- D; i - .text:0040116E cmp edi, eax
2 c: i* X2 E1 i$ @; x: \ - .text:00401170 jz short loc_4011CA: \, `0 p2 o4 [7 u5 E5 M1 Q8 `* g
- .text:00401172 cmp byte ptr [edi], 0! I: v5 u0 T9 t4 _
- .text:00401175 jnz short loc_4011A22 y' o) d; A6 B, o1 z
- .text:00401177 test eax, eax. a. \2 n3 k! L
- .text:00401179 mov dword ptr [esi+4], 10 J1 c. {" g, T$ g7 V/ p$ _- x9 m
- .text:00401180 jz short loc_40118B
+ p; q- F- t3 n4 G7 a" [ - .text:00401182 push eax ; void *
' B. Y( L+ F+ [% k - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)$ F& d- d1 D# e' c. a# M6 P" U- u
- .text:00401188 add esp, 4' h) S1 E5 \ h: q$ U$ ^4 P
- .text:0040118B, p. l+ M1 |4 S8 Y. q
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
5 |+ K' W+ }) _% b - .text:0040118B push 6 ; Size
9 o, w0 R; R7 j" s. `( O5 w - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)- L1 q# o0 g& a
- .text:00401192 add esp, 4/ f, b) ?. L1 Y0 I' q7 W6 t
- .text:00401195 mov [esi], eax0 ?7 \ c l6 o( \6 }4 ]9 w7 E
- .text:00401197 pop edi' |2 F* y( G* ?! Z" f- j; O
- .text:00401198 mov dword ptr [eax], 0+ {# n# @+ K5 y% |
- .text:0040119E pop esi
' ]/ d# d9 H# v0 \! K - .text:0040119F retn 4
/ `& I( ^, s( L# q: K! e L2 R" l% X+ H - .text:004011A2 ; ---------------------------------------------------------------------------" D+ Z4 B: S9 w4 b7 S. P- h# i8 l8 p
- .text:004011A2' P4 a9 e3 }8 h g
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
t! v; ~! a" M8 ?+ a - .text:004011A2 mov eax, edi
. B5 o5 o7 O# t% w - .text:004011A4 lea edx, [eax+1]
! v7 ^0 y5 {4 d* f" J7 B - .text:004011A79 G7 M- R" u0 E7 l, ?
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j7 i& E/ M+ r& p
- .text:004011A7 mov cl, [eax]
7 \3 b* \( q' C% \$ @ - .text:004011A9 inc eax, w# b) q. t- _$ b, u* N( w
- .text:004011AA test cl, cl4 c" h+ E0 Z8 u1 A3 h9 Y$ C
- .text:004011AC jnz short loc_4011A7, I6 v) R$ S& Q& H* S4 C: o
- .text:004011AE sub eax, edx6 R( T+ u, a' T& `
- .text:004011B0 push eax
0 {) b0 G; }3 ]# ^ - .text:004011B1 mov ecx, esi
0 k5 B' z5 t* h* x9 l' Y - .text:004011B3 call sub_4010305 S2 E7 ^ P) S
- .text:004011B8 mov edx, [esi]0 T( P9 P2 k9 U* h
- .text:004011BA mov ecx, edi' [2 O6 D/ w7 f) Z% S5 P
- .text:004011BC lea esp, [esp+0]7 {2 l; k8 @. \9 ] g" r8 V
- .text:004011C0) V8 O0 L$ a' X; G2 @; p3 A
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
+ e1 w2 q! P) `' W: K* q - .text:004011C0 mov al, [ecx]0 f" v1 S5 G/ K2 t2 g
- .text:004011C2 inc ecx
* a/ q& R# l; e) j S' N: N - .text:004011C3 mov [edx], al
0 E5 U5 `; _* d" Q1 | - .text:004011C5 inc edx+ F3 p5 ?2 C- y% E
- .text:004011C6 test al, al! Y" v- J c8 [
- .text:004011C8 jnz short loc_4011C0 u1 T6 j, k2 ^2 M/ a+ ]7 `! }. }
- .text:004011CA
5 K* w( s; o" z9 R( s0 `5 [9 g1 n - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j$ O& m; x# X" c2 T z
- .text:004011CA ; sub_401160+10↑j
& I: P3 X. E# r+ C1 ~6 u - .text:004011CA pop edi: R/ a# q( f& y7 S9 j" b4 A' g3 O
- .text:004011CB pop esi) n- b2 I9 R- z, u6 ]5 z# s$ c) y
- .text:004011CC retn 4
, ^, e. N9 {* [0 f/ I - .text:004011CC sub_401160 endp
5 A* d( G3 F. K9 } - .text:004011CC0 r! ]0 ^* C a; Y4 Y% G+ T
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
- C2 `6 u; p" d! B# b* Z
: U6 j9 W% h+ f$ Q; U
" Z6 L3 t0 P) R1 b; I |