写屏函数:- Z/ _8 }3 _4 T2 I# f- d
02A0EA4C |> /8B00 |/mov eax,dword ptr ds:[eax]
4 r2 h, f. O3 q- g02A0EA4E |. |0FB70450 ||movzx eax,word ptr ds:[eax+edx*2] ; [eax+edx*2]存放字符的UNICODE码3 k7 n; y! k' S6 c+ `# }
02A0EA52 |. |8B7C24 14 ||mov edi,dword ptr ss:[esp+14]! L' D! Z+ L5 B0 x5 g) F$ e* i3 a
02A0EA56 |. |8B7F 2C ||mov edi,dword ptr ds:[edi+2C]% k/ Q$ r5 c. \3 ?. h8 z
02A0EA59 |. |8D04C0 ||lea eax,dword ptr ds:[eax+eax*8]3 ^4 c) J5 r7 j" v: u
02A0EA5C |. |8D0487 ||lea eax,dword ptr ds:[edi+eax*4] ; eax存放字符编码表" }, l8 }+ E) V2 H+ {1 S, E7 A
每个字符码表占24(16进制)个字节
" j; V) R& [- Q$ M02A0EA5F |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]2 c: t& P4 m) i: g+ `. i' K
02A0EA63 |. |8D7C39 14 ||lea edi,dword ptr ds:[ecx+edi+14] ; edi就是显存地址
. y! S( b/ a$ [- h! J02A0EA67 |. |D940 04 ||fld dword ptr ds:[eax+4]
% d! o/ M3 {& R: K9 Z. D2 c1 x02A0EA6A |. |83C2 01 ||add edx,1 字符个数加一; i3 D& U) l2 N, @' }& b9 U$ y
02A0EA6D |. |D95C24 30 ||fstp dword ptr ss:[esp+30]2 E. R# H9 ~* K/ l
02A0EA71 |. |D900 ||fld dword ptr ds:[eax]
& r+ }9 d8 Y* x* s9 x$ X" n02A0EA73 |. |D91F ||fstp dword ptr ds:[edi] ; edi就是显存地址2 U* P0 F* i2 I4 g2 d7 @- G+ _
每个字符占1C个字节,最后的四个字节都是一样的,可以认为是结束标志
: {1 d! L5 E X5 @. H02A0EA75 |. |D94424 30 ||fld dword ptr ss:[esp+30]2 J4 ?6 [4 d" i/ U5 s. B: U6 y
02A0EA79 |. |D95F 04 ||fstp dword ptr ds:[edi+4], _5 T, w* M2 t: U( H# C
02A0EA7C |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]
5 |2 _# r2 I7 V9 r+ w02A0EA80 |. |D940 04 ||fld dword ptr ds:[eax+4]
) c/ G j1 D0 g: y. ~) ^02A0EA83 |. |8D7C39 30 ||lea edi,dword ptr ds:[ecx+edi+30]
; o, c0 E& I$ V0 `02A0EA87 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]( S1 L1 q1 J7 P6 w, R. L
02A0EA8B |. |D940 08 ||fld dword ptr ds:[eax+8]
5 B C0 P2 e, f. P02A0EA8E |. |D91F ||fstp dword ptr ds:[edi]
/ W$ K2 o6 l9 P. P3 J5 ^02A0EA90 |. |D94424 30 ||fld dword ptr ss:[esp+30] C, j0 L* [: [
02A0EA94 |. |D95F 04 ||fstp dword ptr ds:[edi+4]' F6 Q$ d5 M4 [! V
02A0EA97 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]$ i! W# k$ f3 Q/ L, G
02A0EA9B |. |D940 0C ||fld dword ptr ds:[eax+C]+ b/ I! z* T9 t7 D6 @
02A0EA9E |. |8D7C39 4C ||lea edi,dword ptr ds:[ecx+edi+4C]5 T# f8 r; ~ F8 `9 I, j
02A0EAA2 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
5 y; t4 b2 d1 X) i0 r1 [$ r+ A$ F02A0EAA6 |. |D900 ||fld dword ptr ds:[eax]1 A% n0 I- p* ^) l( @% C. \
02A0EAA8 |. |D91F ||fstp dword ptr ds:[edi]/ c: }/ P% `! A1 c* ~, q
02A0EAAA |. |D94424 30 ||fld dword ptr ss:[esp+30]
% |! c+ l1 | d$ P+ F2 c6 |" \02A0EAAE |. |D95F 04 ||fstp dword ptr ds:[edi+4]
i0 h1 x' B0 q6 c02A0EAB1 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C] C3 `1 \3 X! p. M* b
02A0EAB5 |. |D940 0C ||fld dword ptr ds:[eax+C]
: S! q+ \6 \/ ~+ _02A0EAB8 |. |8D7C39 68 ||lea edi,dword ptr ds:[ecx+edi+68]
5 u) h' ^# m9 Y) g4 V$ i02A0EABC |. |D95C24 30 ||fstp dword ptr ss:[esp+30]) ~0 ~7 l8 _& Y6 O; F
02A0EAC0 |. |83C1 70 ||add ecx,70" a( ~9 e: _- H5 q8 c
02A0EAC3 |. |D940 08 ||fld dword ptr ds:[eax+8]6 g, Y1 }# Q8 b5 e1 [
02A0EAC6 |. |D91F ||fstp dword ptr ds:[edi]
4 e3 Y" ~: y/ I& X+ ^02A0EAC8 |. |D94424 30 ||fld dword ptr ss:[esp+30]
9 n7 Q- h8 S7 d+ {/ i/ s02A0EACC |. |D95F 04 ||fstp dword ptr ds:[edi+4]
( f! [8 P3 H6 W& _$ z02A0EACF |. |8B46 58 ||mov eax,dword ptr ds:[esi+58]* i" D1 i% R1 O5 A. o2 c5 z
02A0EAD2 |. |03C3 ||add eax,ebx
& D: p! r/ I# P# v. F6 h02A0EAD4 |. |3B50 08 ||cmp edx,dword ptr ds:[eax+8]
0 z1 m9 R) |2 [02A0EAD7 |.^\\0F8C 6FFFFF>|\\jl xcDxShad.02A0EA4C& K# d4 _) Y6 {2 r5 h: N" T
6 U8 w$ F* s% ?& }' D- v; `本游戏字符编码采用UNICODE,
( t/ |" M1 n% X! _) Z& \3 ]& K对字符码表的操作:, x. C8 \' A& m5 v+ I
10028807 |> /0FB702 /movzx eax,word ptr ds:[edx] 读字符的UNICODE码
4 n$ R1 m& D! ~9 [5 a$ u2 L1002880A |. |8D04C0 |lea eax,dword ptr ds:[eax+eax*8]
' q( r( B. l% {, s" H* v1002880D |. |8D0483 |lea eax,dword ptr ds:[ebx+eax*4] 根据UNICODE码求得字符码表的地址: `8 F' `- f& }( c$ @% O
10028810 |. |33C9 |xor ecx,ecx
( v' }5 @* i# [$ C10028812 |. |DB40 20 |fild dword ptr ds:[eax+20]. f" Y3 i/ a5 ^% g8 O, j
10028815 |. |D95C24 14 |fstp dword ptr ss:[esp+14]
1 g2 d2 f; V- Z0 D# A8 ^10028819 |. |D94424 14 |fld dword ptr ss:[esp+14]
% U- D% c" n& K6 E" D1 z- a1002881D |. |D9C0 |fld st; m: a# B2 V9 R. B) I2 @5 p
1002881F |. |D84E 14 |fmul dword ptr ds:[esi+14]) p3 O2 N H( e1 m5 U) T, p8 H/ |) A
10028822 |. |D94424 0C |fld dword ptr ss:[esp+C]
# z* ^4 r+ g4 p% E9 M10028826 |. |D9C0 |fld st
: n% n( J4 f4 i10028828 |. |DEC2 |faddp st(2),st7 W) g1 U J7 {. u( { U D
1002882A |. |D9C9 |fxch st(1)( v: P9 K" L% K; O
1002882C |. |D95C24 14 |fstp dword ptr ss:[esp+14]
3 o, A7 J7 R! X0 X10028830 |. |D8D3 |fcom st(3)
9 Q. K6 ]6 {. \3 ?& `' ?10028832 |. |DFE0 |fstsw ax0 v1 _6 @5 a' [. s3 n0 N
10028834 |. |F6C4 01 |test ah,1
/ x8 h! C& [5 i ^3 w8 s10028837 |. |74 2B |je short xcEngine.10028864
0 l+ K* b6 \1 r! q/ A* G8 d10028839 |. |D94424 14 |fld dword ptr ss:[esp+14]8 s( @ N$ X/ Z# B8 Z: F+ ?
1002883D |. |D8D3 |fcom st(3)
$ \: f; i) t+ ?( U1002883F |. |DFE0 |fstsw ax
) Y6 L. H" U5 Q! ?, Y7 V10028841 |. |F6C4 41 |test ah,41
5 o+ r: j c+ Y: m10028844 |. |7A 04 |jpe short xcEngine.1002884A' J! L& T( w# c, x6 q* d
10028846 |. |DDD8 |fstp st
5 E7 Q+ {+ p5 q" }6 M& Q3 f# i10028848 |. |EB 1A |jmp short xcEngine.100288649 U* G% v( O5 v, x
1002884A |> |D9C9 |fxch st(1)
$ P$ d: Z0 f, \2 g1002884C |. |D8D3 |fcom st(3)% K/ X- Y5 S( c- A" m* v' t
1002884E |. |DFE0 |fstsw ax" t* w, z# A4 L. |7 ]2 i
10028850 |. |F6C4 05 |test ah,5. T" I0 w- p4 w( H5 f
10028853 |. |7A 04 |jpe short xcEngine.100288591 H+ }1 s( z: N$ N9 o
10028855 |. |DDD9 |fstp st(1)
5 }2 e* E; X+ Z, n, s8 q. c/ d5 f10028857 |. |EB 0B |jmp short xcEngine.10028864
- f2 r* n) L" [2 |' V2 z/ P10028859 |> |D9C9 |fxch st(1)
- }/ C9 s: ~5 ~# k* q+ Q% q1002885B |. |D8DC |fcomp st(4)
, z0 K0 r4 T% @1 H" D1002885D |. |DFE0 |fstsw ax
: y! W+ J; c. V1 C1002885F |. |F6C4 41 |test ah,41
/ I! o3 a3 R- P+ w10028862 |. |75 05 |jnz short xcEngine.100288697 b& z. j' A$ h, y# v& M
10028864 |> |B9 01000000 |mov ecx,15 K# Y4 |8 \& c
10028869 |> |85C9 |test ecx,ecx
2 z) k6 K, G3 L: m# t1002886B |. |8B4424 18 |mov eax,dword ptr ss:[esp+18], a4 [) o: z0 I. h- p1 ?$ s
1002886F |. |D940 14 |fld dword ptr ds:[eax+14]
- a# N/ R: `: G6 o10028872 |. |DECA |fmulp st(2),st
% J" M" J8 b* G10028874 |. |DEC1 |faddp st(1),st' |6 u w1 ^5 `8 I- I8 T$ M
10028876 |. |D95C24 0C |fstp dword ptr ss:[esp+C]( u$ j8 l3 \+ W7 C6 p9 @" q
1002887A |. |75 05 |jnz short xcEngine.10028881
# s/ u4 e3 `1 q1002887C |. |834424 10 0>|add dword ptr ss:[esp+10],1
. X9 X/ ~) h. S% Z10028881 |> |83C2 02 |add edx,2
9 u* N" q( g. U8 a( R) j& _10028884 |. |83EF 01 |sub edi,1$ M. ?7 I& O5 n0 ]! H# p
10028887 |.^\\0F85 7AFFFF>\\jnz xcEngine.10028807
* ^2 g+ [) S! P4 r由于算法采用了浮点数指令,本人不太懂,边学习边研究中。。。。。。。。。 |