2014-10-6 17:36
fly_sky
哈,作者来啦
优化一直好像容易运行着运行着就出错;是什么缘故?
2 //killer array coef
DWORD dwAddrKillerArrayCoef = dwAddrStackBottom + 0x3100;
BYTE codeKillerArrayCoef[] = {
//killer_array_coef:
0xB8, 0xCC, 0xCC, 0xCC, 0x0C, //mov eax,0CCCCCCCh
0x8B, 0x51, 0x54, //mov edx,dword ptr [ecx+54h]
0x80, 0xFA, 0x04, //cmp dl,4
0x75, 0x06, //jne test_strength_killer
0x6B, 0xC0, 0x08, //imul eax,eax,8
0xC2, 0x04, 0x00, //ret 4
//test_strength_killer:
0x7C, 0x06, //jl strength_killer
//no_match:
0x6B, 0xC0, 0x05, //imul eax,eax,5
0xC2, 0x04, 0x00, //ret 4
//strength_killer:
0x8B, 0x4C, 0x24, 0x04, //mov ecx,dword ptr [esp+4]
0x80, 0xFA, 0x02, //cmp dl,2
0x75, 0x18, //jne test_bow_killer
0x8A, 0x51, 0x04, //mov dl,byte ptr [ecx+4]
0x80, 0xFA, 0x02, //cmp dl,2
0x74, 0x14, //je full_match
0x80, 0xFA, 0x05, //cmp dl,5
0x74, 0x0F, //je full_match
0x80, 0xFA, 0x10, //cmp dl,10h
0x74, 0x0A, //je full_match
0x80, 0xFA, 0x0D, //cmp dl,0Dh 新增发石
0x74, 0x05, //je full_match
0x75, 0xDA, //jne no_match
//full_match:
0x6B, 0xC0, 0x0A, //imul eax,eax,0Ah
0xC2, 0x04, 0x00, //ret 4
//test_bow_killer:
0x80, 0xFA, 0x03, //cmp dl,3
0x75, 0x14, //jne test_horse_killer
0x8A, 0x51, 0x04, //mov dl,byte ptr [ecx+4]
0x80, 0xFA, 0x01, //cmp dl,1
0x74, 0xED, //je full_match
0x80, 0xFA, 0x04, //cmp dl,4
0x74, 0xE8, //je full_match
0x80, 0xFA, 0x05, //cmp dl,5
0x74, 0xE3, //je full_match
0x80, 0xFA, 0x08, //cmp dl,8
0x74, 0xDE, //je full_match
0xEB, 0xB6, //jmp no_match
//test_horse_killer:
0x80, 0xFA, 0x01, //cmp dl,1
0x75, 0x19, //jne foot_killer
0x8A, 0x51, 0x04, //mov dl,byte ptr [ecx+4]
0x80, 0xFA, 0x02, //cmp dl,2
0x74, 0xCF, //je full_match
0x80, 0xFA, 0x03, //cmp dl,3
0x74, 0xCA, //je full_match
0x80, 0xFA, 0x10, //cmp dl,10
0x74, 0xC5, //je full_match
0x80, 0xFA, 0x11, //cmp dl,11
0x74, 0xC0, //je full_match
0x80, 0xFA, 0x0A, //cmp dl,0A 象兵
0x74, 0xBB, //je full_match
0x80, 0xFA, 0x06, //cmp dl,06 长蛇(轻骑兵)
0x74, 0xB6, //je full_match
0xEB, 0x8E, //jmp no_match
//foot_killer:
0x8A, 0x51, 0x04, //mov dl,byte ptr [ecx+4]
0x80, 0xFA, 0x00, //cmp dl,0
0x74, 0xAC, //je full_match
0x80, 0xFA, 0x01, //cmp dl,1
0x74, 0xA7, //je full_match
0x80, 0xFA, 0x0C, //cmp dl,C 冲车(步兵)
0x74, 0xA2, //je full_match
0xEB, 0x7A //jmp no_match
};
这么改对吗?
3 另外想加入的一点就是设施其他武将也能发动兵法且兵法不限于设施兵法?
ps:我是新人,不知道群号。
[color=Silver][[i] 本帖最后由 fly_sky 于 2014-10-7 11:27 编辑 [/i]][/color]