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

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x49ee34
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0xf8
mov eax, dword [0x4dd094]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebx + 8]
mov eax, accept
mov dword [ebp - 0x64], 0
mov dword [ecx + 4], 0xa
add ecx, 0xc
mov dword [ebp - 0x6c], edi
mov esi, dword [edi + 0x10]
mov edx, dword [ecx + 0x10]
sub eax, edx
cmp eax, esi
jb 0x40fcdf
cmp dword [ecx + 0x14], 0x10
jb 0x40f385
mov ecx, dword [ecx]
cmp dword [edi + 0x14], 0x10
mov eax, edi
jb 0x40f38f
mov eax, dword [edi]
push esi
push eax
push edx
push ecx
push ecx
push dword [ebp - 0x6c]
lea ecx, [ebp - 0xbc]
call fcn.00408c50
mov dword [ebp - 4], 0
lea ecx, [ebp - 0xbc]
mov esi, dword [ebp - 0xa8]
mov eax, esi
mov edx, dword [ebp - 0xac]
sub eax, edx
cmp eax, 1
jb 0x40f3ec
cmp esi, 0x10
lea eax, [edx + 1]
mov dword [ebp - 0xac], eax
cmovae ecx, dword [ebp - 0xbc]
mov al, byte [0x4d2228]
mov byte [edx + ecx], al
lea eax, [ebp - 0xbc]
mov byte [edx + ecx + 1], 0
jmp 0x40f3fd
push 1
push 0x4d2228
push dword [ebp - 0x6c]
push 1
call fcn.00408130
mov dword [ebp - 0x40], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0x50], xmm0
mov dword [ebp - 0x3c], 0
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x50], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0x40], xmm0
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0xf
mov byte [eax], 0
mov eax, 0x60
mov dword [ebp - 0x60], eax
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0xa8]
cmp ecx, 0x10
jb 0x40f47a
mov edx, dword [ebp - 0xbc]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40f470
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fce4
push ecx
push edx
call fcn.00476d74
add esp, 8
push edi
push 8
push 0x4d24e4
lea edx, [ebp - 0x50]
mov dword [ebp - 0xac], 0
lea ecx, [ebp - 0xec]
mov dword [ebp - 0xa8], 0xf
mov byte [ebp - 0xbc], 0
mov dword [ebp - 0x34], 0
call fcn.00412790
add esp, 0xc
cmp dword [eax + 0x14], 0x10
jb 0x40f4bd
mov eax, dword [eax]
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 0x80
push 3
push 0
push 1
push 1
push eax
call esi
mov ecx, dword [ebp - 0xd8]
mov edi, eax
mov dword [ebp - 0x70], edi
cmp ecx, 0x10
jb 0x40f514
mov edx, dword [ebp - 0xec]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40f50a
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fce9
push ecx
push edx
call fcn.00476d74
add esp, 8
push dword [ebp - 0x6c]
lea edx, [ebp - 0x50]
mov dword [ebp - 0xdc], 0
push 8
push 0x4d24f0
lea ecx, [ebp - 0x104]
mov dword [ebp - 0xd8], 0xf
mov byte [ebp - 0xec], 0
call fcn.00412790
add esp, 0xc
cmp dword [eax + 0x14], 0x10
jb 0x40f552
mov eax, dword [eax]
push 0
push 0x80
push 3
push 0
push 1
push 1
push eax
call esi
mov ecx, dword [ebp - 0xf0]
mov dword [ebp - 0x68], eax
cmp ecx, 0x10
jb 0x40f5a4
mov edx, dword [ebp - 0x104]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40f597
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fcee
push ecx
push edx
call fcn.00476d74
mov eax, dword [ebp - 0x68]
add esp, 8
mov dword [ebp - 0xf4], 0
mov dword [ebp - 0xf0], 0xf
mov byte [ebp - 0x104], 0
cmp edi, 0xffffffff
je 0x40fc8f
cmp eax, 0xffffffff
je 0x40fc8f
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x18]
push 0
push eax
push 4
lea eax, [ebp - 0x34]
mov dword [ebp - 0x18], 0
push eax
push edi
call esi
cmp eax, 1
jne 0x40fb81
cmp dword [ebp - 0x34], 0
mov dword [ebp - 0x74], 0
jbe 0x40fb81
nop word [eax + eax]
push 0
lea eax, [ebp - 0x18]
mov dword [ebp - 0x58], 0
push eax
push 4
lea eax, [ebp - 0x58]
push eax
push edi
call esi
test eax, eax
je 0x40fb81
mov edi, dword [ebp - 0x58]
xorps xmm0, xmm0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
movups xmmword [ebp - 0x30], xmm0
cmp edi, 0x7fffffff
ja 0x40fcdf
mov dword [ebp - 0x1c], 0xf
cmp edi, 0x10
jae 0x40f677
push edi
lea eax, [ebp - 0x30]
mov dword [ebp - 0x20], edi
push 0
push eax
call fcn.00478780
mov byte [ebp + edi - 0x30], 0
jmp 0x40f707
mov esi, edi
or esi, 0xf
cmp esi, 0x7fffffff
jbe 0x40f693
mov ecx, connect
mov esi, accept
add ecx, 0x23
jmp 0x40f6b3
cmp esi, 0x16
mov eax, 0x16
cmovb esi, eax
lea eax, [esi + 1]
cmp eax, 0x1000
jb 0x40f6d1
lea ecx, [eax + 0x23]
cmp ecx, eax
jbe 0x40fcf3
push ecx
call fcn.00476d3f
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x40fcfd
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
jmp 0x40f6e2
test eax, eax
je 0x40f6e0
push eax
call fcn.00476d3f
add esp, 4
jmp 0x40f6e2
xor eax, eax
push edi
push 0
push eax
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], esi
call fcn.00478780
mov eax, dword [ebp - 0x64]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov byte [eax + edi], 0
mov edi, dword [ebp - 0x58]
add esp, 0xc
push 0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x18]
cmp dword [ebp - 0x1c], 0x10
lea eax, [ebp - 0x30]
push ecx
cmovae eax, dword [ebp - 0x30]
push edi
mov edi, dword [ebp - 0x70]
push eax
push edi
call esi
test eax, eax
je 0x40fbee
push 0
lea eax, [ebp - 0x18]
mov dword [ebp - 0x38], 0
push eax
push 4
lea eax, [ebp - 0x38]
mov dword [ebp - 0x54], 0
push eax
push edi
call esi
test eax, eax
je 0x40fb49
push 0
lea eax, [ebp - 0x18]
push eax
push 4
lea eax, [ebp - 0x54]
push eax
push edi
call esi
test eax, eax
je 0x40fb49
cmp dword [ebp - 0x1c], 0x10
lea esi, [ebp - 0x30]
mov eax, dword [ebp - 0x20]
cmovae esi, dword [ebp - 0x30]
cmp eax, 1
jb 0x40f8ec
lea edi, [esi + eax]
mov eax, edi
sub eax, esi
push eax
push 0x5c
push esi
call fcn.00479340
add esp, 0xc
test eax, eax
je 0x40f8ec
nop dword [eax]
movzx ecx, byte [eax]
cmp cl, 0x5c
jne 0x40f7ac
xor ecx, ecx
jmp 0x40f7b1
sbb ecx, ecx
or ecx, 1
test ecx, ecx
je 0x40f7cf
inc eax
mov ecx, edi
sub ecx, eax
push ecx
push 0x5c
push eax
call fcn.00479340
add esp, 0xc
test eax, eax
jne 0x40f7a0
jmp 0x40f8ec
sub eax, esi
cmp eax, 0xffffffff
je 0x40f8ec
lea eax, [ebp - 0x30]
push eax
push 4
push 0x4d24fc
lea edx, [ebp - 0x50]
lea ecx, [ebp - 0xd4]
call fcn.00412790
add esp, 0xc
mov edx, eax
mov byte [ebp - 4], 4
mov esi, dword [ebp - 0x60]
or esi, 1
cmp dword [edx + 0x14], 0x10
mov dword [ebp - 0x64], esi
jb 0x40f80d
mov edx, dword [edx]
mov ecx, edx
mov dword [ebp - 0x94], 0
xorps xmm0, xmm0
mov dword [ebp - 0x90], 0
movups xmmword [ebp - 0xa4], xmm0
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40f830
sub ecx, edi
push ecx
push edx
lea ecx, [ebp - 0xa4]
call fcn.00408290
mov dword [ebp - 4], 5
lea ecx, [ebp - 0xa4]
or esi, 2
cmp dword [ebp - 0x90], 0x10
push 2
cmovae ecx, dword [ebp - 0xa4]
setae byte [ebp - 0x59]
sub esp, 8
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x64], esi
mov esi, dword [ebp - 0x94]
mov edx, esi
call fcn.00407e30
mov ecx, eax
mov dword [ebp - 0x7c], 0
add esp, 0xc
mov dword [ebp - 0x78], 0
cmp esi, ecx
lea eax, [ebp - 0xa4]
xorps xmm0, xmm0
cmovb ecx, esi
cmp byte [ebp - 0x59], 0
push ecx
cmovne eax, dword [ebp - 0xa4]
lea ecx, [ebp - 0x8c]
push eax
movups xmmword [ebp - 0x8c], xmm0
call fcn.00408290
mov eax, dword [ebp - 0x60]
or eax, 0x1800
or eax, 4
mov dword [ebp - 4], 6
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x64], eax
lea eax, [ebp - 0x8c]
push eax
call fcn.00410dc0
mov byte [ebp - 0x59], 1
test eax, eax
je 0x40f8f0
mov byte [ebp - 0x59], 0
mov dword [ebp - 4], 5
mov eax, dword [ebp - 0x60]
test al, 4
je 0x40f953
mov ecx, dword [ebp - 0x78]
and eax, 0xfffffffb
mov dword [ebp - 0x60], eax
cmp ecx, 0x10
jb 0x40f93e
mov edx, dword [ebp - 0x8c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40f931
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fce4
push ecx
push edx
call fcn.00476d74
mov eax, dword [ebp - 0x60]
add esp, 8
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], 0xf
mov byte [ebp - 0x8c], 0
mov dword [ebp - 4], 4
test al, 2
je 0x40f9bc
mov ecx, dword [ebp - 0x90]
and eax, 0xfffffffd
mov dword [ebp - 0x60], eax
cmp ecx, 0x10
jb 0x40f9a1
mov edx, dword [ebp - 0xa4]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40f994
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fce4
push ecx
push edx
call fcn.00476d74
mov eax, dword [ebp - 0x60]
add esp, 8
mov dword [ebp - 0x94], 0
mov dword [ebp - 0x90], 0xf
mov byte [ebp - 0xa4], 0
mov dword [ebp - 4], 3
test al, 1
je 0x40fa07
mov ecx, dword [ebp - 0xc0]
and eax, 0xfffffffe
mov dword [ebp - 0x60], eax
cmp ecx, 0x10
jb 0x40fa07
mov edx, dword [ebp - 0xd4]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40f9fd
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fce4
push ecx
push edx
call fcn.00476d74
add esp, 8
cmp byte [ebp - 0x59], 0
jne 0x40faf7
lea eax, [ebp - 0x30]
push eax
push 4
push 0x4d24fc
lea edx, [ebp - 0x50]
lea ecx, [ebp - 0x8c]
call fcn.00412790
add esp, 0xc
cmp dword [eax + 0x14], 0x10
jb 0x40fa35
mov eax, dword [eax]
push 0
push 0x80
push 2
push 0
push 1
push 2
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebp - 0x78]
mov esi, eax
cmp ecx, 0x10
jb 0x40fa84
mov edx, dword [ebp - 0x8c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40fa7a
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fce4
push ecx
push edx
call fcn.00476d74
add esp, 8
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], 0xf
mov byte [ebp - 0x8c], 0
cmp esi, 0xffffffff
je 0x40faf7
push 0
push 0
push dword [ebp - 0x38]
push dword [ebp - 0x68]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 0x54]
call fcn.00476d82
add esp, 4
mov edi, eax
lea eax, [ebp - 0x18]
push 0
push eax
push dword [ebp - 0x54]
push edi
push dword [ebp - 0x68]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40faf7
push 0
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x54]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40faf7
push edi
call fcn.00476d3a
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0x10
jb 0x40fb2f
mov edx, dword [ebp - 0x30]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40fb25
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fcfd
push ecx
push edx
call fcn.00476d74
add esp, 8
mov eax, dword [ebp - 0x74]
mov edi, dword [ebp - 0x70]
inc eax
mov dword [ebp - 0x74], eax
cmp eax, dword [ebp - 0x34]
jae 0x40fb81
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40f610
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0x10
jb 0x40fb81
mov edx, dword [ebp - 0x30]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40fb77
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fcfd
push ecx
push edx
call fcn.00476d74
add esp, 8
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call esi
push dword [ebp - 0x68]
call esi
mov esi, dword [ebp - 0x6c]
lea edx, [ebp - 0x50]
push esi
push 8
push 0x4d24e4
lea ecx, [ebp - 0xd4]
call fcn.00412790
add esp, 0xc
cmp dword [eax + 0x14], 0x10
jb 0x40fbb3
mov eax, dword [eax]
push eax
call fcn.0047fb0c
mov ecx, dword [ebp - 0xc0]
add esp, 4
cmp ecx, 0x10
jb 0x40fc2f
mov edx, dword [ebp - 0xd4]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40fc25
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fcf8
jmp 0x40fc25
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0x10
jb 0x40fb81
mov edx, dword [ebp - 0x30]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40fb77
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fcfd
jmp 0x40fb77
push ecx
push edx
call fcn.00476d74
add esp, 8
push esi
push 8
push 0x4d24f0
lea edx, [ebp - 0x50]
lea ecx, [ebp - 0xd4]
call fcn.00412790
add esp, 0xc
cmp dword [eax + 0x14], 0x10
jb 0x40fc50
mov eax, dword [eax]
push eax
call fcn.0047fb0c
mov ecx, dword [ebp - 0xc0]
add esp, 4
cmp ecx, 0x10
jb 0x40fc8f
mov edx, dword [ebp - 0xd4]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40fc85
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fd02
push ecx
push edx
call fcn.00476d74
add esp, 8
mov ecx, dword [ebp - 0x3c]
cmp ecx, 0x10
jb 0x40fcbf
mov edx, dword [ebp - 0x50]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40fcb5
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fd07
push ecx
push edx
call fcn.00476d74
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00476d2c
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 4
call fcn.00401830
call fcn.0047ebc0
call fcn.0047ebc0
call fcn.0047ebc0
call fcn.00401790
call fcn.0047ebc0
call fcn.0047ebc0
call fcn.0047ebc0
call fcn.0047ebc0
int3