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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x90
mov ebx, ecx
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov edx, dword [eax + 0x28]
mov esi, dword [eax + 0x2c]
mov ecx, edx
or edx, esi
mov edx, esi
bswap edx
bswap ecx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x48], edx
je 0x500a5e
movzx esi, word [eax + 0x3a]
cmp esi, 0x4000
jne 0x500a7f
mov dword [esp + 0x10], ebx
mov ebx, edx
add ebx, 0x40
mov esi, ecx
adc esi, 0
mov edi, 0xffffffbf
cmp edi, edx
mov edi, 0xffffffff
sbb edi, ecx
jb 0x500ada
mov edi, dword [ebp + 8]
mov edi, dword [edi + 4]
mov dword [esp + 0x54], edi
cmp edi, ebx
mov ebx, 0
sbb ebx, esi
jb 0x500ada
movzx esi, word [eax + 0x3c]
add eax, edx
mov ebx, esi
rol bx, 8
movzx ebx, bx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], 0
test si, si
mov edi, 0
jne 0x500b31
mov edi, dword [eax + 0x20]
mov ebx, dword [eax + 0x24]
bswap ebx
bswap edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x28], ebx
test edi, 0xfc000000
je 0x500b31
mov dword [esp + 0x34], str.invalid_number_of_sections_specified_in_the_NULL_sections_sh_size_field__
lea eax, [esp + 0x28]
mov dword [esp + 0x3c], eax
mov word [esp + 0x44], 0xd03
lea eax, [esp + 0x34]
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], 0x5514e0
mov word [esp + 0x24], 0x302
mov dword [esp], 0x1c
call sub.libc.dll_operator_new_unsigned_int_
mov edi, eax
call fcn.0054a58e
mov dword [esp + 0x68], eax
mov dword [esp + 0x64], 3
movsd xmm0, qword [esp + 0x64]
jmp 0x500bcb
mov eax, dword [edi + 8]
mov ecx, dword [edi + 0xc]
cmp eax, ecx
je 0x500b1b
and byte [ebx + 8], 0xfe
sub ecx, eax
sar ecx, 6
mov dword [ebx], eax
mov dword [ebx + 4], ecx
jmp 0x500bec
rol si, 8
movzx eax, si
mov dword [esp + 0x14], str.invalid_e_shentsize_in_ELF_header:
mov dword [esp + 0x1c], eax
mov word [esp + 0x24], 0xa03
mov dword [esp], 0x1c
call sub.libc.dll_operator_new_unsigned_int_
mov edi, eax
call fcn.0054a58e
mov dword [esp + 0x38], eax
mov dword [esp + 0x34], 3
movsd xmm0, qword [esp + 0x34]
movsd qword [esp + 4], xmm0
lea eax, [esp + 0x14]
mov dword [esp], eax
mov ecx, edi
call fcn.0054a3a8
sub esp, 0xc
jmp 0x500be6
mov dword [esp + 0x14], str.section_header_table_goes_past_the_end_of_the_file:_e_shoff__0x
lea eax, [esp + 0x48]
mov dword [esp + 0x1c], eax
mov word [esp + 0x24], 0xf03
mov dword [esp], 0x1c
call sub.libc.dll_operator_new_unsigned_int_
mov edi, eax
call fcn.0054a58e
mov dword [esp + 0x38], eax
mov dword [esp + 0x34], 3
movsd xmm0, qword [esp + 0x34]
jmp 0x500bcb
and byte [ebx + 8], 0xfe
mov dword [ebx], 0
mov dword [ebx + 4], 0
jmp 0x500bec
shld edi, ebx, 6
mov esi, ebx
shl esi, 6
add esi, edx
adc edi, ecx
jae 0x500bf8
mov dword [esp + 0x78], str.invalid_section_header_table_offset__e_shoff__0x
lea eax, [esp + 0x48]
mov dword [esp + 0x80], eax
mov word [esp + 0x88], 0xf03
lea eax, [esp + 0x78]
mov dword [esp + 0x64], eax
mov dword [esp + 0x6c], str.__or_invalid_number_of_sections_specified_in_the_first_section_headers_sh_size_field__0x
mov word [esp + 0x74], 0x302
lea eax, [esp + 0x64]
mov dword [esp + 0x34], eax
lea eax, [esp + 0x28]
mov dword [esp + 0x3c], eax
mov word [esp + 0x44], 0xf02
lea eax, [esp + 0x34]
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], 0x5514e0
mov word [esp + 0x24], 0x302
mov dword [esp], 0x1c
call sub.libc.dll_operator_new_unsigned_int_
mov edi, eax
call fcn.0054a58e
mov dword [esp + 0x60], eax
mov dword [esp + 0x5c], 3
movsd xmm0, qword [esp + 0x5c]
movsd qword [esp + 4], xmm0
lea eax, [esp + 0x14]
mov dword [esp], eax
mov ecx, edi
call fcn.0054a3a8
sub esp, 0xc
mov ebx, dword [esp + 0x10]
or byte [ebx + 8], 1
mov dword [ebx], edi
mov eax, ebx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret 4
xor ecx, ecx
cmp dword [esp + 0x54], esi
sbb ecx, edi
jae 0x500c35
mov dword [esp + 0x14], str.section_table_goes_past_the_end_of_file
mov word [esp + 0x24], 0x103
lea eax, [esp + 0x14]
mov dword [esp + 4], eax
lea eax, [esp + 0x58]
mov dword [esp], eax
call fcn.0041ba30
mov ebx, dword [esp + 0x10]
or byte [ebx + 8], 1
mov eax, dword [esp + 0x58]
mov dword [ebx], eax
jmp 0x500bec
mov ecx, dword [esp + 0x10]
and byte [ecx + 8], 0xfe
mov dword [ecx], eax
mov dword [ecx + 4], ebx
mov ebx, ecx
jmp 0x500bec