Function at 0x406a90
Capabilities:
Write clipboard data

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push ecx
cmp dword [0x4f0784], 0
push ebx
push esi
push edi
jne 0x406b0b
mov edi, dword [ebp + 8]
test edi, edi
je 0x406bc8
mov esi, dword [ebp + 0xc]
cmp esi, 0xffffffff
jne 0x406acf
mov esi, edi
lea ecx, [esi + 2]
nop dword [eax + eax]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x406ac0
sub esi, ecx
sar esi, 1
test esi, esi
je 0x406bc8
lea ebx, [esi + 1]
test ebx, ebx
je 0x406b0b
lea eax, [ebx + ebx]
push eax
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x4f077c], eax
test eax, eax
jne 0x406b16
push dword [0x4eff1c]
mov ecx, 0x4f0050
push eax
push eax
push eax
push str.Out_of_memory.
call fcn.0040cc20
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [0x4f0784], eax
test eax, eax
jne 0x406b9e
push dword [0x4f077c]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [0x4f077c], eax
mov eax, dword [0x4ea828]
cmp dword [eax + 0x34], 0
jne 0x406b79
cmp dword [0x4f06c4], 0
jne 0x406b79
cmp byte [0x4effe6], 0
jne 0x406b79
push 0
push 0
push 0x4d3ee8
push 0
push str.An_internal_function_call_failed.
mov ecx, 0x4f0050
call fcn.0040d820
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0
push 0
push 0
push 0x4d3ee8
push str.An_internal_function_call_failed.
mov ecx, 0x4f0050
call fcn.0040c540
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
xor ecx, ecx
mov dword [0x4f078c], ebx
mov word [eax], cx
mov ebx, dword [0x4f0784]
test ebx, ebx
je 0x406b0b
push esi
push edi
push ebx
call fcn.004afab4
add esp, 0xc
xor eax, eax
mov word [ebx + esi*2], ax
cmp dword [0x4f0790], 0
jne 0x406bed
call fcn.00407030
test eax, eax
jne 0x406bed
push str.Cant_open_clipboard_for_writing.
call fcn.00406d60
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
call dword [sym.imp.USER32.dll_EmptyClipboard]
test eax, eax
jne 0x406c4a
cmp dword [0x4f0790], eax
je 0x406c37
cmp dword [0x4f0780], eax
je 0x406c1d
push dword [0x4f0778]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov dword [0x4f0780], 0
call dword [sym.imp.USER32.dll_CloseClipboard]
mov dword [0x4f0790], 0
mov dword [0x4f0778], 0
push 0x4d5f14
call fcn.00406d60
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [0x4f077c]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
test eax, eax
je 0x406c97
mov ecx, dword [0x4f0784]
test ecx, ecx
je 0x406ce8
movzx esi, word [ecx]
push eax
call edi
mov dword [0x4f0784], 0
mov dword [0x4f078c], 0
test si, si
jne 0x406ce3
push dword [0x4f077c]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [0x4f077c], eax
cmp dword [0x4f0790], 0
je 0x406cd5
cmp dword [0x4f0780], 0
je 0x406cbb
push dword [0x4f0778]
call edi
mov dword [0x4f0780], 0
call dword [sym.imp.USER32.dll_CloseClipboard]
mov dword [0x4f0790], 0
mov dword [0x4f0778], 0
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [0x4f077c]
push eax
push 0xd
call dword [sym.imp.USER32.dll_SetClipboardData]
test eax, eax
je 0x406d01
mov dword [0x4f077c], 0
jmp 0x406c97
cmp dword [0x4f0790], 0
je 0x406d3f
cmp dword [0x4f0780], 0
je 0x406d25
push dword [0x4f0778]
call edi
mov dword [0x4f0780], 0
call dword [sym.imp.USER32.dll_CloseClipboard]
mov dword [0x4f0790], 0
mov dword [0x4f0778], 0
push 0x4d5f34
call fcn.00406d60
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8