写屏函数:7 t8 v. @6 a( p- J1 O. i
02A0EA4C |> /8B00 |/mov eax,dword ptr ds:[eax]
d, o1 q+ ^, ~0 w" S' L02A0EA4E |. |0FB70450 ||movzx eax,word ptr ds:[eax+edx*2] ; [eax+edx*2]存放字符的UNICODE码
+ u* M5 q3 r/ H3 ]( C; c ~02A0EA52 |. |8B7C24 14 ||mov edi,dword ptr ss:[esp+14]2 A; E$ A1 b$ W" N! b4 r4 t
02A0EA56 |. |8B7F 2C ||mov edi,dword ptr ds:[edi+2C]4 p+ ~6 C" g& N; ]; i
02A0EA59 |. |8D04C0 ||lea eax,dword ptr ds:[eax+eax*8]$ d- H; B5 j6 i/ Q, C
02A0EA5C |. |8D0487 ||lea eax,dword ptr ds:[edi+eax*4] ; eax存放字符编码表) \5 ?( |" O+ n7 K ]5 L
每个字符码表占24(16进制)个字节/ P6 P: v. v; ^# Y' M2 L7 s2 b6 r
02A0EA5F |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]
) i8 O* h5 |; W' o V02A0EA63 |. |8D7C39 14 ||lea edi,dword ptr ds:[ecx+edi+14] ; edi就是显存地址
5 h6 g6 d0 x5 n; z* c$ X; J4 i02A0EA67 |. |D940 04 ||fld dword ptr ds:[eax+4]
& Q! z- g* ^: c! Y: X$ ^02A0EA6A |. |83C2 01 ||add edx,1 字符个数加一2 o0 U/ I8 {: A5 L; X6 z# `
02A0EA6D |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
/ _% [0 i$ i# v% ?02A0EA71 |. |D900 ||fld dword ptr ds:[eax]! L. }& U& x6 ?$ m( ?
02A0EA73 |. |D91F ||fstp dword ptr ds:[edi] ; edi就是显存地址
, i) t) ^. w" ~每个字符占1C个字节,最后的四个字节都是一样的,可以认为是结束标志
: m1 I- E( n5 h" G0 h02A0EA75 |. |D94424 30 ||fld dword ptr ss:[esp+30]1 P) i$ D$ b" B7 N7 P
02A0EA79 |. |D95F 04 ||fstp dword ptr ds:[edi+4]
9 Y( }7 g' [' P02A0EA7C |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]
# E% Z! t, ~ y. V02A0EA80 |. |D940 04 ||fld dword ptr ds:[eax+4]8 S) ]5 ], s% ]7 u
02A0EA83 |. |8D7C39 30 ||lea edi,dword ptr ds:[ecx+edi+30]: p1 j3 I5 o1 u$ A9 _0 J' f
02A0EA87 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
- K, K0 ^& t, b- t, U! a3 b02A0EA8B |. |D940 08 ||fld dword ptr ds:[eax+8]0 e% g8 y& N$ E1 Y" p+ a0 F& i* q
02A0EA8E |. |D91F ||fstp dword ptr ds:[edi]# Q W0 C- V( s+ L/ B: q! p& y
02A0EA90 |. |D94424 30 ||fld dword ptr ss:[esp+30]
7 k, b3 S" q& j$ Q! ~02A0EA94 |. |D95F 04 ||fstp dword ptr ds:[edi+4]: K# t7 j1 o6 z: g( v' C* {* a
02A0EA97 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]9 w7 w3 d/ B! o' U, Y) w+ `
02A0EA9B |. |D940 0C ||fld dword ptr ds:[eax+C]& ]1 Y* a+ j# ~8 x3 [( T
02A0EA9E |. |8D7C39 4C ||lea edi,dword ptr ds:[ecx+edi+4C]
* D+ F: Y$ K: n/ [02A0EAA2 |. |D95C24 30 ||fstp dword ptr ss:[esp+30]
/ @$ z/ c5 K/ S* ?# ?; v& a02A0EAA6 |. |D900 ||fld dword ptr ds:[eax]( V+ x8 q* o a$ q. v
02A0EAA8 |. |D91F ||fstp dword ptr ds:[edi]
/ F7 I. g) H" }6 J7 t02A0EAAA |. |D94424 30 ||fld dword ptr ss:[esp+30]
- b8 K1 e5 H5 f+ P3 B0 D/ W02A0EAAE |. |D95F 04 ||fstp dword ptr ds:[edi+4] `" k5 j8 Z! T1 ]( Q3 f2 F! s
02A0EAB1 |. |8B7C24 0C ||mov edi,dword ptr ss:[esp+C]
1 V. @ g( U Z# K6 h8 U02A0EAB5 |. |D940 0C ||fld dword ptr ds:[eax+C]
- W$ s0 t) D% k4 _+ x5 b/ y02A0EAB8 |. |8D7C39 68 ||lea edi,dword ptr ds:[ecx+edi+68]" F0 c2 h z2 Z5 a0 W' Y* ?$ @
02A0EABC |. |D95C24 30 ||fstp dword ptr ss:[esp+30]- P& [2 A! J: x6 z& |, W p1 R3 p! g
02A0EAC0 |. |83C1 70 ||add ecx,705 G/ D+ y# B5 H7 N1 y+ ~+ R! Y
02A0EAC3 |. |D940 08 ||fld dword ptr ds:[eax+8]5 ^' ~7 h8 V. J5 r
02A0EAC6 |. |D91F ||fstp dword ptr ds:[edi]
% T( l7 {# M T02A0EAC8 |. |D94424 30 ||fld dword ptr ss:[esp+30]: |. ^* C( [7 J" Z
02A0EACC |. |D95F 04 ||fstp dword ptr ds:[edi+4]
/ g2 S) V4 f7 y9 `( i02A0EACF |. |8B46 58 ||mov eax,dword ptr ds:[esi+58]8 M9 n# L4 I( B" l; r
02A0EAD2 |. |03C3 ||add eax,ebx
# J/ N- u0 A9 `7 p; T. L02A0EAD4 |. |3B50 08 ||cmp edx,dword ptr ds:[eax+8]
' }- q' x4 J, v4 z2 u D, |02A0EAD7 |.^\\0F8C 6FFFFF>|\\jl xcDxShad.02A0EA4C9 H! {/ [/ q1 |; P( S
& N* g9 T% T9 L
本游戏字符编码采用UNICODE,
4 U+ W+ d1 {: h; X对字符码表的操作:# S+ _' p* ]; t* K' Y3 \. J
10028807 |> /0FB702 /movzx eax,word ptr ds:[edx] 读字符的UNICODE码# U* p8 b9 ~0 ?
1002880A |. |8D04C0 |lea eax,dword ptr ds:[eax+eax*8]
3 n: W9 ]6 O7 {2 x) }/ z1002880D |. |8D0483 |lea eax,dword ptr ds:[ebx+eax*4] 根据UNICODE码求得字符码表的地址: ~" i: o# z' v! E3 J5 I: \
10028810 |. |33C9 |xor ecx,ecx, x* M6 G; J8 i9 i' Q+ Y: Z
10028812 |. |DB40 20 |fild dword ptr ds:[eax+20]
6 {7 [# ]8 x- ]5 ^( m! E+ h10028815 |. |D95C24 14 |fstp dword ptr ss:[esp+14]& K3 X$ [1 V7 u! \% `. {
10028819 |. |D94424 14 |fld dword ptr ss:[esp+14]7 g6 E: X/ n. d1 ^$ `
1002881D |. |D9C0 |fld st
/ S. G& r: l$ ~3 I1002881F |. |D84E 14 |fmul dword ptr ds:[esi+14]
; V0 V4 r% J) \( w/ l10028822 |. |D94424 0C |fld dword ptr ss:[esp+C]
/ _2 U. m, m, x8 H4 {$ q10028826 |. |D9C0 |fld st# I$ k+ \2 { l4 p: U" q
10028828 |. |DEC2 |faddp st(2),st( s9 E+ d+ P; p8 w+ d! I( {4 |
1002882A |. |D9C9 |fxch st(1)
+ E$ B) x) V6 y }& L* v3 T1002882C |. |D95C24 14 |fstp dword ptr ss:[esp+14]7 C1 ^$ D. {" a* A
10028830 |. |D8D3 |fcom st(3)0 J N. j6 r2 A; X) m5 K5 ^$ \
10028832 |. |DFE0 |fstsw ax; V+ Z8 |; X1 d2 P" P7 z
10028834 |. |F6C4 01 |test ah,1
# V9 V3 L+ y" T+ y$ b }' w! k10028837 |. |74 2B |je short xcEngine.10028864; h- E) n, ~4 T; e/ {" X8 K
10028839 |. |D94424 14 |fld dword ptr ss:[esp+14]: f3 k6 t# |/ H: W v5 \! |$ d/ j
1002883D |. |D8D3 |fcom st(3)" L2 N; b" B* B
1002883F |. |DFE0 |fstsw ax+ y8 {4 {1 Q' f. U( [" [" H/ z0 H
10028841 |. |F6C4 41 |test ah,41
4 U- P, o3 p2 e& Q10028844 |. |7A 04 |jpe short xcEngine.1002884A( v$ d) Y6 X1 {- C' d' X
10028846 |. |DDD8 |fstp st1 L2 J0 L- I3 s/ K& u( v- J
10028848 |. |EB 1A |jmp short xcEngine.10028864
7 `; H8 g$ M1 E9 H. W1002884A |> |D9C9 |fxch st(1)8 ~' c. V) n, D# ?: s; v
1002884C |. |D8D3 |fcom st(3)
: \# x0 Q; W( d8 M. ]1002884E |. |DFE0 |fstsw ax2 o& r6 B( [( n' I; B' {
10028850 |. |F6C4 05 |test ah,5
$ S* r3 I' G+ B0 A- o10028853 |. |7A 04 |jpe short xcEngine.10028859; i5 R7 ^$ [/ X% N# @- k
10028855 |. |DDD9 |fstp st(1)+ r- ~0 _. p) T( u
10028857 |. |EB 0B |jmp short xcEngine.10028864
6 W$ Y# j+ J2 f% E10028859 |> |D9C9 |fxch st(1)
+ D$ @( L9 z% [7 ?$ a# d" j1002885B |. |D8DC |fcomp st(4)
- J) k |4 g. I. ] {1002885D |. |DFE0 |fstsw ax/ S+ S. z& w( Y7 @
1002885F |. |F6C4 41 |test ah,41
6 v$ r% ^: m/ B# }10028862 |. |75 05 |jnz short xcEngine.10028869
) {0 g8 L3 W1 ^6 L" n( ]1 E10028864 |> |B9 01000000 |mov ecx,1: o. X: V* Z& P8 U
10028869 |> |85C9 |test ecx,ecx
, a ~% O. \0 N9 k- [1002886B |. |8B4424 18 |mov eax,dword ptr ss:[esp+18]
* g/ H( s/ l& |5 ~1002886F |. |D940 14 |fld dword ptr ds:[eax+14]8 }9 |! X* S4 D! K A' F9 C* o4 J
10028872 |. |DECA |fmulp st(2),st; N" m7 n2 z4 ]. O6 Y0 N9 V* i
10028874 |. |DEC1 |faddp st(1),st
8 e$ q, t# u: E# }! x10028876 |. |D95C24 0C |fstp dword ptr ss:[esp+C]
' R4 l$ z5 ~# c" N% a3 y, O3 E! ?1 A, Y1002887A |. |75 05 |jnz short xcEngine.100288810 l; ?7 `) E' g
1002887C |. |834424 10 0>|add dword ptr ss:[esp+10],1, ^' t- F# ]7 h- E: i& z
10028881 |> |83C2 02 |add edx,24 ~" i/ Z" ? Z4 Y: d) I
10028884 |. |83EF 01 |sub edi,1 E+ C$ G) b, P- Q
10028887 |.^\\0F85 7AFFFF>\\jnz xcEngine.100288070 i* s% l" y0 S
由于算法采用了浮点数指令,本人不太懂,边学习边研究中。。。。。。。。。 |