Function at 0x409fb0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x660
mov eax, dword [0x4efca4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push dword [0x4f3994]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x624], ebx
cmp ebx, 0xffffffff
jne 0x40a001
lea eax, [ebx + 0x65]
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00488295
mov esp, ebp
pop ebp
ret
push esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
push 0
push 0
push 0x186a0
push ebx
mov dword [ebp - 0x630], 0
call esi
push 1
push 0
push 0
push ebx
call esi
push 2
push 0
push 0
push ebx
mov edi, eax
call esi
push 0
push 0
push edi
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
push ebx
call edi
cmp esi, 0x249f00
jge 0x40a06f
push 1
push 0
push 0
push ebx
call edi
push 2
push 0
push 0
push ebx
mov esi, eax
call edi
push 0
push 0
push esi
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x40a074
mov edi, 0x249f00
lea eax, [edi + 8]
push 1
push eax
call fcn.0049277a
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x40a6cd
push 0
lea eax, [ebp - 0x644]
mov esi, ebx
push eax
push edi
push ebx
push dword [ebp - 0x624]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a0af
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor eax, eax
test edi, edi
je 0x40a0e7
cmp dword [esi], 0x77777777
jne 0x40a0c7
cmp dword [ebx + eax + 4], 0x12478749
je 0x40a0cf
inc eax
inc esi
cmp eax, edi
jb 0x40a0b5
jmp 0x40a0e7
sub esi, ebx
mov dword [ebp - 0x630], 1
add esi, 0x186a0
mov dword [0x4f3990], esi
push ebx
call fcn.00492790
add esp, 4
cmp dword [ebp - 0x630], 0
je 0x40a6cd
mov ebx, dword [ebp - 0x624]
push 0
push 0
push dword [0x4f3990]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x638]
push 0
push eax
push 0x20
push 0x4f1b48
push ebx
call esi
test eax, eax
jne 0x40a149
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [eax - 0x26]
neg edi
sbb edi, edi
add edi, 0x40000002
jmp 0x40a6d8
mov eax, dword [ebp - 0x638]
cmp eax, 0xffffffff
jne 0x40a15e
mov edi, 0x40000001
jmp 0x40a6d8
cmp eax, 0x20
je 0x40a16d
mov edi, 0x40000002
jmp 0x40a6d8
mov ecx, dword [0x4f1b54]
xor edi, edi
test ecx, ecx
je 0x40a188
mov eax, dword [0x4f3990]
add eax, 0xffffffe0
add eax, ecx
mov dword [0x4f1b54], eax
imul eax, dword [0x4f1b64], 0x104
push 2
add eax, 2
push eax
call fcn.0049277a
add esp, 8
mov dword [ebp - 0x63c], eax
mov dword [0x4f398c], eax
test eax, eax
jne 0x40a1b7
lea edi, [eax + 0x66]
jmp 0x40a6d8
xor ecx, ecx
mov dword [eax], ecx
mov dword [ebp - 0x638], ecx
cmp dword [0x4f1b64], ecx
jle 0x40a6d8
push 0
lea eax, [ebp - 0x648]
mov edi, 0x104
push eax
push 2
lea eax, [ebp - 0x634]
push eax
push ebx
call esi
test eax, eax
je 0x40a131
mov eax, dword [ebp - 0x648]
cmp eax, 0xffffffff
je 0x40a154
cmp eax, 2
jne 0x40a163
mov ax, word [ebp - 0x634]
test ax, ax
je 0x40a6c6
cmp ax, di
jae 0x40a6c6
movzx esi, ax
lea eax, [ebp - 0x64c]
push 0
push eax
add esi, esi
lea eax, [ebp - 0x20c]
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a131
mov eax, dword [ebp - 0x64c]
cmp eax, 0xffffffff
je 0x40a154
cmp eax, esi
jne 0x40a163
movzx eax, word [ebp - 0x634]
add eax, eax
cmp eax, 0x208
jae 0x40a6f2
xor ecx, ecx
lea edx, [ebp - 0x61c]
mov word [ebp + eax - 0x20c], cx
mov ecx, dword [0x4f3988]
sub edx, ecx
nop dword [eax + eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40a290
lea edx, [ebp - 0x20c]
mov esi, edx
nop dword [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40a2b0
lea edi, [ebp - 0x61c]
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40a2c6
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x63c]
lea ecx, [ebp - 0x61c]
mov edx, esi
mov eax, ecx
sub edx, eax
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40a2f2
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40a307
sub ecx, edx
xor eax, eax
sar ecx, 1
lea edx, [ebp - 0x644]
push 4
lea esi, [esi + ecx*2]
mov ecx, ebx
add esi, 2
mov dword [ebp - 0x63c], esi
mov word [esi], ax
call fcn.00409c80
mov edi, eax
add esp, 4
test edi, edi
jne 0x40a6d8
lea ecx, [ebp - 0x61c]
call fcn.00409a50
test eax, eax
jne 0x40a6bf
push eax
push 0x80
push 2
push eax
push eax
push 0xc0000000
lea eax, [ebp - 0x61c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x628], ebx
cmp ebx, 0xffffffff
je 0x40a6b8
lea eax, [ebp - 0x20c]
push 0x4dd760
push eax
call fcn.004a674d
add esp, 8
push 4
test eax, eax
jne 0x40a5c8
mov ecx, dword [ebp - 0x624]
lea edx, [ebp - 0x650]
call fcn.00409c80
mov edi, eax
add esp, 4
mov dword [ebp - 0x62c], edi
test edi, edi
jne 0x40a6af
push 0x8000
call fcn.0049276f
add esp, 4
mov dword [ebp - 0x620], eax
test eax, eax
je 0x40a48f
mov ebx, dword [ebp - 0x650]
test ebx, ebx
je 0x40a478
mov ecx, dword [ebp - 0x624]
mov esi, 0x8000
cmp ebx, esi
mov edx, eax
cmovl esi, ebx
push esi
sub ebx, esi
call fcn.00409c80
mov edi, eax
add esp, 4
mov dword [ebp - 0x62c], edi
test edi, edi
jne 0x40a472
push eax
lea eax, [ebp - 0x654]
push eax
push esi
push dword [ebp - 0x620]
push dword [ebp - 0x628]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a459
mov eax, dword [ebp - 0x620]
cmp dword [ebp - 0x654], esi
jne 0x40a44c
mov dword [ebp - 0x62c], edi
jmp 0x40a3e6
mov edi, 0x40000004
mov dword [ebp - 0x62c], edi
jmp 0x40a478
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [eax - 0x70]
neg edi
sbb edi, edi
add edi, 0x40000004
mov dword [ebp - 0x62c], edi
mov eax, dword [ebp - 0x620]
push eax
call fcn.00492790
mov ebx, dword [ebp - 0x628]
add esp, 4
test edi, edi
jne 0x40a6af
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40a4a0
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jl 0x40a67e
lea eax, [ebp + ecx*2 - 0x214]
push 0x4df410
push eax
call fcn.004a674d
add esp, 8
test eax, eax
jne 0x40a67e
push eax
push eax
push eax
push ebx
call esi
mov ecx, ebx
call fcn.00409d60
push 1
push 0x8000
mov dword [ebp - 0x630], eax
xor esi, esi
call fcn.0049277a
mov ecx, eax
add esp, 8
mov eax, dword [ebp - 0x630]
mov dword [ebp - 0x620], ecx
test eax, eax
je 0x40a648
nop
mov ebx, 0x8000
cmp eax, ebx
push 0
cmovb ebx, eax
lea eax, [ebp - 0x658]
push eax
push ebx
push ecx
push dword [ebp - 0x628]
mov dword [ebp - 0x660], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a636
mov eax, dword [ebp - 0x658]
cmp eax, 0xffffffff
je 0x40a63c
cmp eax, ebx
jne 0x40a63c
mov edx, dword [ebp - 0x620]
mov ecx, ebx
shr ecx, 2
test ecx, ecx
je 0x40a577
mov eax, esi
shr eax, 0x1f
lea esi, [eax + esi*2]
add esi, dword [edx]
add edx, 4
sub ecx, 1
jne 0x40a565
mov eax, ebx
mov ebx, 0
and eax, 3
mov dword [ebp - 0x65c], eax
jbe 0x40a5a9
mov edi, eax
nop dword [eax + eax]
movzx ecx, byte [ebx + edx]
mov eax, esi
shr eax, 0x1f
inc ebx
add ecx, eax
lea esi, [ecx + esi*2]
cmp ebx, edi
jb 0x40a590
mov edi, dword [ebp - 0x62c]
mov eax, dword [ebp - 0x630]
sub eax, dword [ebp - 0x660]
mov ecx, dword [ebp - 0x620]
mov dword [ebp - 0x630], eax
je 0x40a642
jmp 0x40a510
mov esi, dword [ebp - 0x624]
lea edx, [ebp - 0x640]
mov ecx, esi
call fcn.00409c80
mov edi, eax
add esp, 4
test edi, edi
jne 0x40a6af
push 1
push eax
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 0x640]
mov esi, eax
push dword [ebp - 0x624]
push ebx
call dword [sym.imp.MMFS2.dll_Ordinal_766]
mov edi, eax
mov dword [ebp - 0x62c], edi
test edi, edi
jne 0x40a6af
push eax
push eax
mov eax, dword [ebp - 0x640]
add eax, esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push dword [ebp - 0x624]
call esi
jmp 0x40a495
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x620]
mov ebx, dword [ebp - 0x628]
push 0x8000
push 0
push ecx
call fcn.00489e90
push dword [ebp - 0x620]
call fcn.00492790
add esp, 0x10
mov eax, 0x65
cmp dword [ebp - 0x644], esi
cmovne edi, eax
push 2
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0x624]
test edi, edi
jne 0x40a6d8
mov eax, dword [ebp - 0x638]
inc eax
mov dword [ebp - 0x638], eax
cmp eax, dword [0x4f1b64]
jge 0x40a6d8
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40a1cd
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40a6d2
mov edi, 0x68
jmp 0x40a6d2
mov edi, 0x67
jmp 0x40a6d8
mov edi, 0x65
jmp 0x40a6d8
mov edi, 0x65
mov ebx, dword [ebp - 0x624]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00488295
mov esp, ebp
pop ebp
ret
call fcn.00488807
int3