Function at 0x40cf40
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5007e9
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
push ebx
push esi
push edi
mov eax, dword [0x559680]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x14], 0
mov eax, dword [0x5591b8]
mov ecx, 0x5591b8
mov dword [ebp - 4], 0
call dword [eax + 0xc]
mov edi, dword [ebp + 8]
add eax, 0x10
mov dword [edi], eax
mov esi, dword [ebp + 0xc]
mov dword [ebp - 4], 0
mov eax, dword [esi]
mov dword [ebp - 0x14], 1
cmp dword [eax - 0xc], 0
je 0x40d048
mov ecx, 0x5122d0
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40cfd6
test dx, dx
je 0x40cfd2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40cfd6
add eax, 4
add ecx, 4
test dx, dx
jne 0x40cfb0
xor eax, eax
jmp 0x40cfdb
sbb eax, eax
or eax, 1
test eax, eax
sete al
test al, al
jne 0x40d048
lea eax, [ebp - 0x20]
push eax
call fcn.0040c2e0
mov ecx, dword [eax]
xor eax, eax
add esp, 4
test ecx, ecx
setne al
mov dword [ebp - 0x14], 3
test eax, eax
jne 0x40d00e
push 0x80004005
call fcn.00402ec0
mov eax, dword [esi]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40d036
test dx, dx
je 0x40d032
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40d036
add eax, 4
add ecx, 4
test dx, dx
jne 0x40d010
xor eax, eax
jmp 0x40d03b
sbb eax, eax
or eax, 1
test eax, eax
sete al
mov byte [ebp - 0xe], 0
test al, al
je 0x40d04c
mov byte [ebp - 0xe], 1
mov eax, dword [ebp - 0x14]
or ebx, 0xffffffff
test al, 2
je 0x40d078
mov edx, dword [ebp - 0x20]
and eax, 0xfffffffd
add edx, 0xfffffff0
mov dword [ebp - 0x14], eax
lea eax, [edx + 0xc]
mov ecx, ebx
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40d078
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp byte [ebp - 0xe], 0
je 0x40d11c
lea eax, [ebp - 0x18]
push eax
call fcn.0040c2e0
add esp, 4
mov dword [ebp - 4], 1
mov ecx, dword [eax]
mov esi, dword [edi]
lea edx, [ecx - 0x10]
sub esi, 0x10
cmp edx, esi
je 0x40d0e6
cmp dword [esi + 0xc], 0
jl 0x40d0db
mov eax, dword [edx]
cmp eax, dword [esi]
jne 0x40d0db
push edx
call fcn.00404d60
add esp, 4
mov dword [ebp - 0x20], eax
mov ecx, ebx
lea edx, [esi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d0d4
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x20]
add eax, 0x10
mov dword [edi], eax
jmp 0x40d0e6
push dword [ecx - 0xc]
push ecx
mov ecx, edi
call fcn.00409230
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40d3fc
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push 3
push 0
push 0
push SysReAllocStringLen
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
jne 0x40d153
lea eax, [ebp - 0x18]
push eax
call fcn.0040c2e0
add esp, 4
mov dword [ebp - 4], 2
jmp 0x40d095
lea ecx, [ebp - 0x2c]
push ecx
xorps xmm0, xmm0
push eax
movq qword [ebp - 0x2c], xmm0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40d1ac
lea eax, [ebp - 0x18]
push eax
call fcn.0040c2e0
add esp, 4
mov dword [ebp - 4], 3
push eax
mov ecx, edi
call fcn.004025b0
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40d3f3
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40d3f3
cmp dword [ebp - 0x28], 0
je 0x40d1c7
lea eax, [ebp - 0x18]
push eax
call fcn.0040c2e0
add esp, 4
mov dword [ebp - 4], 4
jmp 0x40d17d
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x40d3f3
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
push eax
lea ecx, [ebp - 0x38]
mov dword [ebp - 4], 5
call fcn.00411b30
mov esi, dword [ebp - 0x38]
push 0
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x2c]
mov dword [ebp - 0x24], 0
push esi
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d3e6
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0xf]
push eax
lea eax, [ebp - 0xd]
push eax
push esi
mov byte [ebp - 0xd], 0
mov byte [ebp - 0xf], 0
mov dword [ebp - 0x1c], 0
call fcn.004892e0
mov eax, dword [ebp - 0x1c]
add esp, 0x10
test eax, eax
jle 0x40d25a
add eax, esi
push eax
push esi
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x38]
call fcn.0040d5e0
mov esi, dword [ebp - 0x38]
cmp byte [ebp - 0xf], 0
mov edi, dword [ebp - 0x34]
je 0x40d2fe
mov edx, dword [0x55aac0]
imul edx, edx
mov ecx, esi
and edx, 0x8000000f
jns 0x40d27f
dec edx
or edx, 0xfffffff0
inc edx
mov eax, dword [0x55aecc]
cmp edx, 0xe
mov dword [ebp - 0x18], 0xdf054586
cmove eax, dword [ebp - 0x18]
mov dword [0x55aecc], eax
cmp esi, edi
je 0x40d2b4
jmp 0x40d2a0
mov dl, byte [ecx]
mov bl, byte [ecx + 1]
mov byte [ecx + 1], dl
mov byte [ecx], bl
add ecx, 2
cmp ecx, edi
jne 0x40d2a0
or ebx, 0xffffffff
call fcn.0040d680
test al, al
jne 0x40d2fe
mov eax, 0x51eb851f
imul dword [0x55aac0]
mov eax, dword [0x55aac0]
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
imul ecx, ecx, 0x64
sub eax, ecx
xor ecx, ecx
add eax, 0x7b
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004ddf94
push eax
call fcn.004e00c3
add esp, 8
sub edi, esi
cmp byte [esi + edi - 1], 0
je 0x40d333
inc edi
push edi
lea ecx, [ebp - 0x38]
call fcn.00411b30
mov esi, dword [ebp - 0x38]
mov byte [esi + edi - 1], 0
cmp byte [ebp - 0xd], 0
je 0x40d38c
inc edi
push edi
lea ecx, [ebp - 0x38]
call fcn.00411b30
mov esi, dword [ebp - 0x38]
mov byte [esi + edi - 1], 0
jmp 0x40d34e
cmp byte [ebp - 0xd], 0
je 0x40d38c
lea eax, [edi + 2]
push eax
lea ecx, [ebp - 0x38]
call fcn.00411b30
mov esi, dword [ebp - 0x38]
mov word [esi + edi], 0
cmp byte [ebp - 0xd], 0
je 0x40d38c
push esi
lea ecx, [ebp - 0x18]
call fcn.00401b70
mov edi, dword [ebp + 8]
push eax
mov ecx, edi
mov byte [ebp - 4], 6
call fcn.004025b0
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 5
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40d3e6
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40d3e6
mov eax, dword [0x5591b8]
mov ecx, 0x5591b8
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
push esi
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 7
call fcn.004026b0
mov edi, dword [ebp + 8]
lea eax, [ebp - 0x18]
push eax
mov ecx, edi
mov byte [ebp - 4], 8
call fcn.004025b0
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 5
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40d3dc
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push edi
push edi
call fcn.00487cf0
add esp, 8
test esi, esi
je 0x40d3f3
push esi
call fcn.004decf8
add esp, 4
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret