Function at 0x407490
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov ebx, dword [ebp + 8]
xor edi, edi
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
cmp dword [ebp + 0x10], 0
je 0x4074c5
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
test byte [edx + eax + 4], 2
je 0x4074cc
xor eax, eax
jmp 0x4077b5
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
add eax, edx
test byte [eax + 4], 0x48
je 0x40752e
cmp byte [eax + 5], 0xa
je 0x40752e
mov eax, dword [ebp - 0xc]
lea edx, [eax + 1]
mov dword [ebp - 0xc], edx
mov edx, ebx
and edx, 0x1f
imul edx, edx, 0x24
mov ecx, ebx
sar ecx, 5
mov ecx, dword [ecx*4 + 0x430e14]
mov dl, byte [ecx + edx + 5]
mov byte [eax], dl
inc edi
dec dword [ebp + 0x10]
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
mov byte [edx + eax + 5], 0xa
push 0
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp + 0x10]
push eax
mov eax, dword [ebp - 0xc]
push eax
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
mov eax, dword [edx + eax]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40759e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp eax, 5
jne 0x40757f
call fcn.00403dd0
mov dword [eax], 9
or eax, 0xffffffff
jmp 0x4077b5
cmp dword [ebp - 0x10], 0x6d
jne 0x40758c
xor eax, eax
jmp 0x4077b5
mov eax, dword [ebp - 0x10]
push eax
call fcn.00403c70
pop ecx
or eax, 0xffffffff
jmp 0x4077b5
mov eax, dword [ebp - 4]
add edi, eax
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
test byte [edx + eax + 4], 0x80
je 0x4077b3
cmp dword [ebp - 4], 0
je 0x4075ed
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0xa
jne 0x4075ed
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
lea eax, [edx + eax + 4]
or byte [eax], 4
jmp 0x407608
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
lea eax, [edx + eax + 4]
and byte [eax], 0xfb
mov eax, dword [ebp + 0xc]
mov dword [ebp - 8], eax
mov esi, eax
jmp 0x40779c
cmp byte [esi], 0x1a
jne 0x407659
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
test byte [edx + eax + 4], 0x40
jne 0x4077a9
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
lea eax, [edx + eax + 4]
or byte [eax], 2
jmp 0x4077a9
cmp byte [esi], 0xd
je 0x407673
mov eax, dword [ebp - 8]
lea edx, [eax + 1]
mov dword [ebp - 8], edx
mov edx, esi
inc esi
mov dl, byte [edx]
mov byte [eax], dl
jmp 0x40779c
mov eax, dword [ebp + 0xc]
lea eax, [eax + edi - 1]
cmp esi, eax
jae 0x4076ad
cmp byte [esi + 1], 0xa
jne 0x407698
add esi, 2
mov eax, dword [ebp - 8]
lea edx, [eax + 1]
mov dword [ebp - 8], edx
mov byte [eax], 0xa
jmp 0x40779c
mov eax, dword [ebp - 8]
lea edx, [eax + 1]
mov dword [ebp - 8], edx
mov edx, esi
inc esi
mov dl, byte [edx]
mov byte [eax], dl
jmp 0x40779c
inc esi
mov dword [ebp - 0x10], 0
push 0
lea eax, [ebp - 4]
push eax
push 1
lea eax, [ebp - 0x11]
push eax
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
mov eax, dword [edx + eax]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4076ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4076f8
cmp dword [ebp - 4], 0
jne 0x407709
mov eax, dword [ebp - 8]
lea edx, [eax + 1]
mov dword [ebp - 8], edx
mov byte [eax], 0xd
jmp 0x40779c
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
test byte [edx + eax + 4], 0x48
je 0x407761
cmp byte [ebp - 0x11], 0xa
jne 0x407738
mov eax, dword [ebp - 8]
lea edx, [eax + 1]
mov dword [ebp - 8], edx
mov byte [eax], 0xa
jmp 0x40779c
mov eax, dword [ebp - 8]
lea edx, [eax + 1]
mov dword [ebp - 8], edx
mov byte [eax], 0xd
mov eax, ebx
and eax, 0x1f
imul eax, eax, 0x24
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x430e14]
mov cl, byte [ebp - 0x11]
mov byte [edx + eax + 5], cl
jmp 0x40779c
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 8]
jne 0x40777d
cmp byte [ebp - 0x11], 0xa
jne 0x40777d
mov eax, dword [ebp - 8]
lea edx, [eax + 1]
mov dword [ebp - 8], edx
mov byte [eax], 0xa
jmp 0x40779c
push 1
push 0xffffffffffffffff
push ebx
call fcn.00406c10
add esp, 0xc
cmp byte [ebp - 0x11], 0xa
je 0x40779c
mov eax, dword [ebp - 8]
lea edx, [eax + 1]
mov dword [ebp - 8], edx
mov byte [eax], 0xd
mov eax, dword [ebp + 0xc]
add eax, edi
cmp esi, eax
jb 0x407615
mov eax, dword [ebp - 8]
mov edx, dword [ebp + 0xc]
sub eax, edx
mov edi, eax
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret