Function at 0x59058650
Capabilities:
Check if file exists
Enumerate files on windows
Get file attributes
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x59143632
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x17c
mov eax, dword [0x59194a20]
push ebp
xor ebp, ebp
push esi
cmp eax, ebp
push edi
mov dword [esp + 0x24], ecx
je 0x59058696
push str.CheckBadMailLog_____
push str.Winncap
push 0xffffffffffffffff
push 0x591949b4
call fcn.59078030
add esp, 0x10
lea eax, [esp + 0x18]
push eax
call fcn.5900d050
add esp, 4
push str..eml
lea ecx, [esp + 0x1c]
mov dword [esp + 0x194], ebp
call fcn.59095ca0
mov edx, dword [esp + 0x18]
mov ecx, 0x4f
xor eax, eax
lea edi, [esp + 0x4c]
mov dword [esp + 0x48], ebp
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x48]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x20], esi
je 0x590588d5
cmp dword [0x59194a20], ebp
je 0x5905870e
lea eax, [esp + 0x74]
push eax
push str.CheckBadMailLog___S_
push str.Winncap
push 0xffffffffffffffff
push 0x591949b4
call fcn.59078030
add esp, 0x14
push ebx
lea ecx, [esp + 0x2c]
call fcn.5909f0b0
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov byte [esp + 0x194], 1
mov bl, 3
test byte [esp + 0x4c], 0x10
jne 0x59058881
lea ecx, [esp + 0x78]
push ecx
lea ecx, [esp + 0x14]
call fcn.59094760
mov edx, dword [esp + 0x10]
mov byte [esp + 0x194], 2
mov esi, dword [edx - 8]
cmp esi, 4
jbe 0x5905886c
xor eax, eax
lea ecx, [esp + 0x18]
mov dword [esp + 0x40], eax
push ecx
mov dword [esp + 0x48], eax
mov dword [esp + 0x40], ebp
mov dword [esp + 0x4c], eax
call fcn.5900d050
add esp, 4
lea edx, [esp + 0x10]
lea ecx, [esp + 0x18]
push edx
mov byte [esp + 0x198], bl
call fcn.59095d00
add esi, 0xfffffffc
lea eax, [esp + 0x20]
push esi
push eax
lea ecx, [esp + 0x18]
call fcn.590976b0
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x198], 4
call fcn.59095210
lea ecx, [esp + 0x20]
mov byte [esp + 0x194], bl
call fcn.59095090
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x3c]
push ecx
push edx
call fcn.590af550
add esp, 8
test eax, eax
je 0x5905885b
lea eax, [esp + 0x18]
lea ecx, [esp + 0x14]
push eax
call fcn.59094660
lea ecx, [esp + 0x14]
mov byte [esp + 0x194], 5
call fcn.59096350
push str..mlg
push 0x591734fc
lea ecx, [esp + 0x1c]
call fcn.59096ed0
mov ecx, dword [esp + 0x14]
push ecx
call edi
cmp eax, 0xffffffff
jne 0x5905884b
push str..mlg2
push str..mlg
lea ecx, [esp + 0x1c]
call fcn.59096ed0
mov edx, dword [esp + 0x14]
push edx
call edi
cmp eax, 0xffffffff
jne 0x5905884b
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0x18]
push eax
push ecx
lea ecx, [esp + 0x34]
call fcn.5909f6b0
lea ecx, [esp + 0x14]
mov byte [esp + 0x194], bl
call fcn.59095090
lea ecx, [esp + 0x18]
mov byte [esp + 0x194], 2
call fcn.59095090
lea ecx, [esp + 0x10]
mov byte [esp + 0x194], 1
call fcn.59095090
mov esi, dword [esp + 0x24]
lea edx, [esp + 0x4c]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
cmp eax, ebp
jne 0x59058728
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, dword [esp + 0x30]
xor esi, esi
cmp eax, ebp
pop ebx
jle 0x590588c4
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
push 2
push ebp
mov eax, dword [eax + esi*4]
push eax
call fcn.5904db00
mov eax, dword [esp + 0x2c]
inc esi
cmp esi, eax
jl 0x590588a7
lea ecx, [esp + 0x28]
mov byte [esp + 0x190], 0
call fcn.5909f0c0
lea ecx, [esp + 0x18]
mov dword [esp + 0x190], 0xffffffff
call fcn.59095090
mov ecx, dword [esp + 0x188]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x188
ret