Function at 0x40d158
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x44f41c
call fcn.0042b9b8
sub esp, 0x58
push ebx
push esi
push edi
mov ebx, ecx
mov eax, dword [ebx + 0x3c]
xor edi, edi
cmp eax, dword [ebp + 0x10]
mov dword [ebp - 4], edi
jb 0x40d63e
mov esi, dword [ebp + 0xc]
cmp esi, dword [ebp + 0x10]
ja 0x40d63e
lea eax, [ebp - 0x30]
push eax
call fcn.0040d65d
mov eax, dword [eax]
push edi
push edi
push 3
push edi
push 1
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x14], eax
sete byte [ebp - 0xd]
call fcn.00440d69
cmp byte [ebp - 0xd], 0
jne 0x40d63e
lea ecx, [ebp - 0x54]
call fcn.00441b5d
push edi
push 0x9002
push dword [ebp + 8]
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 1
call fcn.00441c6f
test eax, eax
jne 0x40d1f2
and byte [ebp - 4], al
lea ecx, [ebp - 0x54]
call fcn.00441bb2
jmp 0x40d63e
mov ecx, dword [ebx + 0x118]
mov dword [ebp - 0x2c], edi
cmp ecx, edi
mov dword [ebp - 0x1c], edi
jne 0x40d277
je 0x40d209
fld qword [ebx + 0x50]
jmp 0x40d20c
fild dword [ebx + 0x4c]
fmul qword [0x454718]
mov eax, dword [ebx + 0x10c]
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x30], edi
fild qword [ebp - 0x34]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], edi
fmulp st(1)
fild qword [ebp - 0x34]
faddp st(1)
call fcn.0042c124
cmp dword [ebx + 0x118], edi
mov esi, eax
je 0x40d242
fld qword [ebx + 0x50]
jmp 0x40d245
fild dword [ebx + 0x4c]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x30], edi
fmul qword [0x454718]
mov dword [ebp - 0x34], eax
mov eax, dword [ebx + 0x10c]
fild qword [ebp - 0x34]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], edi
fmulp st(1)
fild qword [ebp - 0x34]
faddp st(1)
call fcn.0042c124
mov dword [ebp + 0x10], eax
jmp 0x40d447
mov eax, dword [ebx + 0x14]
mov edx, dword [ebx + 0x10c]
cmp ecx, edi
je 0x40d28c
mov ecx, dword [ebx + 0x120]
jmp 0x40d28f
mov ecx, dword [ebx + 0x38]
sub eax, edx
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x34], eax
push 4
fild qword [ebp - 0x34]
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], edi
fild qword [ebp - 0x34]
lea eax, [ebp - 0x30]
push edi
push eax
xor esi, esi
fdivp st(1)
fstp qword [ebp - 0x3c]
call fcn.0042bd20
add esp, 0xc
push edi
push edi
push edi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebx + 0x10c]
lea eax, [ebp - 0x30]
mov ecx, ebx
push eax
push dword [ebp - 0x14]
call fcn.0040c37a
mov edx, dword [ebx + 0x44]
mov ecx, dword [ebp - 0x30]
cmp edx, edi
jle 0x40d361
cmp dword [ebx + 0x40], 3
mov eax, edx
jne 0x40d327
dec eax
je 0x40d316
dec eax
je 0x40d305
dec eax
jne 0x40d361
mov eax, ecx
shr eax, 0xc
and eax, 0xf
mov esi, dword [eax*4 + 0x466cdc]
jmp 0x40d361
mov eax, ecx
shr eax, 0xc
and eax, 0xf
mov esi, dword [eax*4 + 0x466c9c]
jmp 0x40d361
mov eax, ecx
shr eax, 0xc
and eax, 0xf
mov esi, dword [eax*4 + 0x466c5c]
jmp 0x40d361
dec eax
je 0x40d352
dec eax
je 0x40d341
dec eax
jne 0x40d361
mov eax, ecx
shr eax, 0xc
and eax, 0xf
mov esi, dword [eax*4 + 0x466d9c]
jmp 0x40d361
mov eax, ecx
shr eax, 0xc
and eax, 0xf
mov esi, dword [eax*4 + 0x466d5c]
jmp 0x40d361
mov eax, ecx
shr eax, 0xc
and eax, 0xf
mov esi, dword [eax*4 + 0x466d1c]
mov eax, dword [ebx + 0x40]
cmp eax, 3
je 0x40d373
cmp eax, 2
je 0x40d373
cmp eax, 1
jne 0x40d3b7
mov eax, ecx
shr eax, 0xa
and eax, 3
sub eax, edi
je 0x40d385
dec eax
je 0x40d385
dec eax
jne 0x40d3b7
cmp edx, 1
mov eax, esi
jne 0x40d3a3
imul eax, eax, 0x2ee0
cdq
idiv dword [ebx + 0x58]
shr ecx, 9
and ecx, 1
add eax, ecx
shl eax, 2
jmp 0x40d3bf
imul eax, eax, 0x23280
cdq
idiv dword [ebx + 0x58]
shr ecx, 9
and ecx, 1
add eax, ecx
jmp 0x40d3bf
fld qword [ebp - 0x3c]
call fcn.0042c124
cmp dword [ebp + 0x18], edi
mov dword [ebp - 0x2c], eax
je 0x40d3ff
mov eax, dword [ebx + 0x4c]
push 8
cdq
pop esi
mov ecx, dword [ebx + 0x10c]
idiv esi
mov dword [ebp - 0x1c], edi
mov esi, eax
imul eax, dword [ebp + 0x10]
imul esi, dword [ebp + 0xc]
add eax, ecx
add esi, ecx
mov dword [ebp + 0x10], eax
sub eax, esi
mov dword [ebp - 0x20], eax
fild qword [ebp - 0x20]
fdiv qword [ebp - 0x3c]
call fcn.0042c124
mov dword [ebp - 0x1c], eax
jmp 0x40d447
push dword [ebp - 0x14]
lea eax, [ebp - 0x44]
mov ecx, ebx
push dword [ebp + 0xc]
push eax
call fcn.0040db2d
mov esi, eax
lea edi, [ebp - 0x28]
movsd dword es:[edi], dword [esi]
push dword [ebp - 0x14]
lea eax, [ebp - 0x64]
movsd dword es:[edi], dword [esi]
push dword [ebp + 0x10]
mov ecx, ebx
movsd dword es:[edi], dword [esi]
push eax
movsd dword es:[edi], dword [esi]
call fcn.0040db2d
mov esi, eax
lea edi, [ebp - 0x44]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0x38]
mov esi, dword [ebp - 0x1c]
mov dword [ebp + 0x10], eax
mov eax, dword [ebp - 0x3c]
sub eax, dword [ebp - 0x20]
xor edi, edi
mov dword [ebp - 0x1c], eax
cmp dword [ebx + 0x118], edi
je 0x40d4b5
cmp dword [ebp + 0x14], edi
jle 0x40d4b5
cmp dword [ebp + 0x18], edi
je 0x40d4b5
mov eax, dword [ebx + 0x3c]
cmp eax, edi
jbe 0x40d470
fild dword [ebp + 0x14]
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edi
fild qword [ebp - 0x3c]
fdivp st(1)
jmp 0x40d472
fldz
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x38], edi
fild qword [ebp - 0x3c]
fmul st(1)
call fcn.0042c124
mov esi, eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edi
fild qword [ebp - 0x3c]
fmul st(1)
call fcn.0042c124
cmp dword [ebx + 0x118], edi
mov dword [ebp + 0x10], eax
je 0x40d4b3
fild dword [ebp - 0x1c]
fmul st(1)
call fcn.0042c124
fstp st(0)
mov dword [ebp - 0x1c], eax
jmp 0x40d4b5
fstp st(0)
push esi
mov ecx, ebx
push dword [ebp - 0x14]
call fcn.0040d7ec
push dword [ebp + 0x10]
mov ecx, ebx
mov dword [ebp + 0xc], eax
push dword [ebp - 0x14]
call fcn.0040d7ec
push 0x989680
mov dword [ebp + 0x10], eax
call fcn.0043d181
pop ecx
mov esi, eax
mov eax, dword [ebp - 0x54]
push edi
push edi
lea ecx, [ebp - 0x54]
call dword [eax + 0x28]
cmp dword [ebx + 0x118], edi
push edi
push edi
je 0x40d5a7
push dword [ebx + 0x10c]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x18]
push edi
push eax
mov eax, dword [ebx + 0x110]
sub eax, dword [ebx + 0x10c]
push eax
push esi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x18]
lea ecx, [ebp - 0x54]
push esi
call fcn.00441dc6
lea eax, [ebp - 0x18]
push edi
push eax
mov eax, dword [ebp - 0x2c]
sub eax, dword [ebp - 0x18]
push eax
push esi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x1c]
mov ecx, eax
mov byte [esi + 0xb], al
sar ecx, 0x18
mov byte [esi + 8], cl
mov ecx, eax
sar ecx, 0x10
mov byte [esi + 9], cl
mov ecx, eax
sar ecx, 8
mov byte [esi + 0xa], cl
mov eax, dword [ebx + 0x110]
sub eax, dword [ebp + 0xc]
add eax, dword [ebp + 0x10]
mov ecx, eax
mov byte [esi + 0xf], al
shr ecx, 0x18
mov byte [esi + 0xc], cl
mov ecx, eax
shr ecx, 0x10
mov byte [esi + 0xd], cl
mov ecx, eax
shr ecx, 8
mov byte [esi + 0xe], cl
push dword [ebp - 0x18]
lea ecx, [ebp - 0x54]
push esi
call fcn.00441dc6
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebx + 0x10c]
jbe 0x40d5b3
push edi
push edi
push eax
jmp 0x40d5aa
push dword [ebp + 0xc]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push edi
push edi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebx, eax
lea eax, [ebx + 0x989680]
push edi
cmp eax, dword [ebp + 0x10]
lea eax, [ebp - 0x18]
push eax
jae 0x40d5d9
push 0x989680
jmp 0x40d5df
mov eax, dword [ebp + 0x10]
sub eax, ebx
push eax
push esi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x18]
mov eax, dword [ebp - 0x54]
add ebx, dword [ebp - 0x18]
lea ecx, [ebp - 0x54]
push esi
call dword [eax + 0x38]
cmp dword [ebp - 0x18], 0x989680
je 0x40d5c2
cmp dword [ebp + 0x1c], edi
je 0x40d617
push 0x80
lea ecx, [ebp - 0x54]
push dword [ebp + 0x1c]
call fcn.00441dc6
push esi
call fcn.0043d1aa
pop ecx
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x54]
call fcn.00441e8a
and byte [ebp - 4], 0
lea ecx, [ebp - 0x54]
call fcn.00441bb2
push 1
pop edi
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.00440d69
mov ecx, dword [ebp - 0xc]
mov eax, edi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 0x18