本帖最后由 shane007 于 2023-8-27 13:23 编辑 6 B2 c; P( e2 l \# e
' L6 U3 X7 h+ @( _0 p8 `本游戏采用了CEGUI,该组件能采用directx和opengl。
- Y R- ]$ c. }3 |经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
4 I$ Q5 C& o/ M( i游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。. y3 u! N9 R0 l5 V* b5 V
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)6 z2 _" V8 B& m4 T+ G1 _7 ], ]% r/ w
: X! A; U& K( L. W X7 l8 C, q$ ]& ?) ~8 R. S
在游戏中找一个字幕,在以下地方断下。9 t. A9 u; m' H) k: Q
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),! E& J( z% ~' C& X" [( H6 Z) {
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。" t; q% p: H: L1 ^* H
! O& o# D4 o/ F, M, c
- NextLife.exe+11C5 - 42 - inc edx
4 w# g( |$ |( ~" [- U2 ? - 004011C5
复制代码
2 l9 T0 W4 |( D6 q: J
6 ~+ ]$ ~- j4 `( I- q该地方的伪代码
/ r( x- |/ X/ l2 {4 m- void __thiscall sub_401160(char **this, const char *a2)
6 _/ D6 Q4 P- G: R: K - {
; m8 V2 u! R6 h1 ^ - char **v2; // esi @8 k9 l( d8 ~2 _ [5 ^) ]( F
- char *v3; // eax
5 X0 M* V% }. W& ` - char *v4; // eax9 E3 F+ n" z0 M1 A% q* n; E
. t, I2 N1 U H0 G8 y9 f6 b$ d& r- v2 = this;/ d; D% Z. V5 p( T0 l. n
- if ( a2 )- H7 D$ s! [& A' ?- d$ r$ \
- {
, W+ v: D; a" ?/ q Y0 ]0 } - v3 = *this;' G4 }2 \3 O. e2 Y3 p4 `+ f
- if ( a2 != *this )! x1 Y' P0 }, s" {
- {
4 Y0 S3 [7 M: J - if ( *a2 )# y H# y' Q4 u3 s' ^& n. |
- { g* J* T0 j- n2 |+ y( u
- sub_401030(strlen(a2));
- B" T* d4 M5 b1 Z7 u - strcpy(*v2, a2);5 x4 p# m4 I, P* @9 }7 ^4 B& N8 {, J- b
- }
5 F) V }! A: C/ v - else
1 z+ M4 N0 P. L' U" q - {* T6 n0 v% i% a' t* X
- this[1] = (char *)1;
% {8 c9 @+ T7 l- [ - if ( v3 )
* ?# ?! Y/ T2 ]: T, r7 J$ v - operator delete[](v3);6 J6 {. s6 C# f, j3 m
- v4 = (char *)operator new(6u);
* O4 U: X% H0 g& f - *v2 = v4;
9 h. X7 V7 \5 [" _4 v3 \/ h - *(_DWORD *)v4 = 0;% }8 ?$ @: W7 l% _9 Y* S. l
- } |' h4 t8 V( E* i0 H {. F& G
- }
$ ~- G: k0 q; K/ j - }8 l2 F3 w6 z% j4 O
- }
复制代码 + F! Z! S( K# \% ^
汇编代码
' y; K) k& ` ~$ O- .text:004010F0
# ?- Z3 C l% l# r/ J* D2 z8 f1 u - .text:004010F0 ; =============== S U B R O U T I N E =======================================
. Z3 {( i' G8 j9 { - .text:004010F0
7 E5 E( l! W2 F+ i - .text:004010F09 u7 r+ [1 W8 j% T
- .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p- P( @( T( q8 h5 U; h$ p
- .text:004010F0 ; sub_403240+97E↓p ...
Z' H5 K! {7 o$ z/ o$ e - .text:004010F04 j7 Y2 c: _9 r @% q& c) U
- .text:004010F0 arg_0 = dword ptr 4
9 i# t$ E3 I$ e7 r$ [# V9 Z - .text:004010F09 P7 `( W* c- O1 V# N- [8 V
- .text:004010F0 mov eax, [ecx]
$ ]1 _5 }4 |; k. A - .text:004010F2 test eax, eax: p4 f) m4 u2 W0 d/ @$ p. A
- .text:004010F4 mov edx, [esp+arg_0]
! _6 g, ^, K( g& ` - .text:004010F8 jz short loc_401147& q Q$ I- X/ m1 M+ s) J) X" U
- .text:004010FA test edx, edx
* L! u5 K1 y1 W: o, g. H! d( V - .text:004010FC jz short loc_401147: ?! s0 Q; I) h1 y
- .text:004010FE mov cl, [eax]( c8 s6 r7 \- F. n5 h/ k0 N/ Z5 \
- .text:00401100 test cl, cl0 ]2 ~3 {) l. n- k& y, B( Z
- .text:00401102 jnz short loc_401116
* N+ L, I% I" t, O - .text:00401104 cmp byte ptr [edx], 0
: {! K) j/ \- M4 N. n - .text:00401107 setz al
& i4 w7 Y p* L4 j+ Y - .text:0040110A xor edx, edx3 r, x) s ~4 @$ K/ r
- .text:0040110C test al, al6 V* ^* r$ U0 [, c) I' o/ |, x; U
- .text:0040110E setz dl5 ?- }9 @ m. ?1 {- E F5 Z
- .text:00401111 mov al, dl' \$ r0 b: ~+ T0 c; u# b
- .text:00401113 retn 4
" {" v# z8 E: q7 E - .text:00401116 ; ---------------------------------------------------------------------------( R# v }' V# d: y9 F- Y9 k) U
- .text:00401116# `% Z& \4 Y' A$ \
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j8 C0 o2 r+ J- ~) F C1 ]
- .text:00401116 cmp byte ptr [edx], 08 @( H% t$ w# l3 L# t
- .text:00401119 jz short loc_4011478 z. E" d( F: H: p
- .text:0040111B jmp short loc_4011203 S: K* z7 } t
- .text:0040111B ; ---------------------------------------------------------------------------
# z+ y3 c+ t, P7 u" |2 r! \ - .text:0040111D align 10h) |8 F9 E) e8 ], J* E* x/ a
- .text:00401120; n0 I E# K* }, i8 {( D4 r
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j7 J( @8 n. t% e& n+ q) D% b; g8 f
- .text:00401120 ; sub_4010F0+3B↓j
. K& b a$ N+ C' Z9 Y/ e - .text:00401120 cmp cl, [edx]- m7 E3 x3 Y, n' T/ W4 f7 R
- .text:00401122 jnz short loc_40112D) X" v. y0 d0 N4 ~) {$ N- U. s6 A
- .text:00401124 mov cl, [eax+1]
" |3 W* W0 h2 n) S N; E - .text:00401127 inc eax
/ D" K' v/ u, d0 I! ^ - .text:00401128 inc edx
: E% \' S {( b% \& [/ \9 L - .text:00401129 test cl, cl: s! y& S; n2 D: w
- .text:0040112B jnz short loc_401120: P6 C6 I! @* d" r9 P* V6 f r
- .text:0040112D8 ^) o# l5 Z, E# I3 G
- .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
7 k3 [% o7 b4 Z0 V2 _& S' ]: O - .text:0040112D movzx eax, byte ptr [eax]% J- k2 {8 U- c3 X- L
- .text:00401130 movzx ecx, byte ptr [edx]3 C4 [% t2 k2 p! h) Z" |" k5 R+ w
- .text:00401133 sub eax, ecx1 Z2 J+ r8 F8 i. [% ~
- .text:00401135 neg eax
+ Y X7 z, u5 Q; x% w4 n- r9 S - .text:00401137 sbb al, al( r0 f! `3 k9 p5 a$ [" @+ E
- .text:00401139 inc al
/ C& u9 k4 k6 Y3 a - .text:0040113B xor edx, edx% p: r# w. _( i
- .text:0040113D test al, al
7 X4 P( @" I9 \2 I4 `' g4 b$ O - .text:0040113F setz dl
0 C$ O' `+ n* R5 I7 Y - .text:00401142 mov al, dl
$ i+ ~: N1 i. G0 a. E+ T - .text:00401144 retn 4/ y& Y' B9 m5 h3 s
- .text:00401147 ; ---------------------------------------------------------------------------7 T; A' D9 c8 e/ i4 n, J
- .text:004011472 F) u" w! n& J& j6 @
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
5 D" U" D$ F9 T, @! m - .text:00401147 ; sub_4010F0+C↑j ...0 x- \9 Q) O- S7 z: [( U7 }
- .text:00401147 xor al, al
9 B* |+ N1 V- [, ?% W4 p2 u - .text:00401149 xor edx, edx9 {' [; w3 l* z& \: p
- .text:0040114B test al, al
% p0 {4 T. \2 M% L$ X w - .text:0040114D setz dl/ J8 h4 I5 j3 c# L+ G7 p$ E( c
- .text:00401150 mov al, dl
4 m S$ y7 p" y7 W: R& H c - .text:00401152 retn 4
! f- U+ N! K3 v5 c* g: g - .text:00401152 sub_4010F0 endp
" x* N% e4 d) D k" @ - .text:00401152
" G+ k' W D$ H- ?. x# w& M - .text:00401152 ; ---------------------------------------------------------------------------
1 ^* n i" r4 v* ^7 { - .text:00401155 align 10h
: p/ B; C: _* D3 q5 i - .text:00401160
; [* h$ G* | ] - .text:00401160 ; =============== S U B R O U T I N E =======================================7 t) u- X; k$ u6 L a3 G
- .text:00401160$ a$ g; m N; h8 L, y" h
- .text:004011609 C) ~" H; W( s2 j
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
0 h+ S V# d+ \9 }% S - .text:00401160 ; sub_4013F0+C↓p ...: ^8 I( A$ ^3 r# T5 u% s. ]4 S
- .text:00401160& \) ~: h# V% c- K( O% a
- .text:00401160 arg_0 = dword ptr 4- S; ?9 `8 c; _' c1 o, R
- .text:00401160
C, H, m1 p% B# j& W! y - .text:00401160 push esi( K# V/ u( i$ k! I7 {
- .text:00401161 push edi
+ i$ y) k* q* G+ }. b - .text:00401162 mov edi, [esp+8+arg_0]$ p2 s/ X% x4 n5 ~
- .text:00401166 test edi, edi6 y" k Y0 G5 r& d% [7 P
- .text:00401168 mov esi, ecx( |% I7 L' S. ~! A7 d: T
- .text:0040116A jz short loc_4011CA
+ @6 T$ V3 @7 I9 V- P6 Q( U! x/ R: x - .text:0040116C mov eax, [esi]0 A: ^5 n: s8 n; O
- .text:0040116E cmp edi, eax
; p6 P$ Z3 e% v" U7 A0 t5 [# I1 u - .text:00401170 jz short loc_4011CA' d3 X; D6 c; p, D
- .text:00401172 cmp byte ptr [edi], 07 k* S# z ]7 X0 h9 q' _# Z% ?/ m
- .text:00401175 jnz short loc_4011A23 X/ b$ q5 v, @
- .text:00401177 test eax, eax0 q- z* {* Z H1 J- R+ w
- .text:00401179 mov dword ptr [esi+4], 1
) d M0 x# G' @. I! J5 O. o! i, x5 ? - .text:00401180 jz short loc_40118B7 N3 y4 U# p+ ~2 k5 C
- .text:00401182 push eax ; void *
' s; a5 d0 ^+ ~1 Z, Z* M - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)2 F/ h9 }. q9 ?( W6 T# Z; d% w6 e
- .text:00401188 add esp, 4
7 f; w- r% T/ ^! ~- w" A - .text:0040118B" `6 S. Z, r5 E, V
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j; ?. j3 B; q1 d8 m: z
- .text:0040118B push 6 ; Size" K) I+ v& I2 F
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)1 N1 A y" k: b+ l% F# i
- .text:00401192 add esp, 41 P: g2 k/ f# E5 L
- .text:00401195 mov [esi], eax4 W' u* u# r+ X( }. z7 ]! v
- .text:00401197 pop edi8 ~& X. B# X# L- f! j) b% R
- .text:00401198 mov dword ptr [eax], 0& G' [. U j+ o z& h
- .text:0040119E pop esi
5 ]; }7 w6 R+ h - .text:0040119F retn 4
8 y2 c0 |6 ]$ B+ a - .text:004011A2 ; ---------------------------------------------------------------------------
+ c( ?- j6 D; |5 K b$ ^( k - .text:004011A2% V( R, T$ D+ J
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
0 }" C: T2 k- g1 R - .text:004011A2 mov eax, edi
. ?( H. v% L- ?$ ~* } - .text:004011A4 lea edx, [eax+1]5 k# U% N$ _& {) e9 w
- .text:004011A7$ L7 @4 t) i$ x
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
* f8 ~# q9 ?/ y, b0 [- @ - .text:004011A7 mov cl, [eax]
: F q0 |4 n8 s - .text:004011A9 inc eax0 ?3 V; ]) `# P0 B' O
- .text:004011AA test cl, cl
/ ?& [3 K3 P/ ^% F+ Q* j - .text:004011AC jnz short loc_4011A7
$ g A' E8 [, ?5 X3 B) R+ ^# T! ^2 K; F - .text:004011AE sub eax, edx
5 i4 ^- i3 o7 J - .text:004011B0 push eax
/ d6 o1 W( `) b5 v4 i& A9 ? - .text:004011B1 mov ecx, esi, G! d6 I6 Q5 q8 a
- .text:004011B3 call sub_401030
/ S$ q! H$ r, ?2 e( e7 m# ^ - .text:004011B8 mov edx, [esi]
' V+ q7 o- E5 s& c8 i( L" {5 n - .text:004011BA mov ecx, edi
% V/ h4 j4 T4 c7 ~" s- [! i - .text:004011BC lea esp, [esp+0]7 x8 I3 Z0 e* |% r& _$ ]
- .text:004011C07 w; N: |/ J) i1 j0 t, U
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
1 N, F, L* p% \; X6 B( R - .text:004011C0 mov al, [ecx]
6 H: A4 g. }- \, c - .text:004011C2 inc ecx3 o9 f. _/ @: t' @2 p
- .text:004011C3 mov [edx], al
% v5 q1 w/ N3 n" c( T; X - .text:004011C5 inc edx
4 j$ H. @. N" |( P. _+ Q+ D - .text:004011C6 test al, al, F: P [ U0 Y
- .text:004011C8 jnz short loc_4011C0
9 ]; U p2 U/ G - .text:004011CA& ~# P4 }, H1 m. y! |6 l
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
0 b0 ?+ J9 w. O( D0 V" O - .text:004011CA ; sub_401160+10↑j
7 L2 q O; U% D - .text:004011CA pop edi
$ o L1 z. G) g1 D+ d) m6 Q# q - .text:004011CB pop esi
. @, Y: H! X$ E& [" T1 G* G - .text:004011CC retn 4
$ [; T, }! Z0 i5 v - .text:004011CC sub_401160 endp$ l- E3 J+ M. h/ Y q
- .text:004011CC3 E& ^0 t1 K) n* }; L! C( @" x! ~
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
4 I2 J4 [5 _2 _/ r
2 D4 ]: E( o0 y' n% D+ `7 @" d% d5 f
3 O& s5 k/ {. R! ^1 W |