Function at 0x419770
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x43a984
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2c
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
push ebx
push ebp
mov ebp, dword [esp + 0x48]
push esi
push edi
mov edi, dword [eax]
lea ebx, [ebp + 0x18]
mov ecx, ebx
mov dword [esp + 0x14], ebx
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Split_void_]
mov eax, dword [ebx + 8]
cmp eax, edi
jae 0x4197af
mov edi, eax
test edi, edi
jbe 0x4197e6
mov ecx, dword [ebx + 4]
sub eax, edi
push eax
lea edx, [ecx + edi]
push edx
push ecx
call dword [sym.imp.MSVCRT.dll_memmove]
mov esi, dword [ebx + 8]
add esp, 0xc
sub esi, edi
mov ecx, ebx
push 0
push esi
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 0x4197e6
mov eax, dword [ebx + 4]
mov dword [ebx + 8], esi
add eax, esi
mov byte [eax], 0
mov eax, dword [ebp + 4]
mov ecx, 0x4443e4
test al, 0x40
je 0x4197f9
mov ecx, 0x449f1c
jmp 0x419802
test al, 0x20
je 0x419802
mov ecx, 0x445ef8
push ecx
mov ecx, dword [esp + 0x50]
xor esi, esi
push ecx
mov dword [ebp], esi
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
cmp eax, esi
mov dword [ebp], eax
jne 0x41986a
lea edx, [esp + 0x1c]
push edx
call fcn.004163c0
add esp, 4
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 dword [esp + 0x44], esi
mov edx, dword [ecx]
mov ecx, ebx
push edx
push esi
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__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
push 1
lea ecx, [esp + 0x20]
mov dword [esp + 0x48], 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_]
xor al, al
mov ecx, dword [esp + 0x3c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
mov ecx, dword [ebp + 4]
mov byte [esp + 0x50], 1
test cl, 0x10
mov dword [esp + 0x4c], esi
je 0x419b39
push 2
push esi
mov esi, dword [sym.imp.MSVCRT.dll_fseek]
push eax
call esi
mov eax, dword [ebp]
push eax
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [ebp]
push 0
push 0
push ecx
mov dword [ebp + 8], eax
call esi
mov eax, dword [ebp + 8]
mov esi, 0x400
add esp, 0x1c
cmp eax, esi
mov dword [esp + 0x10], esi
jge 0x4198c3
test eax, eax
mov dword [esp + 0x10], eax
je 0x419b81
mov esi, eax
push esi
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [esp + 0x14], eax
test esi, esi
je 0x4198f7
mov edx, dword [ebp]
push edx
push 1
push esi
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
sete al
test al, al
mov byte [esp + 0x50], al
je 0x419b27
mov ecx, dword [ebp + 4]
mov dword [ebp + 0x10], 1
and ecx, 0xfffffffa
mov dword [esp + 0x18], 0
mov dword [ebp + 4], ecx
mov eax, dword [0x447eb0]
test eax, eax
je 0x4199d8
mov eax, dword [esp + 0x4c]
mov esi, 0x447eb4
mov edi, dword [esi]
test edi, edi
jle 0x419945
cmp eax, dword [esp + 0x10]
jge 0x419945
mov edx, dword [esp + 0x14]
mov ecx, dword [esi - 4]
mov dl, byte [edx + eax]
cmp dl, byte [ecx + eax]
jne 0x419945
inc eax
cmp eax, edi
jl 0x41992b
cmp eax, edi
je 0x419964
mov edi, dword [esp + 0x18]
mov ecx, dword [esi + 0xc]
add esi, 0x10
inc edi
xor eax, eax
mov dword [esp + 0x18], edi
test ecx, ecx
jne 0x419925
mov dword [esp + 0x4c], eax
jmp 0x4199d8
mov ecx, dword [esp + 0x18]
mov edi, dword [ebp + 4]
mov esi, dword [ebp + 8]
mov dword [esp + 0x4c], eax
shl ecx, 4
sub esi, eax
mov edx, dword [ecx + 0x447ebc]
mov dword [ebp + 8], esi
or edx, edi
cmp eax, 2
mov dword [ebp + 4], edx
jne 0x41998d
mov dword [ebp + 0x10], eax
mov esi, dword [ecx + 0x447eb8]
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [ebp + 0x28]
push 1
mov dword [esp + 0x1c], ecx
push ecx
mov ecx, edx
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 0x4199d8
mov ecx, dword [esp + 0x18]
mov edi, dword [ebp + 0x2c]
lea eax, [ebp + 0x28]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, edx
push ecx
mov ecx, eax
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
mov edi, dword [esp + 0x10]
mov esi, dword [esp + 0x4c]
cmp edi, esi
jle 0x4199f4
mov edx, dword [ebp]
push 0
push esi
push edx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test esi, esi
jne 0x419acb
mov al, byte [esp + 0x50]
push esi
lea ecx, [esp + 0x20]
mov byte [esp + 0x20], 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_]
push 1
push edi
lea ecx, [esp + 0x24]
mov dword [esp + 0x4c], 1
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 0x419a50
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x20]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x24], eax
mov byte [ecx + eax], 0
mov eax, dword [esp + 0x20]
push ecx
test eax, eax
mov dword [esp + 0x1c], esp
mov ecx, esp
jne 0x419a64
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
lea edx, [esp + 0x30]
mov dword [ecx], eax
push edx
call fcn.00415e20
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 + 0x44], 2
mov edx, dword [ecx]
lea ecx, [ebp + 0x28]
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__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
push 1
lea ecx, [esp + 0x30]
mov byte [esp + 0x48], 1
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 eax, dword [esp + 0x20]
mov dword [esp + 0x44], 0xffffffff
test eax, eax
je 0x419acb
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x419ac2
cmp al, 0xff
je 0x419ac2
dec al
mov byte [ecx], al
jmp 0x419acb
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov eax, dword [ebp + 0x30]
test eax, eax
jne 0x419b27
mov eax, dword [esp + 0x14]
cmp byte [eax], 0x3c
jne 0x419b27
mov edi, str.UTF_8
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp + 0x28]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov dword [esp + 0x1c], ecx
push ecx
mov ecx, edx
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 0x419b27
mov edx, dword [esp + 0x18]
mov edi, dword [ebp + 0x2c]
mov ecx, edx
mov esi, str.UTF_8
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 eax, dword [ebp + 0x2c]
mov dword [ebp + 0x30], edx
add eax, edx
mov byte [eax], 0
mov ecx, dword [esp + 0x14]
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
jmp 0x419c57
test cl, 0x20
je 0x419b81
test cl, 0x40
mov dword [ebp + 0x10], 1
je 0x419b57
push eax
call dword [sym.imp.MSVCRT.dll_ftell]
add esp, 4
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
test eax, eax
jne 0x419b81
mov eax, dword [0x447eb0]
xor ecx, ecx
test eax, eax
je 0x419b81
mov edx, dword [ebp + 4]
mov eax, 0x447eb0
test dword [eax + 0xc], edx
jne 0x419bc5
mov esi, dword [eax + 0x10]
add eax, 0x10
inc ecx
test esi, esi
jne 0x419b71
mov eax, dword [ebp + 0x30]
test eax, eax
je 0x419e75
mov edx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov ecx, dword [ebp + 0x30]
lea esi, [ebp + 0x28]
mov ebp, ecx
mov eax, dword [edx]
cmp eax, ebp
jae 0x419ba2
mov ebp, eax
cmp ebx, esi
jne 0x419cd9
push eax
push ebp
mov ecx, ebx
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__::erase_unsigned_int__unsigned_int_]
push 0
push 0
mov ecx, ebx
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__::erase_unsigned_int__unsigned_int_]
jmp 0x419d5a
shl ecx, 4
mov dword [esp + 0x50], ecx
mov ecx, dword [ecx + 0x447eb4]
cmp ecx, 2
mov dword [esp + 0x4c], ecx
jne 0x419c2c
mov edx, dword [esp + 0x50]
mov dword [ebp + 0x10], ecx
or ecx, 0xffffffff
xor eax, eax
mov esi, dword [edx + 0x447eb8]
lea ebx, [ebp + 0x28]
mov edi, esi
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x1c], ecx
push ecx
mov ecx, ebx
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 0x419c2c
mov eax, dword [esp + 0x18]
mov edi, dword [ebx + 4]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebx + 8], eax
mov ebx, dword [ebx + 4]
add ebx, eax
mov byte [ebx], 0
mov eax, dword [ebp]
mov edx, dword [esp + 0x50]
mov ecx, dword [esp + 0x4c]
push eax
mov eax, dword [edx + 0x447eb0]
push 1
push ecx
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ebx, dword [esp + 0x24]
add esp, 0x10
cmp eax, 1
sete byte [esp + 0x50]
mov al, byte [esp + 0x50]
test al, al
jne 0x419b81
lea ecx, [esp + 0x2c]
push ecx
call fcn.004163c0
add esp, 4
mov edx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov dword [esp + 0x44], 3
mov ecx, dword [edx]
push ecx
push 0
push eax
mov ecx, ebx
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__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov eax, dword [esp + 0x30]
test eax, eax
je 0x419cc4
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x419cbb
cmp al, 0xff
je 0x419cbb
dec al
mov byte [ecx], al
xor al, al
mov ecx, dword [esp + 0x3c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
xor al, al
mov ecx, dword [esp + 0x3c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
test ebp, ebp
jbe 0x419d22
cmp ebp, ecx
jne 0x419d22
mov eax, dword [esi + 4]
test eax, eax
jne 0x419ced
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
cmp byte [eax - 1], 0xfe
jae 0x419d22
push 1
mov ecx, ebx
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 eax, dword [esi + 4]
test eax, eax
jne 0x419d09
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov dword [ebx + 4], eax
mov ecx, dword [esi + 8]
mov dword [ebx + 8], ecx
mov edx, dword [esi + 0xc]
mov dword [ebx + 0xc], edx
mov cl, byte [eax - 1]
inc cl
mov byte [eax - 1], cl
jmp 0x419d5a
push 1
push ebp
mov ecx, ebx
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 0x419d5a
mov esi, dword [esi + 4]
test esi, esi
jne 0x419d3e
mov esi, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov edi, dword [ebx + 4]
mov ecx, ebp
mov eax, ecx
push ebp
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, ebx
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x419dcb
mov edi, str._BOM_
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
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 edx, dword [ecx]
mov ecx, dword [ebx + 8]
sub edx, ecx
cmp edx, esi
ja 0x419d8a
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
test esi, esi
jbe 0x419dcb
mov eax, dword [ebx + 8]
mov ebp, esi
add ebp, eax
push 0
push ebp
mov ecx, ebx
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 0x419dcb
mov edi, dword [ebx + 8]
mov eax, dword [ebx + 4]
mov ecx, esi
add edi, eax
mov eax, ecx
mov esi, str._BOM_
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 [ebx + 4]
mov dword [ebx + 8], ebp
mov byte [ecx + ebp], 0
mov edi, 0x4444a8
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
repne scasb al, byte es:[edi]
mov eax, dword [edx]
mov edx, dword [ebx + 8]
not ecx
dec ecx
sub eax, edx
mov esi, ecx
cmp eax, esi
ja 0x419df3
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
test esi, esi
jbe 0x419e75
mov ebp, dword [ebx + 8]
add ebp, esi
cmp ebp, 0xfffffffd
jbe 0x419e07
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x419e2d
mov al, byte [ecx - 1]
test al, al
je 0x419e2d
cmp al, 0xff
je 0x419e2d
test ebp, ebp
jne 0x419e45
dec al
push ebp
mov byte [ecx - 1], al
mov ecx, ebx
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 0x419e75
test ebp, ebp
jne 0x419e40
test ecx, ecx
je 0x419e75
push ebp
mov ecx, ebx
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
jmp 0x419e75
cmp dword [ebx + 0xc], ebp
jae 0x419e4e
push ebp
mov ecx, ebx
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Copy_unsigned_int_]
mov edi, dword [ebx + 8]
mov edx, dword [ebx + 4]
mov ecx, esi
add edi, edx
mov edx, ecx
mov esi, 0x4444a8
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx + 4]
mov dword [ebx + 8], ebp
mov byte [eax + ebp], 0
mov ecx, dword [esp + 0x3c]
mov al, byte [esp + 0x50]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x38
ret