Function at 0x46c0a0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x84
mov eax, dword [0x4af890]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
push esi
push str.writing__s_n
push 1
call dword [0x7b17e0]
call fcn.0046bf60
push 0x70
lea eax, [ebp - 0x74]
push 0
push eax
call fcn.0046e6d0
mov eax, dword [0x7b12ec]
mov dword [ebp - 0x78], eax
lea eax, [ebp - 0x84]
push 1
push eax
push esi
mov dword [ebp - 0x80], 0x53414145
mov dword [ebp - 0x7c], 5
call dword [0x7b1810]
mov eax, dword [ebp - 0x84]
add esp, 0x24
test eax, eax
jne 0x46c12c
push esi
push str.error_opening__s_n
push 3
call dword [0x7b17e0]
add esp, 0xc
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret
push eax
lea eax, [ebp - 0x80]
push 0x7c
push eax
call dword [0x7b1818]
mov esi, dword [0x7b1378]
mov ecx, 0x7c
shl esi, 5
add esp, 0xc
mov dword [0x6cd210], ecx
mov dword [ebp - 0x74], ecx
mov dword [ebp - 0x70], esi
test esi, esi
jle 0x46c176
push dword [ebp - 0x84]
push esi
push dword [0x7b137c]
call dword [0x7b1818]
mov ecx, dword [0x6cd210]
add esp, 0xc
mov eax, dword [0x7b1380]
add ecx, esi
mov dword [0x6cd210], ecx
mov dword [ebp - 0x6c], ecx
lea esi, [eax + eax*2]
shl esi, 2
mov dword [ebp - 0x68], esi
test esi, esi
jle 0x46c1af
push dword [ebp - 0x84]
push esi
push dword [0x7b1384]
call dword [0x7b1818]
mov ecx, dword [0x6cd210]
add esp, 0xc
mov eax, dword [0x7b1388]
add ecx, esi
mov dword [0x6cd210], ecx
lea eax, [eax + eax*4]
shl eax, 2
push eax
push dword [0x7b138c]
lea eax, [ebp - 0x80]
push 2
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b1390]
shl eax, 3
push eax
push dword [0x7b1394]
lea eax, [ebp - 0x80]
push 3
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b1398]
shl eax, 2
push eax
push dword [0x7b139c]
lea eax, [ebp - 0x80]
push 4
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b13a0]
lea eax, [eax + eax*2]
shl eax, 3
push eax
push dword [0x7b13a4]
lea eax, [ebp - 0x80]
push 5
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b13a8]
shl eax, 2
push eax
push dword [0x7b13ac]
lea eax, [ebp - 0x80]
push 6
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b13b0]
lea eax, [eax + eax*2]
shl eax, 4
push eax
push dword [0x7b13b4]
lea eax, [ebp - 0x80]
push 7
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b13b8]
lea ecx, [eax*8]
sub ecx, eax
lea eax, [ebp - 0x80]
shl ecx, 2
push ecx
push dword [0x7b13bc]
push 8
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
imul eax, dword [0x7b13c0], 0x2c
push eax
push dword [0x7b13c4]
lea eax, [ebp - 0x80]
push 9
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b13c8]
lea eax, [eax + eax*2]
shl eax, 2
push eax
push dword [0x7b13cc]
lea eax, [ebp - 0x80]
push 0xa
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b13d0]
lea eax, [eax + eax*4]
shl eax, 2
push eax
push dword [0x7b13d4]
lea eax, [ebp - 0x80]
push 0xb
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b13d8]
shl eax, 2
push eax
push dword [0x7b13dc]
lea eax, [ebp - 0x80]
push 0xc
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
mov eax, dword [0x7b13e0]
shl eax, 4
push eax
push dword [0x7b13e4]
lea eax, [ebp - 0x80]
push 0xd
push eax
push dword [ebp - 0x84]
call fcn.0046c440
add esp, 0x14
test eax, eax
je 0x46c11b
push 2
push 0
push dword [ebp - 0x84]
call dword [0x7b1820]
add esp, 0xc
xor ecx, ecx
jmp 0x46c3f0
movzx eax, cl
imul eax, eax, 0x77
xor byte [ebp + ecx - 0x78], al
inc ecx
cmp ecx, 0x74
jl 0x46c3f0
push dword [ebp - 0x84]
lea eax, [ebp - 0x80]
push 0x7c
push eax
call dword [0x7b1818]
push dword [ebp - 0x84]
call dword [0x7b181c]
mov ecx, dword [ebp - 4]
add esp, 0x10
xor ecx, ebp
mov eax, 1
pop esi
call fcn.0046cfaf
mov esp, ebp
pop ebp
ret