Function at 0x40a810
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41cb3e
mov eax, dword fs:[0]
push eax
sub esp, 0x26c
mov eax, dword [0x42701c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov ebx, edx
push str.reading_tail_MD_...
mov edi, ecx
push 0x4208f8
mov ecx, ebx
mov dword [ebp - 0x268], eax
mov dword [ebp - 0x26c], ebx
call fcn.004038b0
push 0x218
call fcn.0040fafb
mov esi, eax
add esp, 4
mov dword [ebp - 0x254], esi
xor eax, eax
mov dword [ebp - 4], eax
cmp esi, eax
je 0x40a8f7
push 0xc
mov dword [esi + 4], eax
call fcn.0040fafb
add esp, 4
test eax, eax
je 0x40a8c0
push edi
mov dword [esi], eax
mov dword [eax], eax
mov eax, dword [esi]
push 0x420918
lea ecx, [esi + 0xc]
push 0x104
mov dword [eax + 4], eax
push ecx
mov dword [esi + 0x214], ebx
call dword [sym.imp.SHLWAPI.dll_wnsprintfW]
add esp, 0x10
mov dword [ebp - 0x25c], esi
jmp 0x40a8fd
lea edx, [ebp - 0x264]
push edx
lea ecx, [ebp - 0x278]
mov dword [ebp - 0x264], 0
call fcn.0040fda3
push 0x424a58
lea eax, [ebp - 0x278]
push eax
mov dword [ebp - method.std::bad_alloc.virtual_0], vtable.std::bad_alloc.0
call fcn.00410c3d
mov dword [ebp - 0x25c], eax
push 0x20
mov dword [ebp - 4], 0xffffffff
call fcn.0040fa6a
mov ebx, dword [ebp + 0xc]
add esp, 4
mov dword [ebp - 0x258], eax
push 0x28
call fcn.0040fafb
add esp, 4
test eax, eax
je 0x40a948
xor ecx, ecx
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 0x14], ecx
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], ecx
mov dword [eax + 0x20], ecx
mov esi, eax
mov dword [eax + 0x24], ecx
jmp 0x40a94a
xor esi, esi
mov dword [ebp - 0x254], esi
mov edi, dword [ebp - 0x268]
push 0
push 0
push ebx
push edi
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
mov edx, dword [ebp - 0x258]
push 0
lea ecx, [ebp - 0x260]
push ecx
push 0x20
push edx
push edi
call dword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
je 0x40aabf
mov ecx, dword [ebp - 0x260]
test ecx, ecx
je 0x40aabf
xor eax, eax
test ecx, ecx
je 0x40a950
mov edi, dword [ebp - 0x258]
mov ecx, esi
sub ecx, edi
cmp eax, 0x20
jae 0x40aabf
mov dl, byte [edi]
mov byte [ecx + edi], dl
cmp byte [edi], 0
je 0x40a9c1
inc eax
inc ebx
inc edi
cmp eax, dword [ebp - 0x260]
jae 0x40a950
jmp 0x40a9a1
mov edi, dword [ebp - 0x258]
movzx ecx, byte [eax + edi + 1]
mov byte [esi + 0x20], cl
movzx edx, byte [eax + edi + 2]
mov byte [esi + 0x21], dl
movzx ecx, byte [eax + edi + 3]
mov byte [esi + 0x22], cl
movzx edx, byte [eax + edi + 4]
mov eax, dword [ebp - 0x25c]
mov byte [esi + 0x23], dl
add ebx, 5
mov dword [esi + 0x24], ebx
mov edi, dword [eax]
mov edx, dword [edi + 4]
add ebx, dword [esi + 0x20]
lea ecx, [ebp - 0x254]
push ecx
push edx
push edi
call fcn.0040acd0
mov ecx, dword [ebp - 0x25c]
mov ecx, dword [ecx + 4]
mov edx, 0x3ffffffe
sub edx, ecx
cmp edx, 1
jb 0x40aab5
mov edx, dword [ebp - 0x25c]
inc ecx
mov dword [edx + 4], ecx
mov dword [edi + 4], eax
mov ecx, dword [eax + 4]
mov dword [ecx], eax
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40aa40
push 0x1f
sub eax, edx
lea edx, [ebp - 0x50]
push edx
push eax
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.DLL_MultiByteToWideChar]
test eax, eax
js 0x40aa73
cmp eax, 0x1f
jae 0x40aa6d
xor ecx, ecx
mov word [ebp + eax*2 - 0x50], cx
jmp 0x40aa73
xor edx, edx
mov word [ebp - 0x14], dx
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x20]
push eax
push ecx
lea edx, [ebp - 0x50]
push edx
push str.item_name_s__len_d__offset_d
lea eax, [ebp - 0x250]
push 0x100
push eax
call dword [sym.imp.SHLWAPI.dll_wnsprintfW]
add esp, 0x18
lea ecx, [ebp - 0x250]
push ecx
mov ecx, dword [ebp - 0x26c]
push 0x4208f8
call fcn.004038b0
jmp 0x40a917
push str.list_T__too_long
call fcn.004181a3
push esi
call fcn.0040fa9f
mov edx, dword [ebp - 0x258]
add esp, 4
push edx
call fcn.0040fa9f
mov eax, dword [ebp - 0x25c]
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040fa5b
mov esp, ebp
pop ebp
ret 8