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

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0xc4
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0xd8]
push 0
push eax
push edi
call dword [sym.imp.MSVCRT.DLL_fseek]
mov ebp, dword [esp + 0xf0]
mov ebx, dword [sym.imp.MSVCRT.DLL_fread]
add esp, 0xc
xor esi, esi
jmp 0x407dc2
mov ebx, dword [sym.imp.MSVCRT.DLL_fread]
mov edi, dword [esp + 0xd8]
xor esi, esi
push edi
push 1
lea ecx, [esp + 0x3c]
push 8
push ecx
call ebx
mov eax, dword [esp + 0x44]
add esp, 0x10
cmp eax, 0x1006
ja 0x4082bd
je 0x40828a
cmp eax, 0x1004
ja 0x408203
je 0x4081da
cmp eax, 0x905
jb case.0x4082d3.4107
cmp eax, 0x907
ja case.0x4082d3.4107
push edi
push 1
lea edx, [esp + 0x28]
push 4
push edx
call ebx
mov eax, dword [esp + 0x48]
add eax, 0xfffffffc
push eax
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x4c]
push edi
add ecx, 0xfffffffc
push 1
push ecx
push eax
mov dword [esp + 0x34], eax
call ebx
push 0x104
mov dword [esp + 0x84], esi
mov dword [ebp + 0xc], esi
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
push 0x104
mov dword [esp + 0x48], eax
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
push 0x104
mov dword [esp + 0x58], eax
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x50]
add esp, 0x30
cmp eax, esi
mov dword [esp + 0x18], esi
jbe 0x408187
cmp dword [esp + 0x34], 0x905
je 0x407f26
mov ebx, dword [esp + 0x10]
mov esi, dword [esp + 0x5c]
mov eax, dword [esp + 0x1c]
mov edi, dword [sym.imp.MSVCRT.DLL_sprintf]
lea edx, [esi + ebx]
push edx
push 0x45f2e8
push eax
call edi
mov edx, dword [esp + 0x3c]
add esi, eax
add esp, 0xc
lea ecx, [esi + ebx]
push ecx
push 0x45f2ec
push edx
call edi
lea edx, [esi + eax + 1]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
lea edi, [edx + ebx]
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x34]
not ecx
dec ecx
cmp eax, 0x907
lea esi, [edx + ecx + 1]
jne 0x407ef4
lea edi, [esi + ebx]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea esi, [esi + ecx + 1]
mov ecx, dword [esp + 0x28]
lea eax, [esi + ebx]
push eax
push 0x45f2f0
push ecx
call dword [sym.imp.MSVCRT.DLL_sprintf]
lea esi, [esi + eax + 1]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
lea edi, [esi + ebx]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [esi + ecx + 0xd]
mov dword [esp + 0x5c], edx
jmp 0x407f8b
mov edi, dword [esp + 0x10]
mov esi, dword [esp + 0x5c]
mov ecx, dword [esp + 0x1c]
mov ebx, dword [sym.imp.MSVCRT.DLL_sprintf]
lea eax, [esi + edi]
push eax
push 0x45f2f4
push ecx
call ebx
add esi, eax
mov eax, dword [esp + 0x3c]
add esp, 0xc
lea edx, [esi + edi]
push edx
push 0x45f2f8
push eax
call ebx
mov edx, dword [esp + 0x34]
lea esi, [esi + eax + 0xa]
add esp, 0xc
lea ecx, [esi + edi]
push ecx
push 0x45f2fc
push edx
call ebx
lea edx, [esi + eax + 1]
or ecx, 0xffffffff
add edi, edx
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [edx + ecx + 1]
mov dword [esp + 0x5c], eax
mov eax, dword [ebp + 4]
mov byte [esp + 0x2f], 0
test eax, eax
mov dword [esp + 0x24], 0
jbe 0x4080b2
xor edi, edi
mov dword [esp + 0x14], edi
mov ecx, dword [ebp]
mov eax, dword [esp + 0x1c]
add edi, ecx
mov esi, dword [edi + 0x18]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x407fdd
test cl, cl
je 0x407fd9
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x407fdd
add eax, 2
add esi, 2
test cl, cl
jne 0x407fb5
xor eax, eax
jmp 0x407fe2
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x408087
mov eax, dword [ebp + 0xc]
xor edx, edx
mov dword [edi + 0x14], eax
mov eax, dword [ebp + 0xc]
test eax, eax
jbe 0x408087
mov edi, dword [ebp + 8]
add edi, 8
mov esi, dword [edi - 4]
mov eax, dword [esp + 0x28]
mov bl, byte [eax]
mov cl, bl
cmp bl, byte [esi]
jne 0x40802e
test cl, cl
je 0x40802a
mov bl, byte [eax + 1]
mov cl, bl
cmp bl, byte [esi + 1]
jne 0x40802e
add eax, 2
add esi, 2
test cl, cl
jne 0x40800a
xor eax, eax
jmp 0x408033
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40806a
mov esi, dword [edi]
mov eax, dword [esp + 0x30]
mov bl, byte [eax]
mov cl, bl
cmp bl, byte [esi]
jne 0x408061
test cl, cl
je 0x40805d
mov bl, byte [eax + 1]
mov cl, bl
cmp bl, byte [esi + 1]
jne 0x408061
add eax, 2
add esi, 2
test cl, cl
jne 0x40803d
xor eax, eax
jmp 0x408066
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x408077
mov eax, dword [ebp + 0xc]
inc edx
add edi, 0x12
cmp edx, eax
jb 0x408003
jmp 0x408087
mov ecx, dword [ebp]
mov eax, dword [esp + 0x14]
mov byte [esp + 0x2f], 1
mov dword [eax + ecx + 0x14], edx
mov eax, dword [esp + 0x24]
mov edi, dword [esp + 0x14]
mov ecx, dword [ebp + 4]
inc eax
add edi, 0x44
cmp eax, ecx
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], edi
jb 0x407fa9
mov al, byte [esp + 0x2f]
test al, al
jne 0x408172
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
push ecx
push 0x12
push edx
call fcn.004066b0
mov esi, dword [esp + 0x34]
mov dword [ebp + 8], eax
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
mov ebx, dword [esp + 0x40]
lea ecx, [ecx + ecx*8]
mov edi, ebx
mov dword [edx + ecx*2 + 4], eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
mov edi, esi
add esp, 0x14
lea ecx, [ecx + ecx*8]
mov dword [edx + ecx*2 + 8], eax
mov eax, dword [ebp + 0xc]
or ecx, 0xffffffff
lea edx, [eax + eax*8]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x24], edx
mov edx, dword [ebp + 8]
mov esi, edi
mov edi, dword [esp + 0x24]
mov eax, ecx
shr ecx, 2
mov edi, dword [edx + edi*2 + 4]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0xc]
mov edi, ebx
or ecx, 0xffffffff
lea edx, [eax + eax*8]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x24], edx
mov edx, dword [ebp + 8]
mov esi, edi
mov edi, dword [esp + 0x24]
mov eax, ecx
shr ecx, 2
mov edi, dword [edx + edi*2 + 8]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
inc dword [ebp + 0xc]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
inc eax
cmp eax, ecx
mov dword [esp + 0x18], eax
jb 0x407e7f
mov eax, dword [ebp + 4]
xor esi, esi
test eax, eax
jbe 0x4081ad
xor edi, edi
mov ecx, dword [ebp]
mov edx, dword [edi + ecx + 0x18]
push edx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
mov eax, dword [ebp + 4]
add esp, 4
inc esi
add edi, 0x44
cmp esi, eax
jb 0x408192
mov eax, dword [esp + 0x10]
push eax
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
mov ecx, dword [esp + 0x20]
push ecx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
mov edx, dword [esp + 0x30]
push edx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x3c]
push eax
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
jmp 0x408ac9
push edi
push 1
lea ecx, [esp + 0xc4]
push 0x18
push ecx
call ebx
mov edx, dword [ebp + 4]
mov eax, dword [ebp]
push edx
push 0x44
push eax
call fcn.004066b0
add esp, 0x1c
mov dword [ebp], eax
jmp 0x408acc
cmp eax, 0x1005
jne case.0x4082d3.4107
push edi
push 1
lea ecx, [esp + 0x60]
push 4
push ecx
call ebx
mov eax, dword [esp + 0x68]
lea edx, [eax + eax*2]
shl edx, 2
push edx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x6c]
push edi
push ecx
push 0xc
push eax
mov dword [esp + 0x78], eax
call ebx
mov eax, dword [esp + 0x7c]
mov ecx, dword [esp + 0x5c]
add esp, 0x24
lea eax, [eax + eax*2]
lea edx, [ecx - 4]
shl eax, 2
cmp edx, eax
je 0x408acc
sub ecx, eax
sub ecx, 4
push ecx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x3c]
mov esi, eax
mov eax, dword [esp + 0x5c]
push edi
push 1
lea eax, [eax + eax*2]
shl eax, 2
sub ecx, eax
sub ecx, 4
push ecx
push esi
call ebx
push esi
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
add esp, 0x18
jmp 0x408acc
push edi
push 1
lea edx, [esp + 0x44]
push 4
push edx
call ebx
mov eax, dword [esp + 0x4c]
lea eax, [eax + eax*2]
shl eax, 3
push eax
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x50]
push edi
push ecx
push 0x18
push eax
mov dword [esp + 0x64], eax
call ebx
add esp, 0x24
jmp 0x408acc
add eax, 0xffffeff8
cmp eax, 0xa
ja case.0x4082d3.4107
xor edx, edx
mov dl, byte [eax + 0x408b08]
jmp dword [edx*4 + 0x408af8]
mov eax, dword [esp + 0xd8]
lea ecx, [esp + 0x20]
push eax
push 1
push 4
push ecx
call dword [sym.imp.MSVCRT.DLL_fread]
mov eax, dword [esp + 0x30]
mov dword [esp + 0x54], eax
lea edx, [eax + eax*4]
shl edx, 2
push edx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov edi, eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x64], edi
lea ecx, [eax*4]
push ecx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov edx, dword [esp + 0x38]
mov ebx, eax
mov dword [esp + 0x64], ebx
lea eax, [edx*4]
push eax
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov dword [esp + 0x64], eax
mov eax, dword [esp + 0x58]
add esp, 0x1c
xor edx, edx
test eax, eax
jbe 0x4083e1
xor eax, eax
mov esi, dword [esp + 0x40]
mov ebx, dword [esp + 0x54]
inc edx
mov ecx, dword [eax + esi]
add eax, 0x18
lea ecx, [ecx + ecx*2]
lea ebx, [ebx + ecx*4]
mov ecx, dword [eax + esi - 0x14]
mov esi, dword [ebx]
lea ecx, [ecx + ecx*4]
lea ecx, [edi + ecx*4]
mov dword [ecx], esi
mov esi, dword [ebx + 4]
mov dword [ecx + 4], esi
mov esi, dword [ebx + 8]
mov ebx, dword [esp + 0x54]
mov dword [ecx + 8], esi
mov esi, dword [esp + 0x40]
mov ecx, dword [eax + esi - 0x10]
lea ecx, [ecx + ecx*2]
lea ebx, [ebx + ecx*4]
mov ecx, dword [eax + esi - 0xc]
mov esi, dword [ebx]
lea ecx, [ecx + ecx*4]
lea ecx, [edi + ecx*4]
mov dword [ecx], esi
mov esi, dword [ebx + 4]
mov dword [ecx + 4], esi
mov esi, dword [ebx + 8]
mov ebx, dword [esp + 0x54]
mov dword [ecx + 8], esi
mov esi, dword [esp + 0x40]
mov ecx, dword [eax + esi - 8]
lea ecx, [ecx + ecx*2]
lea ebx, [ebx + ecx*4]
mov ecx, dword [eax + esi - 4]
mov esi, dword [ebx]
lea ecx, [ecx + ecx*4]
lea ecx, [edi + ecx*4]
mov dword [ecx], esi
mov esi, dword [ebx + 4]
mov dword [ecx + 4], esi
mov esi, dword [ebx + 8]
mov dword [ecx + 8], esi
mov ecx, dword [esp + 0x3c]
cmp edx, ecx
jb 0x40834a
mov ebx, dword [esp + 0x4c]
mov edx, dword [esp + 0x54]
push edx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x3c]
add esp, 4
add eax, 0xfffffffc
xor edi, edi
test eax, eax
mov dword [esp + 0x18], eax
jbe 0x408acc
mov ecx, dword [esp + 0xd8]
mov esi, dword [sym.imp.MSVCRT.DLL_fread]
push ecx
push 1
lea edx, [esp + 0x70]
push 1
push edx
call esi
mov ecx, dword [esp + 0x78]
mov eax, dword [esp + 0xe8]
and ecx, 0xff
push eax
push ecx
lea edx, [esp + 0x81]
push 8
push edx
call esi
mov ecx, dword [esp + 0x88]
add esp, 0x20
xor dl, dl
test cl, cl
jbe 0x408477
mov eax, dword [esp + 0x48]
mov esi, ebx
sub esi, dword [esp + 0x48]
lea eax, [eax + edi*4]
test dl, dl
jne 0x408471
mov ecx, dword [esp + 0x69]
inc edi
mov dword [esi + eax], ecx
mov ecx, dword [esp + 0x6d]
mov dword [eax], ecx
mov ecx, dword [esp + 0x68]
add eax, 4
inc dl
cmp dl, cl
jb 0x408458
mov eax, dword [esp + 0x18]
and ecx, 0xff
shl ecx, 3
or edx, 0xffffffff
sub edx, ecx
add eax, edx
mov dword [esp + 0x18], eax
jne 0x408403
jmp 0x408acc
mov edi, dword [esp + 0xd8]
mov esi, dword [sym.imp.MSVCRT.DLL_fread]
push edi
push 1
lea eax, [esp + 0x68]
push 2
push eax
call esi
mov edx, dword [esp + 0x48]
mov ecx, dword [esp + 0x70]
add edx, 0xfffffffe
mov dword [esp + 0x74], ecx
push edx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ebx, eax
mov eax, dword [esp + 0x4c]
push edi
add eax, 0xfffffffe
push 1
push eax
push ebx
call esi
xor edi, edi
add esp, 0x24
cmp word [esp + 0x60], di
mov dword [esp + 0x10], edi
jbe 0x4085f1
mov eax, dword [esp + 0x10]
test eax, eax
je 0x408509
mov ecx, dword [ebp + 4]
mov edx, dword [ebp]
push ecx
push 0x44
push edx
call fcn.004066b0
add esp, 0xc
mov dword [ebp], eax
push 0x104
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp + 4]
add esp, 4
mov edx, ecx
shl edx, 4
add edx, ecx
mov ecx, dword [ebp]
mov dword [ecx + edx*4 + 0x18], eax
mov eax, dword [ebp + 4]
mov ecx, eax
lea edx, [edi + ebx]
shl ecx, 4
push edx
mov edx, dword [ebp]
add ecx, eax
push 0x45f300
mov eax, dword [edx + ecx*4 + 0x18]
push eax
call dword [sym.imp.MSVCRT.DLL_sprintf]
add edi, eax
mov eax, dword [ebp + 4]
mov edx, eax
mov esi, dword [edi + ebx]
add edi, 4
shl edx, 4
add edx, eax
mov eax, dword [ebp]
lea ecx, [esi + esi*2]
mov dword [eax + edx*4 + 0xc], ecx
lea ecx, [esi + esi*2]
shl ecx, 2
push ecx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp + 4]
add esp, 0x10
mov edx, ecx
shl edx, 4
add edx, ecx
mov ecx, dword [ebp]
mov dword [ecx + edx*4 + 0x10], eax
mov eax, dword [ebp + 4]
mov edx, eax
shl edx, 4
add edx, eax
mov eax, dword [ebp]
test esi, esi
mov eax, dword [eax + edx*4 + 0x10]
jle 0x4085cf
lea ecx, [eax + 8]
mov eax, dword [edi + ebx]
mov edx, dword [esp + 0x40]
add edi, 4
add ecx, 0xc
lea eax, [eax + eax*2]
shl eax, 3
dec esi
mov edx, dword [eax + edx + 4]
mov dword [ecx - 0x14], edx
mov edx, dword [esp + 0x40]
mov edx, dword [eax + edx + 0xc]
mov dword [ecx - 0x10], edx
mov edx, dword [esp + 0x40]
mov eax, dword [eax + edx + 0x14]
mov dword [ecx - 0xc], eax
jne 0x40859c
mov edx, dword [ebp + 4]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x60]
inc edx
inc eax
and ecx, 0xffff
cmp eax, ecx
mov dword [ebp + 4], edx
mov dword [esp + 0x10], eax
jb 0x4084ec
mov edx, dword [esp + 0x40]
push edx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
push ebx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
add esp, 8
jmp 0x408acc
push edi
push 1
lea eax, [esp + 0x28]
push 4
push eax
call ebx
mov eax, dword [esp + 0x44]
add esp, 0x10
cmp eax, 0x1011
jne 0x40876a
mov eax, dword [esp + 0x20]
lea ecx, [eax + eax*8]
lea edx, [eax + ecx*2]
shl edx, 1
push edx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x24]
add esp, 4
cmp ecx, esi
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], esi
jbe 0x4088ea
lea esi, [eax + 0x22]
mov eax, dword [esp + 0xd8]
push eax
call dword [sym.imp.MSVCRT.DLL_ftell]
mov ecx, dword [esp + 0xdc]
lea edi, [esi - 0x22]
push ecx
push 1
push 0x20
push edi
mov ebx, eax
call dword [sym.imp.MSVCRT.DLL_fread]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edi, dword [esp + 0xec]
push 0
not ecx
dec ecx
lea edx, [ecx + ebx + 1]
push edx
push edi
call dword [sym.imp.MSVCRT.DLL_fseek]
push edi
push 1
lea eax, [esi - 2]
push 6
push eax
call dword [sym.imp.MSVCRT.DLL_fread]
mov al, byte [esi - 1]
mov edi, dword [esi]
add esp, 0x30
test al, al
jne 0x408749
lea ecx, [edi*8]
push ecx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov edx, dword [esp + 0xdc]
mov ebx, eax
push edx
push edi
push 8
push ebx
mov dword [esp + 0x24], ebx
call dword [sym.imp.MSVCRT.DLL_fread]
mov eax, dword [esp + 0x58]
add esp, 0x14
test eax, eax
jbe 0x408740
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x48]
mov ebx, dword [esp + 0x4c]
mov edx, dword [esp + 0x44]
add ecx, 0xc
sub ebx, eax
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x14]
cmp dword [eax + ebx], edx
jne 0x40872b
mov edx, dword [eax]
cmp edx, edi
jae 0x40872b
mov ebx, dword [esp + 0x10]
mov ebx, dword [ebx + edx*8]
mov dword [ecx], ebx
mov ebx, dword [esp + 0x10]
mov edx, dword [ebx + edx*8 + 4]
mov ebx, dword [esp + 0x1c]
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x18]
add eax, 4
add ecx, 0x14
dec edx
mov dword [esp + 0x18], edx
jne 0x408704
mov ebx, dword [esp + 0x10]
push ebx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
inc eax
add esi, 0x26
cmp eax, ecx
mov dword [esp + 0x14], eax
jb 0x408653
mov eax, dword [esp + 0x24]
jmp 0x4088ea
cmp eax, 0x1012
jne 0x4088f3
mov eax, dword [esp + 0x20]
lea ecx, [eax + eax*4]
shl ecx, 3
sub ecx, eax
push ecx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x24]
add esp, 4
cmp ecx, esi
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], esi
jbe 0x4088ea
lea esi, [eax + 0x23]
mov edx, dword [esp + 0xd8]
push edx
call dword [sym.imp.MSVCRT.DLL_ftell]
mov ebx, eax
mov eax, dword [esp + 0xdc]
push eax
lea edi, [esi - 0x23]
push 1
push 0x20
push edi
call dword [sym.imp.MSVCRT.DLL_fread]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edi, dword [esp + 0xec]
push 0
not ecx
dec ecx
lea ecx, [ecx + ebx + 1]
push ecx
push edi
call dword [sym.imp.MSVCRT.DLL_fseek]
push edi
push 1
lea edx, [esi - 3]
push 7
push edx
call dword [sym.imp.MSVCRT.DLL_fread]
mov al, byte [esi - 1]
mov edi, dword [esi]
add esp, 0x30
test al, al
jne 0x408897
lea eax, [edi*8]
push eax
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0xdc]
mov ebx, eax
push ecx
push edi
push 8
push ebx
mov dword [esp + 0x24], ebx
call dword [sym.imp.MSVCRT.DLL_fread]
mov eax, dword [esp + 0x58]
add esp, 0x14
test eax, eax
jbe 0x40888e
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x48]
mov ebx, dword [esp + 0x4c]
lea ecx, [edx + 0xc]
mov edx, dword [esp + 0x44]
sub ebx, eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], ebx
mov edx, dword [esp + 0x14]
cmp dword [ebx + eax], edx
jne 0x408879
mov edx, dword [eax]
cmp edx, edi
jae 0x408879
mov ebx, dword [esp + 0x10]
mov ebx, dword [ebx + edx*8]
mov dword [ecx], ebx
mov ebx, dword [esp + 0x10]
mov edx, dword [ebx + edx*8 + 4]
mov ebx, dword [esp + 0x1c]
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x18]
add eax, 4
add ecx, 0x14
dec edx
mov dword [esp + 0x18], edx
jne 0x408852
mov ebx, dword [esp + 0x10]
push ebx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
add esp, 4
mov ebx, dword [esp + 0xd8]
push ebx
call dword [sym.imp.MSVCRT.DLL_ftell]
mov cl, byte [esi - 2]
add esp, 4
test cl, cl
je 0x4088b2
lea eax, [eax + edi*4]
mov cl, byte [esi - 1]
test cl, cl
jne 0x4088be
lea edi, [eax + edi*4]
jmp 0x4088c1
lea edi, [eax + edi*8]
push 0
push edi
push ebx
call dword [sym.imp.MSVCRT.DLL_fseek]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x2c]
add esp, 0xc
inc eax
add esi, 0x27
cmp eax, ecx
mov dword [esp + 0x14], eax
jb 0x4087a1
mov eax, dword [esp + 0x24]
push eax
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [esp + 0x44]
lea eax, [eax + eax*4]
shl eax, 2
push eax
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp + 4]
mov edx, dword [esp + 0x68]
mov dword [esp + 0x20], eax
and edx, 0xffff
mov eax, ecx
add esp, 4
sub eax, edx
cmp eax, ecx
mov dword [esp + 0x24], eax
jae 0x408a71
mov ecx, eax
shl ecx, 4
add ecx, eax
shl ecx, 2
mov dword [esp + 0x28], ecx
mov eax, dword [ebp]
mov ecx, dword [esp + 0x28]
add eax, ecx
xor ebx, ebx
mov dword [esp + 0x30], ebx
mov edx, dword [eax + 0xc]
mov ecx, dword [eax + 0x10]
cmp edx, ebx
jbe 0x4089f9
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], edx
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x50]
xor edi, edi
mov eax, dword [eax]
test ebx, ebx
lea ecx, [eax + eax*4]
lea esi, [edx + ecx*4]
jbe 0x4089a2
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x10]
push esi
push ecx
call fcn.00407d10
add esp, 8
test eax, eax
je 0x408a9b
mov ecx, dword [esp + 0x10]
inc edi
add ecx, 0x14
cmp edi, ebx
mov dword [esp + 0x10], ecx
jb 0x40897c
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x28]
mov ecx, 5
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp]
add eax, 0x14
mov dword [esp + 0x18], eax
mov ecx, dword [edx + ecx + 0x10]
mov edx, dword [esp + 0x30]
mov word [ecx + edx*2], bx
inc ebx
cmp ebx, 0xffff
jae 0x4089f9
mov ecx, dword [ebp]
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x30]
mov edi, dword [esp + 0x14]
mov esi, dword [edx + ecx + 0xc]
inc eax
add edi, 4
cmp eax, esi
mov dword [esp + 0x30], eax
mov dword [esp + 0x14], edi
jb 0x40895e
mov eax, dword [ebp]
mov edi, dword [esp + 0x28]
mov ecx, dword [esp + 0x30]
lea esi, [ebx + ebx*4]
mov dword [edi + eax + 0xc], ecx
mov edx, dword [ebp]
shl esi, 2
push esi
mov dword [edi + edx], ebx
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp]
lea edx, [ebx + ebx*2]
shl edx, 2
push edx
mov dword [edi + ecx + 4], eax
call sub.MSVCRT.DLL_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp]
add esp, 8
mov dword [edi + ecx + 8], eax
mov edx, dword [ebp]
mov ecx, esi
mov esi, dword [esp + 0x1c]
mov edi, dword [edi + edx + 4]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov edx, dword [esp + 0x28]
mov ecx, eax
mov eax, dword [esp + 0x24]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 4]
inc eax
add edx, 0x44
cmp eax, ecx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edx
jb 0x408935
mov ecx, dword [esp + 0x4c]
push ecx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
mov edx, dword [esp + 0x4c]
push edx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x58]
push eax
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
mov ecx, dword [esp + 0x28]
push ecx
call sub.MSVCRT.DLL_void___cdecl_operator_delete_void__
jmp 0x408ac9
mov edx, dword [ebp]
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + edx + 0x10]
mov edx, dword [esp + 0x30]
mov word [ecx + edx*2], di
jmp 0x4089d2
push edi
call dword [sym.imp.MSVCRT.DLL_ftell]
mov ecx, dword [esp + 0x3c]
push esi
add eax, ecx
push eax
push edi
call dword [sym.imp.MSVCRT.DLL_fseek]
add esp, 0x10
mov ecx, dword [esp + 0x38]
mov eax, dword [esp + 0xe0]
mov edx, 0xfffffff8
sub edx, ecx
add eax, edx
mov dword [esp + 0xe0], eax
jne 0x407db3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc4
ret