Function at 0x406760
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
push edi
push esi
push ebx
mov dword [ebp - 0x38], 0
push 0
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x38]
push eax
push dword [0x42dc30]
call fcn.0040ee3c
mov dword [ebp - 0x40], 0x41120c
mov dword [ebp - 0x3c], 0
add esp, 0x10
lea eax, [ebp - 0x2f]
mov dword [ebp - 0x64], eax
jmp 0x4067a3
inc dword [ebp - 0x3c]
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
call sub.msvcrt.dll_getc
add esp, 0x10
cmp eax, 0xffffffff
je 0x4067bc
cmp eax, 0x50
jne 0x4067a0
mov byte [ebp - 0x30], al
mov eax, dword [ebp + 8]
push eax
push 1
push 3
mov edx, dword [ebp - 0x64]
push edx
call sub.msvcrt.dll_fread
add esp, 0x10
cmp eax, 1
jne 0x406838
movzx dx, byte [ebp - 0x30]
movzx ax, byte [ebp - 0x2f]
shl eax, 8
or edx, eax
movzx ecx, dx
movzx dx, byte [ebp - 0x2e]
movzx ax, byte [ebp - 0x2d]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
mov dword [ebp - 0x34], ecx
cmp ecx, 0x4034b50
je 0x406838
cmp ecx, 0x6054b50
je 0x406838
add esp, 0xfffffffc
push 1
push 0xfffffffffffffffd
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_fseek
add esp, 0x10
test eax, eax
je 0x4067a0
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
jmp 0x406e33
mov eax, dword [ebp - 0x3c]
mov dword [0x42dc50], eax
movzx cx, byte [ebp - 0x30]
movzx ax, byte [ebp - 0x2f]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x2e]
movzx ax, byte [ebp - 0x2d]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
cmp ecx, 0x4034b50
jne 0x406eb1
add esp, 0xfffffff4
push 0x60
call sub.msvcrt.dll_malloc
mov esi, eax
add esp, 0x10
test esi, esi
je 0x406b62
mov eax, dword [0x42dc40]
inc eax
cmp eax, dword [0x42dc40]
jb 0x406b62
mov edx, dword [ebp + 8]
push edx
push 1
push 0x1a
lea ebx, [ebp - 0x30]
push ebx
call sub.msvcrt.dll_fread
add esp, 0x10
cmp eax, 1
je 0x4068c8
add esp, 0xfffffff4
push esi
call sub.msvcrt.dll_free
add esp, 0x10
jmp 0x406eb1
movzx dx, byte [ebp - 0x30]
movzx ax, byte [ebp - 0x2f]
shl eax, 8
or edx, eax
mov word [esi + 2], dx
mov eax, dword [0x4111c8]
mov dword [ebp - 0x44], eax
mov eax, 0xb17
cmp dword [ebp - 0x44], 0
je 0x4068f3
mov eax, 0x14
mov word [esi], ax
mov edx, dword [ebp - 0x44]
mov dword [esi + 0x58], edx
movzx ax, byte [ebp - 0x2e]
mov word [ebp - 0x60], ax
movzx ax, byte [ebp - 0x2d]
shl eax, 8
or word [ebp - 0x60], ax
mov edx, dword [ebp - 0x60]
mov word [esi + 0x2c], dx
mov word [esi + 4], dx
movzx dx, byte [ebp - 0x2c]
movzx ax, byte [ebp - 0x2b]
shl eax, 8
or edx, eax
mov word [esi + 6], dx
movzx cx, byte [ebp - 0x2a]
movzx ax, byte [ebp - 0x29]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x28]
movzx ax, byte [ebp - 0x27]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
mov dword [esi + 8], ecx
movzx cx, byte [ebp - 0x26]
movzx ax, byte [ebp - 0x25]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x24]
movzx ax, byte [ebp - 0x23]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
mov dword [esi + 0xc], ecx
movzx dx, byte [ebp - 0x22]
movzx ax, byte [ebp - 0x21]
shl eax, 8
or edx, eax
movzx ebx, dx
movzx dx, byte [ebp - 0x20]
movzx ax, byte [ebp - 0x1f]
shl eax, 8
or edx, eax
shl edx, 0x10
or ebx, edx
mov dword [esi + 0x10], ebx
movzx cx, byte [ebp - 0x1e]
movzx ax, byte [ebp - 0x1d]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x1c]
movzx ax, byte [ebp - 0x1b]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
mov dword [esi + 0x14], ecx
movzx dx, byte [ebp - 0x1a]
movzx ax, byte [ebp - 0x19]
shl eax, 8
or edx, eax
movzx edi, dx
mov dword [esi + 0x18], edi
movzx dx, byte [ebp - 0x18]
movzx ax, byte [ebp - 0x17]
shl eax, 8
or edx, eax
movzx edx, dx
mov dword [esi + 0x1c], edx
mov dword [esi + 0x20], edx
mov dword [esi + 0x24], 0
mov word [esi + 0x28], 0
mov word [esi + 0x2a], 0
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 0x44], 0
je 0x406a21
and eax, 0xff
mov dword [esi + 0x30], eax
mov dword [esi + 0x50], 0
mov dword [esi + 0x54], 0
xor eax, eax
cmp dword [0x4111d0], 1
jg 0x406a3f
mov eax, ebx
mov dword [ebp - 0x34], eax
mov dword [esi + 0x44], 0
mov dword [esi + 0x40], 0
mov dword [esi + 0x3c], 0
mov dword [esi + 0x48], 0
mov dword [esi + 0x38], 0
mov dword [esi + 0x4c], 0
mov eax, dword [ebp - 0x40]
mov dword [eax], esi
mov dword [esi + 0x5c], 0
lea edx, [esi + 0x5c]
mov dword [ebp - 0x40], edx
test edi, edi
jne 0x406ab0
add esp, 0xfffffffc
mov eax, dword [0x42dc40]
inc eax
push eax
push 0x4065d9
push 0x42d790
call sub.msvcrt.dll_sprintf
add esp, 0xfffffff8
push 0x42d790
push 0x4065dd
jmp 0x406d1d
add esp, 0xfffffff4
lea eax, [edi + 1]
push eax
call sub.msvcrt.dll_malloc
mov dword [esi + 0x48], eax
add esp, 0x10
test eax, eax
je 0x406b62
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x406ae4
add esp, 0xfffffff4
push eax
call sub.msvcrt.dll_malloc
mov dword [esi + 0x3c], eax
add esp, 0x10
test eax, eax
je 0x406b62
mov eax, dword [ebp + 8]
push eax
push 1
push edi
push dword [esi + 0x48]
call sub.msvcrt.dll_fread
add esp, 0x10
cmp eax, 1
jne 0x406b36
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x406b19
mov edx, dword [ebp + 8]
push edx
push 1
push eax
push dword [esi + 0x3c]
call sub.msvcrt.dll_fread
add esp, 0x10
cmp eax, 1
jne 0x406b36
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x406b44
add esp, 0xfffffffc
push 1
push eax
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_fseek
add esp, 0x10
test eax, eax
je 0x406b44
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
jmp 0x406e33
mov eax, dword [esi + 0x48]
mov byte [edi + eax], 0
add esp, 0xfffffff4
push dword [esi + 0x48]
call fcn.0040edb8
mov edx, eax
mov dword [esi + 0x4c], edx
add esp, 0x10
test edx, edx
jne 0x406b6c
mov eax, 4
jmp 0x406f79
mov dword [esi + 0x38], edx
mov eax, dword [esi + 0x3c]
mov dword [esi + 0x40], eax
cmp dword [0x4111f4], 0
je 0x406b95
add esp, 0xfffffffc
push edx
push 0x4065fa
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
add esp, 0x10
mov eax, dword [ebp - 0x3c]
mov dword [esi + 0x34], eax
mov eax, edi
add eax, dword [esi + 0x1c]
mov edx, dword [ebp - 0x34]
lea eax, [edx + eax + 0x1e]
add dword [ebp - 0x3c], eax
inc dword [0x42dc40]
mov eax, dword [ebp - 0x60]
test al, 8
je 0x406d90
test edx, edx
jne 0x406ca4
nop
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
call sub.msvcrt.dll_getc
add esp, 0x10
cmp eax, 0xffffffff
je 0x406bdd
cmp eax, 0x50
jne 0x406bc4
mov byte [ebp - 0x30], al
mov eax, dword [ebp + 8]
push eax
push 1
push 0xf
mov edx, dword [ebp - 0x64]
push edx
call sub.msvcrt.dll_fread
add esp, 0x10
cmp eax, 1
jne 0x406c4c
movzx cx, byte [ebp - 0x30]
movzx ax, byte [ebp - 0x2f]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x2e]
movzx ax, byte [ebp - 0x2d]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
cmp ecx, 0x8074b50
je 0x406c4c
add esp, 0xfffffffc
push 1
push 0xfffffffffffffff1
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_fseek
add esp, 0x10
test eax, eax
je 0x406bc4
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
jmp 0x406e33
movzx cx, byte [ebp - 0x28]
movzx ax, byte [ebp - 0x27]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x26]
movzx ax, byte [ebp - 0x25]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
mov dword [ebp - 0x34], ecx
add dword [ebp - 0x3c], ecx
add esp, 0xfffffff4
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_ftell
mov edx, eax
mov eax, dword [ebp - 0x3c]
add eax, 0x10
add esp, 0x10
cmp edx, eax
je 0x406d2c
add esp, 0xfffffff8
push dword [esi + 0x4c]
push 0x40660c
jmp 0x406d1d
add esp, 0xfffffffc
push 0
mov edx, dword [ebp - 0x3c]
push edx
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_fseek
add esp, 0x10
test eax, eax
jne 0x406cd6
mov edx, dword [ebp + 8]
push edx
push 1
push 0x10
lea eax, [ebp - 0x30]
push eax
call sub.msvcrt.dll_fread
add esp, 0x10
cmp eax, 1
je 0x406ce4
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
jmp 0x406e33
movzx cx, byte [ebp - 0x30]
movzx ax, byte [ebp - 0x2f]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x2e]
movzx ax, byte [ebp - 0x2d]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
cmp ecx, 0x8074b50
je 0x406d2c
add esp, 0xfffffff8
push dword [esi + 0x4c]
push 0x40662c
call fcn.00402624
mov eax, 3
jmp 0x406f79
movzx cx, byte [ebp - 0x2c]
movzx ax, byte [ebp - 0x2b]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x2a]
movzx ax, byte [ebp - 0x29]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
mov dword [esi + 0xc], ecx
mov eax, dword [ebp - 0x34]
mov dword [esi + 0x10], eax
movzx cx, byte [ebp - 0x24]
movzx ax, byte [ebp - 0x23]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x22]
movzx ax, byte [ebp - 0x21]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
mov dword [esi + 0x14], ecx
add dword [ebp - 0x3c], 0x10
jmp 0x406e94
cmp dword [0x4111d0], 1
jle 0x406e94
jmp 0x406da3
inc dword [ebp - 0x3c]
add esp, 0xfffffff4
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_getc
add esp, 0x10
cmp eax, 0xffffffff
je 0x406dbc
cmp eax, 0x50
jne 0x406da0
mov byte [ebp - 0x30], al
mov edx, dword [ebp + 8]
push edx
push 1
push 3
mov eax, dword [ebp - 0x64]
push eax
call sub.msvcrt.dll_fread
add esp, 0x10
cmp eax, 1
jne 0x406e50
movzx dx, byte [ebp - 0x30]
movzx ax, byte [ebp - 0x2f]
shl eax, 8
or edx, eax
movzx ecx, dx
movzx dx, byte [ebp - 0x2e]
movzx ax, byte [ebp - 0x2d]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
mov dword [ebp - 0x34], ecx
cmp ecx, 0x4034b50
je 0x406e50
cmp ecx, 0x2014b50
je 0x406e50
add esp, 0xfffffffc
push 1
push 0xfffffffffffffffd
mov edx, dword [ebp + 8]
push edx
call sub.msvcrt.dll_fseek
add esp, 0x10
test eax, eax
je 0x406da0
add esp, 0xfffffff4
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_ferror
mov edx, 2
test eax, eax
je 0x406e46
mov edx, 0xb
mov eax, edx
jmp 0x406f79
mov eax, dword [esi + 0x34]
lea eax, [eax + edi + 0x1e]
add eax, dword [esi + 0x1c]
mov edx, dword [ebp - 0x3c]
sub edx, eax
mov dword [ebp - 0x34], edx
mov eax, dword [esi + 0x10]
cmp edx, eax
je 0x406840
add esp, 0xfffffff4
push dword [esi + 0x4c]
push edx
push eax
push 0x40666c
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
mov eax, dword [ebp - 0x34]
mov dword [esi + 0x10], eax
add esp, 0x20
jmp 0x406840
mov edx, dword [ebp + 8]
push edx
push 1
push 4
lea eax, [ebp - 0x30]
push eax
call sub.msvcrt.dll_fread
add esp, 0x10
cmp eax, 1
je 0x406840
mov edx, dword [ebp - 0x3c]
mov dword [ebp - 0x34], edx
movzx cx, byte [ebp - 0x30]
movzx ax, byte [ebp - 0x2f]
shl eax, 8
or ecx, eax
movzx ecx, cx
movzx dx, byte [ebp - 0x2e]
movzx ax, byte [ebp - 0x2d]
shl eax, 8
or edx, eax
shl edx, 0x10
or ecx, edx
cmp ecx, 0x2014b50
je 0x406f46
cmp dword [0x4111f4], 0
je 0x406f46
mov eax, 0x4066a3
cmp dword [0x4111d0], 1
jle 0x406f01
mov eax, 0x40669a
push eax
push dword [0x42dc30]
push 0x4066ac
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
add esp, 0x10
cmp dword [0x4111d0], 1
jne 0x406f46
add esp, 0xfffffff8
push 0x4066cc
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
add esp, 0xfffffff8
push 0
push 3
call fcn.004023bc
add esp, 0x20
mov eax, dword [ebp - 0x34]
mov dword [0x42d780], eax
mov eax, dword [0x42dc50]
test eax, eax
je 0x406f77
cmp dword [0x4111f4], 0
je 0x406f77
push eax
push dword [0x42dc30]
push 0x40672c
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
xor eax, eax
lea esp, [ebp - 0x88]
pop ebx
pop esi
pop edi
leave
ret