Function at 0x12817070
Capabilities:
Link many functions at runtime

Disassembly:
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x248
mov qword [rsp + 0x230], 0xfffffffffffffffe
mov rsi, rdx
mov edi, 0x57
mov rax, qword [rdx + 8]
test rax, rax
je 0x12817e1f
cmp qword [rax], 0
je 0x12817e1f
cmp qword [rax + 0x18], 0
je 0x12817e1f
mov rax, qword [rdx + 0x10]
test rax, rax
je 0x12817e1f
cmp qword [rax], 0
je 0x12817e1f
mov rax, qword [rdx + 0x18]
test rax, rax
je 0x12817e1f
xor r15d, r15d
cmp r15w, word [rax]
je 0x12817e1f
cmp qword [rdx + 0x20], r15
je 0x12817e1f
lea rcx, [0x129b4df0]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov r14, rax
mov qword [rsp + 0x1d0], rax
test rax, rax
jne 0x12817124
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x12817e21
mov edi, 8
lea edx, [rdi - 5]
lea rcx, [rsp + 0x40]
call fcn.12815330
nop
mov rcx, qword [rsp + 0x60]
sub rcx, qword [rsp + 0x58]
movabs rax, 0x8888888888888889
imul rcx
add rdx, rcx
sar rdx, 8
mov rax, rdx
shr rax, 0x3f
add rdx, rax
cmp rdx, 3
jne 0x12817df7
xor edx, edx
lea rcx, [rsp + 0x40]
call fcn.12814a70
mov r13, rax
mov ebx, 1
mov rdx, rbx
lea rcx, [rsp + 0x40]
call fcn.12814a70
mov r12, rax
lea edx, [rdi - 6]
lea rcx, [rsp + 0x40]
call fcn.12814a70
mov qword [rsp + 0xe0], rax
lea rcx, [rsp + 0x100]
call fcn.12813100
nop
xor edx, edx
lea rcx, [rsp + 0x100]
call fcn.12812690
mov edi, eax
test eax, eax
jne 0x12817dbd
mov rax, qword [rsp + 0x110]
mov dword [rax + 0x34], ebx
lea rcx, [rsp + 0x70]
call fcn.128136d0
nop
mov ebx, dword [rsi + 4]
mov ebp, dword [rsi]
mov dword [rsp + 0xbc], 0x1100
mov eax, dword [rsp + 0xb4]
test eax, eax
je 0x1281720b
add rax, 0xf
and rax, 0xfffffffffffffff0
mov dword [rsp + 0xb8], eax
jmp 0x12817215
mov eax, r15d
mov dword [rsp + 0xb8], eax
mov dword [rsp + 0xc0], r15d
add eax, 0x1100
mov dword [rsp + 0xc8], eax
mov dword [rsp + 0xc4], r15d
mov dword [rsp + 0xcc], eax
mov edx, 0x40
lea rcx, [rsp + 0x70]
call fcn.12812690
mov edi, eax
test eax, eax
jne 0x12817d78
mov rcx, qword [rsp + 0x80]
test rcx, rcx
je 0x128172cb
mov eax, ebx
and eax, ebp
not ebx
and ebx, 6
or eax, ebx
mov dword [rcx + 4], eax
mov dword [rcx], 0x1100
mov eax, dword [rsp + 0xcc]
mov qword [rcx + 8], rax
mov eax, dword [rsp + 0xb4]
mov dword [rcx + 0x88], eax
mov eax, dword [rsp + 0xbc]
mov dword [rcx + 0x90], eax
mov eax, dword [rsp + 0xb8]
mov dword [rcx + 0x8c], eax
mov eax, dword [rsp + 0xc0]
mov dword [rcx + 0x94], eax
mov eax, dword [rsp + 0xc8]
mov dword [rcx + 0x9c], eax
mov eax, dword [rsp + 0xc4]
mov dword [rcx + 0x98], eax
lea rcx, [rsp + 0x170]
call fcn.128135f0
nop
mov edx, 0x80
lea rcx, [rsp + 0x170]
call fcn.12812690
mov ebx, eax
test eax, eax
je 0x12817347
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x12817327
call fcn.12958250
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x68], r15
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, ebx
jmp 0x12817e21
lea rcx, [rsp + 0x1e0]
call fcn.128135f0
nop
mov edx, 0x80
lea rcx, [rsp + 0x1e0]
call fcn.12812690
mov ebx, eax
test eax, eax
je 0x128173d1
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x128173b1
call fcn.12958250
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x68], r15
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, ebx
jmp 0x12817e21
movsxd rbx, dword [rsp + 0x120]
add rbx, 0xf
and rbx, 0xfffffffffffffff0
mov qword [rsp + 0x160], rbx
movsxd rcx, dword [rsp + 0x90]
add rcx, 0xf
and rcx, 0xfffffffffffffff0
mov qword [rsp + 0xf8], rcx
movsxd rbp, dword [rsp + 0x190]
add rbp, 0xf
and rbp, 0xfffffffffffffff0
movsxd rax, dword [rsp + 0x200]
add rax, 0xf
and rax, 0xfffffffffffffff0
add rax, rbp
add rax, rcx
add rax, rbx
mov qword [rsp + 0xe8], rax
lea r8, [rax + 0x300]
mov qword [rsp + 0xf0], r8
mov qword [rsp + 0x298], r15
mov rdx, qword [rsi + 0x10]
mov rax, qword [rsi + 8]
mov ecx, dword [rdx + 0x10]
mov dword [rsp + 0x28], 0x40
mov dword [rsp + 0x20], 0x1000
mov r9, r8
lea r8, [rsp + 0x298]
mov rdx, qword [rdx]
call qword [rax]
mov edi, eax
mov r15, qword [rsp + 0x298]
test r15, r15
je 0x12817d3f
lea rcx, [r15 + rbx]
mov qword [rsp + 0x2a0], rcx
mov rax, qword [rsp + 0xf8]
add rax, rcx
mov qword [rsp + 0x2a8], rax
lea rdi, [rax + rbp]
mov rax, qword [rsp + 0xe8]
add rax, r15
mov qword [rsp + 0x1c0], rax
lea rdx, str.LdrGetProcedureAddress
mov qword [r13], rdx
lea rbx, str.ntdll.dll
mov qword [r13 + 8], rbx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [r13 + 0x10], rax
lea rdx, str.LdrLoadDll
mov qword [r12], rdx
mov qword [r12 + 8], rbx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [r12 + 0x10], rax
lea rdx, str.NtCreateSection
mov rbp, qword [rsp + 0xe0]
mov qword [rbp], rdx
mov qword [rbp + 8], rbx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbp + 0x10], rax
mov ebx, dword [rsp + 0x94]
mov eax, dword [rsp + 0xa8]
add ebx, eax
mov eax, dword [rsp + 0x9c]
add rbx, rax
lea rcx, [rsp + 0x70]
mov rax, qword [rsp + 0x70]
call qword [rax + 0x30]
mov ecx, dword [rsp + 0xa0]
add rax, rbx
add rcx, rax
add rcx, qword [rsp + 0x2a0]
mov qword [r13 + 0x18], rcx
mov rax, qword [rsp + 0x2a8]
mov qword [r12 + 0x18], rax
mov qword [rbp + 0x18], rdi
mov rdx, qword [rsi + 0x10]
lea rax, [rsp + 0x88]
mov qword [rsp + 0x28], rax
xor edi, edi
mov dword [rsp + 0x20], edi
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [rdx]
mov rcx, r13
mov rbx, qword [rsp + 0x290]
call rbx
test eax, eax
je 0x12817cd8
mov rdx, qword [rsi + 0x10]
lea rax, [rsp + 0x188]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], edi
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [rdx]
mov rcx, r12
call rbx
test eax, eax
je 0x12817cd8
mov rcx, qword [rsp + 0xf0]
call fcn.12958238
mov rbp, rax
mov qword [rsp + 0xe0], rax
test rax, rax
jne 0x1281765f
xor ecx, ecx
call fcn.12958250
nop
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1281763c
call fcn.12958250
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, 8
jmp 0x12817e21
mov r9, qword [rsi + 0x48]
mov r8, qword [rsi + 0x20]
mov rdx, qword [rsi + 0x18]
lea rcx, [rsp + 0x100]
call fcn.12810320
mov ebx, eax
test eax, eax
je 0x128176eb
mov rcx, rbp
call fcn.12958250
nop
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x128176cb
call fcn.12958250
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, ebx
jmp 0x12817e21
mov rdx, qword [rsi + 0x50]
lea rcx, [rsp + 0x100]
call fcn.12810280
mov ebx, eax
test eax, eax
je 0x1281776f
mov rcx, rbp
call fcn.12958250
nop
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1281774f
call fcn.12958250
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, ebx
jmp 0x12817e21
mov r14, qword [rsp + 0x80]
mov rbx, qword [rsp + 0x110]
mov rax, qword [r12 + 0x10]
mov qword [rbx], rax
lea rdx, str.LdrGetDllHandle
mov rdi, qword [rsp + 0x1d0]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x10], rax
mov rax, qword [r13 + 0x10]
mov qword [rbx + 8], rax
cmp qword [rsi + 0x50], 0
je 0x128177da
lea rdx, str.NtClose
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x20], rax
lea rdx, str.NtOpenSection
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x18], rax
mov rax, qword [rsi + 0x40]
mov qword [rsp + 0x20], rax
mov r9, qword [rsi + 0x38]
mov r8, qword [rsi + 0x30]
mov rdx, qword [rsi + 0x28]
lea rcx, [rsp + 0x70]
call fcn.12810710
mov ebx, eax
test eax, eax
je 0x1281786e
mov rcx, rbp
call fcn.12958250
nop
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1281784c
call fcn.12958250
xor edi, edi
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, ebx
jmp 0x12817e21
mov qword [r14 + 0x18], r15
mov ecx, dword [rsp + 0x124]
mov eax, dword [rsp + 0x138]
add eax, ecx
mov ecx, dword [rsp + 0x12c]
add rax, r15
add rcx, rax
mov qword [r14 + 0x20], rcx
mov rax, qword [rsp + 0x180]
mov qword [rax], r15
mov rax, qword [rsp + 0x1f0]
mov qword [rax], r15
mov rdx, r15
lea rcx, [rsp + 0x100]
call fcn.128123f0
mov ebx, eax
test eax, eax
je 0x1281792e
mov rcx, rbp
call fcn.12958250
nop
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1281790c
call fcn.12958250
xor edi, edi
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, ebx
jmp 0x12817e21
mov ecx, dword [r13 + 0x1a8]
add ecx, dword [r13 + 0x1a4]
lea rax, [r13 + 0x124]
mov r9d, dword [r13 + 0xa0]
add r9, qword [r13 + 0x10]
lea r15, [fcn.1280f3b0]
mov qword [rsp + 0x38], r15
mov dword [rsp + 0x30], ecx
mov qword [rsp + 0x28], rax
xor edi, edi
mov dword [rsp + 0x20], edi
mov r8, qword [rsp + 0x2a0]
xor edx, edx
lea rcx, [rsp + 0x70]
call fcn.12811bd0
mov ebx, eax
test eax, eax
je 0x128179f0
mov rcx, rbp
call fcn.12958250
nop
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x128179d0
call fcn.12958250
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, ebx
jmp 0x12817e21
mov ecx, dword [r12 + 0x1a8]
add ecx, dword [r12 + 0x1a4]
mov r9d, dword [r12 + 0xa0]
add r9, qword [r12 + 0x10]
lea rax, [r12 + 0x124]
mov qword [rsp + 0x38], r15
mov dword [rsp + 0x30], ecx
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], edi
mov r8, qword [rsp + 0x2a8]
xor edx, edx
lea rcx, [rsp + 0x170]
call fcn.128117c0
mov ebx, eax
test eax, eax
je 0x12817ab1
mov rcx, rbp
call fcn.12958250
nop
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x12817a91
call fcn.12958250
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, ebx
jmp 0x12817e21
mov rcx, qword [rsp + 0xe8]
add rcx, rbp
lea rbx, [rcx + 0x100]
mov r15, qword [rsp + 0x1c0]
lea rdi, [r15 + 0x100]
mov r8d, dword [r13 + 0xa0]
lea rdx, [r13 + 0xa4]
call fcn.12959240
mov r11d, dword [r13 + 0xa0]
mov dword [r14 + 0x64], r11d
mov eax, dword [r13 + 0xa0]
mov dword [r14 + 0x60], eax
mov rax, qword [r13 + 0x10]
mov qword [r14 + 0x48], rax
mov qword [r14 + 0x50], r15
mov r8d, dword [r12 + 0xa0]
lea rdx, [r12 + 0xa4]
mov rcx, rbx
call fcn.12959240
mov r11d, dword [r12 + 0xa0]
mov dword [r14 + 0x44], r11d
mov eax, dword [r12 + 0xa0]
mov dword [r14 + 0x40], eax
mov rax, qword [r12 + 0x10]
mov qword [r14 + 0x28], rax
mov qword [r14 + 0x30], rdi
movsxd r8, dword [rsp + 0x120]
mov rdx, qword [rsp + 0x108]
mov rcx, rbp
call fcn.12959240
movsxd r8, dword [rsp + 0x90]
mov rbx, qword [rsp + 0x160]
lea rcx, [rbx + rbp]
mov rdx, qword [rsp + 0x78]
call fcn.12959240
movsxd r8, dword [rsp + 0x190]
mov rcx, qword [rsp + 0xf8]
add rcx, rbp
add rcx, rbx
mov rdx, qword [rsp + 0x178]
call fcn.12959240
xor r15d, r15d
mov qword [rsp + 0x1c8], r15
mov rcx, qword [rsi + 0x10]
mov rax, qword [rsi + 8]
mov edx, dword [rcx + 0x10]
lea r8, [rsp + 0x1c8]
mov qword [rsp + 0x30], r8
mov dword [rsp + 0x28], 0x40
mov r8, qword [rsp + 0xf0]
mov qword [rsp + 0x20], r8
mov r9, rbp
mov r8, qword [rsp + 0x298]
mov rcx, qword [rcx]
call qword [rax + 0x18]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
test ebx, ebx
je 0x12817cce
mov rdx, qword [rsi + 0x10]
mov r9, qword [rsi + 8]
mov qword [rsp + 0x28], r15
mov eax, dword [rdx + 0x10]
mov dword [rsp + 0x20], eax
mov r9, qword [r9 + 0x18]
mov r8b, 1
mov rdx, qword [rdx]
mov rcx, r13
mov rbx, qword [rsp + 0x290]
call rbx
test eax, eax
je 0x12817c54
mov rdx, qword [rsi + 0x10]
mov r9, qword [rsi + 8]
mov qword [rsp + 0x28], r15
mov eax, dword [rdx + 0x10]
mov dword [rsp + 0x20], eax
mov r9, qword [r9 + 0x18]
mov r8b, 1
mov rdx, qword [rdx]
mov rcx, r12
call rbx
test eax, eax
je 0x12817c54
lea eax, [r15 + 1]
jmp 0x12817c57
mov eax, r15d
mov edi, r15d
test eax, eax
jne 0x12817cce
mov rcx, rbp
call fcn.12958250
nop
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x12817cab
call fcn.12958250
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x68], r15
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, 0x80004005
jmp 0x12817e21
mov rcx, rbp
call fcn.12958250
jmp 0x12817d42
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x12817d1c
call fcn.12958250
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x68], rdi
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, 0x80004005
jmp 0x12817e21
xor r15d, r15d
lea rcx, [rsp + 0x1e0]
call fcn.128131c0
nop
lea rcx, [rsp + 0x170]
call fcn.128131c0
nop
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
jmp 0x12817df7
lea rcx, [rsp + 0x70]
call fcn.128131f0
nop
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x12817da0
call fcn.12958250
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x68], r15
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, edi
jmp 0x12817e21
lea rcx, [rsp + 0x100]
call fcn.128131c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x12817dda
call fcn.12958250
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x68], r15
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, edi
jmp 0x12817e21
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x12817e06
call fcn.12958250
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x68], r15
mov rcx, qword [rsp + 0x40]
call fcn.12958250
mov eax, edi
add rsp, 0x248
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret