Function at 0x40675c
Capabilities:
Get file size
Read file on windows
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x178
push ebx
xor ebx, ebx
push esi
push edi
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], ebx
mov esi, 0x80
cmp dword [ebp + 0x10], ebx
je 0x406784
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 3
push ebx
push 3
mov edi, bind
push edi
push dword [ebp + 8]
call esi
mov dword [ebp - 8], eax
cmp eax, 0xffffffff
jne 0x4067b5
push ebx
push 4
push 3
push ebx
push 3
push edi
push dword [ebp + 8]
call esi
mov dword [ebp - 8], eax
cmp dword [ebp + 0x10], ebx
je 0x4067c5
push 2
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
cmp dword [ebp - 8], 0xffffffff
je 0x406977
push ebx
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 4], eax
cmp eax, 0xffffffff
je 0x40696b
cmp eax, ebx
je 0x40696b
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
lea eax, [ebp + 0x10]
push eax
push 0x40
lea eax, [ebp - 0x80]
push eax
push dword [ebp - 8]
mov dword [ebp + 0x10], ebx
mov dword [ebp - 0x18], ebx
call esi
test eax, eax
je 0x40696b
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
push ebx
push dword [ebp - 0x44]
push dword [ebp - 8]
call edi
cmp eax, 0xffffffff
je 0x40696b
push ebx
lea eax, [ebp - 0x18]
push eax
push 0xf8
lea eax, [ebp - 0x178]
push eax
push dword [ebp - 8]
call esi
test eax, eax
je 0x40696b
movzx eax, word [ebp - 0x164]
mov ecx, dword [ebp - 0x44]
push ebx
push ebx
lea eax, [eax + ecx + 0x18]
push eax
push dword [ebp - 8]
call edi
cmp eax, 0xffffffff
je 0x40696b
xor eax, eax
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
cmp ax, word [ebp - 0x172]
jae 0x4068d5
push 0x28
pop eax
push ebx
lea ecx, [ebp + 0x10]
push ecx
push eax
mov dword [ebp + 0x10], eax
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 8]
call esi
test eax, eax
je 0x4068d2
movzx edx, word [ebp - 0x172]
lea eax, [edx - 1]
cmp dword [ebp - 0x14], eax
jne 0x4068b7
mov ecx, dword [ebp - 0x13c]
mov eax, dword [ebp - 0x38]
lea eax, [ecx + eax - 1]
dec ecx
not ecx
and eax, ecx
add eax, dword [ebp - 0x2c]
jmp 0x4068bd
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x30]
mov dword [ebp + 0x10], eax
cmp dword [ebp - 0x10], eax
jae 0x4068c8
mov dword [ebp - 0x10], eax
inc dword [ebp - 0x14]
cmp dword [ebp - 0x14], edx
jl 0x406878
jmp 0x4068d5
mov dword [ebp - 4], ebx
movzx eax, word [ebp - 0x172]
cmp dword [ebp - 0x14], eax
jl 0x40696e
mov eax, dword [ebp - 0x10]
cmp dword [ebp - 4], eax
jbe 0x4068f0
mov dword [ebp - 4], eax
push dword [ebp - 4]
call fcn.0040ebcc
pop ecx
mov dword [ebp - 0xc], eax
cmp eax, ebx
je 0x40696b
push ebx
push ebx
push ebx
push dword [ebp - 8]
call edi
cmp eax, 0xffffffff
je 0x40695a
mov edi, dword [ebp - 0xc]
push ebx
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 4]
push edi
push dword [ebp - 8]
call esi
test eax, eax
je 0x40695a
movzx eax, word [ebp - 0x164]
add eax, dword [ebp - 0x44]
lea ecx, [eax + edi + 0x18]
movzx eax, word [ebp - 0x172]
dec eax
imul eax, eax, 0x28
add eax, ecx
mov ecx, dword [ebp - 0x13c]
mov edx, dword [eax + 8]
lea edx, [edx + ecx - 1]
dec ecx
not ecx
and edx, ecx
mov dword [eax + 0x10], edx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 4], eax
jmp 0x40696e
push dword [ebp - 0xc]
mov dword [ebp - 4], ebx
call fcn.0040ec2e
pop ecx
mov dword [ebp - 0xc], ebx
jmp 0x40696e
mov dword [ebp - 4], ebx
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 4]
pop edi
pop esi
mov dword [eax], ecx
mov eax, dword [ebp - 0xc]
pop ebx
leave
ret