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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x224
mov eax, dword [0x5bc684]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
xor eax, eax
mov dword [ebp - 0x214], eax
cmp esi, eax
je 0x406a6b
mov ebx, dword [ebp + 0xc]
cmp ebx, eax
je 0x406a6b
push edi
push 0x1ffff
mov dword [ebp - 0x210], eax
call fcn.004fc6be
add esp, 4
push 0
push 0
push 3
push 0
push 3
push 0xc0000000
mov edi, eax
push esi
mov dword [ebp - 0x21c], edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x406a41
push 0
lea eax, [ebp - 0x210]
push eax
push 0x1fffe
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x406a41
cmp dword [ebp - 0x210], 0
je 0x406a41
push 0x103
lea ecx, [ebp - 0x20b]
push 0
push ecx
mov byte [ebp - 0x20c], 0
call fcn.004ff6f0
lea edx, [ebp - 0x20c]
add esp, 0xc
mov eax, ebx
sub edx, ebx
jmp 0x406880
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x406880
push 0x103
lea edx, [ebp - 0x107]
push 0
push edx
mov byte [ebp - 0x108], cl
call fcn.004ff6f0
add esp, 0xc
cmp dword [0x5c19bc], 0
je 0x4068e3
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4068cf
cmp byte [eax], 0
je 0x4068cf
lea edx, [ebp - 0x108]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4068c3
jmp 0x4068e3
push 0x103
lea eax, [ebp - 0x108]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0
push 3
push 0
push 1
push SysReAllocString
lea ecx, [ebp - 0x108]
push ecx
mov dword [ebp - 0x218], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x220], eax
cmp eax, 0xffffffff
je 0x406a41
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [ebp - 0x210]
mov edi, eax
lea ebx, [edi + edx + 8]
mov eax, ebx
and eax, 7
mov ecx, 8
sub ecx, eax
add ebx, ecx
push ebx
call fcn.004fc6be
mov esi, eax
add esp, 4
test esi, esi
je 0x4069b7
push ebx
push 0
push esi
call fcn.004ff6f0
mov eax, dword [ebp - 0x220]
add esp, 0xc
push 0
lea edx, [ebp - 0x224]
push edx
push edi
push esi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4069b7
cmp dword [ebp - 0x224], edi
jne 0x4069b7
mov ecx, dword [0x54f100]
mov dword [esi + edi], ecx
mov edx, dword [0x54f104]
mov ecx, dword [ebp - 0x21c]
mov dword [esi + edi + 4], edx
mov eax, dword [ebp - 0x210]
push eax
push ecx
lea edx, [esi + edi + 8]
push edx
call fcn.004fe210
mov eax, ebx
sub eax, edi
push eax
push esi
call fcn.004cd0d0
add esp, 0x14
mov edi, eax
jmp 0x4069bd
mov edi, dword [ebp - 0x218]
mov ecx, dword [ebp - 0x220]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x406a41
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
lea edx, [ebp - 0x20c]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x406a41
push 0
lea eax, [ebp - 0x218]
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x406a1c
cmp dword [ebp - 0x218], ebx
jne 0x406a1c
mov dword [ebp - 0x214], 1
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x214], 0
je 0x406a41
lea ecx, [ebp - 0x20c]
push ecx
call fcn.004cc130
add esp, 4
mov dword [ebp - 0x214], eax
mov eax, dword [ebp - 0x21c]
pop edi
test eax, eax
je 0x406a55
push eax
call fcn.004fedfc
add esp, 4
mov eax, dword [ebp - 0x214]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004fe1f5
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.004fe1f5
mov esp, ebp
pop ebp
ret