Function at 0x58cc20
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5fe247
mov eax, dword fs:[0]
push eax
sub esp, 0x58
mov eax, dword [0x70f200]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x4c], edx
mov dword [ebp - 0x5c], ecx
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0x18]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x64], ebx
test al, 0x10
je 0x58cd1e
push dword [ebp + 0x10]
mov edx, dword [edx + esi*4 - 4]
push ebx
push eax
call fcn.0058d070
mov esi, eax
mov dword [ebp - 0x38], esi
mov dword [ebp - 4], 0
test esi, esi
jne 0x58cc95
xor bl, bl
mov al, bl
jmp 0x58d052
lea edx, [ebp - 0x30]
mov ecx, str.image_png
call fcn.005d1960
mov bl, al
test bl, bl
je 0x58cd0f
mov ebx, dword [ebp - 0x48]
lea eax, [ebp - 0x30]
mov edi, dword [sym.imp.gdiplus.dll_GdipSaveImageToFile]
push 0
push eax
push ebx
push dword [esi + 4]
call edi
test eax, eax
je 0x58cd0d
mov edx, 2
mov dword [esi + 8], eax
mov ecx, ebx
call fcn.005e4c40
push 0
lea eax, [ebp - 0x30]
push eax
push ebx
push dword [esi + 4]
call edi
test eax, eax
je 0x58ccf7
mov dword [esi + 8], eax
test eax, eax
mov edx, dword [esi]
mov ecx, esi
push 1
sete bl
call dword [edx]
mov al, bl
jmp 0x58d052
mov edx, dword [esi]
xor eax, eax
test eax, eax
mov ecx, esi
push 1
sete bl
call dword [edx]
mov al, bl
jmp 0x58d052
mov bl, 1
mov edx, dword [esi]
mov ecx, esi
push 1
call dword [edx]
mov al, bl
jmp 0x58d052
mov ecx, 0x50
mov eax, esi
mul ecx
mov ecx, 0xffffffff
cmovb eax, ecx
push eax
call fcn.0041e7cf
add esp, 4
mov dword [ebp - 0x50], eax
lea ecx, [esi + esi*4]
shl ecx, 4
push ecx
push 0
push eax
call fcn.00420090
mov eax, esi
or ebx, 0xffffffff
shl eax, 4
add esp, 0xc
add eax, 6
mov dword [ebp - 0x34], ebx
xor edi, edi
mov dword [ebp - 0x58], eax
mov dword [ebp - 4], 1
push edi
mov dword [ebp - 0x20], 0x10000
mov word [ebp - 0x1c], si
call dword [sym.imp.USER32.dll_GetDC]
mov dword [ebp - 0x60], eax
xor eax, eax
mov dword [ebp - 0x54], eax
test esi, esi
jle 0x58cffd
mov ecx, dword [ebp - 0x50]
add ecx, 0x40
mov dword [ebp - 0x40], ecx
push dword [ebp + 0x10]
mov edx, dword [ebp - 0x4c]
push dword [ebp - 0x64]
mov ecx, dword [ebp - 0x5c]
push dword [ebp + 0x14]
mov edx, dword [edx + eax*4]
call fcn.0058d070
mov esi, eax
mov dword [ebp - 0x38], esi
mov byte [ebp - 4], 2
test esi, esi
je 0x58cfd1
mov ecx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x60]
mov edx, dword [ebp - 0x54]
push dword [ebp + 0x14]
mov dword [ecx - 8], eax
mov eax, dword [ebp - 0x4c]
push ecx
mov eax, dword [eax + edx*4]
mov dword [ecx], eax
mov eax, dword [ebp - 0x4c]
mov eax, dword [eax + edx*4]
lea edx, [ecx - 0x40]
mov dword [ecx - 4], eax
mov ecx, esi
call fcn.0058d890
mov ecx, esi
push 1
test al, al
je 0x58cfcd
mov eax, dword [ebp - 0x3c]
dec eax
cmp dword [ebp - 0x54], eax
mov dword [ebp - 0x38], eax
mov eax, 1
cmove edi, eax
mov byte [ebp - 4], al
mov eax, dword [esi]
call dword [eax]
mov eax, dword [ebp - 0x54]
add dword [ebp - 0x40], 0x50
inc eax
mov esi, dword [ebp - 0x3c]
mov dword [ebp - 0x54], eax
cmp eax, esi
jl 0x58cd92
test edi, edi
je 0x58cfd4
xor edi, edi
push edi
push 0x80
push 2
push edi
push edi
push 0x40000000
push dword [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x34], ebx
test ebx, ebx
jne 0x58ce59
or ebx, 0xffffffff
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x4c], ebx
jmp 0x58ce64
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x4c], ebx
cmp ebx, 0xffffffff
jne 0x58cecc
push dword [ebp - 0x48]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x58cfd4
mov ecx, dword [ebp - 0x48]
mov edx, 2
call fcn.005e4c40
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp dword [ebp - 0x40], 0xffffffff
mov dword [ebp - 0x5c], eax
je 0x58ceb5
cmp dword [ebp - 0x4c], edi
je 0x58ceb5
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x5c]
mov ebx, eax
test eax, eax
jne 0x58cec3
or ebx, 0xffffffff
jmp 0x58cfd4
cmp eax, 0xffffffff
je 0x58cfd4
push 0
lea eax, [ebp - 0x18]
push eax
push 6
lea eax, [ebp - 0x20]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x58cfd4
cmp dword [ebp - 0x18], 6
jne 0x58cfd4
mov eax, dword [ebp - 0x50]
add eax, 0x48
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x40], eax
nop dword [eax]
mov ecx, dword [ebp - 0x58]
push 0
mov dword [eax - 0x3c], ecx
lea ecx, [ebp - 0x18]
push ecx
push 0x10
add eax, 0xffffffb8
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x58cfd4
cmp dword [ebp - 0x18], 0x10
jne 0x58cfd4
mov eax, dword [ebp - 0x40]
lea edx, [esi - 1]
mov ecx, dword [ebp - 0x58]
add ecx, dword [eax]
mov dword [ebp - 0x58], ecx
mov ecx, dword [ebp - 0x34]
cmp ecx, edx
mov edx, 1
cmove edi, edx
inc ecx
add eax, 0x50
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x40], eax
cmp ecx, esi
jl 0x58cf00
test edi, edi
je 0x58cfd4
mov esi, dword [ebp - 0x50]
xor edi, edi
mov dword [ebp - 0x34], edi
add esi, 0x44
mov eax, dword [esi]
lea ecx, [esi - 0x34]
add eax, 0x28
cmp dword [ecx + 0x38], eax
jne 0x58cf8d
push 0
lea eax, [ebp - 0x18]
push eax
push 0x28
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x58cfd1
cmp dword [ebp - 0x18], 0x28
jne 0x58cfd1
lea ecx, [esi - 0x34]
push 0
lea eax, [ebp - 0x18]
push eax
push dword [esi]
push dword [ecx + 0x3c]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x58cfd1
mov eax, dword [ebp - 0x18]
cmp eax, dword [esi]
jne 0x58cfd1
mov edx, dword [ebp - 0x34]
mov eax, 1
cmp edx, dword [ebp - 0x38]
cmove edi, eax
inc edx
add esi, 0x50
mov dword [ebp - 0x34], edx
cmp edx, dword [ebp - 0x3c]
jl 0x58cf63
mov esi, dword [ebp - 0x3c]
test esi, esi
jle 0x58cffd
jmp 0x58cfd4
mov eax, dword [esi]
call dword [eax]
mov esi, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x50]
add eax, 0x4c
mov dword [ebp - 0x34], eax
nop dword [eax]
mov ecx, dword [eax]
test ecx, ecx
je 0x58cff2
push ecx
call fcn.0041e1c3
mov eax, dword [ebp - 0x34]
add esp, 4
add eax, 0x50
mov dword [ebp - 0x34], eax
sub esi, 1
jne 0x58cfe0
push dword [ebp - 0x50]
call fcn.0041e1c3
add esp, 4
push dword [ebp - 0x60]
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
test edi, edi
je 0x58d036
mov esi, dword [sym.imp.SHELL32.dll_SHChangeNotify]
push 0
push dword [ebp - 0x48]
push 5
push 2
call esi
push 0
push dword [ebp - 0x48]
push 5
push 0x2000
call esi
cmp edi, 1
sete al
mov byte [ebp - 0x41], al
cmp ebx, 0xffffffff
je 0x58d052
test ebx, ebx
je 0x58d052
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [ebp - 0x41]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0041e1b5
mov esp, ebp
pop ebp
ret 0x14