Function at 0x578b40
Capabilities:
Resolve function by parsing pe exports

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x74686b
push eax
mov dword fs:[0], esp
sub esp, 0x168
push ebx
mov ebx, dword [esp + 0x17c]
mov ax, word [ebx + 0x9c]
push ebp
xor ebp, ebp
cmp ax, bp
je 0x5795ba
cmp ax, 0xffff
je 0x5795ba
mov eax, dword [0x912e94]
mov cx, word [eax + 0x1ac]
push ecx
mov ecx, ebx
call fcn.00574a00
test al, 3
je 0x5795ba
and eax, 1
mov dword [esp + 0x68], eax
je 0x578bae
mov cx, word [ebx + 0x80]
jmp 0x578bb5
mov cx, word [ebx + 0x82]
mov ax, word [ebx + 0x80]
cmp cx, ax
mov dword [esp + 0x30], ecx
jne 0x578bd3
mov dx, word [ebx + 0x82]
mov word [esp + 0x60], dx
jmp 0x578bd7
mov dword [esp + 0x60], eax
mov eax, dword [ebx + 0xb0]
push esi
push edi
lea edi, [ebx + 0xb0]
mov ecx, edi
mov dword [esp + 0x58], ebp
mov dword [esp + 0x60], ebp
mov dword [esp + 0x54], ebp
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x64], ebp
mov dword [esp + 0x44], ebp
mov dword [esp + 0x50], ebp
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x48], ebp
mov dword [esp + 0x34], ebp
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x30], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x40], ebp
call dword [eax + 0x2c]
cmp eax, ebp
mov dword [esp + 0x6c], eax
je 0x578e81
mov edx, dword [edi]
lea eax, [esp + 0x6c]
push eax
mov ecx, edi
call dword [edx + 0x34]
mov edx, dword [eax]
mov eax, edx
shr eax, 0x18
sub eax, ebp
je 0x578c77
sub eax, 1
je 0x578c69
sub eax, 1
jne 0x578e77
mov ecx, dword [0x912e94]
mov ecx, dword [ecx + 0x2e4]
jmp 0x578c83
mov ecx, dword [0x912e94]
mov ecx, dword [ecx + 0x2e0]
jmp 0x578c83
mov ecx, dword [0x912e94]
mov ecx, dword [ecx + 0x2dc]
mov eax, dword [ecx]
push edx
call dword [eax + 0x18]
cmp eax, ebp
je 0x578e77
lea ecx, [eax - 0x18]
cmp ecx, ebp
je 0x578e77
mov edx, dword [ecx]
call dword [edx + 0x24]
mov esi, eax
cmp esi, ebp
je 0x578e77
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0xdc]
mov ecx, dword [0x912e94]
cmp ax, word [ecx + 0x1ac]
jne 0x578d9f
cmp dword [esp + 0x58], ebp
jne 0x578cd2
mov dword [esp + 0x58], esi
mov ecx, esi
call fcn.00559ac0
test eax, eax
je 0x578d35
mov dx, word [esi + 0xb8]
cmp dx, word [ebx + 0x9c]
je 0x578d35
mov ecx, esi
call fcn.0055a440
cmp eax, ebp
je 0x578e77
cmp dword [eax + 0x3c], ebp
je 0x578e77
mov eax, dword [esp + 0x24]
add eax, 1
cmp eax, 2
mov dword [esp + 0x24], eax
jle 0x578d1d
mov dword [esp + 0x24], 2
cmp dword [esp + 0x44], ebp
jne 0x578d2c
mov dword [esp + 0x44], esi
jmp 0x578e77
mov dword [esp + 0x50], esi
jmp 0x578e77
mov ecx, esi
call fcn.0055eb70
test eax, eax
je 0x578e77
mov ecx, esi
call fcn.0055ecd0
test eax, eax
je 0x578d57
mov dword [esp + 0x40], 1
mov ecx, esi
call fcn.0055a440
cmp eax, ebp
je 0x578e77
cmp dword [eax + 0x3c], ebp
je 0x578e77
mov eax, dword [esp + 0x30]
add eax, 1
cmp eax, 2
mov dword [esp + 0x30], eax
jle 0x578d87
mov dword [esp + 0x30], 2
cmp dword [esp + 0x4c], ebp
jne 0x578d96
mov dword [esp + 0x4c], esi
jmp 0x578e77
mov dword [esp + 0x64], esi
jmp 0x578e77
mov ax, word [esi + 0xb8]
cmp ax, bp
je 0x578e66
cmp ax, word [esp + 0x38]
je 0x578e6d
cmp dword [esp + 0x60], ebp
jne 0x578dc4
mov dword [esp + 0x60], esi
mov ecx, esi
call fcn.00559ac0
test eax, eax
je 0x578e21
mov ax, word [esi + 0xb8]
cmp ax, word [ebx + 0x9c]
je 0x578e21
mov ecx, esi
call fcn.0055a440
cmp eax, ebp
je 0x578e77
cmp dword [eax + 0x3c], ebp
je 0x578e77
mov eax, dword [esp + 0x28]
add eax, 1
cmp eax, 2
mov dword [esp + 0x28], eax
jle 0x578e0f
mov dword [esp + 0x28], 2
cmp dword [esp + 0x34], ebp
jne 0x578e1b
mov dword [esp + 0x34], esi
jmp 0x578e77
mov dword [esp + 0x5c], esi
jmp 0x578e77
mov ecx, esi
call fcn.0055eb70
test eax, eax
je 0x578e77
mov ecx, esi
call fcn.0055a440
cmp eax, ebp
je 0x578e77
cmp dword [eax + 0x3c], ebp
je 0x578e77
mov eax, dword [esp + 0x2c]
add eax, 1
cmp eax, 2
mov dword [esp + 0x2c], eax
jle 0x578e54
mov dword [esp + 0x2c], 2
cmp dword [esp + 0x3c], ebp
jne 0x578e60
mov dword [esp + 0x3c], esi
jmp 0x578e77
mov dword [esp + 0x48], esi
jmp 0x578e77
cmp ax, word [esp + 0x38]
jne 0x578e77
cmp dword [esp + 0x54], ebp
jne 0x578e77
mov dword [esp + 0x54], esi
cmp dword [esp + 0x6c], ebp
jne 0x578c36
mov eax, dword [esp + 0x38]
mov edi, dword [esp + 0x188]
xor ebx, ebx
cmp dword [esp + 0x40], ebp
setne bl
xor ecx, ecx
add ebx, 1
cmp ax, word [edi + 0x9c]
mov dword [esp + 0x74], ebx
sete cl
xor edx, edx
mov esi, ecx
mov ecx, dword [0x912e94]
cmp ax, word [ecx + 0x1ac]
setne dl
mov eax, edx
cmp eax, ebp
mov dword [esp + 0x40], eax
je 0x578ecd
mov edx, str.reinforcement
jmp 0x578ed7
mov edx, dword [edi + 0x40]
mov edx, dword [edx*4 + 0x8618bc]
cmp esi, ebp
mov ecx, 0x7c4ca8
jne 0x578ee5
mov ecx, str.lost
cmp dword [esp + 0x70], ebp
mov eax, str.attack
jne 0x578ef5
mov eax, str.defend
push ecx
push eax
push edx
lea eax, [esp + 0x104]
push str._s__s__s
push eax
call fcn.0071f52c
add esp, 0x14
push ebp
push 2
lea ecx, [esp + 0x100]
push ecx
mov ecx, dword [0x894420]
push str.battle_outcome
call fcn.00414c00
mov edi, eax
cmp edi, ebp
je 0x578f72
mov ebp, dword [esp + 0x18c]
test ebp, ebp
je 0x578f67
test esi, esi
mov ecx, dword [0x894420]
push 0
push 0
je 0x578f4e
push str.title_won
jmp 0x578f53
push str.title_lost
push str.battle_outcome
call fcn.00414c00
push eax
push ebp
call fcn.0071e658
add esp, 8
mov ebp, dword [esp + 0x190]
test ebp, ebp
jne 0x578f8d
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x168]
mov dword fs:[0], ecx
add esp, 0x174
ret
lea ecx, [esp + 0x10]
call fcn.004179a0
mov ebx, dword [esp + 0x188]
mov edx, dword [ebx]
mov ecx, ebx
mov dword [esp + 0x180], 0
call dword [edx + 0xd4]
push 0
mov esi, eax
push esi
call fcn.00659110
add esp, 8
test eax, eax
je 0x578ff6
push 0
push 1
movzx esi, si
push esi
push fcn.005e0630
push str.REALM
lea ecx, [esp + 0x24]
call fcn.00415b10
push 0
push 1
push esi
push 0x5e0690
push str.TOWN
lea ecx, [esp + 0x24]
call fcn.00415b10
mov eax, dword [0x912e94]
movzx ecx, word [eax + 0x1ac]
push 0
push 1
push ecx
push fcn.005e0570
push str.PLR_KINGDOM
lea ecx, [esp + 0x24]
call fcn.00415b10
mov ecx, dword [esp + 0x58]
test ecx, ecx
je 0x579067
call fcn.0055a440
mov esi, eax
test esi, esi
je 0x579067
mov eax, dword [esi + 0x3c]
test eax, eax
je 0x579067
push 0
push 1
push eax
push 0x5e06f0
push str.PLR_KNIGHT
lea ecx, [esp + 0x24]
call fcn.00415b10
mov edx, dword [esi + 0x3c]
push 0
push 1
push edx
push 0x5e07b0
push str.PLR_TITLE
lea ecx, [esp + 0x24]
call fcn.00415b10
movzx eax, word [esp + 0x68]
push 0
push 1
push eax
push fcn.005e0570
push str.ENEMY_KINGDOM
lea ecx, [esp + 0x24]
call fcn.00415b10
mov ecx, dword [esp + 0x60]
test ecx, ecx
je 0x5790d3
call fcn.0055a440
mov esi, eax
test esi, esi
je 0x5790f9
mov eax, dword [esi + 0x3c]
test eax, eax
je 0x5790f9
push 0
push 1
push eax
push 0x5e06f0
push str.ENEMY_KNIGHT
lea ecx, [esp + 0x24]
call fcn.00415b10
mov ecx, dword [esi + 0x3c]
push 0
push 1
push ecx
push 0x5e07b0
push str.ENEMY_TITLE
lea ecx, [esp + 0x24]
call fcn.00415b10
jmp 0x5790f9
cmp dword [esp + 0x70], 0
je 0x57959f
mov eax, dword [ebx + 0x40]
cmp eax, 1
je 0x5790f9
cmp eax, 4
je 0x5790f9
cmp eax, 5
je 0x5790f9
cmp eax, 2
jne 0x57959f
mov ebx, dword [esp + 0x40]
test ebx, ebx
je 0x57916b
movzx edx, word [esp + 0x38]
push 0
push 1
push edx
push fcn.005e0570
push str.ALLY_KINGDOM
lea ecx, [esp + 0x24]
call fcn.00415b10
mov ecx, dword [esp + 0x54]
test ecx, ecx
je 0x57916b
call fcn.0055a440
mov esi, eax
test esi, esi
je 0x57916b
mov eax, dword [esi + 0x3c]
test eax, eax
je 0x57916b
push 0
push 1
push eax
push 0x5e06f0
push str.ALLY_KNIGHT
lea ecx, [esp + 0x24]
call fcn.00415b10
mov eax, dword [esi + 0x3c]
push 0
push 1
push eax
push 0x5e07b0
push str.ALLY_TITLE
lea ecx, [esp + 0x24]
call fcn.00415b10
xor esi, esi
push esi
lea ecx, [esp + 0x14]
push ecx
push edi
push ebp
call fcn.00415f60
add esp, 0x10
cmp ebx, esi
lea ebp, [ebp + eax*2]
je 0x579195
xor eax, eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x34], esi
mov dword [esp + 0x5c], esi
jmp 0x579199
mov eax, dword [esp + 0x28]
cmp dword [esp + 0x2c], esi
jne 0x579520
cmp eax, esi
je 0x57934e
mov edx, dword [esp + 0x28]
mov ebx, dword [esp + 0x34]
mov esi, dword [esp + 0x5c]
push edx
push str.enemy__dcaptured
lea eax, [esp + 0x80]
push eax
call fcn.0071f52c
add esp, 0xc
push 0
push 0
lea ecx, [esp + 0x80]
push ecx
mov ecx, dword [0x894420]
push str.battle_outcome
call fcn.00414c00
test eax, eax
mov dword [esp + 0x48], eax
je 0x57934e
push 0x7c4b1c
push ebp
call fcn.0071f52c
add esp, 8
test ebx, ebx
lea ebp, [ebp + eax*2]
je 0x57926a
mov edx, dword [ebx]
push 0
push 1
mov ecx, ebx
call dword [edx + 0xdc]
movzx eax, ax
push eax
push fcn.005e0570
push str.KINGDOM1
lea ecx, [esp + 0x24]
call fcn.00415b10
mov ecx, ebx
call fcn.0055a440
mov edi, dword [eax + 0x3c]
push 0
push 1
push edi
push 0x5e07b0
push str.TITLE1
lea ecx, [esp + 0x24]
call fcn.00415b10
push 0
push 1
push edi
push 0x5e06f0
push str.NAME1
lea ecx, [esp + 0x24]
call fcn.00415b10
test esi, esi
je 0x5792cd
mov edx, dword [esi]
push 0
push 1
mov ecx, esi
call dword [edx + 0xdc]
movzx eax, ax
push eax
push fcn.005e0570
push str.KINGDOM2
lea ecx, [esp + 0x24]
call fcn.00415b10
mov ecx, esi
call fcn.0055a440
mov edi, dword [eax + 0x3c]
push 0
push 1
push edi
push 0x5e07b0
push str.TITLE2
lea ecx, [esp + 0x24]
call fcn.00415b10
push 0
push 1
push edi
push 0x5e06f0
push str.NAME2
lea ecx, [esp + 0x24]
call fcn.00415b10
mov edx, dword [esp + 0x48]
push 0
lea ecx, [esp + 0x14]
push ecx
push edx
push ebp
call fcn.00415f60
add esp, 0x10
test esi, esi
lea ebp, [ebp + eax*2]
je 0x57931a
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
test ebx, ebx
je 0x57934e
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
cmp dword [esp + 0x30], 0
jne 0x57955e
cmp dword [esp + 0x24], 0
je 0x579503
mov eax, dword [esp + 0x24]
mov esi, dword [esp + 0x44]
mov edi, dword [esp + 0x50]
push eax
push str.player__dcaptured
lea ecx, [esp + 0x80]
push ecx
call fcn.0071f52c
add esp, 0xc
mov ecx, dword [0x894420]
push 0
push 0
lea edx, [esp + 0x80]
push edx
push str.battle_outcome
call fcn.00414c00
test eax, eax
mov dword [esp + 0x50], eax
je 0x579503
push 0x7c4b1c
push ebp
call fcn.0071f52c
add esp, 8
test esi, esi
lea ebp, [ebp + eax*2]
je 0x579423
mov eax, dword [esi]
push 0
push 1
mov ecx, esi
call dword [eax + 0xdc]
movzx ecx, ax
push ecx
push fcn.005e0570
push str.KINGDOM1
lea ecx, [esp + 0x24]
call fcn.00415b10
mov ecx, esi
call fcn.0055a440
mov ebx, dword [eax + 0x3c]
push 0
push 1
push ebx
push 0x5e07b0
push str.TITLE1
lea ecx, [esp + 0x24]
call fcn.00415b10
push 0
push 1
push ebx
push 0x5e06f0
push str.NAME1
lea ecx, [esp + 0x24]
call fcn.00415b10
test edi, edi
je 0x579486
mov edx, dword [edi]
push 0
push 1
mov ecx, edi
call dword [edx + 0xdc]
movzx eax, ax
push eax
push fcn.005e0570
push str.KINGDOM2
lea ecx, [esp + 0x24]
call fcn.00415b10
mov ecx, edi
call fcn.0055a440
mov ebx, dword [eax + 0x3c]
push 0
push 1
push ebx
push 0x5e07b0
push str.TITLE2
lea ecx, [esp + 0x24]
call fcn.00415b10
push 0
push 1
push ebx
push 0x5e06f0
push str.NAME2
lea ecx, [esp + 0x24]
call fcn.00415b10
mov edx, dword [esp + 0x50]
push 0
lea ecx, [esp + 0x14]
push ecx
push edx
push ebp
call fcn.00415f60
add esp, 0x10
test edi, edi
je 0x5794cf
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
test esi, esi
je 0x579503
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x14]
call dword [edx + 0x1c]
lea ecx, [esp + 0x10]
mov dword [esp + 0x180], 0xffffffff
call fcn.004179c0
mov eax, dword [esp + 0x74]
jmp 0x578f74
cmp eax, esi
mov ebx, dword [esp + 0x3c]
je 0x579543
mov esi, dword [esp + 0x34]
lea edx, [esp + 0x78]
push str.enemy_1killed_1captured
push edx
call fcn.0071e658
add esp, 8
jmp 0x5791cd
mov eax, dword [esp + 0x2c]
mov esi, dword [esp + 0x48]
push eax
push str.enemy__dkilled
lea ecx, [esp + 0x80]
push ecx
jmp 0x5791c5
cmp dword [esp + 0x24], 0
mov esi, dword [esp + 0x4c]
je 0x579584
mov edi, dword [esp + 0x44]
lea eax, [esp + 0x78]
push str.player_1killed_1captured
push eax
call fcn.0071e658
add esp, 8
jmp 0x579386
mov ecx, dword [esp + 0x30]
mov edi, dword [esp + 0x64]
push ecx
push 0x7c4a54
lea edx, [esp + 0x80]
push edx
jmp 0x57937e
lea ecx, [esp + 0x10]
mov dword [esp + 0x180], 0xffffffff
call fcn.004179c0
xor eax, eax
jmp 0x578f74
mov ecx, dword [esp + 0x170]
pop ebp
xor eax, eax
pop ebx
mov dword fs:[0], ecx
add esp, 0x174
ret