本帖最后由 shane007 于 2023-8-25 17:31 编辑 H! `/ r( ]4 _
8 \+ Z; w% V1 A# v$ D# K1 J- @
本游戏的引擎似乎有支持2套图形API,DirectDraw和Opengl,9 p& e: I3 c2 N9 L: _
游戏应该实际只用了其中1个,暂时作下记录。
- F @4 N, o! f1 q6 i
- a) p# z! l* Q# u2 {2 mDirectDraw是由bin目录下的ddraw2d.dll来完成的。
/ B! k: s! ]) ?以下是一处的初始化代码6 p v' ]. I6 v @1 ^, R& a. l
- CSpace:10015015
- G7 \5 {5 m2 B0 E' ]- _0 ~ - CSpace:10015015 loc_10015015: ; CODE XREF: sub_10014D50+2AD↑j6 K, u1 E5 Z, U$ H7 D3 S
- CSpace:10015015 mov [ebp+lpGUID], 0
6 O3 d7 b9 H/ S8 n" g" B - CSpace:1001501C mov eax, [ebp+dwNewLong]
1 B2 m" A) V2 u# K. |& Z2 _; Z - CSpace:1001501F mov ecx, [eax+230h]
. b) \; j/ l; ~& j$ T* P7 o1 i - CSpace:10015025 movzx edx, byte ptr [ecx+1Ah]9 B" \8 `! T# X( f7 s
- CSpace:10015029 test edx, edx
+ s& L: [/ d& L8 H - CSpace:1001502B jnz short loc_1001503C- X3 M3 J4 @$ X. w; ^! h5 K
- CSpace:1001502D mov eax, [ebp+dwNewLong]$ A' O+ w, k& E8 h
- CSpace:10015030 mov ecx, [eax+230h]
, B* J4 _: e0 @7 y# r9 {" S" r - CSpace:10015036 add ecx, 8- L4 j8 ]/ s) U5 P7 D
- CSpace:10015039 mov [ebp+lpGUID], ecx' M1 H m I; h6 @. F4 A
- CSpace:1001503C8 z) Q! ?" M8 F2 U: T
- CSpace:1001503C loc_1001503C: ; CODE XREF: sub_10014D50+2DB↑j" E- h$ h$ Q+ f% e
- CSpace:1001503C mov eax, [ebp+dwNewLong]: s% z3 X) w5 T6 u. }5 @ Q% z! F
- CSpace:1001503F mov ecx, [eax+230h]& { N8 Q4 X9 a. E* D9 }
- CSpace:10015045 mov edx, [ecx+1Ch]* Q, w- d/ m9 y* l& x' `1 Y4 U
- CSpace:10015048 push edx
) k3 x+ p2 Y1 X9 x$ A4 b - CSpace:10015049 mov eax, [ebp+dwNewLong]
9 v) K) q8 J: x6 F - CSpace:1001504C mov ecx, [eax+230h]
( b$ M2 D; N; V {% {( u - CSpace:10015052 mov edx, [ecx+20h]: P3 b2 v8 \: s; J& z2 q
- CSpace:10015055 push edx7 y' T1 X9 w8 @+ d, A' h4 [6 E# ~. c+ Z- B
- CSpace:10015056 push offset aUsingDirectdra ; "Using DirectDraw %s (%s)"
/ b9 k# V3 f/ L/ g3 c" E& d( Q - CSpace:1001505B push 3
( U% B3 _; I* k! A - CSpace:1001505D mov eax, [ebp+dwNewLong]
0 [5 w. C2 K. j4 c3 [9 n. N& F9 V - CSpace:10015060 push eax
; N/ S/ Y G+ _; W - CSpace:10015061 call sub_1003882A
" b4 e% a" C, w; z# C - CSpace:10015066 add esp, 14h4 C. b- `& [8 E$ n! D9 `
- CSpace:10015069 push 0 ; pUnkOuter: S* q" `- ?+ h5 b2 ?& M8 }2 z
- CSpace:1001506B mov eax, [ebp+dwNewLong]
4 `, e0 e" J0 l- J- i - CSpace:1001506E add eax, 1DCh) S' C5 ~ X2 k9 Q$ p
- CSpace:10015073 push eax ; lplpDD
; A/ B$ R. d/ q7 Q) a - CSpace:10015074 mov ecx, [ebp+lpGUID]# b, U9 i+ k c/ B, H5 ?
- CSpace:10015077 push ecx ; lpGUID
+ j5 A+ E/ l% o# `2 K! [ - CSpace:10015078 call j_DirectDrawCreate
+ ]! M, A7 b* N8 N. v6 t - CSpace:1001507D mov [ebp+var_14], eax
+ N* \% R; J; \" d( | - CSpace:10015080 cmp [ebp+var_14], 0
1 @4 u# n1 h6 r: L - CSpace:10015084 jz short loc_1001509E# |0 C V& ^5 _+ _7 R
- CSpace:10015086 push offset aDirectdrawcrea ; "DirectDrawCreate FAILED (Code: %08lx)\n"" {1 ^$ O# Z& K: @$ @) _* C
- CSpace:1001508B mov eax, [ebp+var_14]" }7 I+ F+ C" _$ X0 u
- CSpace:1001508E push eax5 A$ }1 r/ a/ Y5 G
- CSpace:1001508F mov ecx, [ebp+dwNewLong]
1 s' q! D4 t- [# { - CSpace:10015092 call sub_10038F3C
9 k6 p# D9 B3 g- b) Y5 R6 g - CSpace:10015097 xor al, al. w) }( ?: t% _5 M. \
- CSpace:10015099 jmp loc_10015173
复制代码 $ A: o# \$ Q3 f/ R( t
9 q0 Q- h. Z0 n5 C# L
7 h/ _1 s! i' F b0 M2 `' B
我用3D Analyzer对opengl API的调用进行跟踪之后,输出了不少log.2 s$ {) g) n9 | I' [7 a6 a
记录到log_GL.out文件中。以下是摘录的一段。
! S- Q- t& @9 i" [我认为这个游戏大概率使用的是opengl API,程序修改的切入点,还需要进一步分析。6 H: U& {- ~( n8 [, Q# X) ], v
以前Skywalker 说 这个游戏不能用Hypersnap抓图,这也算是个使用opengl API的侧面证明吧?
1 q9 R4 |/ @" {& {0 C6 p+ l: m- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>: \) k7 K! @ g+ a3 H* r
- glTexEnvi, GLenum<8960>, GLenum<34176>, GLint<5890>
1 `0 Q8 R; X; [0 G- {: I6 z! X - glTexEnvi, GLenum<8960>, GLenum<34192>, GLint<768>1 O3 \( v& V8 k8 C9 H, n, L
- glTexEnvi, GLenum<8960>, GLenum<34177>, GLint<34167>- w8 n5 p L1 K8 r
- glTexEnvi, GLenum<8960>, GLenum<34193>, GLint<768>
1 [0 U O/ b9 s& ]% p - glTexEnvi, GLenum<8960>, GLenum<34161>, GLint<8448>
+ `" a+ r9 u* ^8 l. [7 ^4 D - glTexEnvf, GLenum<8960>, GLenum<34163>, GLfloat<1065353216>
2 w5 G2 G- H- v. R. G: _. W) o - glTexEnvi, GLenum<8960>, GLenum<34184>, GLint<5890>
$ h. d3 z4 o; D+ ]: N1 |+ P4 } - glTexEnvi, GLenum<8960>, GLenum<34200>, GLint<770>8 s2 @ H* X" l/ z
- glTexEnvi, GLenum<8960>, GLenum<34185>, GLint<34167>
" |, a' F' L" t6 Y - glTexEnvi, GLenum<8960>, GLenum<34201>, GLint<770>
! @" t* v- C }% z6 g- R - glTexEnvi, GLenum<8960>, GLenum<34162>, GLint<8448>! u3 `# V/ X5 [' e0 J
- glTexEnvf, GLenum<8960>, GLenum<3356>, GLfloat<1065353216>
/ n9 A; k" t- a( J7 Z" g - glClear, GLbitfield<256>8 @$ ~& u9 w7 g0 [/ k# M7 c* ?
- glShadeModel, GLenum<7424>& W: f- F% Y9 H& y9 t6 w4 ~' D
- glDisable, GLenum<2929>' `8 X: @% e9 `& \, j
- glDisable, GLenum<3008>0 v0 s3 n$ P# N! P! P/ ]
- glDisable, GLenum<2896>; X. i0 @9 @: n3 i
- glEnable, GLenum<3042>( v, R* U* M! G3 X1 k& \0 n
- glDisable, GLenum<3553>
$ h6 z! U+ E% L$ K - glBindTexture, GLenum<3553>, GLuint<631># L9 a+ Y4 W8 h C, `. y0 s
- glTexParameteri, GLenum<3553>, GLenum<10240>, GLint<9729>/ w- T3 ]1 T# @# w* m: m8 r* \4 \
- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
* f) M3 _2 N3 T4 @* y9 Q& ` - glClear, GLbitfield<16384>
9 d) }( P# B+ t$ O4 E* K - glTexSubImage2D, GLenum<3553>, GLint<0>, GLint<0>, GLint<0>, GLsizei<512>, GLsizei<384>, GLenum<6408>, GLenum<5121>, CGLvoidP<266776608>
1 T7 x. `+ G/ E: k - glEnable, GLenum<3553>
1 Z F8 d3 N# j& w1 M( m8 f& L) m - glBegin, GLenum<7>3 k6 B$ `4 Q) X( e. w' C1 x
- glColor4f, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>+ l$ d8 \7 d5 O* B( b
- glTexCoord2f, GLfloat<0>, GLfloat<0>
+ T {0 T1 x+ w7 d. _3 u% L - glVertex2i, GLint<0>, GLint<768>3 V* p( E$ f6 m) @! }. C
- glTexCoord2f, GLfloat<1065353216>, GLfloat<0>
# ?. a& Y' F3 N5 Q4 X - glVertex2i, GLint<1024>, GLint<768>
$ ]6 |* X; Z5 j% a U. B( X - glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>
9 x/ F! V( A% h2 t - glVertex2i, GLint<1024>, GLint<-256>
3 S+ |( T( A5 v4 L6 I3 j4 m - glTexCoord2f, GLfloat<0>, GLfloat<1065353216>% p* Q' Q8 F# G3 Y
- glVertex2i, GLint<0>, GLint<-256>& k$ M' T# k v' _# L# W. { e
- glEnd
s# B1 D, H; b# C n - glShadeModel, GLenum<7424>& s& W0 }0 I" q: \' G- J9 y. D( y0 q
- glGetError! V4 r2 K- Z/ Z; B
- glDisable, GLenum<2929>
8 Q! [8 H% ]# I* w! e8 g: i2 t - glGetError! r, {/ z# Y- f. d7 s4 |/ R
- glBlendFunc, GLenum<770>, GLenum<771>9 l! H" [) \- c" f$ ?
- glGetError: ?9 v2 M9 c, @: ]. p
- glEnable, GLenum<3042>
/ |" {: A' O2 t/ J1 c+ o0 V8 F" V - glGetError0 }; n9 \/ @- M. p5 D
- glDisable, GLenum<3553>
. v* [$ U% r$ y. U: a4 A - glGetError
! U1 p3 b3 ^2 d9 k% ]. f - glBegin, GLenum<7>
/ G' ?: B' A! ? - glColor4f, GLfloat<0>, GLfloat<0>, GLfloat<0>, GLfloat<1059883844>- S3 X( t2 n$ r" j* u3 l) [
- glTexCoord2f, GLfloat<0>, GLfloat<0>$ s3 y& t; K7 n9 } e) A6 G+ }. v
- glVertex2i, GLint<0>, GLint<768>
# F8 H2 f: }" q5 z* s0 J5 ~5 L3 | |6 w - glTexCoord2f, GLfloat<1065353216>, GLfloat<0>
/ c; T" B# s( h" B8 j. Y - glVertex2i, GLint<1024>, GLint<768>) x6 E# a% N) j" A
- glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>
' a2 p: f- V; E% C4 c - glVertex2i, GLint<1024>, GLint<0>. l9 n8 {1 k a4 L h
- glTexCoord2f, GLfloat<0>, GLfloat<1065353216>
T1 L8 h( Q) z/ J" m! Q6 h5 x. F9 m - glVertex2i, GLint<0>, GLint<0>
$ N% _# N% F: \/ n - glEnd# [' H4 p& h Q' M% v% V
- glGetError. t/ J8 x, M7 e7 E
- glEnable, GLenum<3553>& K6 u U8 Y2 A8 v! i6 d O
- glGetError# d+ H p+ j# U9 z
- glFlush
4 U: U3 S& ~6 [' W! J' Y - wglSwapBuffers% [4 z# p. g4 L6 C* w" Y+ E
- ---------------------------
, I* e8 E. C, B+ p0 Z& b M - , HDC<-33484711>) h- r( a% H. F4 O& J; Y
- wglGetPixelFormat, HDC<-33484711>
! [! O9 R$ I6 H3 V - glMatrixMode, GLenum<5889>
& O1 z% {+ J8 b5 p# m - glLoadIdentity# f2 H$ W* B4 C( b& {% G8 ~$ m+ u
- glOrtho, GLdouble<00>, GLdouble<01083179008>, GLdouble<00>, GLdouble<01082654720>, GLdouble<0-1074790400>, GLdouble<01076101120>( E9 ~5 ?& A& r
- glViewport, GLint<0>, GLint<0>, GLsizei<1024>, GLsizei<768>
( U% ]. v$ N! ~" O8 g; q% ^ - glMatrixMode, GLenum<5888>5 `0 A% X$ y1 p1 a. I- j
- glLoadIdentity
- t1 R# ]. O" m2 V& E; \! x - glColor3f, GLfloat<1065353216>, GLfloat<0>, GLfloat<0>6 M W; g# {/ y7 a2 J4 O5 u8 q* u
- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
# h/ a3 e, X( [" N/ Y5 ? - glTexEnvi, GLenum<8960>, GLenum<34176>, GLint<5890>5 z9 t0 S7 ]$ @: c
- glTexEnvi, GLenum<8960>, GLenum<34192>, GLint<768>, Z% \/ Q5 Q: W" u. v
- glTexEnvi, GLenum<8960>, GLenum<34177>, GLint<34167>
# ~4 w3 N. S! W! n4 m- b& v: k0 } - glTexEnvi, GLenum<8960>, GLenum<34193>, GLint<768>$ ?' W; j2 E9 y
- glTexEnvi, GLenum<8960>, GLenum<34161>, GLint<8448>* @+ O. W8 |) r6 z" Y1 m; b
- glTexEnvf, GLenum<8960>, GLenum<34163>, GLfloat<1065353216>5 T$ ]/ |8 R6 p# B/ W" M
- glTexEnvi, GLenum<8960>, GLenum<34184>, GLint<5890>' A; `. W o0 a4 `. L1 q- C9 o
- glTexEnvi, GLenum<8960>, GLenum<34200>, GLint<770>
7 ^3 @4 r i, \$ B - glTexEnvi, GLenum<8960>, GLenum<34185>, GLint<34167>
' E0 }" A$ _: m+ @ - glTexEnvi, GLenum<8960>, GLenum<34201>, GLint<770>
+ S- S5 U6 C$ s3 x: D7 g - glTexEnvi, GLenum<8960>, GLenum<34162>, GLint<8448>
7 i6 @. c0 Q2 f* U - glTexEnvf, GLenum<8960>, GLenum<3356>, GLfloat<1065353216>+ K! K& d$ Q( H# v! K3 z
- glClear, GLbitfield<256>
! Z% [6 H+ f+ D% @! a* F - glShadeModel, GLenum<7424>; ?& }4 p0 A6 T6 o/ f7 C. i
- glDisable, GLenum<2929>5 r! H v. y$ k
- glDisable, GLenum<3008>
, D2 [) e* ~0 n( I5 A4 | - glDisable, GLenum<2896>
% q2 n' u) m) U4 ?) b, J& Q0 | - glEnable, GLenum<3042>
. B1 Q5 i8 \' O j - glDisable, GLenum<3553>% C; ]9 c1 @4 J4 z# @7 t5 U6 P/ K( q
- glBindTexture, GLenum<3553>, GLuint<631>
7 x% k9 u% E i: F0 a- B$ M) L - glTexParameteri, GLenum<3553>, GLenum<10240>, GLint<9729>
9 F1 `! u6 w. B* i5 A - glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
) [7 U$ u' ^; [$ J1 x* M: b - glClear, GLbitfield<16384>8 [+ W% o# [. Z7 S
- glTexSubImage2D, GLenum<3553>, GLint<0>, GLint<0>, GLint<0>, GLsizei<512>, GLsizei<384>, GLenum<6408>, GLenum<5121>, CGLvoidP<266776608>, ]4 o- h' M: p0 i$ ~$ R8 m
- glEnable, GLenum<3553>: v# X, \) Y+ C
- glBegin, GLenum<7>' I5 T$ i0 z9 X4 j; d
- glColor4f, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>
' C! ?3 t# N$ c: o4 K: i - glTexCoord2f, GLfloat<0>, GLfloat<0># Y& V9 G8 u- x0 o
- glVertex2i, GLint<0>, GLint<768>
6 ~ X) |) |7 H3 {4 i" h* H - glTexCoord2f, GLfloat<1065353216>, GLfloat<0>
5 l5 i) O& r9 R: F2 g3 ?" G" [5 g9 t2 Q3 P - glVertex2i, GLint<1024>, GLint<768>
' n. F! F5 c! A4 n9 ^4 Y, N - glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>$ V: \( K& f0 b9 c
- glVertex2i, GLint<1024>, GLint<-256>
7 W) g: P" _% R+ | - glTexCoord2f, GLfloat<0>, GLfloat<1065353216>. }2 P, i* H4 M S4 T- n$ c
- glVertex2i, GLint<0>, GLint<-256>
$ }8 ~. U: c& _& ]' \ o
复制代码
$ a2 E. O1 O; e2 q% f, \" I3 V; h7 s$ `, G5 X
|