本帖最后由 shane007 于 2023-8-27 13:23 编辑
5 g) E2 U) a0 W/ w2 K/ `) W/ H' t. R6 U& Y& U6 u4 F
本游戏采用了CEGUI,该组件能采用directx和opengl。
1 G% D' W2 Z: ~) d; z* x2 S经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
( G" o7 @8 E' s. {游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
; M# V$ C1 |$ Z! K' K- ](由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
) W' \! f# m2 d
% Q4 s3 {% @1 s3 J# j* X$ Q3 L) y
9 w! q4 ?, B7 G' m在游戏中找一个字幕,在以下地方断下。1 B8 ?' ^* f& w
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
, M: k. B1 X' W9 e3 P( v* _因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。3 a' Y- X8 R2 k- m3 `
, |, P5 x& s9 C* o0 V* b
- NextLife.exe+11C5 - 42 - inc edx
2 k T5 `2 i8 {/ [/ l4 j' N: n; O8 W - 004011C5
复制代码
+ B8 e1 W2 I0 |$ J* g
# [" G# L6 \! K1 n6 N* `该地方的伪代码6 }) w' H! p4 j' h
- void __thiscall sub_401160(char **this, const char *a2)
! d0 R% o; A$ d l% a - {
4 O$ l" |$ {* t* G - char **v2; // esi7 r3 y) D4 W7 ^' @/ f( U. D
- char *v3; // eax/ Y) R7 B! o7 }/ y
- char *v4; // eax8 X) n2 ]. q, b% g9 E
- % o+ U- _+ f0 n* W$ N% W1 G7 a# H
- v2 = this;
2 O& G; B4 O7 m! @' q# d - if ( a2 )
5 x0 A2 E/ k/ V. k- v u - {
/ {$ @; _6 T9 U$ t - v3 = *this;
7 v0 U6 f+ j) v7 \0 Q - if ( a2 != *this )+ m, K3 }- F2 u8 ?* `8 a0 l
- {! R5 r- q s3 k( n* t" Z
- if ( *a2 )3 C4 s9 Y6 b; {$ A/ s
- {
+ _* m9 `+ E1 W& O - sub_401030(strlen(a2));
0 e& K3 N4 E9 C/ W) y3 q" o - strcpy(*v2, a2);! K E4 i, s4 e# Z: ~
- }
0 {4 U7 S: `8 Y2 [( y0 h7 l1 ?( Y - else) x! X P j9 C. F" M R) x
- {
1 [: u6 _' ?! J n2 Y; M' s - this[1] = (char *)1;
& T6 x: c: @# Y - if ( v3 )
L8 u% z# H" J' z# c% Y; r - operator delete[](v3);8 L$ L5 o7 y6 T4 V1 W7 R
- v4 = (char *)operator new(6u);
, s5 b' X8 J; \; h( Z) K" r - *v2 = v4;
9 @7 l, _0 o* A# P9 Z' Z' T - *(_DWORD *)v4 = 0;7 O% i' E- ?* W: a3 L
- }. ` I' r! F- ]% Y# F w
- }/ U- L" Y$ g* z4 ]
- }6 e# p6 n/ K3 L( G. T& k
- }
复制代码 " `: e" b. E7 |. ?/ @
汇编代码
/ i: n" y/ ]2 m G/ a- .text:004010F0
- n w8 V2 y/ S8 m& e4 M* I - .text:004010F0 ; =============== S U B R O U T I N E =======================================
, Z1 K6 ^& W* r3 z+ r1 Y - .text:004010F0- @& @4 G5 k: W2 r" v% c2 w
- .text:004010F0
* M& t8 s2 G# t& b4 q1 a - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p1 ?9 I& b/ d% a( B1 ^5 T
- .text:004010F0 ; sub_403240+97E↓p ...
: w4 _! R& f0 a- C - .text:004010F0
2 U' [8 ^( Y) ~7 D$ E - .text:004010F0 arg_0 = dword ptr 45 u5 H+ L4 x& f b8 r: ~
- .text:004010F0
) B6 f5 T6 |8 O. h0 [ - .text:004010F0 mov eax, [ecx]
R' a8 m4 }7 w* L5 b7 o; e3 D - .text:004010F2 test eax, eax3 J/ c O1 v9 V X4 i Z& X
- .text:004010F4 mov edx, [esp+arg_0]6 {. E( O! C& ]8 s$ Z' n
- .text:004010F8 jz short loc_401147
$ J/ E) B$ m" p7 f M: Z( u2 X' O - .text:004010FA test edx, edx
% J: e J' A" |! j. N H7 V$ ]4 V - .text:004010FC jz short loc_401147, X+ _/ _! x4 X1 C$ m, E" M* e
- .text:004010FE mov cl, [eax]
- M$ x7 a6 S, f( O. B6 b* M - .text:00401100 test cl, cl
7 K# j3 c1 {) g - .text:00401102 jnz short loc_4011162 d/ p8 O: I9 M) P3 o% e6 f
- .text:00401104 cmp byte ptr [edx], 0
* w F; r! C. g+ ?; f+ o* f - .text:00401107 setz al0 o2 J+ R* s6 F2 u, c5 b7 h( ~
- .text:0040110A xor edx, edx; d! V) d- P: ^ ?6 @
- .text:0040110C test al, al
( a, u5 a1 @( C6 z ^: A- `1 k" v - .text:0040110E setz dl, f' s4 E# \$ H$ t" C
- .text:00401111 mov al, dl6 q4 v; W6 X. u6 ~0 [! k
- .text:00401113 retn 4
8 X: ]0 j( f- r - .text:00401116 ; ---------------------------------------------------------------------------: f" `$ @* r8 x4 f, u/ Y( D0 D, Y
- .text:00401116
2 B W* [3 h! c! x# b' ~6 d2 v - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j q1 I2 z: C, i9 \9 |/ V+ o9 @ ^" a
- .text:00401116 cmp byte ptr [edx], 0+ c0 B+ |( {4 B+ G
- .text:00401119 jz short loc_4011472 P& `' z' a% M d$ J
- .text:0040111B jmp short loc_401120
" X: Q; T0 x* W( ]: b - .text:0040111B ; ---------------------------------------------------------------------------9 M! k* y( f* ]9 D: X" g
- .text:0040111D align 10h# k, ^; @* T$ P9 G4 _& J8 Y; Z
- .text:004011200 F/ Q0 a3 W( N8 G* a0 C8 \
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j3 ? B# n# L$ ?7 s- ]
- .text:00401120 ; sub_4010F0+3B↓j
. m1 L. e" y; m2 j - .text:00401120 cmp cl, [edx]) Q" E. L# H5 e/ R: ~
- .text:00401122 jnz short loc_40112D
. r& x/ A9 l* O& A! a; H: | - .text:00401124 mov cl, [eax+1]
: _1 X. J3 t1 } v/ o - .text:00401127 inc eax) V/ p% ]3 R8 t, \" g J' E0 X
- .text:00401128 inc edx- E9 {) a& u0 w' w
- .text:00401129 test cl, cl
+ N& B* }. `) d - .text:0040112B jnz short loc_401120
) Y: d8 w$ I A - .text:0040112D9 Y5 u2 e5 | i# P
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
- [7 y6 U& @- r, j5 h/ @1 Q3 K1 c - .text:0040112D movzx eax, byte ptr [eax]: b7 y2 W$ X1 i5 b: A! H
- .text:00401130 movzx ecx, byte ptr [edx]
k ~" I2 ]: F) u; d - .text:00401133 sub eax, ecx6 P1 t4 V1 P1 L$ f7 o2 k
- .text:00401135 neg eax8 V8 V7 E0 G& i, f
- .text:00401137 sbb al, al
7 ~7 l" @# d8 Z; h - .text:00401139 inc al( l }' d: V3 t8 n2 z
- .text:0040113B xor edx, edx/ `; v9 H% V" S# Q
- .text:0040113D test al, al
: Z. d. V& ^+ B7 Q$ b t. Y7 j - .text:0040113F setz dl4 H( K+ V8 f' F) z$ y
- .text:00401142 mov al, dl8 _+ c6 f. I) R( S3 U
- .text:00401144 retn 4
5 T5 @: `& ?9 n# ^( U5 p - .text:00401147 ; ---------------------------------------------------------------------------
9 p5 I2 {% T9 A' l - .text:004011475 l3 \3 O1 n% P8 J, S, k
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j3 I( \; S8 Q* T$ ^3 U
- .text:00401147 ; sub_4010F0+C↑j ...
) t- X8 k; z# N8 R/ o3 @- {6 B/ ]7 P - .text:00401147 xor al, al
6 S) K+ n$ ?" ~+ e; N - .text:00401149 xor edx, edx
+ P6 L5 L8 a9 B# q( v6 y) l5 P/ U - .text:0040114B test al, al
% S4 T1 p! j' a, z; p$ ^* E y9 G - .text:0040114D setz dl
( m# E- C, W' t; U% g. c0 { - .text:00401150 mov al, dl( `; X2 h0 s1 Z9 S- v' k& ~
- .text:00401152 retn 44 ]2 l* y% S6 b0 S4 h ?9 q) {. K! E
- .text:00401152 sub_4010F0 endp
2 N' k# e i, S - .text:004011529 p; a( G- S$ n7 o
- .text:00401152 ; ---------------------------------------------------------------------------
4 k4 W4 m2 L) ]$ M, L0 U - .text:00401155 align 10h
# F: u9 a# A5 ] - .text:00401160
7 J% F$ K8 O" T& p+ | - .text:00401160 ; =============== S U B R O U T I N E =======================================
! q; [$ ~6 w* Y# W9 @5 A* C, M - .text:00401160" Y! v) C9 T4 \
- .text:004011604 B$ L' q9 W4 Z: m" r$ n
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
) s( p% r& E' N8 k! {: j - .text:00401160 ; sub_4013F0+C↓p ...
) w6 p) R3 f+ K, _' H+ i - .text:00401160+ L# G, c* j9 _
- .text:00401160 arg_0 = dword ptr 4# J1 _# b7 u/ w0 C: Y
- .text:00401160* W" R6 O0 U) B" N1 ~. g, W; {
- .text:00401160 push esi0 E6 P! Z2 m' e
- .text:00401161 push edi) l+ ]+ }* ?4 s/ X( y
- .text:00401162 mov edi, [esp+8+arg_0]" o( y* s1 V* a
- .text:00401166 test edi, edi
7 E A1 k* j1 t7 f# B9 u6 O! a - .text:00401168 mov esi, ecx6 D2 S8 R8 m/ k0 r% L- O
- .text:0040116A jz short loc_4011CA5 y( a! h9 d$ F; G( A6 G
- .text:0040116C mov eax, [esi]* S, e/ R0 ~! k' f9 v! t
- .text:0040116E cmp edi, eax
! G! i: V c# e P) D' P9 p - .text:00401170 jz short loc_4011CA
* B' j& Q. z$ y% a+ k1 ]2 |+ x - .text:00401172 cmp byte ptr [edi], 0- ?" T: L0 n7 w
- .text:00401175 jnz short loc_4011A28 W" J3 t0 r$ w! _3 N
- .text:00401177 test eax, eax
' A3 d- U0 \: q - .text:00401179 mov dword ptr [esi+4], 1
9 _ `" C* q1 O# B+ P5 N - .text:00401180 jz short loc_40118B
( Y' v. \, V& \, I - .text:00401182 push eax ; void *" m' q3 \! c+ H8 j1 ` d; i
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
" U8 x2 X% G) `( h* g0 \/ W4 e - .text:00401188 add esp, 4
+ S: F! u& R; c, Y l$ z - .text:0040118B
; N/ f. @2 m6 i - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
7 }) g/ P' X4 E' L& C5 M8 u/ A - .text:0040118B push 6 ; Size
V$ p: ]! G) q7 }5 {$ y: e8 p/ v - .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint) q; R; Y$ V" R; V; m
- .text:00401192 add esp, 41 n7 f; p4 R5 I* p! ~% F1 P |$ Q2 R
- .text:00401195 mov [esi], eax
0 l( Z; S6 U& O+ E* _# I - .text:00401197 pop edi
. o& I, S" P+ y) O% |6 B/ E7 N, G. z - .text:00401198 mov dword ptr [eax], 0
* A) j8 w7 D1 H+ q/ ]" f - .text:0040119E pop esi1 f/ a3 c3 L* M& |5 V
- .text:0040119F retn 4+ f8 ]- C& Y; C
- .text:004011A2 ; ---------------------------------------------------------------------------2 H- W: L' L; s$ K* L& M
- .text:004011A28 ^& _8 p) e' s4 P9 Y$ c! q: V
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j- p- K8 b* v1 t
- .text:004011A2 mov eax, edi2 u1 [0 t: X! x# d0 O
- .text:004011A4 lea edx, [eax+1]1 d2 U! {/ j( V' [3 l
- .text:004011A7. a+ Y, n$ I3 E% r5 |, J. D
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
/ g9 G: y, v2 h K) n+ X - .text:004011A7 mov cl, [eax]+ e) u8 x8 j. L# y
- .text:004011A9 inc eax
- i; h; V. d3 n3 c) \$ E5 p - .text:004011AA test cl, cl
$ t( n; O( ^; V- c% v( Y+ i. l - .text:004011AC jnz short loc_4011A7; w3 t: {4 H( b' Y+ ~
- .text:004011AE sub eax, edx
3 b: o( j E7 }6 H1 u - .text:004011B0 push eax8 B0 }3 S! R2 M% p7 ^( s4 i6 {# I' g5 Z: m
- .text:004011B1 mov ecx, esi
: L& l; w! A( ~( A& r3 z - .text:004011B3 call sub_401030
9 Q" m( D F. t* }7 x - .text:004011B8 mov edx, [esi]
' E4 D/ e& N' z - .text:004011BA mov ecx, edi
. z8 H8 f; I3 P - .text:004011BC lea esp, [esp+0]
7 C- N1 ^$ x2 [ - .text:004011C0
; A9 d% i3 E7 U# W - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j- L, b* _5 m5 c H+ z
- .text:004011C0 mov al, [ecx]
7 u6 m" d' S. r( J# a - .text:004011C2 inc ecx
& F& a5 |# z: A- q; y& \6 p - .text:004011C3 mov [edx], al* r# q+ L+ S6 J) x L- K
- .text:004011C5 inc edx
! p0 I% s$ z ]# X' I, q% g4 i' J. V - .text:004011C6 test al, al
# @: o3 j% G' z2 ?8 H - .text:004011C8 jnz short loc_4011C0# e+ B0 w/ Y4 \
- .text:004011CA1 h: x) K: n; L6 V, v( f
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
0 r. I$ n, k7 Y; S" n9 ~, a5 { - .text:004011CA ; sub_401160+10↑j0 O0 {9 F$ ~; {* e4 b; ^ U) `$ v9 u
- .text:004011CA pop edi; U e; Q( y# p
- .text:004011CB pop esi" Q& J% y& @0 _& S+ V% p: m# V# S
- .text:004011CC retn 4
3 a! @/ J) f. X# @) }: e - .text:004011CC sub_401160 endp- y% N* d6 v. o8 r P Z, x
- .text:004011CC+ A" T3 [, R/ Z8 [ l* p
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码 - ]. \1 H5 t/ q' d- ^ u6 s2 N
( M" f3 n3 Q R
/ A: t& ]9 L, b2 ` |