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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x7494ca
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x1b0
push ebx
push esi
xor esi, esi
cmp dword [ebp + 8], esi
push edi
mov edi, ecx
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], esi
je 0x5b6a3d
lea ecx, [esp + 0x140]
call fcn.00617e50
mov eax, dword [edi]
mov ecx, edi
mov dword [esp + 0x1c4], esi
call dword [eax + 0xc]
lea ecx, [esp + 0xf8]
call fcn.004049b0
push str.map_kings_kingdoms.ini
lea ecx, [esp + 0xfc]
mov byte [esp + 0x1c8], 1
call fcn.00403a50
test eax, eax
lea ecx, [esp + 0xf8]
jne 0x5b6a19
push str.kingdoms
push esi
call fcn.00402f30
cmp eax, esi
lea ecx, [esp + 0xf8]
jne 0x5b6a56
mov byte [esp + 0x1c4], 0
call fcn.004049f0
lea ecx, [esp + 0x140]
mov dword [esp + 0x1c4], 0xffffffff
call fcn.00616d60
xor eax, eax
mov ecx, dword [esp + 0x1bc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push eax
call fcn.004030f0
mov ebx, eax
cmp ebx, esi
mov dword [esp + 0x8c], ebx
je 0x5b73f0
lea ecx, [ecx]
push 0xffffffffffffffff
push ebx
lea ecx, [esp + 0x100]
call fcn.00405410
push eax
lea ecx, [esp + 0x44]
call fcn.00413870
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x9c]
push str.map_kings_
push edx
mov byte [esp + 0x1d0], 2
call fcn.00413c20
add esp, 0xc
push eax
lea ecx, [esp + 0x40]
mov byte [esp + 0x1c8], 3
call fcn.004133c0
lea ecx, [esp + 0x98]
mov byte [esp + 0x1c4], 2
call fcn.00412de0
push 0x77fbbc
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x64]
push ecx
call fcn.00413ad0
mov edx, dword [0x912e94]
mov eax, dword [edx + 0x1a4]
add esp, 4
add eax, 0x1f8
mov ecx, esp
mov dword [esp + 0x40], esp
push eax
mov byte [esp + 0x1d0], 4
call fcn.00413820
lea ecx, [esp + 0x64]
call fcn.00413460
lea ecx, [esp + 0xb0]
call fcn.004049b0
push str..txt
lea ecx, [esp + 0x60]
push ecx
lea edx, [esp + 0xa8]
push edx
mov byte [esp + 0x1d0], 5
call fcn.00413ad0
add esp, 0xc
mov eax, dword [eax]
push eax
lea ecx, [esp + 0xb4]
mov byte [esp + 0x1c8], 6
call fcn.00403a50
lea ecx, [esp + 0xa0]
mov esi, eax
mov byte [esp + 0x1c4], 5
call fcn.00412de0
test esi, esi
je 0x5b6bc4
push str..txt
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x98]
push ecx
call fcn.00413ad0
add esp, 0xc
mov eax, dword [eax]
push eax
lea ecx, [esp + 0xb4]
mov byte [esp + 0x1c8], 7
call fcn.00403a50
lea ecx, [esp + 0x90]
mov esi, eax
mov byte [esp + 0x1c4], 5
call fcn.00412de0
test esi, esi
jne 0x5b739c
push 0xffffffffffffffff
push ebx
lea ecx, [esp + 0xb8]
call fcn.00405410
push eax
lea ecx, [esp + 0x50]
call fcn.00413870
lea ecx, [esp + 0x48]
mov byte [esp + 0x1c4], 8
call fcn.00413540
mov edx, dword [esp + 0x48]
push edx
call fcn.005b45f0
mov esi, eax
add esp, 4
test esi, esi
mov dword [esp + 0x50], esi
je 0x5b738b
mov eax, dword [esi + 0x24]
lea ecx, [esi + 0x24]
call dword [eax + 0x48]
test eax, eax
je 0x5b738b
cmp dword [esi + 0x19c], 0
jne 0x5b738b
push 0x3c
call fcn.0040fa60
add esp, 4
mov dword [esp + 0x38], eax
test eax, eax
mov byte [esp + 0x1c4], 9
je 0x5b6c57
xor esi, esi
push esi
lea ecx, [esp + 0xb4]
push ecx
mov ecx, eax
call fcn.00409fe0
mov edi, eax
jmp 0x5b6c5b
xor edi, edi
xor esi, esi
push ebx
lea ecx, [esp + 0xb4]
mov byte [esp + 0x1c8], 8
call fcn.00402f50
push eax
call fcn.0071ed91
lea edx, [eax + eax*4]
mov eax, dword [esp + 0x34]
add edx, edx
add esp, 4
mov dword [eax + 0x1c], edx
mov dword [esp + 0x38], esi
mov dword [esp + 0x44], esi
mov dword [esp + 0x18], vtable.CBArray_class_CBStr_.0
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], esi
mov dword [esp + 0x24], 1
mov dword [esp + 0x28], esi
mov edx, dword [edi]
lea eax, [esp + 0x18]
push eax
mov ecx, edi
mov byte [esp + 0x1c8], 0xa
call dword [edx + 0x44]
mov edx, dword [esp + 0x18]
push str.king
push esi
lea ecx, [esp + 0x20]
call dword [edx + 0x14]
mov ecx, eax
call fcn.0040c500
test al, al
je 0x5b6d52
mov esi, 1
cmp dword [esp + 0x28], esi
jbe 0x5b6d52
mov eax, dword [esp + 0x18]
push esi
lea ecx, [esp + 0x1c]
call dword [eax + 0x14]
mov eax, dword [eax]
test eax, eax
je 0x5b6d49
push str.king
push eax
call fcn.0071f59b
add esp, 8
neg eax
sbb eax, eax
add eax, 1
test al, al
je 0x5b6d49
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x1c]
call dword [edx + 0x14]
push eax
mov eax, dword [esp + 0x1c]
push esi
lea ecx, [esp + 0x20]
call dword [eax + 0x14]
mov ecx, eax
call fcn.004133c0
mov edx, dword [esp + 0x18]
push str.king
push 0
lea ecx, [esp + 0x20]
call dword [edx + 0x14]
mov ecx, eax
call fcn.00413310
add esi, 1
cmp esi, dword [esp + 0x28]
jb 0x5b6ce4
cmp dword [esp + 0x28], 0
mov dword [esp + 0x2c], 0
jbe 0x5b723c
mov ebx, dword [esp + 0x2c]
mov eax, dword [esp + 0x18]
push ebx
lea ecx, [esp + 0x1c]
call dword [eax + 0x14]
mov eax, dword [eax]
mov edx, dword [edi]
push eax
mov ecx, edi
call dword [edx + 0x24]
mov ecx, dword [esp + 0x30]
push 0
call fcn.005b68a0
mov esi, eax
lea eax, [esp + 0x48]
push eax
lea ecx, [esi + 0x2c]
call fcn.004133c0
mov edx, dword [esp + 0x18]
push 8
lea ecx, [esp + 0xac]
push ecx
push ebx
lea ecx, [esp + 0x24]
call dword [edx + 0x14]
mov ecx, eax
call fcn.004455a0
mov eax, dword [eax]
or dword [esp + 0x34], 1
test eax, eax
mov byte [esp + 0x1c4], 0xb
je 0x5b6de2
push str.princess
push eax
call fcn.0071f59b
add esp, 8
neg eax
sbb eax, eax
add eax, 1
test al, al
jne 0x5b6e11
mov eax, dword [esp + 0x18]
push ebx
lea ecx, [esp + 0x1c]
call dword [eax + 0x14]
mov eax, dword [eax]
test eax, eax
je 0x5b6e0d
push str.queen
push eax
call fcn.0071f59b
add esp, 8
neg eax
sbb eax, eax
add eax, 1
test al, al
jne 0x5b6e11
xor bl, bl
jmp 0x5b6e13
mov bl, 1
test byte [esp + 0x34], 1
mov dword [esp + 0x1c4], 0xa
je 0x5b6e36
and dword [esp + 0x34], 0xfffffffe
lea ecx, [esp + 0xa8]
call fcn.00412de0
test bl, bl
je 0x5b6e3e
mov byte [esi + 0xc], 1
push esi
call fcn.0062ee60
mov eax, dword [esi + 0x24]
mov edx, dword [edi]
add esp, 4
add eax, 4
push eax
push str.name
mov ecx, edi
call dword [edx + 0x6c]
mov edx, dword [edi]
push 0xffff
push str.icon
mov ecx, edi
call dword [edx + 0x90]
mov edx, dword [esp + 0x50]
mov ecx, dword [esi + 0x24]
push edx
push esi
mov word [ecx + 0xc], ax
call fcn.005b5d90
mov ecx, dword [esi + 0x24]
add esp, 8
call fcn.00630d80
lea ecx, [esp + 0x54]
call fcn.00412d40
mov eax, dword [edi]
lea ecx, [esp + 0x54]
push ecx
push str.title
mov ecx, edi
mov byte [esp + 0x1cc], 0xc
call dword [eax + 0x6c]
mov ecx, dword [esi + 0x24]
call fcn.006314f0
movzx eax, al
lea edx, [eax*8]
sub edx, eax
cmp byte [esi + 0xc], 0
mov eax, dword [0x923cb8]
lea eax, [eax + edx*4 + 8]
je 0x5b6ed6
mov ax, word [eax + 2]
jmp 0x5b6ed9
mov ax, word [eax]
mov ecx, dword [esi + 0x24]
cmp word [ecx + 0xc], ax
jbe 0x5b6efc
call fcn.00631540
mov ecx, dword [0x923cb8]
push eax
call fcn.0062e580
mov ecx, dword [esi + 0x24]
mov word [ecx + 0xc], ax
jmp 0x5b6f15
call fcn.00631540
mov edx, dword [esi + 0x24]
mov ecx, dword [0x923cb8]
push eax
mov ax, word [edx + 0xc]
push eax
call fcn.0062c130
mov ecx, dword [0x912e94]
mov edx, dword [ecx]
push 0x762
push str.BSSKoHGame_family.cpp
push 4
push 1
call dword [edx + 0x40]
mov ecx, dword [0x912e94]
mov bl, al
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, dword [esi + 0x14]
sub ecx, dword [esi + 0x10]
mov dword [esp + 0x14], eax
jne 0x5b6f4c
mov ecx, 0x5265c0
movzx eax, bl
imul eax, ecx
cdq
and edx, 7
add edx, eax
mov eax, dword [esp + 0x14]
sar edx, 3
sub eax, edx
mov dword [esi + 0x10], eax
add eax, ecx
mov dword [esi + 0x14], eax
mov ecx, dword [0x912e94]
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, dword [esp + 0x2c]
mov dword [esi + 0x4c], eax
mov edx, dword [esp + 0x18]
push ecx
lea ecx, [esp + 0x1c]
call dword [edx + 0x14]
mov eax, dword [eax]
test eax, eax
je 0x5b6fd3
push str.king
push eax
call fcn.0071f59b
add esp, 8
neg eax
sbb eax, eax
add eax, 1
test al, al
je 0x5b6fd3
mov eax, dword [esi + 8]
mov byte [esi + 0xe], 1
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x54]
test eax, eax
je 0x5b6fd3
cmp word [eax], 0
je 0x5b6fd3
lea ecx, [esp + 0x54]
push ecx
mov ecx, dword [esp + 0x54]
add ecx, 0x1a8
call fcn.004133c0
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x18]
push edx
lea ecx, [esp + 0x1c]
call dword [eax + 0x14]
mov eax, dword [eax]
test eax, eax
je 0x5b702b
push str.queen
push eax
call fcn.0071f59b
add esp, 8
neg eax
sbb eax, eax
add eax, 1
test al, al
je 0x5b702b
mov eax, dword [esp + 0x54]
test eax, eax
mov ecx, dword [esi + 8]
mov dword [esp + 0x44], ecx
je 0x5b702b
cmp word [eax], 0
je 0x5b702b
mov ecx, dword [esp + 0x50]
lea edx, [esp + 0x54]
push edx
add ecx, 0x1b0
call fcn.004133c0
mov ebx, 1
mov byte [esp + 0x13], 0
mov dword [esp + 0x14], ebx
lea esp, [esp]
lea ecx, [esp + 0x6c]
call fcn.00412d40
lea ecx, [esp + 0x64]
mov byte [esp + 0x1c4], 0xd
call fcn.00412d40
cmp byte [esp + 0x13], 3
mov byte [esp + 0x1c4], 0xe
lea ecx, [esp + 0x6c]
jae 0x5b7082
mov eax, dword [esp + 0x14]
push eax
push 0x7cf774
push ecx
call fcn.00413950
add esp, 0xc
jmp 0x5b708c
push 0x7cf76c
call fcn.00413310
mov ecx, dword [esp + 0x6c]
mov edx, dword [edi]
lea eax, [esp + 0x64]
push eax
push ecx
mov ecx, edi
call dword [edx + 0x6c]
mov eax, dword [esp + 0x64]
xor ecx, ecx
cmp eax, ecx
je 0x5b70ac
cmp word [eax], cx
jne 0x5b70d3
lea ecx, [esp + 0x64]
mov byte [esp + 0x1c4], 0xd
call fcn.00412de0
lea ecx, [esp + 0x6c]
mov byte [esp + 0x1c4], 0xc
call fcn.00412de0
jmp 0x5b71ce
mov dword [esp + 0x78], vtable.CBArray_class_CBStr_.0
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x80], ecx
mov dword [esp + 0x84], ebx
mov dword [esp + 0x88], ecx
lea edx, [esp + 0x78]
push edx
push 0x2c
lea ecx, [esp + 0x6c]
mov byte [esp + 0x1cc], 0xf
call fcn.00413d40
cmp dword [esp + 0x88], ebx
mov eax, dword [esp + 0x78]
lea ecx, [esp + 0x78]
jbe 0x5b7153
push 1
call dword [eax + 0x14]
mov eax, dword [eax]
push eax
call fcn.0062ca10
mov bl, al
add esp, 4
test bl, bl
je 0x5b7172
mov edx, dword [esp + 0x78]
push 0
lea ecx, [esp + 0x7c]
call dword [edx + 0x14]
mov ecx, eax
call fcn.00412d50
mov edx, dword [esi + 0x24]
movzx ecx, bl
mov byte [edx + ecx*2 + 0x32], al
jmp 0x5b7172
push 0
call dword [eax + 0x14]
mov eax, dword [eax]
push eax
call fcn.0062ca10
add esp, 4
test al, al
je 0x5b7172
mov edx, dword [esi + 0x24]
movzx ecx, al
mov byte [edx + ecx*2 + 0x32], 1
mov eax, dword [esp + 0x7c]
test eax, eax
mov byte [esp + 0x1c4], 0xe
mov dword [esp + 0x78], vtable.CBArray_class_CBStr_.0
je 0x5b71a7
mov ecx, dword [eax - 4]
lea ebx, [eax - 4]
push fcn.00412de0
push ecx
push 8
push eax
call fcn.0071f0d2
push ebx
call fcn.0040fa80
add esp, 4
lea ecx, [esp + 0x64]
mov byte [esp + 0x1c4], 0xd
call fcn.00412de0
lea ecx, [esp + 0x6c]
mov byte [esp + 0x1c4], 0xc
call fcn.00412de0
mov ebx, 1
mov al, byte [esp + 0x13]
add dword [esp + 0x14], ebx
add al, 1
cmp al, 4
mov byte [esp + 0x13], al
jb 0x5b7040
mov edx, dword [esi + 8]
mov eax, dword [esi + 0x24]
push edx
push eax
call fcn.00418500
mov ebx, dword [esp + 0x38]
mov edx, dword [ebx + 8]
add esp, 8
lea ecx, [ebx + 8]
push esi
call dword [edx + 8]
mov ecx, dword [ebx + 0x28]
mov edx, dword [esi + 8]
mov eax, dword [ecx]
push esi
push edx
call dword [eax + 0xc]
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x28]
lea ecx, [esp + 0x54]
mov byte [esp + 0x1c4], 0xa
call fcn.00412de0
mov eax, dword [esp + 0x2c]
add eax, 1
cmp eax, dword [esp + 0x28]
mov dword [esp + 0x2c], eax
jb 0x5b6d65
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx + 8]
add ecx, 8
mov dword [esp + 0x14], ecx
call dword [edx + 0x2c]
test eax, eax
mov dword [esp + 0x74], eax
je 0x5b72fa
mov ebx, dword [esp + 0x38]
lea ecx, [ecx]
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx]
lea edx, [esp + 0x74]
push edx
call dword [eax + 0x34]
mov ecx, dword [esp + 0x48]
test ecx, ecx
mov esi, dword [eax]
je 0x5b7292
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x5b7292
push ecx
push eax
call fcn.0071f59b
add esp, 8
neg eax
sbb eax, eax
add eax, 1
jmp 0x5b729a
xor eax, eax
cmp ecx, dword [esi + 0x2c]
sete al
test al, al
je 0x5b72ef
mov eax, dword [esi + 8]
cmp eax, ebx
jne 0x5b72ae
mov eax, dword [esp + 0x44]
mov dword [esi + 0x20], eax
jmp 0x5b72c1
mov ecx, dword [esp + 0x44]
cmp eax, ecx
jne 0x5b72bb
mov dword [esi + 0x20], ebx
jmp 0x5b72c1
mov dword [esi + 0x18], ebx
mov dword [esi + 0x1c], ecx
mov eax, dword [esi + 0x2c]
push eax
call fcn.005b45f0
add esp, 4
test eax, eax
je 0x5b72ef
movzx ecx, word [eax + 0x20]
mov edx, dword [esi + 0x24]
mov word [esi + 0x28], cx
movzx ecx, word [eax + 0x20]
mov word [edx + 0x1c], cx
cmp dword [esi + 8], ebx
jne 0x5b72ef
mov dword [eax + 0x19c], ebx
cmp dword [esp + 0x74], 0
jne 0x5b7260
mov edx, dword [edi]
push 1
mov ecx, edi
call dword [edx]
mov eax, dword [esp + 0x1c]
test eax, eax
mov byte [esp + 0x1c4], 8
mov dword [esp + 0x18], vtable.CBArray_class_CBStr_.0
je 0x5b7337
mov ecx, dword [eax - 4]
lea esi, [eax - 4]
push fcn.00412de0
push ecx
push 8
push eax
call fcn.0071f0d2
push esi
call fcn.0040fa80
add esp, 4
lea ecx, [esp + 0x48]
mov byte [esp + 0x1c4], 5
call fcn.00412de0
lea ecx, [esp + 0xb0]
mov byte [esp + 0x1c4], 4
call fcn.004049f0
lea ecx, [esp + 0x5c]
mov byte [esp + 0x1c4], 2
call fcn.00412de0
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1c4], 1
call fcn.00412de0
mov ebx, dword [esp + 0x8c]
mov edi, dword [esp + 0x30]
jmp 0x5b73d2
lea ecx, [esp + 0x48]
mov byte [esp + 0x1c4], 5
call fcn.00412de0
lea ecx, [esp + 0xb0]
mov byte [esp + 0x1c4], 4
call fcn.004049f0
lea ecx, [esp + 0x5c]
mov byte [esp + 0x1c4], 2
call fcn.00412de0
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1c4], 1
call fcn.00412de0
push ebx
lea ecx, [esp + 0xfc]
call fcn.00403110
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x8c], ebx
jne 0x5b6a70
mov edx, dword [edi + 8]
lea ecx, [edi + 8]
push 0
push 0x5b45d0
mov dword [edi + 0x1c], 0x2710
call dword [edx + 0x58]
lea ecx, [esp + 0xf8]
mov byte [esp + 0x1c4], 0
call fcn.004049f0
lea ecx, [esp + 0x140]
mov dword [esp + 0x1c4], 0xffffffff
call fcn.00616d60
mov ecx, dword [esp + 0x1bc]
pop edi
pop esi
mov eax, 1
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 4