Function at 0x64a630
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
xor ebp, ebp
movsxd r13, dword [rdx + 4]
mov byte [rsp + 0x35], 0
mov rsi, rcx
mov rdi, rdx
mov ebx, r8d
test r8b, 0x40
jne 0x64a860
test bl, 0x80
jne 0x64a7a9
test bl, 0x20
je 0x64a760
mov eax, ebx
and eax, 0x10
cmp eax, 1
sbb r13d, r13d
and r13d, 0xfffffff8
add r13d, 9
lea rax, [rsp + 0x35]
mov rcx, qword [rdi + 8]
and ebx, 0x40f
mov r8d, r13d
mov qword [rsp + 0x28], 0
mov r9d, ebx
mov qword [rsp + 0x20], rax
mov edx, dword [rdi]
call sym.do_buf.constprop.0
test eax, eax
js 0x64a740
cmp byte [rsp + 0x35], 0
lea r12d, [rbp + rax]
je 0x64a8d0
add r12d, 2
test rsi, rsi
je 0x64a746
mov r9, rsi
mov r8d, 1
mov edx, 1
lea rcx, [0x009632ad]
call sym.fwrite
cmp rax, 1
jne 0x64a740
mov rcx, qword [rdi + 8]
mov qword [rsp + 0x28], rsi
mov r9d, ebx
mov r8d, r13d
mov qword [rsp + 0x20], 0
mov edx, dword [rdi]
call sym.do_buf.constprop.0
test eax, eax
js 0x64a740
cmp byte [rsp + 0x35], 0
je 0x64a746
mov r9, rsi
mov r8d, 1
mov edx, 1
lea rcx, [0x009632ad]
call sym.fwrite
cmp rax, 1
je 0x64a746
nop dword [rax + rax]
mov r12d, 0xffffffff
mov eax, r12d
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea eax, [r13 - 1]
cmp eax, 0x1d
ja 0x64a7a0
lea rax, [0x009632d0]
movsx r13d, byte [rax + r13]
mov eax, r13d
cmp r13b, 0xff
je 0x64a7a0
test bl, 0x10
je 0x64a683
or eax, 8
test r13d, r13d
mov r13d, 1
movsx eax, al
cmovne r13d, eax
jmp 0x64a683
test bh, 1
je 0x64a670
test rsi, rsi
je 0x64a9f0
mov r9, rsi
mov r8d, 1
mov edx, 1
lea rcx, [0x009632ab]
call sym.fwrite
cmp rax, 1
jne 0x64a740
and bh, 2
jne 0x64a8e0
movsxd rbx, dword [rdi]
mov r13, qword [rdi + 8]
lea r14, [0x009632b0]
lea rdi, [rsp + 0x40]
mov r12, rbx
add rbx, r13
cmp rbx, r13
jne 0x64a815
jmp 0x64a9fc
add r13, 1
cmp rbx, r13
je 0x64a9fc
movzx eax, byte [r13]
mov r9, rsi
mov r8d, 2
mov rcx, rdi
mov edx, eax
and eax, 0xf
shr dl, 4
movzx eax, byte [r14 + rax]
and edx, 0xf
movzx edx, byte [r14 + rdx]
mov byte [rsp + 0x41], al
mov byte [rsp + 0x40], dl
mov edx, 1
call sym.fwrite
cmp rax, 2
jne 0x64a740
jmp 0x64a808
mov ecx, r13d
call sym.ASN1_tag2str
mov rcx, rax
mov r14, rax
call sym.strlen
mov rbp, rax
test rsi, rsi
je 0x64a8c0
movsxd r8, eax
mov r9, rsi
mov edx, 1
mov rcx, r14
call sym.fwrite
mov r8, rax
mov eax, ebp
cmp r8, rax
jne 0x64a740
mov r9, rsi
mov r8d, 1
mov edx, 1
lea rcx, [0x009632a9]
call sym.fwrite
cmp rax, 1
jne 0x64a740
add ebp, 1
jmp 0x64a65e
test rsi, rsi
jne 0x64a6ee
jmp 0x64a746
mov eax, dword [rdi + 4]
lea r14, [rsp + 0x40]
xor edx, edx
mov qword [rsp + 0x48], rdi
mov rcx, r14
mov dword [rsp + 0x40], eax
call sym.i2d_ASN1_TYPE
mov r12d, eax
test eax, eax
jle 0x64a740
movsxd rbx, eax
mov r8d, 0x11d
lea rdx, str.crypto_asn1_a_strex.c
mov rcx, rbx
call sym.CRYPTO_malloc
mov r13, rax
test rax, rax
je 0x64aa06
lea rdx, [rsp + 0x38]
mov rcx, r14
mov qword [rsp + 0x38], rax
call sym.i2d_ASN1_TYPE
test rsi, rsi
je 0x64a9b9
add rbx, r13
mov r15, r13
lea rdi, [rsp + 0x36]
lea r14, [0x009632b0]
nop dword [rax + rax]
movzx eax, byte [r15]
mov r9, rsi
mov r8d, 2
mov rcx, rdi
mov edx, eax
and eax, 0xf
shr dl, 4
movzx eax, byte [r14 + rax]
and edx, 0xf
movzx edx, byte [r14 + rdx]
mov byte [rsp + 0x37], al
mov byte [rsp + 0x36], dl
mov edx, 1
call sym.fwrite
cmp rax, 2
je 0x64a9b0
mov r8d, 0x124
lea rdx, str.crypto_asn1_a_strex.c
mov rcx, r13
call sym.CRYPTO_free
jmp 0x64a740
add r15, 1
cmp rbx, r15
jne 0x64a958
add r12d, r12d
mov r8d, 0x124
lea rdx, str.crypto_asn1_a_strex.c
mov rcx, r13
call sym.CRYPTO_free
test r12d, r12d
js 0x64a740
add r12d, 1
add r12d, ebp
jmp 0x64a746
and bh, 2
jne 0x64a8e0
mov r12d, dword [rdi]
add r12d, r12d
jns 0x64a9da
jmp 0x64a740
mov r8d, 0x41
mov edx, 0x7d
mov ecx, 0xd
mov dword [rsp + 0x20], 0x11e
lea r9, str.crypto_asn1_a_strex.c
call sym.ERR_put_error
jmp 0x64a740