Function at 0x478c80
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
xor edi, edi
mov esi, ecx
mov dword [ebp - 4], eax
mov dword [ebp + 0xc], ebx
test ebx, ebx
jle 0x478f0a
cmp dword [esi + 0x18], 0
je 0x478e31
mov eax, dword [esi + 0x20]
mov dword [ebp + 8], eax
cmp eax, ebx
jl 0x478cb8
mov dword [ebp + 8], ebx
mov eax, dword [esi + 0x1c]
mov ecx, dword [ebp + 8]
sub eax, dword [esi + 0x20]
mov edx, dword [ebp - 4]
push ecx
push edx
lea ecx, [eax + esi + 4]
push ecx
call sub.MSVCR100.dll_memcpy
mov edx, dword [ebp + 8]
add esp, 0xc
sub dword [esi + 0x20], edx
jne 0x478ef7
mov edx, dword [esi + 4]
mov eax, edx
shr eax, 8
and eax, 0x7f
cmp eax, 0x7e
jge 0x478cf8
mov dword [ebp - 8], 0
jmp 0x478d08
lea ecx, [eax - 0x7e]
neg ecx
sbb ecx, ecx
and ecx, 6
add ecx, 2
mov dword [ebp - 8], ecx
mov ecx, dword [ebp - 8]
mov ebx, edx
shr ebx, 0xf
and ebx, 1
add ebx, ebx
add ebx, ebx
lea ecx, [ebx + ecx + 2]
mov dword [ebp - 0xc], ecx
mov ecx, dword [esi + 0x1c]
cmp ecx, dword [ebp - 0xc]
jge 0x478d38
mov eax, dword [ebp - 0xc]
mov edx, eax
sub edx, ecx
mov dword [esi + 0x20], edx
mov dword [esi + 0x1c], eax
jmp 0x478ef4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
test ecx, ecx
je 0x478d4d
test ebx, ebx
je 0x478f15
test ecx, ecx
jne 0x478d55
test ebx, ebx
jg 0x478f15
mov ecx, dword [ebp - 8]
test ecx, ecx
jne 0x478d5f
cdq
jmp 0x478d84
cmp ecx, 2
jne 0x478d74
shr edx, 0x10
push edx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
cdq
jmp 0x478d84
mov edx, dword [esi + 0xa]
mov eax, dword [esi + 6]
push edx
push eax
call fcn.0044bf90
add esp, 8
mov dword [esi + 0x2c], edx
mov ecx, dword [esi + 0x2c]
mov edx, eax
mov dword [esi + 0x28], eax
mov dword [esi + 0x30], edx
mov dword [esi + 0x34], ecx
test ebx, ebx
jle 0x478da2
mov eax, dword [ebp - 8]
lea edi, [eax + esi + 6]
jmp 0x478da4
xor edi, edi
mov dword [esi + 0x14], edi
mov al, byte [esi + 4]
and al, 0xf
mov byte [ebp - 0x10], al
mov eax, dword [esi + 4]
mov ebx, eax
shr eax, 7
and eax, 1
push ecx
mov ecx, dword [esi]
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x1c], edx
mov eax, dword [ebp - 0x1c]
mov edx, dword [ecx + 0x10]
mov ecx, dword [ecx + 0xc]
push eax
mov eax, dword [ebp - 0x10]
push edi
push eax
shr ebx, 4
and bl, 7
mov byte [ebp - 0x14], bl
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 8], edx
mov edx, dword [ecx + 0x5b4]
mov ebx, dword [edx]
push eax
mov eax, dword [ebp - 8]
mov eax, dword [eax + 4]
push eax
push ecx
mov ecx, edx
mov edx, dword [ebx + 0x2c]
call edx
mov edi, eax
cmp edi, 2
je 0x478f0a
cmp dword [esi + 0x2c], 0
ja 0x478e14
cmp dword [esi + 0x28], 0
jbe 0x478e20
mov dword [esi + 0x18], 0
jmp 0x478ef4
mov ecx, esi
call fcn.00478140
mov edi, eax
cmp edi, 2
jmp 0x478ef2
mov edi, dword [esi + 0x30]
mov eax, ebx
cdq
cmp dword [esi + 0x34], edx
ja 0x478e47
jb 0x478e42
cmp edi, eax
jae 0x478e47
mov dword [ebp + 8], edi
jmp 0x478e4c
mov dword [ebp + 8], ebx
mov edi, ebx
cmp dword [esi + 0x14], 0
je 0x478e7b
mov ecx, dword [esi + 0x28]
sub ecx, dword [esi + 0x30]
and ecx, 3
test edi, edi
jle 0x478e7b
mov eax, dword [ebp - 4]
sub ecx, eax
mov dword [ebp - 0xc], edi
mov ebx, dword [esi + 0x14]
lea edx, [ecx + eax]
and edx, 3
mov dl, byte [edx + ebx]
xor byte [eax], dl
inc eax
dec dword [ebp - 0xc]
jne 0x478e67
mov eax, edi
cdq
sub dword [esi + 0x30], eax
mov eax, dword [esi]
push edi
sbb dword [esi + 0x34], edx
mov edx, dword [eax + 0x10]
mov eax, dword [eax + 0xc]
push dword [ebp - 4]
mov ecx, dword [eax + 0x5b4]
mov edx, dword [edx + 4]
mov ebx, dword [ecx]
push edx
push eax
mov eax, dword [ebx + 0x30]
call eax
mov edi, eax
cmp edi, 2
je 0x478f0a
mov ecx, dword [esi + 0x30]
or ecx, dword [esi + 0x34]
jne 0x478ef4
mov eax, dword [esi]
mov edx, dword [eax + 0x10]
mov eax, dword [eax + 0xc]
mov ecx, dword [eax + 0x5b4]
mov edx, dword [edx + 4]
mov edi, dword [ecx]
push edx
push eax
mov eax, dword [edi + 0x34]
call eax
xor edx, edx
mov ecx, 2
mov dword [esi + 0x18], 1
mov dword [esi + 0x14], edx
mov dword [esi + 0x1c], ecx
mov dword [esi + 0x20], ecx
mov dword [esi + 0x28], edx
mov dword [esi + 0x2c], edx
mov dword [esi + 0x30], edx
mov dword [esi + 0x34], edx
mov edi, eax
cmp eax, ecx
je 0x478f0a
mov ebx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
add dword [ebp - 4], eax
sub ebx, eax
mov dword [ebp + 0xc], ebx
test ebx, ebx
jg 0x478ca1
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
mov eax, 2
pop ebx
mov esp, ebp
pop ebp
ret 8