Function at 0x402040
Capabilities:
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x40314b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x28
mov al, byte [esp + 3]
push ebx
push ebp
push esi
mov ebx, ecx
push edi
push 0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x1c], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
lea ecx, [esp + 0x18]
push 0
push ecx
mov dword [esp + 0x48], 0
call fcn.00402a00
add esp, 8
test al, al
jne 0x4020ad
push 1
lea ecx, [esp + 0x1c]
mov byte [ebx + 0xeac], 1
mov dword [esp + 0x44], 0xffffffff
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
jmp 0x402289
lea edx, [esp + 0x28]
push str.index.dat
push edx
call fcn.00402eb0
add esp, 8
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov byte [esp + 0x40], 1
mov edx, dword [ecx]
lea ecx, [esp + 0x18]
push edx
push 0
push eax
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
push 1
lea ecx, [esp + 0x2c]
mov byte [esp + 0x44], 0
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x18]
push eax
push ecx
call fcn.00402970
add esp, 8
test al, al
je 0x4021a7
mov dl, byte [esp + 0x13]
push 0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x2c], dl
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov edi, 0x43bbac
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
lea ecx, [esp + 0x2c]
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x402160
mov edi, dword [esp + 0x2c]
mov ecx, ebp
mov eax, ecx
mov esi, 0x43bbac
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 + 0x2c]
mov dword [esp + 0x30], ebp
mov byte [ecx + ebp], 0
lea edx, [esp + 0x28]
lea eax, [esp + 0x18]
push edx
push eax
mov byte [esp + 0x48], 2
call fcn.00402870
mov edi, eax
mov eax, dword [esp + 0x34]
add esp, 8
mov byte [esp + 0x40], 0
test eax, eax
je 0x4021a3
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x40219a
cmp al, 0xff
je 0x40219a
dec al
mov byte [ecx], al
jmp 0x4021a3
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
test edi, edi
jne 0x4021d7
mov ecx, dword [esp + 0x1c]
mov byte [ebx + 0xeac], 1
test ecx, ecx
je 0x402289
mov al, byte [ecx - 1]
test al, al
je 0x40227f
cmp al, 0xff
je 0x40227f
dec al
mov byte [ecx - 1], al
jmp 0x402289
push edi
lea esi, [ebx + 4]
push 0x750
push 1
push esi
call dword [sym.imp.MSVCRT.dll_fread]
mov ebp, eax
mov eax, dword [ebx + 0x750]
add esp, 0x10
cmp eax, 0xffddee11
jne 0x402204
mov byte [ebx + 0xeac], 1
jmp 0x40220b
mov byte [ebx + 0xeac], 0
mov al, byte [ebx + 0xeac]
test al, al
je 0x40221d
push esi
mov ecx, ebx
call fcn.00402520
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
mov ecx, dword [esp + 0x20]
add esp, 4
cmp ebp, 0x750
jne 0x4021b2
test ecx, ecx
je 0x40226a
mov al, byte [ecx - 1]
test al, al
je 0x402260
cmp al, 0xff
je 0x402260
dec al
pop edi
pop esi
mov byte [ecx - 1], al
pop ebp
mov al, 1
pop ebx
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
add esp, 0x34
ret
dec ecx
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
add esp, 0x34
ret
dec ecx
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, dword [esp + 0x38]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov dword fs:[0], ecx
add esp, 0x34
ret