Function at 0x100638ec0
Capabilities:
Open clipboard
Read clipboard data

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x48
lea rbp, [rsp + 0x80]
mov rdi, qword [sym.imp.USER32.dll_OpenClipboard]
mov ebx, 7
mov esi, 0xa
mov r12, qword [sym.imp.KERNEL32.dll_Sleep]
mov qword [rbp - 0x50], 0xffffffffffffffff
mov r13, rcx
mov qword [rbp - 0x48], 0xffffffffffffffff
mov qword [rbp - 0x58], 0
mov dword [rbp - 0x60], 0
jmp 0x100638f1f
mov ecx, esi
add esi, esi
call r12
xor ecx, ecx
call rdi
test eax, eax
jne 0x100638f40
sub ebx, 1
jne 0x100638f18
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov ecx, dword [r13 + 0x54]
mov rsi, qword [sym.imp.USER32.dll_IsClipboardFormatAvailable]
call rsi
test eax, eax
jne 0x100638fb0
mov ecx, dword [r13 + 0x58]
call rsi
test eax, eax
je 0x100638f75
mov r14, qword [sym.vim.exe_p_enc]
mov edi, dword [rbp - 0x44]
mov rcx, qword [r14]
call sub.msys_2.0.dll_strlen
cmp edi, eax
jg 0x1006390a0
mov ecx, 0xd
call rsi
test eax, eax
je 0x100638f8b
mov ebx, dword [rbp - 0x48]
test ebx, ebx
jne 0x1006391c0
mov ecx, 1
call rsi
test eax, eax
jne 0x100639018
call qword [sym.imp.USER32.dll_CloseClipboard]
mov rcx, qword [rbp - 0x58]
call sym.vim.exe_vim_free
jmp 0x100638f2c
mov ecx, dword [r13 + 0x54]
call qword [sym.imp.USER32.dll_GetClipboardData]
mov r12, rax
test rax, rax
je 0x100638f51
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GlobalLock]
mov r14, rax
test rax, rax
je 0x100638f51
mov rbx, qword [sym.imp.KERNEL32.dll_GlobalSize]
mov rcx, r12
call rbx
mov r8d, 0x10
cmp rax, 0xf
jbe 0x100639325
lea rcx, [rbp - 0x50]
mov r9d, 0x10
mov rdx, r14
call fcn.10065e300
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
jmp 0x100638f51
mov ecx, 1
call qword [sym.imp.USER32.dll_GetClipboardData]
mov r14, rax
test rax, rax
je 0x100638f9a
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GlobalLock]
mov rcx, r14
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GlobalSize]
mov esi, dword [rbp - 0x4c]
mov dword [rbp - 0x5c], eax
mov edx, eax
test esi, esi
js 0x10063923a
cmp eax, esi
jge 0x10063931b
mov dword [rbp - 0x60], eax
lea r9, [rbp - 0x5c]
lea r8, [rbp - 0x58]
mov rcx, rbx
call sym.vim.exe_acp_to_enc
mov r12, qword [rbp - 0x58]
test r12, r12
je 0x100639332
mov eax, dword [rbp - 0x5c]
mov dword [rbp - 0x60], eax
test esi, esi
jne 0x100639358
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
jmp 0x100638f9a
mov ecx, dword [r13 + 0x58]
call qword [sym.imp.USER32.dll_GetClipboardData]
mov r12, rax
test rax, rax
je 0x100638f75
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GlobalLock]
mov rbx, rax
test rax, rax
je 0x1006392ed
mov r14, qword [r14]
mov rdx, rax
mov rcx, r14
call sub.msys_2.0.dll_strcmp
test eax, eax
jne 0x1006392ed
mov rcx, r14
call sub.msys_2.0.dll_strlen
lea rdx, [rax + 1]
mov eax, edi
sub eax, edx
add rbx, rdx
mov edx, dword [rbp - 0x4c]
mov dword [rbp - 0x60], eax
test edx, edx
je 0x1006391b1
xor r14d, r14d
cmp dword [rbp - 0x50], 0xffffffff
jne 0x100639112
mov dword [rbp - 0x50], 0xff
mov esi, dword [rbp - 0x60]
test esi, esi
je 0x100639300
movsxd rcx, esi
call sym.vim.exe_alloc
mov r15, rax
test rax, rax
je 0x10063919a
test esi, esi
jle 0x100639180
mov rcx, rax
xor eax, eax
jmp 0x10063914e
mov eax, r8d
add rcx, 1
mov byte [rcx - 1], dl
cmp esi, eax
jle 0x100639180
movsxd rdx, eax
lea r8d, [rax + 1]
movzx edx, byte [rbx + rdx]
cmp dl, 0xd
jne 0x100639140
movsxd r9, r8d
add r9, rbx
cmp byte [r9], 0xa
jne 0x100639140
sub dword [rbp - 0x60], 1
movzx edx, byte [r9]
add eax, 2
add rcx, 1
mov byte [rcx - 1], dl
cmp esi, eax
jg 0x10063914e
mov ecx, dword [rbp - 0x50]
movsxd r8, dword [rbp - 0x60]
mov r9, r13
mov rdx, r15
call sym.vim.exe_clip_yank_selection
mov rcx, r15
call sym.vim.exe_vim_free
test r14, r14
je 0x1006391a8
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
test r12, r12
je 0x100638f9a
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
jmp 0x100638f9a
mov ecx, 0xd
call qword [sym.imp.USER32.dll_GetClipboardData]
mov r12, rax
test rax, rax
je 0x100638f9a
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GlobalLock]
mov rcx, r12
mov r14, rax
call qword [sym.imp.KERNEL32.dll_GlobalSize]
shr rax, 1
mov dword [rbp - 0x5c], eax
test ebx, ebx
js 0x10063929f
cmp ebx, eax
cmovg ebx, eax
mov dword [rbp - 0x60], ebx
mov rcx, r14
lea rdx, [rbp - 0x60]
call sym.vim.exe_utf16_to_enc
mov rcx, r12
mov rbx, rax
mov qword [rbp - 0x58], rax
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
test rbx, rbx
je 0x100638f9a
mov eax, dword [rbp - 0x4c]
test eax, eax
je 0x100638f9a
xor r12d, r12d
jmp 0x100639102
mov dword [rbp - 0x60], 0
test eax, eax
jle 0x100639351
lea edx, [rax - 1]
mov eax, 1
add rdx, 2
jmp 0x10063926f
mov dword [rbp - 0x60], eax
mov r10d, eax
add rax, 1
cmp rdx, rax
je 0x10063927a
cmp byte [rbx + rax - 1], 0
jne 0x100639260
mov r10d, dword [rbp - 0x60]
lea r9, [rbp - 0x5c]
lea r8, [rbp - 0x58]
mov edx, r10d
mov rcx, rbx
call sym.vim.exe_acp_to_enc
mov r12, qword [rbp - 0x58]
test r12, r12
jne 0x10063907c
jmp 0x100639105
mov dword [rbp - 0x60], 0
test eax, eax
jle 0x100639202
lea r8d, [rax - 1]
xor ecx, ecx
xor eax, eax
jmp 0x1006392d5
lea r9d, [rax + 1]
lea rdx, [rax + 1]
mov ecx, 1
cmp rax, r8
je 0x100639348
mov rax, rdx
cmp word [r14 + rax*2], 0
jne 0x1006392c0
test cl, cl
je 0x100639202
mov dword [rbp - 0x60], eax
jmp 0x100639202
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
jmp 0x100638f75
mov ecx, 1
call sym.vim.exe_alloc
mov r15, rax
test rax, rax
je 0x10063919a
jmp 0x100639180
mov dword [rbp - 0x60], esi
mov edx, esi
jmp 0x10063905f
mov rcx, r12
call rbx
mov r8, rax
jmp 0x100638ff3
mov r12, rbx
test rbx, rbx
jne 0x100639082
jmp 0x10063908a
mov dword [rbp - 0x60], r9d
jmp 0x100639202
xor edx, edx
jmp 0x10063905f
mov rbx, r12
xor r12d, r12d
jmp 0x100639105