Function at 0x10027600
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 0x10027678
mov al, byte [esi - 1]
test al, al
je 0x10027678
cmp al, 0xff
je 0x10027678
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 0x10027678
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 0x10027681
mov ebx, eax
test ebx, ebx
jbe 0x100276b7
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 0x100276b7
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 0x10027721
push eax
call fcn.1002ba20
add esp, 4
lea ecx, [esp + 0x18]
push eax
push edi
push str._comm__read_file__s__OpenFile_failed:__s
push 0x10048674
call fcn.1002ce00
push eax
call fcn.1002ce10
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 0x1002782c
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 0x10027791
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
test edi, edi
jbe 0x1002781d
mov ebx, dword [ebp + 8]
add ebx, edi
cmp ebx, 0xfffffffd
jbe 0x100277a9
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x100277cf
mov al, byte [ecx - 1]
test al, al
je 0x100277cf
cmp al, 0xff
je 0x100277cf
test ebx, ebx
jne 0x100277e7
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 0x1002781d
test ebx, ebx
jne 0x100277e2
test ecx, ecx
je 0x1002781d
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 0x1002781d
cmp dword [ebp + 0xc], ebx
jae 0x100277f0
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 0x1002785d
jmp 0x10027744
push 0
call fcn.1002ba20
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 0x100486a8
call fcn.1002ce00
push eax
call fcn.1002ce10
add esp, 0x10
jmp 0x10027862
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