本帖最后由 shane007 于 2023-8-25 17:31 编辑
' v# \/ i3 a0 u4 h8 v; W' L, A
. K+ Y. l# Y2 a% n) g0 j# b本游戏的引擎似乎有支持2套图形API,DirectDraw和Opengl,7 D* P2 h" q d7 J2 E; r$ |$ ?! [1 l
游戏应该实际只用了其中1个,暂时作下记录。
L% n8 R8 J6 K# \+ B! c2 \
( B- [; l1 L# `4 W rDirectDraw是由bin目录下的ddraw2d.dll来完成的。4 }* E, E) C$ A( K [; U
以下是一处的初始化代码7 e6 n, e3 B4 c' f5 R
- CSpace:10015015
& ?7 b6 q' r# Y" W/ V; h - CSpace:10015015 loc_10015015: ; CODE XREF: sub_10014D50+2AD↑j
1 r. s" _4 F+ O) _ - CSpace:10015015 mov [ebp+lpGUID], 0- o0 d# |, w) _7 T/ a0 d) l
- CSpace:1001501C mov eax, [ebp+dwNewLong]; j Q/ |5 o* v1 {4 V
- CSpace:1001501F mov ecx, [eax+230h]
2 {& D( A1 x( [# Z2 D% n, l* L4 y - CSpace:10015025 movzx edx, byte ptr [ecx+1Ah]: ^0 O" Y! e$ y( c5 K% w
- CSpace:10015029 test edx, edx% H5 O7 C' J2 R$ [
- CSpace:1001502B jnz short loc_1001503C
, R* H/ d0 d; F' g* V - CSpace:1001502D mov eax, [ebp+dwNewLong]' |6 @+ _3 W. `* t; p! f
- CSpace:10015030 mov ecx, [eax+230h]
! ]: q% T- W0 ] - CSpace:10015036 add ecx, 8( x5 o$ j& ?0 D; K
- CSpace:10015039 mov [ebp+lpGUID], ecx
5 j: ~8 ~4 L! i5 M$ z( h, e - CSpace:1001503C0 Z4 O* `+ B+ {4 n
- CSpace:1001503C loc_1001503C: ; CODE XREF: sub_10014D50+2DB↑j
% t2 {- C& i8 `) m) T+ s0 x9 N+ o - CSpace:1001503C mov eax, [ebp+dwNewLong]
. E% k4 G0 a# G$ k9 H8 `5 b4 { - CSpace:1001503F mov ecx, [eax+230h]6 B: G$ F" |' ]0 `+ x' n$ R, P
- CSpace:10015045 mov edx, [ecx+1Ch]
3 @7 S: Y& O# ~+ a0 G' v - CSpace:10015048 push edx
( I" r2 L: G4 S+ t4 p0 C4 L - CSpace:10015049 mov eax, [ebp+dwNewLong]) a1 ~2 S1 N a+ t) ?
- CSpace:1001504C mov ecx, [eax+230h]
6 Q5 S" o5 I/ k _ D* f2 K4 h( e9 _ - CSpace:10015052 mov edx, [ecx+20h] j/ A6 y0 J* o3 e0 f
- CSpace:10015055 push edx
" O2 ]/ {. E& S' z9 w+ l - CSpace:10015056 push offset aUsingDirectdra ; "Using DirectDraw %s (%s)": R- U7 \" |2 U' s' V3 Q
- CSpace:1001505B push 34 A4 z9 [: M5 W% z7 j4 \
- CSpace:1001505D mov eax, [ebp+dwNewLong]
6 S# i/ S- G; ~( H9 x b - CSpace:10015060 push eax
- p5 _. }5 m% I5 }* U8 N5 s - CSpace:10015061 call sub_1003882A
$ e- a0 p# Q" Z! X - CSpace:10015066 add esp, 14h
' C- g$ \2 d) T- G% D5 N1 C( D* x8 L - CSpace:10015069 push 0 ; pUnkOuter8 u. w _; \( ~. P2 k4 u& j2 z
- CSpace:1001506B mov eax, [ebp+dwNewLong]' z* |' Q4 H6 v Z' j# }
- CSpace:1001506E add eax, 1DCh3 S( N% E1 H0 D1 P0 W# | f& r
- CSpace:10015073 push eax ; lplpDD: b4 c/ x1 K+ v+ w5 D/ o
- CSpace:10015074 mov ecx, [ebp+lpGUID]
" e/ |/ i. L; G - CSpace:10015077 push ecx ; lpGUID
3 H4 `( |7 C2 O) R0 F - CSpace:10015078 call j_DirectDrawCreate
- U- V6 l1 w+ J2 D3 }& X, X - CSpace:1001507D mov [ebp+var_14], eax
6 ^, [6 E( b5 u# r - CSpace:10015080 cmp [ebp+var_14], 03 ]1 U) ^( _, `+ v
- CSpace:10015084 jz short loc_1001509E( M" A/ F) X) a
- CSpace:10015086 push offset aDirectdrawcrea ; "DirectDrawCreate FAILED (Code: %08lx)\n"
5 f4 B) o- T) q8 i' v i4 }5 N' F - CSpace:1001508B mov eax, [ebp+var_14]
* D; }8 |2 Q5 Y2 t2 k - CSpace:1001508E push eax
+ G) |* W) L7 E, A7 J - CSpace:1001508F mov ecx, [ebp+dwNewLong]
1 f5 S" o. p6 i1 k& ^" N - CSpace:10015092 call sub_10038F3C, S4 s$ C2 N4 i6 x
- CSpace:10015097 xor al, al
7 L2 q( C3 s' t% T8 h( Y. U& e - CSpace:10015099 jmp loc_10015173
复制代码 2 Q' U+ Y9 |/ `" ]4 q: H' O* x4 |& ^
- w2 C% N: G8 _# N* G% c' t
+ N/ r% n u5 w& I8 c [5 P" U4 N我用3D Analyzer对opengl API的调用进行跟踪之后,输出了不少log.
0 @/ t. s) }. L: K$ o记录到log_GL.out文件中。以下是摘录的一段。
9 z. `6 l( n q2 }我认为这个游戏大概率使用的是opengl API,程序修改的切入点,还需要进一步分析。: V: }4 @0 k9 m/ ?8 i
以前Skywalker 说 这个游戏不能用Hypersnap抓图,这也算是个使用opengl API的侧面证明吧?
+ L, W9 t! t/ P: B- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>7 v# n2 S9 z- S" @* g* o
- glTexEnvi, GLenum<8960>, GLenum<34176>, GLint<5890>/ @! ]4 C/ p) G: z
- glTexEnvi, GLenum<8960>, GLenum<34192>, GLint<768>. ?3 S% J0 Z- t, K) x Q/ g
- glTexEnvi, GLenum<8960>, GLenum<34177>, GLint<34167>
" G# `4 @' I+ a8 g - glTexEnvi, GLenum<8960>, GLenum<34193>, GLint<768>
# S7 S4 G0 u Y( v - glTexEnvi, GLenum<8960>, GLenum<34161>, GLint<8448>1 r7 H; V% s5 l* M2 V% \" s. k
- glTexEnvf, GLenum<8960>, GLenum<34163>, GLfloat<1065353216>/ g8 O' G8 f4 @7 M" \& ?
- glTexEnvi, GLenum<8960>, GLenum<34184>, GLint<5890>: w. c; b7 n# W+ y8 `
- glTexEnvi, GLenum<8960>, GLenum<34200>, GLint<770>5 ]7 ?9 n, W& U" x, k. g- h# o% T
- glTexEnvi, GLenum<8960>, GLenum<34185>, GLint<34167>8 x+ L. I3 O( V1 c& l' v
- glTexEnvi, GLenum<8960>, GLenum<34201>, GLint<770>
A8 y( ]* s* N0 t& R8 z; i - glTexEnvi, GLenum<8960>, GLenum<34162>, GLint<8448>9 y) Q4 G7 A. C: b. }% ?
- glTexEnvf, GLenum<8960>, GLenum<3356>, GLfloat<1065353216>+ R3 l% H) j! ^+ u+ `
- glClear, GLbitfield<256>; W' \, R1 q$ a: j
- glShadeModel, GLenum<7424>
8 N9 c, o# S6 H. q+ z* M" H- U% P: g - glDisable, GLenum<2929>" F9 S; @2 R& B; |1 G/ |
- glDisable, GLenum<3008>
, v: A2 Q* a |9 x8 z - glDisable, GLenum<2896>8 _. Z0 L9 {- n# N0 J* N- l2 y, w
- glEnable, GLenum<3042>
1 {- C3 c6 L* n$ ? - glDisable, GLenum<3553>2 B* p1 U. M, f
- glBindTexture, GLenum<3553>, GLuint<631>; w8 `. v$ N3 W/ J6 x
- glTexParameteri, GLenum<3553>, GLenum<10240>, GLint<9729>3 @) f% ?7 p5 A0 z
- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>* R; f# R# N$ n" R8 O2 H: _" L
- glClear, GLbitfield<16384>& z+ J) T6 s7 o7 n0 P6 Z, N: {7 q
- glTexSubImage2D, GLenum<3553>, GLint<0>, GLint<0>, GLint<0>, GLsizei<512>, GLsizei<384>, GLenum<6408>, GLenum<5121>, CGLvoidP<266776608>: y: J+ M& m8 A
- glEnable, GLenum<3553>8 J0 u; U& V( g3 J0 O# R8 }, S
- glBegin, GLenum<7>6 r- a) s W" z# f9 R8 ?; k
- glColor4f, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>
% d7 D7 t1 L& M# D s - glTexCoord2f, GLfloat<0>, GLfloat<0>9 a/ l# e: B8 Z, N" M. F
- glVertex2i, GLint<0>, GLint<768>3 I' I; ` k" U3 X" {( Q
- glTexCoord2f, GLfloat<1065353216>, GLfloat<0>! d7 ]% ^. Y" i2 L
- glVertex2i, GLint<1024>, GLint<768>
% U. S3 G% {& a& b' A& M - glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>
$ `; L* S9 Y" A, \ U - glVertex2i, GLint<1024>, GLint<-256>7 ^; u: Z5 L, X3 s p0 ~$ H
- glTexCoord2f, GLfloat<0>, GLfloat<1065353216>9 W7 ]6 m$ `- r0 t5 L" D2 X
- glVertex2i, GLint<0>, GLint<-256>
v9 T! g( b }0 s - glEnd
" ^- ~9 s: v/ _8 J - glShadeModel, GLenum<7424> Z; L% \5 w) K* H
- glGetError" F& q. d, y5 H' y
- glDisable, GLenum<2929>
( _* R+ N5 d! I- d4 D - glGetError
* J. s4 `% \# _8 q - glBlendFunc, GLenum<770>, GLenum<771>8 R4 `: Z& }+ g9 _2 S& H
- glGetError2 ^1 h! i2 A) P0 E5 h' L
- glEnable, GLenum<3042>3 o+ }/ Z6 R( C0 }( e9 U" r
- glGetError
: \/ j5 C' ^4 o- W - glDisable, GLenum<3553>
; `6 Q3 H, O, |4 X8 k5 f2 V - glGetError9 H5 h |8 p T" W4 s! I. s* b
- glBegin, GLenum<7>
6 c+ A9 U2 M P - glColor4f, GLfloat<0>, GLfloat<0>, GLfloat<0>, GLfloat<1059883844>* P9 W- ^0 L" }) I! |
- glTexCoord2f, GLfloat<0>, GLfloat<0>
7 z# _0 m/ d' c7 e4 A c - glVertex2i, GLint<0>, GLint<768>5 ?* }) L1 g. b* Q
- glTexCoord2f, GLfloat<1065353216>, GLfloat<0>: q2 ]1 z4 a3 }9 o. f) B1 R
- glVertex2i, GLint<1024>, GLint<768>
& W* L: m+ m: [+ Y8 W8 @ - glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>* G1 }+ L/ a$ v9 i& m
- glVertex2i, GLint<1024>, GLint<0>
0 ]: K& l1 T2 M- t7 a! C, v( z - glTexCoord2f, GLfloat<0>, GLfloat<1065353216>' j# ^6 h) s1 E$ ] R! Z4 p) H: [
- glVertex2i, GLint<0>, GLint<0>
0 r2 k/ ]7 t- Y u - glEnd
( Y" r! z! }! [. {' Z1 u0 S6 Y, } - glGetError
' P4 p, \* q) {1 U0 |. d - glEnable, GLenum<3553>* w/ f/ s# o0 ^3 C+ c0 D( C$ R e
- glGetError9 Y p- D6 N/ T
- glFlush8 q+ o" M" ^3 t1 n) r W
- wglSwapBuffers
0 m: ]5 }! B) b+ m6 W/ m* [ - ---------------------------- N: ^: T1 _9 v% j
- , HDC<-33484711>* d- I+ N2 c' s8 t
- wglGetPixelFormat, HDC<-33484711>: q. r4 ?4 [! Q5 h
- glMatrixMode, GLenum<5889>
( h+ {7 ?/ ~6 N3 ~' z5 D+ y - glLoadIdentity
8 P- E5 g! Y/ S7 e2 L: ?6 C - glOrtho, GLdouble<00>, GLdouble<01083179008>, GLdouble<00>, GLdouble<01082654720>, GLdouble<0-1074790400>, GLdouble<01076101120>
8 d( G5 F7 H* d, w- `( Y/ q k' O - glViewport, GLint<0>, GLint<0>, GLsizei<1024>, GLsizei<768>
# G2 E6 c% R! m1 v5 U - glMatrixMode, GLenum<5888>
; z9 J* r( D& u6 t - glLoadIdentity6 @( Z4 a4 C( L% ~8 o/ t
- glColor3f, GLfloat<1065353216>, GLfloat<0>, GLfloat<0>2 n7 f4 a2 M1 X
- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>) b/ P, \& P6 q6 P! y& Q
- glTexEnvi, GLenum<8960>, GLenum<34176>, GLint<5890>* V+ N; u8 L$ `) P: Z$ [
- glTexEnvi, GLenum<8960>, GLenum<34192>, GLint<768>
3 x* K* }# a, L: J - glTexEnvi, GLenum<8960>, GLenum<34177>, GLint<34167>' Q: {1 s! {7 M/ y3 ^
- glTexEnvi, GLenum<8960>, GLenum<34193>, GLint<768>
; f; D: |" J8 H r& t: [4 c# ^; J6 | - glTexEnvi, GLenum<8960>, GLenum<34161>, GLint<8448>
; y Y& B) j' Z& m - glTexEnvf, GLenum<8960>, GLenum<34163>, GLfloat<1065353216>
, t# f7 J$ u# ? \" x/ K: R# z8 X - glTexEnvi, GLenum<8960>, GLenum<34184>, GLint<5890>0 t: A7 x5 Z/ D7 e2 V+ t
- glTexEnvi, GLenum<8960>, GLenum<34200>, GLint<770>
/ R0 l% m2 ?* \5 o& E- z' z. G - glTexEnvi, GLenum<8960>, GLenum<34185>, GLint<34167>$ d' M1 N: u& F0 D, }" Z3 P
- glTexEnvi, GLenum<8960>, GLenum<34201>, GLint<770>$ C$ J2 R5 a/ ^' u7 d6 K
- glTexEnvi, GLenum<8960>, GLenum<34162>, GLint<8448>
0 ]' m* N9 i. O - glTexEnvf, GLenum<8960>, GLenum<3356>, GLfloat<1065353216>
* i, z: @5 Z4 }& H3 q - glClear, GLbitfield<256>
6 ?) ]6 A3 Q2 R6 D& @ - glShadeModel, GLenum<7424>
- N l* D; N( ]2 Y8 @ - glDisable, GLenum<2929>
8 R& I$ U' I4 r: k# R7 {- ^ - glDisable, GLenum<3008>
# U. z% e o# { U4 c/ k9 q! b - glDisable, GLenum<2896>
( {- L5 r$ X, X) b9 ~! g - glEnable, GLenum<3042>
, n4 {6 f5 |' [& U- U; f. x - glDisable, GLenum<3553># g9 A9 g& m& X4 y0 s6 }/ {/ A
- glBindTexture, GLenum<3553>, GLuint<631>
& H' B+ s4 J% {, [ - glTexParameteri, GLenum<3553>, GLenum<10240>, GLint<9729>3 d2 |; P$ I' A# F" ~
- glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
/ E5 |9 @9 M. D/ e - glClear, GLbitfield<16384>
. c3 ~8 k3 t8 Y# p0 U$ N, b - glTexSubImage2D, GLenum<3553>, GLint<0>, GLint<0>, GLint<0>, GLsizei<512>, GLsizei<384>, GLenum<6408>, GLenum<5121>, CGLvoidP<266776608>
4 n6 \0 Y9 [0 n- ?9 ] - glEnable, GLenum<3553>9 Q4 m* H, C) Q( J# Z4 v5 y
- glBegin, GLenum<7>+ \. e% t' C( q' }6 j! n3 K/ y
- glColor4f, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>
+ j, V( o# i# W( t% G2 e l - glTexCoord2f, GLfloat<0>, GLfloat<0>5 b/ F) i9 h. F8 p$ E$ s3 s
- glVertex2i, GLint<0>, GLint<768>. q/ w0 w1 b' V/ \+ r
- glTexCoord2f, GLfloat<1065353216>, GLfloat<0>
* l4 S) V9 [- K7 J/ M! D9 v$ c4 F, L - glVertex2i, GLint<1024>, GLint<768>$ f' H' u# a) X ~! P% X: z
- glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>4 W1 R2 t3 V$ m6 O3 t
- glVertex2i, GLint<1024>, GLint<-256>
% ?* L3 C: `5 G. w/ L - glTexCoord2f, GLfloat<0>, GLfloat<1065353216>' g9 `) x/ `+ D$ m: o l
- glVertex2i, GLint<0>, GLint<-256>( y$ U7 ` @) s3 L3 q* a- {
复制代码 - q2 M# E& O! H( C$ l
# G/ L y* ?! @6 ?% p
|