本帖最后由 shane007 于 2023-8-26 16:32 编辑 # A5 z0 P0 ^& l6 V+ c6 |3 _0 K4 R" E
3 y+ [) Z! Z7 v: K0 W# l
这个游戏以前分析过,这次再写仔细些,
; g" j; ?7 [' \CreateDevice应该就是以下这处了,我用ida pro的F5功能看了一下伪代码,更确定了。: [; w' _% z( J7 s/ a3 t
这游戏构造比较简单,CreateDevice是在exe文件内完成的。dxwnd窗口化成功。1 O5 q5 n7 V6 P# P* |
) S2 R1 u# l2 A' S: k! [- k0 T0 v- .text:0041641A push ecx
6 L$ n& k @$ C0 k* B' ~9 @ - .text:0041641B mov [esi+90Dh], dl
- G4 w/ b7 L- }' V1 V - .text:00416421 mov ecx, hWnd
* Z4 w O. { O+ N5 I4 C/ ^$ i - .text:00416427 mov edx, [eax]
% t' G* A9 h4 n4 I5 L' d/ l - .text:00416429 mov edx, [edx+40h]) z- s0 F+ E/ S7 ?; h0 n9 ]' b
- .text:0041642C push 40h
0 i7 P5 O0 L9 d( P& J" {4 Y - .text:0041642E push ecx
* h4 W' S+ x. z7 C A' T& q - .text:0041642F push 1
8 \1 G1 H" F" w X+ [ b- P - .text:00416431 push ebx3 w: `6 A r Z' j$ g8 M- q
- .text:00416432 push eax
, V0 U3 X8 x: x3 z/ O% M# y - .text:00416433 call edx
复制代码
: D- b) g2 s4 H) k/ z, V, F- int __thiscall sub_415FF0(char *this): o8 D" n# z% L; ? c3 C# P& V
- {) ?! v; }4 m6 i. d" B0 U4 n+ X8 f
- char *v1; // esi, X9 G7 R0 w M
- FILE *v2; // eax" W% g6 `1 }' t. @1 w3 f# }5 g" m$ H
- IDirect3D9 *v3; // eax
, I/ R5 |4 z& r2 m! I$ ` - const char *v4; // ecx0 `9 V. s+ K2 l% \) H) N6 C- B
- const char *v5; // edi
4 t' t9 a. g3 j/ B* X - const char *v6; // edx
; a G1 T1 k* p5 Y - const char *v7; // eax
; i2 z P) `- o9 B }' c, o+ B - FILE *v8; // eax! A+ L3 ]8 R4 J/ q( s
- signed int v9; // ebp
; o8 [/ x1 m+ v. P$ q# n - const char **v10; // eax
2 V8 N. H7 d; G. l6 U- Y - double v11; // st71 ~1 K, P# p2 S# o/ G
- double v12; // st6
3 X- p( H1 c, j - const char *v13; // ecx" e8 Y: U2 c1 s8 }) i2 ]
- FILE *v14; // eax
2 B2 O* t/ g: v( o - unsigned int v15; // eax
2 z {* [ i' G" U" d, m4 |. \ - int v16; // ecx
5 p7 h: c4 X7 r" T& Y4 x - FILE *v17; // eax
U E6 |0 P3 P( E - int v18; // eax/ H7 W' P# X% w% M- e% r5 _! T
- bool v19; // zf# @1 @- v" u3 e7 h0 W! n+ F: X# e
- int v20; // eax6 ?% j4 [8 Q$ W" ^" }# t
- unsigned int v21; // edx/ _- M9 x" |; B) ~# [
- bool v22; // sf0 q, ?$ l; L3 ^% E- U# i! h; e
- int v23; // eax0 e4 x c( R- J; a' q9 `* \& }
- int v24; // eax% T. O6 e+ A0 F# V, K- [
- int v25; // ecx5 b D" z; X* c( w! D h% K
- int v26; // eax7 _+ S3 ]& I! q! Q- h+ l, I
- int v27; // ecx
: c$ w+ I) t# ^5 \8 E - const char *v28; // eax
. N) Q8 ]7 R4 b9 G6 I - const char *v29; // edx/ Y* Y" g" R" M3 C7 l
- FILE *v30; // eax' o8 {3 ^! `, `9 t8 q
- void *v31; // eax
1 k: k, Z1 k& m/ a$ k - double v32; // st7
8 S" p0 G8 L% {% s" J- n! r$ y1 t - _DWORD *v33; // esi+ M. g9 M' _) g; {! |
- float *v34; // eax8 z' M" }, l% E: O( e8 K0 j
- float v35; // ecx& G5 E0 M9 ^0 f
- float v36; // edx- z4 t* O" C/ Z) _# e' ?0 V1 N% f
- float v37; // ecx4 x4 |6 X( i4 K0 [$ R! W# z; t0 R
- float v38; // edx
1 f7 m& x6 W) v3 t2 e - float v39; // ecx
% A1 ?, z4 ~9 _6 e( {( \+ d5 w0 B - float *v40; // eax
4 n* m% G; h" k; ^& F - float v41; // edx
. P" [6 ]3 U7 _3 O; |' g3 q0 x - float v42; // ecx
# _2 p9 z5 g" n% n. C# Y - float v43; // edx1 a3 F7 O6 M1 e. X
- float *v44; // eax! w+ P- D0 _/ `& v+ u* G
- float v45; // ecx/ k9 z0 ?5 ~7 g6 k4 I$ c
- const char *v47; // ecx. O7 @; l1 W# f+ ~0 x+ z
- const char *v48; // ecx& i8 ~. W# r5 s6 {
- signed int v49; // [esp+A0h] [ebp-5Ch]+ n2 b0 P0 Q9 W8 W! a
- const char *v50; // [esp+A4h] [ebp-58h]( J( F5 u- e6 ~: ]" z2 K
- const char *v51; // [esp+A8h] [ebp-54h]% a4 \" i* v* s, g& b
- const char *v52; // [esp+ACh] [ebp-50h]9 H$ w/ u9 L P* H$ i
- _DWORD *v53; // [esp+C4h] [ebp-38h], Y# z, z/ u* }8 T4 l5 Z/ q
- const char **v54; // [esp+C8h] [ebp-34h]# M; G% \, f- ^1 r, u
- float v55; // [esp+CCh] [ebp-30h]; u, q0 R2 ^2 G, E) z7 g
- const char *v56; // [esp+D0h] [ebp-2Ch], V5 P& j `- M& q. C, v
- float v57; // [esp+D4h] [ebp-28h]
6 b( ?( J( ], e; S - float v58; // [esp+D8h] [ebp-24h]2 R' ~' N6 z+ Y8 `! K9 I7 T
- float v59; // [esp+DCh] [ebp-20h]7 v" z, H! p; |7 h5 o4 h9 `4 h
- char v60; // [esp+E0h] [ebp-1Ch]& b' Y6 u& D; t: K- T ^ M
- int v61; // [esp+ECh] [ebp-10h]
' H a3 P; a3 a - int v62; // [esp+F8h] [ebp-4h]. h2 D/ A9 B) U. E _% D- I" f' K
# l8 G- n% q/ j9 ^1 e- v1 = this;
: {& b# ^3 K7 g: G7 O3 ~4 b - v2 = (FILE *)sub_4D7E8F("Initializing graphics...\n");
& N2 B' v) ]3 q3 l; _& f' T - fprintf(v2 + 1, v52);
8 y, y2 n0 r- Y- E$ u. ? - *((_DWORD *)v1 + 492) = 0;
O( {: d% R" D6 K. b3 Y7 w( E - *((_DWORD *)v1 + 609) = 0;
, h: @5 m' b2 G. |6 a: [ - *((_DWORD *)v1 + 611) = 0;
8 u: n2 U5 G3 l# C+ q6 ? - *((_DWORD *)v1 + 610) = 0;0 i: |6 E& _7 p5 N7 ?
- *((_DWORD *)v1 + 613) = 0;
5 T0 A! B- ~! K! k: P- D - *((_DWORD *)v1 + 612) = 0;
6 n" t2 z. h' H - *((_DWORD *)v1 + 614) = 0;
& R$ C( d _8 _! @& Y3 B/ Z - *((_DWORD *)v1 + 601) = 0;
4 ~" `$ O+ O. F4 Q) q, L - *((_DWORD *)v1 + 600) = 0;1 H3 T' K/ O( C3 W
- *((_DWORD *)v1 + 615) = 0;
$ ~- g& o. T7 z* @# q; W - *((_DWORD *)v1 + 395) = 0;% Q2 S7 e0 h4 q+ k" @
- *((_DWORD *)v1 + 488) = 0;
- I! G1 m1 z% ?6 A- Z$ c5 { - *((_DWORD *)v1 + 486) = 0;; @* `5 t% R: r" I* s
- *((_DWORD *)v1 + 487) = 0;! @$ y0 i D& M% |/ A- N7 D
- *((_DWORD *)v1 + 489) = 0;
( m9 q1 Y0 M$ A0 [ - *((_DWORD *)v1 + 491) = 0;
; z" Z' m$ k6 u) w; z4 w( { - *((_DWORD *)v1 + 514) = 0;# a7 f ~, H8 U- a* }. |
- *((_DWORD *)v1 + 597) = 0;
/ q7 C2 P" h+ h: _' c - v53 = v1 + 1968;
* l; \$ a9 N# E9 l: z' h0 p: _3 l - *((_DWORD *)v1 + 498) = 0;0 t) n0 K J! i' v0 f
- *((_DWORD *)v1 + 499) = 0;
3 J4 l; d8 x$ T" G& d3 m - *((_DWORD *)v1 + 500) = 0;. g7 X% o4 i0 Y g) H2 z3 s
- *((_DWORD *)v1 + 501) = 0;
7 I* V4 Z: h& ~6 V- y& p - *((_DWORD *)v1 + 502) = 0;
- z5 I9 I/ v2 y* ~/ D! L: ` - v52 = (const char *)32;
2 @) z& e- `! s. A0 w W - *((_DWORD *)v1 + 578) = 0;# e3 ^ L1 p7 Q5 w& n
- v1[2316] = 1;
1 Q: O/ i' j- M9 k# M% J/ p - v1[2476] = 0;
% T }2 R& K) `' \$ W& p' U( o6 t - v3 = Direct3DCreate9((UINT)v52);! W. _6 Q/ d E; Y# ^
- *((_DWORD *)v1 + 384) = v3;
V; E) g4 g; G4 n. _* Q/ m: ?2 m - if ( !v3 )
& w8 J8 O: r+ y1 | - { } s9 w# s) C
- v5 = v56;
; b0 A, c6 Z1 G1 {! u ^7 I - goto LABEL_27;1 h# I* _, d- V h2 f9 L
- }
- ]0 l1 o' \1 S# a% I, [ - v5 = (const char *)v3->lpVtbl->GetAdapterDisplayMode(v3, 0, (D3DDISPLAYMODE *)&v60);, x7 F- o! o8 H9 P8 n; F# t8 c
- if ( (signed int)v5 < 0 )
( o' v0 J: Z; m1 x' J2 r) ^' `0 T# T: X - goto LABEL_27;
, }4 ], n. @% @ - (*(void (__stdcall **)(_DWORD, _DWORD, signed int, char *))(**((_DWORD **)v1 + 384) + 56))(0 |$ {% P; H4 K R6 m2 D* E
- *((_DWORD *)v1 + 384),6 h! }& d9 D4 S1 z0 J8 V" u
- 0,
$ ]' n4 P. f3 H, P - 1,
( `. s6 |9 V& U, U- _- A - v1 + 1640);; w; u/ m* ~" `: {
- memset(v1 + 1584, 0, 0x38u);
; [2 c% Z8 o) I4 I/ i - *((_DWORD *)v1 + 404) = 0;
( @; Z* z# J: G4 s6 `7 c% L - *((_DWORD *)v1 + 402) = 1;
9 O9 }. o. l, ^$ \ - *((_DWORD *)v1 + 403) = hWnd;) {2 l, e U( n5 v9 A
- *((_DWORD *)v1 + 407) = 0;* m" ]: _% h% {: Z5 }* v8 T
- *((_DWORD *)v1 + 399) = 1;
0 ] b( g- X2 K* i - *((_DWORD *)v1 + 398) = 21; |) T5 N. d5 @0 D" \4 |
- *((_DWORD *)v1 + 405) = 0;
3 e1 Y3 K0 m; k; {/ _ - *((_DWORD *)v1 + 522) = (unsigned __int16)word_558176;
" V3 Y; C0 G v- V - v6 = (const char *)word_558174;8 F K) @+ E$ o4 z
- *((_DWORD *)v1 + 523) = word_558174;
+ {$ k* [3 O( o: n. u+ _/ ] - v7 = (const char *)*((_DWORD *)v1 + 522);& W7 [5 J0 b* d Q6 ]2 C
- v52 = v6;
- S- ^( A" A; w9 `7 `3 | - v51 = v7;
, z- E3 e9 ]* ^1 C, F5 p - v50 = "Screen resolution is %d x %d.\n";0 |3 l7 F3 {' W0 m- H# @
- v1[2076] = *(_DWORD *)&word_558174 == 67109632;3 F# }0 |( U, z3 ?8 |5 p( o) M
- v8 = (FILE *)sub_4D7E8F(v50);. [. O e* f2 T# ~
- fprintf(v8 + 1, v50);
; y* J4 e( v* |1 h) @ - v9 = *((_DWORD *)v1 + 522);8 C/ c& g3 V/ Z6 h$ N
- v54 = (const char **)*((_DWORD *)v1 + 523);3 ?- D+ ?7 a' Z
- v10 = v54;8 y6 H: `' n! V$ p
- *((_DWORD *)v1 + 396) = v9;
- d+ J! g+ F1 Y# L4 J! J - *((_DWORD *)v1 + 397) = v10;
% U J& ~% R3 m - v55 = (double)v9 * 0.0009765625;/ _( ~. ~- l- a8 t! E& o
- v11 = v55;- R! {* h0 Y7 P5 m3 z3 G
- *((float *)v1 + 520) = v55;& f+ ^. ~, d( j- {6 `( A4 N7 T* w8 C
- v55 = (double)(signed int)v54 / 768.0;% ]9 `; m4 G/ k8 N
- v12 = v55;
4 t- {9 O8 x+ ` J - *((float *)v1 + 521) = v55;
9 z! p5 B7 ~, |0 @) Z6 K - *((_DWORD *)v1 + 524) = (signed int)(v11 * 1024.0);
, Z; r) v5 h) k$ Q% b, c - v52 = (const char *)1;
. C, }1 h9 ]7 q* r7 \% a' P; K - v51 = (const char *)(v54 + 11);
8 `* q$ t4 ?5 V1 ~ - v50 = (const char *)(v9 + 6);! T: G. t7 t( G) @
- *((_DWORD *)v1 + 525) = (signed int)(v12 * 512.0);! U1 n5 N: C( {* `" v8 U6 g( b2 W
- *((_DWORD *)v1 + 515) = 0;
5 D: k" a6 ~" V2 l" X8 z! I0 N - *((_DWORD *)v1 + 517) = 1024;7 y0 M. `: p5 a8 ^5 p2 C9 A
- *((_DWORD *)v1 + 516) = 128;
6 `0 q1 e W( ?% Z Y& g - *((_DWORD *)v1 + 518) = 640;* k) W5 T! j# Y9 y: ?3 R% `) X- ]
- MoveWindow(hWnd, 0, 0, (int)v50, (int)v51, (BOOL)v52);6 a/ b4 c9 }( B/ e) O. B
- if ( (*(int (__stdcall **)(_DWORD, _DWORD, signed int, int, signed int, signed int))(**((_DWORD **)v1 + 384) + 48))(, ^( d4 o: k# g
- *((_DWORD *)v1 + 384),
2 `, T$ |$ r! c - 0,
/ m, \+ |/ Q, U K4 w, H - 1,
# q0 F5 N. F* p - v61,
0 D0 Y$ s4 V; i6 w, O2 P5 ^# I! | - 21,$ V- R/ Z! n5 Z7 y
- 75) < 0 )( |' x) E7 `- I6 V# q& U
- {
9 i& `* l* x3 Y+ t% H) z, L9 L - v52 = v5;
3 \- o ~- }: |, \ - v51 = v13;
4 x, R v, q+ ] b+ v- h5 p - v55 = COERCE_FLOAT(&v51);4 [: N9 \+ B0 Z1 e9 B
- sub_456DD0("Direct3D initialization failed. No appropriate Depth/Stencil-Buffer-Format found.");1 d! Z4 L2 W7 N0 P5 v) w) A- H* v
- v50 = v47;
8 Z. P! v3 D/ T - v54 = &v50;
2 J. f4 f1 g2 J! V - v62 = 0;
3 k5 b N' M3 A7 I3 p - sub_456DD0("cCougarGraphics::cCougarGraphics");
: ? D$ h) v5 Q1 T' o0 o9 c' C - v49 = 118;6 p3 s) X2 }' p6 L
- goto LABEL_28;5 ^8 m# V' F. R
- }
% t0 `. l+ g! s - v52 = "Depth/Stencil Buffer is D24S8.\n";
& b/ G+ U! f6 Y6 L4 Q4 W - *((_DWORD *)v1 + 576) = 24;
6 T0 k" R3 h4 b& O) |. [' s0 u1 a - *((_DWORD *)v1 + 577) = 8;2 \8 ^1 d* ]2 y+ y4 F
- *((_DWORD *)v1 + 406) = 75;
& E: X; \; k+ R! [ - v14 = (FILE *)sub_4D7E8F(v52);. Q- ?8 Q! U+ I* k) e3 D" m
- fprintf(v14 + 1, v52);( R2 K) _1 N+ O5 S" }% [; c
- *((_DWORD *)v1 + 409) = 1;' z0 [) G0 I/ y7 ]. \- `: Y
- if ( dword_558178 != 45 T$ s3 |2 `, a2 B! z0 _* `. ]
- || (*(int (__stdcall **)(_DWORD, _DWORD, signed int, signed int, _DWORD, signed int, _DWORD))(**((_DWORD **)v1 + 384)" k0 h- X4 x# q! l. C
- + 44))(
4 p* n6 A8 A6 q* p3 v - *((_DWORD *)v1 + 384),. |9 u1 `" ]: y$ h
- 0,
% P8 l, c5 J4 m0 E a I O, ^1 m& X g - 1,0 e% H! n) G8 ]% i. R
- 21,5 T: R$ U, T2 _
- *((_DWORD *)v1 + 404),
. B0 B6 M+ Z! q; t7 `+ c# I - 4,
/ @5 _) e; _3 t0 n5 u' { - 0) )' R- h; |0 G% ` g2 i# A6 L
- {
3 K, h6 ^, d5 t+ K! {: x" I5 z - if ( dword_558178 != 2
# b" i& ?9 _* u% z* I - || (*(int (__stdcall **)(_DWORD, _DWORD, signed int, signed int, _DWORD, signed int, _DWORD))(**((_DWORD **)v1 + 384). n$ r5 t% @3 S9 s; x# C
- + 44))(2 n$ a& h. x7 ]
- *((_DWORD *)v1 + 384),
% H$ o7 O I3 K- G% D; _ - 0,
; P) \$ w1 o+ h" y0 u6 L( a - 1,
8 g; m. X6 g+ Q/ M - 21,
2 W* U; J. ]! {$ s# C5 W - *((_DWORD *)v1 + 404),( O3 z4 D3 W7 o$ v$ j
- 2,9 R. M& q5 M* ~$ J! ~! M0 o
- 0) ), X( A! ^5 E, v3 }8 \% T! T! U4 |
- {
% p; r" }; \* c, d - if ( (unsigned int)dword_558178 > 06 l. R6 D- c1 l) v# u9 h: V8 ^
- && !(*(int (__stdcall **)(_DWORD, _DWORD, signed int, signed int, _DWORD, signed int, const char **))(**((_DWORD **)v1 + 384) + 44))(( {& B/ Q& G3 @7 R# u3 w
- *((_DWORD *)v1 + 384),
9 }. Z. m. w6 o5 X - 0,4 f& d+ z9 ~' d4 r; i; F. u( E1 m
- 1,0 ], k, ?7 I, I: Y* H+ k7 t; ]
- 21,
4 k# c3 {/ H0 R - *((_DWORD *)v1 + 404),
# j0 l2 T6 m, w0 A! Y - 1,
) E! U0 R% F- o# Q - &v56) ), j7 k, X! J1 p$ Y1 @! _$ \
- {" e4 Y0 j. U0 s. D
- v15 = (unsigned int)v56;
& U6 R4 S4 v" [; t% @ - *((_DWORD *)v1 + 400) = 1;
3 `( V7 r7 T1 w0 d+ H6 B8 l - v16 = dword_558178;
. v3 s) M" \( Y - if ( dword_558178 >= v15 )
8 d- {; r" X+ ~0 b: Y+ r0 C - v16 = v15;
$ L! l) K7 [+ f. `. j; U) f - *((_DWORD *)v1 + 401) = v16 - 1;
( \5 o# ]( ~; _; A4 F# N - if ( dword_558178 < v15 )
* \9 z Q% D2 e2 w7 N8 O8 @) u - v15 = dword_558178;) V \( g# O3 Q3 C. V" t& S& C/ P
- *((_DWORD *)v1 + 578) = v15;! `# V1 E( h) V9 k
- }
- Y# X3 x) `$ E2 \5 }7 v w - }
( w, v1 _$ i8 K t6 @2 n - else
0 e, X1 p5 }6 g- N* w - {( l7 Z) K8 o$ B: j
- *((_DWORD *)v1 + 400) = 2;! w1 |+ N1 Z8 ~8 a2 t1 m" v
- *((_DWORD *)v1 + 578) = 2;2 }/ W) U, E1 Y
- }- M5 B. n* ~; P' l
- }+ L. G: s7 ~- T* `4 Y# L4 Q
- else& I% W4 R$ P$ O
- { f5 X( r: d! f) a
- *((_DWORD *)v1 + 400) = 4;$ D% j9 ~0 o6 h, p8 Q. Z
- *((_DWORD *)v1 + 578) = 4;4 ?3 X7 h3 ]2 ~$ d1 ?6 Z
- }
6 I( c. S N+ K. Z9 f! D - v52 = (const char *)*((_DWORD *)v1 + 578); k: k- A" o4 c+ T, {
- v17 = (FILE *)sub_4D7E8F("AntiAliasing is %d.\n");
/ A+ {5 U! R+ |" R7 o - fprintf(v17 + 1, v51);- _0 ^- z7 N1 v; W
- v18 = *((_DWORD *)v1 + 384);0 w9 v! r+ c8 u6 w1 M
- v19 = *((_DWORD *)v1 + 578) == 0;
6 e6 I& ^7 E8 v4 t6 g! r - v52 = (const char *)827611204;& l* }0 ~. A1 e! u
- v51 = (const char *)3;$ ~) n+ ^ t/ i, k" q$ l2 n
- v50 = 0;
P* I$ D5 v" k# w! r' u! ] - *((_DWORD *)v1 + 402) = 2 * v19 + 1;6 t. }" ?/ D( T: B0 O8 C3 n6 |
- v20 = (*(int (__stdcall **)(int, _DWORD, signed int, int, const char *, const char *, const char *))(*(_DWORD *)v18 + 40))(
8 D- D* p T: Y2 h! z - v18,; R( T) }( R A/ e" `
- 0,
; x; u9 s# y+ V: h) y1 d4 z - 1,
8 t: }: ]4 w$ | P1 x* Y1 b( A e - v61,6 J. R2 T# l! o, l; g1 h
- v50,3 h) h e9 U' A! G: b# p+ D. f. ]
- v51,0 o/ D# \5 X5 N% K
- v52);
5 b0 F) L' q/ R' o, ^2 B8 i1 j1 Y - v21 = *((_DWORD *)v1 + 425);
6 F' k" H$ h" k+ A- x7 ] - v22 = v20 < 0;9 e% X( u" z& n
- v23 = *((_DWORD *)v1 + 384);
6 f" ^. v# t- t @" y3 a! b - v1[2316] = !v22;
( c9 V$ {; p: Y% V - v52 = v1 + 1540;
2 l. X, K! i" f* c" Q - v51 = v1 + 1584;
% V: I0 m5 `3 z0 g9 j - v1[2317] = (v21 >> 14) & 1;( \1 W0 K+ F! i1 i$ P: w2 W P
- v5 = (const char *)(*(int (__stdcall **)(int, _DWORD, signed int, HWND, signed int, const char *, const char *))(*(_DWORD *)v23 + 64))(# z, R' P( {, j& N+ J
- v23,1 v0 |' l9 X1 {
- 0,
& G7 H( s. l; k6 U) S, c - 1,
( u1 [: R" _" _$ C - hWnd,- I8 Y' L# u, R2 @/ J2 B6 I$ O
- 64,
" X/ i. K$ U# p D4 p5 K - v51,
) E1 U4 o9 r( I+ }5 t4 f& k - v52);
8 G# w- X7 s) q - if ( (signed int)v5 < 0 )- V m1 A- K" q* Y5 U5 k
- goto LABEL_27;
5 ^" [9 U P0 z B: t0 q9 Z- d/ _* S - if ( dword_558180 && ((v24 = *((_DWORD *)v1 + 425), v24 & 2) || v24 & 0x100) )3 j+ i' w6 P. z. y
- {1 U5 Y- j% F3 g
- v25 = *((_DWORD *)v1 + 609);
7 ]4 K9 O* S9 Y8 H - v26 = sub_418670(*((_DWORD *)v1 + 522));
- o( r1 O; ~( C7 O% H - v52 = (const char *)*((_DWORD *)v1 + 523);
0 B& ~5 w% W! G( h3 b/ t4 K: J - v27 = *((_DWORD *)v1 + 609);$ N7 w: N' M: e0 m8 @
- *((_DWORD *)v1 + 496) = v26;/ j8 L1 F3 m% g' R
- v28 = (const char *)sub_418670(v52);) o4 ]: p4 k2 Q6 K1 j! E- u; d6 l& o
- }% K8 F" N7 h/ g$ w
- else" e& v) X; A& d& M# e
- {1 G2 Z7 c, f9 O2 s! ]- w* ~
- v28 = (const char *)*((_DWORD *)v1 + 523);0 m8 d$ m( f2 O" S; U
- *((_DWORD *)v1 + 496) = *((_DWORD *)v1 + 522);; k# A8 X. G( I: i& ]8 _
- }
$ s9 }" d0 M' n8 j. Q3 a% i" t3 l - v29 = (const char *)*((_DWORD *)v1 + 496);
6 J. Z! T+ v* [( i* O - v52 = v28;) @6 @3 W/ [: f$ g
- v51 = v29;) ?' [/ R6 \3 E4 X- N+ @! c7 P8 `/ m
- v50 = "PostProcess Surface is %d x %d.\n";
" f* \' U/ Z1 |) \2 S7 [ - *((_DWORD *)v1 + 497) = v28;
% p3 l2 Q* C0 ?& B - v30 = (FILE *)sub_4D7E8F(v50);7 }) D' {- B& e ]% S0 U" ]
- fprintf(v30 + 1, v50);
4 H0 h- F1 k; C - (*(void (__stdcall **)(_DWORD, _DWORD, char *))(**((_DWORD **)v1 + 385) + 88))(*((_DWORD *)v1 + 385), 0, v1);
* N% x$ m# T( U# ` - sub_413100(v1);' ]+ N" E/ f( f9 I
- sub_411D60(v1);
2 X0 ~) Q( t3 x2 y7 i - v31 = malloc(0x78u);
+ [6 ^! z0 ?! f, ~7 h0 I - v32 = -0.5 / (double)*((signed int *)v1 + 522);
' p$ i& Z9 _. D - *((_DWORD *)v1 + 599) = v31;
* M% r, N" d' s - *((_DWORD *)v1 + 600) = 0;2 }) n( J6 u) e; O1 L
- *((float *)v1 + 526) = v32;
; [* n. B9 ?3 a; K - *((float *)v1 + 527) = -0.5 / (double)*((signed int *)v1 + 523);
9 ?7 Y, T3 Y# ~: W1 E' h - sub_411CC0(v1);
: X3 Z. g- I0 e- D8 e - v33 = v53;2 B# p f% r. R! E/ }* F+ _
- v5 = (const char *)(*(int (__stdcall **)(int, signed int, signed int, signed int, signed int, _DWORD *, _DWORD))(*(_DWORD *)dword_559B7C + 104))(% P. E" A$ H$ T. | S ^1 m
- dword_559B7C,
. j5 h! g. [2 m) ]9 {. F* U' n( A9 W - 80,
6 R8 p8 v2 A: t2 g E, M# y& W - 8,
# R8 `# D) f( S - 258,
, H3 M' s0 @1 [) H+ d - 1,
& d9 O% j6 J+ Z# w1 I1 b! [ - v53,
0 R" p6 k; B2 f% y - 0);
$ b$ O5 ^$ H2 }! e - if ( (signed int)v5 < 0 )
' J! a' W; v7 H3 m - {4 t8 G2 |) m. ?7 E0 c5 z
- LABEL_27:
+ @5 |; y- l9 X0 _' Q1 b# }2 E - v52 = v5;3 A7 P. ]. p8 ?' E' Y
- v51 = v4;
: M, F1 y% q% A0 [+ l2 g( Z - v55 = COERCE_FLOAT(&v51);" `' h( y# C1 S! Q9 E9 E, C
- sub_456DD0("Direct3D initialization failed.");
; F3 ], u& d+ Z: R$ ] - v50 = v48;/ p' D; v1 K" ?1 C
- v54 = &v50;
. F4 L7 \! Z# t- V2 C7 c9 L% w& m) V: \ - v62 = 1;$ w7 f- Q- d- b
- sub_456DD0("cCougarGraphics::cCougarGraphics");
5 Z( L4 \' x5 R- q, G) @ - v49 = 205;3 o! p7 a" t& Q% w+ O( W! z2 z
- LABEL_28:
+ d: N3 d4 e% `( y, x S3 S! P - v62 = -1;
8 _# @$ F5 \$ g8 N9 V W - sub_40CB30(1, ".\\source\\class_graphics.cpp", v49, (char)v50, (char)v51, v52);. U! U6 c6 A1 L# B3 o* N
- }+ \( n9 D% H+ f
- (*(void (__stdcall **)(_DWORD, _DWORD, _DWORD, _DWORD **, _DWORD))(*(_DWORD *)*v53 + 44))(*v53, 0, 0, &v53, 0);: ?9 D. b: }& K- K9 i/ {
- v58 = -1.0;4 }0 ~5 i' U8 ~/ } @4 q0 A2 y
- *(float *)v53 = -1.0;9 `% d' E' P* G" c/ `* U8 s# W1 [
- v59 = 1.0;& m% h* ^3 r: A% A; Z4 L$ {6 U
- *((float *)v53 + 1) = v58;
" w+ ^! I) v6 G3 e - v57 = -1.0;2 v! C% d4 P1 Z8 w* z1 D9 J6 @
- v58 = 1.0;8 [. M5 x" m$ t, Q9 e8 E
- *((float *)v53 + 2) = v59;$ R- n, b' u* u
- v59 = 1.0;3 T! E+ }0 i. b$ G
- v34 = (float *)v53;# y2 Z5 m8 o4 q( N
- v35 = v57;3 A9 d" A1 ?1 w* D3 V. b
- v57 = 1.0;1 D) p! i/ N7 g" Y. B
- v36 = v58;
0 s% f B# j6 U P" Y( U8 F - *((float *)v53 + 5) = v35;
+ g- ~7 m; [6 ^ x, r; j* j9 k - v37 = v59;
, I( U' o/ S5 H! W, }6 ^ - v59 = 1.0;
* o2 @' F0 V4 [& d% `* s. { - v34[6] = v36;
% O9 N- a; y; k( y; @ - v38 = v57;" x+ d4 ?3 j* I- U0 \0 B7 e) d6 [
- v58 = -1.0;
. _5 N5 p* |8 s$ l% D4 ~ - v34[7] = v37;, X$ v/ I# C a
- v39 = v58;) M- ~. I/ K7 X& X3 T- g1 I0 j
- v57 = 1.0;
' X5 [ g2 R1 a* z9 [ - v58 = 1.0;) C, E) Q4 H. G! s. I
- v40 = (float *)v53;7 d7 Z3 }/ Y8 g3 C# I# S
- *((float *)v53 + 10) = v38;
3 K# k& }8 `6 q - v41 = v59;5 g K! u' q9 P$ }. x
- v59 = 1.0;# w0 H; [, i: L7 B
- v40[11] = v39;- r% z& z. p; E+ e) s2 o; j
- v42 = v57;
1 j1 ^% g( |& c7 P. o# A - v40[12] = v41;
" c2 i9 f/ z) Q E% r9 m - v43 = v58;
5 l* a/ r( P% q- p - v44 = (float *)v53;1 |, O& u& V. x) ~2 O, p
- *((float *)v53 + 15) = v42;
- e: ?/ p! d) y8 o5 e2 P+ _ - v45 = v59;4 D4 ]9 @: f/ w* P) l" Y, }( K
- v44[16] = v43;6 t% l) S( a7 p, ~
- v44[17] = v45;* a, [- _ U, U$ ?: h, B
- *((float *)v53 + 3) = 0.000099999997;
: F0 N- k: s0 L; Y( y - *((float *)v53 + 4) = 1.0001;- `; t' c- F. S* | X7 m+ b
- *((float *)v53 + 8) = 0.000099999997;
. u3 m. s D8 h* X; I( p4 Z - *((float *)v53 + 9) = 0.000099999997;
! B. `+ k# H& ?% a1 n - *((float *)v53 + 13) = 1.0001;
( f# k- y* V: o1 t% E7 u% u - *((float *)v53 + 14) = 1.0001;/ T" \. A+ M2 P4 f9 T( P1 q
- *((float *)v53 + 18) = 1.0001;
+ i/ E: l$ t/ X' E% L1 I - *((float *)v53 + 19) = 0.000099999997;
# {" q7 {5 s3 D& a+ P - (*(void (__stdcall **)(_DWORD))(*(_DWORD *)*v33 + 48))(*v33);) m& D B* b2 h, }% g
- return 0;3 j M L- ~1 f+ W z0 a
- }
复制代码
* e- T. z! K4 m2 e. Z, L9 e用Cheatengin寻找一个字幕之后,在以下地方断下1 J2 P3 D3 f$ Z
- <div>ocd.exe+425B9 - 0FB6 D9 - movzx ebx,cl</div><div>004425B9</div>
复制代码 7 u9 c G2 c+ Z9 s7 u, e. M u
7 |: q) v, ~; ?9 X+ W3 m/ ^在ida pro下查看,是这个函数,从代码看a2字符像是索引号。0 v9 @' K; c; ~7 N$ f) `, D
稍后需要仔细分析。字幕显示函数应该在本函数上下。3 b4 \, h9 n& H+ F( C: `
- int __thiscall sub_442510(unsigned __int8 **this, int a2)
复制代码
5 _$ ?) {5 E+ F3 F1 ^% g7 ]# F% T* S/ i. t5 ]4 M
7 ~& [& C" g2 x5 l |