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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x94
push ebx
push esi
push edi
mov ebx, ecx
mov dword [ebp - 8], edx
xor edi, edi
mov dword [ebp - 0x10], ebx
and dword [ebp - 0xc], edi
mov ecx, 0x21c
mov dword [ebp - 4], edi
call fcn.00408de8
mov esi, eax
xor eax, eax
mov dword [ebp - 0x20], esi
test esi, esi
je 0x4015b4
push eax
push 0x88000000
push 3
push eax
push eax
push 0xc0010000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4012d8
xor eax, eax
push eax
push 0x88000000
push 3
push eax
push eax
push 0xc0000000
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x401500
mov edi, dword [ebp + 0x10]
push dword [edi + 0x1c]
push dword [edi + 0x20]
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_LockFile]
push 2
push 0
push 0xffffffffffffffff
push 0xfffffde4
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x401370
push 0
lea eax, [ebp - 0xc]
push eax
push 0x21c
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401357
cmp dword [esi + 0x214], 0x93892918
jne 0x401357
cmp dword [esi + 0x218], 0x38281
jne 0x401357
push dword [edi + 0x1c]
push dword [edi + 0x20]
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_UnlockFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, esi
call fcn.00408df9
xor eax, eax
jmp 0x4015b4
push 0
push 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x18], xmm0
push dword [ebp - 0x14]
push dword [ebp - 0x18]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push dword [ebp - 8]
and dword [ebp - 0xc], 0
lea edx, [ebp - 0x28]
push esi
lea ecx, [ebp - 0x48]
call fcn.00401180
pop ecx
pop ecx
test eax, eax
je 0x401349
push 0x40
pop eax
mov byte [ebp - 0x50], 0
dec eax
jne 0x40138c
push ecx
push 0x100
lea edx, [ebp - 0x48]
lea ecx, [ebp - 0x90]
call fcn.00406ec9
mov eax, dword [ebp - 0x28]
add esp, 8
mov ecx, dword [esi + 0x210]
and dword [ebp - 0x70], 0
and dword [ebp - 0x6c], 0
inc ecx
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x74], eax
call fcn.00408de8
mov ecx, dword [esi + 0x210]
add ecx, 5
mov dword [ebp - 0x10], eax
call fcn.00408de8
mov dword [ebp - 8], eax
xor edi, edi
push 0
lea eax, [ebp - 0xc]
push eax
push dword [esi + 0x210]
push dword [ebp - 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4014ac
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x4014ac
cmp eax, dword [esi + 0x210]
mov edx, dword [ebp - 0x10]
push 1
pop ecx
cmovb edi, ecx
cmp dword [ebp + 0xc], 0
lea ecx, [ebp - 0x90]
cmovne edi, dword [ebp + 0xc]
add dword [esi + 0x200], eax
mov dword [ebp - 0x14], edi
adc dword [esi + 0x204], 0
mov eax, dword [ebp - 0xc]
push eax
push dword [ebp - 8]
mov dword [ebp - 4], eax
call fcn.00406f46
mov eax, dword [ebp - 4]
pop ecx
pop ecx
xor ecx, ecx
neg eax
inc ecx
cdq
push ecx
push 0
push edx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 4]
push dword [ebp - 8]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40149a
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
lea eax, [ebp - 0x1c]
push eax
push edi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x401479
mov esi, dword [ebp - 0x20]
mov edi, dword [ebp - 0x14]
xor eax, eax
inc eax
add dword [esi + 0x208], eax
adc dword [esi + 0x20c], 0
jmp 0x4014b1
xor eax, eax
lea edi, [eax + 1]
test edi, edi
je 0x4013e0
cmp dword [ebp + 0xc], 0
je 0x4014d8
push 2
push 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x18], xmm0
push dword [ebp - 0x14]
push dword [ebp - 0x18]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x1c]
push eax
push 0x21c
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x10]
mov edi, eax
mov dword [ebp - 4], edi
call fcn.00408df9
mov ecx, dword [ebp - 8]
call fcn.00408df9
mov ecx, esi
call fcn.00408df9
test ebx, ebx
je 0x4015b2
test edi, edi
je 0x401597
cmp dword [ebp + 8], 0
je 0x401597
push dword [ebp + 8]
and dword [ebp - 0x18], 0
and dword [ebp - 0x14], 0
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
call esi
lea ecx, [eax*2 + 0x12]
call fcn.00408de8
push dword [ebp + 8]
mov edi, eax
xor eax, eax
inc eax
and dword [edi + 4], 0
mov byte [edi], al
call esi
push dword [ebp + 8]
add eax, eax
mov dword [edi + 8], eax
call esi
lea eax, [eax*2 + 2]
push eax
push dword [ebp + 8]
lea eax, [edi + 0xc]
push eax
call fcn.0040e3d0
add esp, 0xc
push 0xa
push dword [ebp + 8]
call esi
lea eax, [eax*2 + 0x12]
push eax
push edi
lea eax, [ebp - 0x18]
push eax
push ebx
call dword [0x423310]
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
mov ecx, edi
call fcn.00408df9
mov edi, dword [ebp - 4]
mov eax, dword [ebp + 0x10]
push dword [eax + 0x1c]
push dword [eax + 0x20]
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_UnlockFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret