Function at 0x30013710
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 0x30013bdc
mov eax, dword [ebp + 8]
test eax, eax
je 0x30013751
mov esi, eax
jmp 0x30013769
mov ecx, str.CAPE
call fcn.30003370
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 0x30013bdc
push dword [edi + 0x18]
xor edx, edx
mov ecx, eax
push 0x40
call fcn.30015530
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 0x300137d4
mov eax, dword [edi + 0x1c]
test eax, eax
je 0x300137d4
mov ecx, dword [edi + 0x3c]
mov edx, ebx
push eax
push esi
call fcn.30015530
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 0x300137f8
call fcn.30003f40
cmp eax, 1
jne 0x300137f8
mov ecx, dword [edi + 0x24]
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
setne al
jmp 0x30013800
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.30015530
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 0x300138a6
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 0x300138a2
test eax, eax
je 0x300138a2
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 0x30013872
test eax, eax
jne 0x300138a2
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 0x300138a2
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 0x30013834
jmp 0x300138a6
mov byte [ebp - 1], 0
mov eax, dword [edi + 0x48]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x30013917
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 0x30013906
test ecx, ecx
je 0x30013906
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 0x300138e9
test eax, eax
jne 0x30013906
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 0x3001390b
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 0x30013aba
jmp 0x30013930
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 0x30013a74
cmp esi, ebx
jbe 0x300139a1
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.30168968
add esp, 8
mov dword [ebp - 0x20], eax
test eax, eax
je 0x30013ab6
mov ecx, dword [ebp - 0x1c]
mov edx, ebx
push eax
push dword [ebp - 0x14]
call fcn.30015530
push dword [ebp - 0x20]
mov bl, al
call fcn.30168264
add esp, 0xc
test bl, bl
je 0x30013a87
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 0x30013a74
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 0x30013aa3
test ecx, ecx
je 0x30013aa3
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 0x300139fa
test eax, eax
jne 0x30013aa0
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 0x30013aa3
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 0x30013a71
mov eax, dword [edi + 0x3c]
sub esi, ecx
push 1
push esi
mov dword [ebp - 0x20], eax
call fcn.30168968
add esp, 8
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x30013a8c
mov ecx, dword [ebp - 0x20]
mov edx, ebx
push eax
push esi
call fcn.30015530
push dword [ebp - 0x1c]
mov bl, al
call fcn.30168264
add esp, 0xc
test bl, bl
mov ebx, dword [ebp - 8]
je 0x30013a8c
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 0x30013930
jmp 0x30013aba
mov ebx, dword [ebp - 8]
jmp 0x30013ab6
mov eax, dword [ebp - 0x18]
inc eax
push eax
push str.PeParser:_savePeFileToDisk:_Failure_to_write_padding_to_section__d._n
call fcn.30009b00
add esp, 8
jmp 0x30013ab6
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.30009b00
add esp, 0xc
mov byte [ebp - 1], 0
mov eax, dword [edi + 0x30]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x30013b28
mov eax, dword [edi + 0x2c]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x30013b28
mov eax, dword [edi + 0x3c]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x20], 0
cmp eax, 0xffffffff
je 0x30013b1a
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 0x30013afd
test eax, eax
jne 0x30013b1a
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 0x30013b1f
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 0x30013b4a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x3c], 0xffffffff
cmp byte [ebp - 2], 0
je 0x30013bdc
cmp dword [ebp + 8], 0
jne 0x30013c49
mov ecx, str.CAPE
call fcn.30003370
mov esi, eax
push str.CapeOutput.bin
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
push 0
push 0x302386d8
push 0x104
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
call esi
test eax, eax
je 0x30013bcf
call fcn.300034b0
mov ebx, dword [sym.imp.KERNEL32.dll_MoveFileA]
mov edi, eax
push edi
push 0x302386d8
call ebx
test eax, eax
je 0x30013be7
push 0x104
push 0
push 0x302386d8
call fcn.30160f00
add esp, 0xc
push 0
push 0x302386d8
push 0x104
push edi
call esi
test eax, eax
jne 0x30013c3f
push str.savePeFileToDisk:_There_was_a_problem_obtaining_the_full_file_path
call fcn.30009b20
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 0x30013c92
push str.savePeFileToDisk:_Name_clash__trying_to_obtain_new_name...
call fcn.30009b00
add esp, 4
call fcn.300034b0
mov edi, eax
push edi
push 0x302386d8
call ebx
test eax, eax
je 0x30013c55
push 0x104
push 0
push 0x302386d8
call fcn.30160f00
add esp, 0xc
push 0
push 0x302386d8
push 0x104
push edi
call esi
test eax, eax
je 0x30013bcf
mov ecx, 0x302386d8
call fcn.30009c20
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.30009b20
add esp, 4
push 0x302386d8
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x30013bdc
push 0x302386d8
push str.savePeFileToDisk:_There_was_a_problem_deleting_the_file:__s
call fcn.30009b20
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 0x30013c5a