Function at 0x10059eff
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x74
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
xor ebx, ebx
cmp word [edi], 0x3a
jne 0x10059f38
inc edi
inc edi
push 0x3a
push edi
mov dword [ebp + 0xc], edi
call dword [sym.imp.SHLWAPI.dll_StrChrW]
test eax, eax
je 0x10059ff0
mov esi, edi
mov word [edi], bx
inc edi
inc edi
mov dword [ebp + 0xc], edi
jmp 0x10059fc5
mov esi, dword [sym.imp.SHLWAPI.dll_StrRChrW]
push 0x5c
push ebx
push edi
call esi
push 0x2e
push ebx
push edi
call esi
mov edi, eax
inc edi
inc edi
test eax, eax
je 0x10059ff0
mov esi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
push 0x100d0050
push edi
call esi
test eax, eax
jne 0x10059f6f
mov esi, str.image_png
jmp 0x10059fc9
push 0x100d0034
push edi
call esi
test eax, eax
je 0x10059fc0
push str.jpeg
push edi
call esi
test eax, eax
je 0x10059fc0
push 0x100d0020
push edi
call esi
test eax, eax
jne 0x10059f9a
mov esi, str.image_gif
jmp 0x10059fc9
push str.tiff
push edi
call esi
test eax, eax
jne 0x10059fad
mov esi, str.image_tiff
jmp 0x10059fc9
push 0x100cffe0
push edi
call esi
test eax, eax
jne 0x10059ff0
mov esi, str.image_bmp
jmp 0x10059fc9
mov esi, str.image_jpeg
cmp esi, ebx
je 0x10059ff0
push 0x100cffe0
push esi
call dword [sym.imp.SHLWAPI.dll_StrCmpIW]
test eax, eax
je 0x10059ff0
push dword [ebp + 0x10]
push esi
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.10059e35
add esp, 0x10
jmp 0x1005a23f
cmp dword [ebp + 0x10], ebx
jne 0x1005a190
push ebx
push ebx
push ebx
push dword [ebp + 0x14]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], ebx
call dword [sym.imp.GDI32.dll_CreateDCW]
mov edi, dword [sym.imp.GDI32.dll_GetDeviceCaps]
push 0xe
push eax
mov dword [ebp - 4], eax
call edi
push 0xc
push dword [ebp - 4]
mov esi, eax
call edi
imul esi, eax
push dword [ebp - 4]
call dword [sym.imp.GDI32.dll_DeleteDC]
xor edi, edi
inc edi
cmp esi, edi
jg 0x1005a198
mov dword [ebp - 8], edi
mov cl, byte [ebp - 8]
mov eax, edi
shl eax, cl
shl eax, 2
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x4c]
push eax
push 0x18
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_GetObjectW]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x48]
mov word [ebp - 0x66], ax
movzx eax, ax
imul eax, ecx
add eax, 0x1f
cdq
push 0x20
mov dword [ebp - 0x70], ecx
pop ecx
idiv ecx
mov esi, dword [ebp - 0x44]
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x74], 0x28
mov dword [ebp - 0x6c], esi
mov word [ebp - 0x68], di
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x60], ebx
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x50], ebx
imul eax, esi
shl eax, 2
add eax, ecx
mov dword [ebp - 0x20], eax
add eax, 0x28
push eax
push 0x42
mov dword [ebp - 0x14], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [ebp - 0x18], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
push 0xa
pop ecx
mov edi, eax
lea esi, [ebp - 0x74]
push 0xf
mov dword [ebp - 8], eax
rep movsd dword es:[edi], dword [esi]
call dword [sym.imp.GDI32.dll_GetStockObject]
cmp eax, ebx
mov esi, dword [sym.imp.GDI32.dll_SelectPalette]
mov edi, dword [sym.imp.GDI32.dll_RealizePalette]
mov dword [ebp - 0x1c], eax
je 0x1005a0ff
push ebx
call dword [sym.imp.USER32.dll_GetDC]
push ebx
push dword [ebp - 0x1c]
mov dword [ebp - 4], eax
push eax
call esi
push dword [ebp - 4]
mov dword [ebp - 0x10], eax
call edi
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0xc]
push ebx
push eax
lea eax, [eax + ecx + 0x28]
push eax
push dword [ebp - 0x44]
push ebx
push dword [ebp + 8]
push dword [ebp - 4]
call dword [sym.imp.GDI32.dll_GetDIBits]
cmp dword [ebp - 0x10], ebx
je 0x1005a13a
push 1
push dword [ebp - 0x10]
push dword [ebp - 4]
call esi
push dword [ebp - 4]
call edi
push dword [ebp - 4]
push ebx
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [ebp - 0x20]
add eax, 0x36
mov dword [ebp - 0x32], eax
mov eax, dword [ebp - 0xc]
add eax, 0x36
cmp dword [ebp + 0xc], ebx
mov word [ebp - 0x34], 0x4d42
mov word [ebp - 0x2e], bx
mov word [ebp - 0x2c], bx
mov dword [ebp - 0x2a], eax
je 0x1005a1f0
push ebx
push 0x8000080
push 2
push ebx
push ebx
push 0x40000000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x1005a1c5
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x1005a23f
xor eax, eax
inc eax
jmp 0x1005a23f
push 4
pop eax
cmp esi, eax
jle 0x1005a1a6
push 8
pop eax
cmp esi, eax
jg 0x1005a1ae
mov dword [ebp - 8], eax
jmp 0x1005a03c
xor eax, eax
cmp esi, 0x18
setg al
lea eax, [eax*8 + 0x18]
mov dword [ebp - 8], eax
jmp 0x1005a049
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
lea eax, [ebp - 0x24]
push eax
push 0xe
lea eax, [ebp - 0x34]
push eax
push edi
call esi
push ebx
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x14]
push dword [ebp - 8]
push edi
call esi
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1005a22b
mov edi, dword [ebp - 0x14]
lea eax, [edi + 0xe]
mov dword [0x100e350c], eax
add eax, 8
push eax
mov ecx, 0x100e3d48
call fcn.10045ff1
mov esi, dword [0x100e3d48]
push 0xe
lea eax, [ebp - 0x34]
push eax
push esi
call fcn.100144ff
push edi
push dword [ebp - 8]
add esi, 0xe
push esi
call fcn.100144ff
add esp, 0x18
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret