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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x28
push ebx
push ebp
push esi
mov esi, ecx
mov dword [esp + 0x24], edx
push edi
mov dword [esp + 0x24], 0
mov edi, dword [esi]
movsx edx, byte [esi + 0x44]
mov dword [esp + 0x20], edx
mov eax, dword [edi + 4]
mov ebp, dword [esi + edx*4 + 0x78]
mov dword [esp + 0x18], eax
lea eax, [esi + 0x50]
movzx ecx, word [eax + edx*2]
lea eax, [eax + edx*2]
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x40]
mov dword [esp + 0x1c], ecx
mov ax, word [eax + ecx*2]
mov ch, al
mov cl, ah
movzx eax, word [ebp + 0x14]
movzx ebx, cx
and ebx, eax
add ebx, dword [ebp + 0x38]
cmp byte [ebp + 5], 0
mov dword [esp + 0x10], ebx
jne 0x49942c
and byte [esi + 0x40], 0xf1
xor eax, eax
cmp byte [esi + 0x42], 1
mov dword [esp + 0x14], 0
mov word [esi + 0x24], ax
jne 0x499419
movzx ecx, word [esi + edx*2 + 0x50]
test cx, cx
je 0x499419
mov eax, dword [esi + edx*4 + 0x78]
cmp byte [eax + 5], 0
je 0x499419
lea eax, [ecx - 1]
mov word [esi + edx*2 + 0x50], ax
jmp 0x49942c
lea edx, [esp + 0x14]
mov ecx, esi
call fcn.00495be0
test eax, eax
jne 0x499750
test byte [esi + 0x40], 0x20
je 0x49944c
mov edx, dword [esi + 0x34]
mov ecx, dword [esp + 0x18]
push esi
call fcn.00491040
mov edx, eax
add esp, 4
test edx, edx
jne 0x49974e
cmp dword [esi + 0x48], 0
jne 0x49948f
cmp byte [edi + 0xb], 0
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 0x14]
je 0x49948f
mov eax, dword [edi + 4]
mov byte [edi + 0xb], 0
mov eax, dword [eax + 8]
test eax, eax
je 0x49948f
nop dword [eax]
test byte [eax + 0x40], 0x10
je 0x499488
mov byte [edi + 0xb], 1
cmp dword [eax + 0x10], ecx
jne 0x499488
cmp dword [eax + 0x14], edx
jne 0x499488
mov byte [eax + 0x42], 0
mov eax, dword [eax + 8]
test eax, eax
jne 0x499470
cmp dword [esp + 0x28], 0
je 0x4994d0
cmp byte [ebp + 5], 0
je 0x499500
push ebx
push ebp
call fcn.00491720
movzx edi, word [ebp + 0x10]
add esp, 8
movzx ecx, ax
add edi, 2
mov eax, dword [esp + 0x18]
add edi, ecx
mov ecx, dword [eax + 0x24]
mov eax, 0xaaaaaaab
add ecx, ecx
mul ecx
shr edx, 1
cmp edi, edx
jg 0x499500
mov dword [esp + 0x24], 1
mov ecx, dword [ebp + 0x48]
test byte [ecx + 0x18], 4
mov edx, dword [ecx + 0x10]
je 0x49956c
mov eax, dword [edx + 0x18]
cmp eax, dword [ecx + 0x14]
jb 0x49956c
cmp dword [edx + 0x60], 0
je 0x49958e
call fcn.0048c4d0
jmp 0x499586
mov ecx, esi
call fcn.00494b50
cmp byte [esi + 0x45], 0
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
mov dword [esi + 0x28], ecx
mov dword [esi + 0x2c], eax
jne 0x4994d0
push eax
push ecx
call fcn.00480960
mov edi, eax
add esp, 8
test edi, edi
je 0x49955d
push 0
push edi
push dword [esi + 0x28]
xor edx, edx
mov ecx, esi
call fcn.00494dc0
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x49954a
mov ebx, dword [esp + 0x10]
mov dword [esi + 0x30], edi
jmp 0x4994d0
push edi
call fcn.00480d40
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, 7
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edx + 0x94]
cmp eax, dword [edx + 0x98]
jbe 0x499581
call fcn.0048db70
jmp 0x499586
call fcn.0048d970
test eax, eax
jne 0x499750
lea eax, [esp + 0x10]
mov edx, ebx
push eax
mov ecx, ebp
call fcn.004967e0
mov edx, dword [esp + 0x20]
add esp, 4
mov dword [esp + 0x14], eax
mov ecx, ebp
lea eax, [esp + 0x14]
push eax
movzx eax, word [esp + 0x14]
push eax
call fcn.00496d50
mov edx, dword [esp + 0x1c]
add esp, 8
test edx, edx
jne 0x49974e
cmp byte [ebp + 5], dl
jne 0x499691
movsx eax, byte [esi + 0x44]
mov ebx, dword [esi + eax*4 + 0x78]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x10], ebx
movzx ecx, word [ebx + 0x12]
mov eax, dword [esi + eax*4 + 0x7c]
mov edx, dword [ebx + 0x38]
mov eax, dword [eax + 0x54]
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 0x40]
mov ax, word [eax + ecx*2 - 2]
mov ch, al
mov cl, ah
movzx eax, word [ebx + 0x14]
movzx ecx, cx
and ecx, eax
lea eax, [edx + 4]
add ecx, edx
mov dword [esp + 0x30], ecx
cmp ecx, eax
jae 0x499627
mov ecx, 0xf4c5
call fcn.004f0770
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x4c]
push ecx
push ebx
call eax
mov ecx, dword [esp + 0x18]
movzx ebx, ax
mov eax, dword [esp + 0x20]
mov ecx, dword [ecx + 0x48]
mov edi, dword [eax + 0x50]
call fcn.0048dd70
mov edx, dword [esp + 0x24]
mov ecx, ebp
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x38]
lea eax, [ebx + 4]
push edi
push eax
mov eax, dword [esp + 0x48]
add eax, 0xfffffffc
push eax
call fcn.00496e70
add esp, 0x1c
lea eax, [esp + 0x14]
push eax
mov eax, dword [esp + 0x14]
mov ecx, eax
push ebx
movzx edx, word [eax + 0x12]
dec edx
call fcn.00496d50
mov edx, dword [esp + 0x1c]
add esp, 8
test edx, edx
jne 0x49974e
mov ecx, esi
call fcn.00498f70
mov edx, eax
test edx, edx
jne 0x49974e
mov cl, byte [esi + 0x44]
mov ebx, dword [esp + 0x20]
movsx eax, cl
cmp eax, ebx
jle 0x4996f6
movsx eax, cl
dec cl
mov eax, dword [esi + eax*4 + 0x78]
mov byte [esi + 0x44], cl
test eax, eax
je 0x4996e2
mov ecx, dword [eax + 0x48]
test byte [ecx + 0x18], 0x40
mov edi, dword [ecx + 0x10]
je 0x4996d3
call fcn.0048bf80
jmp 0x4996d8
call fcn.00488760
mov ecx, edi
call fcn.0048d1b0
mov cl, byte [esi + 0x44]
movsx eax, cl
cmp eax, ebx
jg 0x4996b0
mov ecx, esi
call fcn.00498f70
mov edx, eax
test edx, edx
jne 0x49974e
cmp dword [esp + 0x24], 0
je 0x49973a
mov byte [esi + 0x42], 2
movzx eax, word [ebp + 0x12]
cmp dword [esp + 0x1c], eax
jb 0x499729
mov ecx, dword [esp + 0x34]
mov dword [esi + 0x3c], 0xffffffff
mov ax, word [ebp + 0x12]
dec ax
mov word [ecx], ax
mov eax, edx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x3c], 1
mov eax, edx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, esi
call fcn.004951d0
cmp dword [esp + 0x28], 0
mov edx, eax
je 0x49974e
mov byte [esi + 0x42], 3
mov eax, edx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret