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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x67c
mov eax, dword [0x4a8014]
xor eax, esp
mov dword [esp + 0x678], eax
push ebx
push esi
push edi
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push dword [0x4ab154]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [esp + 0x10], edi
cmp edi, 0xffffffff
jne 0x408dde
lea eax, [edi + 0x65]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x678]
xor ecx, esp
call fcn.0046d741
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0x186a0
push edi
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
lea eax, [esp + 0x48]
push 1
xorps xmm0, xmm0
push eax
movlpd qword [esp + 0x28], xmm0
push dword [esp + 0x2c]
movlpd qword [esp + 0x54], xmm0
push dword [esp + 0x2c]
push edi
call esi
test eax, eax
je 0x408e33
mov ebx, dword [esp + 0x48]
mov dword [esp + 0x14], ebx
mov ebx, dword [esp + 0x4c]
mov dword [esp + 0x1c], ebx
jmp 0x408e4c
xorps xmm0, xmm0
movlpd qword [esp + 0x20], xmm0
mov eax, dword [esp + 0x24]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x14], eax
push 2
xorps xmm0, xmm0
lea eax, [esp + 0x44]
push eax
movlpd qword [esp + 0x28], xmm0
push dword [esp + 0x2c]
movlpd qword [esp + 0x4c], xmm0
push dword [esp + 0x2c]
push edi
call esi
test eax, eax
je 0x408e7b
mov edi, dword [esp + 0x40]
mov ebx, dword [esp + 0x44]
jmp 0x408e83
mov ebx, dword [esp + 0x24]
mov edi, dword [esp + 0x20]
push 0
lea eax, [esp + 0x64]
xorps xmm0, xmm0
push eax
push dword [esp + 0x24]
movlpd qword [esp + 0x6c], xmm0
push dword [esp + 0x20]
push dword [esp + 0x20]
call esi
test ebx, ebx
ja 0x408eaf
jb 0x408eb4
cmp edi, 0x249f00
jb 0x408eb4
mov edi, 0x249f00
lea eax, [edi + 8]
push 1
push eax
call fcn.0047122f
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x40948a
push 0
lea eax, [esp + 0x24]
mov esi, ebx
push eax
push edi
push ebx
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x408eeb
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor eax, eax
test edi, edi
je 0x408f21
cmp dword [esi], 0x77777777
jne 0x408f03
cmp dword [ebx + eax + 4], 0x12478749
je 0x408f0b
inc eax
inc esi
cmp eax, edi
jb 0x408ef1
jmp 0x408f21
sub esi, ebx
mov dword [esp + 0xc], 1
add esi, 0x186a0
mov dword [0x4ab150], esi
push ebx
call fcn.00471245
add esp, 4
cmp dword [esp + 0xc], 0
je 0x40948a
mov ebx, dword [esp + 0x10]
push 0
push 0
push dword [0x4ab150]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esp + 0x30]
push 0
push eax
push 0x20
push 0x4a9d78
push ebx
call esi
test eax, eax
jne 0x408f7d
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [eax - 0x26]
neg edi
sbb edi, edi
add edi, 0x40000002
jmp 0x409493
mov eax, dword [esp + 0x30]
cmp eax, 0xffffffff
jne 0x408f90
mov edi, 0x40000001
jmp 0x409493
cmp eax, 0x20
je 0x408f9f
mov edi, 0x40000002
jmp 0x409493
mov ecx, dword [0x4a9d84]
xor edi, edi
test ecx, ecx
je 0x408fba
mov eax, dword [0x4ab150]
add eax, 0xffffffe0
add eax, ecx
mov dword [0x4a9d84], eax
imul eax, dword [0x4a9d94], 0x104
push 2
add eax, 2
push eax
call fcn.0047122f
add esp, 8
mov dword [esp + 0x34], eax
mov dword [0x4ab14c], eax
test eax, eax
jne 0x408fe7
lea edi, [eax + 0x66]
jmp 0x409493
xor ecx, ecx
mov dword [eax], ecx
mov dword [esp + 0x30], ecx
cmp dword [0x4a9d94], ecx
jle 0x409493
push 0
lea eax, [esp + 0x58]
mov edi, 0x104
push eax
push 2
lea eax, [esp + 0x38]
push eax
push ebx
call esi
test eax, eax
je 0x408f65
mov eax, dword [esp + 0x54]
cmp eax, 0xffffffff
je 0x408f86
cmp eax, 2
jne 0x408f95
mov ax, word [esp + 0x2c]
test ax, ax
je 0x409483
cmp ax, di
jae 0x409483
movzx esi, ax
lea eax, [esp + 0x58]
push 0
push eax
add esi, esi
lea eax, [esp + 0x70]
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x408f65
mov eax, dword [esp + 0x58]
cmp eax, 0xffffffff
je 0x408f86
cmp eax, esi
jne 0x408f95
movzx eax, word [esp + 0x2c]
add eax, eax
cmp eax, 0x208
jae 0x4094b1
xor ecx, ecx
lea edx, [esp + 0x270]
mov word [esp + eax + 0x68], cx
mov ecx, dword [0x4ab148]
sub edx, ecx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [ecx + edx - 2], ax
test ax, ax
jne 0x4090a4
lea edx, [esp + 0x68]
mov esi, edx
nop word [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x4090c0
lea edi, [esp + 0x270]
sub edx, esi
add edi, 0xfffffffe
nop word [eax + eax]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4090e0
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 [esp + 0x34]
lea ecx, [esp + 0x270]
mov edx, esi
mov eax, ecx
sub edx, eax
nop dword [eax + eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x409110
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x409125
sub ecx, edx
xor eax, eax
sar ecx, 1
lea edx, [esp + 0x20]
push 4
lea esi, [esi + ecx*2]
mov ecx, ebx
add esi, 2
mov dword [esp + 0x38], esi
mov word [esi], ax
call fcn.00408c80
mov edi, eax
add esp, 4
test edi, edi
jne 0x409493
lea ecx, [esp + 0x270]
call fcn.00408aa0
test eax, eax
jne 0x40947c
push eax
push 0x80
push 2
push eax
push eax
push 0xc0000000
lea eax, [esp + 0x288]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0x18], ebx
cmp ebx, 0xffffffff
je 0x409475
lea eax, [esp + 0x68]
push str.mmfs2.dll
push eax
call fcn.00474ee8
add esp, 8
push 4
test eax, eax
jne 0x40939e
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x60]
call fcn.00408c80
mov edi, eax
add esp, 4
mov dword [esp + 0x14], edi
test edi, edi
jne 0x40946c
push 0x8000
call fcn.00471224
add esp, 4
mov dword [esp + 0xc], eax
test eax, eax
je 0x409281
mov ebx, dword [esp + 0x5c]
test ebx, ebx
je 0x40926c
mov ecx, dword [esp + 0x10]
mov esi, 0x8000
cmp ebx, esi
mov edx, eax
cmovb esi, ebx
push esi
sub ebx, esi
call fcn.00408c80
mov edi, eax
add esp, 4
mov dword [esp + 0x14], edi
test edi, edi
jne 0x409268
push eax
lea eax, [esp + 0x64]
push eax
push esi
push dword [esp + 0x18]
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409251
mov eax, dword [esp + 0xc]
cmp dword [esp + 0x60], esi
jne 0x409246
mov dword [esp + 0x14], edi
jmp 0x4091f4
mov edi, 0x40000004
mov dword [esp + 0x14], edi
jmp 0x40926c
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [eax - 0x70]
neg edi
sbb edi, edi
add edi, 0x40000004
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0xc]
push eax
call fcn.00471245
mov ebx, dword [esp + 0x1c]
add esp, 4
test edi, edi
jne 0x40946c
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [esp + 0x68]
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x409290
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jl 0x409441
lea eax, [esp + ecx*2 + 0x60]
push 0x498dfc
push eax
call fcn.00474ee8
add esp, 8
test eax, eax
jne 0x409441
push eax
push eax
push eax
push ebx
call esi
mov ecx, ebx
call fcn.00408ce0
push 1
push 0x8000
mov dword [esp + 0x24], eax
xor esi, esi
call fcn.0047122f
mov ecx, eax
add esp, 8
mov eax, dword [esp + 0x1c]
mov dword [esp + 0xc], ecx
test eax, eax
je 0x40940c
mov ebx, 0x8000
cmp eax, ebx
push 0
cmovb ebx, eax
lea eax, [esp + 0x44]
push eax
push ebx
push ecx
push dword [esp + 0x28]
mov dword [esp + 0x50], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4093fe
mov eax, dword [esp + 0x40]
cmp eax, 0xffffffff
je 0x409404
cmp eax, ebx
jne 0x409404
mov edx, dword [esp + 0xc]
shr ebx, 2
test ebx, ebx
je 0x409354
nop
mov ecx, dword [edx]
mov eax, esi
shr eax, 0x1f
add edx, 4
add eax, ecx
lea esi, [eax + esi*2]
sub ebx, 1
jne 0x409340
mov eax, dword [esp + 0x3c]
mov ebx, 0
and eax, 3
mov dword [esp + 0x48], eax
jbe 0x409387
mov edi, eax
nop dword [eax + eax]
movzx ecx, byte [ebx + edx]
mov eax, esi
shr eax, 0x1f
inc ebx
add eax, ecx
lea esi, [eax + esi*2]
cmp ebx, edi
jb 0x409370
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x1c]
sub eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0xc]
mov dword [esp + 0x1c], eax
je 0x409408
jmp 0x4092f6
mov esi, dword [esp + 0x14]
lea edx, [esp + 0x3c]
mov ecx, esi
call fcn.00408c80
mov edi, eax
add esp, 4
test edi, edi
jne 0x40946c
push 1
push eax
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [esp + 0x38]
mov esi, eax
push dword [esp + 0x14]
push ebx
call dword [sym.imp.MMFS2.dll_Ordinal_766]
mov edi, eax
mov dword [esp + 0x14], edi
test edi, edi
jne 0x40946c
push eax
push eax
mov eax, dword [esp + 0x40]
add eax, esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push dword [esp + 0x1c]
call esi
jmp 0x409287
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0xc]
mov ebx, dword [esp + 0x18]
push 0x8000
push 0
push ecx
call fcn.0046f0c0
add esp, 0xc
push dword [esp + 0xc]
call fcn.00471245
add esp, 4
mov eax, 0x65
cmp dword [esp + 0x20], 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 [esp + 0x10]
test edi, edi
jne 0x409493
mov eax, dword [esp + 0x30]
inc eax
mov dword [esp + 0x30], eax
cmp eax, dword [0x4a9d94]
jge 0x409493
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x408ffb
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40948f
mov edi, 0x68
jmp 0x40948f
mov edi, 0x67
jmp 0x409493
mov edi, 0x65
jmp 0x409493
mov edi, 0x65
mov ebx, dword [esp + 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x684]
mov eax, edi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0046d741
mov esp, ebp
pop ebp
ret
call fcn.0046db4b
int3