Function at 0x41f820
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x88
mov eax, dword [ebp + 8]
push esi
cmp dword [eax + 0x14], 0x10
push edi
mov dword [esp + 0x1c], ecx
jb 0x41f83f
mov esi, dword [eax]
jmp 0x41f841
mov esi, eax
push 0
push 0
push 0xffffffffffffffff
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov edi, eax
test edi, edi
jle 0x41fcae
push 2
push edi
call fcn.004dbc31
add esp, 8
mov dword [esp + 0xc], eax
test eax, eax
je 0x41fcae
push edi
push eax
push 0xffffffffffffffff
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ecx, dword [esp + 0xc]
test eax, eax
jne 0x41f893
mov word [ecx], ax
xorps xmm0, xmm0
xor eax, eax
xor edi, edi
movdqa xmmword [esp + 0x20], xmm0
mov dword [esp + 0x68], 0
mov dword [esp + 0x6c], 0
movq qword [esp + 0x70], xmm0
movq qword [esp + 0x78], xmm0
mov dword [esp + 0x80], 0
movq qword [esp + 0x84], xmm0
mov dword [esp + 0x8c], 0
mov dword [esp + 0x30], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
cmp dword [ebp + 0x10], eax
jne 0x41f9bc
push eax
push 0x80
push 3
push eax
push 7
push SysReAllocString
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [esp + 8], esi
cmp esi, 0xffffffff
jne 0x41f944
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
push eax
push str.Failed_to_open_file_in_read_mode__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov esi, 0x302
jmp 0x41fc41
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
jne 0x41f974
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_get_the_file_size_mode__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov esi, 0x302
jmp 0x41fbde
test edi, edi
je 0x41fb1d
lea eax, [esp + 0x20]
push eax
push 0
push edi
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_LockFileEx]
mov dword [esp + 0x10], eax
cmp eax, 1
je 0x41fb36
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_LockFileEx_in_shared_mode:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov esi, 0x302
jmp 0x41fbde
lea ecx, [esp + 0x68]
call fcn.0041ed60
mov esi, eax
test esi, esi
je 0x41f9df
push str.Failed_to_initialize_SLC_SD_ATTR.
push 4
call fcn.00417ea0
add esp, 8
jmp 0x41fc72
push 0
push str.__slc_features__
push dword [ebp + 0x10]
call fcn.004188f0
add esp, 8
test al, al
mov edx, 0x80
mov ecx, 2
cmovne ecx, edx
push ecx
push 4
lea eax, [esp + 0x90]
push eax
push 7
push 0xc2000000
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [esp + 8], esi
cmp esi, 0xffffffff
jne 0x41fa4b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_open_file_in_write_mode__error_code:_d.
push 4
call fcn.00417ea0
mov eax, dword [esp + 0x14]
add esp, 0xc
mov esi, 0x302
jmp 0x41fbe6
push 0
push dword [esp + 0x6c]
push 0
push 0
push 4
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_SetSecurityInfo]
test eax, eax
je 0x41fa90
mov esi, dword [ebp + 8]
cmp dword [esi + 0x14], 0x10
jb 0x41fa6f
mov esi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.Couldnt_reset_perms_on___s___error_code:_d.
push 4
call fcn.00417ea0
add esp, 0x10
mov esi, 0x303
jmp 0x41fbde
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
jne 0x41fac8
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_get_the_file_handle_in_write_mode__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov esi, 0x302
jmp 0x41fbde
test edi, edi
je 0x41fb10
lea eax, [esp + 0x20]
push eax
push 0
push edi
push 0
push 2
push esi
call dword [sym.imp.KERNEL32.dll_LockFileEx]
mov dword [esp + 0x10], eax
cmp eax, 1
je 0x41fb10
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_get_the_file_size_in_write_mode__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov esi, 0x302
jmp 0x41fbde
mov eax, dword [ebp + 0x10]
mov dword [eax + 0x30], esi
mov dword [eax + 0x34], edi
test edi, edi
jne 0x41fb36
push str.Got_empty_string_from_the_file__treating_as_file_doesnot_exist.
push 4
call fcn.00417ea0
add esp, 8
mov esi, 0x301
jmp 0x41fbde
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
jne 0x41fb63
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_get_the_file_size_before_reading__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov esi, 0x302
jmp 0x41fbde
lea eax, [edi + 1]
push eax
call fcn.004df659
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
jne 0x41fb94
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_allocate_memory_while_reading_the_document_content_from_file__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov esi, 7
jmp 0x41fbde
push 0
lea ecx, [esp + 0x1c]
push ecx
push edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, 1
je 0x41fbc6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_read_the_file_data__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov esi, 0x302
jmp 0x41fbde
push dword [ebp + 0xc]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
push edi
push eax
mov byte [eax + edi], 0
call fcn.00421930
mov esi, eax
mov eax, dword [esp + 8]
test eax, eax
je 0x41fc61
cmp dword [ebp + 0x10], 0
jne 0x41fc61
cmp dword [esp + 0x10], 0
je 0x41fc3b
lea ecx, [esp + 0x40]
push ecx
push 0
push edi
xorps xmm0, xmm0
push 0
movdqa xmmword [esp + 0x50], xmm0
push eax
mov dword [esp + 0x64], 0
mov dword [esp + 0x5c], 0
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x41fc41
call edi
push eax
push str.Failed_to_UnlockFileEx__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
jmp 0x41fc41
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x41fc61
call edi
push eax
push str.Failed_to_CloseHandle__error_code:_d.
push 4
call fcn.00417ea0
add esp, 0xc
mov eax, dword [esp + 0x14]
test eax, eax
je 0x41fc72
push eax
call fcn.004dbc6f
add esp, 4
push dword [esp + 0xc]
call fcn.004dbc6f
mov eax, dword [esp + 0x6c]
add esp, 4
test eax, eax
je 0x41fc95
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esp + 0x68], 0
mov eax, dword [esp + 0x6c]
test eax, eax
je 0x41fca4
push eax
call dword [sym.imp.ADVAPI32.dll_FreeSid]
mov eax, esi
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0xc
pop edi
mov eax, 9
pop esi
mov esp, ebp
pop ebp
ret 0xc