Function at 0x4058c0
Capabilities:
Delete file
Get common file path
Get file size
Move file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x124
mov eax, dword [0x47c554]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov byte [ebp - 0x10d], dl
mov dword [ebp - 0x118], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x120], ecx
push edi
mov dword [esi + 0x238], 0xffffffff
test dl, dl
jne 0x405951
lea eax, [ebp - 0x10c]
push eax
push 0x105
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea edi, [esi + 0x12d]
push edi
push 0
push 0x46ab78
lea eax, [ebp - 0x10c]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
push 0
push 0x80
push 3
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esi + 0x238], eax
xor edi, edi
jmp 0x405986
push 0
push 0x80
push 3
push 0
push 3
push closesocket
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
lea ecx, [ebp - 0x11c]
mov dword [esi + 0x238], eax
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
sub edi, dword [ebp - 0x11c]
cmp dword [esi + 0x238], 0xffffffff
je 0x405c44
mov eax, dword [esi + 0x10]
mov dword [esi + 4], 0
mov word [esi + 0x23d], 0
mov dword [esi + 0x234], 0xfffffffe
mov dword [eax], 0xfffffffe
mov eax, dword [esi + 0x10]
push ebx
add eax, 4
mov dword [ebp - 0x114], 0
push 0x105
push eax
call fcn.0043f2f3
mov eax, dword [esi + 0x10]
add esp, 0xc
mov bl, byte [ebp - 0x10d]
mov byte [eax + 0x109], bl
or dword [esi], 0x2010
mov dword [esi + 0xc], 0x10c
mov eax, dword [esi + 0x18]
or dword [esi], 2
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push dword [0xd9a768]
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esi]
test cl, 4
jne 0x405b30
test eax, eax
jne 0x405b30
mov eax, dword [esi + 0x234]
cmp bl, 1
jne 0x405af2
cmp eax, 0xfffffffe
jne 0x405a4a
mov eax, dword [esi + 0x10]
mov eax, dword [eax]
mov dword [esi + 0x234], eax
cmp eax, 0xfffffffe
je 0x405b0a
mov ebx, dword [ebp - 0x114]
cmp ebx, edi
jb 0x405a86
test edi, edi
je 0x405a86
mov eax, dword [esi + 0x238]
cmp eax, 0xffffffff
je 0x405a6a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov bl, byte [ebp - 0x10d]
mov dword [esi + 0x238], 0xffffffff
mov byte [esi + 0x23d], 1
jmp 0x405b0f
mov ecx, dword [esi + 0x10]
test edi, edi
je 0x405ab9
lea eax, [ecx + 0x10]
mov dword [ecx + 0xc], eax
mov ecx, dword [esi + 0x10]
push 0
lea eax, [ecx + 8]
push eax
push dword [0xd9a76c]
push dword [ecx + 0xc]
push dword [esi + 0x238]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esi + 0x10]
add ebx, dword [eax + 8]
jmp 0x405ac7
mov edi, 1
mov dword [ecx + 8], 0
mov ebx, edi
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x114], ebx
cmp dword [eax + 8], 0
je 0x405ada
cmp ebx, edi
jb 0x405ade
mov byte [eax + 4], 1
mov eax, dword [esi + 0x10]
mov bl, byte [ebp - 0x10d]
mov eax, dword [eax + 8]
add eax, 0x1c
mov dword [esi + 0xc], eax
jmp 0x405b0f
mov edx, dword [esi + 0x10]
cmp eax, 0xfffffffe
jne 0x405b71
mov eax, dword [edx]
mov edi, dword [edx + 4]
mov dword [esi + 0x234], eax
cmp eax, 0xfffffffe
jne 0x405b0f
or ecx, 4
mov dword [esi], ecx
mov edx, dword [ebp - 0x114]
mov ecx, dword [ebp - 0x120]
test ecx, ecx
je 0x405b30
test edi, edi
je 0x405b30
imul eax, edx, 0x64
xor edx, edx
div edi
push eax
call ecx
add esp, 4
cmp byte [esi + 0x23d], 0
jne 0x405b55
test byte [esi], 4
jne 0x405c1e
push 0
push dword [esi + 0x1c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x4059f1
test byte [esi], 4
jne 0x405c1e
pop edi
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043b572
mov esp, ebp
pop ebp
ret
mov al, byte [edx]
lea ecx, [ebp - 0x124]
mov byte [esi + 0x23d], al
lea eax, [edx + 0xc]
mov dword [edx + 8], eax
mov eax, dword [esi + 0x10]
push 0
push ecx
push dword [eax + 4]
push dword [eax + 8]
push dword [esi + 0x238]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esi + 0x10]
mov edx, dword [ebp - 0x114]
mov eax, dword [esi + 0x234]
add edx, dword [ecx + 4]
mov dword [ecx], eax
cmp byte [esi + 0x23d], 1
mov dword [ebp - 0x114], edx
jne 0x405c12
mov eax, dword [esi + 0x238]
cmp eax, 0xffffffff
je 0x405bd2
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x118]
mov dword [esi + 0x238], 0xffffffff
call fcn.004061c0
push 0xb
push dword [ebp - 0x118]
lea eax, [esi + 0x12d]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
mov edx, dword [ebp - 0x114]
test eax, eax
jne 0x405b15
or dword [esi], 4
jmp 0x405b15
mov dword [esi + 0xc], 0x1c
jmp 0x405b15
xor bh, bh
test bl, bl
jne 0x405c31
add esi, 0x12d
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
pop edi
pop esi
mov al, bh
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043b572
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor al, al
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0043b572
mov esp, ebp
pop ebp
ret