Function at 0x401252
Capabilities:
Encode data using xor
Get file size
Parse pe header
Read file on windows

Disassembly:
sub esp, 0x1d4
push ebx
push ebp
push esi
push edi
push 0x40
xor ebx, ebx
mov dword [esp + 0x1c], 0x4f98e8
lea eax, [esp + 0x2c]
or ebp, 0xffffffff
push ebx
push eax
mov dword [esp + 0x28], ebp
call fcn.0041d750
add esp, 0xc
lea eax, [esp + 0x68]
push 0xf8
push ebx
push eax
call fcn.0041d750
mov eax, dword [esp + 0x1f8]
lea ecx, [esp + 0x24]
add esp, 8
mov dword [eax], ebx
push 3
push 3
push closesocket
push dword [esp + 0x1f8]
call fcn.00401140
mov esi, dword [esp + 0x1c]
test al, al
je 0x401544
cmp esi, ebp
je 0x401544
mov edi, ebx
push ebx
lea eax, [esp + 0x18]
mov dword [esp + 0x18], ebx
push eax
push 0x40
pop eax
sub eax, edi
push eax
lea eax, [esp + 0x34]
add eax, edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4012f9
cmp dword [esp + 0x14], ebx
je 0x4012f9
add edi, dword [esp + 0x14]
cmp edi, 0x40
jb 0x4012c8
cmp edi, 0x40
jne 0x401544
mov eax, 0x5a4d
cmp word [esp + 0x28], ax
jne 0x401544
cmp esi, ebp
je 0x401544
mov eax, dword [esp + 0x64]
lea ecx, [esp + 0x1c]
push ebx
cdq
push ecx
push eax
push esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, ebp
mov dword [esp + 0x18], eax
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
jne 0x401345
call ebp
mov edi, ebx
push ebx
lea eax, [esp + 0x18]
mov dword [esp + 0x18], ebx
push eax
mov eax, 0xf8
sub eax, edi
push eax
lea eax, [esp + 0x74]
add eax, edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40137d
cmp dword [esp + 0x14], ebx
je 0x40137d
add edi, dword [esp + 0x14]
cmp edi, 0xf8
jb 0x401347
cmp edi, 0xf8
jne 0x401544
cmp dword [esp + 0x68], 0x4550
jne 0x401544
mov edi, dword [esp + 0x70]
test edi, edi
je 0x401544
xorps xmm0, xmm0
movlpd qword [esp + 0x18], xmm0
cmp esi, 0xffffffff
je 0x4013c1
lea eax, [esp + 0x18]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x4013ca
xorps xmm0, xmm0
movlpd qword [esp + 0x18], xmm0
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
cmp ebx, eax
ja 0x401544
jb 0x4013e4
cmp edi, ecx
ja 0x401544
cmp esi, 0xffffffff
jne 0x4013f1
or eax, 0xffffffff
or ecx, 0xffffffff
jmp 0x40141e
push ebx
lea eax, [esp + 0x20]
mov dword [esp + 0x1c], edi
push eax
push edi
push esi
mov dword [esp + 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
jne 0x40141a
call ebp
test eax, eax
jne 0x4013e9
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
cmp eax, edi
jne 0x401544
cmp ecx, ebx
jne 0x401544
cmp esi, 0xffffffff
je 0x401544
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, ebx
push ebx
lea eax, [esp + 0x18]
mov dword [esp + 0x18], ebx
push eax
push 8
pop eax
sub eax, edi
push eax
lea eax, [esp + 0x2c]
add eax, edi
push eax
push esi
call ebp
test eax, eax
je 0x40146c
cmp dword [esp + 0x14], ebx
je 0x40146c
add edi, dword [esp + 0x14]
cmp edi, 8
jb 0x40143f
cmp edi, 8
jne 0x401544
cmp dword [esp + 0x20], 0x12d84cb
jne 0x401544
cmp esi, 0xffffffff
je 0x401544
mov edi, ebx
push ebx
lea eax, [esp + 0x18]
mov dword [esp + 0x18], ebx
push eax
mov eax, 0x80
sub eax, edi
push eax
lea eax, [esp + 0x16c]
add eax, edi
push eax
push esi
call ebp
test eax, eax
je 0x4014c3
cmp dword [esp + 0x14], ebx
je 0x4014c3
add edi, dword [esp + 0x14]
cmp edi, 0x80
jb 0x40148e
cmp edi, 0x80
jne 0x401544
push 4
push 0x3000
push dword [esp + 0x2c]
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebp, eax
test ebp, ebp
je 0x401544
mov edi, dword [esp + 0x24]
cmp esi, 0xffffffff
je 0x401531
cmp edi, 1
jb 0x401531
mov ecx, ebx
mov dword [esp + 0x14], ebx
push ebx
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], ebx
push eax
mov eax, edi
sub eax, ecx
push eax
lea eax, [ecx + ebp]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x14]
test eax, eax
je 0x40152b
cmp dword [esp + 0x18], ebx
je 0x40152b
add ecx, dword [esp + 0x18]
mov dword [esp + 0x14], ecx
cmp ecx, edi
jb 0x4014f7
mov edi, dword [esp + 0x24]
jmp 0x401533
mov ecx, ebx
cmp ecx, edi
je 0x401561
push 0x8000
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov ebp, ebx
cmp esi, 0xffffffff
je 0x401552
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x1d4
ret 8
mov eax, dword [esp + 0x1ec]
mov dword [eax], edi
test edi, edi
je 0x401546
mov dl, bl
mov cl, byte [ebx + ebp]
mov eax, ebx
and eax, 0x7f
mov al, byte [esp + eax + 0x160]
add al, dl
mov dl, cl
xor al, cl
mov byte [ebx + ebp], al
inc ebx
cmp ebx, edi
jb 0x401570
jmp 0x401546