写屏函数:
# C, ~ o& Y+ T$ V4 W6 n' p6 ?02A0EA4C |> /8B00 |/mov eax,dword ptr ds:[eax]; L! L8 |) a. \" \- @7 i2 i! \
02A0EA4E |. |0FB70450 ||movzx eax,word ptr ds:[eax+edx*2] ; [eax+edx*2]存放字符的UNICODE码
! g6 O$ j& U# A7 y! j4 v1 B02A0EA52 |. |8B7C24 14 ||mov edi,dword ptr ss:[esp+14]& u) D' D. N* Z0 ?
02A0EA56 |. |8B7F 2C ||mov edi,dword ptr ds:[edi+2C]4 ]" \% {- ~2 I1 i
02A0EA59 |. |8D04C0 ||lea eax,dword ptr ds:[eax+eax*8]" U. V( G, Y! ^ e
02A0EA5C |. |8D0487 ||lea eax,dword ptr ds:[edi+eax*4] ; eax存放字符编码表) M5 |" ]5 X8 }) u1 |
每个字符码表占24(16进制)个字节
' J' [9 }& k- s. ~& f0 X/ j02A0EA5F |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]
e# } R) h, y5 `" i02A0EA63 |. |8D7C39 14 ||lea edi,dword ptr ds:[ecx+edi+14] ; edi就是显存地址
. q& B J& s" _' o02A0EA67 |. |D940 04 ||fld dword ptr ds:[eax+4], h6 S! K5 L' s n0 A7 g1 o& B6 l
02A0EA6A |. |83C2 01 ||add edx,1 字符个数加一( _9 |! e. z8 H( b
02A0EA6D |. |D95C24 30 ||fstp dword ptr ss:[esp+30]$ l2 d/ C5 K) T# j
02A0EA71 |. |D900 ||fld dword ptr ds:[eax]8 x( f# [% t7 y8 T4 r; }& N
02A0EA73 |. |D91F ||fstp dword ptr ds:[edi] ; edi就是显存地址) x; p+ ?! p8 X# ~: j' Y) u
每个字符占1C个字节,最后的四个字节都是一样的,可以认为是结束标志7 C5 S. J V6 ]
02A0EA75 |. |D94424 30 ||fld dword ptr ss:[esp+30]
: e4 H" N; A+ K$ ^ I M7 `/ }3 Q02A0EA79 |. |D95F 04 ||fstp dword ptr ds:[edi+4]5 T( d2 h5 T' P; M
02A0EA7C |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]8 M! r8 W* G' X. |
02A0EA80 |. |D940 04 ||fld dword ptr ds:[eax+4]' f. U$ M' |6 ]- \5 s- ^2 Y
02A0EA83 |. |8D7C39 30 ||lea edi,dword ptr ds:[ecx+edi+30]" t1 B i0 W0 O" q) ^
02A0EA87 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
$ m0 M1 n4 o; V2 M4 P02A0EA8B |. |D940 08 ||fld dword ptr ds:[eax+8]
8 b: w) G0 M( E# b1 @02A0EA8E |. |D91F ||fstp dword ptr ds:[edi]5 |3 F3 M. E! p0 ~3 ^9 b: g% U+ u
02A0EA90 |. |D94424 30 ||fld dword ptr ss:[esp+30]
2 Y( i. s( h. r% X) K, w5 D1 C02A0EA94 |. |D95F 04 ||fstp dword ptr ds:[edi+4]
8 d! y1 _+ F4 `7 s02A0EA97 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]/ B+ T0 f& i/ O7 E0 o+ ` J; b
02A0EA9B |. |D940 0C ||fld dword ptr ds:[eax+C]
, u- M+ C& k, y# j1 k02A0EA9E |. |8D7C39 4C ||lea edi,dword ptr ds:[ecx+edi+4C]
. v5 {+ s }/ B: @6 o02A0EAA2 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
k0 e" l* \8 z2 ?' C3 o A7 n, d02A0EAA6 |. |D900 ||fld dword ptr ds:[eax]
7 q, i' T2 A. {8 U! r4 o( S5 I F02A0EAA8 |. |D91F ||fstp dword ptr ds:[edi]
0 K6 l4 s1 x6 g$ H' Z02A0EAAA |. |D94424 30 ||fld dword ptr ss:[esp+30]
. _% y X7 t2 f- Y$ o! X6 q* _02A0EAAE |. |D95F 04 ||fstp dword ptr ds:[edi+4]
/ n4 J/ c/ d: ^/ S02A0EAB1 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]/ r, B8 T- Z8 _8 Q2 E5 R
02A0EAB5 |. |D940 0C ||fld dword ptr ds:[eax+C]
( e; L7 r+ V8 Z8 W1 z; \02A0EAB8 |. |8D7C39 68 ||lea edi,dword ptr ds:[ecx+edi+68]" P- c' y8 v. Y/ g2 K. d
02A0EABC |. |D95C24 30 ||fstp dword ptr ss:[esp+30]6 S- U5 O: {4 _ a; E
02A0EAC0 |. |83C1 70 ||add ecx,70; ]6 z" L$ u, M/ z ?
02A0EAC3 |. |D940 08 ||fld dword ptr ds:[eax+8]
7 @2 Z- V! U2 Q' K, \02A0EAC6 |. |D91F ||fstp dword ptr ds:[edi]
% @' _; A1 x, r/ ?02A0EAC8 |. |D94424 30 ||fld dword ptr ss:[esp+30]
Y' K- M f9 X# O9 U4 K02A0EACC |. |D95F 04 ||fstp dword ptr ds:[edi+4]; z! d) C8 l7 h% f, L0 @ f I
02A0EACF |. |8B46 58 ||mov eax,dword ptr ds:[esi+58]" M; U7 ?/ H+ s1 s# Z/ y
02A0EAD2 |. |03C3 ||add eax,ebx
1 E+ {; n6 c' X7 u: B- \3 G3 d' T02A0EAD4 |. |3B50 08 ||cmp edx,dword ptr ds:[eax+8]" h6 F4 y9 V% n1 P
02A0EAD7 |.^\\0F8C 6FFFFF>|\\jl xcDxShad.02A0EA4C
1 F f4 j# `0 M6 J0 [+ [; ?3 ~& L: T2 [( g, |
本游戏字符编码采用UNICODE,1 ~ ~) t2 v8 o
对字符码表的操作:
$ {; `; W) N; ?* g X0 G; a10028807 |> /0FB702 /movzx eax,word ptr ds:[edx] 读字符的UNICODE码4 K8 x0 J, d+ P- j D6 u. s; M) v
1002880A |. |8D04C0 |lea eax,dword ptr ds:[eax+eax*8]
) i5 y2 k; f( A1002880D |. |8D0483 |lea eax,dword ptr ds:[ebx+eax*4] 根据UNICODE码求得字符码表的地址
# w* {+ h- Y' v( ?2 Q9 C10028810 |. |33C9 |xor ecx,ecx
+ w2 b7 k- } y/ E" R: |10028812 |. |DB40 20 |fild dword ptr ds:[eax+20]
F3 m: K8 G- Y f6 J; q9 s10028815 |. |D95C24 14 |fstp dword ptr ss:[esp+14]
) B8 Q( [3 g# b# Z3 r& h' Y) t10028819 |. |D94424 14 |fld dword ptr ss:[esp+14]: N5 N1 y* a- ~- d6 }* ]! T+ \$ `
1002881D |. |D9C0 |fld st
t$ A# p. k$ ]* `& g1002881F |. |D84E 14 |fmul dword ptr ds:[esi+14]0 y4 ^* R9 V! E ^( C/ G
10028822 |. |D94424 0C |fld dword ptr ss:[esp+C]2 s% s' N6 q6 v6 g, ]1 o, ?% \
10028826 |. |D9C0 |fld st
4 ?) y" i1 t& r4 B. a$ l2 Z- c10028828 |. |DEC2 |faddp st(2),st
0 O# {/ m, Z2 r9 n1002882A |. |D9C9 |fxch st(1)
6 A4 b! y/ L6 H& {1002882C |. |D95C24 14 |fstp dword ptr ss:[esp+14]: b6 X. y1 |1 g, B* Z0 e
10028830 |. |D8D3 |fcom st(3)/ ^+ _7 G# R* s; L
10028832 |. |DFE0 |fstsw ax
) w) H5 s: q4 Q5 ?10028834 |. |F6C4 01 |test ah,1
. Q+ ?/ C0 N* g1 ~" c; m; C) J10028837 |. |74 2B |je short xcEngine.10028864
3 z/ ~$ ~" w1 U8 d" W+ F10028839 |. |D94424 14 |fld dword ptr ss:[esp+14]
9 ?; f K/ E/ e. T8 t* r% _8 l6 t8 s1002883D |. |D8D3 |fcom st(3)
' u, \' u/ F* M+ g4 ~- P1002883F |. |DFE0 |fstsw ax; h* t6 e0 f- b; j4 l- B5 ?5 Z
10028841 |. |F6C4 41 |test ah,41) w" a& M3 r! N2 Y0 r4 V
10028844 |. |7A 04 |jpe short xcEngine.1002884A E0 S: B- i" R7 B6 q
10028846 |. |DDD8 |fstp st
R- _% c6 V% L% G/ B# B# r% t; W: h# K10028848 |. |EB 1A |jmp short xcEngine.10028864
% X3 [, f6 T; d1002884A |> |D9C9 |fxch st(1)0 j$ \; A) q9 Y1 E2 f
1002884C |. |D8D3 |fcom st(3)( C6 r% j- c. _' Q4 U
1002884E |. |DFE0 |fstsw ax. h) U! _; @" q
10028850 |. |F6C4 05 |test ah,5
0 u/ R$ p0 F' @5 z5 ]3 N. g10028853 |. |7A 04 |jpe short xcEngine.10028859
5 B5 A9 R2 @) X10028855 |. |DDD9 |fstp st(1)- M) {6 D3 t5 Z# }' \4 o
10028857 |. |EB 0B |jmp short xcEngine.10028864: L; }1 I: P1 g) A3 n7 d2 s/ f: U
10028859 |> |D9C9 |fxch st(1)
# |% U! R/ M' i: ?. u$ y3 [ f1002885B |. |D8DC |fcomp st(4)) O, ?9 S- S4 }' c- A u4 ]/ P" a' p
1002885D |. |DFE0 |fstsw ax
5 D. L0 @1 D9 B5 H, x- w1002885F |. |F6C4 41 |test ah,417 S" P+ G; ?( w8 ^
10028862 |. |75 05 |jnz short xcEngine.10028869* z8 f% v9 W9 v- u, B1 a$ m
10028864 |> |B9 01000000 |mov ecx,1
. p6 ]+ ^0 l. \10028869 |> |85C9 |test ecx,ecx0 D( M6 r) R+ u3 y2 R: h2 w- d% l
1002886B |. |8B4424 18 |mov eax,dword ptr ss:[esp+18]
: w! J* S: L, k ^+ Q. r' [- r; q- ]1002886F |. |D940 14 |fld dword ptr ds:[eax+14]
' K) n6 {, D. `+ _10028872 |. |DECA |fmulp st(2),st
8 H& W* h8 n' {) V2 w$ F10028874 |. |DEC1 |faddp st(1),st
$ r9 O0 H* }6 W$ a10028876 |. |D95C24 0C |fstp dword ptr ss:[esp+C]
0 ?/ f) N3 w" h' T) w1002887A |. |75 05 |jnz short xcEngine.10028881$ I6 J$ r$ C% C
1002887C |. |834424 10 0>|add dword ptr ss:[esp+10],1
& b- O+ a+ p9 ?% p& [: m5 A- ~10028881 |> |83C2 02 |add edx,2( X) p& j+ F% o( W& F; k# ^
10028884 |. |83EF 01 |sub edi,1
* K+ q( f# k. `# Q6 p2 P" O3 x10028887 |.^\\0F85 7AFFFF>\\jnz xcEngine.100288075 _% R6 X0 r' r" p' z/ M
由于算法采用了浮点数指令,本人不太懂,边学习边研究中。。。。。。。。。 |