Function at 0x404650
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x8ac
mov eax, dword [esp + 0x8b4]
push ebx
push ebp
mov ebp, dword [sym.imp.MSVCRT.dll_malloc]
push esi
mov esi, dword [esp + 0x8bc]
push edi
xor edi, edi
cmp eax, 1
mov dword [esp + 0x10], edi
mov dword [esp + 0x24], esi
mov dword [esp + 0x38], edi
jne 0x404775
push 0x40a0cc
push esi
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
cmp esi, edi
je 0x404f8c
mov ebx, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push edi
push esi
call ebx
add esp, 0xc
test eax, eax
push esi
je 0x4046c9
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8ac
ret
call dword [sym.imp.MSVCRT.dll_ftell]
mov edi, eax
add esp, 4
cmp edi, 1
jge 0x4046f0
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8ac
ret
push 0
push 0
push esi
call ebx
add esp, 0xc
test eax, eax
je 0x404716
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8ac
ret
lea eax, [edi + 2]
push eax
call ebp
mov ebx, eax
add esp, 4
test ebx, ebx
mov dword [esp + 0x38], ebx
je 0x404f8c
push esi
push edi
push 1
push ebx
mov dword [esp + 0x34], ebx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp edi, eax
push esi
je 0x404762
call dword [sym.imp.MSVCRT.dll_fclose]
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8ac
ret
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov byte [edi + ebx], 0
mov dword [esp + 0x48], edi
jmp 0x4047e4
cmp eax, 2
mov edi, esi
jne 0x4047d6
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
mov dword [esp + 0x48], ecx
jge 0x40479a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8ac
ret
add ecx, 2
push ecx
call ebp
mov edx, eax
add esp, 4
test edx, edx
mov dword [esp + 0x38], edx
je 0x404f8c
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
mov dword [esp + 0x24], edx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4047e4
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x48], ecx
mov edi, dword [esp + 0x8c8]
or ecx, 0xffffffff
xor eax, eax
mov esi, dword [esp + 0x24]
repne scasb al, byte es:[edi]
mov edi, dword [esp + 0x8d4]
xor edx, edx
not ecx
dec ecx
cmp edi, edx
mov dword [esp + 0x68], ecx
mov dword [esp + 0x60], edx
je 0x404826
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
mov dword [esp + 0x60], ecx
jge 0x404826
mov dword [esp + 0x8d4], edx
mov ebx, dword [esp + 0x8d0]
xor ecx, ecx
cmp ebx, ecx
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x70], ecx
mov dword [esp + 0x3c], ecx
je 0x4048ca
push str.LEVELNO
push ebx
call dword [sym.imp.MSVCRT.dll__stricmp]
add esp, 8
test eax, eax
jne 0x404860
mov dword [esp + 0x70], 1
jmp 0x4048ae
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 4
jle 0x4048ae
mov al, byte [ebx]
cmp al, 0x52
je 0x40487b
cmp al, 0x72
jne 0x4048ae
mov al, byte [ebx + 1]
cmp al, 0x4f
je 0x404886
cmp al, 0x6f
jne 0x4048ae
mov al, byte [ebx + 2]
cmp al, 0x4f
je 0x404891
cmp al, 0x6f
jne 0x4048ae
mov al, byte [ebx + 3]
cmp al, 0x54
je 0x40489c
cmp al, 0x74
jne 0x4048ae
add ebx, 4
mov dword [esp + 0x3c], 1
mov dword [esp + 0x8d0], ebx
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
mov dword [esp + 0x7c], ecx
jge 0x4048ca
mov dword [esp + 0x8d0], eax
mov edi, dword [esp + 0x8cc]
xor edx, edx
cmp edi, edx
mov dword [esp + 0x80], edx
je 0x4048f8
cmp ecx, edx
jle 0x4048f8
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
mov dword [esp + 0x80], ecx
jge 0x4048ff
mov dword [esp + 0x8cc], edx
mov edi, dword [esp + 0x8d8]
mov dword [esp + 0x50], edx
cmp edi, edx
je 0x404928
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
mov dword [esp + 0x50], ecx
jge 0x404928
mov dword [esp + 0x8d8], edx
mov eax, dword [esp + 0x8dc]
mov dword [esp + 0x34], 1
cmp eax, edx
je 0x40496b
mov eax, dword [esp + 0x24]
xor edi, edi
cmp eax, edx
mov dword [esp + 0x34], edi
je 0x40496b
mov ebx, dword [esp + 0x8c8]
push ebx
push esi
inc edi
call fcn.00405b90
mov esi, eax
add esp, 8
test esi, esi
je 0x404967
add esi, dword [esp + 0x68]
jne 0x404950
mov dword [esp + 0x34], edi
mov esi, dword [esp + 0x24]
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0xbc]
rep stosd dword es:[edi], eax
mov ecx, 0x100
lea edi, [esp + 0x4bc]
or edx, 0xffffffff
push 0x8000
rep stosd dword es:[edi], eax
mov dword [esp + 0x60], edx
mov dword [esp + 0x4c0], edx
mov dword [esp + 0x34], eax
mov dword [esp + 0x7c], eax
mov dword [esp + 0xc0], eax
mov dword [esp + 0x5c], eax
mov byte [esp + 0x1e], al
mov dword [esp + 0x44], eax
mov byte [esp + 0x1a], al
mov byte [esp + 0x1f], al
mov dword [esp + 0x48], eax
mov byte [esp + 0x1b], al
mov byte [esp + 0x1c], al
mov dword [esp + 0x50], eax
mov byte [esp + 0x1d], al
mov dword [esp + 0x2c], esi
mov ebx, esi
call ebp
mov edi, eax
push 0x800
mov dword [esp + 0x34], edi
call ebp
push 0x800
mov dword [esp + 0x28], eax
call ebp
add esp, 0xc
mov dword [esp + 0x20], eax
test edi, edi
je 0x404f4e
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x404f4e
mov eax, dword [esp + 0x20]
test eax, eax
je 0x404f4e
mov ebp, esi
test ebp, ebp
je 0x404eb1
mov dword [esp + 0x54], 1
jmp 0x404a36
mov ebp, dword [esp + 0x24]
mov ecx, 0xe
xor eax, eax
lea edi, [esp + 0x84]
xor edx, edx
rep stosd dword es:[edi], eax
cmp dword [esp + 0x10], edx
jne 0x404a5a
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], edx
mov dword [esp + 0x4c], edx
cmp ebx, edx
mov dword [esp + 0x64], edx
mov dword [esp + 0x6c], edx
mov dword [esp + 0x74], edx
je 0x404ae5
mov edi, dword [esp + 0x8c8]
push edi
push ebx
call fcn.00405b90
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x404acf
mov eax, dword [esp + 0x10]
mov ecx, esi
mov edx, ebx
sub ecx, ebp
sub edx, ebp
mov dword [esp + 0x8c], ecx
test eax, eax
mov dword [esp + 0x90], edx
jne 0x404aac
mov al, byte [ebx]
mov dword [esp + 0x40], ebx
mov byte [esp + 0x1a], al
mov byte [ebx], 0
mov eax, dword [esp + 0x68]
push edi
add ebx, eax
push ebx
call fcn.00405b90
add esp, 8
mov dword [esp + 0x64], eax
test eax, eax
je 0x404ae5
mov cl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x16], cl
jmp 0x404ae5
mov eax, dword [esp + 0x48]
mov edx, esi
sub edx, ebp
mov dword [esp + 0x90], eax
mov dword [esp + 0x8c], edx
mov eax, dword [esp + 0x60]
test eax, eax
jle 0x404b3d
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x404b17
mov ecx, dword [esp + 0x8d4]
push ecx
push esi
call fcn.00405b90
add esp, 8
mov dword [esp + 0x44], eax
test eax, eax
je 0x404b17
mov dl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x1b], dl
test ebx, ebx
je 0x404b3d
mov eax, dword [esp + 0x8d4]
push eax
push ebx
call fcn.00405b90
add esp, 8
mov dword [esp + 0x6c], eax
test eax, eax
je 0x404b3d
mov cl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x17], cl
mov ebp, dword [esp + 0x80]
mov edi, esi
test ebp, ebp
jle 0x404b9f
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x404b79
mov edx, dword [esp + 0x8cc]
xor edi, edi
push edx
push esi
call fcn.00405b90
add esp, 8
mov dword [esp + 0x4c], eax
test eax, eax
je 0x404b79
mov cl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x18], cl
lea edi, [eax + ebp]
test ebx, ebx
je 0x404b9f
mov edx, dword [esp + 0x8cc]
push edx
push ebx
call fcn.00405b90
add esp, 8
mov dword [esp + 0x74], eax
test eax, eax
je 0x404b9f
mov cl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x19], cl
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x404c47
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x1c]
test edi, edi
mov byte [edx], 0
mov byte [eax], 0
je 0x404be9
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [esp + 0x2c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x8d8]
mov esi, dword [esp + 0x28]
jmp 0x404bf0
mov edi, dword [esp + 0x8d8]
test esi, esi
je 0x404c22
mov edi, dword [esp + 0x28]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x1c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x8d8]
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x50]
test eax, eax
jle 0x404c4e
mov ecx, dword [esp + 0x2c]
push edi
push edi
push ecx
call fcn.00403b40
mov edx, dword [esp + 0x28]
push edi
push edi
push edx
call fcn.00403b40
add esp, 0x18
jmp 0x404c4e
mov edi, dword [esp + 0x8d8]
mov eax, dword [esp + 0x20]
test ebx, ebx
mov byte [eax], 0
je 0x404c85
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [esp + 0x20]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x8d8]
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x50]
test eax, eax
jle 0x404c9c
mov eax, dword [esp + 0x20]
push edi
push edi
push eax
call fcn.00403b40
add esp, 0xc
mov edi, dword [esp + 0x1c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
jb 0x404efd
test ebx, ebx
je 0x404ce1
mov edi, dword [esp + 0x20]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
jae 0x404ce1
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x404e68
mov dword [esp + 0x10], 2
jmp 0x404e6c
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x7c]
mov eax, dword [esp + 0x8d0]
push ecx
mov ecx, dword [esp + 0x24]
push edx
mov edx, dword [esp + 0x24]
push eax
push ecx
push edx
call fcn.00404fa0
mov esi, eax
mov eax, dword [esp + 0x50]
add esp, 0x14
test eax, eax
je 0x404d23
cmp dword [esp + 0x58], 1
jge 0x404d23
mov esi, 1
mov dword [esp + 0x3c], 0
mov edi, dword [esp + 0x78]
lea ebp, [esi + edi]
test ebp, ebp
mov dword [esp + 0x30], ebp
jge 0x404d38
xor ebp, ebp
mov dword [esp + 0x30], ebp
cmp dword [esp + 0x10], 1
jne 0x404d4c
test esi, esi
jg 0x404e68
jmp 0x404efd
mov eax, dword [esp + 0x8e4]
mov edx, dword [esp + 0x34]
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x84], eax
lea eax, [esp + edi*4 + 0x4bc]
mov dword [esp + 0x94], edx
mov edx, dword [esp + 0x8cc]
mov dword [esp + 0x10], eax
mov eax, dword [eax]
mov dword [esp + 0x88], ecx
mov ecx, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x9c], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0xa8], edx
mov edx, dword [esp + 0x8d8]
test edi, edi
mov dword [esp + 0x98], edi
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], ecx
mov dword [esp + 0xac], edx
jle 0x404dca
or dword [esp + 0xb0], 2
test esi, esi
jle 0x404dd6
or dword [esp + 0xb0], 1
mov edx, dword [esp + edi*4 + 0xbc]
mov dword [esp + 0xb4], edx
mov dl, byte [eax]
test dl, dl
jne 0x404def
cmp byte [ecx], 0
je 0x404e01
lea eax, [esp + 0x84]
push eax
call dword [esp + 0x8e4]
add esp, 4
cmp ebp, 0x100
jl 0x404e1d
mov ebp, 0xff
mov dword [esp + 0xb8], 1
mov dword [esp + 0x30], ebp
lea edx, [edi + 1]
cmp edx, ebp
jg 0x404e4c
mov eax, dword [esp + 0xb4]
mov ecx, ebp
sub ecx, edx
lea edi, [esp + edx*4 + 0xbc]
inc ecx
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx]
inc eax
mov dword [esp + edx*4 + 0x4bc], eax
inc edx
cmp edx, ebp
jle 0x404e39
mov eax, dword [esp + 0xb8]
cmp eax, 1
jne 0x404ef4
test esi, esi
jle 0x404efd
mov dword [esp + 0x10], eax
mov esi, dword [esp + 0x28]
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x64]
inc edx
test eax, eax
mov dword [esp + 0x54], edx
je 0x404e83
mov dl, byte [esp + 0x16]
mov byte [eax], dl
mov eax, dword [esp + 0x6c]
test eax, eax
je 0x404e91
mov cl, byte [esp + 0x17]
mov byte [eax], cl
mov eax, dword [esp + 0x74]
test eax, eax
je 0x404e9f
mov dl, byte [esp + 0x19]
mov byte [eax], dl
cmp dword [esp + 0xb8], 2
je 0x404eb9
test esi, esi
jne 0x404a32
mov dword [esp + 0x5c], 1
mov eax, dword [esp + 0x38]
mov esi, dword [sym.imp.MSVCRT.dll_free]
test eax, eax
je 0x404ecd
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x2c]
push eax
call esi
mov ecx, dword [esp + 0x20]
push ecx
call esi
mov edx, dword [esp + 0x28]
push edx
call esi
mov eax, dword [esp + 0x68]
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8ac
ret
cmp eax, 2
jne 0x404efd
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x30]
mov esi, ebx
test eax, eax
mov dword [esp + 0x10], 0
mov dword [esp + 0x28], esi
mov dword [esp + 0x58], ecx
mov dword [esp + 0x78], edx
je 0x404f29
mov cl, byte [esp + 0x1a]
mov byte [eax], cl
mov eax, dword [esp + 0x44]
test eax, eax
je 0x404f37
mov dl, byte [esp + 0x1b]
mov byte [eax], dl
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x404e6c
mov cl, byte [esp + 0x18]
mov byte [eax], cl
jmp 0x404e6c
mov eax, dword [esp + 0x38]
mov esi, dword [sym.imp.MSVCRT.dll_free]
test eax, eax
je 0x404f62
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x404f70
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x404f7e
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x20]
test eax, eax
je 0x404f8c
push eax
call esi
add esp, 4
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x8ac
ret