Function at 0x4f8330
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 0x4f8560
test bl, 0x80
jne 0x4f84a9
test bl, 0x20
je 0x4f8460
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 0x4f8440
cmp byte [rsp + 0x35], 0
lea r12d, [rbp + rax]
je 0x4f85d0
add r12d, 2
test rsi, rsi
je 0x4f8446
mov r9, rsi
mov r8d, 1
mov edx, 1
lea rcx, [0x005ef54d]
call sym.fwrite
cmp rax, 1
jne 0x4f8440
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 0x4f8440
cmp byte [rsp + 0x35], 0
je 0x4f8446
mov r9, rsi
mov r8d, 1
mov edx, 1
lea rcx, [0x005ef54d]
call sym.fwrite
cmp rax, 1
je 0x4f8446
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 0x4f84a0
lea rax, [0x005ef570]
movsx r13d, byte [rax + r13]
mov eax, r13d
cmp r13b, 0xff
je 0x4f84a0
test bl, 0x10
je 0x4f8383
or eax, 8
test r13d, r13d
mov r13d, 1
movsx eax, al
cmovne r13d, eax
jmp 0x4f8383
test bh, 1
je 0x4f8370
test rsi, rsi
je 0x4f85e0
mov r9, rsi
mov r8d, 1
mov edx, 1
lea rcx, [0x005ef54b]
call sym.fwrite
cmp rax, 1
jne 0x4f8440
and bh, 2
jne 0x4f8699
movsxd rbx, dword [rdi]
mov r13, qword [rdi + 8]
lea r14, [0x005ef550]
lea rdi, [rsp + 0x40]
mov r12, rbx
add rbx, r13
cmp rbx, r13
jne 0x4f8515
jmp 0x4f85e8
add r13, 1
cmp rbx, r13
je 0x4f85e8
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 0x4f8440
jmp 0x4f8508
mov ecx, r13d
call sym.ASN1_tag2str
mov rcx, rax
mov r14, rax
call sym.strlen
mov rbp, rax
test rsi, rsi
je 0x4f85c0
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 0x4f8440
mov r9, rsi
mov r8d, 1
mov edx, 1
lea rcx, [0x005ef549]
call sym.fwrite
cmp rax, 1
jne 0x4f8440
add ebp, 1
jmp 0x4f835e
test rsi, rsi
jne 0x4f83ee
jmp 0x4f8446
and bh, 2
jne 0x4f8600
mov r12d, dword [rdi]
add r12d, r12d
js 0x4f8440
add r12d, 1
add r12d, ebp
jmp 0x4f8446
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 r8d, 0x11b
lea rdx, str.crypto_asn1_a_strex.c
movsxd rcx, eax
mov r12, rcx
call sym.CRYPTO_malloc
mov r13, rax
test rax, rax
je 0x4f8670
lea rdx, [rsp + 0x38]
mov rcx, r14
mov qword [rsp + 0x38], r13
call sym.i2d_ASN1_TYPE
add r12d, r12d
mov r8d, 0x122
lea rdx, str.crypto_asn1_a_strex.c
mov rcx, r13
call sym.CRYPTO_free
test r12d, r12d
jns 0x4f85f1
jmp 0x4f8440
mov r8d, 0x41
mov edx, 0x7d
mov ecx, 0xd
mov dword [rsp + 0x20], 0x11c
lea r9, str.crypto_asn1_a_strex.c
call sym.ERR_put_error
jmp 0x4f8440
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 r8d, 0x11b
lea rdx, str.crypto_asn1_a_strex.c
movsxd rbx, eax
mov rcx, rbx
mov r12, rbx
call sym.CRYPTO_malloc
mov r13, rax
test rax, rax
je 0x4f8670
mov rcx, r14
lea rdx, [rsp + 0x38]
add rbx, r13
mov qword [rsp + 0x38], r13
mov r15, r13
lea r14, [0x005ef550]
lea rdi, [rsp + 0x36]
call sym.i2d_ASN1_TYPE
cmp rbx, r13
je 0x4f864d
nop dword [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 0x4f8760
mov r8d, 0x122
lea rdx, str.crypto_asn1_a_strex.c
mov rcx, r13
call sym.CRYPTO_free
jmp 0x4f8440
add r15, 1
cmp rbx, r15
jne 0x4f8708
jmp 0x4f864d