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

Disassembly:
sub esp, 0x24
mov ecx, dword [esp + 0x34]
push ebx
mov ebx, dword [esp + 0x34]
push ebp
push esi
mov esi, dword [str.public]
mov dword [esp + 0x14], eax
lea ebp, [ebx + ecx - 1]
mov ecx, dword [esi + 0x13b]
xor edx, edx
mov eax, ebx
div ecx
push edi
xor edx, edx
mov dword [esp + 0x28], ebp
mov dword [esp + 0x14], 0
mov byte [esp + 0x13], 1
mov edi, eax
mov eax, ebp
div ecx
mov dword [esp + 0x30], edi
mov ebp, edi
mov dword [esp + 0x2c], eax
cmp edi, eax
jbe 0x501fde
mov eax, dword [esp + 0x48]
test eax, eax
je 0x501fae
mov cl, byte [esp + 0x13]
mov byte [eax], cl
mov eax, dword [esp + 0x14]
test eax, eax
je 0x501fc0
push eax
call dword [sym.imp.MSVCR90.dll_free]
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
mov esi, dword [str.public]
mov edi, dword [esp + 0x30]
mov ebx, dword [esp + 0x40]
cmp byte [esp + 0x13], 0
je 0x501fa0
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x502025
mov eax, dword [esi + 0x13b]
mov edx, eax
imul edx, ebp
cmp ebx, edx
ja 0x50201d
lea edx, [ebp + 1]
imul edx, eax
dec edx
cmp dword [esp + 0x28], edx
jb 0x50201d
mov ebx, dword [esp + 0x1c]
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], eax
mov edi, ecx
jmp 0x502096
mov dword [esp + 0x24], 1
cmp dword [esp + 0x14], 0
jne 0x50204e
mov eax, dword [esi + 0x13b]
push eax
call dword [sym.imp.MSVCR90.dll_malloc]
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
je 0x502304
mov esi, dword [str.public]
cmp ebp, edi
jne 0x502064
mov eax, ebx
xor edx, edx
div dword [esi + 0x13b]
mov ebx, edx
mov dword [esp + 0x1c], ebx
jmp 0x502070
mov dword [esp + 0x1c], 0
mov ebx, dword [esp + 0x1c]
cmp ebp, dword [esp + 0x2c]
jne 0x502084
mov eax, dword [esp + 0x28]
xor edx, edx
div dword [esi + 0x13b]
jmp 0x50208b
mov edx, dword [esi + 0x13b]
dec edx
mov edi, dword [esp + 0x14]
sub edx, ebx
inc edx
mov dword [esp + 0x20], edx
cmp byte [esp + 0x3c], 0
je 0x5020b2
call fcn.00501ea0
mov esi, eax
test esi, esi
jne 0x502329
mov esi, dword [str.public]
cmp dword [0x62c600], 0xffffffff
jne 0x5020e2
mov ecx, dword [0x62c623]
mov ebx, dword [ecx + 4]
mov eax, 2
call fcn.00501340
mov esi, eax
test esi, esi
jne 0x502329
mov ebx, dword [esp + 0x1c]
mov esi, dword [str.public]
cmp dword [esp + 0x38], 1
jne 0x502224
cmp dword [esp + 0x24], 0
je 0x50219f
mov edx, dword [esi + 0x13b]
mov esi, dword [esp + 0x14]
push edx
push 0
push esi
call sub.MSVCR90.dll_memset
mov eax, dword [0x6236d0]
add esp, 0xc
cmp dword [eax + 0x10], 0
je 0x502120
call fcn.0056c730
jmp 0x502122
xor eax, eax
mov ecx, dword [0x6236d0]
push esi
push 1
mov dword [ecx + 0xc], eax
mov edx, dword [0x62c600]
push ebp
push edx
call fcn.004a25a0
add esp, 0x10
cmp eax, 0xffffffff
je 0x502399
mov eax, dword [0x6236d0]
inc dword [eax + 0x6c]
mov ecx, dword [0x6236d0]
cmp dword [ecx + 0x10], 0
je 0x502173
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x502173
push eax
call fcn.0056c770
mov ecx, dword [0x6236d0]
add esp, 4
jmp 0x502175
xor eax, eax
add dword [ecx + 0x78], eax
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov eax, dword [0x6236d0]
inc dword [0x6b25d8]
push ecx
push edx
add ebx, esi
push ebx
mov dword [eax + 0xc], 0
call sub.MSVCR90.dll_memcpy
add esp, 0xc
mov eax, dword [0x6236d0]
cmp dword [eax + 0x10], 0
je 0x5021b1
call fcn.0056c730
jmp 0x5021b3
xor eax, eax
mov ecx, dword [0x6236d0]
push edi
push 1
mov dword [ecx + 0xc], eax
mov edx, dword [0x62c600]
push ebp
push edx
call fcn.004a26e0
mov ecx, dword [str.public]
add esp, 0x10
cmp eax, dword [ecx + 0x13b]
jne 0x502350
mov eax, dword [0x6236d0]
inc dword [eax + 0x70]
mov ecx, dword [0x6236d0]
cmp dword [ecx + 0x10], 0
je 0x50220d
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x50220d
push eax
call fcn.0056c770
mov ecx, dword [0x6236d0]
add esp, 4
jmp 0x50220f
xor eax, eax
add dword [ecx + 0x7c], eax
mov edx, dword [0x6236d0]
mov dword [edx + 0xc], 0
jmp 0x5022ec
mov eax, dword [0x6236d0]
cmp dword [eax + 0x10], 0
je 0x502236
call fcn.0056c730
jmp 0x502238
xor eax, eax
mov ecx, dword [0x6236d0]
push edi
push 1
mov dword [ecx + 0xc], eax
mov edx, dword [0x62c600]
push ebp
push edx
call fcn.004a25a0
mov esi, eax
add esp, 0x10
cmp esi, 0xffffffff
je 0x502399
mov eax, dword [0x6236d0]
mov ecx, 1
add dword [0x6b25d8], ecx
add dword [eax + 0x6c], ecx
mov ecx, dword [0x6236d0]
cmp dword [ecx + 0x10], 0
je 0x502296
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x502296
push eax
call fcn.0056c770
mov ecx, dword [0x6236d0]
add esp, 4
jmp 0x502298
xor eax, eax
add dword [ecx + 0x78], eax
cmp dword [esp + 0x24], 0
mov eax, dword [0x6236d0]
mov dword [eax + 0xc], 0
je 0x5022d9
mov ecx, dword [esp + 0x20]
lea edx, [ecx + ebx]
cmp esi, edx
jae 0x5022be
mov byte [esp + 0x13], 0
mov eax, dword [esp + 0x18]
test eax, eax
je 0x5022ec
push ecx
mov ecx, dword [esp + 0x18]
add ebx, ecx
push ebx
push eax
call sub.MSVCR90.dll_memcpy
add esp, 0xc
jmp 0x5022ec
mov edx, dword [str.public]
cmp esi, dword [edx + 0x13b]
jge 0x5022ec
mov byte [esp + 0x13], 0
mov eax, dword [esp + 0x20]
add dword [esp + 0x18], eax
inc ebp
cmp ebp, dword [esp + 0x2c]
jbe 0x501fd0
jmp 0x501fa0
call dword [sym.imp.MSVCR90.dll__errno]
mov ecx, dword [eax]
push ecx
push 0x6b24d0
push 0x3396
push 6
call fcn.00406f10
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
call dword [sym.imp.MSVCR90.dll__errno]
mov edx, dword [eax]
push edx
push 0x6b24d0
push 0x3396
push 0
call fcn.00406f10
add esp, 0x10
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
call dword [sym.imp.MSVCR90.dll__errno]
mov eax, dword [eax]
mov edx, dword [str.public]
mov ecx, dword [esp + 0x44]
push eax
mov eax, dword [edx + 0x13b]
imul eax, ebp
push ecx
push eax
push 0x6b24d0
push 0x3396
push 0xe29
call fcn.00406f10
push 1
call fcn.0044ca00
add esp, 0x1c
pop edi
pop esi
pop ebp
mov eax, 0xe29
pop ebx
add esp, 0x24
ret
call dword [sym.imp.MSVCR90.dll__errno]
mov ecx, dword [eax]
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x40]
push ecx
push edx
push eax
push 0x6b24d0
push 0x3396
push 0xe28
call fcn.00406f10
add esp, 0x18
pop edi
pop esi
pop ebp
mov eax, 0xe28
pop ebx
add esp, 0x24
ret