Function at 0x140001070
Capabilities:
Write file on windows

Disassembly:
push rsi
push rdi
sub rsp, 0x58
mov rax, qword [section..data]
xor rax, rsp
mov qword [rsp + 0x30], rax
mov rdi, rcx
mov esi, edx
lea rcx, str.1._creating_VMC_file..._n
call fcn.140001010
lea rdx, [0x14000337c]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov qword [0x140005800], rax
test rax, rax
jne 0x1400010bd
mov eax, 0xffffff9b
jmp 0x140001941
mov qword [rsp + 0x78], rbx
lea rdx, str.Sony_PS2_Memory_Card_Format
mov qword [rsp + 0x80], rbp
lea rbx, [0x140005680]
xor eax, eax
mov qword [rsp + 0x88], r12
xorps xmm0, xmm0
mov qword [rsp + 0x40], r15
xor r15d, r15d
mov qword [0x1400056a0], rax
mov ecx, r15d
movups xmmword [0x140005680], xmm0
movups xmmword [0x140005690], xmm0
nop word [rax + rax]
movzx eax, byte [rcx + rdx]
mov byte [rcx + rbx], al
lea rcx, [rcx + 1]
test al, al
jne 0x140001110
lea rcx, [rbx - 1]
cmp byte [rcx + 1], r15b
lea rcx, [rcx + 1]
jne 0x140001123
lea rdi, str.1.2.0.0
xor edx, edx
nop word [rax + rax]
movzx eax, byte [rdi + rdx]
mov byte [rcx + rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140001140
movdqa xmm0, xmmword [0x1400034a0]
lea rcx, str.2._clearing_all_clusters..._n
mov eax, 0x200
shl esi, 0xa
shr esi, 0xa
mov r12, 0xffffffffffffffff
mov qword [rsp + 0x50], r13
movdqa xmm1, xmm0
mov dword [0x1400056b0], esi
mov qword [rsp + 0x48], r14
mov dword [0x1400057d4], 0x400
mov dword [0x1400056aa], 0x100002
mov word [0x1400056a8], ax
mov dword [0x1400057dc], 8
mov word [0x1400057d0], 0x2b02
mov dword [0x1400057e0], r12d
mov dword [0x1400057d8], 0x100
movdqa xmmword [0x140005750], xmm0
movdqa xmmword [0x140005760], xmm0
movdqa xmmword [0x140005770], xmm0
movdqa xmmword [0x140005780], xmm0
movdqa xmmword [0x140005790], xmm0
movdqa xmmword [0x1400057a0], xmm0
movdqa xmmword [0x1400057b0], xmm0
movdqa xmmword [0x1400057c0], xmm0
call fcn.140001010
mov edx, 0xff
lea rcx, [0x140005810]
mov r8d, 0x4010
call sub.VCRUNTIME140.dll_memset
mov eax, dword [0x1400056b0]
mov ebp, r15d
test eax, eax
je 0x140001282
nop dword [rax]
mov edx, dword [0x1400057d4]
xor r8d, r8d
mov rsi, qword [0x140005800]
imul edx, ebp
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov edi, dword [0x1400057d4]
lea rcx, [0x140005810]
shl edi, 4
mov r9, rsi
movsxd r8, edi
mov edx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp eax, edi
jne 0x14000138e
mov eax, dword [0x1400056b0]
add ebp, 0x10
cmp ebp, eax
jb 0x140001230
mov ecx, dword [0x1400057d4]
lea eax, [rax*4 - 1]
xor edx, edx
div ecx
xor edx, edx
lea esi, [rax + 1]
lea eax, [rsi*4 - 1]
div ecx
lea ebp, [rax + 1]
mov dword [rsp + 0x28], ebp
cmp ebp, 0x20
jle 0x1400012c0
mov esi, dword [0x1400057d8]
mov ebp, 0x20
mov dword [rsp + 0x28], ebp
shl esi, 5
nop
movzx r14d, word [0x1400056ac]
mov rax, r15
shr r14d, 1
mov qword [0x1400056d0], r12
mov qword [0x1400056d8], r12
mov qword [0x1400056e0], r12
mov qword [0x1400056e8], r12
mov qword [0x1400056f0], r12
mov qword [0x1400056f8], r12
mov qword [0x140005700], r12
mov qword [0x140005708], r12
mov qword [0x140005710], r12
mov qword [0x140005718], r12
mov qword [0x140005720], r12
mov qword [0x140005728], r12
mov qword [0x140005730], r12
mov qword [0x140005738], r12
mov qword [0x140005740], r12
mov qword [0x140005748], r12
movsxd rdi, ebp
test ebp, ebp
jle 0x140001366
nop word [rax + rax]
mov dword [rbx + rax*4 + 0x50], r14d
inc rax
inc r14d
cmp rax, rdi
jl 0x140001350
mov ecx, dword [0x1400057d4]
imul ecx, ebp
mov dword [rsp + 0x20], r14d
add ecx, 0xff
cmovb rcx, r12
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r12, rax
test rax, rax
jne 0x140001398
lea edi, [rax - 0x67]
jmp 0x1400018e0
mov edi, 0xffffff9a
jmp 0x1400018e0
mov r8d, dword [0x1400057d4]
xor edx, edx
imul r8d, ebp
mov rcx, r12
call sub.VCRUNTIME140.dll_memset
movsxd rcx, esi
mov rax, r15
test esi, esi
jle 0x1400013dc
nop word [rax + rax]
cmp r14d, dword [0x1400056b0]
jae 0x1400015d9
mov dword [r12 + rax*4], r14d
inc rax
inc r14d
cmp rax, rcx
jl 0x1400013c0
lea rcx, str.3._writing_ifc_clusters..._n
call fcn.140001010
mov r13d, r15d
test ebp, ebp
jle 0x14000144b
nop
mov edx, dword [0x1400057d4]
xor r8d, r8d
mov rsi, qword [0x140005800]
mov ebp, edx
imul edx, dword [rbx + r15*4 + 0x50]
mov rcx, rsi
imul ebp, r13d
add rbp, r12
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
movsxd rdi, dword [0x1400057d4]
mov r9, rsi
mov r8, rdi
mov edx, 1
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp eax, edi
jne 0x1400015ec
movsxd rcx, dword [rsp + 0x28]
inc r13d
inc r15
cmp r15, rcx
jl 0x1400013f0
mov rcx, r12
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r8d, dword [0x1400056b0]
xor edx, edx
movzx edi, word [0x1400056b2]
mov eax, r8d
div dword [0x1400057dc]
lea ecx, [rax - 1]
add eax, 0xfffffffe
mov dword [0x1400056c0], ecx
movzx ecx, r8w
imul edx, ecx, 0x4dd3
mov dword [0x1400056c4], eax
imul eax, edi, 0x4dd3
shr r8d, 0x1f
shr edx, 0x10
add edx, eax
imul eax, ecx, 0x1062
add edx, eax
imul eax, edi, 0x1062
sar edx, 0x10
movzx ecx, dx
add ecx, eax
shr ecx, 6
sub ecx, r8d
imul eax, ecx, 0x3e8
lea rcx, str.4._writing_fat_clusters..._n
inc eax
mov dword [0x1400057f0], eax
call fcn.140001010
mov esi, dword [0x1400057dc]
xor edx, edx
mov eax, dword [0x1400056b0]
mov ecx, esi
div esi
xor r15d, r15d
lea r13d, [rax - 2]
imul ecx, r13d
cmp r14d, ecx
jae 0x1400015b5
mov edi, dword [0x1400057d8]
mov r12d, dword [rsp + 0x20]
nop
mov ebp, dword [0x1400057d4]
lea rcx, [0x140005810]
mov r8d, ebp
xor edx, edx
call sub.VCRUNTIME140.dll_memset
imul esi, r13d
sub esi, r14d
cmp esi, edi
cmova esi, edi
test esi, esi
jle 0x140001538
movsxd rcx, esi
lea rdi, [0x140005810]
mov eax, 0x7fffffff
rep stosd dword [rdi], eax
test r15d, r15d
jne 0x140001555
mov dword [0x1400056b4], r14d
mov dword [0x1400056bc], r15d
mov dword [0x140005810], 0xffffffff
imul ebp, r12d
add r15d, esi
mov rsi, qword [0x140005800]
xor r8d, r8d
mov rcx, rsi
mov edx, ebp
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
movsxd rdi, dword [0x1400057d4]
lea rcx, [0x140005810]
mov r8, rdi
mov r9, rsi
mov edx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp eax, edi
jne 0x140001602
mov esi, dword [0x1400057dc]
inc r12d
mov edi, dword [0x1400057d8]
mov eax, esi
imul eax, r13d
add r14d, edi
cmp r14d, eax
jb 0x140001500
mov eax, esi
imul eax, r13d
sub eax, dword [0x1400056b4]
mov dword [0x1400056b8], eax
cmp r15d, esi
jae 0x14000160f
mov edi, 0xffffff94
xor r15d, r15d
jmp 0x1400018e0
mov rcx, r12
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edi, 0xffffff98
jmp 0x1400018e0
mov rcx, r12
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor r15d, r15d
mov edi, 0xffffff97
jmp 0x1400018e0
mov edi, 0xffffff95
xor r15d, r15d
jmp 0x1400018e0
mov eax, dword [0x1400056bc]
lea rcx, [rsp + 0x28]
xor r15d, r15d
mov dword [0x1400057fc], 0xffffffff
mov qword [0x1400057e8], r15
mov dword [0x1400057e4], eax
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
lea rcx, [rsp + 0x28]
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__gmtime64]
mov r8, rax
mov byte [rsp + 0x20], r15b
mov edi, dword [rax]
mov edx, edi
sar edx, 2
mov ecx, edi
sar ecx, 4
and dl, 0xfc
add dl, cl
and dil, 0xf
add dl, dl
add dl, dil
mov edi, 0xfffc
mov byte [rsp + 0x21], dl
mov edx, dword [rax + 4]
mov ecx, edx
sar ecx, 2
mov eax, edx
and cl, 0xfc
sar eax, 4
add cl, al
and dl, 0xf
add cl, cl
add cl, dl
mov edx, dword [r8 + 8]
mov byte [rsp + 0x22], cl
mov eax, edx
mov ecx, edx
sar eax, 4
sar ecx, 2
and dl, 0xf
and cl, 0xfc
add cl, al
add cl, cl
add cl, dl
mov edx, dword [r8 + 0xc]
mov byte [rsp + 0x23], cl
mov eax, edx
mov ecx, edx
sar eax, 4
sar ecx, 2
and dl, 0xf
and cl, 0xfc
add cl, al
movzx eax, byte [r8 + 0x10]
add cl, cl
inc al
add cl, dl
and al, 0xf
mov edx, dword [r8 + 0x14]
mov r8d, 0x200
mov byte [rsp + 0x24], cl
mov byte [rsp + 0x25], al
lea eax, [rdx - 0x64]
sub dx, 4
mov ecx, eax
and dx, 0xf
sar ecx, 2
and cx, di
sar eax, 4
add cx, ax
mov eax, 0x7d0
or dx, ax
add cx, cx
add cx, dx
xor edx, edx
mov word [rsp + 0x26], cx
lea rcx, [0x140005810]
call sub.VCRUNTIME140.dll_memset
xor edx, edx
lea rcx, [0x140005a10]
mov r8d, 0x200
call sub.VCRUNTIME140.dll_memset
mov ecx, 0x2e
mov dword [0x140005814], 2
mov word [0x140005850], cx
mov eax, 0x8427
mov word [0x140005810], ax
mov ecx, 0xa426
mov rax, qword [rsp + 0x20]
mov qword [0x140005818], rax
mov qword [0x140005828], rax
mov qword [0x140005a18], rax
mov qword [0x140005a28], rax
movzx eax, word [0x1400033dc]
mov word [0x140005a50], ax
movzx eax, byte [0x1400033de]
mov word [0x140005a10], cx
lea rcx, str.5._writing_root_directory_cluster..._n
mov byte [0x140005a52], al
mov qword [0x140005820], r15
mov dword [0x140005a14], 2
mov qword [0x140005a20], r15
call fcn.140001010
mov edx, dword [0x1400056bc]
xor r8d, r8d
add edx, dword [0x1400056b4]
mov rsi, qword [0x140005800]
imul edx, dword [0x1400057d4]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
movsxd rdi, dword [0x1400057d4]
lea edx, [r15 + 1]
mov r8, rdi
lea rcx, [0x140005810]
mov r9, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp eax, edi
je 0x14000180d
lea edi, [r15 - 0x6d]
jmp 0x1400018e0
lea rcx, str.6._writing_superblock..._n
mov dword [0x1400057e0], 1
call fcn.140001010
mov r8d, dword [0x1400057d4]
lea rcx, [0x140005810]
mov edx, 0xff
call sub.VCRUNTIME140.dll_memset
lea rax, [0x140005810]
mov edi, 3
nop word [rax + rax]
lea rax, [rax + 0x80]
movups xmm0, xmmword [rbx]
movups xmm1, xmmword [rbx + 0x10]
lea rbx, [rbx + 0x80]
movups xmmword [rax - 0x80], xmm0
movups xmm0, xmmword [rbx - 0x60]
movups xmmword [rax - 0x70], xmm1
movups xmm1, xmmword [rbx - 0x50]
movups xmmword [rax - 0x60], xmm0
movups xmm0, xmmword [rbx - 0x40]
movups xmmword [rax - 0x50], xmm1
movups xmm1, xmmword [rbx - 0x30]
movups xmmword [rax - 0x40], xmm0
movups xmm0, xmmword [rbx - 0x20]
movups xmmword [rax - 0x30], xmm1
movups xmm1, xmmword [rbx - 0x10]
movups xmmword [rax - 0x20], xmm0
movups xmmword [rax - 0x10], xmm1
sub rdi, 1
jne 0x140001850
mov rbx, qword [0x140005800]
xor r8d, r8d
mov rcx, rbx
xor edx, edx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
movsxd rdi, dword [0x1400057d4]
lea rcx, [0x140005810]
mov r8, rdi
mov r9, rbx
mov edx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp eax, edi
je 0x1400018fc
mov edi, 0xffffff92
mov rcx, qword [0x140005800]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
test eax, eax
js 0x1400018f8
mov qword [0x140005800], r15
mov eax, edi
jmp 0x14000191d
mov rcx, qword [0x140005800]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
test eax, eax
jns 0x140001914
mov eax, 0xffffff91
jmp 0x14000191d
mov qword [0x140005800], r15
xor eax, eax
mov r14, qword [rsp + 0x48]
mov r13, qword [rsp + 0x50]
mov r12, qword [rsp + 0x88]
mov rbp, qword [rsp + 0x80]
mov rbx, qword [rsp + 0x78]
mov r15, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x30]
xor rcx, rsp
call fcn.140001a60
add rsp, 0x58
pop rdi
pop rsi
ret