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

Disassembly:
sub esp, 0x8c
mov eax, dword [0x5635bc]
xor eax, esp
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0xa4]
mov edx, dword [esp + 0xa0]
push ebx
mov ebx, dword [esp + 0xa0]
push ebp
mov ebp, dword [esp + 0x9c]
push esi
mov esi, dword [esp + 0xa4]
mov dword [esp + 0x18], eax
xor eax, eax
test esi, esi
mov dword [esp + 0x50], ebp
mov dword [esp + 0x38], ebx
mov dword [esp + 0x48], edx
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
jbe 0x505b76
movzx ecx, word [ebp + eax*2]
add word [esp + ecx*2 + 0x54], 1
lea ecx, [esp + ecx*2 + 0x54]
add eax, 1
cmp eax, esi
jb 0x505b60
mov eax, dword [edx]
mov dword [esp + 0x10], eax
mov ecx, 0xf
cmp word [esp + ecx*2 + 0x54], 0
jne 0x505b91
sub ecx, 1
cmp ecx, 1
jae 0x505b81
cmp eax, ecx
mov dword [esp + 0x1c], ecx
jbe 0x505b9f
mov dword [esp + 0x10], ecx
mov eax, ecx
test ecx, ecx
jne 0x505be4
mov word [esp + 0xe], cx
mov ecx, dword [ebx]
mov byte [esp + 0xc], 0x40
mov byte [esp + 0xd], 1
mov eax, dword [esp + 0xc]
mov dword [ecx], eax
add dword [ebx], 4
mov ecx, dword [ebx]
pop esi
mov dword [ecx], eax
add dword [ebx], 4
pop ebp
mov dword [edx], 1
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0046252a
add esp, 0x8c
ret
mov esi, 1
lea esp, [esp]
cmp word [esp + esi*2 + 0x54], 0
jne 0x505c34
cmp word [esp + esi*2 + 0x56], 0
jne 0x505c22
cmp word [esp + esi*2 + 0x58], 0
jne 0x505c27
cmp word [esp + esi*2 + 0x5a], 0
jne 0x505c2c
cmp word [esp + esi*2 + 0x5c], 0
jne 0x505c31
add esi, 5
cmp esi, 0xf
jbe 0x505bf0
jmp 0x505c34
add esi, 1
jmp 0x505c34
add esi, 2
jmp 0x505c34
add esi, 3
jmp 0x505c34
add esi, 4
cmp eax, esi
jae 0x505c3c
mov dword [esp + 0x10], esi
mov edx, 1
mov eax, edx
push edi
movzx edi, word [esp + eax*2 + 0x58]
add edx, edx
sub edx, edi
js 0x505c6b
add eax, 1
cmp eax, 0xf
jbe 0x505c44
test edx, edx
mov edi, dword [esp + 0xa0]
jle 0x505c73
test edi, edi
je 0x505c6b
cmp ecx, 1
je 0x505c73
or eax, 0xffffffff
jmp 0x505fc5
mov word [esp + 0x7a], 0
mov eax, 2
nop
mov cx, word [esp + eax + 0x78]
add cx, word [esp + eax + 0x58]
add eax, 2
cmp eax, 0x1e
mov word [esp + eax + 0x78], cx
jb 0x505c80
mov ecx, dword [esp + 0x1c]
xor eax, eax
cmp dword [esp + 0xa8], eax
jbe 0x505cd7
cmp word [ebp + eax*2], 0
je 0x505ccb
movzx edx, word [ebp + eax*2]
movzx edx, word [esp + edx*2 + 0x78]
mov word [ecx + edx*2], ax
movzx edx, word [ebp + eax*2]
add word [esp + edx*2 + 0x78], 1
lea edx, [esp + edx*2 + 0x78]
add eax, 1
cmp eax, dword [esp + 0xa8]
jb 0x505ca6
mov eax, edi
sub eax, 0
mov edx, 0xffffffff
je 0x505d24
sub eax, 1
je 0x505cfe
mov dword [esp + 0x2c], 0x538080
mov dword [esp + 0x38], 0x5380c0
mov dword [esp + 0x30], edx
jmp 0x505d34
mov eax, 0x538000
sub eax, 0x202
mov dword [esp + 0x2c], eax
mov eax, 0x538040
sub eax, 0x202
mov dword [esp + 0x38], eax
mov dword [esp + 0x30], 0x100
jmp 0x505d34
mov dword [esp + 0x38], ecx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], 0x13
mov eax, dword [ebx]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x24], eax
mov eax, 1
shl eax, cl
xor ebp, ebp
xor ebx, ebx
cmp edi, 1
lea ecx, [eax - 1]
mov dword [esp + 0x18], esi
mov dword [esp + 0x34], edx
mov dword [esp + 0x44], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x40], ecx
jne 0x505d70
cmp eax, 0x5b0
jae 0x505fc0
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x1c], edx
jmp 0x505d80
mov al, byte [esp + 0x18]
mov esi, dword [esp + 0x1c]
mov edx, dword [esp + 0x30]
sub al, bl
mov byte [esp + 0x11], al
movzx eax, word [esi]
movzx ecx, ax
cmp ecx, edx
jge 0x505da8
mov byte [esp + 0x10], 0
mov word [esp + 0x12], ax
jmp 0x505dd5
jle 0x505dc9
movzx eax, word [esi]
mov ecx, dword [esp + 0x38]
add eax, eax
mov dl, byte [eax + ecx]
mov ecx, dword [esp + 0x2c]
mov byte [esp + 0x10], dl
mov dx, word [eax + ecx]
mov word [esp + 0x12], dx
jmp 0x505dd5
mov byte [esp + 0x10], 0x60
mov word [esp + 0x12], 0
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x44]
sub ecx, ebx
mov edx, 1
shl edx, cl
mov ecx, ebx
mov edi, ebp
shr edi, cl
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x50], eax
lea esi, [edx*4]
add edi, eax
lea ecx, [ecx + edi*4]
mov edi, dword [esp + 0x10]
sub eax, edx
sub ecx, esi
test eax, eax
mov dword [ecx], edi
jne 0x505e04
mov edx, dword [esp + 0x18]
lea ecx, [edx - 1]
mov eax, 1
shl eax, cl
test ebp, eax
je 0x505e26
shr eax, 1
test ebp, eax
jne 0x505e20
test eax, eax
je 0x505e35
lea ecx, [eax - 1]
and ecx, ebp
add ecx, eax
mov ebp, ecx
jmp 0x505e37
xor ebp, ebp
add word [esp + edx*2 + 0x58], 0xffff
movzx eax, word [esp + edx*2 + 0x58]
add dword [esp + 0x1c], 2
test ax, ax
jne 0x505e6a
cmp edx, dword [esp + 0x20]
je 0x505f33
mov edx, dword [esp + 0x1c]
movzx eax, word [edx]
mov ecx, dword [esp + 0x54]
movzx edx, word [ecx + eax*2]
mov dword [esp + 0x18], edx
cmp edx, dword [esp + 0x14]
jbe 0x505d80
mov esi, dword [esp + 0x40]
and esi, ebp
cmp esi, dword [esp + 0x34]
mov dword [esp + 0x48], esi
je 0x505d80
test ebx, ebx
jne 0x505e90
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x50]
lea edx, [eax + ecx*4]
mov ecx, dword [esp + 0x18]
sub ecx, ebx
mov dword [esp + 0x24], edx
mov eax, 1
lea edx, [ebx + ecx]
shl eax, cl
cmp edx, dword [esp + 0x20]
jae 0x505ede
lea esi, [esp + edx*2 + 0x58]
lea esp, [esp]
movzx edi, word [esi]
sub eax, edi
test eax, eax
jle 0x505eda
add edx, 1
add ecx, 1
add esi, 2
add eax, eax
cmp edx, dword [esp + 0x20]
jb 0x505ec0
mov esi, dword [esp + 0x48]
mov eax, 1
shl eax, cl
add dword [esp + 0x28], eax
cmp dword [esp + 0xa0], 1
mov dword [esp + 0x44], eax
jne 0x505f05
cmp dword [esp + 0x28], 0x5b0
jae 0x505fc0
mov edx, esi
mov esi, dword [esp + 0x3c]
mov eax, dword [esi]
mov byte [eax + edx*4], cl
mov ecx, dword [esi]
mov al, byte [esp + 0x14]
mov byte [ecx + edx*4 + 1], al
mov eax, dword [esi]
mov ecx, dword [esp + 0x24]
sub ecx, eax
sar ecx, 2
mov dword [esp + 0x34], edx
mov word [eax + edx*4 + 2], cx
jmp 0x505d80
mov edi, dword [esp + 0x3c]
mov al, dl
sub al, bl
test ebp, ebp
mov byte [esp + 0x10], 0x40
mov byte [esp + 0x11], al
mov word [esp + 0x12], 0
je 0x505fa5
mov esi, dword [esp + 0x24]
test ebx, ebx
je 0x505f75
mov ecx, dword [esp + 0x40]
and ecx, ebp
cmp ecx, dword [esp + 0x34]
je 0x505f75
mov eax, dword [esp + 0x14]
mov esi, dword [edi]
xor ebx, ebx
mov dword [esp + 0x18], eax
mov byte [esp + 0x11], al
mov edx, eax
mov ecx, ebx
mov eax, ebp
shr eax, cl
mov ecx, dword [esp + 0x10]
mov dword [esi + eax*4], ecx
lea ecx, [edx - 1]
mov eax, 1
shl eax, cl
test ebp, eax
je 0x505f96
shr eax, 1
test ebp, eax
jne 0x505f90
test eax, eax
je 0x505fa5
lea ecx, [eax - 1]
and ecx, ebp
add ecx, eax
mov ebp, ecx
jne 0x505f53
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x4c]
lea eax, [edx*4]
add dword [edi], eax
mov edx, dword [esp + 0x14]
mov dword [ecx], edx
xor eax, eax
jmp 0x505fc5
mov eax, 1
mov ecx, dword [esp + 0x98]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0046252a
add esp, 0x8c
ret