Function at 0x41ea50
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x48e00c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, edx
mov esi, ecx
push 0x40001
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], esi
call fcn.00436cf5
push edi
mov ebx, eax
lea eax, [ebp - 0xc]
push 1
push eax
push str.read
mov dword [ebp - 0x30], ebx
call esi
add esp, 0x14
cmp eax, 1
je 0x41ea9f
push 0xfffffffffffffffa
test eax, eax
pop edi
cmovs edi, eax
jmp 0x41ee29
mov al, byte [ebp - 0xc]
test al, al
jne 0x41eae0
push edi
jmp 0x41eac5
push dword [ebp - 0x18]
push eax
push ebx
push str.write
call esi
mov edi, eax
add esp, 0x10
test edi, edi
js 0x41ee29
push dword [ebp - 0x18]
push 0x40000
push ebx
push str.read
call esi
add esp, 0x10
mov edi, eax
test eax, eax
jg 0x41eaa9
jmp 0x41ee29
test al, 0xfe
je 0x41eaec
push 0xfffffffffffffff9
pop edi
jmp 0x41ee29
push edi
push 2
lea eax, [ebp - 0xb]
push eax
push str.read
call esi
add esp, 0x10
cmp eax, 2
jne 0x41ea92
push edi
push 4
pop eax
push eax
lea eax, [ebp - 8]
push eax
push str.read
call esi
add esp, 0x10
cmp eax, 4
jne 0x41ea92
mov esi, dword [ebp - 8]
push esi
call fcn.00436cf5
mov dword [ebp - 0x2c], eax
pop ecx
test esi, esi
je 0x41eb6f
push edi
mov edi, dword [ebp - 0x14]
push esi
push eax
push str.read
call edi
add esp, 0x10
cmp eax, esi
je 0x41eb50
push 0xfffffffffffffffa
test eax, eax
pop edi
cmovs edi, eax
jmp 0x41ee1b
push dword [ebp - 0x18]
mov eax, dword [ebp - 0x2c]
push esi
push eax
push str.write
call edi
mov edi, eax
add esp, 0x10
test edi, edi
js 0x41ee1b
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x41eb7f
push eax
call fcn.00436cda
xor eax, eax
pop ecx
mov dword [ebp - 0x2c], eax
movzx edx, byte [ebp - 0xa]
movzx edi, byte [ebp - 0xb]
add edx, 7
shr edx, 3
mov ecx, edx
mov dword [ebp - 0x28], edi
imul ecx, edi
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x10], ecx
cmp ecx, 1
jbe 0x41ebb4
xor edx, edx
mov eax, 0x40000
div ecx
mov edx, dword [ebp - 0x38]
imul eax, ecx
mov dword [ebp - 0x34], eax
jmp 0x41ebbb
mov dword [ebp - 0x34], 0x40000
push 4
pop ecx
cmp edx, 3
mov eax, edx
cmove eax, ecx
push eax
push edi
call fcn.004395f4
lea edi, [esi + 7]
mov dword [ebp - 0x24], eax
pop ecx
pop ecx
test edi, edi
je 0x41ebf2
cmp dword [ebp - 0x10], 1
jbe 0x41ebf2
lea ecx, [edi - 1]
xor edx, edx
mov edi, dword [ebp - 0x10]
mov eax, ecx
div edi
mov eax, dword [ebp - 0x24]
sub ecx, edx
add edi, ecx
sub edi, esi
mov esi, dword [ebp - 0x14]
sub edi, 7
je 0x41ec1c
push dword [ebp - 0x18]
push edi
push eax
push str.read
call esi
add esp, 0x10
cmp eax, edi
je 0x41ec1c
push 0xfffffffffffffffa
test eax, eax
pop edi
cmovs edi, eax
jmp 0x41ee0d
push dword [ebp - 0x18]
push dword [ebp - 0x34]
push ebx
push str.read
call esi
mov ecx, eax
mov dword [ebp - 0x1c], ecx
jmp 0x41ee00
mov eax, dword [ebp - 0x38]
sub eax, 1
je 0x41ed86
sub eax, 1
je 0x41ed27
sub eax, 1
je 0x41ecc7
sub eax, 1
jne 0x41edd8
mov edi, dword [ebp - 0x28]
lea eax, [ecx + ebx]
mov edx, edi
mov dword [ebp - 0x20], eax
shl edx, 2
mov dword [ebp - 0x10], ebx
lea eax, [edx + ebx]
cmp eax, dword [ebp - 0x20]
ja 0x41edd4
mov ecx, dword [ebp - 0x24]
mov esi, ebx
imul eax, edi, 0xfffffffc
sub ecx, ebx
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 8], eax
test edi, edi
je 0x41ecae
push 4
mov edx, esi
mov ebx, edi
pop esi
mov eax, dword [edx]
add dword [ecx + edx], eax
mov eax, dword [ecx + edx]
mov dword [edx], eax
add edx, esi
sub ebx, 1
jne 0x41ec8f
mov esi, dword [ebp - 0x10]
mov edx, edi
mov ebx, dword [ebp - 0x20]
mov eax, dword [ebp - 8]
shl edx, 2
add esi, edx
add ecx, eax
mov dword [ebp - 0x10], esi
lea eax, [edx + esi]
cmp eax, ebx
mov eax, dword [ebp - 8]
jbe 0x41ec84
mov ebx, dword [ebp - 0x30]
jmp 0x41edce
mov edi, dword [ebp - 0x28]
mov ecx, ebx
mov edx, dword [ebp - 0x1c]
imul eax, edi, 3
add edx, ebx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x20], edx
mov dword [ebp - 8], eax
add eax, ebx
cmp eax, edx
ja 0x41edd1
mov ebx, dword [ebp - 8]
xor edx, edx
test edi, edi
je 0x41ed18
mov esi, ecx
mov ebx, 0xffffff
mov ecx, dword [ebp - 0x24]
mov eax, dword [esi]
and eax, ebx
add dword [ecx + edx*4], eax
mov eax, dword [esi]
xor eax, dword [ecx + edx*4]
and eax, ebx
xor dword [esi], eax
inc edx
lea esi, [esi + 3]
cmp edx, edi
jl 0x41ecfa
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ebp - 8]
add ecx, ebx
mov dword [ebp - 0x10], ecx
lea eax, [ebx + ecx]
cmp eax, dword [ebp - 0x20]
jbe 0x41ecea
jmp 0x41ecbf
mov edi, dword [ebp - 0x28]
lea eax, [ecx + ebx]
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], ebx
lea edx, [edi + edi]
lea eax, [edx + ebx]
mov dword [ebp - 0x20], edx
cmp eax, dword [ebp - 8]
ja 0x41edd4
mov ecx, dword [ebp - 0x24]
mov esi, edi
neg esi
add esi, esi
sub ecx, ebx
test edi, edi
je 0x41ed75
mov edx, ebx
mov dword [ebp - 0x10], edi
mov ax, word [edx]
add word [ecx + edx], ax
mov ax, word [ecx + edx]
mov word [edx], ax
lea edx, [edx + 2]
sub edi, 1
jne 0x41ed59
mov edi, dword [ebp - 0x28]
mov edx, dword [ebp - 0x20]
add ebx, edx
add ecx, esi
lea eax, [edx + ebx]
cmp eax, dword [ebp - 8]
jbe 0x41ed50
jmp 0x41ecbf
mov edi, dword [ebp - 0x28]
lea eax, [ecx + ebx]
mov dword [ebp - 0x10], eax
mov edx, ebx
lea eax, [edi + ebx]
mov dword [ebp - 8], eax
cmp eax, dword [ebp - 0x10]
ja 0x41edd4
mov ecx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x10]
sub ecx, ebx
test edi, edi
je 0x41edc0
mov esi, edi
mov al, byte [edx]
add byte [ecx + edx], al
mov al, byte [ecx + edx]
mov byte [edx], al
inc edx
sub esi, 1
jne 0x41edaa
mov eax, dword [ebp - 8]
mov esi, dword [ebp - 0x10]
mov edx, eax
sub ecx, edi
lea eax, [edx + edi]
mov dword [ebp - 8], eax
cmp eax, esi
jbe 0x41eda4
mov esi, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
je 0x41eded
push dword [ebp - 0x18]
push ecx
push ebx
push str.write
call esi
mov edi, eax
add esp, 0x10
test edi, edi
js 0x41ee0d
push dword [ebp - 0x18]
push dword [ebp - 0x34]
push ebx
push str.read
call esi
mov ecx, eax
mov dword [ebp - 0x1c], eax
add esp, 0x10
mov edi, ecx
test ecx, ecx
jg 0x41ec34
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x41ee1b
push eax
call fcn.00436cda
pop ecx
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x41ee29
push eax
call fcn.00436cda
pop ecx
test ebx, ebx
je 0x41ee34
push ebx
call fcn.00436cda
pop ecx
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0042a75e
leave
ret