Function at 0x10005140
Capabilities:
Delete file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
mov eax, dword [0x10139d00]
xor eax, esp
mov dword [esp + 0x18], eax
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push edi
xor eax, eax
push eax
push 0x80
push 3
push eax
push 1
push SysReAllocString
mov edi, edx
push ecx
mov dword [esp + 0x34], edi
mov byte [esp + 0x38], 0
mov dword [esp + 0x39], eax
mov word [esp + 0x3d], ax
mov byte [esp + 0x3f], al
mov byte [esp + 0x2b], al
call esi
mov ebx, eax
cmp ebx, 0xffffffff
je 0x100053c3
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push edi
call esi
mov edi, eax
cmp edi, 0xffffffff
je 0x100053bc
push 0
push 0
push str.btc
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [esp + 0x14]
push eax
push 8
lea ecx, [esp + 0x28]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x10], 4
jbe 0x100053a3
lea ecx, [esp + 0x1c]
call fcn.1001fae0
push str.00__
mov edx, ecx
push edx
call fcn.1006a908
lea ecx, [esp + 0x1c]
call fcn.1001fae0
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x14], 0
cmp esi, 4
ja 0x1000524c
mov eax, dword [esp + 0x10]
lea ecx, [eax - 4]
cmp eax, ecx
ja 0x1000524c
push 0
lea edx, [esp + 0x18]
push edx
push esi
lea eax, [esp + 0x2c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x1000539e
push 0
lea ecx, [esp + 0x18]
push ecx
push 4
lea edx, [esp + 0x2c]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esi, dword [esp + 0x14]
je 0x1000539e
jmp 0x10005270
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
push eax
cmp esi, 8
jbe 0x100052a0
lea eax, [esp + 0x14]
push eax
push 8
lea ecx, [esp + 0x28]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x10], 8
jne 0x100053a3
jmp 0x100052c1
lea edx, [esp + 0x14]
push edx
push 8
lea eax, [esp + 0x28]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x10], esi
jb 0x100053a3
mov dword [esp + 0x10], esi
mov eax, dword [esp + 0x1c]
mov ecx, eax
and ecx, 0xff00
mov edx, eax
shr eax, 8
shl edx, 0x10
or ecx, edx
shl ecx, 8
and eax, 0xff00
or ecx, eax
movzx eax, byte [esp + 0x1f]
or ecx, eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x1c], ecx
mov ecx, eax
mov edx, eax
shl ecx, 0x10
and edx, 0xff00
or ecx, edx
shr eax, 8
shl ecx, 8
and eax, 0xff00
or ecx, eax
movzx eax, byte [esp + 0x23]
or ecx, eax
mov dword [esp + 0x20], ecx
push str.00__
lea ecx, [esp + 0x20]
push ecx
call fcn.1006a908
mov eax, dword [esp + 0x1c]
mov edx, eax
mov ecx, eax
shl ecx, 0x10
and edx, 0xff00
or edx, ecx
shr eax, 8
and eax, 0xff00
shl edx, 8
or edx, eax
movzx eax, byte [esp + 0x1f]
or edx, eax
mov eax, dword [esp + 0x20]
mov ecx, eax
mov dword [esp + 0x1c], edx
mov edx, eax
shl ecx, 0x10
and edx, 0xff00
or ecx, edx
mov edx, dword [esp + 0x10]
shr eax, 8
shl ecx, 8
and eax, 0xff00
or ecx, eax
movzx eax, byte [esp + 0x23]
or ecx, eax
push 0
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x18]
push ecx
push edx
lea eax, [esp + 0x28]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esi, dword [esp + 0x14]
jne 0x10005270
mov byte [esp + 0xf], 1
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [esp + 0xf], 0
jne 0x100053bc
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x24]
mov al, byte [esp + 0xf]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.100d0738
mov esp, ebp
pop ebp
ret