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