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

Disassembly:
push 0xffffffffffffffff
push 0x51a51c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x174
push ebx
mov ebx, dword [ecx + 0x10]
push esi
xor esi, esi
cmp ebx, esi
mov dword [esp + 8], ecx
je 0x499d69
mov eax, dword [ebx + 0x44]
push ebp
push edi
mov edi, dword [esp + 0x194]
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], edi
mov eax, dword [ebx + 0x40]
lea ecx, [esp + 0x70]
neg eax
sbb eax, eax
push esi
and eax, 0xfffff810
push ecx
add eax, 0x7f6
push eax
call fcn.0049c4a0
mov eax, dword [esp + 0x17c]
xor ecx, ecx
mov ebp, eax
mov dword [esp + 0x20], esi
mov dword [esp + 0x28], ebp
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x34], 0x6fb89c
mov dword [esp + 0x38], ecx
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], esi
cmp eax, esi
mov dword [esp + 0x18c], esi
mov dword [esp + 0x48], esi
mov dword [esp + 0x50], esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x58], esi
jle 0x499c26
mov dword [esp + 0x74], edi
mov eax, dword [ebx + 0x40]
neg eax
sbb eax, eax
lea edx, [esp + 0x70]
and eax, 0xfffff810
push esi
add eax, 0x7f6
push edx
push eax
call fcn.0049c4a0
xor ecx, ecx
cmp eax, esi
mov dword [esp + 0x2c], ecx
je 0x499c22
jmp 0x499a26
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x17c]
cmp eax, ebp
jl 0x499c22
jne 0x499bda
cmp dword [esp + 0x180], esi
je 0x499bf4
cmp ecx, esi
je 0x499a50
mov dword [esp + 0x2c], esi
mov eax, dword [esp + 0x3c]
mov esi, dword [esp + 0x74]
mov edi, eax
inc eax
push 0xffffffffffffffff
push eax
lea ecx, [esp + 0x3c]
call fcn.0049beb0
mov eax, dword [esp + 0x38]
lea ecx, [esp + 0x78]
push ecx
lea ecx, [esp + 0x28]
mov dword [eax + edi*4], esi
call fcn.00504ee1
lea edx, [esp + 0x24]
lea eax, [esp + 0x30]
push edx
push eax
mov byte [esp + 0x194], 1
call fcn.0049a820
mov ecx, dword [esp + 0x2c]
lea eax, [ebx + 0x12c]
push eax
push ecx
mov byte [esp + 0x19c], 2
call fcn.0049a900
mov ebp, eax
mov dword [esp + 0x7c], edx
mov edx, dword [esp + 0x40]
lea eax, [ebx + 0x12c]
push eax
push edx
call fcn.0049a900
add esp, 0x18
mov dword [esp + 0x60], eax
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x74]
lea ecx, [esp + 0x14]
lea esi, [ebx + 0x7c]
push ecx
push eax
mov ecx, esi
mov dword [esp + 0x6c], edx
mov dword [esp + 0x50], ebp
mov edi, eax
call fcn.0049be00
test eax, eax
jne 0x499b2b
mov eax, dword [esi + 4]
test eax, eax
jne 0x499b04
mov edx, dword [esi + 8]
push 1
push edx
mov ecx, esi
call fcn.004983f0
mov ecx, esi
call fcn.0049be40
mov ecx, dword [esp + 0x14]
mov dword [eax + 8], edi
mov dword [eax + 4], ecx
mov edx, dword [esi + 4]
mov ecx, dword [esp + 0x14]
mov edx, dword [edx + ecx*4]
mov dword [eax], edx
mov ecx, dword [esi + 4]
mov edx, dword [esp + 0x14]
mov dword [ecx + edx*4], eax
lea edi, [eax + 0xc]
mov eax, dword [esp + 0x20]
mov ecx, 5
lea esi, [esp + 0x48]
cmp ebp, eax
rep movsd dword es:[edi], dword [esi]
jle 0x499b45
mov dword [esp + 0x20], ebp
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x18]
cmp eax, ecx
jle 0x499b55
mov dword [esp + 0x18], eax
lea eax, [esp + 0x78]
lea ecx, [esp + 0x5c]
push eax
call fcn.00504ee1
mov eax, dword [eax]
push 0x7295bc
push eax
call fcn.004f28a4
add esp, 8
test eax, eax
sete cl
and ecx, 0xff
mov esi, ecx
lea ecx, [esp + 0x5c]
call fcn.00504e73
test esi, esi
je 0x499b94
mov eax, 3
jmp 0x499ba6
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x6c]
mov ecx, dword [edx + 0x18]
cmp eax, ecx
jg 0x499ba6
lea eax, [ecx + 8]
mov ecx, dword [esp + 0x1c]
mov byte [esp + 0x18c], 1
add ecx, eax
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x30]
call fcn.00504e73
lea ecx, [esp + 0x24]
mov byte [esp + 0x18c], 0
call fcn.00504e73
mov ebp, dword [esp + 0x28]
xor esi, esi
jmp 0x499bf4
cmp ecx, esi
jne 0x499bf4
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x10]
push eax
mov dword [esp + 0x30], 1
call fcn.00499940
mov edx, dword [esp + 0x74]
lea ecx, [esp + 0x70]
inc edx
push esi
mov dword [esp + 0x78], edx
mov eax, dword [ebx + 0x40]
neg eax
sbb eax, eax
push ecx
and eax, 0xfffff810
add eax, 0x7f6
push eax
call fcn.0049c4a0
cmp eax, esi
jne 0x499a22
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
xor edi, edi
dec edx
mov dword [esp + 0x10], edi
test edx, edx
jl 0x499d47
lea ebp, [ebx + 0x7c]
mov ebx, dword [ecx + edi*4]
xor edx, edx
mov eax, ebx
shr eax, 4
div dword [ebp + 8]
mov eax, dword [ebp + 4]
cmp eax, esi
je 0x499d35
mov eax, dword [eax + edx*4]
cmp eax, esi
je 0x499d35
cmp dword [eax + 8], ebx
je 0x499c6f
mov eax, dword [eax]
cmp eax, esi
jne 0x499c5f
jmp 0x499d35
cmp eax, esi
je 0x499d35
mov edx, dword [esp + 0x1c]
lea esi, [eax + 0xc]
mov eax, dword [esp + 0x20]
mov ecx, 5
lea edi, [esp + 0x48]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp + 8]
mov dword [esp + 0x50], eax
mov eax, ebx
mov dword [esp + 0x58], edx
shr eax, 4
xor edx, edx
mov ecx, dword [esp + 0x18]
div esi
mov dword [esp + 0x54], ecx
mov ecx, dword [ebp + 4]
test ecx, ecx
mov edi, edx
mov dword [esp + 0x28], edi
je 0x499cd2
mov eax, dword [ecx + edi*4]
test eax, eax
je 0x499cce
cmp dword [eax + 8], ebx
je 0x499cca
mov eax, dword [eax]
test eax, eax
jne 0x499cbd
jmp 0x499cce
test eax, eax
jne 0x499d1d
test ecx, ecx
jne 0x499d02
lea edi, [esi*4]
push edi
call fcn.00504bb4
mov edx, eax
mov ecx, edi
mov dword [ebp + 4], edx
mov edi, edx
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
add esp, 4
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x28]
mov dword [ebp + 8], esi
mov ecx, ebp
call fcn.0049be40
mov dword [eax + 4], edi
mov dword [eax + 8], ebx
mov ecx, dword [ebp + 4]
mov edx, dword [ecx + edi*4]
mov dword [eax], edx
mov ecx, dword [ebp + 4]
mov dword [ecx + edi*4], eax
lea edi, [eax + 0xc]
mov ecx, 5
lea esi, [esp + 0x48]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x38]
mov edi, dword [esp + 0x10]
xor esi, esi
mov edx, dword [esp + 0x3c]
inc edi
dec edx
mov dword [esp + 0x10], edi
cmp edi, edx
jle 0x499c3c
mov dword [esp + 0x34], 0x6fb89c
pop edi
cmp ecx, esi
mov dword [esp + 0x188], 3
pop ebp
je 0x499d69
push ecx
call fcn.00504bdd
add esp, 4
mov ecx, dword [esp + 0x17c]
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x180
ret 4