本帖最后由 shane007 于 2023-8-27 13:23 编辑 9 b! f% j* g, |0 _0 j
2 a5 d' e8 b; U
本游戏采用了CEGUI,该组件能采用directx和opengl。
" C; N) [/ d3 \3 Q6 w( v8 K0 p经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
; M: F% G& u& f f0 O" k游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
2 _+ ]6 ~ C# c9 e9 K( [, @(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
' K0 s* r, a* v% Q/ }: }0 ]- |
' O' i5 B1 a! ]9 V) G9 f
* e% e, T0 y1 K# ?1 M: q B+ s- L$ \# ~在游戏中找一个字幕,在以下地方断下。3 u/ \& K# u' h$ D% \6 ]
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
! t, w$ l8 G9 Y. q5 ]6 e( I2 Y因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。! N. k" }3 [3 h) E. c
8 J5 u! B( { d8 Y1 _4 I0 R- NextLife.exe+11C5 - 42 - inc edx6 X& l! u$ g1 n3 x/ q" C
- 004011C5
复制代码
0 \# p) ?! V3 L q
2 H; _7 G/ c5 {) U该地方的伪代码
7 _9 [, k/ N$ V4 y( L5 _- void __thiscall sub_401160(char **this, const char *a2)
# J; n( N* C. h4 P* h ]7 c3 E, ~ - {
( L; G! A% y; i8 l/ o: A. e - char **v2; // esi! w" q2 \, {9 r. F& t8 G7 s' m
- char *v3; // eax
& y8 C0 v0 o8 T. K, ` - char *v4; // eax0 a0 Q' K( _, I1 h* y1 k% j/ n& Q
1 n- B' P, S7 C+ ^7 J J- v2 = this;
# U0 F9 _7 M# R% v/ l8 I% q9 P - if ( a2 )2 U' z( T& I/ q
- {* B! O, H# A e( a
- v3 = *this;1 P3 ?. [) C' j- j! Z
- if ( a2 != *this )
7 L9 O( p) J6 m' a9 D/ W - {* L; k2 |; x/ S: E3 i
- if ( *a2 )2 P& J8 n' z. l/ C5 t1 g9 h
- {% E" q$ C/ }+ z' M" T5 @4 w
- sub_401030(strlen(a2));5 @- Z; C n. l/ l8 l
- strcpy(*v2, a2);
# g+ t4 I% V, I9 { - }
/ t& \7 R. ]4 Z4 ]5 j: G& W& s - else( }) o7 _2 K' [- i( b
- {; W, {1 g0 j1 @6 H! y2 h
- this[1] = (char *)1;
/ B. O A, w V" O - if ( v3 ). t# `4 n) d$ Z$ N
- operator delete[](v3);4 Q% i( \' ^6 X2 R6 M4 C8 c M0 ^8 c
- v4 = (char *)operator new(6u);
8 O$ T/ z7 P# @" X - *v2 = v4;
$ D: j* N9 B) i; L# R/ } - *(_DWORD *)v4 = 0;6 C7 \$ E8 } u3 Q
- }
5 {1 |/ n4 n! I8 _4 X% Q - }& p! _8 D- c8 Y/ H
- }
[) B/ } k% M& ~ - }
复制代码 1 P! C: d' s/ P* u+ d4 w* Y. R {: J
汇编代码2 q1 D& T8 k) N/ Q$ p
- .text:004010F0- n; W, t4 b4 W# X+ _0 W7 z
- .text:004010F0 ; =============== S U B R O U T I N E =======================================
0 H: T/ N2 [' w% y4 z( H - .text:004010F0
1 [% y/ }: t2 l6 D q9 n! a - .text:004010F0
/ X; P% M) _$ T( r" Z( W - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p3 b8 j; \; @1 H+ V/ x) V
- .text:004010F0 ; sub_403240+97E↓p ...6 [0 F, D( c5 c
- .text:004010F0( U& e% _; @( N5 C# q
- .text:004010F0 arg_0 = dword ptr 4( H2 K0 w7 N: o1 E: x( v1 h5 A
- .text:004010F0
0 Y6 v9 m& E1 b, ?7 X - .text:004010F0 mov eax, [ecx]
& ?, ]; t$ ^3 A- ~ _7 T6 U; G - .text:004010F2 test eax, eax
: W0 t$ u' j' k2 z8 D3 | - .text:004010F4 mov edx, [esp+arg_0]
7 J0 c8 S$ h; V# @$ C8 c6 I3 p; { - .text:004010F8 jz short loc_401147) M7 g2 T3 A" `6 q# m, I
- .text:004010FA test edx, edx
0 x# {+ h+ ]/ s, U4 x - .text:004010FC jz short loc_4011470 F, P" Z8 b8 D7 H0 x# q1 g$ ~/ G
- .text:004010FE mov cl, [eax]/ ]0 j4 J7 X& t2 }
- .text:00401100 test cl, cl& U n& T/ c, z, f0 |
- .text:00401102 jnz short loc_401116* r9 |! r3 E) e* K( ^
- .text:00401104 cmp byte ptr [edx], 0
4 _* z1 d- V; |# i4 z6 m; _ - .text:00401107 setz al% Q- ]) R- f& c& K2 R/ p
- .text:0040110A xor edx, edx
+ Y! ^' [2 J" S* W - .text:0040110C test al, al
+ C- v/ y9 t0 r( w V* N - .text:0040110E setz dl" d" c1 m% O# t$ T. j& J& w
- .text:00401111 mov al, dl
" v( e" ]) p3 M5 q3 O1 U+ e4 O - .text:00401113 retn 40 G" h$ P1 B7 Q6 }
- .text:00401116 ; ---------------------------------------------------------------------------
4 t. F; b2 }6 q3 }( j* k - .text:00401116" U8 o( d t7 b& }( j
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
( k# t" A0 p6 i1 ^/ K { - .text:00401116 cmp byte ptr [edx], 0
3 E# I+ @; x/ R0 \1 U' W8 A' F+ t - .text:00401119 jz short loc_401147
1 o$ ^& M8 h% R& V0 b - .text:0040111B jmp short loc_401120
, B3 Q7 _) c/ R7 n7 E5 ]5 y - .text:0040111B ; ---------------------------------------------------------------------------) Y N; e# G5 j- c$ J& H
- .text:0040111D align 10h
; n) J, w9 _9 W$ ]! H, O - .text:00401120) Q; \+ T5 v% B, F% w
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j4 A$ p1 h/ u. S4 q9 c2 \ j) T
- .text:00401120 ; sub_4010F0+3B↓j
+ i/ f8 D4 E+ U( D! j# m - .text:00401120 cmp cl, [edx], l5 Y5 Y6 p" O5 x5 D9 k
- .text:00401122 jnz short loc_40112D. S5 X3 ?+ G, n( Z) [. k9 O
- .text:00401124 mov cl, [eax+1]
; c2 R1 c+ N) Z0 D! ?" T - .text:00401127 inc eax$ v) s! _- O: _& V8 e3 f+ R8 d
- .text:00401128 inc edx3 O( L# ^$ u4 R9 _- i' v/ [
- .text:00401129 test cl, cl& J/ n' ?! ^, y- o$ f* n* V
- .text:0040112B jnz short loc_4011206 T$ \. u% Z- E2 V; R$ [
- .text:0040112D
6 \+ I( W2 m) P: C0 z- o* { - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
* U! `6 n- P1 ?: W) t9 c - .text:0040112D movzx eax, byte ptr [eax]
' H8 p% Y# N7 X, Q$ P+ J - .text:00401130 movzx ecx, byte ptr [edx]
: V# l2 h7 t/ L, n& O - .text:00401133 sub eax, ecx
" L8 |8 K) u8 I: g0 u2 ? - .text:00401135 neg eax; [% l; {/ Q, i
- .text:00401137 sbb al, al
3 e( E1 q) B: j1 e# O* ` - .text:00401139 inc al3 V5 g5 w& w L# Y% D$ f( \
- .text:0040113B xor edx, edx
+ Z% j, K* p; `3 u: @ - .text:0040113D test al, al
/ X! r9 w: q7 E: h2 w- u" _ - .text:0040113F setz dl1 S% `# q, |( h7 t
- .text:00401142 mov al, dl7 Y0 w# K6 S2 c9 K% m
- .text:00401144 retn 4- d$ ?5 E* C/ {' b/ g9 R
- .text:00401147 ; ---------------------------------------------------------------------------% u8 W$ p0 n$ L0 x5 W- g. `& P
- .text:00401147. V, m8 X J6 T9 c
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
, [2 j; @. R, r4 N - .text:00401147 ; sub_4010F0+C↑j ...
. F( e. }5 K: _' n! {# d - .text:00401147 xor al, al- l, N. n- |! e. B
- .text:00401149 xor edx, edx
, Z# _9 [+ J" `2 [4 \' C! ~$ D - .text:0040114B test al, al% I( a5 i! Z) j/ }
- .text:0040114D setz dl
: G$ T8 T0 F+ b$ ]5 J& d - .text:00401150 mov al, dl
; p0 [; b2 T5 q7 [; b - .text:00401152 retn 45 v$ Q; l9 E" }+ K5 r7 s1 W3 C2 w
- .text:00401152 sub_4010F0 endp
/ { [3 l6 O- Z - .text:00401152( q/ z) _, F( o/ H, L
- .text:00401152 ; ---------------------------------------------------------------------------0 i9 c( n4 B7 k' J& }. |* i; ^$ u
- .text:00401155 align 10h+ M! J/ p" ], v1 e8 h, ~/ q+ ?- g
- .text:00401160+ u# E$ S. ?, }; r
- .text:00401160 ; =============== S U B R O U T I N E =======================================6 Q2 D, B$ |- k% O# a! X
- .text:00401160" R( P5 Y0 P+ W8 U6 p7 N6 U5 c- q
- .text:00401160
" I" F9 ?! o4 x; y9 T( k - .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p
% y/ w# F$ k" {$ g5 h e2 ` - .text:00401160 ; sub_4013F0+C↓p ...
) `& F8 j+ Q" K. d% C) d - .text:004011609 `% C. r5 U9 y' G6 C$ J0 P! g4 @
- .text:00401160 arg_0 = dword ptr 47 T X+ e, I3 W! }
- .text:00401160
4 F. ^5 e' ?4 A& u' n- R - .text:00401160 push esi: \6 J3 y( g9 P/ T6 x* {, n
- .text:00401161 push edi& a& x! d5 B M" p% Y- C$ H
- .text:00401162 mov edi, [esp+8+arg_0]: [, B9 r+ E6 ?( p) M, q
- .text:00401166 test edi, edi
1 E% l# Z6 A+ M# d - .text:00401168 mov esi, ecx8 S0 @8 k! ?+ G2 M. [8 C
- .text:0040116A jz short loc_4011CA! Y; {% P; w1 I9 |1 I5 k
- .text:0040116C mov eax, [esi]& r; b. U1 I: `( ~+ H
- .text:0040116E cmp edi, eax. [) \+ V: @5 P+ ^ }
- .text:00401170 jz short loc_4011CA) x& [3 [9 v+ H! \$ I
- .text:00401172 cmp byte ptr [edi], 0
! n9 D6 }( r4 h; T! I - .text:00401175 jnz short loc_4011A2
* U" F/ h: Z4 x9 E$ g - .text:00401177 test eax, eax' J1 R, e+ d% X" J7 `4 U
- .text:00401179 mov dword ptr [esi+4], 1% d0 z6 K' G M2 Z, [
- .text:00401180 jz short loc_40118B
D) ]# M( l, z% Y7 O - .text:00401182 push eax ; void *
8 g3 T4 u7 \3 ~1 l - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *); F# v/ j) b6 [! }5 O( h+ ?6 t
- .text:00401188 add esp, 4: ^* Z0 ~ ]/ V3 ^7 A1 {
- .text:0040118B
' M) k8 t2 i6 X, T ~5 {4 x - .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j- t7 b: j. E, q9 r& X
- .text:0040118B push 6 ; Size g; Z! h1 A. y2 j! \9 m
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint)
7 l$ Q0 t5 r d3 N+ r# M - .text:00401192 add esp, 4
( U6 v$ v) P9 u% e - .text:00401195 mov [esi], eax
3 c% L, a* m# O' o - .text:00401197 pop edi. V/ ^) k+ p, Y. T; S
- .text:00401198 mov dword ptr [eax], 01 V+ _! D8 p" ?& P: f$ m4 e) n
- .text:0040119E pop esi/ ?) c( z" S% B1 m( c
- .text:0040119F retn 4/ d4 h5 l5 s5 ~1 J
- .text:004011A2 ; ---------------------------------------------------------------------------
$ c- ~* v8 ]. T+ I% ~5 r, G; k# a - .text:004011A2
4 q) \0 n7 E6 K6 T" f, @ - .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
* O- ]/ \' ?4 x4 t% U! P# c- w* ?+ t - .text:004011A2 mov eax, edi3 N% D1 i& } K& O* `: d F
- .text:004011A4 lea edx, [eax+1]8 N' C6 ]; c5 R' v- `
- .text:004011A7
. X" I2 a+ F) s# C7 M - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j9 g+ i, t; }# L5 C s% i/ ^- i
- .text:004011A7 mov cl, [eax]
! f' |. v: W! |% |: i, R* M( S3 N) q - .text:004011A9 inc eax2 O/ O K" t# H, r
- .text:004011AA test cl, cl
1 }$ y8 A1 M% L9 ~5 H" w" U/ z - .text:004011AC jnz short loc_4011A72 i& b" }! n4 o2 W. t
- .text:004011AE sub eax, edx, _1 Q! t1 l3 M$ ^4 B# x
- .text:004011B0 push eax
2 q" Q9 i7 x/ j A# } - .text:004011B1 mov ecx, esi6 B; P* V+ k; y' E4 }
- .text:004011B3 call sub_401030
7 N8 H* C% l1 D( Q, t - .text:004011B8 mov edx, [esi]/ j1 f: w; f( j0 a7 _! Q
- .text:004011BA mov ecx, edi/ C Z7 ^/ b: N$ D& ^
- .text:004011BC lea esp, [esp+0]
: G7 T, {% M7 c( h! I - .text:004011C0( K2 L7 Z% M. h# P1 [
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j, g v, z# h! D* H: j4 r
- .text:004011C0 mov al, [ecx]3 j1 R% A9 Q) q6 a+ ]
- .text:004011C2 inc ecx
+ n# g) Z7 m, S. {; N a- `' [( A - .text:004011C3 mov [edx], al
% O! Q" P4 {% p - .text:004011C5 inc edx/ q) C; p" l* G2 v
- .text:004011C6 test al, al
' d3 W1 X! t |+ @& X" X - .text:004011C8 jnz short loc_4011C0- J( }1 D: Y; H" U, w& ^0 I' ?
- .text:004011CA" c1 n1 ~7 Q/ M3 g) }
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j; W4 ?2 r( [) Q8 `4 b
- .text:004011CA ; sub_401160+10↑j I" k! L& `+ J5 V7 @, }9 s
- .text:004011CA pop edi
$ A. l7 G. E+ S - .text:004011CB pop esi
' g6 r: ]( O: X, j% T. g - .text:004011CC retn 4
* ^& M1 h2 ^4 z5 d - .text:004011CC sub_401160 endp/ y: e: a9 ?2 d9 \& K
- .text:004011CC
- l3 I; A9 B# ?/ p( n - .text:004011CC ; ---------------------------------------------------------------------------
复制代码 c6 R. k* P4 e, t2 `& C( F
+ v: u) I4 `$ ]9 |: _/ h; Y
: x9 m+ Z! k, x& o |