Function at 0x401180
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x40e008]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [edx + 0x14], 0x10
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x14], 0
jb 0x4011a2
mov edx, dword [edx]
push 0x40b46c
push edx
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen_s]
add esp, 0xc
test eax, eax
jne 0x40135a
push ebx
push esi
push edi
push 2
push eax
push dword [ebp - 0x14]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push dword [ebp - 0x14]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
push dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_rewind]
mov eax, dword [ebp - 0x18]
xor ebx, ebx
xor ecx, ecx
mov dword [ebp - 0x1c], ebx
add esp, 0x14
mov dword [ebp - 0x10], ebx
xor esi, esi
mov dword [ebp - 0xc], ebx
xor edi, edi
mov dword [ebp - 0x20], ecx
mov dword [ebp - 8], ecx
test eax, eax
je 0x40122d
push eax
lea ecx, [ebp - 0x10]
call fcn.004032d0
mov eax, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x10]
push eax
push edi
push ebx
mov dword [ebp - 0x1c], ebx
call sub.VCRUNTIME140.dll_memset
mov eax, dword [ebp - 0x18]
add esp, 0xc
mov ecx, dword [ebp - 8]
mov edi, ebx
mov dword [ebp - 0x20], ecx
lea esi, [ebx + eax]
push dword [ebp - 0x14]
push eax
push 1
push eax
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread_s]
push dword [ebp - 0x14]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov edx, dword [ebp + 8]
add esp, 0x18
sub esi, edi
cmp byte [edx + 0xc], 0
mov ebx, dword [edx + 4]
je 0x401279
test esi, esi
je 0x4012e4
nop dword [eax]
movzx ecx, byte [edi]
lea edi, [edi + 1]
movzx eax, bl
xor ecx, eax
shr ebx, 8
xor ebx, dword [edx + ecx*4 + 0x10]
sub esi, 1
jne 0x401260
jmp 0x4012e4
mov eax, dword fs:[0x2c]
mov ecx, dword [eax]
mov eax, dword [0x40e610]
cmp eax, dword [ecx + 4]
jle 0x4012be
push 0x40e610
call fcn.00408dc4
add esp, 4
cmp dword [0x40e610], 0xffffffff
jne 0x4012bb
push 0x40e610
mov dword [0x40e614], 0x18
call fcn.00408d7a
add esp, 4
mov edx, dword [ebp + 8]
test esi, esi
je 0x4012e4
mov ecx, dword [0x40e614]
lea edi, [edi + 1]
mov eax, ebx
shl ebx, 8
shr eax, cl
movzx ecx, al
movzx eax, byte [edi - 1]
xor ecx, eax
xor ebx, dword [edx + ecx*4 + 0x10]
sub esi, 1
jne 0x4012c2
mov al, byte [edx + 0xc]
cmp al, byte [edx + 0xd]
je 0x401306
mov ecx, ebx
xor ebx, ebx
lea edx, [ebx + 0x20]
mov eax, ecx
add ebx, ebx
and eax, 1
shr ecx, 1
or ebx, eax
sub edx, 1
jne 0x4012f3
mov edx, dword [ebp + 8]
mov eax, dword [edx + 8]
mov ecx, dword [ebp - 0x1c]
xor eax, ebx
cmp dword [ebp - 0x24], eax
sete bl
test ecx, ecx
je 0x401347
mov edx, dword [ebp - 0x20]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x40133d
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40133d
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.00408c77
add esp, 8
pop edi
pop esi
mov al, bl
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00408c46
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor al, al
xor ecx, ebp
call fcn.00408c46
mov esp, ebp
pop ebp
ret