Function at 0x514f20
Capabilities:
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x5331f8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, dword [esp + 0x30]
push edi
mov edi, ecx
test esi, esi
mov dword [esp + 0x10], edi
jne 0x514f5b
push esi
push esi
push esi
push 2
call fcn.005188e0
xor al, al
jmp 0x515226
mov ecx, edi
call fcn.005144a0
mov ebx, dword [sym.imp.MSVCRT.dll_fseek]
push 2
or ebp, 0xffffffff
push 0
push esi
mov dword [edi + 8], ebp
mov dword [edi + 4], ebp
call ebx
push esi
call dword [sym.imp.MSVCRT.dll_ftell]
push 0
push 0
push esi
mov edi, eax
call ebx
add esp, 0x1c
test edi, edi
jg 0x514fb9
mov al, byte [esp + 0x38]
test al, al
je 0x514fa1
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov ecx, dword [esp + 0x10]
push 0
push 0
push 0
push 0xd
call fcn.005188e0
xor al, al
jmp 0x515226
mov al, byte [esp + 0x38]
push 0
lea ecx, [esp + 0x18]
mov byte [esp + 0x18], al
call fcn.0040d460
mov eax, dword [esp + 0x20]
mov dword [esp + 0x2c], 0
cmp eax, edi
jae 0x514fe8
push 0
push edi
lea ecx, [esp + 0x1c]
call fcn.0040fac0
lea ecx, [edi + 1]
push ecx
call sub.MFC42.DLL_operatornew
push esi
mov ebx, eax
push 1
push edi
push ebx
mov dword [esp + 0x48], ebx
mov byte [ebx], 0
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x14
cmp eax, 1
mov al, byte [esp + 0x38]
je 0x51504f
test al, al
je 0x51501f
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
push ebx
call sub.MFC42.DLL_operatordelete
mov ecx, dword [esp + 0x14]
add esp, 4
push 0
push 0
push 0
push 2
call fcn.005188e0
push 1
lea ecx, [esp + 0x18]
mov dword [esp + 0x30], ebp
call fcn.0040d460
xor al, al
jmp 0x515226
test al, al
je 0x51505d
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov ebp, dword [esp + 0x34]
mov esi, ebx
mov byte [edi + ebp], 0
mov al, byte [ebp]
test al, al
je 0x515162
mov al, byte [ebx]
cmp al, 0xa
jne 0x5150c5
mov edi, ebx
sub edi, esi
inc edi
je 0x5150bd
mov edx, dword [esp + 0x1c]
push 0
lea ecx, [esp + 0x18]
lea ebp, [edx + edi]
push ebp
call fcn.0040fac0
test al, al
je 0x5150bd
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov ecx, edi
lea edi, [edx + eax]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], ebp
mov byte [ecx + ebp], 0
inc ebx
mov esi, ebx
jmp 0x515155
cmp al, 0xd
jne 0x515154
mov edi, ebx
sub edi, esi
test edi, edi
jle 0x515115
jbe 0x515115
mov edx, dword [esp + 0x1c]
push 0
lea ecx, [esp + 0x18]
lea ebp, [edx + edi]
push ebp
call fcn.0040fac0
test al, al
je 0x515115
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov ecx, edi
lea edi, [edx + eax]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], ebp
mov byte [ecx + ebp], 0
mov edx, dword [esp + 0x1c]
push 0
lea ecx, [esp + 0x18]
lea esi, [edx + 1]
push esi
call fcn.0040fac0
test al, al
je 0x515143
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
add ecx, eax
push esi
mov byte [ecx], 0xa
lea ecx, [esp + 0x18]
call fcn.0040faa0
cmp byte [ebx + 1], 0xa
jne 0x5150bd
add ebx, 2
mov esi, ebx
jmp 0x515155
inc ebx
cmp byte [ebx], 0
jne 0x515072
mov ebp, dword [esp + 0x34]
mov edi, ebx
sub edi, esi
je 0x5151aa
test edi, edi
jbe 0x5151aa
mov edx, dword [esp + 0x1c]
push 0
lea ecx, [esp + 0x18]
lea ebx, [edx + edi]
push ebx
call fcn.0040fac0
test al, al
je 0x5151aa
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov ecx, edi
lea edi, [edx + eax]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], ebx
mov byte [ecx + ebx], 0
push ebp
call sub.MFC42.DLL_operatordelete
mov eax, dword [esp + 0x1c]
add esp, 4
test eax, eax
jne 0x5151c0
mov eax, 0x535108
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x3c]
push ecx
push 0
mov edx, dword [esi]
push eax
mov ecx, esi
call dword [edx + 8]
mov al, byte [esi + 0x38]
mov ecx, dword [esp + 0x18]
test al, al
je 0x515204
test ecx, ecx
je 0x515200
mov al, byte [ecx - 1]
test al, al
je 0x5151f6
cmp al, 0xff
je 0x5151f6
dec al
mov byte [ecx - 1], al
xor al, al
jmp 0x515226
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
xor al, al
jmp 0x515226
test ecx, ecx
je 0x515224
mov al, byte [ecx - 1]
test al, al
je 0x51521a
cmp al, 0xff
je 0x51521a
dec al
mov byte [ecx - 1], al
jmp 0x515224
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x24]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x20
ret 0xc