Function at 0x401940
Capabilities:
Delete file
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x334
mov eax, dword [0x46ad0c]
mov dword [esp + 0x330], eax
mov eax, dword [esp + 0x338]
push edi
push eax
lea ecx, [esp + 0x18]
push 0x45c28c
push ecx
call fcn.0044b73f
mov edx, dword [esp + 0x34c]
push edx
lea eax, [esp + 0x1b4]
push 0x45d2d0
push eax
call fcn.0044b73f
lea ecx, [esp + 0x2c]
push 0x45d298
push ecx
call fcn.0044b906
mov edi, eax
add esp, 0x20
test edi, edi
jne 0x4019b2
pop edi
mov ecx, dword [esp + 0x330]
call fcn.0044b7c8
add esp, 0x334
ret 8
push ebx
push ebp
push esi
lea edx, [esp + 0x1b0]
push 0x45d190
push edx
call fcn.0044b906
mov esi, eax
mov al, byte [edi + 0xc]
add esp, 8
test al, 0x10
jne 0x401bda
push edi
call fcn.0044ba6c
add esp, 4
cmp eax, 1
jne 0x401bd0
push edi
call fcn.0044ba6c
add esp, 4
test eax, eax
jne 0x401bd0
push edi
call fcn.0044ba6c
add esp, 4
cmp eax, 0x61
jne 0x401bd0
push edi
call fcn.0044ba6c
add esp, 4
test eax, eax
jne 0x401bd0
push esi
push 0xff
call fcn.0044bc5f
push esi
push 0xfe
call fcn.0044bc5f
push esi
push 0x61
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
mov al, byte [edi + 0xc]
add esp, 0x20
test al, 0x10
mov ebp, 1
jne 0x401aeb
test ebp, ebp
push esi
je 0x401a70
push 0x20
xor ebp, ebp
call fcn.0044bc5f
push esi
push ebp
call fcn.0044bc5f
add esp, 0x10
jmp 0x401a97
push 0xd
mov ebp, 1
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
push esi
push 0xa
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
add esp, 0x20
push edi
call fcn.0044ba6c
push edi
mov bl, al
call fcn.0044ba6c
add esp, 8
test eax, eax
jne 0x401ae1
test bl, bl
jle 0x401ae1
cmp bl, 0x61
jge 0x401ae1
push esi
push edi
dec bl
call fcn.0044ba6c
add esp, 4
push eax
call fcn.0044bc5f
add esp, 8
push esi
push edi
call fcn.0044ba6c
add esp, 4
push eax
call fcn.0044bc5f
add esp, 8
test bl, bl
jg 0x401ab0
test byte [edi + 0xc], 0x10
je 0x401a56
push esi
push 0x7a
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
push esi
push 0x7a
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
push esi
push 0x7a
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
push esi
push 0x7a
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
add esp, 0x40
push esi
push 0x20
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
push esi
push 0x16
call fcn.0044bc5f
push esi
push 0x4e
call fcn.0044bc5f
push esi
push 0x3a
call fcn.0044bc5f
push esi
push 0x5f
call fcn.0044bc5f
push esi
push 0x6f
call fcn.0044bc5f
push esi
push 0x8f
call fcn.0044bc5f
add esp, 0x40
push esi
push 0xf6
call fcn.0044bc5f
push esi
push 0x4e
call fcn.0044bc5f
push esi
push 0x6c
call fcn.0044bc5f
push esi
push 0x51
call fcn.0044bc5f
push esi
push 0xf8
call fcn.0044bc5f
push esi
push 0x53
call fcn.0044bc5f
push esi
push 0xd
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
add esp, 0x40
push esi
push 0xa
call fcn.0044bc5f
push esi
push 0
call fcn.0044bc5f
add esp, 0x10
test byte [edi + 0xc], 0x10
je 0x4019d7
push edi
call fcn.0044b859
push esi
call fcn.0044b859
add esp, 8
push 0
push 0x80
push 4
push 0
push 0
push 0xc0000000
lea eax, [esp + 0x1c8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push eax
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
lea esi, [ebx + 0xa]
push esi
call fcn.0044b0d1
push esi
mov ebp, eax
call fcn.0044b0d1
mov dword [esp + 0x1c], eax
mov ecx, esi
mov edx, ecx
shr ecx, 2
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, esi
mov esi, dword [esp + 0x1c]
shr ecx, 2
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x354]
push eax
lea ecx, [esp + 0x2c]
push 0x45c28c
push ecx
call fcn.0044b73f
add esp, 0x14
push 0
push 0x80
push 4
push 0
push 0
push 0xc0000000
lea edx, [esp + 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [esp + 0x10]
push 0
mov edi, eax
lea eax, [esp + 0x1c]
push eax
push ebx
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401cdb
push 0
push 0
push ebx
push esi
push 0xffffffffffffffff
push ebp
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401cc0
sub eax, edx
push 0
lea edx, [esp + 0x20]
push edx
dec eax
push eax
inc esi
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
push edi
call esi
lea ecx, [esp + 0x1b0]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov edx, dword [esp + 0x348]
push str.winsp.mb
push edx
call fcn.0044f6d5
add esp, 4
push eax
call fcn.0044c040
add esp, 8
test eax, eax
je 0x401d78
mov eax, dword [esp + 0x34c]
push 0x45d2c0
push eax
call fcn.0044b906
mov esi, eax
mov al, byte [esi + 0xc]
add esp, 8
test al, 0x10
jne 0x401d6f
lea esp, [esp]
push esi
call fcn.0044ba6c
add esp, 4
cmp eax, 0x3b
jne 0x401d69
push 1
push 0xffffffffffffffff
push esi
call fcn.0044bfeb
push esi
push 0x27
call fcn.0044bc5f
push esi
call fcn.0044bf03
add esp, 0x18
test byte [esi + 0xc], 0x10
je 0x401d40
push esi
call fcn.0044b859
add esp, 4
mov ecx, dword [esp + 0x340]
pop esi
pop ebp
pop ebx
mov eax, 1
pop edi
call fcn.0044b7c8
add esp, 0x334
ret 8