Function at 0x140253450
Capabilities:
Write file on windows

Disassembly:
mov dword [rsp + 0x10], edx
push rbx
push rbp
push rdi
push r12
push r13
sub rsp, 0x90
mov ebx, edx
lea rdx, [0x140326fec]
mov r12d, r9d
movsxd r13, r8d
call sub.MSVCR90.dll_fopen
mov rbp, rax
test rax, rax
jne 0x140253490
lea eax, [rbp + 1]
add rsp, 0x90
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret
mov qword [rsp + 0xc0], rsi
mov eax, ebx
mov qword [rsp + 0xd0], r14
cdq
mov qword [rsp + 0xd8], r15
xor r15d, r15d
and edx, 7
lea esi, [rdx + rax]
sar esi, 3
imul esi, r13d
mov eax, esi
and eax, 3
je 0x1402534d5
mov r14d, 4
sub r14d, eax
mov dword [rsp + 0x28], r14d
add esi, r14d
jmp 0x1402534dd
mov r14d, r15d
mov dword [rsp + 0x28], r15d
mov eax, 0x4d42
mov edi, 1
imul esi, r12d
mov word [rsp + 0x40], ax
lea rcx, [rsp + 0x40]
lea r8d, [rdi + 1]
lea eax, [rsi + 0x36]
mov r9, rbp
mov rdx, rdi
mov word [rsp + 0x48], r15w
mov word [rsp + 0x4a], r15w
mov dword [rsp + 0x4c], 0x36
mov dword [rsp + 0x44], eax
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x44]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 1]
lea rcx, [rsp + 0x48]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 1]
lea rcx, [rsp + 0x4a]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x4c]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x50]
mov r9, rbp
mov rdx, rdi
mov dword [rsp + 0x50], 0x28
mov dword [rsp + 0x54], r13d
mov dword [rsp + 0x58], r12d
mov word [rsp + 0x5c], di
mov word [rsp + 0x5e], bx
mov dword [rsp + 0x60], r15d
mov dword [rsp + 0x64], esi
mov dword [rsp + 0x68], r15d
mov dword [rsp + 0x6c], r15d
mov dword [rsp + 0x70], r15d
mov dword [rsp + 0x74], r15d
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x54]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x58]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 1]
lea rcx, [rsp + 0x5c]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 1]
lea rcx, [rsp + 0x5e]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x60]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x64]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
mov r9, rbp
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x68]
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x6c]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x70]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
lea r8d, [rdi + 3]
lea rcx, [rsp + 0x74]
mov r9, rbp
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
mov byte [rsp + 0x20], r15b
test r12d, r12d
jle 0x14025381c
lea eax, [r12 - 1]
mov rcx, r15
mov rsi, r12
mov qword [rsp + 0x78], r12
mov r12, qword [rsp + 0xe0]
mov r15, r13
imul eax, r13d
movsxd rdx, eax
mov eax, r13d
mov qword [rsp + 0x38], rcx
neg eax
mov qword [rsp + 0x30], rdx
cdqe
mov qword [rsp + 0x80], rax
mov eax, dword [rsp + 0xf0]
xor ebx, ebx
test r13d, r13d
jle 0x1402537be
mov r14d, eax
mov r15d, eax
lea esi, [r13 - 1]
and r14d, edi
and r15d, 2
test r14d, r14d
mov eax, ebx
cmovne eax, esi
test r15d, r15d
je 0x140253708
cdqe
add rax, rcx
lea rcx, [r12 + rax*4]
jmp 0x140253711
cdqe
add rax, rdx
lea rcx, [r12 + rax*4]
mov ecx, dword [rcx]
cmp dword [rsp + 0xe8], edi
jne 0x140253736
mov edx, ecx
mov eax, ecx
movzx r8d, cl
shr eax, 8
shr edx, 0x18
shr ecx, 0x10
movzx r9d, al
movzx eax, cl
jmp 0x140253750
mov eax, ecx
mov edx, ecx
shr eax, 0x10
shr edx, 0x18
movzx r8d, al
mov eax, ecx
shr eax, 8
movzx r9d, al
movzx eax, cl
cmp dword [rsp + 0xc8], 0x18
mov byte [rsp + 0x24], al
mov byte [rsp + 0x25], r9b
mov byte [rsp + 0x26], r8b
mov byte [rsp + 0x27], dl
jne 0x140253784
lea rcx, [rsp + 0x24]
mov r9, rbp
mov r8d, 3
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
jmp 0x14025379a
lea rcx, [rsp + 0x24]
mov r9, rbp
mov r8d, 4
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
mov rcx, qword [rsp + 0x38]
mov rdx, qword [rsp + 0x30]
inc ebx
dec esi
cmp ebx, r13d
jl 0x1402536f0
mov r14d, dword [rsp + 0x28]
mov rsi, qword [rsp + 0x78]
mov r15, r13
test r14d, r14d
jle 0x1402537f2
mov ebx, r14d
nop word [rax + rax]
lea rcx, [rsp + 0x20]
mov r9, rbp
mov r8, rdi
mov rdx, rdi
call sub.MSVCR90.dll_fwrite
sub rbx, rdi
jne 0x1402537d0
mov rcx, qword [rsp + 0x38]
mov rdx, qword [rsp + 0x30]
add rdx, qword [rsp + 0x80]
mov eax, dword [rsp + 0xf0]
add rcx, r15
sub rsi, rdi
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x30], rdx
mov qword [rsp + 0x78], rsi
jne 0x1402536d4
mov rcx, rbp
call sub.MSVCR90.dll_fclose
mov r15, qword [rsp + 0xd8]
mov r14, qword [rsp + 0xd0]
mov rsi, qword [rsp + 0xc0]
xor eax, eax
add rsp, 0x90
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret