Function at 0x10002d10
Capabilities:
Read file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10044c45
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ebx
sub esp, 0x78
push esi
push edi
push 0x7588c4
push str.NuzlockeSave_s.nuz
push 0x10050d40
call fcn.10001190
add esp, 0xc
push 0x1004666c
push 0x10050d40
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov edi, eax
add esp, 8
mov dword [ebp - 0x18], edi
test edi, edi
jne 0x10002e93
push eax
mov dword [ebp - 0x30], eax
lea ecx, [ebp - 0x30]
push 0x1004643e
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], 0xf
mov byte [ebp - 0x30], al
call fcn.1000aef0
lea eax, [ebp - 0x30]
mov dword [ebp - 4], edi
push eax
mov ecx, 0x100500c0
call fcn.1000a600
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0x10
jb 0x10002de2
mov edx, dword [ebp - 0x30]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x10002dd8
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10002f37
push ecx
push edx
call fcn.10043db5
add esp, 8
mov edx, str.Cant_open_file
mov ecx, 0x100500b8
call fcn.1000c2e0
mov edx, 0x10050d40
mov ecx, eax
call fcn.1000c2e0
mov edx, str._for_reading:
mov ecx, eax
call fcn.1000c2e0
mov esi, eax
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
mov edx, eax
mov ecx, esi
call fcn.1000c2e0
lea eax, [ebp - 0x30]
push eax
call fcn.10009ee0
push eax
mov ecx, 0x10050158
call fcn.1000a2d0
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0x10
jb 0x10002e6f
mov edx, dword [ebp - 0x30]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x10002e65
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x10002e65
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.10043db5
add esp, 8
mov ecx, str.NUZLOCKE___Error
call fcn.1001e140
mov byte [0x10050d14], 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
push 0x3c
lea eax, [ebp - 0x84]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
lea eax, [ebp - 0x84]
add esp, 0xc
push edi
push 1
push 0x3c
push eax
call esi
add esp, 0x10
cmp dword [ebp - 0x84], 0x4c5a554e
je 0x10002fec
push 0
mov dword [ebp - 0x30], 0
lea ecx, [ebp - 0x30]
push 0x1004643e
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0xf
mov byte [ebp - 0x30], 0
call fcn.1000aef0
lea eax, [ebp - 0x30]
mov dword [ebp - 4], 1
push eax
mov ecx, 0x100500c0
call fcn.1000a600
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0x10
jb 0x10002f47
mov edx, dword [ebp - 0x30]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x10002f3d
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x10002f3d
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.10043db5
add esp, 8
mov edx, str.Wrong_file_magic__Expected:_0x4C5A554E_Read:_0x
mov ecx, 0x100500b8
call fcn.1000c2e0
push 0x10001ad0
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base_____cdecl___class_std::ios_base___]
push 0x10001ab0
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base_____cdecl___class_std::ios_base___]
push dword [ebp - 0x84]
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_int_]
push 0x1000c4f0
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
lea eax, [ebp - 0x48]
push eax
call fcn.10009ee0
push eax
mov ecx, 0x10050158
call fcn.1000a2d0
mov ecx, dword [ebp - 0x34]
cmp ecx, 0x10
jb 0x10002fd5
mov edx, dword [ebp - 0x48]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x10002fcb
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x10002fcb
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.10043db5
add esp, 8
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0xf
mov byte [ebp - 0x48], 0
jmp 0x10002e6f
mov eax, dword [ebp - 0x80]
mov dword [0x100508c0], eax
mov eax, dword [ebp - 0x7c]
mov dword [0x1005088c], eax
mov eax, dword [ebp - 0x78]
mov dword [0x1005004c], eax
mov eax, dword [ebp - 0x74]
mov dword [0x10050d34], eax
mov eax, dword [ebp - 0x70]
mov dword [0x10050d98], eax
mov eax, dword [ebp - 0x6c]
mov dword [0x10050d20], eax
mov eax, dword [ebp - 0x68]
mov dword [0x10050898], eax
mov eax, dword [ebp - 0x64]
mov dword [0x100508bc], eax
mov eax, dword [ebp - 0x60]
mov dword [0x100508d0], eax
movzx eax, byte [ebp - 0x58]
mov byte [0x10050d2b], al
movzx eax, byte [ebp - 0x57]
mov byte [0x10050897], al
movzx eax, byte [ebp - 0x56]
mov byte [0x10050d17], al
movzx eax, byte [ebp - 0x55]
mov byte [0x100508cf], al
movzx eax, byte [ebp - 0x54]
mov byte [0x100508ce], al
movzx eax, byte [ebp - 0x53]
mov byte [0x10050895], al
movzx eax, byte [ebp - 0x52]
push edi
push dword [0x10050068]
mov byte [0x100508cc], al
movzx eax, byte [ebp - 0x51]
mov byte [0x10050894], al
movzx eax, byte [ebp - 0x50]
push 0x28
push dword [0x1005090c]
mov byte [0x10050d15], al
call esi
push edi
push 1
push 0x28
push 0x100508d8
call esi
mov edx, dword [0x10050068]
add esp, 0x20
xor esi, esi
test edx, edx
je 0x1000319e
cmp edx, 8
jb 0x1000319e
cmp dword [0x10050558], 2
jl 0x1000319e
movd xmm0, dword [0x10050d10]
mov eax, edx
mov ecx, dword [0x1005090c]
and eax, 0xfffffff8
movaps xmm1, xmmword [0x1004c210]
add ecx, 0x50
movaps xmm3, xmmword [0x1004c230]
mov edi, eax
pshufd xmm2, xmm0, 0
nop word [eax + eax]
movd xmm0, esi
lea eax, [esi + 4]
pshufd xmm0, xmm0, 0
lea ecx, [ecx + 0x140]
paddd xmm0, xmm1
add esi, 8
pmulld xmm0, xmm3
paddd xmm0, xmm2
movd dword [ecx - 0x190], xmm0
psrldq xmm0, 4
movd dword [ecx - 0x168], xmm0
psrldq xmm0, 4
movd dword [ecx - 0x140], xmm0
psrldq xmm0, 4
movd dword [ecx - 0x118], xmm0
movd xmm0, eax
pshufd xmm0, xmm0, 0
paddd xmm0, xmm1
pmulld xmm0, xmm3
paddd xmm0, xmm2
movd dword [ecx - 0xf0], xmm0
psrldq xmm0, 4
movd dword [ecx - 0xc8], xmm0
psrldq xmm0, 4
movd dword [ecx - 0xa0], xmm0
psrldq xmm0, 4
movd dword [ecx - 0x78], xmm0
cmp esi, edi
jb 0x10003100
mov edi, dword [ebp - 0x18]
cmp esi, edx
jae 0x100031cf
mov ecx, dword [0x1005090c]
lea eax, [esi + esi*4]
lea ecx, [ecx + eax*8]
imul eax, esi, 0xc90
add eax, dword [0x10050d10]
sub edx, esi
nop dword [eax]
mov dword [ecx], eax
lea ecx, [ecx + 0x28]
add eax, 0xc90
sub edx, 1
jne 0x100031c0
push edi
mov dword [0x100508d8], 0x10046504
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov byte [0x10050d93], 0
mov byte [0x100508c4], 0
call fcn.10002900
mov ecx, dword [ebp - 0xc]
pop edi
mov dword fs:[0], ecx
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret