Function at 0x30013ce0
Capabilities:
Delete file
Move file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
mov edi, ecx
mov byte [ebp - 2], 0
mov eax, 0x4ec4ec4f
mov bl, 1
mov edx, dword [edi + 4]
sub edx, dword [edi]
imul edx
mov eax, dword [edi + 0x24]
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
movzx eax, word [eax + 6]
add ecx, edx
cmp eax, ecx
jne 0x300141ac
mov eax, dword [ebp + 8]
test eax, eax
je 0x30013d21
mov esi, eax
jmp 0x30013d39
mov ecx, str.CAPE
call fcn.30003500
mov esi, eax
push str.CapeOutput.bin
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
push 0
push 0x80
push 2
push 0
push 3
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [edi + 0x3c], eax
cmp eax, 0xffffffff
je 0x300141ac
push dword [edi + 0x18]
xor edx, edx
mov ecx, eax
push 0x40
call fcn.30015b00
mov esi, dword [edi + 0x20]
add esp, 8
neg al
sbb al, al
and al, bl
mov ebx, 0x40
mov byte [ebp - 1], al
test esi, esi
je 0x30013da4
mov eax, dword [edi + 0x1c]
test eax, eax
je 0x30013da4
mov ecx, dword [edi + 0x3c]
mov edx, ebx
push eax
push esi
call fcn.30015b00
add esp, 8
lea ebx, [esi + 0x40]
neg al
sbb al, al
and byte [ebp - 1], al
mov ecx, dword [edi + 0x18]
test ecx, ecx
je 0x30013dc8
call fcn.300042b0
cmp eax, 1
jne 0x30013dc8
mov ecx, dword [edi + 0x24]
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
setne al
jmp 0x30013dd0
mov ecx, dword [edi + 0x24]
mov eax, 1
shl eax, 4
mov edx, ebx
push ecx
mov ecx, dword [edi + 0x3c]
lea esi, [eax + 0xf8]
push esi
call fcn.30015b00
add esp, 8
neg al
sbb al, al
add ebx, esi
and byte [ebp - 1], al
xor ecx, ecx
mov eax, dword [edi + 0x24]
xor edx, edx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ecx
cmp dx, word [eax + 6]
jae 0x30013e76
movzx eax, cx
mov ecx, dword [edi + 0x3c]
imul eax, eax, 0x34
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x18], 0
add eax, dword [edi]
mov dword [ebp - 0x14], eax
cmp ecx, 0xffffffff
je 0x30013e72
test eax, eax
je 0x30013e72
push 0
push 0
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, 0xffffffff
jne 0x30013e42
test eax, eax
jne 0x30013e72
push 0
lea eax, [ebp - 0x18]
push eax
push 0x28
push dword [ebp - 0x14]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x30013e72
mov ecx, dword [ebp - 0xc]
add ebx, 0x28
mov eax, dword [edi + 0x24]
inc ecx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ecx
cmp cx, word [eax + 6]
jb 0x30013e04
jmp 0x30013e76
mov byte [ebp - 1], 0
mov eax, dword [edi + 0x48]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x30013ee7
mov eax, dword [edi + 0x3c]
mov ecx, dword [edi + 0x4c]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x18], 0
cmp eax, 0xffffffff
je 0x30013ed6
test ecx, ecx
je 0x30013ed6
push 0
push 0
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, 0xffffffff
jne 0x30013eb9
test eax, eax
jne 0x30013ed6
mov esi, dword [ebp - 0xc]
lea eax, [ebp - 0x18]
push 0
push eax
push esi
push dword [ebp - 0x14]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
setne al
jmp 0x30013edb
mov esi, dword [ebp - 0xc]
xor al, al
add ebx, esi
neg al
mov dword [ebp - 8], ebx
sbb al, al
and byte [ebp - 1], al
mov eax, dword [edi + 0x24]
xor ecx, ecx
xor edx, edx
mov dword [ebp - 0xc], ecx
cmp dx, word [eax + 6]
jae 0x3001408a
jmp 0x30013f00
movzx eax, cx
imul edx, eax, 0x34
mov dword [ebp - 0x18], eax
mov eax, dword [edi]
mov dword [ebp - 0x10], edx
mov esi, dword [eax + edx + 0x14]
test esi, esi
je 0x30014044
cmp esi, ebx
jbe 0x30013f71
mov ecx, dword [edi + 0x3c]
mov eax, esi
sub eax, ebx
mov dword [ebp - 0x1c], ecx
push 1
push eax
mov dword [ebp - 0x14], eax
call fcn.30164988
add esp, 8
mov dword [ebp - 0x20], eax
test eax, eax
je 0x30014086
mov ecx, dword [ebp - 0x1c]
mov edx, ebx
push eax
push dword [ebp - 0x14]
call fcn.30015b00
push dword [ebp - 0x20]
mov bl, al
call fcn.30164124
add esp, 0xc
test bl, bl
je 0x30014057
mov eax, dword [edi]
mov ebx, esi
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
mov dword [ebp - 8], ebx
mov esi, dword [eax + edx + 0x2c]
mov dword [ebp - 0x14], esi
test esi, esi
je 0x30014044
mov ecx, dword [eax + edx + 0x28]
mov edx, dword [eax + edx + 0x14]
mov eax, dword [edi + 0x3c]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0x20], 0
cmp eax, 0xffffffff
je 0x30014073
test ecx, ecx
je 0x30014073
push 0
push 0
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, 0xffffffff
jne 0x30013fca
test eax, eax
jne 0x30014070
mov esi, dword [ebp - 0x14]
lea eax, [ebp - 0x20]
push 0
push eax
push esi
push dword [ebp - 0x1c]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x30014073
mov eax, dword [edi]
add ebx, esi
mov esi, dword [ebp - 0x10]
mov dword [ebp - 8], ebx
mov byte [ebp - 2], 1
mov ecx, dword [eax + esi + 0x2c]
mov esi, dword [eax + esi + 0x10]
cmp ecx, esi
jae 0x30014041
mov eax, dword [edi + 0x3c]
sub esi, ecx
push 1
push esi
mov dword [ebp - 0x20], eax
call fcn.30164988
add esp, 8
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x3001405c
mov ecx, dword [ebp - 0x20]
mov edx, ebx
push eax
push esi
call fcn.30015b00
push dword [ebp - 0x1c]
mov bl, al
call fcn.30164124
add esp, 0xc
test bl, bl
mov ebx, dword [ebp - 8]
je 0x3001405c
add ebx, esi
mov dword [ebp - 8], ebx
mov ecx, dword [ebp - 0xc]
mov eax, dword [edi + 0x24]
inc ecx
mov dword [ebp - 0xc], ecx
cmp cx, word [eax + 6]
jb 0x30013f00
jmp 0x3001408a
mov ebx, dword [ebp - 8]
jmp 0x30014086
mov eax, dword [ebp - 0x18]
inc eax
push eax
push str.PeParser:_savePeFileToDisk:_Failure_to_write_padding_to_section__d._n
call fcn.3000a0d0
add esp, 8
jmp 0x30014086
mov esi, dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
push esi
inc eax
push eax
push str.PeParser:_savePeFileToDisk:_Failure_to_write_section__d_of_size_0x_x_bytes._n
call fcn.3000a0d0
add esp, 0xc
mov byte [ebp - 1], 0
mov eax, dword [edi + 0x30]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x300140f8
mov eax, dword [edi + 0x2c]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x300140f8
mov eax, dword [edi + 0x3c]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x20], 0
cmp eax, 0xffffffff
je 0x300140ea
push 0
push 0
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, 0xffffffff
jne 0x300140cd
test eax, eax
jne 0x300140ea
mov esi, dword [ebp - 0xc]
lea eax, [ebp - 0x20]
push 0
push eax
push esi
push dword [ebp - 0x1c]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
setne al
jmp 0x300140ef
mov esi, dword [ebp - 0xc]
xor al, al
add ebx, esi
neg al
sbb al, al
and byte [ebp - 1], al
push dword [edi + 0x3c]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [edi + 0x3c]
mov dword [edi + 0xc], ebx
cmp eax, 0xffffffff
je 0x3001411a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x3c], 0xffffffff
cmp byte [ebp - 2], 0
je 0x300141ac
cmp dword [ebp + 8], 0
jne 0x30014219
mov ecx, str.CAPE
call fcn.30003500
mov esi, eax
push str.CapeOutput.bin
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
push 0
push 0x30233b38
push 0x104
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
call esi
test eax, eax
je 0x3001419f
call fcn.30003640
mov ebx, dword [sym.imp.KERNEL32.dll_MoveFileA]
mov edi, eax
push edi
push 0x30233b38
call ebx
test eax, eax
je 0x300141b7
push 0x104
push 0
push 0x30233b38
call fcn.3015cdc0
add esp, 0xc
push 0
push 0x30233b38
push 0x104
push edi
call esi
test eax, eax
jne 0x3001420f
push str.savePeFileToDisk:_There_was_a_problem_obtaining_the_full_file_path
call fcn.3000a0f0
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x30014262
push str.savePeFileToDisk:_Name_clash__trying_to_obtain_new_name...
call fcn.3000a0d0
add esp, 4
call fcn.30003640
mov edi, eax
push edi
push 0x30233b38
call ebx
test eax, eax
je 0x30014225
push 0x104
push 0
push 0x30233b38
call fcn.3015cdc0
add esp, 0xc
push 0
push 0x30233b38
push 0x104
push edi
call esi
test eax, eax
je 0x3001419f
mov ecx, 0x30233b38
call fcn.3000a1f0
mov al, byte [ebp - 1]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push str.savePeFileToDisk:_Failed_twice_to_rename_file
call fcn.3000a0f0
add esp, 4
push 0x30233b38
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x300141ac
push 0x30233b38
push str.savePeFileToDisk:_There_was_a_problem_deleting_the_file:__s
call fcn.3000a0f0
add esp, 8
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push str.savePeFileToDisk:_There_was_a_problem_renaming_the_file
jmp 0x3001422a