Function at 0x1001a820
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x494
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 + 0x4a0]
mov ebx, dword [eax]
push esi
mov esi, dword [ebp + 4]
push edi
test esi, esi
mov byte [esp + 0x13], 0
je 0x1001a898
mov al, byte [esi - 1]
test al, al
je 0x1001a898
cmp al, 0xff
je 0x1001a898
push 1
mov ecx, ebp
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, esi
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
mov ecx, ebp
push edi
mov dword [esp + 0x1c], edi
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 0x1001a898
mov ecx, edi
mov edi, dword [ebp + 4]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov eax, edx
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov ecx, ebp
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 [ebp + 8]
cmp eax, ebx
jae 0x1001a8a1
mov ebx, eax
test ebx, ebx
jbe 0x1001a8d7
mov ecx, dword [ebp + 4]
sub eax, ebx
push eax
lea edx, [ecx + ebx]
push edx
push ecx
call dword [sym.imp.MSVCRT.dll_memmove]
mov esi, dword [ebp + 8]
add esp, 0xc
sub esi, ebx
mov ecx, ebp
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 0x1001a8d7
mov eax, dword [ebp + 4]
mov dword [ebp + 8], esi
mov byte [eax + esi], 0
mov ecx, 0x21
xor eax, eax
lea edi, [esp + 0x1d]
mov byte [esp + 0x1c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [esp + 0x4ac]
lea ecx, [esp + 0x1c]
push 0
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_OpenFile]
mov esi, eax
test esi, esi
mov dword [esp + 0x18], esi
jne 0x1001a941
push eax
call fcn.10013550
add esp, 4
lea ecx, [esp + 0x18]
push eax
push edi
push str._comm__read_file__s__OpenFile_failed:__s
push 0x1003580c
call fcn.100132b0
push eax
call fcn.100132c0
mov al, byte [esp + 0x23]
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x494
ret
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0xa5]
mov byte [esp + 0xa4], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [esp + 0x14], 0
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0xa4]
lea edx, [esp + 0x14]
rep stosd dword es:[edi], eax
push eax
push edx
lea eax, [esp + 0xac]
push 0x400
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1001aa4c
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 edi, dword [esp + 0x14]
mov edx, dword [ecx]
mov ecx, dword [ebp + 8]
sub edx, ecx
cmp edx, edi
ja 0x1001a9b1
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
test edi, edi
jbe 0x1001aa3d
mov ebx, dword [ebp + 8]
add ebx, edi
cmp ebx, 0xfffffffd
jbe 0x1001a9c9
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x1001a9ef
mov al, byte [ecx - 1]
test al, al
je 0x1001a9ef
cmp al, 0xff
je 0x1001a9ef
test ebx, ebx
jne 0x1001aa07
dec al
push ebx
mov byte [ecx - 1], al
mov ecx, ebp
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 0x1001aa3d
test ebx, ebx
jne 0x1001aa02
test ecx, ecx
je 0x1001aa3d
push ebx
mov ecx, ebp
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 0x1001aa3d
cmp dword [ebp + 0xc], ebx
jae 0x1001aa10
push ebx
mov ecx, ebp
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 eax, dword [ebp + 4]
mov ecx, edi
mov edi, dword [ebp + 8]
lea esi, [esp + 0xa4]
add edi, 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 [ebp + 4]
mov esi, dword [esp + 0x18]
mov dword [ebp + 8], ebx
mov byte [ecx + ebx], 0
cmp dword [esp + 0x14], 0x400
jb 0x1001aa7d
jmp 0x1001a964
push 0
call fcn.10013550
mov edx, dword [esp + 0x4b0]
add esp, 4
lea ecx, [esp + 0x18]
push eax
push edx
push str._comm__read_file__s__ReadFile_failed:__s
push 0x10035840
call fcn.100132b0
push eax
call fcn.100132c0
add esp, 0x10
jmp 0x1001aa82
mov byte [esp + 0x13], 1
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [esp + 0x13]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x494
ret