Function at 0x401040
Capabilities:
Open clipboard
Read file on windows
Write clipboard data

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov dword [esp], 0xfffffff6
call sym._GetStdHandle_4
sub esp, 4
mov dword [ebp - 0x1c], eax
mov dword [esp], 0xfffffff6
call sym._GetStdHandle_4
sub esp, 4
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov dword [esp], 0x407080
call sym._ConStreamInit
mov dword [esp], 0xfffffff5
call sym._GetStdHandle_4
sub esp, 4
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov dword [esp], 0x407040
call sym._ConStreamInit
mov dword [esp], 0xfffffff4
call sym._GetStdHandle_4
sub esp, 4
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov dword [esp], section..bss
call sym._ConStreamInit
cmp dword [ebp + 8], 1
jle 0x401117
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x406000
mov eax, dword [eax + 4]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_wcsncmp]
mov ebx, eax
test eax, eax
je 0x4012e0
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._GetFileType_4
sub esp, 4
cmp eax, 2
je 0x401310
mov dword [esp + 4], 0x1000
mov dword [esp], 0x42
call sym._GlobalAlloc_8
sub esp, 8
mov ebx, eax
test eax, eax
je 0x4011e9
xor esi, esi
jmp 0x4011cb
add eax, esi
lea ecx, [ebp - 0x14]
mov dword [esp + 0x10], 0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 0x1000
mov dword [esp], eax
call sym._ReadFile_20
add esi, dword [ebp - 0x14]
sub esp, 0x14
mov edi, eax
mov dword [ebp - 0x20], esi
mov dword [esp], ebx
call sym._GlobalUnlock_4
sub esp, 4
mov dword [esp], ebx
call sym._GlobalSize_4
sub esp, 4
add eax, 0x1000
mov dword [esp + 8], 0x40
mov dword [esp + 4], eax
mov dword [esp], ebx
call sym._GlobalReAlloc_12
sub esp, 0xc
mov edx, eax
test eax, eax
je 0x4011de
test edi, edi
je 0x401233
mov ebx, eax
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x401233
mov dword [esp], ebx
call sym._GlobalLock_4
sub esp, 4
test eax, eax
jne 0x401153
mov dword [esp], ebx
call sym._GlobalFree_4
sub esp, 4
call sym._GetLastError_0
mov ebx, 0xffffffff
test eax, eax
jne 0x401201
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x10], 0x400
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x1000
mov dword [esp], section..bss
call sym._ConMsgPuts
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x20]
mov dword [esp], edx
mov dword [esp + 8], 0x40
add eax, 2
mov dword [ebp - 0x1c], edx
mov dword [esp + 4], eax
call sym._GlobalReAlloc_12
mov edx, dword [ebp - 0x1c]
sub esp, 0xc
test eax, eax
mov ebx, eax
je 0x401300
mov dword [esp], 0
call sym._OpenClipboard_4
sub esp, 4
test eax, eax
je 0x4011de
call sym._EmptyClipboard_0
mov dword [esp], ebx
call sym._GlobalLock_4
sub esp, 4
mov esi, eax
mov dword [esp], ebx
call sym._GlobalSize_4
sub esp, 4
mov dword [esp], esi
mov dword [esp + 8], 0
mov dword [esp + 4], eax
call sym._IsTextUnicode_12
sub esp, 0xc
mov esi, eax
mov dword [esp], ebx
call sym._GlobalUnlock_4
sub esp, 4
mov dword [esp + 4], ebx
test esi, esi
je 0x401330
mov dword [esp], 0xd
call sym._SetClipboardData_8
sub esp, 8
call sym._CloseClipboard_0
xor ebx, ebx
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], 0x65
mov dword [esp], 0x407040
call sym._ConResPuts
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, edx
jmp 0x401260
mov dword [esp + 4], 0x64
xor ebx, ebx
mov dword [esp], 0x407040
call sym._ConResPuts
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 7
call sym._SetClipboardData_8
sub esp, 8
jmp 0x4012cf