Function at 0x402130
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 0x402255
push 0x40604c
push esi
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
cmp esi, edi
je 0x402a6c
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 0x4021a9
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 0x4021d0
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 0x4021f6
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 0x402a6c
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 0x402242
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 0x4022c4
cmp eax, 2
mov edi, esi
jne 0x4022b6
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 0x40227a
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 0x402a6c
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 0x4022c4
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 0x402306
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
mov dword [esp + 0x60], ecx
jge 0x402306
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 0x4023aa
push str.LEVELNO
push ebx
call dword [sym.imp.MSVCRT.dll__stricmp]
add esp, 8
test eax, eax
jne 0x402340
mov dword [esp + 0x70], 1
jmp 0x40238e
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 4
jle 0x40238e
mov al, byte [ebx]
cmp al, 0x52
je 0x40235b
cmp al, 0x72
jne 0x40238e
mov al, byte [ebx + 1]
cmp al, 0x4f
je 0x402366
cmp al, 0x6f
jne 0x40238e
mov al, byte [ebx + 2]
cmp al, 0x4f
je 0x402371
cmp al, 0x6f
jne 0x40238e
mov al, byte [ebx + 3]
cmp al, 0x54
je 0x40237c
cmp al, 0x74
jne 0x40238e
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 0x4023aa
mov dword [esp + 0x8d0], eax
mov edi, dword [esp + 0x8cc]
xor edx, edx
cmp edi, edx
mov dword [esp + 0x80], edx
je 0x4023d8
cmp ecx, edx
jle 0x4023d8
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 0x4023df
mov dword [esp + 0x8cc], edx
mov edi, dword [esp + 0x8d8]
mov dword [esp + 0x50], edx
cmp edi, edx
je 0x402408
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 0x402408
mov dword [esp + 0x8d8], edx
mov eax, dword [esp + 0x8dc]
mov dword [esp + 0x34], 1
cmp eax, edx
je 0x40244b
mov eax, dword [esp + 0x24]
xor edi, edi
cmp eax, edx
mov dword [esp + 0x34], edi
je 0x40244b
mov ebx, dword [esp + 0x8c8]
push ebx
push esi
inc edi
call fcn.00402ff0
mov esi, eax
add esp, 8
test esi, esi
je 0x402447
add esi, dword [esp + 0x68]
jne 0x402430
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 0x402a2e
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x402a2e
mov eax, dword [esp + 0x20]
test eax, eax
je 0x402a2e
mov ebp, esi
test ebp, ebp
je 0x402991
mov dword [esp + 0x54], 1
jmp 0x402516
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 0x40253a
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 0x4025c5
mov edi, dword [esp + 0x8c8]
push edi
push ebx
call fcn.00402ff0
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4025af
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 0x40258c
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.00402ff0
add esp, 8
mov dword [esp + 0x64], eax
test eax, eax
je 0x4025c5
mov cl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x16], cl
jmp 0x4025c5
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 0x40261d
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4025f7
mov ecx, dword [esp + 0x8d4]
push ecx
push esi
call fcn.00402ff0
add esp, 8
mov dword [esp + 0x44], eax
test eax, eax
je 0x4025f7
mov dl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x1b], dl
test ebx, ebx
je 0x40261d
mov eax, dword [esp + 0x8d4]
push eax
push ebx
call fcn.00402ff0
add esp, 8
mov dword [esp + 0x6c], eax
test eax, eax
je 0x40261d
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 0x40267f
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x402659
mov edx, dword [esp + 0x8cc]
xor edi, edi
push edx
push esi
call fcn.00402ff0
add esp, 8
mov dword [esp + 0x4c], eax
test eax, eax
je 0x402659
mov cl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x18], cl
lea edi, [eax + ebp]
test ebx, ebx
je 0x40267f
mov edx, dword [esp + 0x8cc]
push edx
push ebx
call fcn.00402ff0
add esp, 8
mov dword [esp + 0x74], eax
test eax, eax
je 0x40267f
mov cl, byte [eax]
mov byte [eax], 0
mov byte [esp + 0x19], cl
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x402727
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x1c]
test edi, edi
mov byte [edx], 0
mov byte [eax], 0
je 0x4026c9
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 0x4026d0
mov edi, dword [esp + 0x8d8]
test esi, esi
je 0x402702
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 0x40272e
mov ecx, dword [esp + 0x2c]
push edi
push edi
push ecx
call fcn.00402b50
mov edx, dword [esp + 0x28]
push edi
push edi
push edx
call fcn.00402b50
add esp, 0x18
jmp 0x40272e
mov edi, dword [esp + 0x8d8]
mov eax, dword [esp + 0x20]
test ebx, ebx
mov byte [eax], 0
je 0x402765
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 0x40277c
mov eax, dword [esp + 0x20]
push edi
push edi
push eax
call fcn.00402b50
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 0x4029dd
test ebx, ebx
je 0x4027c1
mov edi, dword [esp + 0x20]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
jae 0x4027c1
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x402948
mov dword [esp + 0x10], 2
jmp 0x40294c
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.00402a80
mov esi, eax
mov eax, dword [esp + 0x50]
add esp, 0x14
test eax, eax
je 0x402803
cmp dword [esp + 0x58], 1
jge 0x402803
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 0x402818
xor ebp, ebp
mov dword [esp + 0x30], ebp
cmp dword [esp + 0x10], 1
jne 0x40282c
test esi, esi
jg 0x402948
jmp 0x4029dd
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 0x4028aa
or dword [esp + 0xb0], 2
test esi, esi
jle 0x4028b6
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 0x4028cf
cmp byte [ecx], 0
je 0x4028e1
lea eax, [esp + 0x84]
push eax
call dword [esp + 0x8e4]
add esp, 4
cmp ebp, 0x100
jl 0x4028fd
mov ebp, 0xff
mov dword [esp + 0xb8], 1
mov dword [esp + 0x30], ebp
lea edx, [edi + 1]
cmp edx, ebp
jg 0x40292c
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 0x402919
mov eax, dword [esp + 0xb8]
cmp eax, 1
jne 0x4029d4
test esi, esi
jle 0x4029dd
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 0x402963
mov dl, byte [esp + 0x16]
mov byte [eax], dl
mov eax, dword [esp + 0x6c]
test eax, eax
je 0x402971
mov cl, byte [esp + 0x17]
mov byte [eax], cl
mov eax, dword [esp + 0x74]
test eax, eax
je 0x40297f
mov dl, byte [esp + 0x19]
mov byte [eax], dl
cmp dword [esp + 0xb8], 2
je 0x402999
test esi, esi
jne 0x402512
mov dword [esp + 0x5c], 1
mov eax, dword [esp + 0x38]
mov esi, dword [sym.imp.MSVCRT.dll_free]
test eax, eax
je 0x4029ad
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 0x4029dd
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 0x402a09
mov cl, byte [esp + 0x1a]
mov byte [eax], cl
mov eax, dword [esp + 0x44]
test eax, eax
je 0x402a17
mov dl, byte [esp + 0x1b]
mov byte [eax], dl
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x40294c
mov cl, byte [esp + 0x18]
mov byte [eax], cl
jmp 0x40294c
mov eax, dword [esp + 0x38]
mov esi, dword [sym.imp.MSVCRT.dll_free]
test eax, eax
je 0x402a42
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x402a50
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x402a5e
push eax
call esi
add esp, 4
mov eax, dword [esp + 0x20]
test eax, eax
je 0x402a6c
push eax
call esi
add esp, 4
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x8ac
ret