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