Function at 0x30013740
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 0x30013c0c
mov eax, dword [ebp + 8]
test eax, eax
je 0x30013781
mov esi, eax
jmp 0x30013799
mov ecx, str.CAPE
call fcn.30003280
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 0x30013c0c
push dword [edi + 0x18]
xor edx, edx
mov ecx, eax
push 0x40
call fcn.30015560
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 0x30013804
mov eax, dword [edi + 0x1c]
test eax, eax
je 0x30013804
mov ecx, dword [edi + 0x3c]
mov edx, ebx
push eax
push esi
call fcn.30015560
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 0x30013828
call fcn.30003fc0
cmp eax, 1
jne 0x30013828
mov ecx, dword [edi + 0x24]
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
setne al
jmp 0x30013830
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.30015560
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 0x300138d6
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 0x300138d2
test eax, eax
je 0x300138d2
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 0x300138a2
test eax, eax
jne 0x300138d2
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 0x300138d2
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 0x30013864
jmp 0x300138d6
mov byte [ebp - 1], 0
mov eax, dword [edi + 0x48]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x30013947
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 0x30013936
test ecx, ecx
je 0x30013936
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 0x30013919
test eax, eax
jne 0x30013936
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 0x3001393b
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 0x30013aea
jmp 0x30013960
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 0x30013aa4
cmp esi, ebx
jbe 0x300139d1
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.30169fc8
add esp, 8
mov dword [ebp - 0x20], eax
test eax, eax
je 0x30013ae6
mov ecx, dword [ebp - 0x1c]
mov edx, ebx
push eax
push dword [ebp - 0x14]
call fcn.30015560
push dword [ebp - 0x20]
mov bl, al
call fcn.301698c4
add esp, 0xc
test bl, bl
je 0x30013ab7
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 0x30013aa4
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 0x30013ad3
test ecx, ecx
je 0x30013ad3
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 0x30013a2a
test eax, eax
jne 0x30013ad0
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 0x30013ad3
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 0x30013aa1
mov eax, dword [edi + 0x3c]
sub esi, ecx
push 1
push esi
mov dword [ebp - 0x20], eax
call fcn.30169fc8
add esp, 8
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x30013abc
mov ecx, dword [ebp - 0x20]
mov edx, ebx
push eax
push esi
call fcn.30015560
push dword [ebp - 0x1c]
mov bl, al
call fcn.301698c4
add esp, 0xc
test bl, bl
mov ebx, dword [ebp - 8]
je 0x30013abc
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 0x30013960
jmp 0x30013aea
mov ebx, dword [ebp - 8]
jmp 0x30013ae6
mov eax, dword [ebp - 0x18]
inc eax
push eax
push str.PeParser:_savePeFileToDisk:_Failure_to_write_padding_to_section__d._n
call fcn.30009b40
add esp, 8
jmp 0x30013ae6
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.30009b40
add esp, 0xc
mov byte [ebp - 1], 0
mov eax, dword [edi + 0x30]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x30013b58
mov eax, dword [edi + 0x2c]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x30013b58
mov eax, dword [edi + 0x3c]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x20], 0
cmp eax, 0xffffffff
je 0x30013b4a
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 0x30013b2d
test eax, eax
jne 0x30013b4a
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 0x30013b4f
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 0x30013b7a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x3c], 0xffffffff
cmp byte [ebp - 2], 0
je 0x30013c0c
cmp dword [ebp + 8], 0
jne 0x30013c79
mov ecx, str.CAPE
call fcn.30003280
mov esi, eax
push str.CapeOutput.bin
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
push 0
push 0x30239778
push 0x104
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
call esi
test eax, eax
je 0x30013bff
call fcn.300033c0
mov ebx, dword [sym.imp.KERNEL32.dll_MoveFileA]
mov edi, eax
push edi
push 0x30239778
call ebx
test eax, eax
je 0x30013c17
push 0x104
push 0
push 0x30239778
call fcn.30162560
add esp, 0xc
push 0
push 0x30239778
push 0x104
push edi
call esi
test eax, eax
jne 0x30013c6f
push str.savePeFileToDisk:_There_was_a_problem_obtaining_the_full_file_path
call fcn.30009b60
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 0x30013cc2
push str.savePeFileToDisk:_Name_clash__trying_to_obtain_new_name...
call fcn.30009b40
add esp, 4
call fcn.300033c0
mov edi, eax
push edi
push 0x30239778
call ebx
test eax, eax
je 0x30013c85
push 0x104
push 0
push 0x30239778
call fcn.30162560
add esp, 0xc
push 0
push 0x30239778
push 0x104
push edi
call esi
test eax, eax
je 0x30013bff
mov ecx, 0x30239778
call fcn.30009c60
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.30009b60
add esp, 4
push 0x30239778
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x30013c0c
push 0x30239778
push str.savePeFileToDisk:_There_was_a_problem_deleting_the_file:__s
call fcn.30009b60
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 0x30013c8a