Function at 0x402850
Capabilities:
Open clipboard
Write clipboard data

Disassembly:
push ebp
mov edx, eax
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov eax, dword [eax + 0x84]
mov dword [ebp - 0x20], edx
movsx esi, word [eax + 0x18]
movsx edi, word [eax + 0x1c]
movsx ebx, word [eax + 0x1a]
movzx eax, word [eax + 0x1e]
mov word [ebp - 0x1c], ax
mov eax, dword [edx + 0xa8]
mov dword [esp], eax
call dword [sym.imp.user32.dll_OpenClipboard]
sub esp, 4
test eax, eax
jne 0x4028a0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movsx eax, word [ebp - 0x1c]
sub esi, edi
mov edx, esi
sub ebx, eax
sar edx, 0x1f
mov eax, ebx
xor esi, edx
sar eax, 0x1f
sub esi, edx
xor ebx, eax
sub ebx, eax
call dword [sym.imp.user32.dll_EmptyClipboard]
inc ebx
lea eax, [esi + 2]
mov dword [esp], 2
imul eax, ebx
mov dword [ebp - 0x44], eax
add eax, eax
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GlobalAlloc]
mov dword [ebp - 0x40], eax
sub esp, 8
test eax, eax
je 0x402a10
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GlobalLock]
mov dword [ebp - 0x3c], eax
sub esp, 4
test eax, eax
je 0x402a10
mov edx, dword [ebp - 0x20]
mov ecx, dword [edx + 0x84]
movzx eax, word [ecx + 0x18]
movzx edi, word [ecx + 0x1a]
cmp word [ecx + 0x1c], ax
cmovle ax, word [ecx + 0x1c]
cmp word [ecx + 0x1e], di
cmovle di, word [ecx + 0x1e]
movsx edi, di
add ebx, edi
mov dword [ebp - 0x28], ebx
cmp ebx, edi
jbe 0x402aa7
dec ebx
inc esi
mov dword [ebp - 0x34], ebx
movsx ebx, ax
lea ecx, [esi + esi]
lea eax, [ebx + ebx]
add esi, ebx
mov dword [ebp - 0x38], ebx
mov ebx, eax
mov dword [ebp - 0x1c], esi
mov esi, dword [ebp - 0x3c]
neg ebx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x30], ebx
mov eax, esi
mov esi, edi
mov edi, eax
nop
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x38]
add eax, edi
mov dword [ebp - 0x24], ecx
mov ebx, ecx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
cmp ecx, eax
jae 0x4029a4
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x24], edi
lea esi, [esi]
mov ecx, dword [edx + 8]
mov edi, dword [ecx + 0xc]
mov ecx, dword [ecx + 0x30]
imul edi, esi
add eax, edi
mov edi, dword [ebp - 0x20]
movzx eax, word [ecx + eax*4]
mov word [edi + ebx*2], ax
inc ebx
mov eax, ebx
cmp ebx, dword [ebp - 0x1c]
jb 0x402980
mov edi, dword [ebp - 0x24]
mov eax, dword [ebp - 0x2c]
add eax, edi
cmp eax, edi
ja 0x4029b9
jmp 0x4029c0
lea ecx, [eax - 2]
cmp ecx, edi
jbe 0x402a20
mov eax, ecx
cmp word [eax - 2], 0x20
je 0x4029b0
lea edi, [eax + 2]
mov ecx, eax
cmp esi, dword [ebp - 0x34]
sbb eax, eax
inc esi
and eax, 0xa
mov word [ecx], ax
cmp dword [ebp - 0x28], esi
ja 0x402960
mov esi, edi
sub esi, dword [ebp - 0x3c]
mov ebx, esi
sar esi, 1
test byte [0x413034], 8
jne 0x402a49
cmp dword [ebp - 0x44], esi
jne 0x402a24
mov esi, dword [ebp - 0x40]
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GlobalUnlock]
sub esp, 4
mov dword [esp + 4], esi
mov dword [esp], 0xd
call dword [sym.imp.user32.dll_SetClipboardData]
sub esp, 8
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
jmp dword [sym.imp.user32.dll_CloseClipboard]
mov edi, eax
jmp 0x4029c5
mov esi, dword [ebp - 0x40]
mov dword [esp + 8], 2
mov dword [esp + 4], ebx
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GlobalReAlloc]
sub esp, 0xc
test eax, eax
cmove eax, esi
mov dword [ebp - 0x40], eax
jmp 0x4029ed
mov eax, dword [ebp - 0x3c]
shr eax, 0x10
je 0x402ab0
mov edi, dword [ebp - 0x3c]
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x402a7a
mov eax, edi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x4159ac
mov dword [esp + 8], str.copy_selection
mov dword [esp + 4], 0x413034
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x4029e8
xor esi, esi
xor ebx, ebx
jmp 0x4029df
movzx eax, word [ebp - 0x3c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf_1
jmp 0x402a7a