本帖最后由 shane007 于 2023-8-27 13:23 编辑
4 t+ N5 x+ o. t- x. V4 i' s+ `9 O
2 @. K9 ~. S, u- A& g8 n本游戏采用了CEGUI,该组件能采用directx和opengl。
`2 P- f1 t. n" f% k# I- r经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
. h* ?# o" O3 g6 Z游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。
5 X8 Q1 n& t7 W1 C(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)$ T/ g& ~7 ?3 K# w/ [( [! K
; {# Y* Q% Y& M6 d6 F1 D8 Q( k
+ d- p0 B! L, X在游戏中找一个字幕,在以下地方断下。5 `' `1 |) B" k1 w' d+ U
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),
* d8 @- c; z: ~1 g因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
- G9 I0 Y5 U7 |* e+ H
- o8 ~, C0 w& q0 d; K4 b4 L- NextLife.exe+11C5 - 42 - inc edx: s. _8 S: t- P* D Z
- 004011C5
复制代码 0 z, t) p _( E; v/ j1 z
6 Q3 Q* E$ P1 g. O. r该地方的伪代码
+ p( X, O& S0 A J( m! ~- void __thiscall sub_401160(char **this, const char *a2)* `% E `' k, o
- {; m) B; V+ Q) v6 o6 o
- char **v2; // esi3 Y) G: ?0 M+ G. F$ E! e
- char *v3; // eax n' I% D( X! t
- char *v4; // eax
5 l: \! i3 c! O- n8 D. o' D
5 E9 u1 h8 F8 ^, f/ n, i3 x% Y& k- v2 = this;
/ V* U1 z p: N2 \' Q2 B6 {& @! r - if ( a2 )
& T2 }! s- G$ m# @" V0 J - {( C3 }, D& M! T( w" ^& s- Z6 r) l
- v3 = *this;9 r) z ^# D1 V, I3 Q
- if ( a2 != *this )8 m7 W# v/ s. g- N
- {6 |3 r$ C, F# R! X' |8 D6 }
- if ( *a2 )) Y0 Z0 m' n8 \, R4 _. m
- {! t0 a h2 F8 m* J" o
- sub_401030(strlen(a2));
4 B: A5 C4 {* l! r - strcpy(*v2, a2);
* j& a8 ]( N c6 v - }# w& ?; B& D9 _3 Z# R
- else
( c, N0 }8 }/ k+ D - {$ m9 v3 D( K& o
- this[1] = (char *)1;
1 i& Z; _% }6 m1 p# j- [ - if ( v3 )0 x6 T6 Q- \. k( X$ ?1 @, `5 g! ~" {
- operator delete[](v3); x) L; E3 ]+ @, G
- v4 = (char *)operator new(6u);
+ C4 |- c7 R. r" [ - *v2 = v4;
9 i9 Z0 I" O% z5 P M# z$ U8 T - *(_DWORD *)v4 = 0;
0 o! B) K( h: f0 s - }
6 j3 \# a" W4 |4 w$ P" L" V# ? - }
% e! {. @& z4 }; l - }+ j! }* J& F4 | \( _
- }
复制代码
5 Z" G9 A6 a/ q4 J4 Z3 M汇编代码
, b% A# M1 X# l9 t- .text:004010F0
. S9 a# V' b! @3 g+ @7 i* Z6 D* ]. v$ L - .text:004010F0 ; =============== S U B R O U T I N E =======================================# U2 o: c1 c% m, \
- .text:004010F0! X. R# I; G l* N8 S/ z
- .text:004010F0
6 g4 {- P7 T% G( f4 S* d - .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p' C' w/ [3 f$ D$ L
- .text:004010F0 ; sub_403240+97E↓p ...- n' l: o+ f1 ^5 g- b/ F
- .text:004010F01 `" o+ C* a2 x
- .text:004010F0 arg_0 = dword ptr 4( _4 J$ z, P, L- L0 \! @" L- S8 x
- .text:004010F0
2 W" W8 c+ q! v$ O9 Q- U9 S7 E4 v) U - .text:004010F0 mov eax, [ecx]6 j$ @! a3 z2 p& g
- .text:004010F2 test eax, eax+ J( O' \$ ^! D$ u) o3 R. S$ a# s
- .text:004010F4 mov edx, [esp+arg_0]8 T, A+ p/ U x# r8 f& \9 d2 c
- .text:004010F8 jz short loc_4011477 b/ D( L3 s& L1 x, b
- .text:004010FA test edx, edx; p% q7 J2 C. S& \: l. n2 g
- .text:004010FC jz short loc_401147
, c9 k) c% ?/ s) s5 \9 C - .text:004010FE mov cl, [eax]
1 ~7 J- v" ?' A - .text:00401100 test cl, cl/ r: e7 q; P! M6 C$ l3 ]9 G
- .text:00401102 jnz short loc_401116# v/ l) X/ F) [+ b: \' s7 ~, @
- .text:00401104 cmp byte ptr [edx], 0
" j' ^4 H+ L" r- I - .text:00401107 setz al
- k7 j! \- i1 S( k: p - .text:0040110A xor edx, edx, F6 u& R2 H! @+ _, [
- .text:0040110C test al, al, S1 s" F2 r) U3 l' @; J5 |1 T1 o6 Q
- .text:0040110E setz dl
3 G. {+ b% N5 W, X/ {3 U6 J! w - .text:00401111 mov al, dl
+ o( V" m. w7 y: C5 K* j - .text:00401113 retn 4$ Z5 i( [/ T, ?1 T) o+ w
- .text:00401116 ; ---------------------------------------------------------------------------
* L% J* X! `( V - .text:00401116* L# M) Q( `6 u0 H4 V7 J3 k+ [ z
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j; F$ }3 m- f( t9 [
- .text:00401116 cmp byte ptr [edx], 08 c9 u3 Y d+ s, F0 K
- .text:00401119 jz short loc_4011474 ?1 B. W: u4 Q. @% B$ [
- .text:0040111B jmp short loc_4011200 P/ s9 w" M f" |8 s0 ^
- .text:0040111B ; ---------------------------------------------------------------------------/ S2 ]6 y- k- [6 n
- .text:0040111D align 10h; p& k& q0 W ?. E
- .text:00401120
7 \+ p- Y$ A) y' i/ p6 X" G - .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j: q$ v' f* Q; ~) m' H/ l
- .text:00401120 ; sub_4010F0+3B↓j
: ~6 j; x e8 s. l - .text:00401120 cmp cl, [edx]
: H: L+ u+ P9 v+ G& V - .text:00401122 jnz short loc_40112D1 f: r4 q0 ?" G3 U
- .text:00401124 mov cl, [eax+1]# w' @$ L+ N8 {5 ^$ a
- .text:00401127 inc eax
& X. s" x" Y) a- u$ \ - .text:00401128 inc edx
) d$ {" I% q- ~3 q - .text:00401129 test cl, cl
/ f# `) |7 K9 I' o" @5 l( J - .text:0040112B jnz short loc_401120; j j- S2 o6 k6 `+ f/ }
- .text:0040112D
" { b9 q' N z9 l - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j+ T& a% ^9 y* \; H8 v& `* b
- .text:0040112D movzx eax, byte ptr [eax]! o4 A. V, c Y: O' b, ^! X" q1 A
- .text:00401130 movzx ecx, byte ptr [edx]
& Y0 N0 U$ `# ]3 Z7 Q) t$ U0 s5 N: ? - .text:00401133 sub eax, ecx
% X( J# g( z% P# } - .text:00401135 neg eax8 |8 A Q: O' i5 D% @7 m3 x8 Z' k; g
- .text:00401137 sbb al, al
1 l( ?7 w9 a) h7 u# n% G7 |0 O+ | - .text:00401139 inc al
F! }# w: d8 j; k% E3 I9 `/ k7 x - .text:0040113B xor edx, edx* Y `0 Q' Y( \; D
- .text:0040113D test al, al
; `0 ?3 ?) f# G7 {7 O - .text:0040113F setz dl) P. W8 I+ S! ], K6 m) G/ y/ p
- .text:00401142 mov al, dl$ _0 N. S5 ?! s3 P2 g
- .text:00401144 retn 4
$ p+ y0 ]" q9 d: z x; A* ^ - .text:00401147 ; ---------------------------------------------------------------------------
6 t% ] F7 C1 l. k - .text:00401147
?& `+ Y T( b& ]6 D5 S @ - .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
h1 ]' y1 T$ a - .text:00401147 ; sub_4010F0+C↑j ...
v8 j$ q7 ^ I2 P - .text:00401147 xor al, al
0 |" Q5 z, n9 C% H# N; d# h - .text:00401149 xor edx, edx
( ]7 U0 x8 B, p4 P( H& }6 | - .text:0040114B test al, al
/ t) ]5 e& T( t% Q: Z# B; D - .text:0040114D setz dl' j! x# Y7 T0 [ u4 e/ v7 D) d
- .text:00401150 mov al, dl
# u+ g: h. I0 X/ h- K: @ - .text:00401152 retn 4) Z+ i J" O, y- \
- .text:00401152 sub_4010F0 endp
) P% F" j% s0 i* S9 _2 J6 x" H - .text:00401152
) D& B, Z% l4 B+ s4 D - .text:00401152 ; ---------------------------------------------------------------------------
p4 P$ v/ [ L$ Z6 o - .text:00401155 align 10h' P) j5 H* k6 j8 A. q* J5 p) M
- .text:00401160
/ C& e5 K- b5 Q: j; J - .text:00401160 ; =============== S U B R O U T I N E =======================================. ?1 N2 E* r& r5 m4 [
- .text:00401160
; s: M6 o x* W5 S* }' v; e: P - .text:00401160
) N, ~: ~3 k3 B; c O' F' G& g - .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p: R" J4 }2 l: |3 b" f
- .text:00401160 ; sub_4013F0+C↓p ...
0 e6 y7 E8 @- J( P - .text:00401160
3 |( ?, a' `* x* r: A% Z - .text:00401160 arg_0 = dword ptr 46 n: k) s% I( y6 v }1 a. }! x9 c* S
- .text:00401160: A* I% L. k) o/ ^) m; I
- .text:00401160 push esi6 [8 u1 o ~: {/ V7 K9 i: P
- .text:00401161 push edi
- {1 \) h4 o! P/ W6 l1 T - .text:00401162 mov edi, [esp+8+arg_0]. Y! \' b8 j# t- Y c) U
- .text:00401166 test edi, edi) C$ k' T6 M! ~: I
- .text:00401168 mov esi, ecx
) s) a' U0 ]6 x( s+ p" W+ [ - .text:0040116A jz short loc_4011CA
9 K' E4 v% p$ k" ~' w2 {% |- n# T - .text:0040116C mov eax, [esi]) c6 k& J: u/ A; ?9 X
- .text:0040116E cmp edi, eax+ e* B. t7 y. v! w! P
- .text:00401170 jz short loc_4011CA7 R! t2 _) q8 k6 c/ P: i3 f8 |
- .text:00401172 cmp byte ptr [edi], 0
8 k7 B z& b- D' y- \$ i9 ~0 v - .text:00401175 jnz short loc_4011A28 s, s. Q/ p! p. X% l9 U: |# D
- .text:00401177 test eax, eax
7 A9 ?5 E- t& O% F$ X! u - .text:00401179 mov dword ptr [esi+4], 1
9 u( b$ R! [) N. V8 z- s4 N' @, K - .text:00401180 jz short loc_40118B
1 l ?: s7 ]# Z4 j5 m& I - .text:00401182 push eax ; void *
' L: h# f! O5 U( F0 Y( ` - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
: E6 X6 C+ x: ^$ `' Z0 i3 [ - .text:00401188 add esp, 4
0 l& \: g" s; M% ^6 @/ W& B1 N - .text:0040118B: n H! h5 g) j2 C4 n. I2 J; \5 l
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
* g% K7 e; T, e6 }& o - .text:0040118B push 6 ; Size4 n/ }9 W6 z: A
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint): o8 R' q: `( e& a' `" ^
- .text:00401192 add esp, 4: z1 p9 Y9 u3 c% h2 R9 ~
- .text:00401195 mov [esi], eax& z- E! k/ t# ^1 N/ ~9 D- N; }
- .text:00401197 pop edi
8 U k, u! ]( [/ C: n - .text:00401198 mov dword ptr [eax], 0
, v* H7 ]* j$ F! P; r - .text:0040119E pop esi3 R/ d8 M; g/ q6 N! ]
- .text:0040119F retn 4% ]9 G5 h) a( {
- .text:004011A2 ; ---------------------------------------------------------------------------
! G2 d9 ?" C( a - .text:004011A21 C5 ]& ?: I* M' W* D
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
) U0 b% l7 ~! p- G - .text:004011A2 mov eax, edi, N0 C) ~ i/ @ f. H
- .text:004011A4 lea edx, [eax+1]$ \- Z; R& K) ^8 E6 @ U! N
- .text:004011A7
* Q/ `- v% X. K/ t - .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
* h# R5 g' G7 d - .text:004011A7 mov cl, [eax]
: q3 H6 x" K1 U$ l( U) ]8 u - .text:004011A9 inc eax
7 l+ }! [" K; T( V) D - .text:004011AA test cl, cl
. ]6 D, Z/ l1 M; _6 }+ r' o0 }% q - .text:004011AC jnz short loc_4011A7( u4 F" R7 V7 E6 |; E B
- .text:004011AE sub eax, edx1 }4 Y9 z. O7 k* k ^" z7 u
- .text:004011B0 push eax: K0 x9 W2 b5 m0 w* h) [
- .text:004011B1 mov ecx, esi
) G# A3 u8 |' v( z6 O3 H& a5 B4 i - .text:004011B3 call sub_401030( ~- I3 @7 S# b5 _+ |/ y
- .text:004011B8 mov edx, [esi]
% o6 Z z; A( ?8 W3 g - .text:004011BA mov ecx, edi
8 m6 Z$ J, G0 y - .text:004011BC lea esp, [esp+0]. R( m# m8 }! P) U* p' O! d
- .text:004011C0# Y; b2 B: ^* p, g/ s
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
* V) ?" S! q2 y3 h - .text:004011C0 mov al, [ecx]; n F% L. w! b1 r+ c) S- H
- .text:004011C2 inc ecx
0 C0 u0 c3 u$ x/ T8 X R6 Q2 r - .text:004011C3 mov [edx], al
. Y! ]* `) }) Q- ^; x - .text:004011C5 inc edx3 L. r* Q3 U$ v1 K. s; Q3 ]. J
- .text:004011C6 test al, al% u, m8 g* f* E* U/ e
- .text:004011C8 jnz short loc_4011C0
* S: H; r& H9 k4 N6 }1 { - .text:004011CA
* T* F: @8 G7 L! M3 a - .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j" Z& z, Y6 g4 G: a
- .text:004011CA ; sub_401160+10↑j0 U% V, K, ^& V
- .text:004011CA pop edi
* i# T# j4 r U/ s, N - .text:004011CB pop esi) S* }1 V: a+ ]/ ` A: I
- .text:004011CC retn 4' [) B" H' l, t$ N
- .text:004011CC sub_401160 endp- |8 S" J9 T4 u: s! r. o1 v
- .text:004011CC1 A; @ w% F! ?
- .text:004011CC ; ---------------------------------------------------------------------------
复制代码
, k5 R& `' j( ]) w) ]
' r y- s+ G7 Q9 g) F) B
% |4 E) a1 `5 |% w8 O$ ]4 N; n# N$ \ |