Function at 0x402fc0
Capabilities:
Encode data using xor
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42a8bb
mov eax, dword fs:[0]
push eax
mov eax, 0x1064
call fcn.0040e860
mov eax, dword [0x439080]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
mov edx, dword [ecx + 0x10]
mov eax, 0x7ffffffe
sub eax, edx
cmp eax, 1
jb 0x40354c
cmp dword [ecx + 0x14], 7
jbe 0x40300e
mov ecx, dword [ecx]
push 1
push 0x433d6c
push edx
push ecx
push ecx
push dword [ebp - 0x1014]
lea ecx, [ebp - 0x1070]
call fcn.00409dd0
push esi
lea edx, [ebp - 0x1070]
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x102c]
call fcn.00407b60
add esp, 4
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x105c]
cmp ecx, 7
jbe 0x403089
mov edx, dword [ebp - 0x1070]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40307f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x403551
push ecx
push edx
call fcn.0040da29
add esp, 8
xor eax, eax
mov dword [ebp - 0x1060], 0
cmp dword [esi + 0x14], 7
mov dword [ebp - 0x105c], 7
mov word [ebp - 0x1070], ax
jbe 0x4030ae
mov esi, dword [esi]
push 0
push 0x80
push 3
push 0
push 3
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x1058], edi
cmp edi, 0xffffffff
jne 0x403181
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
push 0
push 0
lea ecx, [ebp - 0x1050]
mov dword [ebp - 0x1050], 0
push ecx
push 0x400
push eax
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov edx, str.Failed_to_open_file__
mov ecx, 0x43a268
call fcn.00407c20
cmp dword [ebp - 0x1018], 7
lea edx, [ebp - 0x102c]
push dword [ebp - 0x101c]
cmova edx, dword [ebp - 0x102c]
mov ecx, eax
call fcn.00409f10
add esp, 4
mov esi, eax
call edi
push eax
mov edx, 0x433d74
mov ecx, esi
call fcn.00407c20
mov ecx, eax
call fcn.00404480
mov ecx, eax
call fcn.00407ec0
mov edx, dword [ebp - 0x1050]
mov ecx, eax
call fcn.00407c20
push eax
call fcn.00408210
add esp, 4
push dword [ebp - 0x1050]
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x4034e8
lea eax, [ebp - 0x1034]
mov dword [ebp - 0x1034], 0
push eax
push edi
mov dword [ebp - 0x1030], 0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x403204
mov edx, str.Failed_to_get_file_size_for__
mov ecx, 0x43a268
call fcn.00407c20
cmp dword [ebp - 0x1018], 7
lea edx, [ebp - 0x102c]
push dword [ebp - 0x101c]
cmova edx, dword [ebp - 0x102c]
mov ecx, eax
call fcn.00409f10
add esp, 4
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov edx, 0x433d74
mov ecx, esi
call fcn.00407c20
mov ecx, eax
call fcn.00404480
push eax
call fcn.00408210
add esp, 4
jmp 0x4034e1
mov esi, dword [ebp - 0x1034]
mov edx, esi
mov ecx, dword [ebp - 0x1030]
add edx, 0xffffffff
mov eax, ecx
adc eax, 0xffffffff
test eax, eax
ja 0x40349c
jb 0x403230
cmp edx, 0x3ffffffe
ja 0x40349c
xor edi, edi
xor edx, edx
mov dword [ebp - 0x1050], edi
nop word [eax + eax]
mov eax, esi
sub eax, edi
sbb ecx, dword [ebp - 0x1050]
test ecx, ecx
jg 0x40325b
jl 0x403257
cmp eax, 0x1000
jae 0x40325b
sub esi, edx
jmp 0x403260
mov esi, 0x1000
mov eax, dword [ebp - 0x1050]
xorps xmm0, xmm0
mov dword [ebp - 0x1040], eax
lea eax, [ebp - 0x104c]
push eax
lea eax, [ebp - 0x1038]
mov dword [ebp - 0x1038], 0
push eax
push esi
lea eax, [ebp - 0x1010]
movlpd qword [ebp - 0x104c], xmm0
push eax
push dword [ebp - 0x1058]
mov dword [ebp - 0x103c], 0
mov dword [ebp - 0x1044], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403495
cmp dword [ebp - 0x1038], esi
jne 0x403495
xor eax, eax
test esi, esi
je 0x4033b2
cmp esi, 8
jb 0x4033a0
cmp esi, 0x40
jb 0x403364
mov edx, esi
mov ecx, esi
and edx, 0x3f
sub ecx, edx
nop dword [eax]
movups xmm0, xmmword [ebp + eax - 0x1010]
movups xmm1, xmmword [eax + 0x433fd0]
xorps xmm1, xmm0
movups xmmword [ebp + eax - 0x1010], xmm1
movups xmm0, xmmword [ebp + eax - 0x1000]
movups xmm1, xmmword [eax + 0x433fe0]
xorps xmm1, xmm0
movups xmmword [ebp + eax - 0x1000], xmm1
movups xmm0, xmmword [ebp + eax - 0xff0]
movups xmm1, xmmword [eax + 0x433ff0]
xorps xmm1, xmm0
movups xmmword [ebp + eax - 0xff0], xmm1
movups xmm0, xmmword [ebp + eax - 0xfe0]
movups xmm1, xmmword [eax + 0x434000]
xorps xmm1, xmm0
movups xmmword [ebp + eax - 0xfe0], xmm1
add eax, 0x40
cmp eax, ecx
jb 0x4032f0
cmp edx, 8
jb 0x403394
mov ecx, esi
and ecx, 0xfffffff8
nop dword [eax]
movq xmm0, qword [ebp + eax - 0x1010]
movq xmm1, qword [eax + 0x433fd0]
xorps xmm1, xmm0
movq qword [ebp + eax - 0x1010], xmm1
add eax, 8
cmp eax, ecx
jb 0x403370
cmp eax, esi
jae 0x4033b2
nop dword [eax + eax]
mov cl, byte [eax + 0x433fd0]
xor byte [ebp + eax - 0x1010], cl
inc eax
cmp eax, esi
jb 0x4033a0
lea eax, [ebp - 0x104c]
mov dword [ebp - 0x1014], 0
push eax
lea eax, [ebp - 0x1014]
push eax
push esi
lea eax, [ebp - 0x1010]
push eax
push dword [ebp - 0x1058]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x403435
cmp dword [ebp - 0x1014], esi
jne 0x403435
mov ecx, dword [ebp - 0x1030]
add edi, esi
mov eax, 0
mov edx, edi
adc eax, dword [ebp - 0x1050]
mov dword [ebp - 0x1050], eax
cmp eax, ecx
jg 0x40341d
mov esi, dword [ebp - 0x1034]
jl 0x403240
cmp edx, esi
jb 0x403240
push dword [ebp - 0x1058]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 0x1051], 1
jmp 0x4034ef
mov edx, str.Failed_to_write_file__
mov ecx, 0x43a268
call fcn.00407c20
cmp dword [ebp - 0x1018], 7
lea edx, [ebp - 0x102c]
push dword [ebp - 0x101c]
cmova edx, dword [ebp - 0x102c]
mov ecx, eax
call fcn.00409f10
add esp, 4
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov edx, 0x433d74
mov ecx, esi
call fcn.00407c20
mov ecx, eax
call fcn.00404480
push eax
call fcn.00408210
add esp, 4
push dword [ebp - 0x1058]
jmp 0x4034e2
mov edx, str.Failed_to_read_file__
jmp 0x40343a
mov edx, str.File_size_is_invalid_for__
mov ecx, 0x43a268
call fcn.00407c20
cmp dword [ebp - 0x1018], 7
lea edx, [ebp - 0x102c]
push dword [ebp - 0x101c]
cmova edx, dword [ebp - 0x102c]
mov ecx, eax
call fcn.00409f10
mov edx, 0x433dfc
mov ecx, eax
call fcn.00407c20
push eax
call fcn.00408210
add esp, 8
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 0x1051], 0
mov ecx, dword [ebp - 0x1018]
cmp ecx, 7
jbe 0x40352b
mov edx, dword [ebp - 0x102c]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x403521
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x403556
push ecx
push edx
call fcn.0040da29
add esp, 8
mov al, byte [ebp - 0x1051]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040da1b
mov esp, ebp
pop ebp
ret
call fcn.00401310
call fcn.00414476
call fcn.00414476
int3