Function at 0x477239
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
and dword [ebp - 0x10], 0
push ebx
push esi
mov esi, eax
mov eax, dword [ebp + 0x14]
and eax, 0x1000000
mov dword [ebp - 0x1c], eax
movzx eax, word [ebp + 0x14]
test eax, eax
push edi
mov dword [ebp + 0x14], eax
lea ebx, [esi + ecx]
jne 0x4772be
cmp esi, ebx
mov edi, dword [ebp + 0xc]
mov eax, esi
jae 0x47727f
mov dl, byte [eax]
cmp dl, 0x7f
ja 0x47727f
movzx dx, dl
mov word [edi], dx
inc edi
inc edi
inc eax
cmp eax, ebx
jb 0x47726a
mov ebx, edi
sub ebx, dword [ebp + 0xc]
sar ebx, 1
sub ecx, ebx
add esi, ebx
test ecx, ecx
jle 0x4772b3
push dword [ebp + 0x10]
push edi
push ecx
push esi
push 8
push dword [ebp + 8]
call dword [0x4acb54]
test eax, eax
jg 0x4772ae
xor eax, eax
cmp dword [ebp - 0x1c], eax
jne 0x4774c7
add ebx, eax
lea edi, [edi + eax*2]
and word [edi], 0
mov eax, ebx
jmp 0x4774c7
and dword [ebp - 0x58], 0
xor al, 0xa
mov byte [ebp - 1], al
xor eax, eax
lea edi, [ebp - 0x54]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea ecx, [ebp - 0x44]
stosd dword es:[edi], eax
call fcn.00440268
mov dword [ebp - 8], 1
jmp 0x47730f
mov eax, esi
jmp 0x4772ed
mov cl, byte [esi]
inc esi
cmp byte [ebp - 1], cl
je 0x4772f1
cmp esi, ebx
jb 0x4772e5
mov edi, esi
sub edi, eax
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x58]
push eax
lea ecx, [ebp - 0x44]
mov dword [ebp - 0x50], edi
call fcn.00440282
cmp dword [ebp - 8], edi
jge 0x47730f
mov dword [ebp - 8], edi
cmp esi, ebx
jb 0x4772e1
push dword [ebp + 0x10]
lea ecx, [ebp - 0x28]
call fcn.00435d80
mov eax, dword [ebp - 0x28]
push dword [ebp - 8]
lea ecx, [ebp - 0x18]
mov dword [ebp - 0xc], eax
call fcn.00435c56
mov eax, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x18]
and dword [ebp - 0x14], 0
test eax, eax
mov esi, dword [ebp - 0x44]
mov ebx, eax
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x30], ebx
jle 0x47746c
cdq
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], edx
call fcn.004329a6
push dword [ebp - 0x34]
push dword [ebp - 0x38]
push edx
push eax
call fcn.00482900
cmp eax, ebx
jge 0x477460
lea ecx, [eax + eax*4]
lea ecx, [esi + ecx*4]
cmp dword [ecx], 0
je 0x477388
inc eax
add ecx, 0x14
cmp eax, ebx
jl 0x477376
jmp 0x477460
inc dword [ebp - 0x14]
lea eax, [eax + eax*4]
lea esi, [esi + eax*4]
mov ebx, dword [esi + 8]
push ebx
push dword [esi + 4]
mov dword [esi], 1
push edi
call fcn.004102e0
lea ecx, [ebx + edi]
add esp, 0xc
cmp edi, ecx
mov eax, edi
jae 0x4773ba
mov dl, byte [ebp + 0x14]
xor byte [eax], dl
inc eax
cmp eax, ecx
jb 0x4773b0
mov eax, dword [ebp - 0xc]
and dword [ebp - 0x2c], 0
cmp edi, ecx
mov dword [ebp - 8], eax
mov edx, edi
jae 0x4773e3
mov al, byte [edx]
cmp al, 0x7f
ja 0x4773e3
mov edi, dword [ebp - 8]
add dword [ebp - 8], 2
movzx ax, al
inc edx
cmp edx, ecx
mov word [edi], ax
jb 0x4773ca
mov edi, dword [ebp - 8]
sub edi, dword [ebp - 0xc]
sar edi, 1
sub ebx, edi
test ebx, ebx
jle 0x477431
sub ecx, edx
cmp dword [ebp + 8], 0xfde9
jne 0x47740b
push dword [ebp - 8]
push ecx
push edx
call fcn.00475337
add esp, 0xc
jmp 0x477422
mov eax, dword [ebp + 0x10]
sub eax, dword [ebp - 0x10]
push eax
push dword [ebp - 8]
push ecx
push edx
push 8
push dword [ebp + 8]
call dword [0x4acb54]
test eax, eax
jg 0x477434
xor eax, eax
cmp dword [ebp - 0x1c], eax
je 0x477434
xor esi, esi
jmp 0x4774ab
mov eax, dword [ebp - 0x2c]
add edi, eax
add dword [ebp - 0x10], edi
mov eax, dword [ebp - 0xc]
mov dword [esi + 0x10], edi
dec edi
mov dword [esi + 0xc], eax
js 0x47745a
lea ecx, [edi + 1]
mov eax, dword [ebp - 0xc]
mov dx, word [ebp + 0x14]
xor word [eax], dx
inc eax
inc eax
dec ecx
mov dword [ebp - 0xc], eax
jne 0x477448
mov edi, dword [ebp - 0x20]
mov esi, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x30]
cmp dword [ebp - 0x14], ebx
jl 0x477356
test ebx, ebx
jle 0x477495
add esi, 0x10
mov eax, dword [esi]
mov edi, dword [ebp + 0xc]
shl eax, 1
push eax
push dword [esi - 4]
push edi
call fcn.004102e0
mov eax, dword [esi]
add esp, 0xc
lea eax, [edi + eax*2]
add esi, 0x14
dec ebx
mov dword [ebp + 0xc], eax
jne 0x477473
mov eax, dword [ebp + 0xc]
mov cx, word [ebp + 0x14]
mov word [eax], cx
push dword [ebp - 0x18]
call fcn.00430901
mov esi, dword [ebp - 0x10]
pop ecx
lea ecx, [ebp - 0x18]
call fcn.0043092f
lea ecx, [ebp - 0x28]
call fcn.0043092f
lea eax, [ebp - 0x44]
push eax
call fcn.00430981
pop ecx
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret