本帖最后由 shane007 于 2023-8-26 16:32 编辑
6 x' C0 \4 ~2 m/ ?9 [$ M# O+ L& ^ @ V- h) A# S% r
这个游戏以前分析过,这次再写仔细些,
$ ]5 z3 B6 _; z5 Y2 ?' hCreateDevice应该就是以下这处了,我用ida pro的F5功能看了一下伪代码,更确定了。
+ |9 J7 M% f$ w% T: y5 r! B: a这游戏构造比较简单,CreateDevice是在exe文件内完成的。dxwnd窗口化成功。
C1 S" A& h, y
) S$ y+ \. Q/ ^6 J9 t- .text:0041641A push ecx
: X) P! _& _9 ^% N9 @$ q, F - .text:0041641B mov [esi+90Dh], dl$ w% B% [; a; s/ z
- .text:00416421 mov ecx, hWnd5 j* D' k! p2 e- X: H5 ~; m9 ^
- .text:00416427 mov edx, [eax]
; `( b- E# ]5 X - .text:00416429 mov edx, [edx+40h]
T. d4 }1 U0 p# \ - .text:0041642C push 40h
% f8 `8 @' ^' o1 S( ?9 c - .text:0041642E push ecx* c+ G r: V0 o/ o# I+ N$ ~+ K: Z
- .text:0041642F push 1
g% R; ?4 l! {* w. c* u - .text:00416431 push ebx
% \: L4 ~" y/ E2 U+ w* G, l [% r - .text:00416432 push eax
+ p# P9 I, z( @* a - .text:00416433 call edx
复制代码- ( g6 _* m8 A' z
- int __thiscall sub_415FF0(char *this), N/ q5 W Z# M* D: ]$ j
- {/ V$ S* k: N: O3 q/ k% z/ o
- char *v1; // esi, ~7 t5 M, S# N) m
- FILE *v2; // eax$ x! E: L9 a- |7 s- O. Q
- IDirect3D9 *v3; // eax
0 i, v+ \3 U" ]: s' [6 Z - const char *v4; // ecx
6 ~- ^8 D- M3 w1 U, D3 t - const char *v5; // edi( q8 O0 F, n9 S- B( D% z
- const char *v6; // edx: Z* G* m3 F, `# L1 b
- const char *v7; // eax/ ?/ M j; e/ R' N2 M
- FILE *v8; // eax
& s/ A$ T! W( |6 ` - signed int v9; // ebp
3 n# ^* i! z- [# } - const char **v10; // eax2 O, }5 y! ^4 X9 B; I
- double v11; // st7
! q7 K- B% I' t7 Z8 |7 M( q - double v12; // st6
7 ^. ]% x1 K$ r' V `+ a0 K - const char *v13; // ecx
e$ z4 Y! x: |$ H0 a - FILE *v14; // eax" g, Y& a' i9 u- l, k. J+ `; C
- unsigned int v15; // eax% U$ @0 f2 @9 G8 ]& g! i" D
- int v16; // ecx1 H h" i$ y7 V2 J+ K% K
- FILE *v17; // eax% n$ j+ b; g0 B a8 S
- int v18; // eax5 g5 C1 }4 F- h, Z$ V8 X" W0 [ q
- bool v19; // zf9 e* ] |( O# u- ]# J2 ^* z6 x' H
- int v20; // eax
% R& t- @" T# D% j. ?( e - unsigned int v21; // edx, N& T( d# O A3 @
- bool v22; // sf$ [. I2 H! ~% o& A" e" W& D
- int v23; // eax7 J, F/ b9 u7 n, ]3 M
- int v24; // eax
, G: U) L+ V* K3 j5 k2 X - int v25; // ecx# J- u1 ]) W$ o. v; c/ |9 m& d
- int v26; // eax
1 S. s; S. n5 m1 ^ - int v27; // ecx3 D. M1 r/ M4 Z( U. O( f* ?
- const char *v28; // eax
. s: |# R( K% a A! g& u+ H - const char *v29; // edx- \, y% [' ^& }* e1 I+ T+ y
- FILE *v30; // eax( {/ i$ n; c9 g
- void *v31; // eax
5 c- J8 U5 p; O& x+ @( v - double v32; // st7
9 ]4 H' a8 _) e+ d7 H* @3 Z - _DWORD *v33; // esi+ a+ E/ ~ e( _& ~! _
- float *v34; // eax1 p3 m& j& R, m9 J( A( ^
- float v35; // ecx+ x; r7 d. z! d$ p9 B) G! t# S
- float v36; // edx
( s9 y3 N) L5 k8 ?, g& f& B9 m - float v37; // ecx
$ u& o+ H o" Y7 Y3 O1 D - float v38; // edx- r# T$ i- b& Q$ R( i+ X
- float v39; // ecx7 `9 w8 o" J; G4 B9 v6 h) C' a
- float *v40; // eax
1 S5 x/ P' P) E. f0 z8 T - float v41; // edx6 [/ V5 |0 X6 O$ E5 ^% n
- float v42; // ecx0 p. j' T- a1 W" B) \( g# Q
- float v43; // edx# J% r. A: A! h, U+ ^4 f
- float *v44; // eax
7 D, _5 m, V) r, _- g4 w6 O6 m( s - float v45; // ecx9 h" J/ _. ~( p" i
- const char *v47; // ecx
% p4 S% d' ?: y5 J6 l - const char *v48; // ecx8 E! ~, L; z' t/ V# \
- signed int v49; // [esp+A0h] [ebp-5Ch]
s+ X7 ?6 P/ {( P2 Y# U - const char *v50; // [esp+A4h] [ebp-58h]
! t4 e6 {/ m7 D- V0 E - const char *v51; // [esp+A8h] [ebp-54h]! H- f# q$ p4 A3 L4 q
- const char *v52; // [esp+ACh] [ebp-50h]: A& X/ g# \ W5 v2 [6 ]
- _DWORD *v53; // [esp+C4h] [ebp-38h]+ k+ U. N' N% v) ~. F* J% V
- const char **v54; // [esp+C8h] [ebp-34h]5 S3 ~% K6 X* u7 c: ^
- float v55; // [esp+CCh] [ebp-30h]. Y2 ~ U; U0 p& b
- const char *v56; // [esp+D0h] [ebp-2Ch]
( ~5 Y2 X" k+ @ - float v57; // [esp+D4h] [ebp-28h]8 Z# U j2 F% r6 u1 l9 f
- float v58; // [esp+D8h] [ebp-24h]
% R3 A; I. Y8 L3 U - float v59; // [esp+DCh] [ebp-20h]
5 u8 r8 R: n5 ^0 n/ K - char v60; // [esp+E0h] [ebp-1Ch]
: i8 y' S/ x# M2 l6 `2 I - int v61; // [esp+ECh] [ebp-10h]
$ o* k* e [9 z) w* O - int v62; // [esp+F8h] [ebp-4h]
: `: n* M2 l: K3 ]" R: b" c
- p* _4 D3 \" M, F7 G3 i' G- v1 = this;
& z0 S' d7 V4 E# q- i - v2 = (FILE *)sub_4D7E8F("Initializing graphics...\n");3 N% s! Q$ D$ W! S
- fprintf(v2 + 1, v52);
) s9 ~ o) U$ `3 g$ B - *((_DWORD *)v1 + 492) = 0;
$ w% _( V- B6 h5 Q& P- s+ V5 K: D) m - *((_DWORD *)v1 + 609) = 0;
G8 e6 ^* o& `- V; J# [ - *((_DWORD *)v1 + 611) = 0;
5 c1 M: E9 P; O8 L i: Z u8 x - *((_DWORD *)v1 + 610) = 0;# g' h9 X0 r# u
- *((_DWORD *)v1 + 613) = 0;
* l8 X e, V6 h( g! Y3 @" ? - *((_DWORD *)v1 + 612) = 0;
: K! Z9 Y7 ^! z1 L% [; E% S - *((_DWORD *)v1 + 614) = 0;
8 o/ w' B! \; H# t7 X - *((_DWORD *)v1 + 601) = 0;8 U5 m" Z3 w( q6 n# y0 J5 X/ \2 n
- *((_DWORD *)v1 + 600) = 0;
. ^! f7 i1 h$ |0 H0 e - *((_DWORD *)v1 + 615) = 0;0 S$ \& N! q4 Q8 M
- *((_DWORD *)v1 + 395) = 0;
0 U9 P: E% P+ h% ~% K! G - *((_DWORD *)v1 + 488) = 0;
% h! p4 H+ P# @, ~7 Y - *((_DWORD *)v1 + 486) = 0;" K) }+ d3 V! U
- *((_DWORD *)v1 + 487) = 0;
( V9 Z- f9 K/ O' ^% T# B2 s - *((_DWORD *)v1 + 489) = 0;
" s4 D& q5 \" p( B - *((_DWORD *)v1 + 491) = 0;: Q- f0 H1 E2 g* m! x' r ]
- *((_DWORD *)v1 + 514) = 0;6 a k6 k, V4 L1 V1 V
- *((_DWORD *)v1 + 597) = 0;
3 J7 Y: X0 i8 K) o9 u - v53 = v1 + 1968;
2 {# k( r9 s5 A1 f2 w1 Y1 x2 V - *((_DWORD *)v1 + 498) = 0;
: R8 ^6 f% }. }* |6 D - *((_DWORD *)v1 + 499) = 0;
# v) q) H2 j# t9 Z% F: N - *((_DWORD *)v1 + 500) = 0;
2 Q! L0 g4 z% o2 {+ u - *((_DWORD *)v1 + 501) = 0;. z- e% g8 S( D/ T
- *((_DWORD *)v1 + 502) = 0;- G0 c1 F7 U3 n+ [6 J4 d- ?% w
- v52 = (const char *)32;
3 y8 ~$ E+ X6 U- Y6 B6 i - *((_DWORD *)v1 + 578) = 0;
; b0 M# x( [7 B5 \' ?/ _ - v1[2316] = 1;: {% g1 a; F6 }" b! h
- v1[2476] = 0;8 k( [' |' ^, I! V5 U
- v3 = Direct3DCreate9((UINT)v52);
/ X) }! h* O+ i$ n - *((_DWORD *)v1 + 384) = v3;# H' x9 Q! Y5 Q7 I% j2 i
- if ( !v3 )- Q1 u' f* Z9 C9 _2 u, c4 G3 z
- {
; z4 @# ]. I7 A3 v; m9 l2 V - v5 = v56;
x8 K' ]/ `% O$ ~" H" i# b - goto LABEL_27;; i' d. T9 v9 a
- }
E& C2 J6 n5 {$ I - v5 = (const char *)v3->lpVtbl->GetAdapterDisplayMode(v3, 0, (D3DDISPLAYMODE *)&v60);
8 |8 Y/ c/ L% A0 \% x2 B. Y8 c - if ( (signed int)v5 < 0 )# x5 g) m' `: u/ l( W
- goto LABEL_27;8 L7 }7 y$ e! N% o/ F: i
- (*(void (__stdcall **)(_DWORD, _DWORD, signed int, char *))(**((_DWORD **)v1 + 384) + 56))( d% X: v: v* ]1 q9 v
- *((_DWORD *)v1 + 384),
$ E4 k; y: m; v* m/ Q - 0,+ }0 R7 f+ _' I/ r2 l
- 1,
1 e, }8 H5 f8 U0 v6 ?6 j - v1 + 1640);
- s/ i4 }2 \+ ~9 T7 ` - memset(v1 + 1584, 0, 0x38u);
3 n( B4 h6 [- I/ T' Q - *((_DWORD *)v1 + 404) = 0;
- }+ Z1 D' T7 i) m. K( R - *((_DWORD *)v1 + 402) = 1;
8 s& z/ e# L4 s - *((_DWORD *)v1 + 403) = hWnd;( D& A* b. O- F
- *((_DWORD *)v1 + 407) = 0;# `: X6 P7 I9 l+ ]
- *((_DWORD *)v1 + 399) = 1; g# P9 ~( L. f t
- *((_DWORD *)v1 + 398) = 21;
& c5 a: G6 ]9 A0 p1 O5 h: A - *((_DWORD *)v1 + 405) = 0;: O7 ~+ o. S. ~6 Z3 h
- *((_DWORD *)v1 + 522) = (unsigned __int16)word_558176;4 r4 k4 i3 H& L5 E) _2 U
- v6 = (const char *)word_558174;
( |* T0 K$ K( u) [ - *((_DWORD *)v1 + 523) = word_558174;& `- y. L( A. x" y9 P' {0 y. m
- v7 = (const char *)*((_DWORD *)v1 + 522);6 w# O H x" H4 R4 F6 g
- v52 = v6;
' U1 ? e# ]6 s5 x7 U - v51 = v7;) d8 ?8 y$ Y8 D
- v50 = "Screen resolution is %d x %d.\n";7 |% j6 S$ b1 W0 R
- v1[2076] = *(_DWORD *)&word_558174 == 67109632;, a% w; A8 u4 b4 _ P- h1 _
- v8 = (FILE *)sub_4D7E8F(v50);
- A) w- d4 a0 J8 u - fprintf(v8 + 1, v50);: K( `1 n% P8 E8 ?; n
- v9 = *((_DWORD *)v1 + 522);- N; H! Y5 p" @; A5 A; p: s
- v54 = (const char **)*((_DWORD *)v1 + 523);6 N; \; u7 o5 U6 e. @: X- ~) {
- v10 = v54;% L) y7 u# l4 l
- *((_DWORD *)v1 + 396) = v9;1 I% L y; e; o, ?8 w
- *((_DWORD *)v1 + 397) = v10;
2 X' O! T4 z3 [$ ]3 z. | - v55 = (double)v9 * 0.0009765625;
, [, g! y, I1 k0 z0 A& P! X1 J) C - v11 = v55;" W+ f" v7 ]& w3 G5 P1 w
- *((float *)v1 + 520) = v55;
8 I* `* n0 z2 _2 Y - v55 = (double)(signed int)v54 / 768.0; @" f5 }: Y0 S, P" S& V
- v12 = v55;
. k% C; d, t: P' k$ d* q$ h' y; [ - *((float *)v1 + 521) = v55;4 a8 U! I8 F* V% q' L
- *((_DWORD *)v1 + 524) = (signed int)(v11 * 1024.0);
4 a8 Y" w8 ?% d# K6 L - v52 = (const char *)1;
2 B* H; i; r# q; m" w8 h - v51 = (const char *)(v54 + 11);
/ q1 f' o- `! G+ P; F& Q. d - v50 = (const char *)(v9 + 6);8 A/ n, I$ N4 M
- *((_DWORD *)v1 + 525) = (signed int)(v12 * 512.0);5 ?8 k! e0 Q, D/ s8 `
- *((_DWORD *)v1 + 515) = 0; }+ o8 A4 e/ m3 |& d7 h' `
- *((_DWORD *)v1 + 517) = 1024;/ P1 U8 l5 W0 T# Y( u
- *((_DWORD *)v1 + 516) = 128;
5 [4 j* I8 \1 n" A9 w m - *((_DWORD *)v1 + 518) = 640;& V) D6 r( m: ?$ L* K3 C8 {
- MoveWindow(hWnd, 0, 0, (int)v50, (int)v51, (BOOL)v52);
( \$ o9 n2 O6 \* J7 t# c3 B" | - if ( (*(int (__stdcall **)(_DWORD, _DWORD, signed int, int, signed int, signed int))(**((_DWORD **)v1 + 384) + 48))(
7 J1 n7 h! ?1 b - *((_DWORD *)v1 + 384),
7 F" y" \: ^5 x% j$ j - 0,
& S+ _, X4 t n# }0 x. ^6 Y- O$ i - 1,
( f9 o( Q: A) @5 X3 {. d1 u - v61,
U. d+ W4 m- C, p2 t& f8 w" D+ a - 21,
) P# l+ b9 @' O2 `; m - 75) < 0 )' U& l# H O& g/ r4 C
- {
, e, h8 z' b9 O# v* u; z! U8 O2 M3 q - v52 = v5;
# }; f) G+ `1 B: @" ] - v51 = v13;
7 j& U; W C/ w - v55 = COERCE_FLOAT(&v51);
6 a& Q) _# |; h+ p d, K7 g3 H - sub_456DD0("Direct3D initialization failed. No appropriate Depth/Stencil-Buffer-Format found.");
/ t2 m; e+ f/ X - v50 = v47;0 q- c% t0 c" M2 H$ f4 V! `
- v54 = &v50;" S- B+ Y) Y' u. x, T v
- v62 = 0; _. l4 \$ g* O& _
- sub_456DD0("cCougarGraphics::cCougarGraphics");
1 ], r" q8 f, \' n4 H _& | - v49 = 118;9 U% L- @$ e7 b. A$ r
- goto LABEL_28;
& t7 k5 h, }4 V0 \; Q. [ - }
6 a4 V/ @- u% b& r' X, \' y - v52 = "Depth/Stencil Buffer is D24S8.\n";, @; c0 E( s3 v; b. I N
- *((_DWORD *)v1 + 576) = 24;
3 X: W6 q2 H" [3 T% b K# H - *((_DWORD *)v1 + 577) = 8;
( P L l: m# w7 z8 K - *((_DWORD *)v1 + 406) = 75;
6 T( a$ B5 g4 ?4 M& t/ p" x - v14 = (FILE *)sub_4D7E8F(v52);$ H, P1 b" M8 x; j2 u3 L2 H
- fprintf(v14 + 1, v52);
7 R8 |7 ?/ s/ z. I) e - *((_DWORD *)v1 + 409) = 1;% k) T6 O8 E! j/ h8 H
- if ( dword_558178 != 4
% }) G8 A% J& L' H0 e" r$ L - || (*(int (__stdcall **)(_DWORD, _DWORD, signed int, signed int, _DWORD, signed int, _DWORD))(**((_DWORD **)v1 + 384)
# z8 s- [0 b* ~) _ - + 44))(
, X( V S4 l! [; r; E - *((_DWORD *)v1 + 384),
& E. S- w$ r6 {; P8 w - 0,
L; m7 t' }5 x - 1,
. ]: G, }. ^4 d2 b% \2 y9 I8 Q - 21,
$ F! [1 T( ?& k9 R; T& ~ - *((_DWORD *)v1 + 404),' j- r8 g1 z$ ]' m" I5 w! H
- 4,
; l+ z# w' w- J. R# B- [3 U+ g - 0) )
' }4 e D- M2 I$ U8 A - {. Y3 d4 s: }* A3 z
- if ( dword_558178 != 2
1 Y9 Z- J, z. x/ x% p6 U+ d4 `& V - || (*(int (__stdcall **)(_DWORD, _DWORD, signed int, signed int, _DWORD, signed int, _DWORD))(**((_DWORD **)v1 + 384)6 m" W+ v$ e0 G5 Q! k
- + 44))(6 [+ U- Y7 Y# Z5 h- n: t
- *((_DWORD *)v1 + 384),
2 x# W% o7 e- T4 G& v - 0,
" f' D1 A" ~6 v+ c( I9 O - 1,
8 Z6 E" }" m/ S0 R3 z+ _( @ - 21,
/ r2 U8 u1 d+ j; k& W u" A - *((_DWORD *)v1 + 404),
$ d7 t7 W ^5 h+ |7 T T+ T - 2,5 R d/ c* J/ d
- 0) )
' }2 o0 M. S% L! A1 N1 v - { a$ N4 L' W5 m# }0 d
- if ( (unsigned int)dword_558178 > 0( f: R/ M+ e5 s( U. b
- && !(*(int (__stdcall **)(_DWORD, _DWORD, signed int, signed int, _DWORD, signed int, const char **))(**((_DWORD **)v1 + 384) + 44))(* {1 b7 d1 A# k- P3 I
- *((_DWORD *)v1 + 384),3 o, c; a& S$ n) n
- 0,' o+ E, }- `# g: K+ |' P
- 1,+ t* Q3 A% @0 G! k1 C" }3 W8 S/ ^4 q2 ^
- 21,: I! B p# w6 R: i
- *((_DWORD *)v1 + 404),
$ l2 A3 P* I. @# K - 1,7 [! C v3 }( X5 P3 p4 v
- &v56) )
, c3 k9 I0 Q! O& H - {
" `1 x5 m. s! z7 T( r' e$ H - v15 = (unsigned int)v56;
4 s/ t/ F; T* H7 Y* i+ G( p0 K - *((_DWORD *)v1 + 400) = 1;$ ]' N9 V1 f$ T4 H4 f
- v16 = dword_558178;$ e$ j" i8 T$ L c
- if ( dword_558178 >= v15 )
/ G$ U* C5 ]& `, v4 M, \& \ - v16 = v15;
) d& y$ e$ u X( Q, J# v& A: x9 T$ _ - *((_DWORD *)v1 + 401) = v16 - 1;+ N; d& l9 C( i- b% ~$ Z
- if ( dword_558178 < v15 )5 Q! I( P' W S1 Z0 i- ]" u+ x! Q
- v15 = dword_558178;
! x1 [6 N0 ~1 T& U4 N - *((_DWORD *)v1 + 578) = v15;7 e3 i4 \1 V! u1 h& i- M# j& I) {
- }& K' i# A! c8 ]2 T+ ~
- }
; B9 }1 h+ h$ d! n - else
. e7 J C) _6 b$ b# w) F - {
: C" T3 K2 E" O0 N - *((_DWORD *)v1 + 400) = 2;
: b9 G! H# m: N7 ]& w9 ~ - *((_DWORD *)v1 + 578) = 2;
0 g% m3 {7 c; x5 D) H$ J9 p - }
+ e6 w2 P Z# Z7 L( A e - }8 b J+ P s, l+ q
- else
7 [9 H! g( m# R - {
0 S1 s1 ]. a& B6 V# `9 [4 s - *((_DWORD *)v1 + 400) = 4;
+ N: M8 j/ `8 h7 t$ a& m - *((_DWORD *)v1 + 578) = 4;
. n/ o. D( j' ], e - }
. z, X) F/ |! U6 Q5 d - v52 = (const char *)*((_DWORD *)v1 + 578);
6 s+ q4 c1 U* g& `4 \ - v17 = (FILE *)sub_4D7E8F("AntiAliasing is %d.\n");
/ A2 U4 z D }8 N) G2 E3 }9 Q - fprintf(v17 + 1, v51);( f# _8 l% L; |8 r- z+ N. k
- v18 = *((_DWORD *)v1 + 384);, w8 W* W* b" v0 E
- v19 = *((_DWORD *)v1 + 578) == 0;
* g; u8 s1 _+ F) H6 I S$ u - v52 = (const char *)827611204;& t4 k4 n3 x/ ?4 E( z* E v p
- v51 = (const char *)3;
0 M* {) u! N! q+ L$ f: z5 p+ G' P - v50 = 0;
9 k. {4 L# E2 Y* t0 m% D - *((_DWORD *)v1 + 402) = 2 * v19 + 1;
: W, v$ D- Y$ U n8 i - v20 = (*(int (__stdcall **)(int, _DWORD, signed int, int, const char *, const char *, const char *))(*(_DWORD *)v18 + 40))(
. T0 x! |1 S: h6 W, U T - v18, Q! d+ A: F, n( @$ X$ U
- 0,( W. I9 Z D' ~
- 1,
' w' Z# |+ H7 m- `& C( E - v61,$ R5 D h+ F# Z
- v50,$ o, \. f2 p7 P6 H1 o8 y
- v51," r% T: y& P) N) i, _1 w
- v52);- e4 c) N) S U- L8 K. M8 p2 Y
- v21 = *((_DWORD *)v1 + 425);
# t$ f. K6 C7 w+ s+ V b - v22 = v20 < 0; z8 X- Y. z' _, k* m
- v23 = *((_DWORD *)v1 + 384);
& m( L' i3 {. q1 K* ^# C) o( Z - v1[2316] = !v22;
% ]0 Y3 V' M) [; I$ K+ O/ ] - v52 = v1 + 1540;
0 } P% s+ I+ P2 E9 A& m+ j7 c - v51 = v1 + 1584;
$ ^4 j- ~! d0 [0 w - v1[2317] = (v21 >> 14) & 1;1 S6 h, k- W# T4 L) ~
- v5 = (const char *)(*(int (__stdcall **)(int, _DWORD, signed int, HWND, signed int, const char *, const char *))(*(_DWORD *)v23 + 64))(
8 W- j4 t0 T$ y% e7 q- F - v23,0 l" j( B0 D2 \
- 0,0 ~2 C9 S# u8 z- Z
- 1,% |" j! ~/ g5 ^
- hWnd,
4 ?! k3 Z; Y L' N5 O6 e - 64," C4 v! b* p8 V- e( g
- v51,
# K9 B' B5 p# o" y& E* b - v52);" u$ T' t" E( v2 A) Z! X
- if ( (signed int)v5 < 0 )0 R1 `2 t) d8 `# P6 z9 K3 ~3 `* A; Y1 B; J
- goto LABEL_27;9 q$ Z# I0 U+ R: n- n' z
- if ( dword_558180 && ((v24 = *((_DWORD *)v1 + 425), v24 & 2) || v24 & 0x100) )9 ?# f" @5 g0 r- y, L
- {$ Q; @! ?& X* Y( `7 l0 H; T
- v25 = *((_DWORD *)v1 + 609);* s! N* D) ?/ j* a+ L
- v26 = sub_418670(*((_DWORD *)v1 + 522));
7 a3 s! h2 r" T e- Z - v52 = (const char *)*((_DWORD *)v1 + 523);
5 b8 W3 G; ~5 ^$ W# x% F - v27 = *((_DWORD *)v1 + 609);
+ ^. S2 G8 W# l0 b( [ - *((_DWORD *)v1 + 496) = v26;
) M) R0 ] l% g. K' f2 ~2 b, ~ - v28 = (const char *)sub_418670(v52);- Q% r1 O5 j, g# y- O4 {
- }
3 b/ l+ _3 d+ `1 u8 s$ @5 [. ~ - else
- s- L4 u8 Y, n9 T ?* ? - {
$ a3 h' H, n. p: K' }, R$ F+ E( D7 _ - v28 = (const char *)*((_DWORD *)v1 + 523);5 o2 |8 y) u. V* s/ E& G7 y) r' f. Y
- *((_DWORD *)v1 + 496) = *((_DWORD *)v1 + 522);2 }, d" h( y4 ^6 g- P) o$ q
- }
: t- F2 K# c. r- m& {1 F( P - v29 = (const char *)*((_DWORD *)v1 + 496);
( D6 \0 ^) @$ B - v52 = v28;
: J, S/ {, T1 n) g) ^% z! a - v51 = v29;1 a8 U9 w6 F7 ~
- v50 = "PostProcess Surface is %d x %d.\n";% U9 ?; f) m3 C3 m7 p, b: p* A) c
- *((_DWORD *)v1 + 497) = v28;
* K) i& \6 F! b9 |0 i - v30 = (FILE *)sub_4D7E8F(v50);
" j% v: G* f; i: ~; y& G2 o8 C) I - fprintf(v30 + 1, v50);7 L, ~! B- b5 k' k. D. T
- (*(void (__stdcall **)(_DWORD, _DWORD, char *))(**((_DWORD **)v1 + 385) + 88))(*((_DWORD *)v1 + 385), 0, v1);5 q) w! C4 ~, D6 p. S$ w0 K$ Q3 j" a. |
- sub_413100(v1);8 C& d3 m1 ]' B: @0 c7 t6 s: R0 U2 i
- sub_411D60(v1);
3 k9 l+ W/ ?6 N" J% O+ h2 U2 X# W - v31 = malloc(0x78u);
k$ e7 v8 k) [# j8 [- B - v32 = -0.5 / (double)*((signed int *)v1 + 522);7 O( k6 C7 L# @# _0 F b7 f
- *((_DWORD *)v1 + 599) = v31;
. g2 j6 O+ D. E) v/ _ - *((_DWORD *)v1 + 600) = 0;
" a7 d1 Q1 U- k - *((float *)v1 + 526) = v32;6 R: S- m0 t6 c& @( m9 i
- *((float *)v1 + 527) = -0.5 / (double)*((signed int *)v1 + 523);# p# W5 c$ w n- X# v: ~ o- k! o
- sub_411CC0(v1);7 Z# z9 q6 {3 g- P: j7 r/ R
- v33 = v53;* r2 |' t# c! R
- v5 = (const char *)(*(int (__stdcall **)(int, signed int, signed int, signed int, signed int, _DWORD *, _DWORD))(*(_DWORD *)dword_559B7C + 104))(
: Y, D6 ~% c$ Z, o1 W4 Y& Q4 ^! v - dword_559B7C,3 D$ C+ n4 j/ Q7 F. W+ `
- 80,8 w0 Q% A8 T. p3 G. ^
- 8,5 i$ i3 R" @6 R) N! J6 s
- 258,/ `2 E1 W& w9 L4 r* \3 B/ z
- 1,
* j$ N7 M% V, [' j - v53," s! ?+ h+ q9 s( l1 z5 h
- 0);
! o+ K2 Y+ u: [ - if ( (signed int)v5 < 0 )
Q5 V/ ^1 b0 g+ `9 e - {
1 y* c5 f3 @2 r4 ^' Y - LABEL_27:
% s) B$ G I4 W - v52 = v5;
, i* d- m! H! I6 N/ J; {* L - v51 = v4;
6 P9 C9 H9 Z6 J8 G0 x - v55 = COERCE_FLOAT(&v51);
/ H3 c- C- i: h! J( e7 @ - sub_456DD0("Direct3D initialization failed.");
/ Y) f; P7 i x3 _3 i - v50 = v48;- k8 d2 F8 Y; ?9 j3 T l
- v54 = &v50;* j; F9 s; ?9 A N0 ^: e1 C
- v62 = 1;# |* {6 H+ }; B4 {
- sub_456DD0("cCougarGraphics::cCougarGraphics");
3 C; D8 ^, H" l3 T - v49 = 205;
$ h1 i8 j3 t7 [ - LABEL_28:& R! w4 F* S7 m$ P1 l/ f0 `
- v62 = -1;
8 q' K h! j* x, S% [ - sub_40CB30(1, ".\\source\\class_graphics.cpp", v49, (char)v50, (char)v51, v52);! \5 T( F) _5 b" E$ m4 d
- }" E* r6 s% m9 T h- b$ v/ ^/ [. X
- (*(void (__stdcall **)(_DWORD, _DWORD, _DWORD, _DWORD **, _DWORD))(*(_DWORD *)*v53 + 44))(*v53, 0, 0, &v53, 0);: [4 Y, c' O* g5 o
- v58 = -1.0;5 P( _8 l+ u3 A+ V: G
- *(float *)v53 = -1.0;
: n+ y$ R: E X* u* k- x5 H7 U - v59 = 1.0;
5 Q/ d4 o! F p& `/ S0 G - *((float *)v53 + 1) = v58;3 X. f8 F* U% o
- v57 = -1.0;, T2 ~# H% U+ x
- v58 = 1.0;
; j5 h5 L, c8 V# W5 s/ M2 c/ m - *((float *)v53 + 2) = v59;* g# W E4 Y5 S0 m" [
- v59 = 1.0;7 y9 g& x0 v& M* e7 y/ x+ t a2 [+ v
- v34 = (float *)v53;
+ O0 G( v# F z5 R# Y/ ?: t$ B - v35 = v57;
9 k, v) R# ]* ^6 p4 m$ ^ - v57 = 1.0;' p( a$ ]. e( l0 I
- v36 = v58;
0 F* Q! w, G, J+ L: Z - *((float *)v53 + 5) = v35;
+ Y0 I8 `. G6 F# w- R: Z! ]- s4 G9 s& c - v37 = v59;$ R$ s! ^0 `( \' k
- v59 = 1.0;
: k, B) M" k' h* q - v34[6] = v36;
( d7 N5 l3 D- e: ~) T0 X3 A; n - v38 = v57;
, w& |* T; M9 K( d* y - v58 = -1.0;3 Z/ c6 K* o, ] ]2 h: I7 W
- v34[7] = v37;0 [7 ^+ F2 c; u2 b
- v39 = v58;
% K% A, l: M+ ] - v57 = 1.0;
, K- o% G0 {$ ^. ^3 w# @. l- V* N - v58 = 1.0;5 ^) L1 E5 N: W# b
- v40 = (float *)v53;
' }: O& w+ |/ T+ d8 C. @9 _/ V! W - *((float *)v53 + 10) = v38;5 l" B) R3 [: @
- v41 = v59;
; q9 O: U2 ?+ D% M - v59 = 1.0;* F- ~. j( p( q2 P n
- v40[11] = v39;
n4 @; D, Y4 m% Q - v42 = v57;
% R. Q* x C6 ]4 \% A% G8 ] - v40[12] = v41; @2 N4 R" ^8 t2 z5 A
- v43 = v58;4 u: S6 u' n) X% h8 c
- v44 = (float *)v53;& n- T) n k# b3 S# F0 f
- *((float *)v53 + 15) = v42;
9 C) o5 W; S: F% P9 m - v45 = v59;3 W! w% ?- G* Z2 P' f, x6 v) H
- v44[16] = v43;
7 q' `1 M1 {2 I* }" H1 y - v44[17] = v45;5 w6 u& _* e' e2 O; k
- *((float *)v53 + 3) = 0.000099999997;
, m$ U' _& z6 K( c/ W( L" t - *((float *)v53 + 4) = 1.0001;6 p7 C5 Z: E3 L+ G, b! {5 c& y) X
- *((float *)v53 + 8) = 0.000099999997;
# Z# e" Z$ {& G) N! m$ K8 @+ t - *((float *)v53 + 9) = 0.000099999997;
& w2 m# n7 m1 m( Z - *((float *)v53 + 13) = 1.0001; n+ @0 W: Q% q6 N: X& J
- *((float *)v53 + 14) = 1.0001;
' m9 J$ n( q( y- b) ~2 } - *((float *)v53 + 18) = 1.0001;
1 c* L3 e2 o! _8 H - *((float *)v53 + 19) = 0.000099999997;
# ]6 r2 l- X/ M8 D - (*(void (__stdcall **)(_DWORD))(*(_DWORD *)*v33 + 48))(*v33);4 L9 Q. E) H2 S
- return 0;
' c5 m& `& L/ Y' [8 [1 P$ Q, F - }
复制代码
. l5 |) J" b' g. B用Cheatengin寻找一个字幕之后,在以下地方断下. Z9 Q u' O- u
- <div>ocd.exe+425B9 - 0FB6 D9 - movzx ebx,cl</div><div>004425B9</div>
复制代码 $ u. u$ J8 z4 w9 X3 B& q$ |8 N
. C# Z6 g2 Y k$ ?在ida pro下查看,是这个函数,从代码看a2字符像是索引号。# d$ ~, z" R- i9 B4 r3 @
稍后需要仔细分析。字幕显示函数应该在本函数上下。( k& t$ Q1 Z! m. E- O! s+ {* T7 I) g
- int __thiscall sub_442510(unsigned __int8 **this, int a2)
复制代码 % j- q# \+ r, N4 ?# h5 x
6 I/ r8 d) ]* p0 Y! K8 t3 l7 X
- F- ?+ g6 _+ @
|