本帖最后由 shane007 于 2023-8-25 17:31 编辑
$ d$ i) P2 `4 H! T Y% [) I s q. |8 W8 f3 N) _
本游戏的引擎似乎有支持2套图形API,DirectDraw和Opengl,# }/ T8 c( ?# m! R0 P* A
游戏应该实际只用了其中1个,暂时作下记录。
9 M% k0 b0 B a8 r+ y, D# m0 \6 B( q0 [. L
DirectDraw是由bin目录下的ddraw2d.dll来完成的。
2 D; x& s! e8 R! v9 w* |# d以下是一处的初始化代码
7 D- L0 C* t3 f, u2 d1 s- CSpace:10015015
j; y* ?- J( ^0 z+ K - CSpace:10015015 loc_10015015: ; CODE XREF: sub_10014D50+2AD↑j
! _; p( l2 n; H' ?/ s - CSpace:10015015 mov [ebp+lpGUID], 0
3 l4 l9 ]9 G" E; L" x( s" D9 C: e5 V - CSpace:1001501C mov eax, [ebp+dwNewLong]3 \# {% ?% {- _/ W6 p
- CSpace:1001501F mov ecx, [eax+230h]
t+ i8 j& G! ~2 u1 m8 h - CSpace:10015025 movzx edx, byte ptr [ecx+1Ah]
% I; ?* j. F/ i - CSpace:10015029 test edx, edx" C' k5 r' `9 y3 j
- CSpace:1001502B jnz short loc_1001503C7 V( ?& q, Z$ o! v+ E
- CSpace:1001502D mov eax, [ebp+dwNewLong]$ D9 z( V7 W5 B5 G2 O2 F
- CSpace:10015030 mov ecx, [eax+230h]; e$ F9 U) y e" n6 u
- CSpace:10015036 add ecx, 8
, Y2 _$ X; n U% w/ ? - CSpace:10015039 mov [ebp+lpGUID], ecx
; ]9 N) M: U1 p3 n. B - CSpace:1001503C
" w& D- \/ H" ^/ r, g - CSpace:1001503C loc_1001503C: ; CODE XREF: sub_10014D50+2DB↑j J. Z$ F* s0 |3 B: u& I1 V0 E
- CSpace:1001503C mov eax, [ebp+dwNewLong]6 @: L" q1 E1 B5 L
- CSpace:1001503F mov ecx, [eax+230h]
8 f2 j; c n3 |, B8 a5 u - CSpace:10015045 mov edx, [ecx+1Ch]; J; s& V( }/ z
- CSpace:10015048 push edx M* T5 {7 _8 m
- CSpace:10015049 mov eax, [ebp+dwNewLong]
3 r/ ~; u1 V) o. D' | - CSpace:1001504C mov ecx, [eax+230h]
% E! S5 Z2 k9 Q5 ~& H - CSpace:10015052 mov edx, [ecx+20h]
6 z" U9 {7 ~, g( e - CSpace:10015055 push edx# j2 E! G1 _6 u8 r
- CSpace:10015056 push offset aUsingDirectdra ; "Using DirectDraw %s (%s)"
2 F2 `- q4 |4 W - CSpace:1001505B push 3: P5 k$ F ~0 h. k V- t; p" W
- CSpace:1001505D mov eax, [ebp+dwNewLong]5 `: _* E3 L; F" [4 j2 Q$ v
- CSpace:10015060 push eax4 D0 k5 y8 n! s: t# O; N% d
- CSpace:10015061 call sub_1003882A
5 W, A; J' g, v- [0 n$ S/ ] - CSpace:10015066 add esp, 14h
, L {# O& H+ T! s - CSpace:10015069 push 0 ; pUnkOuter
$ i' b9 t' \5 H- A - CSpace:1001506B mov eax, [ebp+dwNewLong]
+ T, @- F* L' ` - CSpace:1001506E add eax, 1DCh# A8 d# b3 Z. ?8 o+ b( p
- CSpace:10015073 push eax ; lplpDD8 _" y4 i, ^' R+ `; N3 O( a9 G( Q7 Y
- CSpace:10015074 mov ecx, [ebp+lpGUID]
7 u5 H2 n$ L) R+ P9 b# i - CSpace:10015077 push ecx ; lpGUID- @4 @5 u7 r+ a' S
- CSpace:10015078 call j_DirectDrawCreate
' a8 a$ x( u( G# s1 M - CSpace:1001507D mov [ebp+var_14], eax
: i; n8 k3 P2 W9 \ - CSpace:10015080 cmp [ebp+var_14], 03 W8 a! g2 d2 w( h
- CSpace:10015084 jz short loc_1001509E! @' p8 b! V7 N" Y
- CSpace:10015086 push offset aDirectdrawcrea ; "DirectDrawCreate FAILED (Code: %08lx)\n"3 e# x: l' U' r' \. a
- CSpace:1001508B mov eax, [ebp+var_14]
/ r, }" y: g' C) N$ E- y* w$ I6 b - CSpace:1001508E push eax$ Z: O0 C( B; l) Y8 t* ?2 M' ^
- CSpace:1001508F mov ecx, [ebp+dwNewLong]$ A# x4 c; [, E: H
- CSpace:10015092 call sub_10038F3C& p5 L0 {/ A- ~7 a0 e. O6 I/ d
- CSpace:10015097 xor al, al
$ X; S7 L1 K7 V0 f0 V - CSpace:10015099 jmp loc_10015173
复制代码
9 ]: p% ?+ R; w
5 a. J h7 y9 n7 q2 Q Q& L2 L, `
) j% W1 ^ C. V8 X* q, c! Y我用3D Analyzer对opengl API的调用进行跟踪之后,输出了不少log.7 k* a" [% _& L& y1 k: p
记录到log_GL.out文件中。以下是摘录的一段。
& k2 n# D/ k8 M) j我认为这个游戏大概率使用的是opengl API,程序修改的切入点,还需要进一步分析。, K* c4 d% [9 d- d$ c1 S
以前Skywalker 说 这个游戏不能用Hypersnap抓图,这也算是个使用opengl API的侧面证明吧?
) y' R$ F! ^. D& F8 ]- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>7 i9 m9 @- r8 h
- glTexEnvi, GLenum<8960>, GLenum<34176>, GLint<5890>
' r N8 f& M! c' J' ^) ] - glTexEnvi, GLenum<8960>, GLenum<34192>, GLint<768>+ t7 E: i& K3 b0 @+ x2 E" M
- glTexEnvi, GLenum<8960>, GLenum<34177>, GLint<34167>+ A* ^" K9 k* ^1 f- q9 k+ I
- glTexEnvi, GLenum<8960>, GLenum<34193>, GLint<768>9 G4 Q$ c4 y4 g" Q, G. q7 j
- glTexEnvi, GLenum<8960>, GLenum<34161>, GLint<8448>& M& ?4 ~2 M3 t o9 T+ S( X% _
- glTexEnvf, GLenum<8960>, GLenum<34163>, GLfloat<1065353216>" @" j k) w- J, g/ V& T. z
- glTexEnvi, GLenum<8960>, GLenum<34184>, GLint<5890>
! _, }6 `1 a) H6 S# e B - glTexEnvi, GLenum<8960>, GLenum<34200>, GLint<770>2 G* ?! z$ @$ R" N: F$ r4 F
- glTexEnvi, GLenum<8960>, GLenum<34185>, GLint<34167>
6 ~* F6 P$ s" u |/ _ - glTexEnvi, GLenum<8960>, GLenum<34201>, GLint<770>
2 I% @2 W1 L+ `: s - glTexEnvi, GLenum<8960>, GLenum<34162>, GLint<8448>
$ L1 a/ Q5 p. J, S! L - glTexEnvf, GLenum<8960>, GLenum<3356>, GLfloat<1065353216>
9 z& y' v& k/ x9 c - glClear, GLbitfield<256>% C, w) D! x* x+ ?; D6 s
- glShadeModel, GLenum<7424>% V: Z6 ^8 S$ n+ w6 |2 F2 b! M0 h; q: f
- glDisable, GLenum<2929>
5 s5 \5 _, }4 j" _ - glDisable, GLenum<3008>2 z. _0 D3 b+ G2 [/ v% I% k& s
- glDisable, GLenum<2896>2 T& R8 k& |- t) [. @
- glEnable, GLenum<3042>
. y/ J* z( a9 U! Q% p1 K, @0 Y - glDisable, GLenum<3553>
1 X$ {, [2 l- J4 u$ A+ V - glBindTexture, GLenum<3553>, GLuint<631>
5 G' U9 m6 m1 y) j+ } - glTexParameteri, GLenum<3553>, GLenum<10240>, GLint<9729>- h" k% M4 U. [% a# p( d U% [
- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>; D0 u) C9 Q' a) P( j+ h9 w
- glClear, GLbitfield<16384>. T ]& d8 W9 f4 c I2 Q4 l
- glTexSubImage2D, GLenum<3553>, GLint<0>, GLint<0>, GLint<0>, GLsizei<512>, GLsizei<384>, GLenum<6408>, GLenum<5121>, CGLvoidP<266776608>
# H7 S% Y1 C& b* w2 X - glEnable, GLenum<3553>& J9 F! ]( o; g1 S+ u
- glBegin, GLenum<7>: ~4 W7 i4 H4 K* X0 a
- glColor4f, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>1 U* S H0 Q- s; U; _, D
- glTexCoord2f, GLfloat<0>, GLfloat<0>/ ?; Y$ M& w( p+ G
- glVertex2i, GLint<0>, GLint<768>
" l) M8 I) v8 o+ ?1 o, U - glTexCoord2f, GLfloat<1065353216>, GLfloat<0># ^6 J7 J2 A9 V* ^5 Q
- glVertex2i, GLint<1024>, GLint<768>
: M" _# x% {5 M - glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>$ M/ R0 M$ D8 ]+ `7 f7 `
- glVertex2i, GLint<1024>, GLint<-256>
6 ?7 Y, A4 i# c& ^- _9 T$ p" F9 e - glTexCoord2f, GLfloat<0>, GLfloat<1065353216>
; |% X+ m0 w) L/ a) l8 h - glVertex2i, GLint<0>, GLint<-256>
) B) c! Z# B- g - glEnd$ J# w4 F6 o. B" x0 |- u
- glShadeModel, GLenum<7424>; B( u! n" o8 }+ Q' F
- glGetError2 c& x) t4 ?. b! B# u: {) s0 u
- glDisable, GLenum<2929>2 |8 q; q2 H/ J+ J
- glGetError
0 W# ~7 o2 G* A2 s - glBlendFunc, GLenum<770>, GLenum<771>
7 h" G' {6 s$ ]8 l - glGetError2 Q6 g0 k' `( J
- glEnable, GLenum<3042>
" u# N9 l# p& f3 s; n - glGetError
# l' }8 M, l, O - glDisable, GLenum<3553>% W1 `8 ?% Y& X1 l: U
- glGetError* c5 {& g5 ]9 v; {* R. T
- glBegin, GLenum<7>6 s4 X+ O! g& Q" q
- glColor4f, GLfloat<0>, GLfloat<0>, GLfloat<0>, GLfloat<1059883844>- a2 K3 v4 N# N- ^! m/ J" {
- glTexCoord2f, GLfloat<0>, GLfloat<0>
5 j3 z6 [, k: n- b - glVertex2i, GLint<0>, GLint<768>
3 U5 Y' ~3 l+ i( [# B+ b- B0 X - glTexCoord2f, GLfloat<1065353216>, GLfloat<0>
& N. t; J( ~. Z! u; [ - glVertex2i, GLint<1024>, GLint<768>
6 `$ e+ ~) c+ j/ g7 {2 |; j; O2 E2 M0 ] - glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>
6 H9 I+ y& G2 Q" L/ c# h! Q x - glVertex2i, GLint<1024>, GLint<0>
; r& H/ E* H$ q! C0 g - glTexCoord2f, GLfloat<0>, GLfloat<1065353216>7 V8 b6 {3 V9 E/ A% L3 y9 r
- glVertex2i, GLint<0>, GLint<0>; d8 k/ y6 r- l! D+ l& t& V' J& U
- glEnd
# [% ^+ ?( v; ]+ X - glGetError9 u& C4 M7 m2 C+ v, d4 p
- glEnable, GLenum<3553>; o; I- p( E# j* G7 {
- glGetError
, B& y, r8 ^# T1 s- w# f" D# _ - glFlush. o; v: a* K* z, a. c" }- p
- wglSwapBuffers
# L, h/ K4 ?2 ~- x, N) }6 M - ---------------------------2 g P# K* |. G: f) D4 ?) r5 G
- , HDC<-33484711>2 z N- [6 G/ f9 R. | V
- wglGetPixelFormat, HDC<-33484711>
' [0 J9 D( y# m. W4 M - glMatrixMode, GLenum<5889>
6 ?' F3 I9 G3 o# Z! i3 j - glLoadIdentity
3 x j/ g" J. O' ~$ U. e. x2 W - glOrtho, GLdouble<00>, GLdouble<01083179008>, GLdouble<00>, GLdouble<01082654720>, GLdouble<0-1074790400>, GLdouble<01076101120>
: d% }6 r' H, O. [8 [( a - glViewport, GLint<0>, GLint<0>, GLsizei<1024>, GLsizei<768>
; y; g' C/ @; t9 S* y4 q - glMatrixMode, GLenum<5888>& ^6 o2 U% Y7 a1 L0 n6 J7 C8 E0 Z
- glLoadIdentity
0 @( k5 r1 H; o$ F- N% o% Y - glColor3f, GLfloat<1065353216>, GLfloat<0>, GLfloat<0>" x# H$ Q2 m" x
- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
2 I' ?& x+ M6 o0 t - glTexEnvi, GLenum<8960>, GLenum<34176>, GLint<5890>
5 b+ E I3 P+ r" R+ e7 Y5 F8 g* I - glTexEnvi, GLenum<8960>, GLenum<34192>, GLint<768>
( [7 w. U1 E, Y7 _4 t1 V8 ^ - glTexEnvi, GLenum<8960>, GLenum<34177>, GLint<34167>- x9 l. s0 s/ U% c e0 }; P
- glTexEnvi, GLenum<8960>, GLenum<34193>, GLint<768>( S# t7 E! u3 ?( u( W v. q3 n6 @
- glTexEnvi, GLenum<8960>, GLenum<34161>, GLint<8448>! O. y) E" f7 E0 Z/ P. n$ n
- glTexEnvf, GLenum<8960>, GLenum<34163>, GLfloat<1065353216>0 H) x# _! H. q/ }3 F: f
- glTexEnvi, GLenum<8960>, GLenum<34184>, GLint<5890>. x" o8 X: U |
- glTexEnvi, GLenum<8960>, GLenum<34200>, GLint<770>
. \7 ?, O2 @: T; R+ o - glTexEnvi, GLenum<8960>, GLenum<34185>, GLint<34167>$ U$ P+ C' C* B4 D
- glTexEnvi, GLenum<8960>, GLenum<34201>, GLint<770>
0 U" J; {' X# y) F1 H6 z - glTexEnvi, GLenum<8960>, GLenum<34162>, GLint<8448>/ u4 R2 K7 n2 F& N0 L
- glTexEnvf, GLenum<8960>, GLenum<3356>, GLfloat<1065353216>; e4 K) v2 ]" [ k+ ]8 }
- glClear, GLbitfield<256>( |* t, I8 |, D3 r) D
- glShadeModel, GLenum<7424>
+ R" e3 d7 ~; P" D7 Q0 U# ^ - glDisable, GLenum<2929>
I& |- M/ m2 b! N - glDisable, GLenum<3008>
' w7 E' Q. r9 C% `% N- ^ - glDisable, GLenum<2896>2 B8 z2 c c" r( r' N, ?( T9 J
- glEnable, GLenum<3042>8 ~( n* s$ e- ]2 |
- glDisable, GLenum<3553>
/ E" }9 M. m/ S. @ n Y; _. f" Z - glBindTexture, GLenum<3553>, GLuint<631>
; l) ?3 w! p% L2 c5 Y$ l: r - glTexParameteri, GLenum<3553>, GLenum<10240>, GLint<9729>
; k$ M9 a6 D+ W - glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
$ c5 d! x- s- U8 c. @ - glClear, GLbitfield<16384>: z, ?; p9 |* p, t
- glTexSubImage2D, GLenum<3553>, GLint<0>, GLint<0>, GLint<0>, GLsizei<512>, GLsizei<384>, GLenum<6408>, GLenum<5121>, CGLvoidP<266776608>+ v' X. J* z8 i6 \
- glEnable, GLenum<3553>% c7 d4 m E6 X6 t
- glBegin, GLenum<7>
+ q! q: j r8 F( @ - glColor4f, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>
* L3 Q: |7 |! s3 p - glTexCoord2f, GLfloat<0>, GLfloat<0>
- q" j" x2 _" r0 ] a - glVertex2i, GLint<0>, GLint<768>
3 s9 J, g5 c5 Y/ g - glTexCoord2f, GLfloat<1065353216>, GLfloat<0>7 _. c0 B+ E- I7 H3 A6 P
- glVertex2i, GLint<1024>, GLint<768>6 m1 m5 a3 O5 G6 s# s
- glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>
3 _! `/ s: R) R/ W7 b+ @$ l - glVertex2i, GLint<1024>, GLint<-256>6 N8 y; e% ?3 T% M
- glTexCoord2f, GLfloat<0>, GLfloat<1065353216># d! x" E5 W+ z
- glVertex2i, GLint<0>, GLint<-256>
7 B# w8 ~6 S( q6 { l
复制代码
5 L. r( z0 k( Z# Q/ r4 a* s; Z5 A# ^
8 t, P! s' }9 |# H0 @# E0 Z0 v S |