本帖最后由 shane007 于 2023-8-27 13:23 编辑 ! J( N9 d, Q3 U
1 R9 U; @5 O: X; }( y) p
本游戏采用了CEGUI,该组件能采用directx和opengl。+ s5 z' o! M- L% p( l
经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。8 l; I4 f: l* i s: |( }* ]
游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
- v) [4 }! X3 |2 O4 K(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
5 |9 b& A1 G8 j6 p; M) O
+ `! L4 |+ \6 B; |# C% N+ w
+ M; }4 K4 J. Y+ D5 Q& H, l在游戏中找一个字幕,在以下地方断下。, ~& s+ j) k0 X! d1 u( v- @% y
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),1 H& F: I6 B2 r. m# k
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
9 p5 G3 K5 I! \
Q7 [; I5 U- i0 E# A& P' b- NextLife.exe+11C5 - 42 - inc edx- B3 |' {% e! Z3 W; M, ?0 o
- 004011C5
复制代码
& ~1 w4 x" R0 }
% u# U$ w( p& o该地方的伪代码
" T2 @, @. r3 p4 ]* L1 E- void __thiscall sub_401160(char **this, const char *a2), m5 K0 c& V k' G" [6 w% v0 l
- {
1 o% A$ ~4 n: |- S% L# Y - char **v2; // esi
& Q1 f# _7 l# h0 f& ~ - char *v3; // eax
7 H2 A" o5 \; [0 Z5 P- x - char *v4; // eax
, Q. X) g1 o! E. Q* V: o
/ d$ S( [+ d! ~4 p- v2 = this;
: d8 V7 r3 E$ G8 J4 @# e - if ( a2 )5 k1 h+ D) W5 L2 ]8 V* E3 S
- {* d1 _: |( k2 i& H. v1 Q" j" Z
- v3 = *this;
3 ^6 X& b. n" D - if ( a2 != *this )
2 r) b+ \& e1 e G+ J - {# ?* N' M7 X2 O0 f
- if ( *a2 ), I8 L7 v/ P2 ]( d4 |5 T2 Q! ^
- {& @% C O' _4 j7 E
- sub_401030(strlen(a2));/ {; I- v! T- F+ ]. }% a
- strcpy(*v2, a2);' q3 j: u0 r0 d
- }
% \6 k% |! S" g% s - else
2 \, D' s' O$ h# F( B8 o- F - {' p: C- a. o5 G2 }% W; n, j" w
- this[1] = (char *)1;, ^$ X7 ^! q6 a3 @3 o9 P& g3 Y: W
- if ( v3 )
5 R* o! I+ \- E! U+ N' u$ u. k/ i- L - operator delete[](v3);# `; E% ?9 u- Q1 I& O* Y! v! T
- v4 = (char *)operator new(6u);1 l% n V; m- R b6 Y$ w
- *v2 = v4;6 ~, F6 W" Q) H9 p- @) z
- *(_DWORD *)v4 = 0;
; i2 W b- S2 p& O3 X( C7 D - }3 I" ]( ~, j# o- @5 T
- }
P% U/ G. Z+ ^; B - } [; S7 p0 J A9 L
- }
复制代码 Z" U+ M' O( w
汇编代码
: {; q7 G( }1 H4 _- .text:004010F0
+ ?2 q7 v/ v5 {; z+ y3 G - .text:004010F0 ; =============== S U B R O U T I N E =======================================
5 M E/ \! {5 Y% I$ F$ {# s - .text:004010F0
) K; S6 j w: }# }3 M - .text:004010F0
0 ^( k( _! }* P6 N8 [0 ^9 i - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p
7 i5 C; _9 r8 f+ \$ ^ - .text:004010F0 ; sub_403240+97E↓p .../ f, i8 `& [/ F
- .text:004010F0
4 k, F* ^1 |1 u: ^% P - .text:004010F0 arg_0 = dword ptr 4
" ~5 K) V6 I/ n* a+ d% s - .text:004010F07 ]/ y2 |3 w5 L/ c
- .text:004010F0 mov eax, [ecx] a! E! R. {" x* J
- .text:004010F2 test eax, eax I5 l* C/ ]" Y; ^. |& z
- .text:004010F4 mov edx, [esp+arg_0]0 N) H% x# a/ E# P: f f+ }# |# S
- .text:004010F8 jz short loc_4011474 m9 s; g+ ~9 }8 j6 f! G
- .text:004010FA test edx, edx
# Z' `9 B; i+ S - .text:004010FC jz short loc_401147: G( v6 |7 I9 ?
- .text:004010FE mov cl, [eax]
) d+ u7 v j( o6 \" Y! A - .text:00401100 test cl, cl
9 ]0 s; I B; i! a1 c& j+ e- ] - .text:00401102 jnz short loc_401116
+ o2 m% ^; W6 d6 _/ N2 \ - .text:00401104 cmp byte ptr [edx], 0
# d1 n7 {, h0 F/ o& n* L - .text:00401107 setz al
7 Z1 J8 C+ V& K - .text:0040110A xor edx, edx. c ]0 R: |+ d' o3 c) Y2 l- [8 C; L
- .text:0040110C test al, al! T% z+ B/ b' U% }3 }1 z
- .text:0040110E setz dl- A: k \0 }6 ]* d, [1 W
- .text:00401111 mov al, dl+ |" X) _2 y5 ]1 F& x, P
- .text:00401113 retn 4
) X$ g! r! `1 w' ] - .text:00401116 ; ---------------------------------------------------------------------------
! y% h! k' O; z - .text:00401116
3 g: _7 ? Z* P4 L3 A8 M& m - .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j0 d, S) |$ k2 v c0 O+ C p+ i$ P5 b
- .text:00401116 cmp byte ptr [edx], 0
0 S- q G `% a - .text:00401119 jz short loc_401147 }% d& N B. c5 y5 g
- .text:0040111B jmp short loc_401120 n1 ?: G2 I1 @
- .text:0040111B ; ---------------------------------------------------------------------------% \( x+ G( z! W x {
- .text:0040111D align 10h
8 w1 ^; m, v7 c/ n. P - .text:00401120
- o, H/ B; ?7 I: x) F8 ] - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j
& }4 ]0 D$ d; q! M - .text:00401120 ; sub_4010F0+3B↓j
# i0 s: H5 E! C" e3 r# D' i - .text:00401120 cmp cl, [edx]
6 Y: h" c$ Y) V) m. T7 [& u& |8 t - .text:00401122 jnz short loc_40112D+ z; j, f- p/ u: v
- .text:00401124 mov cl, [eax+1]' ~0 x* ~+ E& i! M" V0 r
- .text:00401127 inc eax& \# G/ v* |# g# w8 m
- .text:00401128 inc edx
2 H% ~# D# m# C5 T) Q - .text:00401129 test cl, cl
. d9 x! h% T1 ~; G! c3 s - .text:0040112B jnz short loc_401120
3 _: e5 m8 i# u, K( y* R - .text:0040112D
9 \6 C# x1 d/ a; ?3 M5 z( Q: N - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
0 R- O6 Q0 ]: }/ P# r - .text:0040112D movzx eax, byte ptr [eax]! {0 }9 Y7 Q- J
- .text:00401130 movzx ecx, byte ptr [edx]
' c0 r$ v9 I6 [2 K - .text:00401133 sub eax, ecx; K+ `' p$ [" K3 Z, Z; Y) e* w; W
- .text:00401135 neg eax
. L: F+ |8 s& W - .text:00401137 sbb al, al1 R* g9 q1 S) X d8 ]; T
- .text:00401139 inc al
4 |1 F1 I# e8 F9 P - .text:0040113B xor edx, edx0 B8 e7 y2 s3 M" b6 ]7 g8 H
- .text:0040113D test al, al
5 d! m- R& V/ m3 T" g - .text:0040113F setz dl
( G/ o6 E. @6 U' M) { - .text:00401142 mov al, dl* V1 X' M$ R0 a$ _! j- K6 F
- .text:00401144 retn 4
* z8 L1 ]6 ~; T( H; `; q1 \ - .text:00401147 ; ---------------------------------------------------------------------------+ ?/ g* a8 i5 s1 r% A$ c M1 h
- .text:00401147
" C& t$ I9 f% B - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
( n8 ^& [( b- j3 x4 Y7 O- p3 l- s0 q - .text:00401147 ; sub_4010F0+C↑j ...5 H- x( H/ q% x: A! \) ]
- .text:00401147 xor al, al
- r. K9 B2 G1 L# b1 H4 }$ H9 \ - .text:00401149 xor edx, edx
; x2 Q# e+ ]5 ?/ s1 ` - .text:0040114B test al, al
1 a' j' v$ ?7 i( i8 S9 l - .text:0040114D setz dl
9 v2 R/ P% N( a! l# `) O6 i# ` - .text:00401150 mov al, dl: K3 u( r" L! }% n! `) M+ c% I# O
- .text:00401152 retn 4
1 [5 v# F7 i! a' e1 C - .text:00401152 sub_4010F0 endp% d3 J: [* G9 p, r# F a, f
- .text:00401152
, @' C3 r- ^; ~6 I% G& z5 T* z - .text:00401152 ; ---------------------------------------------------------------------------
" ?( V* J% Q E2 k; m - .text:00401155 align 10h
: B I f, J8 Q, s1 j7 {+ i. | - .text:004011607 ], y8 U* x8 r
- .text:00401160 ; =============== S U B R O U T I N E =======================================
% d5 `5 V' [5 K/ Y - .text:00401160
( L. o2 h% o; o! e- n: @7 T - .text:00401160! T% f; b! b. f5 ?/ x5 O0 y
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p, Q* ?) q1 X& M" {: c$ H7 C
- .text:00401160 ; sub_4013F0+C↓p ..." m0 ~4 Q8 m3 Q# M1 O1 m Q
- .text:00401160+ g6 y% V, e: ^7 i' I4 c
- .text:00401160 arg_0 = dword ptr 47 u8 K: z4 u" N
- .text:00401160
0 E" y; ^0 |+ ^* z ? - .text:00401160 push esi
3 b$ H! _( c8 D - .text:00401161 push edi; Y" c8 `: a* K8 c6 l( B0 y, }1 a
- .text:00401162 mov edi, [esp+8+arg_0]
' P, V/ X u. Q1 Z9 y - .text:00401166 test edi, edi
) e3 b" O2 b$ _7 m0 F2 _ - .text:00401168 mov esi, ecx
- G' u4 v( C1 R4 f0 C* V9 w - .text:0040116A jz short loc_4011CA
8 g* H0 t$ ?! ~; O - .text:0040116C mov eax, [esi]5 R( Q- [* ^( t! U; D# F
- .text:0040116E cmp edi, eax3 ?4 h& }' y# A" I
- .text:00401170 jz short loc_4011CA
$ V' N+ Z2 N7 _ - .text:00401172 cmp byte ptr [edi], 0$ c$ L2 U6 C, z% m! {
- .text:00401175 jnz short loc_4011A2# c5 h6 E y7 _( s6 d
- .text:00401177 test eax, eax' }. _0 E, Q9 y! j
- .text:00401179 mov dword ptr [esi+4], 10 F1 G' \6 X6 G# ?- _# Y) h8 \
- .text:00401180 jz short loc_40118B; V: e2 {1 E( {- m* |- J
- .text:00401182 push eax ; void *7 h5 G0 L7 @4 L2 [4 g
- .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
7 ^5 @3 k+ n, x# F# f( |8 e) D& Y; I - .text:00401188 add esp, 4
; u: P( ~( a P, h - .text:0040118B
. m* c% c8 S! ^# m - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j2 d3 ^7 Q% ]3 Y' {. i* |3 X; ^- A
- .text:0040118B push 6 ; Size/ ` k/ p1 {; b. i: n; p
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
- D3 b I* t" W# l0 y" j6 _) g2 a - .text:00401192 add esp, 4
/ m0 K$ o* r6 ^* J% e" r: z, e - .text:00401195 mov [esi], eax
& \1 Q! n; |- l, ^, V - .text:00401197 pop edi
+ }- ?# h2 L7 [* x - .text:00401198 mov dword ptr [eax], 0
# r- S7 \8 {* Q3 ^: }" I - .text:0040119E pop esi
0 ^- @/ X# Y+ `) S0 [% _4 H - .text:0040119F retn 46 N1 w3 s6 n! a/ Q2 n+ t
- .text:004011A2 ; ---------------------------------------------------------------------------- b. j' o5 f) c2 ]( T' ?
- .text:004011A2
' k- W J6 V/ u - .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
+ O8 ~' O% @# y7 x# ^3 w - .text:004011A2 mov eax, edi6 p, [% l- T- g# ?
- .text:004011A4 lea edx, [eax+1]! n# d" g( f9 X1 F
- .text:004011A7
4 G& R" F' V: N$ v - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j( C$ u i; n! ^
- .text:004011A7 mov cl, [eax]
# d* H: U# P1 C+ }5 [ - .text:004011A9 inc eax- S) y# C3 }6 \4 D3 T# d* [) J# K
- .text:004011AA test cl, cl
- M# D) s1 M' g, H; W1 y4 D* E/ A. l - .text:004011AC jnz short loc_4011A7
/ W+ | |! I; g+ ?, h. Y7 d: o - .text:004011AE sub eax, edx. ]" x. j) t* b7 t$ D3 A. C0 j
- .text:004011B0 push eax: X7 o5 X- O* M6 b( G# E1 z: C
- .text:004011B1 mov ecx, esi! b: r) J$ @- t, q3 [& A( ]3 i8 q
- .text:004011B3 call sub_401030
8 {% s" O& |. s. p7 G) N - .text:004011B8 mov edx, [esi]6 ~4 {& N5 l4 H/ ], z' c1 H
- .text:004011BA mov ecx, edi
1 _- C3 U! m/ o" p4 p - .text:004011BC lea esp, [esp+0]
' F6 A Y: T& S - .text:004011C0
" H. w1 Q, |7 L7 q - .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
! W3 C' g/ b; h0 @, a3 I' N9 y - .text:004011C0 mov al, [ecx]
" I% G) Z6 _. U" u: T) _" K - .text:004011C2 inc ecx. N: _: I. ]. p) Q- y4 U) r% B
- .text:004011C3 mov [edx], al
+ d5 b: B. k0 |0 e h S - .text:004011C5 inc edx! J: g- ?: _$ @+ F
- .text:004011C6 test al, al
, w4 n, w" a0 w( g - .text:004011C8 jnz short loc_4011C01 C% K7 x+ c- B% Q9 f
- .text:004011CA3 c. }9 H/ G; t; v: C
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
: G9 b) o( M2 H - .text:004011CA ; sub_401160+10↑j
7 L! B$ v* I0 Q: J$ x. }9 ?7 y - .text:004011CA pop edi, R6 k* [3 m6 v7 r. ^
- .text:004011CB pop esi, ?/ u8 ], S. V1 M2 L5 r
- .text:004011CC retn 4 e7 \% [8 [" z% B. h4 p
- .text:004011CC sub_401160 endp* D- X, m2 H; j) P/ y
- .text:004011CC
, y" c8 W$ a3 Y1 G+ T - .text:004011CC ; ---------------------------------------------------------------------------
复制代码
0 A: j! k' I4 M( L; i* `$ _4 e% `. n m# k# \% {
+ K \2 g7 C1 ^% r5 Z1 H
|