冒险解谜游戏中文网 ChinaAVG
标题:
【Opengl游戏汉化 #1】 纪念品(Keepsake)图形引擎分析
[打印本页]
作者:
shane007
时间:
2023-8-25 17:27
标题:
【Opengl游戏汉化 #1】 纪念品(Keepsake)图形引擎分析
本帖最后由 shane007 于 2023-8-25 17:31 编辑
# _" G X+ J4 @: a
: \- [5 p" d# u, s
本游戏的引擎似乎有支持2套图形API,DirectDraw和Opengl,
% p8 }, e2 B; O4 W. G/ O
游戏应该实际只用了其中1个,暂时作下记录。
3 O$ a" ^- S% {% C% W7 x
% _0 Y) ~& F- g" Z# ]& Q, ~
DirectDraw是由bin目录下的ddraw2d.dll来完成的。
. q5 J# ^0 x/ t' h4 s W+ ~
以下是一处的初始化代码
$ m( l+ W; a: h) \
CSpace:10015015
* e/ r Q2 S9 A1 W5 h
CSpace:10015015 loc_10015015: ; CODE XREF: sub_10014D50+2AD↑j
P; M! ^+ J1 w0 |% `$ a. l- ]
CSpace:10015015 mov [ebp+lpGUID], 0
" u( P- M: U- ?+ B) C5 x& R/ ]
CSpace:1001501C mov eax, [ebp+dwNewLong]
5 X. Z/ w- Z6 A2 [5 _0 t
CSpace:1001501F mov ecx, [eax+230h]
; A$ N9 u9 e/ k3 A X
CSpace:10015025 movzx edx, byte ptr [ecx+1Ah]
5 P% o2 ~" E6 H2 D4 r/ A; |
CSpace:10015029 test edx, edx
+ D, P0 _3 `$ Q, @$ [
CSpace:1001502B jnz short loc_1001503C
3 E, \; h4 x$ V5 G
CSpace:1001502D mov eax, [ebp+dwNewLong]
9 w2 w* N$ w2 S7 G% P% N1 R
CSpace:10015030 mov ecx, [eax+230h]
* T. }; C! _5 O$ a; Y% Y
CSpace:10015036 add ecx, 8
+ _& l! A7 C5 N1 U
CSpace:10015039 mov [ebp+lpGUID], ecx
% x' H O! w V" R1 A
CSpace:1001503C
0 P$ o/ g0 ~9 X% ]# k0 Y6 I; ?
CSpace:1001503C loc_1001503C: ; CODE XREF: sub_10014D50+2DB↑j
6 e+ R. Z4 P% V5 N8 A3 }$ B
CSpace:1001503C mov eax, [ebp+dwNewLong]
2 L* ^9 _. E6 A
CSpace:1001503F mov ecx, [eax+230h]
3 J9 ]7 v' |; A' i0 C/ _; E
CSpace:10015045 mov edx, [ecx+1Ch]
5 b; E" _- U$ u7 C" e; x
CSpace:10015048 push edx
* {8 \) {; e5 z* |- f8 W, ]
CSpace:10015049 mov eax, [ebp+dwNewLong]
' A+ M! y: ^3 n! N3 U5 h7 A+ B- `
CSpace:1001504C mov ecx, [eax+230h]
$ i- k5 _5 Y2 a7 R
CSpace:10015052 mov edx, [ecx+20h]
) G5 T7 |; o- }5 t0 o, J
CSpace:10015055 push edx
& S/ k( t2 G7 g9 R
CSpace:10015056 push offset aUsingDirectdra ; "Using DirectDraw %s (%s)"
8 o$ F" C& |$ m7 s
CSpace:1001505B push 3
6 V, L2 ]9 x0 W
CSpace:1001505D mov eax, [ebp+dwNewLong]
4 X$ v* G) o5 X5 }
CSpace:10015060 push eax
0 j/ W. a$ Z$ o1 _
CSpace:10015061 call sub_1003882A
$ w' E1 Q- \2 j U
CSpace:10015066 add esp, 14h
" [. ^: o2 T' U) @. D/ V
CSpace:10015069 push 0 ; pUnkOuter
9 ~# P9 F4 g9 Y; V
CSpace:1001506B mov eax, [ebp+dwNewLong]
; ]# f6 y1 H( S6 a
CSpace:1001506E add eax, 1DCh
; R3 T7 K8 r& Q4 P1 _# ^$ k
CSpace:10015073 push eax ; lplpDD
( b/ ~, o9 t9 P; o6 `
CSpace:10015074 mov ecx, [ebp+lpGUID]
! e! ]6 E. ]! X7 ~: c
CSpace:10015077 push ecx ; lpGUID
! {; U2 A0 w; V0 W
CSpace:10015078 call j_DirectDrawCreate
1 X& w; h9 F6 m" |5 E$ ~
CSpace:1001507D mov [ebp+var_14], eax
I8 O8 |6 f! A4 D9 @8 {/ [6 b) D$ d
CSpace:10015080 cmp [ebp+var_14], 0
* ^' l7 z# ]& k9 {" K
CSpace:10015084 jz short loc_1001509E
3 f8 d- } O+ z( b! n5 Q
CSpace:10015086 push offset aDirectdrawcrea ; "DirectDrawCreate FAILED (Code: %08lx)\n"
$ U8 D1 W, X0 Y: y
CSpace:1001508B mov eax, [ebp+var_14]
+ z( T2 U$ }7 }2 m! [) N
CSpace:1001508E push eax
2 J- L4 a) p9 j; W1 f, J2 X+ M, `+ H
CSpace:1001508F mov ecx, [ebp+dwNewLong]
/ l6 T! P5 K: p: j/ v
CSpace:10015092 call sub_10038F3C
m% n& l& Q, R. D
CSpace:10015097 xor al, al
" Y/ `) C8 T& I. v1 }' }, A1 `
CSpace:10015099 jmp loc_10015173
复制代码
3 ? p7 G# [) Y8 { o$ A( ]
) }! m* ?& a$ l1 w! G$ p
) w" e$ v% W5 v
我用3D Analyzer对opengl API的调用进行跟踪之后,输出了不少log.
. d0 {) K# B. s
记录到log_GL.out文件中。以下是摘录的一段。
- v2 h6 f2 j! L/ ?. Y" k1 ^: S/ @+ e
我认为这个游戏大概率使用的是opengl API,程序修改的切入点,还需要进一步分析。
i; N! E5 z- w# I' f9 u7 r
以前Skywalker 说 这个游戏不能用Hypersnap抓图,这也算是个使用opengl API的侧面证明吧?
0 H3 H9 k+ Q l& z9 C
glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
( i8 J. X! k& t' }. i
glTexEnvi, GLenum<8960>, GLenum<34176>, GLint<5890>
j2 d' i0 g2 D! V7 X
glTexEnvi, GLenum<8960>, GLenum<34192>, GLint<768>
[/ W' H2 y5 v6 J
glTexEnvi, GLenum<8960>, GLenum<34177>, GLint<34167>
& h& h# d. p; r
glTexEnvi, GLenum<8960>, GLenum<34193>, GLint<768>
* ~* T- H# _) o
glTexEnvi, GLenum<8960>, GLenum<34161>, GLint<8448>
+ c4 }5 k$ ]% V" p8 D
glTexEnvf, GLenum<8960>, GLenum<34163>, GLfloat<1065353216>
; E* I" i( E( X, a9 m
glTexEnvi, GLenum<8960>, GLenum<34184>, GLint<5890>
3 u( W7 N' H5 L) I, h% s6 ~8 Z
glTexEnvi, GLenum<8960>, GLenum<34200>, GLint<770>
% p4 K8 @/ G5 V
glTexEnvi, GLenum<8960>, GLenum<34185>, GLint<34167>
3 e7 N! {+ Q% ~4 ^& e
glTexEnvi, GLenum<8960>, GLenum<34201>, GLint<770>
0 L1 I6 P, C* F& Y! {- i
glTexEnvi, GLenum<8960>, GLenum<34162>, GLint<8448>
Q9 Q! H0 X( B
glTexEnvf, GLenum<8960>, GLenum<3356>, GLfloat<1065353216>
$ B; J4 L2 W4 W# d) Y
glClear, GLbitfield<256>
& h: n6 B% F6 F8 K0 n
glShadeModel, GLenum<7424>
' f9 y) |) d9 u( }0 v+ T0 k. c
glDisable, GLenum<2929>
- V; p; q$ ] `
glDisable, GLenum<3008>
8 _2 m: m, C5 r7 C
glDisable, GLenum<2896>
7 e5 v0 S, n1 T9 C
glEnable, GLenum<3042>
9 q7 @/ L: h9 K7 J C0 k" z
glDisable, GLenum<3553>
: i# _7 E! t9 A# Q2 v- u* L
glBindTexture, GLenum<3553>, GLuint<631>
: ~0 S3 `. ]! Z" n$ A
glTexParameteri, GLenum<3553>, GLenum<10240>, GLint<9729>
6 d$ k' t2 N/ b- u: t" x; {
glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
- ~7 I0 b- e' D! m1 x
glClear, GLbitfield<16384>
/ v( G6 K" e1 S% C' f4 Z. v6 I
glTexSubImage2D, GLenum<3553>, GLint<0>, GLint<0>, GLint<0>, GLsizei<512>, GLsizei<384>, GLenum<6408>, GLenum<5121>, CGLvoidP<266776608>
: i0 Z( k0 e9 {+ s5 C) W/ Z) F
glEnable, GLenum<3553>
& ]7 h- y' a5 H" m
glBegin, GLenum<7>
& b& I' l+ x5 i3 A/ ^
glColor4f, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>
5 q, [* q' T- C" x" @
glTexCoord2f, GLfloat<0>, GLfloat<0>
) E( `( }) q( W) a8 x! [8 u
glVertex2i, GLint<0>, GLint<768>
0 s$ I# [, L# d; W
glTexCoord2f, GLfloat<1065353216>, GLfloat<0>
0 q9 S8 R2 E. g" l& \: ]8 c
glVertex2i, GLint<1024>, GLint<768>
. i5 @) u8 d+ Q7 h5 C
glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>
' f6 d2 B( P2 b
glVertex2i, GLint<1024>, GLint<-256>
+ h2 y: K0 H. g/ {& h3 _, O. o3 [
glTexCoord2f, GLfloat<0>, GLfloat<1065353216>
( h6 X' Z/ W* F, b+ r
glVertex2i, GLint<0>, GLint<-256>
! T+ l, a, ]& b3 @2 Z, x
glEnd
/ D4 n3 W3 w: t% [
glShadeModel, GLenum<7424>
1 b) O) y1 [. U8 N* G) k6 J
glGetError
9 P7 g9 N8 h/ t! X- e) c
glDisable, GLenum<2929>
4 b8 z, z' c1 t4 x: S/ R
glGetError
8 i5 Q7 N5 w: S3 d4 [+ a9 K
glBlendFunc, GLenum<770>, GLenum<771>
/ y5 g8 f e# v6 x* K0 w1 c
glGetError
$ t0 u0 H" ~! t7 ^
glEnable, GLenum<3042>
8 t9 p" M% G' G& K
glGetError
& C) E8 b/ h& T* H3 K/ d$ `
glDisable, GLenum<3553>
$ `1 @9 S/ Z3 m& o$ G% Q
glGetError
) f3 T% M. u$ s
glBegin, GLenum<7>
' Z) G9 _6 m! M% r. f
glColor4f, GLfloat<0>, GLfloat<0>, GLfloat<0>, GLfloat<1059883844>
8 o, r* d) l) J8 T% ]! f% i, [. S
glTexCoord2f, GLfloat<0>, GLfloat<0>
5 K: W$ H2 z# L6 }+ p# E( J; f
glVertex2i, GLint<0>, GLint<768>
; B9 a* u8 \. l j7 \0 [5 \
glTexCoord2f, GLfloat<1065353216>, GLfloat<0>
0 ?5 y, F+ T; C$ L& U! f ~
glVertex2i, GLint<1024>, GLint<768>
+ H8 z8 ?# A( x: M( W
glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>
C8 ~6 N/ j/ J0 ~0 G
glVertex2i, GLint<1024>, GLint<0>
, M8 T1 v* ^& a. Z% E: @2 `
glTexCoord2f, GLfloat<0>, GLfloat<1065353216>
) x+ q# |) H. k& }
glVertex2i, GLint<0>, GLint<0>
+ T6 R- [ O% l7 i" {
glEnd
$ ]+ U& k2 L: Z
glGetError
7 K: ^$ p1 V8 V# t
glEnable, GLenum<3553>
8 R) _3 U: N8 m8 n. o
glGetError
+ o5 i& b* ]0 \6 {8 _
glFlush
$ d% b& G; q7 Q+ `6 P$ R& H
wglSwapBuffers
' O. G) v3 L* b: f
---------------------------
* l! i' w% ?2 g/ E0 s5 Q' ]+ G
, HDC<-33484711>
" U) W; h( I! l: N( q1 T# S: S
wglGetPixelFormat, HDC<-33484711>
. i' [" t" K5 q* D* @! Q- l5 H( X
glMatrixMode, GLenum<5889>
9 `6 X! j) x: J4 i6 I8 F
glLoadIdentity
! \8 N2 ]: l8 }% l
glOrtho, GLdouble<00>, GLdouble<01083179008>, GLdouble<00>, GLdouble<01082654720>, GLdouble<0-1074790400>, GLdouble<01076101120>
, N, p& K; L5 ^6 z9 O: h$ M
glViewport, GLint<0>, GLint<0>, GLsizei<1024>, GLsizei<768>
3 V% P5 u# [, C! P3 w. f4 n7 W
glMatrixMode, GLenum<5888>
; a/ Q% p3 s5 \ Z; @& r
glLoadIdentity
* e- C9 x7 u2 [4 d4 y: a$ \
glColor3f, GLfloat<1065353216>, GLfloat<0>, GLfloat<0>
( [9 |- a0 V2 \
glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
( Q4 O" J+ g1 k4 J. f% Z# J
glTexEnvi, GLenum<8960>, GLenum<34176>, GLint<5890>
) w: ]6 G2 r8 w
glTexEnvi, GLenum<8960>, GLenum<34192>, GLint<768>
/ d8 }) t* _+ b# Y
glTexEnvi, GLenum<8960>, GLenum<34177>, GLint<34167>
' ?4 R( X; }3 P4 o! o. D! |0 P8 B
glTexEnvi, GLenum<8960>, GLenum<34193>, GLint<768>
4 T& \8 c; I) e; _8 H
glTexEnvi, GLenum<8960>, GLenum<34161>, GLint<8448>
! o% A7 V# U- v* V
glTexEnvf, GLenum<8960>, GLenum<34163>, GLfloat<1065353216>
& ^- \) t. C3 c6 U4 k# u
glTexEnvi, GLenum<8960>, GLenum<34184>, GLint<5890>
! H3 ^7 z5 f4 H l: u5 v9 A4 X; m# A# t
glTexEnvi, GLenum<8960>, GLenum<34200>, GLint<770>
% }# Q) s% A0 z: d! R- u
glTexEnvi, GLenum<8960>, GLenum<34185>, GLint<34167>
! l2 P& |! |! F- Z; K6 v
glTexEnvi, GLenum<8960>, GLenum<34201>, GLint<770>
. t" y% x$ }, L/ u$ B
glTexEnvi, GLenum<8960>, GLenum<34162>, GLint<8448>
: W/ @5 C" C4 h7 R
glTexEnvf, GLenum<8960>, GLenum<3356>, GLfloat<1065353216>
& d: e% F8 I8 m* r
glClear, GLbitfield<256>
1 O, K6 O) q9 J H
glShadeModel, GLenum<7424>
4 l& w ?& a" n9 q% P
glDisable, GLenum<2929>
) G' K# o( p% U8 q9 K& J& i
glDisable, GLenum<3008>
8 Z. ^9 W/ N* l0 _9 l0 d& o
glDisable, GLenum<2896>
+ o4 }- Z" d5 R; J4 j5 B
glEnable, GLenum<3042>
' d, f# h1 r; N" V/ o+ `
glDisable, GLenum<3553>
% m& \$ M0 A! H+ J; W1 \" ]8 S
glBindTexture, GLenum<3553>, GLuint<631>
: m0 w/ C. h* T# ?6 `' [
glTexParameteri, GLenum<3553>, GLenum<10240>, GLint<9729>
/ S- [" |9 q; m1 F# X
glClearColor, GLclampf<0>, GLclampf<0>, GLclampf<0>, GLclampf<0>
/ M/ \# a5 D. K$ J9 s+ @; Y/ h
glClear, GLbitfield<16384>
, z6 j' \% L0 [- V% c
glTexSubImage2D, GLenum<3553>, GLint<0>, GLint<0>, GLint<0>, GLsizei<512>, GLsizei<384>, GLenum<6408>, GLenum<5121>, CGLvoidP<266776608>
6 b; d1 a2 h! f$ J
glEnable, GLenum<3553>
) S* z- U# d) r
glBegin, GLenum<7>
% y+ L+ ?5 v$ r, I+ }
glColor4f, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>, GLfloat<1065353216>
2 A. d8 Q- W; s/ ^2 ^
glTexCoord2f, GLfloat<0>, GLfloat<0>
) D9 [, w+ g( i
glVertex2i, GLint<0>, GLint<768>
! H* ~* {# l8 B2 D4 M# V; d
glTexCoord2f, GLfloat<1065353216>, GLfloat<0>
2 B+ M* R2 g# N q; \3 h: p t6 |0 C
glVertex2i, GLint<1024>, GLint<768>
1 C U$ P+ d$ C3 q" r' V
glTexCoord2f, GLfloat<1065353216>, GLfloat<1065353216>
b- n- e0 X$ \& _# y, h
glVertex2i, GLint<1024>, GLint<-256>
4 j* m7 L) a, n
glTexCoord2f, GLfloat<0>, GLfloat<1065353216>
! J' T( B9 S& W9 h# m' r* M2 T
glVertex2i, GLint<0>, GLint<-256>
5 o5 D* t5 a1 f6 I6 p
复制代码
9 I& u; `$ e8 V0 o, }
( W& _8 O+ b0 K, i! z' d' [5 ~" q1 O
欢迎光临 冒险解谜游戏中文网 ChinaAVG (https://chinaavg.com/)
Powered by Discuz! X3.2