写屏函数:: Z9 h! j9 f/ b/ u
02A0EA4C |> /8B00 |/mov eax,dword ptr ds:[eax]
! x0 l. m+ O0 `& M$ r6 M: G5 |02A0EA4E |. |0FB70450 ||movzx eax,word ptr ds:[eax+edx*2] ; [eax+edx*2]存放字符的UNICODE码. z. O+ M9 P2 }( ~4 R" N
02A0EA52 |. |8B7C24 14 ||mov edi,dword ptr ss:[esp+14]
5 q F1 |, E9 e; ~% _02A0EA56 |. |8B7F 2C ||mov edi,dword ptr ds:[edi+2C]
# ~9 K- t& D8 W# g# _/ k' X$ C( g" A02A0EA59 |. |8D04C0 ||lea eax,dword ptr ds:[eax+eax*8]
( E$ t) E7 `' ?. k02A0EA5C |. |8D0487 ||lea eax,dword ptr ds:[edi+eax*4] ; eax存放字符编码表: j- Q" e8 D3 D- o' S( R, s
每个字符码表占24(16进制)个字节
A" @" P8 W2 N: @& w& U02A0EA5F |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]- z( z# h/ j* h5 |) {3 s+ i4 H- h
02A0EA63 |. |8D7C39 14 ||lea edi,dword ptr ds:[ecx+edi+14] ; edi就是显存地址! w2 `6 d1 h, B& D* j$ \- z) Q
02A0EA67 |. |D940 04 ||fld dword ptr ds:[eax+4]+ C& H6 i! y% ]9 n1 p) `$ ~
02A0EA6A |. |83C2 01 ||add edx,1 字符个数加一+ U; f O" Y7 n: x; K) P
02A0EA6D |. |D95C24 30 ||fstp dword ptr ss:[esp+30]7 O' l; P' ^2 U% E7 f
02A0EA71 |. |D900 ||fld dword ptr ds:[eax]
9 A, p9 Y6 R" ~$ }02A0EA73 |. |D91F ||fstp dword ptr ds:[edi] ; edi就是显存地址
% a: R" G) X, Z' W每个字符占1C个字节,最后的四个字节都是一样的,可以认为是结束标志0 a3 V; O0 T$ T+ Z
02A0EA75 |. |D94424 30 ||fld dword ptr ss:[esp+30]
8 Q. P1 i$ ^6 ^: K+ P/ @" | d02A0EA79 |. |D95F 04 ||fstp dword ptr ds:[edi+4]
2 }; M! M' V6 O, K8 U02A0EA7C |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]# K/ A9 @; p9 p
02A0EA80 |. |D940 04 ||fld dword ptr ds:[eax+4]# q$ e, {. k/ c" g
02A0EA83 |. |8D7C39 30 ||lea edi,dword ptr ds:[ecx+edi+30]8 i. W1 K2 e) Z `% K/ x5 b& [
02A0EA87 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
: u2 A: _+ D- R+ ?- j1 D, G4 v02A0EA8B |. |D940 08 ||fld dword ptr ds:[eax+8]/ o! a0 T9 C' R1 L" h) ^9 ?
02A0EA8E |. |D91F ||fstp dword ptr ds:[edi]& e7 ~+ c0 O5 i
02A0EA90 |. |D94424 30 ||fld dword ptr ss:[esp+30]
. U7 V% T6 b6 A7 {02A0EA94 |. |D95F 04 ||fstp dword ptr ds:[edi+4]
1 O2 h# f( I* B# Q0 k B02A0EA97 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]! f% Z1 I3 U0 }5 Z
02A0EA9B |. |D940 0C ||fld dword ptr ds:[eax+C]0 t) Q" [0 F: q0 R
02A0EA9E |. |8D7C39 4C ||lea edi,dword ptr ds:[ecx+edi+4C]3 s# I, _+ y! _, i$ ~6 g
02A0EAA2 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
3 N- i3 A4 \) @8 X& I+ w02A0EAA6 |. |D900 ||fld dword ptr ds:[eax]
5 h& _+ t6 r+ f) I02A0EAA8 |. |D91F ||fstp dword ptr ds:[edi]* m7 n4 r) b* S7 y' g
02A0EAAA |. |D94424 30 ||fld dword ptr ss:[esp+30]6 Q; u& V9 l2 J
02A0EAAE |. |D95F 04 ||fstp dword ptr ds:[edi+4]
. H* G2 f' x F7 Q- ^9 n; a# j02A0EAB1 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]: E5 \8 k, w+ ~5 \9 x! N
02A0EAB5 |. |D940 0C ||fld dword ptr ds:[eax+C]
( _* B, ~: N0 F- @2 `02A0EAB8 |. |8D7C39 68 ||lea edi,dword ptr ds:[ecx+edi+68]
2 t8 J: n0 S# G+ v% h' x8 A$ i02A0EABC |. |D95C24 30 ||fstp dword ptr ss:[esp+30]* _& N+ D) M& i; l
02A0EAC0 |. |83C1 70 ||add ecx,70
! N/ b0 z1 r& z8 Z! I02A0EAC3 |. |D940 08 ||fld dword ptr ds:[eax+8]
2 o4 l+ q. d- e2 @02A0EAC6 |. |D91F ||fstp dword ptr ds:[edi]+ ~! l6 K2 h- ^ F( {, U' U6 N
02A0EAC8 |. |D94424 30 ||fld dword ptr ss:[esp+30]) q3 W! y' L7 }% _0 H$ j" J7 S
02A0EACC |. |D95F 04 ||fstp dword ptr ds:[edi+4]9 }( q, d) k$ f" L& E O; s& ?, r
02A0EACF |. |8B46 58 ||mov eax,dword ptr ds:[esi+58]
& G: M8 W4 w: w( m02A0EAD2 |. |03C3 ||add eax,ebx) Z3 A! p# O+ N3 s+ m' ~3 ^0 x
02A0EAD4 |. |3B50 08 ||cmp edx,dword ptr ds:[eax+8]* ~, A ~, X, K
02A0EAD7 |.^\\0F8C 6FFFFF>|\\jl xcDxShad.02A0EA4C
6 O/ s8 F0 b: U3 h/ s+ D3 G) I, J' D" l+ M$ r
本游戏字符编码采用UNICODE,7 d3 J3 e [% \# e0 F* s
对字符码表的操作:
' K" z w, ?6 S8 }10028807 |> /0FB702 /movzx eax,word ptr ds:[edx] 读字符的UNICODE码
. ^# Z9 E1 b& |; w! }# `1002880A |. |8D04C0 |lea eax,dword ptr ds:[eax+eax*8]
/ F; t# t5 b% N) ^6 b1002880D |. |8D0483 |lea eax,dword ptr ds:[ebx+eax*4] 根据UNICODE码求得字符码表的地址
* @5 H4 @% Q; B3 ?( J10028810 |. |33C9 |xor ecx,ecx
" u" y2 }/ {& {0 p! U! O10028812 |. |DB40 20 |fild dword ptr ds:[eax+20]
) \; {( }) m! J. B+ h: V+ y8 T. K10028815 |. |D95C24 14 |fstp dword ptr ss:[esp+14]% J7 a6 c: X/ y4 ?
10028819 |. |D94424 14 |fld dword ptr ss:[esp+14]6 v; P. |& i1 ^1 p& ?
1002881D |. |D9C0 |fld st, T1 U( ^; Q& N6 L% [" o6 S
1002881F |. |D84E 14 |fmul dword ptr ds:[esi+14]" {8 k5 G) H/ t0 {0 X( ~
10028822 |. |D94424 0C |fld dword ptr ss:[esp+C]
! P! n8 K5 r$ V3 b7 n1 }6 ~& J10028826 |. |D9C0 |fld st l: n9 ~) Z/ Y
10028828 |. |DEC2 |faddp st(2),st
) K( G8 `- W9 P" ]/ F1002882A |. |D9C9 |fxch st(1)! y0 ^4 m( Q: F$ y9 C
1002882C |. |D95C24 14 |fstp dword ptr ss:[esp+14]+ v$ R: Q4 s1 a8 S9 X
10028830 |. |D8D3 |fcom st(3)( P! F' f" b6 R5 H, e# C" |' z
10028832 |. |DFE0 |fstsw ax
* u! i3 I; g: f3 i* d' Y: Y7 x E10028834 |. |F6C4 01 |test ah,1
% H3 H2 r2 @1 J3 I: ?& k10028837 |. |74 2B |je short xcEngine.10028864
1 J( U, q/ v- |0 U: e* I10028839 |. |D94424 14 |fld dword ptr ss:[esp+14]
( B1 G# j; j& T0 K) G+ d1002883D |. |D8D3 |fcom st(3)
% [5 x6 D3 }# C1 E1002883F |. |DFE0 |fstsw ax
/ |" i$ \8 D0 d. S10028841 |. |F6C4 41 |test ah,41! O. z, t, X$ P( }
10028844 |. |7A 04 |jpe short xcEngine.1002884A8 ~1 b' [0 M+ I. P% L9 Z8 S/ j/ U5 Q
10028846 |. |DDD8 |fstp st/ N& j& v% U1 B; S
10028848 |. |EB 1A |jmp short xcEngine.10028864" D& i3 e+ P& ]) a: Q; y
1002884A |> |D9C9 |fxch st(1)
, l5 ]8 M/ ~2 j# w# b) @5 s$ R. V! j1002884C |. |D8D3 |fcom st(3). V; \ s3 J3 @- c% ]5 T/ d9 W
1002884E |. |DFE0 |fstsw ax
% D- z9 B E8 h1 n- p- i10028850 |. |F6C4 05 |test ah,5" D7 n5 T) @! n }& U
10028853 |. |7A 04 |jpe short xcEngine.10028859* S4 s) V0 x1 Q6 Q$ D& q
10028855 |. |DDD9 |fstp st(1)+ \0 K9 S& S$ u" o' ~
10028857 |. |EB 0B |jmp short xcEngine.10028864
& P# K+ h& `" w2 K; O: e5 Z10028859 |> |D9C9 |fxch st(1)( ~4 Y# E/ Y% b- ~/ G3 `
1002885B |. |D8DC |fcomp st(4)
) a& `- | T" O1002885D |. |DFE0 |fstsw ax
" w8 B+ T. h6 Q' r1002885F |. |F6C4 41 |test ah,41
; m, P1 O2 d3 D4 Y4 m$ t10028862 |. |75 05 |jnz short xcEngine.10028869' h- `# q2 N( h1 L: D& x
10028864 |> |B9 01000000 |mov ecx,1
2 D- ]5 H* k0 N/ Q10028869 |> |85C9 |test ecx,ecx! ~: g6 y; H) V5 {& l/ P
1002886B |. |8B4424 18 |mov eax,dword ptr ss:[esp+18]
/ I$ b/ ~" X9 t0 j0 ?6 F- `1002886F |. |D940 14 |fld dword ptr ds:[eax+14] X& k9 H+ V# V6 t
10028872 |. |DECA |fmulp st(2),st d1 P: j: ]7 U! x8 p& X* l
10028874 |. |DEC1 |faddp st(1),st+ t: ]( H0 e& p U5 p
10028876 |. |D95C24 0C |fstp dword ptr ss:[esp+C]5 B4 k0 y8 }! g) ]6 S
1002887A |. |75 05 |jnz short xcEngine.10028881( @; [) f* V' x5 G: h6 S
1002887C |. |834424 10 0>|add dword ptr ss:[esp+10],1) q Q+ o2 Q, s% b* \
10028881 |> |83C2 02 |add edx,2
- C/ F/ t2 |, P' t" c; c% H4 `10028884 |. |83EF 01 |sub edi,12 j3 ^# ?* d* ~- t5 _5 ?
10028887 |.^\\0F85 7AFFFF>\\jnz xcEngine.100288078 p a4 m- a/ H4 @; b: @
由于算法采用了浮点数指令,本人不太懂,边学习边研究中。。。。。。。。。 |