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