本帖最后由 shane007 于 2023-8-27 13:23 编辑
6 w; t. S( s4 y* l$ K
9 ]3 ?" G* o$ ~, `1 h4 O本游戏采用了CEGUI,该组件能采用directx和opengl。. S$ x) f1 Y' B8 m f; r6 X- {
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
# U, L5 q0 H" ]2 [+ N2 q6 I游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
& `* S2 R4 A. N4 `# q( d(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
7 A2 P3 m+ y) h4 B! P+ l
* N; z; h' u1 T; h* q2 s! T. C0 V% k! c, ^$ H
在游戏中找一个字幕,在以下地方断下。
8 s& \! @$ |- f# P6 R由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),$ I; y. I: v& g9 }& ^
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。) N/ v& `/ x# J
; o* c9 H t" B5 y! ]" I, x
- NextLife.exe+11C5 - 42 - inc edx# v( P5 U, r5 i
- 004011C5
复制代码 3 z% n h% v* j; V: O
* W% v" u+ M% G; \+ R1 r该地方的伪代码- X' I$ g6 P* D- j$ \- a: f
- void __thiscall sub_401160(char **this, const char *a2)
/ Y( f+ g% j- ^& w, o' ` - {, o; L0 M. z2 b. ^) Q" c9 D
- char **v2; // esi
5 l1 h" |. n3 D5 R - char *v3; // eax
) e8 a; i9 ^) k3 l7 f5 g - char *v4; // eax
3 w3 d4 D. E. ]: q; E
/ C6 y5 P( b6 a! O4 o- v2 = this;
* O3 Z5 ~! w9 b* I) x; Y - if ( a2 )
! Q( ^. P) P5 |* ~/ t' H - {
* l0 e9 A0 i' y1 ?' e: }5 Q - v3 = *this;
3 p, q/ D. W" ]8 e9 P8 C1 n6 K% b- G - if ( a2 != *this )
# o4 }- |& u& `9 L7 o5 q - {$ u, k2 ]$ j, m% K/ B$ i
- if ( *a2 )9 n" L& F$ f5 B( u/ v! m
- {
; y) ]! f J- i - sub_401030(strlen(a2));
* |+ x- `0 |( i ?3 X - strcpy(*v2, a2);
- k4 l3 Y2 a% I: O) o0 N - }6 J: T1 f$ M6 S7 I5 V) c U: t. [
- else* N2 [% T- k+ V# V) m: h+ V
- {/ J5 N. F5 y4 M6 d
- this[1] = (char *)1;
- r8 D1 J% h7 v - if ( v3 )
2 W3 S0 x% f1 U# K+ w3 x - operator delete[](v3);8 w& R* B! N( V3 ~+ J8 L) u% R2 K; t
- v4 = (char *)operator new(6u);
0 z r, }6 R: K/ }8 o - *v2 = v4;
7 i2 n' ?! F) F, ^; l* N" N) o8 { - *(_DWORD *)v4 = 0;
$ V+ B1 B9 C+ a# R- j% e - }
: }8 [! }! B& h* E$ m" U - }( K2 E m/ b; ]! V6 I5 m1 i1 w
- }9 E" I9 Q& q4 N9 a9 L
- }
复制代码
/ x" o5 O3 `0 P. m汇编代码
- Y7 {4 R* W; V0 c( T- .text:004010F02 s3 V. x. o( I+ U# p3 }& c
- .text:004010F0 ; =============== S U B R O U T I N E =======================================$ d. V2 d% W6 y# t
- .text:004010F0# h, O; r2 V, z! h" U& q. p3 Y2 i
- .text:004010F0
) Z3 `3 ^' Z1 K: L7 {# v2 f - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p
. F# j( F, y1 c# J- M! e& J2 X - .text:004010F0 ; sub_403240+97E↓p ... x# s1 U8 p. z* T0 u0 T- W
- .text:004010F0
1 Y9 L! }5 w8 ~! \: | - .text:004010F0 arg_0 = dword ptr 45 o1 ]. N" e# E$ o. K# E5 h$ ?& i
- .text:004010F0
: v, U, V0 F7 R9 G8 Q - .text:004010F0 mov eax, [ecx]
: e1 m" a" l: B8 B# O5 M0 L) k# @; W) J - .text:004010F2 test eax, eax* X, y P4 ?4 B5 K
- .text:004010F4 mov edx, [esp+arg_0]
" |/ A Q! A) m9 ^( P1 z" ] - .text:004010F8 jz short loc_401147
$ X5 L3 G8 ]$ u, l7 v4 A# g7 k - .text:004010FA test edx, edx* ]" m& `4 V) y# e% y6 g
- .text:004010FC jz short loc_401147: E0 d! D V$ z8 p
- .text:004010FE mov cl, [eax]
8 o& W" p( {) c8 F$ y+ ~ - .text:00401100 test cl, cl
5 d5 }! P" G* _" X; e( u/ U - .text:00401102 jnz short loc_401116
( F) C0 }* V8 I" t. o( D - .text:00401104 cmp byte ptr [edx], 0) O- x4 s$ ~! [: \
- .text:00401107 setz al) l1 J; Q" g0 l) x# O; V+ h
- .text:0040110A xor edx, edx- F4 r- t2 m9 |
- .text:0040110C test al, al
: u1 M9 {4 X, |% d6 g. V - .text:0040110E setz dl, g5 y8 s5 ?8 f5 p1 s
- .text:00401111 mov al, dl
7 Z4 p2 C/ t$ j' ? - .text:00401113 retn 4
& B; \1 _3 z2 L/ q: M - .text:00401116 ; ---------------------------------------------------------------------------
7 e8 s4 Y( k; W" ]. Z8 H - .text:004011162 s2 s) U. g' ?/ C: z
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j+ {) {$ ^7 p( b; p
- .text:00401116 cmp byte ptr [edx], 0
( l: c$ g) Z% h( ]: r - .text:00401119 jz short loc_401147* {3 @3 U! T/ ]0 x8 w1 w) g( I0 ~ c
- .text:0040111B jmp short loc_401120
" F# |0 U& b7 @1 j% a6 U2 G9 _ - .text:0040111B ; ---------------------------------------------------------------------------( t6 b. S1 r! \. ~
- .text:0040111D align 10h+ A- z3 j$ V, ]. F! X3 g! Z3 b1 v
- .text:00401120
w- t+ Y2 C- Y1 V - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
" _2 l8 g! V) W c - .text:00401120 ; sub_4010F0+3B↓j6 P; z1 z9 l' i
- .text:00401120 cmp cl, [edx]+ L$ J& n. E& m
- .text:00401122 jnz short loc_40112D
- F; P F$ R1 J) K+ a2 D - .text:00401124 mov cl, [eax+1]
: t7 L5 M0 w1 E) j/ ?5 K - .text:00401127 inc eax0 ?. j) p& U+ ^! T
- .text:00401128 inc edx
6 R# Q U& k7 M- z3 C - .text:00401129 test cl, cl6 _- f$ b4 q5 `: q2 r& Q. w
- .text:0040112B jnz short loc_401120
- n' e% o$ T" i/ T$ c/ M! ~ - .text:0040112D
' T2 }, [6 I& @% | - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j: U H: L4 o$ x+ N& t1 o0 s4 K
- .text:0040112D movzx eax, byte ptr [eax]
- f; a1 V m% V& ? - .text:00401130 movzx ecx, byte ptr [edx]) r" U: V. u: F5 p
- .text:00401133 sub eax, ecx! X4 V7 N1 z& D5 p3 D- n4 X$ ]
- .text:00401135 neg eax
}1 S7 ]+ g* n8 ]; E6 J8 J; j0 { - .text:00401137 sbb al, al
3 a% Q$ J- }; u; _ - .text:00401139 inc al, `9 o/ `0 I6 v. \1 U8 n3 x, H
- .text:0040113B xor edx, edx
2 k' Q W( o/ M& [4 ^- b - .text:0040113D test al, al# j: [7 _( E1 p! D' A
- .text:0040113F setz dl$ c* N& R9 T# h2 l6 D( D
- .text:00401142 mov al, dl
1 V& R6 ~" U! s" v* `; x6 x - .text:00401144 retn 4# i+ [4 K5 J4 l/ P4 x& e' M
- .text:00401147 ; ---------------------------------------------------------------------------
, `! Y; E; N! E3 m - .text:00401147
7 ~3 R# { y: ?' d2 X0 u' i - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j1 V: T( \; Q& l$ R' q
- .text:00401147 ; sub_4010F0+C↑j ...* w1 K/ l! w! d$ j/ o2 j
- .text:00401147 xor al, al
& u& Q! q- [+ |2 u - .text:00401149 xor edx, edx/ w- a6 ~/ l# m+ p2 h# s( C$ \
- .text:0040114B test al, al
4 g3 |% g, ] g) L7 d - .text:0040114D setz dl0 T3 D6 I/ h( l( n' w
- .text:00401150 mov al, dl+ v. E2 ^! i) w8 ^0 K9 E
- .text:00401152 retn 4+ W A, ~2 ?/ p7 `; z: L
- .text:00401152 sub_4010F0 endp. J2 }# x! A( O: S( {; t
- .text:00401152
2 ~+ o# `7 D" _$ q( p - .text:00401152 ; ---------------------------------------------------------------------------
7 O$ {( C" L7 f" d - .text:00401155 align 10h: T& |+ n/ G% u7 w' [9 K
- .text:00401160$ i4 F- |# q( }* o8 C' h9 R
- .text:00401160 ; =============== S U B R O U T I N E =======================================6 M% w, G: R; u! H1 y$ a- N
- .text:004011603 I, G! i8 y8 b
- .text:00401160: r5 c/ ?0 b+ I4 }
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p W5 o1 R/ n- r, d
- .text:00401160 ; sub_4013F0+C↓p ...7 j" E% `! g3 c2 v; ]
- .text:00401160
' ^; T# B I6 |5 k$ | - .text:00401160 arg_0 = dword ptr 4
8 o; `8 V% h- M& t) g3 l5 B - .text:004011609 \9 P2 |4 _- U( q# J
- .text:00401160 push esi
* c% V( n2 y9 d - .text:00401161 push edi
: u4 }+ C9 N6 r* _ - .text:00401162 mov edi, [esp+8+arg_0], _% ^1 g% W6 ?% ]+ n
- .text:00401166 test edi, edi
: M1 H% \. }& R* J - .text:00401168 mov esi, ecx
0 Z) C# q! d1 |, M+ ~# C4 L7 p - .text:0040116A jz short loc_4011CA& ~$ c6 z- R( G' I2 n( s
- .text:0040116C mov eax, [esi]* K" F/ M% \$ c7 E& v- |
- .text:0040116E cmp edi, eax: f+ @8 w5 q P) L) H9 d% A5 a
- .text:00401170 jz short loc_4011CA
+ I: A2 |) H e3 w! T - .text:00401172 cmp byte ptr [edi], 0
+ a0 |- n# n: E# v - .text:00401175 jnz short loc_4011A2
1 j @: ?! \: Y% y1 d - .text:00401177 test eax, eax# Y' m- p' P1 j3 ~1 ~( N9 O5 q
- .text:00401179 mov dword ptr [esi+4], 10 h! f$ w0 Q I, W4 Q/ d
- .text:00401180 jz short loc_40118B
; c3 h5 {# Z' n; P - .text:00401182 push eax ; void ** g" b( p# k* m {
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)% {' I5 b! B4 r* d8 g8 S: E
- .text:00401188 add esp, 4% g5 q+ w/ a, @) Z: @- y+ E: P
- .text:0040118B
! Q. b+ V& o4 ^. {" P) p+ y: C - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j& K+ }3 s9 g- P3 N7 \7 h
- .text:0040118B push 6 ; Size o! t0 f/ ]7 R; e
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
$ Z0 ~% _6 o0 |' @/ b$ Y9 |& } - .text:00401192 add esp, 47 Q5 n6 H1 D* e0 s9 B l- ~9 Q
- .text:00401195 mov [esi], eax( J* r; s9 N( B
- .text:00401197 pop edi% M! X6 x1 O6 s9 Y6 O
- .text:00401198 mov dword ptr [eax], 0" p( x4 P, j! M* k; G- y0 q
- .text:0040119E pop esi7 T# M( t0 N" I. f5 V [
- .text:0040119F retn 4
7 K8 ]8 J: l& C! C$ D/ o - .text:004011A2 ; ---------------------------------------------------------------------------
4 ]1 w' i% z1 _5 N0 A& p9 R- w - .text:004011A21 M1 T" X( Y! R" }$ o
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j; |, S4 q2 ?9 {/ U" _1 H
- .text:004011A2 mov eax, edi: a1 M8 ^2 x" ?
- .text:004011A4 lea edx, [eax+1]2 A# a! l1 b3 m c
- .text:004011A7) y; ]1 f: S7 Q% q7 B+ V% o
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j8 Z d5 t# T+ Q, G4 v! y+ }* Q1 x
- .text:004011A7 mov cl, [eax]
4 H Y: {3 o4 v. O( F, W m' b - .text:004011A9 inc eax5 l+ F5 h8 M# K$ X
- .text:004011AA test cl, cl9 ~2 B* C, t7 h" M" r
- .text:004011AC jnz short loc_4011A7
, U: _5 a7 {, Q7 \8 X; x' Z: B - .text:004011AE sub eax, edx2 |5 M3 Q7 K% r5 t+ p% a) H
- .text:004011B0 push eax) v! [+ v( f) k8 J9 ]+ H. h0 j
- .text:004011B1 mov ecx, esi2 q1 M( [. l9 S; {, v7 n* m9 \
- .text:004011B3 call sub_401030
8 U3 O u: C/ }+ t3 O% _# C - .text:004011B8 mov edx, [esi]
- H+ r8 @9 j; A) D - .text:004011BA mov ecx, edi( J1 w, o' l7 F$ ]# C2 `
- .text:004011BC lea esp, [esp+0]
$ [) n! R9 k" W6 K3 i - .text:004011C0
8 K, g& y. M% k' W - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j1 O8 x4 J* a( G, z, z) R* U+ q7 S: ?
- .text:004011C0 mov al, [ecx]- T9 {* K$ t- y: b
- .text:004011C2 inc ecx
0 e) {; e2 |8 W1 h5 Y - .text:004011C3 mov [edx], al
a" I0 r6 O/ m. Z# z - .text:004011C5 inc edx
$ B1 x0 t9 L9 e6 P - .text:004011C6 test al, al
% a1 n5 h' V& H2 E9 N- n - .text:004011C8 jnz short loc_4011C0
9 N& k# c* c/ }/ i/ K3 l) V6 U - .text:004011CA
3 O' i6 @3 I- _& R, \ - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j- q+ w( _/ ^) N9 C
- .text:004011CA ; sub_401160+10↑j& E3 i' D7 v/ y/ L
- .text:004011CA pop edi
5 ^. x! ?1 h5 ~/ S - .text:004011CB pop esi
2 _6 d+ M; \4 X8 n& T - .text:004011CC retn 4& n2 m# [# W7 r* @$ V
- .text:004011CC sub_401160 endp
6 e. y% ]3 I% \1 T; b3 i - .text:004011CC, v! F* d" ?1 x8 s- ]
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
$ [) s4 z! T7 W* \7 ^& c% B( k
/ P4 S: a; { |) j" s# } |