本帖最后由 shane007 于 2023-8-27 13:23 编辑 / b; L/ b+ `; h* _" K0 {( x& h) _
2 G' m, J! }: O& y. M! \本游戏采用了CEGUI,该组件能采用directx和opengl。
, @: \, u. f4 k/ I: @经过我的小方块测试,游戏屏幕显示了小方块,因此确认是directx9的游戏。
5 _6 O3 W& b/ G7 a, |游戏自带一个EngineSetup.exe程序,设置为窗口模式后就能用cheatengine调式。2 n# h& r& u1 R* Z& x2 O
(由于游戏窗口较大,我将游戏屏幕和cheatengine分别显示到2个显示器上即可。)
8 p) B+ D# U! r* x+ [2 u" t, O5 D" {* X/ D7 X# f$ H
# g4 y- F7 B4 F& w6 d" K M在游戏中找一个字幕,在以下地方断下。! M S$ i$ F3 B9 f
由于该游戏基本都是显示在屏幕固定位置(上或者下,居中),6 k, U) i! a: }( T4 S( F
因此暂时认为此处就是游戏的字幕函数,该函数被20处左右地方调用。
2 c7 [* j$ l; {! p* }
1 F1 p* J+ J2 f, D* V. Q- NextLife.exe+11C5 - 42 - inc edx! P3 m! z: }% M2 G9 \5 r3 J
- 004011C5
复制代码 6 d, _1 L1 `( I0 {
$ ?" V9 Y; _/ j! c4 B7 s该地方的伪代码
: G/ P. U7 H% F" P) } G& o- void __thiscall sub_401160(char **this, const char *a2)( `% ~6 N0 E+ ^3 x) E$ W' {
- {
$ }) Y8 }8 i- |7 y/ w' O0 Y7 C - char **v2; // esi! t' L1 c/ \; H
- char *v3; // eax2 E5 z3 S. A8 g
- char *v4; // eax9 j7 O6 }2 ^3 U7 {5 M4 K L
' Q- o( B+ s8 a- v2 = this;
# I# C& x) | j& e2 A& I% X - if ( a2 )1 m' ]( D! u1 t v# p; C0 L
- {
; Q7 Q* s& G* N) \3 o - v3 = *this;: `( x% y8 K# Z# ~; \5 z
- if ( a2 != *this ) F7 M' w" ^6 j7 x/ P
- {8 y `, q' c: l1 V" t% x6 E
- if ( *a2 ). F- C" i# c3 J" ], ?5 ]8 l
- {) d' o: ~$ L/ J
- sub_401030(strlen(a2));' P# J7 u2 V Q
- strcpy(*v2, a2);
5 V2 m2 _- x2 c& f, u) u, i, u - }. H: O6 h0 X* n+ V
- else
; ]9 @. H$ c% d& x! M - {- e$ c4 x; S2 o4 @: ?/ Z; ]
- this[1] = (char *)1;+ v+ U" Y2 |* J/ m* M! S4 M
- if ( v3 )! ?& e% Q7 h% D: O
- operator delete[](v3);! w. e3 }! T( ?5 _4 h' J
- v4 = (char *)operator new(6u);' k/ Z! r- {' O# u. z
- *v2 = v4;/ v' }1 Y& |# z' J5 }8 R8 V
- *(_DWORD *)v4 = 0;
' J/ \8 [7 X2 k - }
5 W. ], e4 ~7 {9 h! W - }
2 s5 B0 y- ], {' r3 I - }4 u3 d9 Z1 h: R2 ^
- }
复制代码 4 w$ k6 u4 S4 d6 B6 ^: @4 y& z
汇编代码
) j' }# D1 h5 }+ O- .text:004010F0+ ?2 u# E# X8 @9 L# y
- .text:004010F0 ; =============== S U B R O U T I N E =======================================$ z; w, j' T& W9 {: u
- .text:004010F0
/ Y% X1 ]- s9 e( q0 r4 I - .text:004010F0+ D8 f3 x1 G( b# d0 [7 ^5 e/ R
- .text:004010F0 sub_4010F0 proc near ; CODE XREF: _main+139↓p; S# ] {7 o9 G% j4 ^/ \
- .text:004010F0 ; sub_403240+97E↓p ...
4 x7 v( ^+ f: `: {0 z - .text:004010F0! q6 l; m3 K( H+ m
- .text:004010F0 arg_0 = dword ptr 4
6 ]+ ]( T2 l1 e6 T0 j1 F, A - .text:004010F0" L/ f4 \0 p+ U" }* q. Z
- .text:004010F0 mov eax, [ecx]& [" g* ~' i; A4 L
- .text:004010F2 test eax, eax
$ M( P+ h/ K+ B' M9 L5 l7 l/ M6 K - .text:004010F4 mov edx, [esp+arg_0]
& {6 w/ Z# j2 _$ t& o3 c& Y2 t - .text:004010F8 jz short loc_401147 T* N( J- K( C3 K4 f
- .text:004010FA test edx, edx! h4 \* w; J9 o
- .text:004010FC jz short loc_401147' \# x4 b& D$ L
- .text:004010FE mov cl, [eax]
# G1 e; b% W" n8 c. G i - .text:00401100 test cl, cl) Q$ T+ D. k& n2 b
- .text:00401102 jnz short loc_401116
# i6 s; Q4 y E ]9 C" g7 ]8 D; l) H - .text:00401104 cmp byte ptr [edx], 00 t# o6 Y4 n2 Q+ [
- .text:00401107 setz al& _* _$ i/ {+ T
- .text:0040110A xor edx, edx! t, ^6 N: I1 Z8 n- O+ ^4 ~* q
- .text:0040110C test al, al
/ Y$ c" B/ b- P; d: o% x - .text:0040110E setz dl
( X! c% w8 O* b* H. n: N - .text:00401111 mov al, dl
8 }* s s8 }' _4 U* P) U4 X - .text:00401113 retn 4* w3 v6 a1 S; Z7 T3 L; K
- .text:00401116 ; ---------------------------------------------------------------------------2 c/ s% P1 e2 q$ G$ r
- .text:004011166 i; K A: X+ y7 u, W% T; x: q2 {* h
- .text:00401116 loc_401116: ; CODE XREF: sub_4010F0+12↑j
+ j8 C3 j5 y* J! O/ ~6 z - .text:00401116 cmp byte ptr [edx], 0. w; G& t3 X: ^# e
- .text:00401119 jz short loc_401147
9 X/ z3 Q3 P% @% S0 F$ O# ] - .text:0040111B jmp short loc_401120
% j! P5 z% @) J7 {& f2 z% y$ B - .text:0040111B ; ---------------------------------------------------------------------------9 w _. Y: C" I Z2 y: O, w
- .text:0040111D align 10h+ c f8 b) V4 u/ K* S) T. U
- .text:00401120$ M, o4 H3 L* [& k+ \1 a# S1 X
- .text:00401120 loc_401120: ; CODE XREF: sub_4010F0+2B↑j: U3 y4 b K# J% h4 Y( @" c$ J
- .text:00401120 ; sub_4010F0+3B↓j4 n" T( D- c0 z0 J C* J4 y- G. A) @
- .text:00401120 cmp cl, [edx] Z! m) D, l$ z z+ y1 k1 F: V7 T
- .text:00401122 jnz short loc_40112D! y- I, c, g5 Z! T9 D3 ~
- .text:00401124 mov cl, [eax+1]2 Q4 l% _% c ]2 D! z
- .text:00401127 inc eax, h) j. b1 ?! Q% Z. m- @0 K2 m& e
- .text:00401128 inc edx# c! T+ v( ^* u
- .text:00401129 test cl, cl
5 K. ^; R% V+ b7 q5 N - .text:0040112B jnz short loc_4011208 A" L9 Y% \0 ]9 I0 m8 v
- .text:0040112D
+ H7 I: n6 B2 y8 z - .text:0040112D loc_40112D: ; CODE XREF: sub_4010F0+32↑j
+ [3 o J$ R8 {4 v4 c& r2 H# U4 ~& B! I - .text:0040112D movzx eax, byte ptr [eax]+ O$ U* L! D. ^
- .text:00401130 movzx ecx, byte ptr [edx]4 E: o+ @ [. x7 |, _
- .text:00401133 sub eax, ecx
8 c5 `9 j4 y: J! ] - .text:00401135 neg eax3 \7 I' u! t; \
- .text:00401137 sbb al, al
0 |6 k! r4 S- K& y - .text:00401139 inc al, m. g) I& M' w6 W- e
- .text:0040113B xor edx, edx2 |5 j" h! K- a- T7 j
- .text:0040113D test al, al! j3 o. H7 k+ |( _( W2 ~
- .text:0040113F setz dl
8 ~& W$ e0 H# \/ s9 i* R/ ~ - .text:00401142 mov al, dl3 H. B' D# M, r
- .text:00401144 retn 44 ~& C9 F1 H$ Z. p& E( A
- .text:00401147 ; ---------------------------------------------------------------------------
6 _ Q8 v" _- D0 T( D - .text:00401147. V2 b' w8 } g6 n
- .text:00401147 loc_401147: ; CODE XREF: sub_4010F0+8↑j
1 T' v3 Y2 v" }4 n5 E - .text:00401147 ; sub_4010F0+C↑j ...3 F O, b7 f) Z- h6 H# N
- .text:00401147 xor al, al
# ?1 j" M& N, D8 f+ x2 t - .text:00401149 xor edx, edx
$ w$ U# C. m6 D9 Q f9 f - .text:0040114B test al, al, S& p2 H: Y, _* V0 u
- .text:0040114D setz dl
* W9 W# b" i) O( V* O+ t - .text:00401150 mov al, dl
% t( B, Y( C3 |' |5 F3 x, o - .text:00401152 retn 4
$ i* s" Q, e; P& }0 M9 Y - .text:00401152 sub_4010F0 endp3 g: L4 F/ E& _
- .text:00401152
3 |. v' E2 C' q! D m - .text:00401152 ; ---------------------------------------------------------------------------
+ J& V, ~2 O" A S& p - .text:00401155 align 10h6 h4 t4 q& v \1 h
- .text:00401160) p$ o' W, `1 O' L
- .text:00401160 ; =============== S U B R O U T I N E =======================================% g9 C' u p. b1 B- J) b' O b
- .text:00401160
2 H3 f1 N. P5 ]0 q% r - .text:00401160- ?0 E- g9 {/ ]7 k& F
- .text:00401160 sub_401160 proc near ; CODE XREF: sub_4013D0+15↓p3 S0 J) Z, t9 d. |% i
- .text:00401160 ; sub_4013F0+C↓p ...: ^6 S3 @4 U, R* L8 x3 [, `
- .text:004011606 p4 P* W3 f+ l# { m3 C
- .text:00401160 arg_0 = dword ptr 4' z8 A0 u" ?- ~- n8 q- _+ L }0 @
- .text:00401160$ M$ T, @, e3 G* ~
- .text:00401160 push esi+ B' t2 T) b7 ~
- .text:00401161 push edi
/ v! z% M/ }& N5 H7 Q+ E/ h6 h: W - .text:00401162 mov edi, [esp+8+arg_0]
8 H! o7 T; \4 U9 q: ~ - .text:00401166 test edi, edi U% G: Y! p6 Y5 D& ]: X S
- .text:00401168 mov esi, ecx
9 J: ^$ W! c ~! T" t$ b: a v - .text:0040116A jz short loc_4011CA
) K+ I5 v7 R/ r; K - .text:0040116C mov eax, [esi]* u& i; a" c, V: ^, V
- .text:0040116E cmp edi, eax
! r. I0 a; M4 ?- P3 \ - .text:00401170 jz short loc_4011CA! A: F3 R5 l! y+ v! [: B2 a" M
- .text:00401172 cmp byte ptr [edi], 0
3 k; X6 A p1 j) ^. w; b - .text:00401175 jnz short loc_4011A2
" @4 M4 m8 O0 d5 l/ D4 z - .text:00401177 test eax, eax
% O$ [5 \2 M3 X3 m; q6 n - .text:00401179 mov dword ptr [esi+4], 1) Q$ F2 X4 V$ v7 y! j
- .text:00401180 jz short loc_40118B
& P3 p% ~, G) V0 ~. I - .text:00401182 push eax ; void *
, c- p: t2 P1 ~, G- Z( J# S - .text:00401183 call ??_V@YAXPAX@Z ; operator delete[](void *)
1 O [1 Y/ z7 h | - .text:00401188 add esp, 4
! a @& M6 O3 c3 a w( \ - .text:0040118B' x0 e8 M7 A) g) U9 J; O
- .text:0040118B loc_40118B: ; CODE XREF: sub_401160+20↑j
1 D) i) V2 e ^5 r1 ` - .text:0040118B push 6 ; Size) g% `- x' ?1 X( |& D# ~* Y
- .text:0040118D call j_??2@YAPAXI@Z ; operator new(uint); y2 Q* c4 \$ |8 e
- .text:00401192 add esp, 4; [" G. [0 n& @! t! t
- .text:00401195 mov [esi], eax
5 ~1 O! V) g3 L: \ - .text:00401197 pop edi
2 G t$ K+ z' ^$ {/ O' U - .text:00401198 mov dword ptr [eax], 0
. ^5 H/ ~$ r Q3 R6 [& p- e - .text:0040119E pop esi
: Q: U- k/ n! Z" Q7 q - .text:0040119F retn 4
( [9 H" W {/ o" m1 {: k- d - .text:004011A2 ; ---------------------------------------------------------------------------! X3 O! c" N) V7 X8 W
- .text:004011A2) J5 \! s: ]2 F% F
- .text:004011A2 loc_4011A2: ; CODE XREF: sub_401160+15↑j
( w6 x& ~" q$ r' `7 v: R; T" u b- ^& R - .text:004011A2 mov eax, edi
" k% u7 R- F# B7 T - .text:004011A4 lea edx, [eax+1]4 V& z2 |- A& N" F8 q# D
- .text:004011A7 n K' C; a# C& B# ~4 T
- .text:004011A7 loc_4011A7: ; CODE XREF: sub_401160+4C↓j
% a+ i @( \/ P, \ - .text:004011A7 mov cl, [eax]
( V1 G# x% |1 B9 W& h' K- ^ - .text:004011A9 inc eax) Y2 w( o1 d8 v I2 y& H: q
- .text:004011AA test cl, cl' K! \5 p0 f8 M' T
- .text:004011AC jnz short loc_4011A72 n6 X+ I& _; G* k3 K; Y
- .text:004011AE sub eax, edx; m+ n% D% X X, ^
- .text:004011B0 push eax2 O9 @% ^) w; U# g$ s
- .text:004011B1 mov ecx, esi
, a9 O% K0 ?" J- A9 y5 F- _7 O! W - .text:004011B3 call sub_401030; ~6 H# d! _% B" @3 F
- .text:004011B8 mov edx, [esi]
( L C: l3 }4 G+ e& w: S+ K! K) { u - .text:004011BA mov ecx, edi. i$ u' v+ w% V f6 r
- .text:004011BC lea esp, [esp+0]
5 g- R3 S5 t+ y; y0 n - .text:004011C06 M2 V/ L# U, s, d9 ~3 _2 C
- .text:004011C0 loc_4011C0: ; CODE XREF: sub_401160+68↓j
( ]% d+ V4 s6 I. U: q - .text:004011C0 mov al, [ecx]
0 A* s5 C( |* j# X7 [9 L! M7 j- q - .text:004011C2 inc ecx
; m* Q# p4 N4 n+ c' i2 D" X! L - .text:004011C3 mov [edx], al: [* w+ v! V2 y8 a! s5 i
- .text:004011C5 inc edx
+ L! ^9 w* u) S8 S$ E* f - .text:004011C6 test al, al4 t4 M# i/ v$ R: K8 W
- .text:004011C8 jnz short loc_4011C0! a& x4 i! X! q. m
- .text:004011CA2 e8 V5 d3 y; Y$ [4 z1 U/ d f
- .text:004011CA loc_4011CA: ; CODE XREF: sub_401160+A↑j
4 ?8 i6 L' g1 {1 @3 V; r - .text:004011CA ; sub_401160+10↑j4 o/ n( A+ G& ~* \6 X+ Y
- .text:004011CA pop edi
' p1 D7 i4 x) K - .text:004011CB pop esi% o2 v% [8 |9 ?; f8 O: ^3 ] b" u
- .text:004011CC retn 4: U' c! v1 j2 j7 w
- .text:004011CC sub_401160 endp' O9 M( c$ a" m7 p( w
- .text:004011CC
, ~8 o2 K1 \2 H/ q: t7 K& B2 y - .text:004011CC ; ---------------------------------------------------------------------------
复制代码 6 O( ]0 E: x* b
1 y" @. R* `. D' N5 Y
+ u3 h$ h, {* A5 a" V7 A |