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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47dedd
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x4b5200]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [edi]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x18], ebx
cmp eax, 0xffffffff
je 0x409e6b
test eax, eax
je 0x409e6b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], 0xffffffff
mov eax, dword [ebp + 0xc]
mov dword [edi + 4], eax
test al, 8
je 0x40a03e
xorps xmm0, xmm0
mov dword [ebp - 0x24], 0
xor esi, esi
movq qword [ebp - 0x2c], xmm0
test ebx, ebx
je 0x409e9b
cmp word [ebx], si
je 0x409e9b
inc esi
cmp word [ebx + esi*2], 0
jne 0x409e93
xor ecx, ecx
mov dword [ebp - 0x28], esi
lea eax, [esi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046b90c
add esp, 4
mov dword [ebp - 0x2c], eax
test esi, esi
jle 0x409ee6
mov ecx, eax
sub ebx, eax
mov edx, esi
nop word [eax + eax]
mov ax, word [ebx + ecx]
lea ecx, [ecx + 2]
mov word [ecx - 2], ax
sub edx, 1
jne 0x409ed0
mov ebx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
mov byte [ebp - 0x24], 1
mov word [eax + esi*2], cx
push ecx
push 1
push 1
push ecx
mov dword [ebp - 4], ecx
lea ecx, [ebp - 0x2c]
push 0x49faa8
call fcn.00402380
mov esi, dword [ebp - 0x2c]
test eax, eax
je 0x40a02a
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x409f2e
test esi, esi
je 0x409f29
cmp word [esi], ax
je 0x409f29
inc eax
cmp word [esi + eax*2], 0
jne 0x409f21
mov dword [ebp - 0x28], eax
test eax, eax
setg byte [ebp - 0x24]
test eax, eax
jle 0x409f5d
lea ecx, [eax*2 - 2]
nop dword [eax]
cmp word [esi + ecx], 0x5c
lea edx, [esi + ecx]
jne 0x409f5a
dec eax
xor ebx, ebx
sub ecx, 2
mov dword [ebp - 0x28], eax
mov word [edx], bx
test eax, eax
jne 0x409f40
mov ebx, dword [ebp - 0x18]
push 0
push 1
push 0xffffffffffffffff
push 1
push 0x49faa8
lea ecx, [ebp - 0x2c]
call fcn.00402380
mov esi, dword [ebp - 0x2c]
cmp eax, 2
jle 0x409fb3
lea ecx, [eax - 1]
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x409f9b
test esi, esi
je 0x409f98
cmp word [esi], ax
je 0x409f98
nop dword [eax]
inc eax
cmp word [esi + eax*2], 0
jne 0x409f90
mov dword [ebp - 0x28], eax
cmp eax, ecx
setge byte [ebp - 0x24]
jl 0x409fb6
cmovl ecx, eax
mov eax, ecx
xor ecx, ecx
mov dword [ebp - 0x28], eax
mov word [esi + eax*2], cx
jmp 0x409fb6
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x409fce
test esi, esi
je 0x409fcb
cmp word [esi], ax
je 0x409fcb
inc eax
cmp word [esi + eax*2], 0
jne 0x409fc3
mov dword [ebp - 0x28], eax
cmp eax, 2
jle 0x40a02a
test esi, esi
jne 0x409fee
push 2
call fcn.0046b90c
mov esi, eax
add esp, 4
xor eax, eax
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x28], eax
mov word [esi], ax
mov ecx, esi
mov byte [ebp - 0x24], 1
call fcn.0040bb70
test al, al
jne 0x40a02a
test esi, esi
je 0x40a00a
push esi
call fcn.0046b303
add esp, 4
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0046b2f5
mov esp, ebp
pop ebp
ret 0xc
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x40a03e
push esi
call fcn.0046b303
add esp, 4
mov eax, dword [edi + 4]
mov edx, SysReAllocString
mov esi, eax
mov dword [ebp - 0x18], 0xc0000000
shr esi, 2
mov ecx, eax
not esi
mov dword [ebp - 0x38], 0
and esi, 1
test eax, 3
push 0
cmovne edx, dword [ebp - 0x18]
test al, 2
mov eax, 0
mov dword [ebp - 0x18], 3
sete al
test ecx, 3
push 0
lea eax, [eax*2 + 2]
cmove eax, dword [ebp - 0x18]
push eax
push 0
push esi
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a0af
test eax, eax
je 0x40a0af
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], esi
test esi, esi
jne 0x40a0c0
mov dword [edi], 0xffffffff
jmp 0x40a00a
cmp esi, 0xffffffff
je 0x40a00a
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 0
push eax
push esi
mov dword [ebp - 0x30], 0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40a0ee
xorps xmm0, xmm0
movlpd qword [ebp - 0x34], xmm0
mov ebx, dword [edi + 4]
mov eax, dword [ebp - 0x34]
mov esi, dword [ebp - 0x30]
mov dword [ebp - 0x18], eax
test bl, 0x10
je 0x40a116
test bl, 1
je 0x40a10f
push 0
push esi
push eax
mov ecx, edi
call fcn.0040a830
mov eax, dword [edi]
jmp 0x40a00c
test eax, eax
jne 0x40a1cd
test esi, esi
jne 0x40a1cd
test bl, 0xe0
setne cl
test bl, 3
setne al
test al, cl
je 0x40a10f
and ebx, 0x80
or ebx, 0x100
shr ebx, 7
push ebx
call fcn.0046b90c
mov esi, eax
add esp, 4
mov eax, dword [edi + 4]
test al, al
jns 0x40a162
mov word [esi], 0xbbef
mov byte [esi + 2], 0xbf
jmp 0x40a176
test al, 0x20
je 0x40a16d
mov word [esi], 0xfeff
jmp 0x40a176
test al, 0x40
je 0x40a176
mov word [esi], 0xfffe
push 0
lea eax, [ebp - 0x38]
push eax
push ebx
push esi
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a1bb
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a1a9
test eax, eax
je 0x40a1a9
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], 0xffffffff
mov dword [edi + 4], 0
push esi
xor edi, edi
call fcn.0046b303
add esp, 4
mov eax, edi
jmp 0x40a00c
mov edi, dword [edi]
push esi
call fcn.0046b303
add esp, 4
mov eax, edi
jmp 0x40a00c
test bl, 2
jne 0x40a10f
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x38]
push 0
push eax
push 3
lea eax, [ebp - 0x1c]
mov word [ebp - 0x1c], 0
push eax
push dword [edi]
mov byte [ebp - 0x1a], 0
call ebx
test eax, eax
je 0x40a10f
mov al, byte [ebp - 0x1c]
xor ecx, ecx
cmp al, 0xff
jne 0x40a21f
cmp byte [ebp - 0x1b], 0xfe
jne 0x40a260
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe3f
or eax, 0x20
jmp 0x40a25d
cmp al, 0xfe
jne 0x40a23b
cmp byte [ebp - 0x1b], 0xff
jne 0x40a260
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe5f
or eax, 0x40
jmp 0x40a25d
cmp al, 0xef
jne 0x40a260
cmp byte [ebp - 0x1b], 0xbb
jne 0x40a260
cmp byte [ebp - 0x1a], 0xbf
jne 0x40a260
mov eax, dword [edi + 4]
mov ecx, 3
and eax, 0xfffffe9f
or eax, 0x80
mov dword [edi + 4], eax
mov eax, dword [edi + 4]
test al, 1
je 0x40a30f
test al, 0x60
mov ecx, edi
mov eax, dword [ebp - 0x18]
push 0
je 0x40a2ce
sub eax, 2
sbb esi, 0
push esi
push eax
call fcn.0040a830
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a2ba
test eax, eax
je 0x40a2ba
push 0
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x18], 0xffff
push ecx
push 2
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x30], 0
push ecx
push eax
call ebx
mov eax, 0xffff
cmp ax, word [ebp - 0x18]
jne 0x40a10f
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
mov ecx, edi
call fcn.0040a830
mov eax, dword [edi]
jmp 0x40a00c
sub eax, 1
sbb esi, 0
push esi
push eax
call fcn.0040a830
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a10f
test eax, eax
je 0x40a10f
push 0
lea ecx, [ebp - 0x30]
mov byte [ebp - 0x1d], 0xff
push ecx
push 1
lea ecx, [ebp - 0x1d]
mov dword [ebp - 0x30], 0
push ecx
push eax
call ebx
mov eax, dword [edi]
jmp 0x40a00c
cmp ecx, dword [ebp - 0x38]
je 0x40a10f
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40a10f
test eax, eax
je 0x40a10f
push 0
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [edi]
jmp 0x40a00c