写屏函数:/ h1 T$ P! s. K/ B
02A0EA4C |> /8B00 |/mov eax,dword ptr ds:[eax]# l. C/ A( c4 F }0 F. k v
02A0EA4E |. |0FB70450 ||movzx eax,word ptr ds:[eax+edx*2] ; [eax+edx*2]存放字符的UNICODE码
3 q/ O8 b+ }& [3 D P# x' h02A0EA52 |. |8B7C24 14 ||mov edi,dword ptr ss:[esp+14]
7 m$ i& o y9 K' Y5 I02A0EA56 |. |8B7F 2C ||mov edi,dword ptr ds:[edi+2C]
4 A9 ?. P- n/ ?1 ~" x) [02A0EA59 |. |8D04C0 ||lea eax,dword ptr ds:[eax+eax*8]: V+ Y& h# L3 L1 u
02A0EA5C |. |8D0487 ||lea eax,dword ptr ds:[edi+eax*4] ; eax存放字符编码表
" s0 v' b& m! o0 T每个字符码表占24(16进制)个字节 H0 Z/ A; j r- E( W1 L& @
02A0EA5F |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]
; ?" o- [: O0 N3 ~02A0EA63 |. |8D7C39 14 ||lea edi,dword ptr ds:[ecx+edi+14] ; edi就是显存地址
+ k# g3 B0 W( D; C02A0EA67 |. |D940 04 ||fld dword ptr ds:[eax+4]5 a- G7 U6 L$ i6 e [0 ?" K$ z
02A0EA6A |. |83C2 01 ||add edx,1 字符个数加一
* T3 B) o' d7 h: ]# }+ ]* o' F02A0EA6D |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
0 F5 C9 Q% q; `02A0EA71 |. |D900 ||fld dword ptr ds:[eax]* X0 X% z' A# N* S
02A0EA73 |. |D91F ||fstp dword ptr ds:[edi] ; edi就是显存地址
8 ^3 G1 T6 m' t' K+ O" L5 G1 B" ]每个字符占1C个字节,最后的四个字节都是一样的,可以认为是结束标志7 t- U9 T A& D7 d
02A0EA75 |. |D94424 30 ||fld dword ptr ss:[esp+30]6 u" K! `" w1 e$ E7 k
02A0EA79 |. |D95F 04 ||fstp dword ptr ds:[edi+4]
4 @: H0 G' m+ D- B# I02A0EA7C |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]& U9 w3 ], ~$ u
02A0EA80 |. |D940 04 ||fld dword ptr ds:[eax+4]
( @- u5 Y! e% d# {8 Y1 }, \. q02A0EA83 |. |8D7C39 30 ||lea edi,dword ptr ds:[ecx+edi+30]
! }7 I3 r1 y/ e9 X4 S* }/ n02A0EA87 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
, _+ d* y+ t' ]) v" x, V) P2 c02A0EA8B |. |D940 08 ||fld dword ptr ds:[eax+8]
2 G) g: ?# B# b02A0EA8E |. |D91F ||fstp dword ptr ds:[edi]
- O' ~" n' o, c. d8 N* D02A0EA90 |. |D94424 30 ||fld dword ptr ss:[esp+30]
4 R4 f# U8 k8 [; v6 J) \/ R02A0EA94 |. |D95F 04 ||fstp dword ptr ds:[edi+4]$ ?5 X5 M# V8 r
02A0EA97 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]+ D9 s3 w9 h8 {7 e
02A0EA9B |. |D940 0C ||fld dword ptr ds:[eax+C]
3 ]. h: [! w$ ?02A0EA9E |. |8D7C39 4C ||lea edi,dword ptr ds:[ecx+edi+4C]
/ x% R0 q4 v5 h( I02A0EAA2 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
+ v0 A F0 ]! V: z) f: q9 t* @02A0EAA6 |. |D900 ||fld dword ptr ds:[eax]# Q Z9 _% G% V( M+ b$ U/ j2 R+ _" A' x
02A0EAA8 |. |D91F ||fstp dword ptr ds:[edi]
; K) V2 Y6 S, G; u4 g02A0EAAA |. |D94424 30 ||fld dword ptr ss:[esp+30]+ X& s! P/ a5 a
02A0EAAE |. |D95F 04 ||fstp dword ptr ds:[edi+4]# }" I! X6 I7 ], y0 n
02A0EAB1 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]
5 R9 q1 Y$ y0 e9 m7 @/ h2 ]& Q02A0EAB5 |. |D940 0C ||fld dword ptr ds:[eax+C]
2 _9 H, J3 {$ c1 p! C. e02A0EAB8 |. |8D7C39 68 ||lea edi,dword ptr ds:[ecx+edi+68]9 G0 a& l5 J1 G! n
02A0EABC |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
. Z! ~$ t5 V& X* `, }( s/ q3 N4 L02A0EAC0 |. |83C1 70 ||add ecx,704 q2 A& D* I! y9 g0 q# b4 D
02A0EAC3 |. |D940 08 ||fld dword ptr ds:[eax+8]
- X5 j2 s5 W+ f9 \' z02A0EAC6 |. |D91F ||fstp dword ptr ds:[edi]
! A+ _- ^% G8 `9 ] n02A0EAC8 |. |D94424 30 ||fld dword ptr ss:[esp+30]
+ `! u1 Z0 k' G0 B1 U G( }" n02A0EACC |. |D95F 04 ||fstp dword ptr ds:[edi+4]- k$ ] K+ k" X' x$ s7 m
02A0EACF |. |8B46 58 ||mov eax,dword ptr ds:[esi+58]
3 O+ y! B6 Q; T. g4 F" X02A0EAD2 |. |03C3 ||add eax,ebx
' j. A1 Z9 s- S$ `8 D02A0EAD4 |. |3B50 08 ||cmp edx,dword ptr ds:[eax+8]/ W8 n8 W6 L/ R5 U b
02A0EAD7 |.^\\0F8C 6FFFFF>|\\jl xcDxShad.02A0EA4C
6 B, g r" Z& T6 s: g6 Q9 o! h/ o1 R" n. Q5 ?, r: X: Q0 B: j
本游戏字符编码采用UNICODE,+ ?! X( M. u) q6 H o: \2 r
对字符码表的操作:
. l; X3 d9 ?- S10028807 |> /0FB702 /movzx eax,word ptr ds:[edx] 读字符的UNICODE码% E2 ~5 s. V3 Y# `" }) {
1002880A |. |8D04C0 |lea eax,dword ptr ds:[eax+eax*8]" J* M0 Y6 G# m8 |2 z& Y$ [
1002880D |. |8D0483 |lea eax,dword ptr ds:[ebx+eax*4] 根据UNICODE码求得字符码表的地址
6 S/ R/ \+ d7 f, ]# d8 c10028810 |. |33C9 |xor ecx,ecx
4 f8 H8 b3 @/ F7 E4 _6 A1 o/ Z' `10028812 |. |DB40 20 |fild dword ptr ds:[eax+20]3 h% o6 w8 _# I- t: z6 D3 I
10028815 |. |D95C24 14 |fstp dword ptr ss:[esp+14]9 k' t S4 P y8 e# Q, s4 f
10028819 |. |D94424 14 |fld dword ptr ss:[esp+14]
" Z4 @1 n# L( A0 \1 x1002881D |. |D9C0 |fld st
# R, O) g. \, ^( x. p* L& J1002881F |. |D84E 14 |fmul dword ptr ds:[esi+14]* P$ J! w! k: z7 {
10028822 |. |D94424 0C |fld dword ptr ss:[esp+C], S. p0 J& ~6 |1 \, H
10028826 |. |D9C0 |fld st
7 d* \, _0 G7 D& o, {1 l10028828 |. |DEC2 |faddp st(2),st
5 C2 J5 G3 i0 x$ i2 p3 p1002882A |. |D9C9 |fxch st(1)) R8 j P5 o j: f+ T
1002882C |. |D95C24 14 |fstp dword ptr ss:[esp+14]1 ]1 n) b+ e0 }* Z' y
10028830 |. |D8D3 |fcom st(3)
" S8 q9 f) Y/ n9 _10028832 |. |DFE0 |fstsw ax6 A6 e) O* k9 ]6 b# x
10028834 |. |F6C4 01 |test ah,1
% O, S, P, Z7 S* M+ A: g+ Y10028837 |. |74 2B |je short xcEngine.10028864! W2 |% S, g; N# r( k
10028839 |. |D94424 14 |fld dword ptr ss:[esp+14]
) D1 S( L. P1 {8 D+ Q5 \1002883D |. |D8D3 |fcom st(3)
) h4 y. K5 I, G& i1002883F |. |DFE0 |fstsw ax, ^/ K Z' N0 _* f+ y2 t4 h: X$ B
10028841 |. |F6C4 41 |test ah,41
1 _) a. K) n4 _8 j6 @' t10028844 |. |7A 04 |jpe short xcEngine.1002884A# b; B, n" v1 r, Z3 o) A r: \
10028846 |. |DDD8 |fstp st: m. h' O! ~" `
10028848 |. |EB 1A |jmp short xcEngine.10028864# p0 Z. w* L- H& m9 Z3 N; v. n' V
1002884A |> |D9C9 |fxch st(1)
3 W2 ?# x8 `& F" X2 c: Y5 D1002884C |. |D8D3 |fcom st(3)8 `& L3 {% s5 C0 E
1002884E |. |DFE0 |fstsw ax9 H5 d" E+ c5 v1 S* R# X
10028850 |. |F6C4 05 |test ah,58 J. |" l& F2 J
10028853 |. |7A 04 |jpe short xcEngine.100288599 l' Z& @# @; Z0 i; P
10028855 |. |DDD9 |fstp st(1); F( C0 d# M7 i% e9 ^
10028857 |. |EB 0B |jmp short xcEngine.100288649 G" T$ o9 K$ D- ^* ~
10028859 |> |D9C9 |fxch st(1)
' N6 L% r& g3 d Q- m1002885B |. |D8DC |fcomp st(4)- A! ?2 I& C( \2 A6 { }& D+ G
1002885D |. |DFE0 |fstsw ax
i- [7 E$ {) f& B4 V A1002885F |. |F6C4 41 |test ah,41
) ~, S U2 Z% P1 ]10028862 |. |75 05 |jnz short xcEngine.10028869" I, ?1 b4 k6 ]/ V6 @# V, Z
10028864 |> |B9 01000000 |mov ecx,1
, @+ b0 m4 K, R: C10028869 |> |85C9 |test ecx,ecx8 a( V# ~* [; m! ?1 B" o
1002886B |. |8B4424 18 |mov eax,dword ptr ss:[esp+18]8 n) ~7 F0 V9 F( a
1002886F |. |D940 14 |fld dword ptr ds:[eax+14]5 O8 Y$ Q, M* p) Y0 _1 Q
10028872 |. |DECA |fmulp st(2),st
0 @' A4 P) |1 D7 ^- d. f2 l10028874 |. |DEC1 |faddp st(1),st
0 z5 ]4 x/ O( z; B1 W5 a% x2 h10028876 |. |D95C24 0C |fstp dword ptr ss:[esp+C]) [/ M3 K5 Z6 [* o7 G2 }# |
1002887A |. |75 05 |jnz short xcEngine.100288813 V8 u% j0 }* k! b9 M: P
1002887C |. |834424 10 0>|add dword ptr ss:[esp+10],1
8 W6 ]" m# E: j R- e10028881 |> |83C2 02 |add edx,2
. G: }" M. _/ i( r0 y$ }7 e* U10028884 |. |83EF 01 |sub edi,1
q" K6 ?4 w9 y) D5 @10028887 |.^\\0F85 7AFFFF>\\jnz xcEngine.10028807
1 d, a' k$ \% H: Q; j由于算法采用了浮点数指令,本人不太懂,边学习边研究中。。。。。。。。。 |