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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push edi
xor edi, edi
cmp dword [ebp + 0xc], edi
je 0x408fb6
cmp dword [ebp + 0x10], edi
je 0x408fb6
cmp dword [ebp + 0x14], edi
je 0x408fb6
push ebx
push esi
push dword [ebp + 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0xc], edi
call esi
push dword [ebp + 0x10]
mov ebx, eax
call esi
cmp dword [ebp + 8], edi
lea ebx, [ebx + eax + 0x10]
je 0x408d26
push dword [ebp + 8]
call esi
add ebx, eax
push edi
push 0x80
push 4
push edi
push edi
push 0xc0000000
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x10], eax
je 0x408faf
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
jne 0x408d5b
xor edi, edi
lea eax, [ebp - 0x28]
push eax
lea eax, [edi + ebx]
push eax
call fcn.0040909f
mov ebx, eax
xor eax, eax
pop ecx
cmp ebx, eax
pop ecx
je 0x408fa6
and byte [ebx], al
cmp edi, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], eax
mov dword [ebp + 0x14], eax
mov dword [ebp - 8], eax
je 0x408e3b
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x20]
push eax
push edi
call fcn.0040909f
pop ecx
mov dword [ebp - 0x18], eax
test eax, eax
pop ecx
je 0x408f9f
lea ecx, [ebp - 0x1c]
push 0
push ecx
push edi
push eax
mov dword [ebp - 0x1c], edi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x408e26
cmp dword [ebp - 0x1c], edi
jne 0x408e26
push 0
mov dword [ebp - 0xc], 1
push dword [ebp - 0x20]
push dword [ebp - 0x18]
push ebx
call fcn.00409035
mov eax, dword [ebp - 0x20]
add esp, 0x10
and byte [eax + ebx], 0
mov eax, dword [ebp + 8]
test eax, eax
je 0x408e13
cmp byte [eax], 0
je 0x408e13
push eax
lea eax, [ebp - 4]
push eax
push ebx
call fcn.00408bab
add esp, 0xc
mov dword [ebp - 0x14], eax
test eax, eax
je 0x408e26
mov ecx, dword [ebp - 4]
push dword [ebp + 0xc]
mov dword [ebp - 8], ecx
lea ecx, [ebp - 8]
push ecx
push eax
jmp 0x408e1b
push dword [ebp + 0xc]
lea eax, [ebp - 8]
push eax
push ebx
call fcn.00408c36
add esp, 0xc
mov dword [ebp + 0x14], eax
push dword [ebp - 0x18]
call fcn.004090f8
cmp dword [ebp - 0xc], 0
pop ecx
je 0x408f9f
xor eax, eax
push ebx
mov dword [ebp - 0xc], eax
call fcn.00437370
pop ecx
xor edx, edx
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x18], eax
cmp ecx, edx
je 0x408e9a
cmp dword [ebp + 0x14], edx
jne 0x408e59
mov dword [ebp + 0x14], ecx
push dword [ebp + 0x10]
call esi
mov edi, eax
mov eax, dword [ebp + 0x14]
sub eax, dword [ebp - 8]
add edi, eax
mov eax, dword [ebp - 0x18]
sub eax, dword [ebp - 8]
push edi
lea eax, [eax + ebx + 1]
push eax
push dword [ebp - 8]
call fcn.00408fbd
add esp, 0xc
push dword [ebp + 0x10]
call esi
push eax
push dword [ebp + 0x10]
push dword [ebp + 0x14]
call fcn.00436b60
add esp, 0xc
xor esi, esi
jmp 0x408f38
cmp dword [ebp - 0x14], edx
jne 0x408eb2
mov ecx, dword [ebp + 8]
cmp ecx, edx
je 0x408eb2
cmp byte [ecx], 0
mov dword [ebp - 0x14], 1
jne 0x408eb5
mov dword [ebp - 0x14], edx
mov ecx, dword [ebp - 4]
cmp ecx, edx
jne 0x408ec2
lea ecx, [eax + ebx]
mov dword [ebp - 4], ecx
mov al, byte [ecx]
push dword [ebp + 0xc]
mov byte [ebp + 0x17], al
call esi
push dword [ebp + 0x10]
mov edi, eax
call esi
cmp dword [ebp - 0x14], 0
lea edi, [edi + eax + 3]
je 0x408ee6
push dword [ebp + 8]
call esi
lea edi, [edi + eax + 4]
mov eax, dword [ebp - 0x18]
push edi
sub eax, dword [ebp - 4]
lea eax, [eax + ebx + 1]
push eax
push dword [ebp - 4]
call fcn.00408fbd
add esp, 0xc
xor esi, esi
cmp dword [ebp - 0x14], esi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
je 0x408f1f
push dword [ebp + 8]
push str._r_n__s__r_n_s_s
push dword [ebp - 4]
call fcn.00437b3a
add esp, 0x14
jmp 0x408f2f
push str._r_n_s_s
push dword [ebp - 4]
call fcn.00437b3a
add esp, 0x10
mov eax, dword [ebp - 4]
mov cl, byte [ebp + 0x17]
mov byte [edi + eax], cl
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x18]
add edi, eax
push edi
call fcn.0040909f
mov edi, eax
pop ecx
cmp edi, esi
pop ecx
je 0x408f9f
push 1
push dword [ebp - 0x1c]
push ebx
push edi
call fcn.00409035
add esp, 0x10
push esi
push esi
push esi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x24]
push esi
push eax
push dword [ebp - 0x1c]
push edi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408f98
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x24]
jne 0x408f98
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov dword [ebp - 0xc], 1
push edi
call fcn.004090f8
pop ecx
push ebx
call fcn.004090f8
pop ecx
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0xc]
pop esi
pop ebx
jmp 0x408fb8
xor eax, eax
pop edi
leave
ret 0x10