Function at 0x402630
Capabilities:
Write file on windows

Disassembly:
push r12
push rbx
sub rsp, 0x38
mov r12, rcx
lea rax, [rsp + 0x58]
mov ecx, 2
mov qword [rsp + 0x58], rdx
mov qword [rsp + 0x60], r8
mov qword [rsp + 0x68], r9
mov qword [rsp + 0x28], rax
call fcn.004094a0
mov r8d, 0x1b
mov edx, 1
lea rcx, str.Mingw_w64_runtime_failure:_n
mov r9, rax
call sub.msvcrt.dll_fwrite
mov rbx, qword [rsp + 0x28]
mov ecx, 2
call fcn.004094a0
mov rdx, r12
mov rcx, rax
mov r8, rbx
call sub.msvcrt.dll_vfprintf
call sub.msvcrt.dll_abort
nop
nop word [rax + rax]
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x50
movsxd rdi, dword [0x0040f614]
mov r12, rcx
mov rsi, rdx
mov rbx, r8
test edi, edi
jle 0x402848
mov rax, qword [0x0040f618]
xor ecx, ecx
add rax, 0x18
nop
mov rdx, qword [rax]
cmp r12, rdx
jb 0x4026ec
mov r8, qword [rax + 8]
mov r8d, dword [r8 + 8]
add rdx, r8
cmp r12, rdx
jb 0x402777
add ecx, 1
add rax, 0x28
cmp ecx, edi
jne 0x4026d0
mov rcx, r12
call fcn.00403400
mov rbp, rax
test rax, rax
je 0x402882
mov rax, qword [0x0040f618]
lea rdi, [rdi + rdi*4]
shl rdi, 3
add rax, rdi
mov qword [rax + 0x20], rbp
mov dword [rax], 0
call fcn.00403530
mov ecx, dword [rbp + 0xc]
lea rdx, [rsp + 0x20]
mov r8d, 0x30
add rcx, rax
mov rax, qword [0x0040f618]
mov qword [rax + rdi + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x402891
mov eax, dword [rsp + 0x44]
lea edx, [rax - 0x40]
and edx, 0xffffffbf
je 0x402770
sub eax, 4
and eax, 0xfffffffb
jne 0x402800
add dword [0x0040f614], 1
cmp ebx, 8
jae 0x4027a8
test bl, 4
jne 0x402850
test ebx, ebx
je 0x402799
movzx eax, byte [rsi]
mov byte [r12], al
test bl, 2
jne 0x402870
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov rax, qword [rsi]
lea rcx, [r12 + 8]
and rcx, 0xfffffffffffffff8
mov qword [r12], rax
mov eax, ebx
mov rdx, qword [rsi + rax - 8]
mov qword [r12 + rax - 8], rdx
sub r12, rcx
add ebx, r12d
sub rsi, r12
and ebx, 0xfffffff8
cmp ebx, 8
jb 0x402799
and ebx, 0xfffffff8
xor eax, eax
mov edx, eax
add eax, 8
mov r8, qword [rsi + rdx]
mov qword [rcx + rdx], r8
cmp eax, ebx
jb 0x4027da
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov rcx, qword [rsp + 0x20]
mov rdx, qword [rsp + 0x38]
mov r8d, 0x40
add rdi, qword [0x0040f618]
mov qword [rdi + 8], rcx
mov r9, rdi
mov qword [rdi + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x402770
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call fcn.00402630
nop dword [rax]
xor edi, edi
jmp 0x4026f7
mov eax, dword [rsi]
mov ebx, ebx
mov dword [r12], eax
mov eax, dword [rsi + rbx - 4]
mov dword [r12 + rbx - 4], eax
jmp 0x402799
mov ebx, ebx
movzx eax, word [rsi + rbx - 2]
mov word [r12 + rbx - 2], ax
jmp 0x402799
mov rdx, r12
lea rcx, str.Address__p_has_no_image_section
call fcn.00402630
mov rax, qword [0x0040f618]
mov edx, dword [rbp + 8]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov r8, qword [rax + rdi + 0x18]
call fcn.00402630
nop
nop dword [rax]
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x38
lea rbp, [rsp + 0x80]
mov esi, dword [0x0040f610]
test esi, esi
je 0x4028e8
lea rsp, [rbp - 0x48]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov dword [0x0040f610], 1
call fcn.00403490
cdqe
lea rax, [rax + rax*4]
lea rax, [rax*8 + 0xf]
and rax, 0xfffffffffffffff0
call fcn.004036c0
mov r12, qword [0x0040bf10]
mov rbx, qword [0x0040bf20]
mov dword [0x0040f614], 0
sub rsp, rax
lea rax, [rsp + 0x20]
mov qword [0x0040f618], rax
mov rax, r12
sub rax, rbx
cmp rax, 7
jle 0x4028d2
mov edx, dword [rbx]
cmp rax, 0xb
jg 0x402a98
test edx, edx
jne 0x402b20
mov eax, dword [rbx + 4]
test eax, eax
jne 0x402b20
mov edx, dword [rbx + 8]
cmp edx, 1
jne 0x402b88
add rbx, 0xc
lea r15, [rbp - 0x58]
mov r13, qword [0x0040bf40]
movabs r14, 0xffffffff00000000
cmp rbx, r12
jb 0x4029c9
jmp 0x4028d2
movzx r8d, byte [rcx]
mov rdi, r15
mov r10, r8
or r10, 0xffffffffffffff00
test r8b, r8b
cmovs r8, r10
sub r8, rdx
mov rdx, r15
add r8, r9
mov qword [rbp - 0x58], r8
mov r8d, 1
call 0x4026a0
add rbx, 0xc
cmp rbx, r12
jae 0x402a40
mov edx, dword [rbx]
mov ecx, dword [rbx + 4]
movzx r8d, byte [rbx + 8]
add rdx, r13
add rcx, r13
mov r9, qword [rdx]
cmp r8d, 0x20
je 0x402af0
ja 0x402ac0
cmp r8d, 8
je 0x402990
cmp r8d, 0x10
jne 0x402b71
movzx r8d, word [rcx]
mov rdi, r15
mov r10, r8
or r10, 0xffffffffffff0000
test r8w, r8w
cmovs r8, r10
add rbx, 0xc
sub r8, rdx
mov rdx, r15
add r8, r9
mov qword [rbp - 0x58], r8
mov r8d, 2
call 0x4026a0
cmp rbx, r12
jb 0x4029c9
nop word cs:[rax + rax]
mov eax, dword [0x0040f614]
test eax, eax
jle 0x4028d2
mov r12, qword [sym.imp.KERNEL32.dll_VirtualProtect]
xor ebx, ebx
nop word [rax + rax]
mov rax, qword [0x0040f618]
add rax, rbx
mov r8d, dword [rax]
test r8d, r8d
je 0x402a80
mov rdx, qword [rax + 0x10]
mov rcx, qword [rax + 8]
mov r9, rdi
call r12
add esi, 1
add rbx, 0x28
cmp esi, dword [0x0040f614]
jl 0x402a60
jmp 0x4028d2
test edx, edx
jne 0x402b20
mov eax, dword [rbx + 4]
mov edi, eax
or edi, dword [rbx + 8]
jne 0x402958
mov edx, dword [rbx + 0xc]
add rbx, 0xc
jmp 0x40294d
cmp r8d, 0x40
jne 0x402b71
mov rax, qword [rcx]
mov r8d, 8
mov rdi, r15
sub rax, rdx
mov rdx, r15
add rax, r9
mov qword [rbp - 0x58], rax
call 0x4026a0
jmp 0x4029c0
mov eax, dword [rcx]
mov rdi, r15
mov r8, rax
or rax, r14
test r8d, r8d
cmovns rax, r8
mov r8d, 4
sub rax, rdx
mov rdx, r15
add rax, r9
mov qword [rbp - 0x58], rax
call 0x4026a0
jmp 0x4029c0
cmp rbx, r12
jae 0x4028d2
sub r12, 1
mov r13, qword [0x0040bf40]
lea rdi, [rbp - 0x58]
sub r12, rbx
shr r12, 3
lea r12, [rbx + r12*8 + 8]
nop dword [rax]
mov ecx, dword [rbx + 4]
mov eax, dword [rbx]
mov r8d, 4
mov rdx, rdi
add rbx, 8
add rcx, r13
add eax, dword [rcx]
mov dword [rbp - 0x58], eax
call 0x4026a0
cmp rbx, r12
jne 0x402b48
jmp 0x402a40
mov edx, r8d
lea rcx, str.__Unknown_pseudo_relocation_bit_size__d._n
mov qword [rbp - 0x58], 0
call fcn.00402630
lea rcx, str.__Unknown_pseudo_relocation_protocol_version__d._n
call fcn.00402630
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sub rsp, 0x58
mov rax, qword [0x0040f620]
test rax, rax
je 0x402bdc
movsd xmm0, qword [rsp + 0x80]
mov dword [rsp + 0x20], ecx
lea rcx, [rsp + 0x20]
mov qword [rsp + 0x28], rdx
movsd qword [rsp + 0x30], xmm2
movsd qword [rsp + 0x38], xmm3
movsd qword [rsp + 0x40], xmm0
call rax
nop
add rsp, 0x58
ret