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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x49ca3d
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x4d7200]
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 0x40780b
test eax, eax
je 0x40780b
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 0x4079de
xorps xmm0, xmm0
mov dword [ebp - 0x24], 0
xor esi, esi
movq qword [ebp - 0x2c], xmm0
test ebx, ebx
je 0x40783b
cmp word [ebx], si
je 0x40783b
inc esi
cmp word [ebx + esi*2], 0
jne 0x407833
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.0048a28e
add esp, 4
mov dword [ebp - 0x2c], eax
test esi, esi
jle 0x407886
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 0x407870
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 0x4bfbc8
call fcn.004025a0
mov esi, dword [ebp - 0x2c]
test eax, eax
je 0x4079ca
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x4078ce
test esi, esi
je 0x4078c9
cmp word [esi], ax
je 0x4078c9
inc eax
cmp word [esi + eax*2], 0
jne 0x4078c1
mov dword [ebp - 0x28], eax
test eax, eax
setg byte [ebp - 0x24]
test eax, eax
jle 0x4078fd
lea ecx, [eax*2 - 2]
nop dword [eax]
cmp word [esi + ecx], 0x5c
lea edx, [esi + ecx]
jne 0x4078fa
dec eax
xor ebx, ebx
sub ecx, 2
mov dword [ebp - 0x28], eax
mov word [edx], bx
test eax, eax
jne 0x4078e0
mov ebx, dword [ebp - 0x18]
push 0
push 1
push 0xffffffffffffffff
push 1
push 0x4bfbc8
lea ecx, [ebp - 0x2c]
call fcn.004025a0
mov esi, dword [ebp - 0x2c]
cmp eax, 2
jle 0x407953
lea ecx, [eax - 1]
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x40793b
test esi, esi
je 0x407938
cmp word [esi], ax
je 0x407938
nop dword [eax]
inc eax
cmp word [esi + eax*2], 0
jne 0x407930
mov dword [ebp - 0x28], eax
cmp eax, ecx
setge byte [ebp - 0x24]
jl 0x407956
cmovl ecx, eax
mov eax, ecx
xor ecx, ecx
mov dword [ebp - 0x28], eax
mov word [esi + eax*2], cx
jmp 0x407956
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x40796e
test esi, esi
je 0x40796b
cmp word [esi], ax
je 0x40796b
inc eax
cmp word [esi + eax*2], 0
jne 0x407963
mov dword [ebp - 0x28], eax
cmp eax, 2
jle 0x4079ca
test esi, esi
jne 0x40798e
push 2
call fcn.0048a28e
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.004088c0
test al, al
jne 0x4079ca
test esi, esi
je 0x4079aa
push esi
call fcn.00489ed3
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.00489ec5
mov esp, ebp
pop ebp
ret 0xc
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x4079de
push esi
call fcn.00489ed3
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 0x407a4f
test eax, eax
je 0x407a4f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], esi
test esi, esi
jne 0x407a60
mov dword [edi], 0xffffffff
jmp 0x4079aa
cmp esi, 0xffffffff
je 0x4079aa
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 0x407a8e
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 0x407ab6
test bl, 1
je 0x407aaf
push 0
push esi
push eax
mov ecx, edi
call fcn.00407f30
mov eax, dword [edi]
jmp 0x4079ac
test eax, eax
jne 0x407b6d
test esi, esi
jne 0x407b6d
test bl, 0xe0
setne cl
test bl, 3
setne al
test al, cl
je 0x407aaf
and ebx, 0x80
or ebx, 0x100
shr ebx, 7
push ebx
call fcn.0048a28e
mov esi, eax
add esp, 4
mov eax, dword [edi + 4]
test al, al
jns 0x407b02
mov word [esi], 0xbbef
mov byte [esi + 2], 0xbf
jmp 0x407b16
test al, 0x20
je 0x407b0d
mov word [esi], 0xfeff
jmp 0x407b16
test al, 0x40
je 0x407b16
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 0x407b5b
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x407b49
test eax, eax
je 0x407b49
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.00489ed3
add esp, 4
mov eax, edi
jmp 0x4079ac
mov edi, dword [edi]
push esi
call fcn.00489ed3
add esp, 4
mov eax, edi
jmp 0x4079ac
test bl, 2
jne 0x407aaf
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 0x407aaf
mov al, byte [ebp - 0x1c]
xor ecx, ecx
cmp al, 0xff
jne 0x407bbf
cmp byte [ebp - 0x1b], 0xfe
jne 0x407c00
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe3f
or eax, 0x20
jmp 0x407bfd
cmp al, 0xfe
jne 0x407bdb
cmp byte [ebp - 0x1b], 0xff
jne 0x407c00
mov eax, dword [edi + 4]
mov ecx, 2
and eax, 0xfffffe5f
or eax, 0x40
jmp 0x407bfd
cmp al, 0xef
jne 0x407c00
cmp byte [ebp - 0x1b], 0xbb
jne 0x407c00
cmp byte [ebp - 0x1a], 0xbf
jne 0x407c00
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 0x407caf
test al, 0x60
mov ecx, edi
mov eax, dword [ebp - 0x18]
push 0
je 0x407c6e
sub eax, 2
sbb esi, 0
push esi
push eax
call fcn.00407f30
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x407c5a
test eax, eax
je 0x407c5a
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 0x407aaf
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
mov ecx, edi
call fcn.00407f30
mov eax, dword [edi]
jmp 0x4079ac
sub eax, 1
sbb esi, 0
push esi
push eax
call fcn.00407f30
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x407aaf
test eax, eax
je 0x407aaf
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 0x4079ac
cmp ecx, dword [ebp - 0x38]
je 0x407aaf
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x407aaf
test eax, eax
je 0x407aaf
push 0
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [edi]
jmp 0x4079ac