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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x56ce85
mov eax, dword fs:[0]
push eax
sub esp, 0x50
mov eax, dword [0x5d0000]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x30], ebx
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0x14]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x20], edi
mov dword [ebp - 4], 0
mov eax, dword [ebp + 0x10]
add eax, 0xfffffff0
push eax
call fcn.0040a460
add esp, 4
lea esi, [eax + 0x10]
mov dword [ebp - 0x5c], esi
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x44]
mov edx, dword [ebp + 0x10]
call fcn.0040ed00
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x44]
call fcn.0040db70
cmp eax, 0xffffffff
jne 0x40fdc6
mov ecx, dword [ebp - 0x44]
call fcn.0040dc60
mov dword [ebp - 0x54], vtable.SFile.0
mov byte [ebp - 4], 4
call fcn.0042d02f
mov ecx, eax
mov byte [ebp - 4], 3
test ecx, ecx
je 0x4101f4
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], eax
push 0x1001
push esi
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 5
call fcn.0040dfb0
imul ecx, dword [ebp - 0x40], 0x68
mov dword [ebp - 0x24], ecx
add ecx, dword [ebx + 0x20]
mov edx, dword [ecx + 8]
mov eax, edx
or eax, dword [ecx + 0xc]
je 0x410124
mov eax, dword [ecx + 0x10]
cmp eax, 1
jne 0x40fe8e
lea eax, [edx + 0x1000]
push 1
push eax
call fcn.0055648e
add esp, 8
mov dword [ebp - 0x20], eax
mov ecx, ebx
push eax
push dword [ebp - 0x34]
push dword [ebp - 0x40]
call fcn.0040f550
mov ecx, dword [ebx + 0x20]
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + ecx + 8]
test eax, eax
je 0x40fe6b
push 0
lea ecx, [ebp - 0x48]
push ecx
push eax
push dword [ebp - 0x20]
push dword [ebp - 0x50]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x20]
call fcn.00552bd3
mov ecx, dword [ebx + 0x20]
add esp, 4
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + ecx + 8]
add dword [edi], eax
mov eax, dword [edx + ecx + 0xc]
adc dword [edi + 4], eax
jmp 0x410124
mov edx, dword [ebx]
lea ecx, [ebx + 4]
push 0x40
push edx
test eax, eax
jne 0x40ff95
call fcn.0040dfb0
mov eax, dword [ebx + 0x20]
lea ecx, [ebx + 4]
mov edi, dword [ebp - 0x24]
push 0
push dword [eax + edi + 0x34]
push dword [eax + edi + 0x30]
call fcn.0040e1c0
push 1
push 0x1001000
call fcn.0055648e
mov ecx, dword [ebx + 0x20]
add esp, 8
mov edx, dword [ebp - 0x24]
mov dword [ebp - 0x2c], eax
mov edi, dword [edi + ecx + 8]
mov ebx, dword [edx + ecx + 0xc]
mov ecx, edi
or ecx, ebx
je 0x40ff87
mov esi, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x20]
nop dword [eax + eax]
test ebx, ebx
ja 0x40ff2b
jb 0x40fefe
cmp edi, 0x1000000
ja 0x40ff2b
mov dword [ebp - 0x24], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x3c], xmm0
mov eax, edi
mov dword [ebp - 0x28], eax
test edi, edi
jne 0x40ff23
movlpd qword [ebp - 0x3c], xmm0
mov ebx, dword [ebp - 0x38]
mov edi, dword [ebp - 0x3c]
jmp 0x40ff71
mov ebx, dword [ebp - 0x38]
mov edi, dword [ebp - 0x3c]
jmp 0x40ff43
add edi, 0xff000000
mov dword [ebp - 0x24], 0
mov eax, 0x1000000
mov dword [ebp - 0x28], eax
adc ebx, 0xffffffff
push 0
lea ecx, [ebp - 0x24]
push ecx
push eax
push dword [ebp - 0x2c]
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x48]
push eax
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp - 0x50]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x20]
add dword [ecx], eax
mov eax, edi
adc dword [ecx + 4], 0
or eax, ebx
jne 0x40fef0
mov esi, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x2c]
push eax
call fcn.00552bd3
mov ebx, dword [ebp - 0x30]
jmp 0x41010b
xorps xmm0, xmm0
movlpd qword [ebp - 0x3c], xmm0
call fcn.0040dfb0
mov eax, dword [ebx + 0x20]
lea ecx, [ebx + 4]
mov edi, dword [ebp - 0x24]
push 0
push dword [eax + edi + 0x34]
push dword [eax + edi + 0x30]
call fcn.0040e1c0
push 1
push 0x1001000
call fcn.0055648e
mov ecx, dword [ebx + 0x20]
add esp, 8
mov dword [ebp - 0x2c], eax
cmp dword [edi + ecx + 0xc], 0
jb 0x410105
ja 0x40ffe7
cmp dword [edi + ecx + 8], 0
jbe 0x410105
mov eax, dword [ebp - 0x38]
mov esi, dword [ebp - 0x20]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x58], eax
nop word [eax + eax]
push 0
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0
push eax
push 4
lea eax, [ebp - 0x28]
push eax
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x28]
add eax, 0x100
push 1
push eax
call fcn.0055648e
mov ecx, eax
mov dword [ebp - 0x48], 0
mov eax, dword [ebp - 0x28]
add esp, 8
mov dword [ebp - 0x20], ecx
test eax, eax
je 0x410056
push 0
lea edx, [ebp - 0x48]
push edx
push eax
push ecx
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [ebp - 0x20]
mov eax, dword [ebx + 0x20]
mov edi, 0x1000000
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + eax + 0x14]
xor dword [ecx], eax
lea eax, [ebp - 0x30]
mov edx, dword [ebp - 0x28]
push eax
call fcn.00410b50
add esp, 4
test al, al
je 0x4100aa
cmp dword [ebp - 0x30], edi
ja 0x4100aa
mov eax, dword [ebp - 0x20]
lea ecx, [ebp - 0x1c]
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x1c], vtable.snappy::ByteArraySource.0
mov dword [ebp - 0x14], eax
call fcn.00410e20
test al, al
mov dword [ebp - 0x1c], vtable.snappy::Source.0
cmovne edi, dword [ebp - 0x30]
push dword [ebp - 0x20]
call fcn.00552bd3
add esp, 4
test edi, edi
je 0x4100cc
push 0
lea eax, [ebp - 0x38]
push eax
push edi
push dword [ebp - 0x2c]
push dword [ebp - 0x50]
call dword [sym.imp.KERNEL32.dll_WriteFile]
add dword [esi], edi
mov ecx, dword [ebp - 0x58]
adc dword [esi + 4], 0
add ecx, edi
mov edx, dword [ebp - 0x34]
mov eax, dword [ebx + 0x20]
adc edx, 0
mov edi, dword [ebp - 0x24]
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x34], edx
cmp edx, dword [edi + eax + 0xc]
jb 0x410000
ja 0x4100ff
cmp ecx, dword [edi + eax + 8]
jb 0x410000
mov esi, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x2c]
push eax
call fcn.00552bd3
mov eax, dword [ebx + 8]
add esp, 4
test eax, eax
je 0x410124
push eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
mov dword [ebx + 8], 0
mov edi, dword [ebp - 0x50]
test edi, edi
je 0x410137
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
mov dword [ebp - 0x50], edi
imul ecx, dword [ebp - 0x40], 0x68
add ecx, dword [ebx + 0x20]
mov ebx, dword [ecx + 0x38]
mov eax, ebx
mov edx, dword [ecx + 0x3c]
or eax, edx
je 0x41015f
sub esp, 8
push dword [ecx + 0x44]
push dword [ecx + 0x40]
mov ecx, esi
push edx
push ebx
call fcn.0040d720
add esp, 0x18
test edi, edi
je 0x41016b
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call eax
mov edx, dword [ebp - 0x4c]
or edi, 0xffffffff
add edx, 0xfffffff0
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x410188
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x44]
mov eax, edi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4101a2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4101b9
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp + 0x10]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x4101d1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0054d6d8
mov esp, ebp
pop ebp
ret 0x10
push 0x80004005
call fcn.00402740
int3