Function at 0x402580
Capabilities:
Encode data using xor
Hash data using sha1
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42fcf1
mov eax, dword fs:[0]
push eax
sub esp, 0x1d8
mov eax, dword [0x44c060]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, edx
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xdc], eax
mov dword [ebp - 0xd8], 0
mov dword [ebp - 0xd4], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0xd0], 0
mov dword [ebp - 0xcc], 0
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
mov byte [ebp - 4], 1
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push ecx
call esi
cmp eax, 0xffffffff
jne 0x402655
call fcn.004034f0
test eax, eax
jns 0x40265b
xor esi, esi
mov eax, dword [ebp - 0xd0]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40262a
push eax
call edi
mov eax, dword [ebp - 0xd8]
test eax, eax
je 0x402637
push eax
call edi
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0042e0d6
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0xd0], eax
push 0
push 0x80
push 3
push 0
push 7
push SysReAllocString
push edi
call esi
cmp eax, 0xffffffff
jne 0x402680
call fcn.004034f0
test eax, eax
js 0x402615
jmp 0x402686
mov dword [ebp - 0xd8], eax
push 0x8000
call dword [sym.imp.MSVCR110.dll_malloc]
mov edi, eax
add esp, 4
test edi, edi
je 0x402615
xor ebx, ebx
mov dword [ebp - 0xc4], 0x67452301
mov dword [ebp - 0xc0], 0xefcdab89
mov dword [ebp - 0xbc], 0x98badcfe
mov dword [ebp - 0xb8], 0x10325476
mov dword [ebp - 0xb4], 0xc3d2e1f0
mov dword [ebp - 0xb0], 0
mov dword [ebp - 0xac], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x58], ebx
push 0
lea eax, [ebp - 0x58]
push eax
push 0x8000
push edi
push dword [ebp - 0xd8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40271d
call fcn.004034f0
mov esi, eax
test esi, esi
js 0x4027b8
jmp 0x40271f
xor esi, esi
mov ecx, dword [ebp - 0x58]
test ecx, ecx
je 0x4027b8
add ebx, ecx
cmp ebx, 0x500000
jbe 0x402740
mov eax, 0x500000
sub eax, ebx
add ecx, eax
mov dword [ebp - 0x58], ecx
push ecx
mov edx, edi
lea ecx, [ebp - 0xc4]
call fcn.0041b340
mov edx, dword [ebp - 0x58]
mov ecx, edx
add esp, 4
and ecx, 3
je 0x402767
mov eax, 4
sub eax, ecx
add edx, eax
mov dword [ebp - 0x58], edx
mov ecx, edx
shr ecx, 2
mov eax, edi
lea ecx, [edi + ecx*4]
cmp edi, ecx
jae 0x402785
xor dword [eax], 0x5289b01b
add eax, 4
cmp eax, ecx
jb 0x402775
mov edx, dword [ebp - 0x58]
push 0
lea eax, [ebp - 0x5c]
push eax
push edx
push edi
push dword [ebp - 0xd0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4027aa
call fcn.004034f0
mov esi, eax
test esi, esi
js 0x4027b8
jmp 0x4027ac
xor esi, esi
cmp ebx, 0x500000
jbe 0x4026f0
push edi
mov edi, dword [sym.imp.MSVCR110.dll_free]
call edi
add esp, 4
test esi, esi
js 0x402615
xorps xmm0, xmm0
lea eax, [ebp - 0x40]
push eax
lea edx, [ebp - 0x54]
lea ecx, [ebp - 0xc4]
mov byte [ebp - 0x40], 0
movq qword [ebp - 0x3f], xmm0
movq qword [ebp - 0x37], xmm0
movq qword [ebp - 0x2f], xmm0
movq qword [ebp - 0x27], xmm0
movq qword [ebp - 0x1f], xmm0
call fcn.0041c780
add esp, 4
lea eax, [ebp - 0x1e0]
mov dword [ebp - 0x1e4], eax
push 3
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x1e4]
mov dword [ebp - 0xc8], 0
call fcn.00402e00
mov byte [ebp - 4], 2
push dword [ebp - 0x1e4]
lea ecx, [ebp - 0xc8]
call fcn.00402c70
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x1e4]
lea ecx, [ebp - 0x1e0]
cmp eax, ecx
je 0x402857
push eax
call edi
add esp, 4
push dword [ebp - 0xc8]
push 0x29
push dword [ebp - 0xdc]
call dword [sym.imp.MSVCR110.dll_wcscpy_s]
mov edx, dword [ebp - 0xc8]
add edx, 0xfffffff0
add esp, 0xc
mov esi, 1
lea eax, [edx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x402617
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x402617