Function at 0x401040
Capabilities:
Encode data using xor
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0xc4
mov edi, dword [sym.imp.kernel32.dll_CreateFileW]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], eax
call edi
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x401210
mov edx, eax
lea eax, [ebp - 0x8c]
lea ebx, [ebp - 0xa4]
mov dword [esp + 0x10], 0
mov dword [ebp - 0xac], eax
mov dword [esp + 4], eax
mov eax, dword [sym.imp.kernel32.dll_ReadFile]
mov dword [esp], edx
mov dword [ebp - 0xb4], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x16
mov dword [ebp - 0xb0], eax
call eax
mov edx, dword [ebp - 0xb4]
sub esp, 0x14
test eax, eax
je 0x4010f1
cmp dword [ebp - 0xa4], 0x16
je 0x401228
mov dword [esp], edx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], esi
call edi
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x401189
lea eax, [ebp - 0xa4]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0xac]
mov dword [esp + 8], 0x6c
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x40117d
cmp dword [ebp - 0xa4], 0x6c
je 0x4014e0
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [0x40201c], 0
mov dword [esp], esi
call dword [sym.imp.gdi32.dll_GetMetaFileW]
mov dword [0x402018], eax
sub esp, 4
mov eax, dword [ebp - 0xac]
mov dword [esp + 4], eax
mov eax, dword [0x402010]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetClientRect]
mov eax, dword [ebp - 0x84]
sub eax, dword [ebp - 0x8c]
mov dword [0x402460], eax
mov eax, dword [ebp - 0x80]
sub esp, 8
sub eax, dword [ebp - 0x88]
mov dword [0x402014], eax
mov eax, dword [0x402010]
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.user32.dll_InvalidateRect]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp - 0x8c]
mov dword [ebp - 0xac], eax
jmp 0x4010fd
mov eax, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], edx
mov dword [ebp - 0xb4], eax
call eax
sub esp, 4
cmp dword [ebp - 0x8c], 0x9ac6cdd7
jne 0x4010fd
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], esi
call edi
sub esp, 0x1c
mov edi, eax
cmp eax, 0xffffffff
je 0x401588
lea esi, [ebp - 0xa8]
mov dword [esp], eax
mov eax, dword [ebp - 0xb0]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0x16
mov dword [esp + 4], ebx
call eax
sub esp, 0x14
test eax, eax
je 0x401566
xor eax, eax
cmp dword [ebp - 0xa8], 0x16
lea edx, [ebp - 0x90]
jne 0x401566
lea esi, cs:[esi]
nop
add ebx, 2
xor ax, word [ebx - 2]
cmp ebx, edx
jne 0x4012e0
movzx edx, word [ebp - 0x90]
cmp ax, dx
jne 0x401520
mov eax, dword [ebp - 0xac]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xb0]
mov dword [esp + 8], 0x12
mov dword [esp], edi
call eax
sub esp, 0x14
test eax, eax
je 0x401566
cmp dword [ebp - 0xa8], 0x12
jne 0x401566
mov eax, dword [ebp - 0x86]
mov dword [esp], 0x40
add eax, eax
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GlobalAlloc]
mov dword [ebp - 0xac], eax
sub esp, 8
test eax, eax
je 0x401566
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x16
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_SetFilePointer]
mov eax, dword [ebp - 0x86]
sub esp, 0x10
add eax, eax
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0xac]
mov dword [esp + 0xc], esi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xb0]
mov dword [esp], edi
call eax
sub esp, 0x14
test eax, eax
je 0x401590
mov eax, dword [ebp - 0x86]
add eax, eax
cmp eax, dword [ebp - 0xa8]
jne 0x401590
mov dword [esp], edi
mov eax, dword [ebp - 0xb4]
call eax
mov eax, dword [ebp - 0xac]
sub esp, 4
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x86]
add eax, eax
mov dword [esp], eax
call dword [sym.imp.gdi32.dll_SetMetaFileBitsEx]
sub esp, 8
mov ebx, eax
test eax, eax
je 0x4014c4
movsx edx, word [ebp - 0x9e]
movsx eax, word [ebp - 0x9a]
sub eax, edx
movsx edx, word [ebp - 0x9c]
mov dword [0x402460], eax
movsx eax, word [ebp - 0x98]
sub eax, edx
mov dword [0x402014], eax
mov eax, dword [0x402010]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetDC]
mov esi, dword [sym.imp.gdi32.dll_GetDeviceCaps]
sub esp, 4
mov edi, eax
mov dword [esp + 4], 0x58
mov dword [esp], eax
call esi
imul eax, dword [0x402460]
movzx ecx, word [ebp - 0x96]
sub esp, 8
mov dword [esp + 4], 0x5a
cdq
mov dword [esp], edi
idiv ecx
mov dword [0x402460], eax
call esi
imul eax, dword [0x402014]
movzx ecx, word [ebp - 0x96]
sub esp, 8
mov dword [esp + 4], edi
cdq
idiv ecx
mov dword [0x402014], eax
mov eax, dword [0x402010]
mov dword [esp], eax
call dword [sym.imp.user32.dll_ReleaseDC]
mov dword [section..data], 0
mov dword [0x402004], 0
sub esp, 8
mov eax, dword [ebp - 0xac]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GlobalFree]
sub esp, 4
jmp 0x401576
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
xor eax, eax
sub esp, 4
cmp dword [ebp - 0x64], 0x464d4520
sete al
mov dword [0x40201c], eax
jne 0x401193
mov dword [esp], esi
call dword [sym.imp.gdi32.dll_GetEnhMetaFileW]
mov dword [0x402008], eax
sub esp, 4
jmp 0x4011a4
mov esi, dword [ebp - 0xac]
movzx eax, ax
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], str.Computed_checksum__04x___stored_checksum__04x_n
mov dword [esp], esi
call sym._sprintf.constprop.0
mov eax, dword [0x402010]
mov dword [esp + 4], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], str.Checksum_failed
mov dword [esp], eax
call dword [sym.imp.user32.dll_MessageBoxA]
sub esp, 0x10
mov dword [esp], edi
mov eax, dword [ebp - 0xb4]
xor ebx, ebx
call eax
sub esp, 4
mov dword [0x402018], ebx
jmp 0x4011de
xor ebx, ebx
jmp 0x401576
mov eax, dword [ebp - 0xac]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GlobalFree]
sub esp, 4
jmp 0x401566