Function at 0x405580
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x428f28
mov eax, dword fs:[0]
push eax
sub esp, 0x88
mov eax, dword [0x438040]
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 dword [ebp - 0x7c], edx
push 0
push 0
push 3
push 0
push 1
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x84], esi
mov dword [ebp - 4], 0
cmp esi, 0xffffffff
jne 0x4055f0
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov edi, 0x65b
cmovne edi, eax
jmp 0x405a41
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push eax
mov dword [ebp - 0x80], eax
call fcn.00417b65
mov ebx, eax
mov dword [ebp - 0x38], vtable.std::_Func_impl_no_alloc_class__lambda_24c8e3948900f633971a909cfe19e46e___void___.0
add esp, 4
mov dword [ebp - 0x70], ebx
lea eax, [ebp - 0x38]
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x14], eax
lea ecx, [ebp - 0x38]
lea eax, [ebp - 0x60]
mov dword [ebp - 0x3c], 0
push eax
call fcn.0040c7b0
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x3c], eax
test ecx, ecx
je 0x40564d
mov edx, dword [ecx]
lea eax, [ebp - 0x38]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
xor ecx, ecx
mov dword [ebp - 0x14], ecx
mov byte [ebp - 4], 1
test ecx, ecx
je 0x40566d
mov edx, dword [ecx]
lea eax, [ebp - 0x38]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [ebp - 0x14], 0
push 0
lea eax, [ebp - 0x80]
push eax
push dword [ebp - 0x80]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40569d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov edi, 0x65b
cmovne edi, eax
jmp 0x405a05
mov ecx, dword [ebx + 0xc]
xor dl, dl
mov edi, dword [ebx + 8]
add edi, ebx
mov byte [ebp - 0x61], dl
xor ebx, ebx
mov dword [ebp - 0x78], edi
lea eax, [ecx + ecx*8]
lea eax, [edi + eax*2]
mov dword [ebp - 0x88], eax
test ecx, ecx
je 0x405748
mov esi, dword [ebp - 0x70]
lea edi, [esi + 0x24]
nop dword [eax]
cmp dword [edi - 0x10], 0x6572642e
jne 0x405734
cmp dword [edi - 0xc], 0x65767463
jne 0x405734
mov eax, dword [edi + 4]
test eax, eax
je 0x405734
mov edx, dword [edi]
add eax, esi
add edx, eax
cmp eax, edx
jae 0x405734
cmp byte [eax], 0x20
je 0x40572f
mov ecx, edx
sub ecx, eax
cmp ecx, 8
jb 0x405725
cmp dword [eax], 0x5058452f
jne 0x405725
cmp dword [eax + 4], 0x3a54524f
jne 0x405725
mov byte [ebp - 0x61], 1
cmp byte [eax], 0x20
je 0x40572f
mov byte [eax], 0x20
inc eax
cmp eax, edx
jb 0x405716
jmp 0x40572f
cmp byte [eax], 0x20
je 0x40572f
inc eax
cmp eax, edx
jb 0x405725
inc eax
cmp eax, edx
jb 0x4056f3
mov ecx, dword [esi + 0xc]
inc ebx
add edi, 0x28
cmp ebx, ecx
jne 0x4056d0
mov esi, dword [ebp - 0x84]
mov dl, byte [ebp - 0x61]
mov ebx, dword [ebp - 0x70]
mov edi, 0x14c
mov eax, ecx
cmp word [ebx], di
mov edi, dword [ebp - 0x78]
jne 0x4057f3
mov dword [ebp - 0x68], 0
test ecx, ecx
je 0x4057f3
lea edx, [edi + 4]
xor ecx, ecx
mov dword [ebp - 0x74], edx
mov esi, ebx
cmp byte [edx + 0xc], 2
jne 0x4057d9
cmp dword [edx - 4], 0
jne 0x4057d9
mov ebx, dword [edx]
add ebx, dword [ebp - 0x88]
mov ecx, ebx
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405790
sub ecx, edi
cmp ecx, 7
jb 0x4057d6
cmp dword [ebx], 0x6d695f5f
jne 0x4057d6
cmp word [ebx + 4], 0x5f70
jne 0x4057d6
cmp byte [ebx + 6], 0x5f
jne 0x4057d6
dec ecx
cmp ecx, 0xffffffff
je 0x4057d6
nop word [eax + eax]
mov dl, byte [ecx + ebx]
lea edi, [ecx + ebx]
lea eax, [edx - 0x30]
cmp al, 9
ja 0x405821
dec ecx
cmp ecx, 0xffffffff
jne 0x4057c0
mov edx, dword [ebp - 0x74]
mov ecx, dword [ebp - 0x68]
mov eax, dword [esi + 0xc]
inc ecx
add edx, 0x12
mov dword [ebp - 0x68], ecx
mov dword [ebp - 0x74], edx
cmp ecx, eax
jne 0x405777
mov esi, dword [ebp - 0x84]
mov dl, byte [ebp - 0x61]
mov ecx, dword [ebp - 0x7c]
cmp dword [ecx + 4], 0
je 0x4059bd
mov ecx, dword [ebp - 0x70]
mov byte [ebp - 0x69], 0
movzx ecx, word [ecx]
cmp ecx, 0x8664
ja 0x405882
je 0x405839
sub ecx, 0x14c
je 0x405835
sub ecx, 0x74
jmp 0x405888
mov ecx, dword [ebp - 0x68]
cmp dl, 0x5f
mov edx, dword [ebp - 0x74]
mov byte [ebp - 0x61], 1
jne 0x4057d9
mov byte [edi], 0x40
jmp 0x4057d9
mov byte [ebp - 0x69], 0x5f
mov dword [ebp - 0x74], 0
test eax, eax
je 0x4059bd
mov ecx, dword [ebp - 0x78]
mov edx, dword [ebp - 0x70]
add ecx, 8
mov dword [ebp - 0x78], ecx
xor eax, eax
cmp byte [ecx + 8], 2
jne 0x4059a7
cmp dword [ecx - 8], 0
lea ebx, [ecx - 8]
jne 0x40589a
mov ebx, dword [ecx - 4]
add ebx, dword [ebp - 0x88]
mov edi, ebx
lea ecx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x405877
sub edi, ecx
jmp 0x4058a7
cmp ecx, 0xaa64
je 0x405839
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, 0x57
jmp 0x405a05
push 8
push ebx
call fcn.00415d54
add esp, 8
mov edi, eax
cmp byte [ebp - 0x69], 0
je 0x4058b4
cmp byte [ebx], 0x5f
jne 0x4058b4
inc ebx
dec edi
call fcn.0040db30
mov ecx, eax
test ecx, ecx
je 0x405a6e
test ebx, ebx
jne 0x4058cf
test edi, edi
jne 0x405a5f
mov eax, dword [ecx]
push 1
push edi
call dword [eax]
test eax, eax
je 0x405a69
add eax, 0x10
mov dword [ebp - 0x68], eax
test edi, edi
js 0x405a5f
cmp edi, dword [eax - 8]
jg 0x405a5f
mov dword [eax - 0xc], edi
mov byte [eax + edi], 0
test edi, edi
je 0x40592c
push edi
test ebx, ebx
je 0x405911
push ebx
push eax
call fcn.00410070
add esp, 0xc
jmp 0x40592c
push 0
push eax
call fcn.004105f0
add esp, 0xc
call fcn.00411fa6
mov dword [eax], 0x16
call fcn.00411ecc
mov ecx, dword [ebp - 0x7c]
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0x94]
push eax
call fcn.0040c300
mov ebx, dword [ebp - 0x8c]
cmp byte [ebx + 0xd], 0
jne 0x405969
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x405a6e
mov edi, dword [ebp - 0x68]
push eax
push edi
call fcn.00418134
add esp, 8
test eax, eax
js 0x40596c
jmp 0x405971
mov edi, dword [ebp - 0x68]
mov eax, dword [ebp - 0x7c]
mov ebx, dword [eax]
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x405989
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x7c]
mov ecx, dword [ebp - 0x78]
mov edx, dword [ebp - 0x70]
cmp ebx, dword [eax]
je 0x4059a4
cmp dword [ecx], 0
jne 0x4059a4
mov eax, dword [ebx + 0x14]
mov byte [ebp - 0x61], 1
mov dword [ecx], eax
mov eax, dword [ebp - 0x74]
inc eax
add ecx, 0x12
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x78], ecx
cmp eax, dword [edx + 0xc]
jne 0x405856
mov dl, byte [ebp - 0x61]
test dl, dl
jne 0x4059cb
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
xor edi, edi
jmp 0x405a05
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x80]
push eax
push dword [ebp - 0x80]
push dword [ebp - 0x70]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4059f9
xor edi, edi
jmp 0x405a05
call ebx
test eax, eax
mov edi, 0x65b
cmovne edi, eax
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
je 0x405a78
mov eax, dword [ecx]
call dword [eax + 8]
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
je 0x405a34
mov edx, dword [ecx]
lea eax, [ebp - 0x60]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [ebp - 0x3c], 0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x405a41
call ebx
mov eax, edi
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.0040e950
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.0040d910
call fcn.0040d6a0
push 0x80004005
call fcn.0040d910
call fcn.0040e908
int3