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

Disassembly:
sub esp, 0x90
mov eax, dword [0x59a024]
xor eax, esp
mov dword [esp + 0x8c], eax
mov eax, dword [esp + 0x94]
push ebx
mov ebx, dword [esp + 0x9c]
push ebp
mov ebp, dword [esp + 0xa4]
push esi
push edi
xor edi, edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x34], ebx
mov dword [esp + 0x24], ebp
mov dword [esp + 0x30], ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x18], edi
cmp ebx, edi
je 0x505a94
cmp byte [ebx], 0
je 0x505a94
xor esi, esi
jmp 0x505a99
mov esi, 1
mov dword [esp + 0x14], esi
cmp ebx, edi
je 0x505ad1
mov ecx, str.:memory:
mov eax, ebx
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x505ac8
test dl, dl
je 0x505ac4
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x505ac8
add eax, 2
add ecx, 2
test dl, dl
jne 0x505aa8
xor eax, eax
jmp 0x505acd
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, edi
je 0x505aea
cmp esi, edi
je 0x505adb
cmp byte [ebp + 0x40], 2
je 0x505aea
mov eax, dword [esp + 0xb4]
test al, al
js 0x505af1
xor ebp, ebp
jmp 0x505afe
mov eax, dword [esp + 0xb4]
or dword [esp + 0xb0], 2
mov ebp, 1
mov dword [esp + 0x2c], ebp
test eax, 0x100
je 0x505b22
cmp ebp, edi
jne 0x505b11
cmp esi, edi
je 0x505b22
and eax, 0xfffffeff
or eax, 0x200
mov dword [esp + 0xb4], eax
cmp dword [0x59bf10], edi
je 0x505bc7
mov eax, dword [0x5a2d00]
cmp eax, edi
je 0x505b41
push eax
call dword [0x59bf64]
add esp, 4
lea edx, [esp + 0x10]
push edx
mov eax, 0x30
call fcn.004cb470
mov eax, dword [0x5a2d00]
add esp, 4
cmp eax, edi
je 0x505b66
push eax
call dword [0x59bf6c]
add esp, 4
mov esi, dword [esp + 0x10]
cmp esi, edi
je 0x505c27
push 0x30
push edi
push esi
call fcn.00412eb0
mov eax, dword [esp + 0x30]
add esp, 0xc
mov byte [esi + 8], 0
mov dword [esi], eax
mov dword [esi + 0x20], esi
mov dword [esi + 0x24], 1
cmp dword [esp + 0x14], edi
jne 0x505d9c
test ebp, ebp
je 0x505bae
test byte [esp + 0xb4], 0x40
je 0x505d9c
test dword [esp + 0xb4], 0x20000
je 0x505d9c
test ebx, ebx
jne 0x505bda
xor eax, eax
jmp 0x505bee
push 0x30
call dword [0x59bf34]
mov esi, eax
add esp, 4
mov dword [esp + 0x10], esi
jmp 0x505b6a
mov eax, ebx
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x505be0
sub eax, edx
and eax, 0x3fffffff
mov ecx, dword [esp + 0x28]
mov esi, dword [ecx + 8]
lea edi, [eax + 1]
inc esi
cmp esi, edi
mov eax, esi
jg 0x505c01
mov eax, edi
cdq
push edx
push eax
call fcn.004cb540
mov edx, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x20], eax
mov byte [edx + 9], 1
test eax, eax
jne 0x505c31
mov eax, edx
push eax
call fcn.004bf5d0
add esp, 4
mov eax, 7
jmp 0x506172
test ebp, ebp
je 0x505c59
mov ecx, dword [esp + 0x20]
push edi
push ebx
push ecx
call fcn.0040dc50
mov edi, dword [esp + 0x34]
mov ebp, dword [esp + 0x2c]
add esp, 0xc
cmp dword [0x59bf14], 0
jne 0x505c95
xor eax, eax
jmp 0x505ca0
mov ebp, dword [esp + 0x20]
mov edi, dword [esp + 0x28]
push ebp
push esi
mov byte [ebp], 0
mov edx, dword [edi + 0x24]
push ebx
push edi
call edx
mov esi, eax
add esp, 0x10
mov dword [esp + 0x18], esi
test esi, esi
je 0x505c4c
push ebp
call fcn.004bf5d0
mov eax, dword [esp + 0x14]
push eax
call fcn.004bf5d0
add esp, 8
mov eax, esi
jmp 0x506172
push 4
call dword [0x59bf5c]
add esp, 4
push eax
mov dword [esp + 0x24], eax
call fcn.004bf450
add esp, 4
cmp dword [0x59bf14], 0
jne 0x505cbe
xor esi, esi
mov dword [esp + 0x14], esi
jmp 0x505ccf
push 2
call dword [0x59bf5c]
add esp, 4
mov esi, eax
mov dword [esp + 0x14], eax
push esi
call fcn.004bf450
mov eax, dword [0x5a2d24]
add esp, 4
mov ebx, eax
test eax, eax
je 0x505d79
jmp 0x505cf0
mov esi, dword [ebx]
mov ecx, dword [esi + 0xa8]
mov eax, ebp
lea ebx, [ebx]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x505d20
test dl, dl
je 0x505d1c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x505d20
add eax, 2
add ecx, 2
test dl, dl
jne 0x505d00
xor eax, eax
jmp 0x505d25
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x505d2d
cmp dword [esi], edi
je 0x505d3c
mov eax, dword [ebx + 0x44]
mov dword [esp + 0x1c], eax
mov ebx, eax
test eax, eax
jne 0x505cf0
jmp 0x505d75
mov ecx, dword [esp + 0x24]
mov eax, dword [ecx + 0x14]
sub eax, 1
js 0x505d6b
mov ecx, dword [ecx + 0x10]
mov edx, eax
shl edx, 4
lea ecx, [ecx + edx + 4]
mov edx, dword [ecx]
test edx, edx
je 0x505d63
cmp dword [edx + 4], ebx
je 0x505e40
dec eax
sub ecx, 0x10
test eax, eax
jge 0x505d54
mov eax, dword [esp + 0x10]
mov dword [eax + 4], ebx
inc dword [ebx + 0x40]
mov esi, dword [esp + 0x14]
test esi, esi
je 0x505d87
push esi
call dword [0x59bf6c]
add esp, 4
push ebp
call fcn.004bf5d0
add esp, 4
test ebx, ebx
jne 0x506020
mov ebx, dword [esp + 0x34]
cmp dword [0x59bf10], 0
je 0x505e81
mov eax, dword [0x5a2d00]
test eax, eax
je 0x505dbc
push eax
call dword [0x59bf64]
add esp, 4
lea ecx, [esp + 0x14]
push ecx
mov eax, 0x54
call fcn.004cb470
mov eax, dword [0x5a2d00]
add esp, 4
test eax, eax
je 0x505de1
push eax
call dword [0x59bf6c]
add esp, 4
mov ebp, dword [esp + 0x14]
test ebp, ebp
je 0x505df6
push 0x54
push 0
push ebp
call fcn.00412eb0
add esp, 0xc
mov dword [esp + 0x1c], ebp
test ebp, ebp
jne 0x505e93
mov dword [esp + 0x18], 7
mov ebx, dword [esp + 0x1c]
test ebx, ebx
je 0x505e21
mov eax, dword [ebx]
test eax, eax
je 0x505e21
push eax
call fcn.005055d0
add esp, 4
push ebx
call fcn.004bf5d0
mov eax, dword [esp + 0x14]
push eax
call fcn.004bf5d0
mov ecx, dword [esp + 0x38]
mov dword [ecx], 0
jmp 0x506159
mov eax, dword [esp + 0x14]
test eax, eax
je 0x505e52
push eax
call dword [0x59bf6c]
add esp, 4
mov eax, dword [esp + 0x20]
test eax, eax
je 0x505e64
push eax
call dword [0x59bf6c]
add esp, 4
push ebp
call fcn.004bf5d0
mov edx, dword [esp + 0x14]
push edx
call fcn.004bf5d0
add esp, 8
mov eax, 0x13
jmp 0x506172
push 0x54
call dword [0x59bf34]
add esp, 4
mov ebp, eax
jmp 0x505de5
mov edx, dword [esp + 0xb4]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0xb0]
push 0x4edee0
push edx
push 0x58
push ebx
push ebp
push eax
call fcn.00503610
add esp, 0x18
mov dword [esp + 0x18], eax
test eax, eax
jne 0x505e0a
mov ebx, dword [esp + 0x24]
mov eax, dword [ebp]
mov ecx, dword [ebx + 0x28]
mov dword [eax + 0x80], ecx
mov edx, dword [ebx + 0x2c]
mov dword [eax + 0x84], edx
call fcn.004c2c10
mov eax, dword [ebp]
push eax
lea esi, [esp + 0x3c]
mov edi, 0x64
call fcn.004c2d00
xor esi, esi
add esp, 4
mov dword [esp + 0x18], eax
cmp eax, esi
jne 0x505e0a
mov eax, dword [ebp]
mov cl, byte [esp + 0xb0]
mov byte [ebp + 0x10], cl
mov dword [ebp + 4], ebx
lea ecx, [eax + 0xb0]
mov dword [eax + 0xb4], ebp
mov eax, dword [eax + 0x3c]
mov dword [ecx], 0x4cecb0
cmp dword [eax], esi
je 0x505f3c
mov edx, dword [eax]
push ecx
push 0xf
push eax
mov eax, dword [edx + 0x28]
call eax
add esp, 0xc
mov ecx, dword [esp + 0x10]
mov dword [ecx + 4], ebp
mov edi, dword [ebp]
mov dword [ebp + 8], esi
mov dword [ebp + 0xc], esi
cmp byte [edi + 0xe], 0
je 0x505f57
or word [ebp + 0x16], 1
movzx eax, byte [esp + 0x49]
movzx edx, byte [esp + 0x48]
shl eax, 8
or eax, edx
shl eax, 8
lea ebx, [ebp + 0x20]
mov dword [ebx], eax
cmp eax, 0x200
jb 0x505faa
cmp eax, 0x10000
ja 0x505faa
lea ecx, [eax - 1]
test eax, ecx
jne 0x505faa
mov al, byte [esp + 0x4c]
or word [ebp + 0x16], 2
mov edx, dword [esp + 0x6c]
bswap edx
test edx, edx
setne cl
mov byte [ebp + 0x11], cl
mov edx, dword [esp + 0x78]
bswap edx
test edx, edx
setne cl
mov byte [ebp + 0x12], cl
jmp 0x505fc2
mov dword [ebx], esi
cmp dword [esp + 0x34], esi
je 0x505fc0
cmp dword [esp + 0x2c], esi
jne 0x505fc0
mov byte [ebp + 0x11], 0
mov byte [ebp + 0x12], 0
xor al, al
movzx esi, al
push esi
push ebx
call fcn.004cdd40
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x505e0a
mov edx, dword [ebx]
mov eax, dword [esp + 0x10]
sub edx, esi
mov dword [ebp + 0x24], edx
cmp byte [eax + 9], 0
je 0x50601c
mov dword [ebp + 0x40], 1
cmp dword [0x59bf14], 0
jne 0x50605d
xor esi, esi
push esi
call fcn.004bf450
mov edx, dword [0x5a2d24]
push esi
mov dword [ebp + 0x44], edx
mov dword [0x5a2d24], ebp
call fcn.004bf490
add esp, 8
mov ebx, dword [esp + 0x1c]
mov edi, dword [esp + 0x10]
cmp byte [edi + 9], 0
je 0x5060f3
mov esi, dword [esp + 0x24]
xor edx, edx
cmp dword [esi + 0x14], edx
jle 0x5060f3
mov ecx, dword [esi + 0x10]
add ecx, 4
mov eax, dword [ecx]
test eax, eax
je 0x50604f
cmp byte [eax + 9], 0
jne 0x50609d
inc edx
add ecx, 0x10
cmp edx, dword [esi + 0x14]
jl 0x506043
jmp 0x5060f3
push 2
call dword [0x59bf5c]
add esp, 4
cmp dword [0x59bf14], 0
mov esi, eax
je 0x505ffe
push 0
call dword [0x59bf5c]
add esp, 4
mov dword [ebp + 0x38], eax
test eax, eax
jne 0x505ffe
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x18], 7
mov byte [ecx + 0x41], al
jmp 0x505e0a
cmp dword [eax + 0x1c], 0
je 0x5060ac
mov eax, dword [eax + 0x1c]
cmp dword [eax + 0x1c], 0
jne 0x5060a3
mov edx, dword [edi + 4]
cmp edx, dword [eax + 4]
jae 0x5060c3
mov dword [edi + 0x18], eax
mov dword [edi + 0x1c], 0
mov dword [eax + 0x1c], edi
jmp 0x5060f3
cmp dword [eax + 0x18], 0
je 0x5060e0
lea esp, [esp]
mov ecx, dword [eax + 0x18]
cmp dword [ecx + 4], edx
jae 0x5060e0
mov eax, ecx
cmp dword [eax + 0x18], 0
jne 0x5060d0
mov ecx, dword [eax + 0x18]
mov dword [edi + 0x18], ecx
mov dword [edi + 0x1c], eax
test ecx, ecx
je 0x5060f0
mov dword [ecx + 0x1c], edi
mov dword [eax + 0x18], edi
cmp dword [esp + 0x18], 0
mov edx, dword [esp + 0x30]
mov dword [edx], edi
jne 0x505e0e
mov esi, dword [esp + 0x10]
cmp byte [esi + 9], 0
mov ebx, dword [esi + 4]
je 0x506132
inc dword [esi + 0xc]
cmp byte [esi + 0xa], 0
jne 0x506121
mov edi, esi
call fcn.004c3920
cmp byte [esi + 9], 0
je 0x506132
add dword [esi + 0xc], 0xffffffff
jne 0x506132
call fcn.004c3900
cmp dword [ebx + 0x30], 0
jne 0x50615c
mov edx, dword [esi + 4]
mov eax, dword [edx]
mov eax, dword [eax + 0xcc]
mov ecx, dword [eax + 0x2c]
push 0x7d0
push ecx
mov dword [eax + 0x10], 0x7d0
call dword [0x59bf8c]
add esp, 8
mov eax, dword [esp + 0x20]
test eax, eax
je 0x50616e
push eax
call dword [0x59bf6c]
add esp, 4
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x9c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00409b58
add esp, 0x90
ret