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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4e25b2
mov eax, dword fs:[0]
push eax
sub esp, 0x10c
mov eax, dword [0x5181f4]
xor eax, esp
mov dword [esp + 0x104], eax
push ebx
push esi
mov eax, dword [0x5181f4]
xor eax, esp
push eax
lea eax, [esp + 0x118]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
lea esi, [esp + 0x74]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], 2
call fcn.0040b049
push 7
xor ebx, ebx
pop esi
mov dword [esp + 0x120], ebx
push ebx
lea ecx, [esp + 0x40]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x58], esi
call fcn.00404d28
push ebx
lea ecx, [esp + 0x5c]
mov dword [esp + 0x74], esi
call fcn.00404d28
mov eax, dword [esp + 0x1c]
mov byte [esp + 0x120], 2
mov dword [edi + 4], ebx
mov dword [edi], ebx
push dword [eax]
lea ecx, [esp + 0x78]
push dword [eax + 4]
call fcn.004aa3d0
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x78]
call fcn.0040b085
cmp dword [eax + 0x14], ebx
push ebx
push 1
lea ecx, [esp + 0x28]
sete byte [esp + 0x17]
call fcn.00404df2
cmp byte [esp + 0xf], bl
je 0x40e47c
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov byte [esp + 0xf], bl
push ebx
push 1
lea ecx, [esp + 0x60]
call fcn.00404df2
push ebx
push 1
lea ecx, [esp + 0x44]
call fcn.00404df2
or dword [esp + 0x120], 0xffffffff
lea ecx, [esp + 0x74]
call fcn.00407181
mov al, byte [esp + 0xf]
mov ecx, dword [esp + 0x118]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [esp + 0x104]
xor ecx, esp
call fcn.00441cbb
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x10]
push eax
lea edx, [esp + 0x40]
lea ecx, [esp + 0x78]
call fcn.004075fa
movzx eax, ax
and eax, 0xfffffffe
test ax, ax
pop ecx
jne 0x40e5ba
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x78]
call fcn.0040b085
lea ecx, [esp + 0x3c]
push ebx
mov byte [esp + 0x124], 3
push ecx
mov ecx, dword [esp + 0x18]
mov edx, eax
call fcn.0040be93
pop ecx
pop ecx
push ebx
push 1
lea ecx, [esp + 0x28]
mov dword [esp + 0x1c], eax
mov byte [esp + 0x128], 2
call fcn.00404df2
push dword [esp + 0x10]
call sub.ODBC32.dll_SQLDisconnect
push dword [esp + 0x10]
push 2
call sub.ODBC32.dll_SQLFreeHandle
cmp dword [esp + 0x14], ebx
jne 0x40e5ba
push dword [esp + 0x1c]
push dword [esp + 0x1c]
call fcn.0040e087
test al, al
pop ecx
pop ecx
jne 0x40e523
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x14], 1
jmp 0x40e5ba
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x78]
call fcn.0040b085
mov byte [esp + 0x120], 4
cmp dword [eax + 0x18], 8
jb 0x40e544
mov eax, dword [eax + 4]
jmp 0x40e547
add eax, 4
push esi
push dword [esp + 0x1c]
mov ecx, eax
call fcn.0040c982
pop ecx
neg eax
sbb al, al
pop ecx
xor esi, esi
push ebx
inc al
inc esi
push esi
lea ecx, [esp + 0x28]
mov byte [esp + 0x17], al
mov byte [esp + 0x128], 2
call fcn.00404df2
cmp byte [esp + 0xf], bl
je 0x40e587
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x14], esi
jmp 0x40e5ba
push ebx
push 0x51f974
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
push dword [0x5223cc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
lea eax, [esp + 0x10]
push ebx
push eax
call fcn.00407d95
test eax, eax
pop ecx
pop ecx
je 0x40e57b
push dword [esp + 0x10]
call fcn.00407f35
pop ecx
mov eax, dword [esp + 0x50]
lea eax, [eax + eax + 4]
push eax
mov dword [edi], eax
call fcn.00494ca0
cmp eax, ebx
mov dword [edi + 4], eax
je 0x40e60b
mov ecx, dword [esp + 0x14]
mov dword [eax], ecx
mov eax, dword [esp + 0x50]
cmp eax, ebx
je 0x40e601
cmp dword [esp + 0x54], 8
mov ecx, dword [esp + 0x40]
jae 0x40e5ee
lea ecx, [esp + 0x40]
add eax, eax
push eax
mov eax, dword [edi + 4]
push ecx
add eax, 4
push eax
call fcn.00442550
add esp, 0xc
mov byte [esp + 0xf], 1
jmp 0x40e42c
mov dword [edi], ebx
push 0xe
jmp 0x40e422