Function at 0x405054
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x128
mov eax, dword [0x590cec]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 0x28]
push esi
mov esi, ecx
mov ecx, dword [ebp + 0x1c]
push edi
mov edi, dword [ebp + 0x24]
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x34], ecx
test eax, eax
je 0x405253
test ecx, ecx
je 0x405253
test edi, edi
je 0x405253
test ebx, ebx
je 0x405253
test edx, edx
je 0x4050bc
cmp dword [ebp + 0x18], 0x10
jne 0x4050bc
push 0x10
push edx
lea eax, [ebp - 0x24]
push eax
call fcn.004f4490
jmp 0x4050c9
push 0x10
lea eax, [ebp - 0x24]
push 0
push eax
call fcn.004f42d0
add esp, 0xc
cmp dword [ebp + 8], 0
je 0x4051a0
and dword [edi], 0
mov ecx, esi
call fcn.00404ce9
test eax, eax
je 0x405243
xor eax, eax
push eax
push eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], eax
push 0x5441c4
lea eax, [ebp - 0x28]
push eax
call dword [esi + 4]
test eax, eax
jne 0x405243
cmp dword [ebp - 0x28], eax
je 0x405243
push eax
push dword [ebp + 0x20]
push dword [ebp - 0x34]
push eax
push eax
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x28]
call dword [esi + 0xc]
test eax, eax
jne 0x40517d
cmp dword [ebp - 0x2c], eax
je 0x405189
push 1
push ebx
push eax
push eax
push dword [ebp + 0x18]
lea ecx, [ebp - 0x24]
push ecx
push eax
push dword [ebp + 0x10]
push dword [ebp - 0x30]
push dword [ebp - 0x2c]
call dword [esi + 0x10]
test eax, eax
jne 0x40517d
push dword [ebx]
call fcn.004b6e34
pop ecx
mov dword [edi], eax
test eax, eax
je 0x40517d
push 1
push ebx
push dword [ebx]
push eax
push dword [ebp + 0x18]
lea eax, [ebp - 0x24]
push eax
push 0
push dword [ebp + 0x10]
push dword [ebp - 0x30]
push dword [ebp - 0x2c]
call dword [esi + 0x10]
test eax, eax
jne 0x40517d
xor eax, eax
inc eax
jmp 0x405255
cmp dword [ebp - 0x2c], 0
je 0x405189
push dword [ebp - 0x2c]
call dword [esi + 0x1c]
cmp dword [ebp - 0x28], 0
je 0x405243
push 0
push dword [ebp - 0x28]
call dword [esi + 0x18]
jmp 0x405243
mov esi, dword [ebp + 0x10]
push esi
call fcn.004b6e34
pop ecx
mov dword [edi], eax
test eax, eax
je 0x405253
mov eax, dword [ebp + 0x20]
shl eax, 3
push eax
push dword [ebp - 0x34]
lea eax, [ebp - 0x128]
mov dword [ebx], esi
push eax
xor esi, esi
call fcn.00402ed5
add esp, 0xc
cmp dword [ebp + 0x10], esi
jbe 0x405230
mov eax, dword [ebp - 0x30]
lea ecx, [ebp - 0x14]
add eax, esi
push ecx
push eax
lea eax, [ebp - 0x128]
push eax
call fcn.0040344c
mov eax, dword [ebp - 0x24]
xor dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x20]
xor dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
xor dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x18]
xor dword [ebp - 8], eax
push 0x10
lea eax, [ebp - 0x14]
push eax
mov eax, dword [edi]
add eax, esi
push eax
call fcn.004f4490
mov eax, dword [ebp - 0x30]
add eax, esi
push 0x10
push eax
lea eax, [ebp - 0x24]
push eax
call fcn.004f4490
add esi, 0x10
add esp, 0x24
cmp esi, dword [ebp + 0x10]
jb 0x4051d6
mov ecx, dword [ebp - 0x28]
push ebx
push dword [edi]
call fcn.00404c1b
test eax, eax
jne 0x405175
mov eax, dword [edi]
test eax, eax
je 0x405253
push eax
call fcn.004b6e29
and dword [edi], 0
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004f41b5
leave
ret 0x24