Function at 0x504e40
Capabilities:
Enumerate pe sections
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x74
push ebx
mov ebx, eax
mov edx, dword [ebx]
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
mov dword [esp + 0x30], ecx
mov ecx, dword [eax + 4]
mov dword [esp + 0x34], ecx
mov ecx, dword [eax + 8]
mov dword [esp + 0x38], ecx
mov ecx, dword [eax + 0xc]
mov dword [esp + 0x3c], ecx
mov ecx, dword [eax + 0x10]
push esi
mov esi, dword [ebp + 8]
mov dword [esp + 0x44], ecx
mov ecx, dword [eax + 0x14]
push edi
mov edi, dword [esi + 0x34]
mov dword [esp + 0x4c], ecx
mov ecx, dword [edi + 0x30]
mov dword [esp + 0x1c], edx
test ecx, ecx
jne 0x5055ad
cmp dword [edi + 0x3c], ecx
jne 0x5055a9
mov ecx, dword [ebx + 8]
test ecx, ecx
je 0x504eb1
mov dword [esp + 0x14], ecx
jmp 0x504ecd
cmp dword [ebx + 0x74], 0
jne 0x504ec1
test byte [edx + 0x44], 8
jne 0x504ec1
mov byte [ebx + 0x17], 1
call fcn.004cbf10
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 0xc]
cmp byte [esp + 0x38], 0xc
jne 0x504ef7
mov edx, dword [esi]
mov eax, dword [edx]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x14]
push 0
push eax
push ecx
push 0x71
push edx
call fcn.004cc1f0
mov eax, dword [ebp + 0xc]
add esp, 0x14
mov byte [esp + 0x38], 0xe
mov ecx, dword [esi + 8]
test ecx, 0x400
je 0x504f1c
lea eax, [esp + 0x38]
push eax
mov eax, esi
mov ecx, ebx
call fcn.00504dc0
add esp, 4
mov dword [esp + 0x18], eax
jmp 0x5055ff
test ecx, 0x2000
je 0x504f39
lea ecx, [esp + 0x38]
push ecx
push esi
mov eax, ebx
call fcn.00504990
add esp, 8
jmp 0x505464
xor edx, edx
cmp dword [esi + 0x30], edx
je 0x504f52
push eax
push esi
push ebx
call fcn.00505a00
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [edi + 0x34], edx
jne 0x504f74
push str.COMPOUND_QUERY
push 1
call fcn.004cc530
push str.LEFT_MOST_SUBQUERY
push 1
call fcn.004cc530
add esp, 0x10
xor edx, edx
movzx eax, byte [esi + 4]
sub eax, 0x7b
je 0x505285
sub eax, 1
je 0x50516f
sub eax, 1
je 0x505285
mov eax, dword [ebx + 0x28]
push edx
push edx
mov edx, dword [esp + 0x1c]
lea ecx, [eax + 1]
push eax
mov dword [esp + 0x30], ecx
inc ecx
push 0x71
push edx
mov dword [esp + 0x24], eax
mov dword [ebx + 0x28], ecx
call fcn.004cc1f0
mov dword [esi + 0x18], eax
add esp, 0x14
mov eax, esi
call fcn.00501d20
or dword [eax + 8], 0x20
add eax, 8
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x50]
push ecx
mov dword [esp + 0x58], eax
xor eax, eax
push edi
push ebx
mov byte [esp + 0x5c], 1
mov dword [esp + 0x6c], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
call fcn.005094b0
add esp, 0xc
mov dword [esp + 0x18], eax
test eax, eax
jne 0x5055ff
mov edx, dword [esp + 0x24]
push eax
push eax
mov eax, dword [esp + 0x1c]
push edx
push 0x71
push eax
call fcn.004cc1f0
mov ecx, dword [esi + 0x3c]
mov edx, dword [esp + 0x38]
mov dword [esi + 0x1c], eax
xor eax, eax
mov dword [esi + 0x34], eax
mov dword [esi + 0x3c], eax
movzx eax, byte [esi + 4]
add esp, 0x14
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x54], edx
call fcn.00503610
push eax
push str._s_USING_TEMP_B_TREE
push 1
call fcn.004cc530
add esp, 0xc
lea eax, [esp + 0x50]
push eax
push esi
push ebx
call fcn.005094b0
mov ecx, dword [esi + 0x34]
mov dword [esp + 0x24], eax
mov dword [esi + 0x34], edi
movzx eax, word [edi + 6]
add esp, 0xc
cmp word [esi + 6], ax
mov dword [esp + 0x20], ecx
jle 0x505072
mov word [esi + 6], ax
mov edx, dword [esp + 0x1c]
mov eax, dword [esi + 0x3c]
push edx
call fcn.004e0b50
mov eax, dword [esp + 0x30]
mov dword [esi + 0x3c], eax
mov eax, dword [esp + 0x18]
add esp, 4
call fcn.004cc760
mov edi, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x2c], edi
call fcn.004cc760
push edi
push esi
mov esi, ebx
mov dword [esp + 0x30], eax
call fcn.005046f0
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
push 0
push edi
push ecx
push 0x24
push esi
call fcn.004cc1f0
add esp, 0x1c
mov eax, ebx
call fcn.004e6a30
mov edx, dword [esp + 0x10]
push 0
mov edi, eax
push edi
push edx
push 0x80
push esi
mov dword [esp + 0x44], edi
call fcn.004cc1f0
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
add esp, 0x14
mov dword [esp + 0x34], eax
push 0
push 0x1c
mov eax, edi
call fcn.004cc700
mov edx, edi
mov eax, ebx
call fcn.004e6a50
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
mov edi, dword [esp + 0x18]
push eax
mov eax, dword [ebp + 8]
push ecx
lea edx, [esp + 0x48]
push edx
push 0
push 0
push edi
push eax
mov ecx, ebx
call fcn.005029b0
mov edx, dword [esp + 0x4c]
add esp, 0x24
mov ecx, esi
call fcn.004cc7b0
mov ecx, dword [esp + 0x34]
push 0
push ecx
push edi
push 5
push esi
call fcn.004cc1f0
mov edx, dword [esp + 0x40]
add esp, 0x14
mov ecx, esi
call fcn.004cc7b0
push 0
push 0
lea eax, [edi + 1]
push eax
push 0x75
push esi
call fcn.004cc1f0
add esp, 0x14
jmp 0x505444
mov dword [esp + 0x2c], edx
mov edx, dword [esi + 0xc]
mov dword [edi + 0xc], edx
mov eax, dword [esi + 0x10]
lea edx, [esp + 0x38]
push edx
mov dword [edi + 0x10], eax
mov ecx, dword [esi + 0x3c]
push edi
push ebx
mov dword [edi + 0x3c], ecx
call fcn.005094b0
add esp, 0xc
mov dword [esp + 0x18], eax
mov dword [esi + 0x3c], 0
test eax, eax
jne 0x5055ff
mov dword [esi + 0x34], eax
mov eax, dword [edi + 0xc]
mov dword [esi + 0xc], eax
mov ecx, dword [edi + 0x10]
mov dword [esi + 0x10], ecx
test eax, eax
je 0x5051f2
mov edx, dword [esp + 0x14]
push 0
push 0
push eax
push 0x14
push edx
call fcn.004cc1f0
mov dword [esp + 0x40], eax
mov eax, dword [esi + 0x10]
add esp, 0x14
test eax, eax
je 0x5051f2
mov ecx, dword [esp + 0x14]
push eax
inc eax
push eax
mov eax, dword [esi + 0xc]
push eax
push 0x99
push ecx
call fcn.004cc1f0
add esp, 0x14
push str.UNION_ALL
push 1
call fcn.004cc530
lea edx, [esp + 0x40]
push edx
push esi
push ebx
call fcn.005094b0
mov cx, word [esi + 6]
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0x34]
mov dword [esp + 0x34], eax
mov dword [esi + 0x34], edi
mov ax, word [edi + 6]
add esp, 0x14
call fcn.004af900
mov word [esi + 6], ax
mov edi, dword [edi + 0x3c]
mov word [esp + 0x10], ax
test edi, edi
je 0x50526b
mov edx, dword [edi + 0xc]
lea ecx, [esp + 0x34]
push ecx
push edx
call fcn.004e1db0
add esp, 8
test eax, eax
je 0x50526b
mov eax, dword [esp + 0x34]
test eax, eax
jle 0x50526b
cdq
push edx
push eax
call fcn.004af950
add esp, 8
cmp word [esp + 0x10], ax
jle 0x50526b
mov word [esi + 6], ax
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x505457
mov edx, dword [esp + 0x14]
call fcn.004ccb60
jmp 0x505457
cmp byte [esp + 0x38], 1
jne 0x505296
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x28], eax
jmp 0x5052c8
mov eax, dword [ebx + 0x28]
push edx
push edx
mov edx, dword [esp + 0x1c]
push eax
lea ecx, [eax + 1]
push 0x71
push edx
mov dword [esp + 0x3c], eax
mov dword [ebx + 0x28], ecx
call fcn.004cc1f0
mov dword [esi + 0x18], eax
add esp, 0x14
mov eax, esi
call fcn.00501d20
or dword [eax + 8], 0x20
add eax, 8
xor edx, edx
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x68]
push ecx
push edi
push ebx
mov byte [esp + 0x74], 1
mov dword [esp + 0x78], eax
mov dword [esp + 0x84], edx
mov dword [esp + 0x7c], edx
mov dword [esp + 0x80], edx
call fcn.005094b0
add esp, 0xc
mov dword [esp + 0x18], eax
test eax, eax
jne 0x5055ff
mov cl, byte [esi + 4]
mov edx, dword [esi + 0x3c]
cmp cl, 0x7d
sete al
inc al
mov byte [esp + 0x68], al
movzx eax, cl
mov dword [esi + 0x34], 0
mov dword [esp + 0x34], edx
mov dword [esi + 0x3c], 0
call fcn.00503610
push eax
push str._s_USING_TEMP_B_TREE
push 1
call fcn.004cc530
add esp, 0xc
lea eax, [esp + 0x68]
push eax
push esi
push ebx
call fcn.005094b0
mov ecx, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0x30]
push ecx
call fcn.004e1960
mov edx, dword [esi + 0x34]
add esp, 4
cmp byte [esi + 4], 0x7b
mov dword [esp + 0x20], edx
mov dword [esi + 0x34], edi
mov dword [esi + 0x30], 0
jne 0x505389
mov ax, word [edi + 6]
mov cx, word [esi + 6]
call fcn.004af900
mov word [esi + 6], ax
mov eax, dword [esp + 0x1c]
push eax
mov eax, dword [esi + 0x3c]
call fcn.004e0b50
mov ecx, dword [esp + 0x38]
xor eax, eax
add esp, 4
cmp byte [esp + 0x38], 1
mov dword [esi + 0x3c], ecx
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
je 0x505457
mov eax, dword [esp + 0x14]
call fcn.004cc760
mov edi, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x24], edi
call fcn.004cc760
push edi
push esi
mov esi, ebx
mov dword [esp + 0x34], eax
call fcn.005046f0
mov esi, dword [esp + 0x1c]
push 0
push edi
mov edi, dword [esp + 0x38]
push edi
push 0x24
push esi
call fcn.004cc1f0
mov edx, dword [esi + 0x88]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x48]
add esp, 0x1c
push eax
mov eax, dword [ebp + 8]
push ecx
mov dword [esp + 0x3c], edx
lea edx, [esp + 0x40]
push edx
push 0
push 0
push edi
push eax
mov ecx, ebx
call fcn.005029b0
mov edx, dword [esp + 0x48]
add esp, 0x1c
mov ecx, esi
call fcn.004cc7b0
mov ecx, dword [esp + 0x34]
push 0
push ecx
push edi
push 5
push esi
call fcn.004cc1f0
mov edx, dword [esp + 0x38]
add esp, 0x14
mov ecx, esi
call fcn.004cc7b0
push 0
push 0
push edi
push 0x75
push esi
call fcn.004cc1f0
mov esi, dword [ebp + 8]
add esp, 0x14
cmp dword [esi + 0x38], 0
jne 0x505464
mov edx, ebx
call fcn.004cc5f0
test byte [esi + 8], 0x20
je 0x5055ff
mov edx, dword [esi]
mov eax, dword [edx]
mov edi, dword [esp + 0x1c]
push 1
push eax
mov dword [esp + 0x30], eax
call fcn.005034b0
mov edi, eax
add esp, 8
test edi, edi
jne 0x505498
mov dword [esp + 0x18], 7
jmp 0x5055ff
cmp dword [esp + 0x28], 0
lea eax, [edi + 0x14]
mov dword [esp + 0x10], 0
mov dword [esp + 0x2c], eax
jle 0x5054e6
mov ecx, dword [esp + 0x10]
push ecx
push esi
push ebx
call fcn.00504840
mov ecx, dword [esp + 0x38]
add esp, 0xc
mov dword [ecx], eax
test eax, eax
jne 0x5054d0
mov edx, dword [esp + 0x1c]
mov eax, dword [edx + 8]
mov dword [ecx], eax
mov eax, dword [esp + 0x10]
inc eax
add ecx, 4
cmp eax, dword [esp + 0x28]
mov dword [esp + 0x10], eax
mov dword [esp + 0x2c], ecx
jl 0x5054ae
mov dword [esp + 0x2c], esi
lea ebx, [ebx]
mov dword [esp + 0x10], 0
add esi, 0x18
mov eax, dword [esi]
test eax, eax
jl 0x505585
mov edx, dword [esp + 0x14]
mov ecx, dword [edx]
cmp byte [ecx + 0x49], 0
je 0x505518
mov ecx, 0x6403fc
jmp 0x505521
mov ebx, dword [edx + 0x58]
lea ecx, [eax + eax*4]
lea ecx, [ebx + ecx*4]
mov ebx, dword [esp + 0x28]
mov dword [ecx + 8], ebx
inc dword [edi]
mov ecx, dword [edx]
cmp byte [ecx + 0x49], 0
je 0x505540
mov eax, edi
mov edx, 0xfffffff7
call fcn.004cccf0
jmp 0x50556a
mov ecx, dword [edx + 0x58]
lea eax, [eax + eax*4]
cmp byte [ecx + eax*4 + 1], 0
lea eax, [ecx + eax*4]
je 0x505563
push edi
push eax
mov eax, 0xfffffff7
mov ecx, edx
call fcn.004cce90
add esp, 8
jmp 0x50556a
mov dword [eax + 0x10], edi
mov byte [eax + 1], 0xf7
mov eax, dword [esp + 0x10]
inc eax
mov dword [esi], 0xffffffff
add esi, 4
cmp eax, 2
mov dword [esp + 0x10], eax
jl 0x5054fb
mov edx, dword [esp + 0x2c]
mov esi, dword [edx + 0x34]
mov dword [esp + 0x2c], esi
test esi, esi
jne 0x5054f0
add dword [edi], 0xffffffff
jne 0x5055ff
mov ecx, dword [edi + 0xc]
mov eax, edi
call fcn.004ab540
jmp 0x5055ff
test ecx, ecx
je 0x5055b4
mov ecx, str.ORDER_BY
jmp 0x5055b9
mov ecx, str.LIMIT
movzx eax, byte [esi + 4]
sub eax, 0x7c
je 0x5055e1
sub eax, 1
je 0x5055da
sub eax, 1
je 0x5055d3
mov eax, str.UNION
jmp 0x5055e6
mov eax, str.INTERSECT
jmp 0x5055e6
mov eax, str.EXCEPT
jmp 0x5055e6
mov eax, str.UNION_ALL
push eax
push ecx
push str._s_clause_should_come_after__s_not_before
mov esi, ebx
call fcn.004ae670
add esp, 0xc
mov dword [esp + 0x18], 1
mov eax, dword [ebp + 0xc]
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x44]
mov dword [eax + 8], ecx
mov dword [eax + 0xc], edx
mov eax, dword [esp + 0x20]
test eax, eax
je 0x505628
push 1
push eax
mov eax, dword [esp + 0x24]
push eax
call fcn.005019f0
add esp, 0xc
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret