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

Disassembly:
sub esp, 0x60
mov eax, dword [0x572844]
xor eax, esp
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x64]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x78]
mov esi, ecx
imul edi, dword [esp + 0x7c]
xor ebp, ebp
mov ecx, dword [esp + 0x80]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ebp
lea ebx, [esi + 0x64b820]
mov dword [esp + 0x14], ebx
mov edx, edi
cmp ecx, 1
jne 0x5105c9
lea eax, [esi + 0x6486b8]
mov dword [esi + 0x64b838], ebp
push eax
lea ecx, [esi + 0x64a728]
mov dword [esi + 0x64b83c], ebp
call fcn.004816c0
mov eax, dword [esi + 0x64b7dc]
mov edx, edi
mov ecx, dword [ebx + 4]
mov dword [esi + 0x64b7d8], eax
mov eax, dword [ebx]
mov dword [esi + 0x64b81c], ecx
mov ecx, dword [esp + 0x80]
mov dword [esi + 0x64b818], eax
jmp 0x5105cd
mov dword [esp + 0x14], ebx
mov eax, dword [esi + 0x64b830]
or eax, dword [esi + 0x64b834]
mov dword [esp + 0x10], ebp
je 0x510616
mov eax, dword [esi + 0x64b830]
sub eax, dword [ebx]
mov ebp, dword [esi + 0x64b834]
sbb ebp, dword [ebx + 4]
cmp dword [esp + 0x10], ebp
mov ebp, 0
jb 0x510616
ja 0x510601
cmp edi, eax
jbe 0x510616
cmp ecx, 3
je 0x510614
cmp ecx, 1
je 0x510614
cmp ecx, 2
je 0x510614
mov edx, eax
jmp 0x51065d
xor edx, edx
cmp ecx, 2
jne 0x51065d
cmp dword [esi + 0x64b7e0], 0xffffffff
jne 0x510641
mov eax, dword [esi + 0x64b7dc]
mov ecx, dword [ebx + 4]
mov dword [esi + 0x64b7e0], eax
mov eax, dword [ebx]
mov dword [esi + 0x64b7e8], eax
mov dword [esi + 0x64b7ec], ecx
add dword [esi + 0x64b7f0], 1
adc dword [esi + 0x64b7f4], 0
add dword [esi + 0x64b7f8], 1
adc dword [esi + 0x64b7fc], 0
test edx, edx
je 0x51069b
mov ebp, edx
lea ecx, [esi + 0x6486b8]
imul ebp, dword [esp + 0x78]
push ebp
push dword [esp + 0x20]
mov dword [esp + 0x20], ebp
call fcn.004827f0
add dword [ebx], ebp
adc dword [ebx + 4], 0
cmp dword [esp + 0x80], 0
jne 0x510699
add dword [esi + 0x64b838], ebp
adc dword [esi + 0x64b83c], 0
sub edi, ebp
mov dword [esp + 0x10], edi
test edi, edi
je 0x5109e9
mov ecx, dword [esi + 0x64b828]
test ecx, ecx
je 0x5109e9
mov eax, dword [esi + 0x64b7dc]
cmp ecx, 1
jne 0x5106d6
cmp dword [esi + 0x64b7d8], eax
jne 0x5106d6
mov eax, dword [esi + 0x64b798]
mov dword [esi + 0x64b810], eax
jmp 0x51072a
mov ebp, dword [esi + 0x64b798]
mov ecx, esi
push eax
push dword [esi + 0x64b7bc]
call fcn.00510d20
mov ebx, eax
mov eax, dword [esi + 0x6486b8]
mov edi, dword [eax + 8]
mov ecx, edi
call dword [0x541740]
lea ecx, [esi + 0x6486b8]
call edi
push ebx
push ebp
mov ecx, esi
call fcn.005125b0
push dword [esi + 0x64b798]
call fcn.00525b95
mov ebx, dword [esp + 0x18]
add esp, 4
mov dword [esi + 0x64b798], 0
push dword [esi + 0x64b7dc]
mov ecx, esi
mov dword [esi + 0x64b7f0], 0
push dword [esi + 0x64b7bc]
mov dword [esi + 0x64b7f4], 0
mov dword [ebx], 0
mov dword [ebx + 4], 0
call fcn.00510d20
push 0
mov edi, eax
push edi
push 0
push 0
call fcn.004b3c40
xor eax, eax
mov dword [esp + 0x24], 0x54266c
lea ecx, [esp + 0x20]
mov dword [esp + 0x28], 0x54266c
mov dword [esp + 0x2c], 0x54266c
mov dword [esp + 0x30], 0x54266c
mov dword [esp + 0x34], 0x54266c
mov dword [esp + 0x38], 0x54266c
mov dword [esp + 0x3c], 0x54266c
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], 0x96
mov dword [esp + 0x20], edi
mov dword [esp + 0x60], 1
call fcn.004b2040
push edi
call fcn.00525b95
mov ecx, dword [esi + 0x64b7dc]
add esp, 4
cmp ecx, dword [0x58fc3c]
jae 0x51082b
mov eax, dword [0x58fc38]
mov edx, dword [eax + ecx*8]
mov eax, dword [eax + ecx*8 + 4]
test eax, eax
jl 0x510818
jg 0x51081f
cmp edx, 0x400
ja 0x51081f
mov edx, 0x400
xor eax, eax
mov dword [esi + 0x64b830], edx
mov dword [esi + 0x64b834], eax
inc ecx
cmp dword [esi + 0x64b828], 2
mov dword [esi + 0x64b7dc], ecx
jne 0x510850
push ecx
mov ecx, esi
call fcn.0050f790
test eax, eax
jne 0x510850
push 9
mov ecx, esi
call fcn.00512610
mov ecx, 0x588ad0
lea edx, [ecx + 2]
jmp 0x510860
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x510860
sub ecx, edx
sar ecx, 1
lea ebp, [ecx + 0x1e]
lea eax, [ebp*2]
push eax
call fcn.00525bb0
mov edi, eax
add esp, 4
test edi, edi
jne 0x510890
mov dword [esi + 0x64b798], eax
jmp 0x5108d4
mov ecx, 0x588ad0
mov edx, edi
sub edx, ecx
lea esp, [esp]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x5108a0
push ebp
push edi
call fcn.00493970
push ebp
push str.__rzi_
push edi
call fcn.004b0300
push ebp
push edi
call fcn.00483e40
mov dword [esi + 0x64b798], eax
test eax, eax
jne 0x5108dd
push 4
mov ecx, esi
call fcn.00512610
push 0x11
push dword [esi + 0x64b798]
lea ecx, [esi + 0x6486b8]
call fcn.00481a10
test al, al
jne 0x51090d
push dword [esi + 0x64b798]
mov ecx, 0x5b68fc
call fcn.0047ae20
push 0xa
mov ecx, esi
call fcn.00512610
mov eax, dword [esp + 0x1c]
lea ecx, [esi + 0x6486b8]
mov edi, dword [esp + 0x10]
mov ebp, dword [esp + 0x18]
add eax, ebp
push edi
push eax
call fcn.004827f0
mov eax, dword [esp + 0x80]
add ebp, edi
add dword [ebx], edi
adc dword [ebx + 4], 0
cmp eax, 3
je 0x510958
cmp eax, 1
je 0x510958
cmp eax, 2
je 0x510958
add dword [esi + 0x64b838], edi
adc dword [esi + 0x64b83c], 0
jmp 0x5109e9
cmp dword [esi + 0x64b828], 1
jne 0x5109ab
mov eax, dword [esi + 0x64a728]
lea ebx, [esi + 0x64a728]
mov edi, dword [eax + 0x18]
mov ecx, edi
call dword [0x541740]
mov ecx, ebx
call edi
test al, al
je 0x5109ab
mov eax, dword [esi + 0x64b7d8]
cmp eax, dword [esi + 0x64b7dc]
je 0x5109ab
push dword [esi + 0x64b810]
mov ecx, esi
push ebx
push eax
call fcn.00510b30
push dword [esi + 0x64b810]
call fcn.00525b95
add esp, 4
mov eax, dword [esi + 0x64b798]
lea ecx, [esi + 0x64a728]
mov dword [esi + 0x64b810], eax
lea eax, [esi + 0x6486b8]
push eax
call fcn.004816c0
mov eax, dword [esi + 0x64b7dc]
mov dword [esi + 0x64b818], 0
mov dword [esi + 0x64b81c], 0
mov dword [esi + 0x64b7d8], eax
mov ecx, dword [esp + 0x6c]
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0051dca8
add esp, 0x60
ret 0x10