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

Disassembly:
sub esp, 0x10
cmp byte [edi + 0x42], 4
push ebp
mov ebp, dword [edi]
mov eax, dword [ebp + 4]
push esi
mov esi, dword [esp + 0x38]
mov dword [esp + 0xc], esi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
jne 0x511e4d
mov eax, dword [edi + 0x3c]
pop esi
pop ebp
add esp, 0x10
ret
test byte [edi + 0x40], 0x20
je 0x511e69
mov ecx, dword [edi + 0x34]
push eax
mov edx, edi
call fcn.005114b0
add esp, 4
test eax, eax
jne 0x512038
cmp dword [edi + 0x48], 0
push ebx
mov ebx, dword [esp + 0x28]
jne 0x511ee7
mov eax, dword [esp + 0x24]
push ebx
push eax
xor esi, esi
mov ecx, ebp
call fcn.004c3b10
add esp, 8
test byte [edi + 0x40], 2
je 0x511ebb
test ebx, ebx
jl 0x511ebb
jg 0x511e98
cmp dword [esp + 0x24], esi
jbe 0x511ebb
mov eax, dword [esp + 0x24]
mov edx, dword [edi + 0x10]
sub eax, 1
mov ecx, ebx
sbb ecx, esi
cmp edx, eax
jne 0x511ebb
mov eax, dword [edi + 0x14]
cmp eax, ecx
jne 0x511ebb
mov dword [esp + 0x10], 0xffffffff
jmp 0x511f12
cmp dword [esp + 0x3c], esi
jne 0x511f12
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x10]
push ecx
push edx
push ebx
push eax
push 0
push edi
call fcn.0050b010
add esp, 0x18
test eax, eax
je 0x511f12
pop ebx
pop esi
pop ebp
add esp, 0x10
ret
test esi, esi
jne 0x511f12
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [esp + 0x24]
push edx
push ebx
push eax
push ecx
mov esi, edi
call fcn.005114f0
add esp, 0x14
test eax, eax
jne 0x512037
movsx edx, byte [edi + 0x44]
mov ebp, dword [edi + edx*4 + 0x78]
mov eax, dword [esp + 0x14]
mov esi, dword [eax + 0x50]
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x30]
push edx
mov edx, dword [esp + 0x2c]
push eax
mov eax, dword [esp + 0x2c]
push ecx
push ebx
push edx
push eax
push esi
mov eax, ebp
mov dword [esp + 0x34], esi
call fcn.00507900
add esp, 0x20
mov dword [esp + 0xc], eax
test eax, eax
jne 0x512037
movsx ecx, byte [edi + 0x44]
movzx ebx, word [edi + ecx*2 + 0x50]
lea eax, [edi + ecx*2 + 0x50]
mov ecx, dword [esp + 0x10]
test ecx, ecx
jne 0x511fd9
mov esi, dword [ebp + 0x48]
call fcn.005004f0
test eax, eax
jne 0x512037
mov edx, dword [ebp + 0x40]
mov ax, word [edx + ebx*2]
movzx edx, word [ebp + 0x14]
mov ch, al
mov cl, ah
movzx eax, cx
and eax, edx
add eax, dword [ebp + 0x38]
cmp byte [ebp + 5], 0
jne 0x511fa5
mov ecx, dword [eax]
mov edx, dword [esp + 0x14]
mov dword [edx], ecx
lea ecx, [esp + 0x3c]
push ecx
mov ecx, ebp
call fcn.00507770
mov dword [esp + 0x10], eax
movzx eax, word [esp + 0x40]
lea edx, [esp + 0x10]
push edx
push eax
push ebx
mov esi, ebp
call fcn.004ee0e0
mov eax, dword [esp + 0x1c]
add esp, 0x10
test eax, eax
jne 0x512037
mov esi, dword [esp + 0x14]
jmp 0x511fee
jge 0x511fee
cmp word [ebp + 0x12], 0
jbe 0x511fee
inc word [eax]
movsx ecx, byte [edi + 0x44]
movzx ebx, word [edi + ecx*2 + 0x50]
mov eax, dword [esp + 0x18]
lea edx, [esp + 0xc]
push edx
push 0
push eax
push esi
push ebx
push ebp
xor eax, eax
call fcn.00501320
mov eax, dword [esp + 0x24]
xor ecx, ecx
add esp, 0x18
mov word [edi + 0x22], cx
test eax, eax
jne 0x512037
cmp byte [ebp + 1], al
je 0x512037
and byte [edi + 0x40], 0xfd
push edi
call fcn.0050c920
movsx edx, byte [edi + 0x44]
mov ecx, dword [edi + edx*4 + 0x78]
mov byte [ecx + 1], 0
add esp, 4
mov byte [edi + 0x42], 0
pop ebx
pop esi
pop ebp
add esp, 0x10
ret