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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov ecx, dword [ebp + 0xc]
sub esp, 0x2c
push ebx
lea eax, [ecx - 1]
push esi
push edi
cmp eax, 0x1ff
ja 0x46c33e
mov eax, dword [ebp + 0x10]
dec eax
cmp eax, 0x7ffe
ja 0x46c33e
imul esi, ecx, 0x53
add esi, dword [0x568fb8]
cmp dword [esi - 0x53], 0xffffffff
jne 0x46c33e
mov ecx, dword [ebp + 8]
mov dword [esp + 0x30], 0
test ecx, ecx
je 0x46bf93
mov eax, dword [ecx - 4]
cdq
sub eax, edx
sar eax, 1
jmp 0x46bf95
xor eax, eax
lea edx, [esp + 0x30]
push edx
mov edx, eax
call fcn.0053f2ac
mov ecx, dword [esp + 0x30]
mov edi, eax
mov eax, dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [esp + 0x14], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], ecx
test edi, edi
js 0x46c29f
mov edi, dword [ebp + 0x1c]
mov edx, dword [ebp + 0x28]
mov ebx, dword [ebp + 0x14]
push 0
push 0x80
push edi
push 0
push dword [ebp + 0x18]
movzx eax, dx
push ebx
shr edx, 0x1f
push ecx
mov dword [esp + 0x4c], eax
mov dword [esp + 0x48], edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, eax
cmp ecx, 0xffffffff
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp + 0x20]
sete al
mov dword [esp + 0x20], ecx
jne 0x46c071
test cl, 1
je 0x46c071
cmp ebx, 0xc0000000
jne 0x46c071
push 0
push 0x80
push edi
push 0
push dword [ebp + 0x18]
push 0x40000000
push dword [esp + 0x3c]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, eax
mov ebx, 0x40000000
cmp ecx, 0xffffffff
mov dword [esp + 0x10], ecx
sete al
jne 0x46c071
push 0
push 0x80
push edi
push 0
push dword [ebp + 0x18]
push SysReAllocStringLen
push dword [esp + 0x3c]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov ebx, SysReAllocStringLen
cmp edi, 0xffffffff
mov dword [esp + 0x10], edi
sete al
jmp 0x46c075
mov edi, dword [esp + 0x10]
test al, al
je 0x46c083
mov edi, 0x80004005
jmp 0x46c29f
mov ecx, dword [ebp + 0x24]
mov edx, dword [ebp + 0x10]
mov dword [esp + 0x18], ecx
cmp ecx, 1
jne 0x46c09f
cmp edx, 0x100
jge 0x46c09f
mov edx, 0x1000
mov eax, dword [esp + 0x20]
mov dword [esi - 0x53], edi
mov edi, dword [esp + 0x30]
mov dword [esi - 0x4b], eax
mov eax, dword [0x568fa0]
mov dword [esi - 0x4f], 0
mov dword [esi - 0x47], edx
mov byte [esi - 0x2b], cl
mov dword [esi - 0x33], 0
mov dword [esi - 0x24], 0xffffffff
mov dword [esi - 0x20], 0xffffffff
cmp edi, 0x4b0
je 0x46c0e1
mov eax, dword [0x589c1c]
test byte [esp + 0x20], 4
mov dword [esi - 0x18], eax
jne 0x46c103
test edx, edx
je 0x46c10a
push edx
push 8
call dword [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [esp + 0x18]
jmp 0x46c10c
mov dword [esi - 0x47], 1
xor eax, eax
mov dword [esi - 0x43], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
cmp ecx, 2
je 0x46c150
mov byte [esi - 0x2a], 0
cmp ecx, 1
jne 0x46c154
lea ecx, [esp + 0x30]
mov dword [esp + 0x30], 0
push ecx
push dword [esp + 0x14]
mov dword [esp + 0x3c], 0
call eax
mov eax, dword [esp + 0x30]
or eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x18]
mov eax, dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
jne 0x46c154
mov byte [esi - 0x2a], 1
cmp byte [esp + 0x2c], 0
mov dword [esi - 0x3f], 0
mov dword [esi - 0x3b], 0
mov dword [esi - 0x28], edi
mov dword [esi - 0x2f], 0
mov dword [esi - 0x1c], 0
mov byte [esi - 0x29], 0
je 0x46c283
mov dword [esp + 0x30], 0
mov dword [esp + 0x2c], 0
cmp edi, 0xfde9
jne 0x46c1a1
mov edi, 0x5c3ac4
jmp 0x46c1c8
cmp edi, 0x4b0
jne 0x46c1b7
mov edi, 0x5c3ac0
mov dword [esi - 0x1c], 2
jmp 0x46c1cf
cmp edi, 0xfde8
jne 0x46c2f4
mov edi, 0x5c3abc
mov dword [esi - 0x1c], 3
cmp ecx, 8
jne 0x46c1fe
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], 0
push ecx
push dword [esi - 0x53]
mov dword [esp + 0x24], 0
call eax
mov eax, dword [esp + 0x18]
or eax, dword [esp + 0x1c]
je 0x46c2c8
jmp 0x46c23e
cmp ecx, 1
je 0x46c245
cmp ecx, 2
je 0x46c2c8
cmp ecx, 0x20
je 0x46c216
cmp ecx, 4
jne 0x46c283
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], 0
push ecx
push dword [esi - 0x53]
mov dword [esp + 0x24], 0
call eax
mov eax, dword [esp + 0x18]
or eax, dword [esp + 0x1c]
je 0x46c2c0
shr ebx, 0x1f
test bl, bl
je 0x46c283
push 0
lea eax, [esp + 0x30]
push eax
push dword [esi - 0x1c]
lea eax, [esp + 0x3c]
push eax
push dword [esi - 0x53]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esi - 0x1c]
cmp dword [esp + 0x2c], eax
jne 0x46c2ed
push eax
lea eax, [esp + 0x34]
push edi
push eax
call fcn.005606cd
add esp, 0xc
test eax, eax
jne 0x46c2ed
mov eax, dword [esi - 0x1c]
mov dword [esi - 0x4f], eax
test byte [esp + 0x20], 2
je 0x46c29d
push 2
push 0
push 0
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esi - 0x4f], eax
xor edi, edi
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
test eax, eax
je 0x46c2b5
push eax
push 0
call dword [esp + 0x30]
push eax
call ebx
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
test ebx, 0x40000000
je 0x46c283
push 0
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
push dword [esi - 0x1c]
push edi
push dword [esi - 0x53]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esi - 0x1c]
cmp dword [esp + 0x18], eax
je 0x46c280
mov edi, 0x80004005
jmp 0x46c29f
mov eax, dword [esi - 0x53]
cmp eax, 0xffffffff
je 0x46c330
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi - 0x43]
mov dword [esi - 0x53], 0xffffffff
test eax, eax
je 0x46c330
push eax
push 0
call dword [esp + 0x30]
mov ebx, dword [esp + 0x1c]
push eax
call ebx
mov dword [esi - 0x43], 0
mov edi, 0x80004005
jmp 0x46c2a3
mov ebx, dword [esp + 0x14]
mov edi, 0x80004005
jmp 0x46c2a3
pop edi
pop esi
mov eax, 0x80004005
pop ebx
mov esp, ebp
pop ebp
ret 0x24