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

Disassembly:
sub esp, 0x3c
push ebx
push ebp
mov ebp, dword [esp + 0x4c]
push esi
push edi
mov edi, dword [esp + 0x50]
mov eax, dword [ebp + 4]
mov dword [esp + 0x10], 0
mov ebx, dword [edi + 8]
mov dword [esp + 0x20], ebx
test al, 0x20
jne 0x501730
cmp dword [edi + 0x34], 0
jne 0x501730
test eax, 0x2000000
je 0x501700
push 0x11
push ebx
call fcn.0052e2d0
add esp, 8
mov esi, eax
test dword [ebp + 4], 0x800
je 0x5016aa
mov ecx, dword [ebp + 0x14]
push dword [ecx + 0x10]
push str.REUSE_LIST_SUBQUERY__d
push 0
push edi
call fcn.00536210
add esp, 0x10
push dword [ebp + 0x2c]
push dword [ebp + 0x30]
push 0xc
push ebx
call fcn.0052e380
push dword [ebp + 0x1c]
push dword [esp + 0x6c]
push 0x71
push ebx
call fcn.0052e380
mov edx, dword [ebx + 0x74]
add esp, 0x20
test esi, esi
jns 0x5016d4
lea esi, [edx - 1]
mov eax, dword [ebx]
cmp byte [eax + 0x57], 0
je 0x5016ec
pop edi
mov eax, 0x784c9c
pop esi
pop ebp
pop ebx
mov dword [eax + 8], edx
add esp, 0x3c
ret
mov eax, dword [ebx + 0x70]
lea ecx, [esi + esi*4]
pop edi
pop esi
pop ebp
lea eax, [eax + ecx*4]
mov dword [eax + 8], edx
pop ebx
add esp, 0x3c
ret
or eax, 0x2000000
mov dword [ebp + 4], eax
mov eax, dword [edi + 0x2c]
inc eax
push eax
push 0
push 0x47
mov dword [edi + 0x2c], eax
push ebx
mov dword [ebp + 0x30], eax
call fcn.0052e380
inc eax
push 0x11
push ebx
mov dword [ebp + 0x2c], eax
call fcn.0052e2d0
add esp, 0x18
mov dword [esp + 0x10], eax
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x24], ecx
mov al, byte [ecx]
cmp al, 0xb0
jne 0x501740
mov al, byte [ecx + 2]
cmp al, 0xb1
jne 0x50174b
mov eax, dword [ecx + 0x14]
mov esi, dword [eax]
jmp 0x50175e
cmp al, 0x8a
jne 0x501759
mov eax, dword [ecx + 0x14]
mov eax, dword [eax + 0x1c]
mov esi, dword [eax]
jmp 0x50175e
mov esi, 1
mov edx, dword [esp + 0x58]
mov dword [ebp + 0x1c], edx
mov ecx, dword [ebx + 0x74]
mov dword [esp + 0x50], esi
mov dword [esp + 0x28], ecx
cmp dword [ebx + 0x78], ecx
jg 0x50178a
push 0
push esi
push edx
push 0x74
push ebx
call fcn.004e2e80
add esp, 0x14
mov dword [esp + 0x28], eax
jmp 0x5017b5
lea eax, [ecx + 1]
mov dword [ebx + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [ebx + 0x70]
mov dword [eax + ecx*4], 0x74
mov dword [eax + ecx*4 + 4], edx
mov dword [eax + ecx*4 + 8], esi
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
push 1
push esi
push dword [edi]
call fcn.00519fc0
add esp, 0xc
mov dword [esp + 0x14], eax
test dword [ebp + 4], 0x800
mov eax, dword [ebp + 0x14]
je 0x501964
cmp dword [esp + 0x10], 0
mov ecx, dword [eax + 0x1c]
mov dword [esp + 0x1c], ecx
mov ecx, 0x56dd34
mov dword [esp + 0x18], eax
jne 0x5017f2
mov ecx, str.CORRELATED
push dword [eax + 0x10]
push ecx
push str._sLIST_SUBQUERY__d
push 1
push edi
call fcn.00536210
mov eax, dword [esp + 0x30]
add esp, 0x14
cmp dword [eax], esi
jne 0x501b38
mov eax, dword [esp + 0x58]
push ebp
push edi
mov byte [esp + 0x38], 0xb
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
call fcn.004cc010
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x20]
push 0
push eax
mov dword [eax + 8], 0
push dword [edi]
call fcn.00527f80
mov ecx, dword [edi]
add esp, 0x14
mov dword [esp + 0x2c], eax
cmp byte [ecx + 0x57], 0
je 0x501878
mov dword [esp + 0x18], 1
jmp 0x50188f
lea ecx, [esp + 0x30]
push ecx
push eax
push edi
call fcn.00525770
mov dword [esp + 0x24], eax
add esp, 0xc
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x5018a0
push 1
push eax
push dword [edi]
call fcn.004c3480
add esp, 0xc
mov eax, dword [esp + 0x44]
test eax, eax
je 0x5018b3
push eax
push dword [edi]
call fcn.00504db0
add esp, 8
cmp dword [esp + 0x18], 0
je 0x5018e2
mov eax, dword [esp + 0x14]
test eax, eax
je 0x501c38
dec dword [eax]
jne 0x501c38
push eax
push dword [eax + 0xc]
call fcn.00504db0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
test esi, esi
jle 0x501b38
mov esi, dword [esp + 0x1c]
mov ebx, dword [esp + 0x14]
add esi, 8
add ebx, 0x14
mov dword [esp + 0x1c], esi
xor ebp, ebp
mov edi, edi
push ebp
push dword [esp + 0x28]
call fcn.0053a470
mov esi, dword [esi]
add esp, 8
test dword [eax + 4], 0x100
je 0x50191b
push eax
jmp 0x501937
test esi, esi
je 0x501928
test dword [esi + 4], 0x100
jne 0x501936
push eax
push edi
call fcn.0050a660
add esp, 8
test eax, eax
jne 0x501940
push esi
push edi
call fcn.0050a660
add esp, 8
mov esi, dword [esp + 0x1c]
inc ebp
mov dword [ebx], eax
add esi, 0x14
add ebx, 4
mov dword [esp + 0x1c], esi
cmp ebp, dword [esp + 0x50]
jl 0x501900
mov ebx, dword [esp + 0x20]
mov ebp, dword [esp + 0x54]
jmp 0x501b38
mov dword [esp + 0x2c], eax
test eax, eax
je 0x501b38
push dword [esp + 0x24]
call fcn.00507820
add esp, 4
mov byte [esp + 0x54], al
cmp al, 0x40
jg 0x50198b
mov byte [esp + 0x54], 0x41
jmp 0x501994
cmp al, 0x45
jne 0x501994
mov byte [esp + 0x54], 0x43
mov esi, dword [esp + 0x14]
test esi, esi
je 0x5019ab
push dword [ebp + 0xc]
push edi
call fcn.0050a660
add esp, 8
mov dword [esi + 0x14], eax
mov al, byte [edi + 0x13]
test al, al
jne 0x5019ba
inc dword [edi + 0x2c]
mov esi, dword [edi + 0x2c]
jmp 0x5019c9
dec al
mov byte [edi + 0x13], al
movzx eax, al
mov esi, dword [edi + eax*4 + 0x98]
mov al, byte [edi + 0x13]
mov dword [esp + 0x18], esi
test al, al
jne 0x5019e0
inc dword [edi + 0x2c]
mov edx, dword [edi + 0x2c]
mov dword [esp + 0x50], edx
jmp 0x5019f3
dec al
mov byte [edi + 0x13], al
movzx eax, al
mov eax, dword [edi + eax*4 + 0x98]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x2c]
lea ecx, [eax + 8]
mov eax, dword [eax]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], eax
test eax, eax
jle 0x501b04
mov eax, 1
cmp dword [esp + 0x10], 0
mov esi, dword [ecx]
mov dword [esp + 0x2c], esi
je 0x501a9f
mov word [esp + 0x44], ax
mov dword [esp + 0x34], fcn.004cc820
mov dword [esp + 0x38], 0x528460
mov dword [esp + 0x48], 0
test esi, esi
je 0x501a9f
lea eax, [esp + 0x30]
push esi
push eax
call fcn.0054e280
add esp, 8
cmp word [esp + 0x44], 0
jne 0x501a9f
mov edx, dword [ebx]
cmp byte [edx + 0x57], 0
jne 0x501a90
mov eax, dword [esp + 0x10]
lea ecx, [eax + eax*4]
mov eax, dword [ebx + 0x70]
push dword [eax + ecx*4 + 0x10]
lea esi, [eax + ecx*4]
movsx eax, byte [esi + 1]
push eax
push edx
call fcn.004cfc50
mov word [esi], 0xb6
add esp, 0xc
mov dword [esi + 0x10], 0
mov esi, dword [esp + 0x2c]
and dword [ebp + 4], 0xfdffffff
mov dword [esp + 0x10], 0
push dword [esp + 0x18]
push esi
push edi
call fcn.00507eb0
mov esi, dword [esp + 0x24]
lea eax, [esp + 0x60]
push 1
push eax
push dword [esp + 0x64]
push 1
push esi
push 0x60
push ebx
call fcn.0052e440
push 1
push esi
push dword [esp + 0x80]
push dword [esp + 0x8c]
push 0x89
push ebx
call fcn.0052e510
mov eax, dword [esp + 0x64]
add esp, 0x40
mov ecx, dword [esp + 0x20]
dec eax
add ecx, 0x14
mov dword [esp + 0x24], eax
test eax, eax
mov dword [esp + 0x20], ecx
mov eax, 1
jg 0x501a11
test esi, esi
je 0x501b1c
mov al, byte [edi + 0x13]
cmp al, 8
jae 0x501b1c
movzx eax, al
mov dword [edi + eax*4 + 0x98], esi
inc byte [edi + 0x13]
mov ecx, dword [esp + 0x50]
test ecx, ecx
je 0x501b38
mov al, byte [edi + 0x13]
cmp al, 8
jae 0x501b38
movzx eax, al
mov dword [edi + eax*4 + 0x98], ecx
inc byte [edi + 0x13]
mov esi, dword [esp + 0x14]
test esi, esi
je 0x501b88
mov eax, dword [ebx]
cmp byte [eax + 0x57], 0
je 0x501b56
push esi
push 0xfffffffffffffff7
push eax
call fcn.004cfc50
add esp, 0xc
jmp 0x501b88
mov eax, dword [esp + 0x28]
test eax, eax
jns 0x501b62
mov eax, dword [ebx + 0x74]
dec eax
lea ecx, [eax + eax*4]
mov eax, dword [ebx + 0x70]
cmp byte [eax + ecx*4 + 1], 0
lea eax, [eax + ecx*4]
je 0x501b81
push 0xfffffffffffffff7
push esi
push eax
push ebx
call fcn.00547c80
add esp, 0x10
jmp 0x501b88
mov dword [eax + 0x10], esi
mov byte [eax + 1], 0xf7
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x501c38
mov edx, dword [ebx + 0x74]
jns 0x501b9c
lea ecx, [edx - 1]
mov eax, dword [ebx]
cmp byte [eax + 0x57], 0
je 0x501bab
mov eax, 0x784c9c
jmp 0x501bb4
mov eax, dword [ebx + 0x70]
lea ecx, [ecx + ecx*4]
lea eax, [eax + ecx*4]
mov dword [eax + 8], edx
mov ecx, dword [ebx + 0x74]
mov edx, dword [ebp + 0x30]
cmp dword [ebx + 0x78], ecx
jg 0x501bd4
push 0
push 0
push edx
push 0x43
push ebx
call fcn.004e2e80
add esp, 0x14
jmp 0x501c03
lea eax, [ecx + 1]
mov dword [ebx + 0x74], eax
lea ecx, [ecx + ecx*4]
mov eax, dword [ebx + 0x70]
mov dword [eax + ecx*4], 0x43
mov dword [eax + ecx*4 + 4], edx
mov dword [eax + ecx*4 + 8], 0
mov dword [eax + ecx*4 + 0xc], 0
mov dword [eax + ecx*4 + 0x10], 0
mov ecx, dword [ebp + 0x2c]
dec ecx
mov edx, dword [ebx + 0x74]
jns 0x501c0f
lea ecx, [edx - 1]
mov eax, dword [ebx]
cmp byte [eax + 0x57], 0
je 0x501c1e
mov ecx, 0x784c9c
jmp 0x501c27
mov eax, dword [ebx + 0x70]
lea ecx, [ecx + ecx*4]
lea ecx, [eax + ecx*4]
lea eax, [edx - 1]
mov dword [ecx + 4], eax
mov byte [edi + 0x13], 0
mov dword [edi + 0x1c], 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret