Function at 0x413144
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
push ebx
mov ebx, dword [ebp + 8]
push esi
xor ecx, ecx
mov eax, dword [ebx + 0x30]
mov esi, dword [ebx + 0x2c]
push edi
cmp ecx, ecx
lea edx, [eax + esi]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
mov edi, esi
mov dword [ebp - 0x10], edx
ja 0x413184
cmp eax, ecx
jbe 0x413254
mov al, byte [esi]
push eax
call fcn.0041342c
test eax, eax
pop ecx
je 0x413254
test byte [ebx + 0x79], 0x10
jne 0x413254
mov al, byte [esi]
mov dword [ebp - 4], 1
push eax
call fcn.00413441
test eax, eax
pop ecx
jne 0x4131e8
cmp dword [ebp - 8], eax
ja 0x4131be
cmp dword [ebp - 0xc], 5
jb 0x4131e8
mov eax, dword [esi + 1]
lea ecx, [eax + 5]
mov dword [ebp - 0x30], ecx
xor ecx, ecx
cmp dword [ebp - 8], ecx
jb 0x4131e8
ja 0x4131d8
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp - 0x30]
jb 0x4131e8
lea edi, [eax + esi + 5]
mov eax, dword [ebp - 0x30]
sub dword [ebp - 0xc], eax
push 0
pop eax
sbb dword [ebp - 8], eax
cmp dword [ebp - 8], 0
ja 0x4131f8
cmp dword [ebp - 0xc], 2
jb 0x4132ef
mov cl, byte [edi + 1]
mov al, cl
and al, 0x7f
movzx eax, al
cdq
shr cl, 5
and cl, 4
mov dword [ebp - 0x30], eax
movzx eax, cl
mov dword [ebp - 0x2c], edx
cdq
mov dword [ebp - 0x1c], edx
mov edx, dword [ebp - 0x2c]
test edx, edx
mov dword [ebp - 0x20], eax
ja 0x41325a
jb 0x413228
cmp dword [ebp - 0x30], 0x7e
jae 0x41325e
mov ecx, dword [ebp - 0x1c]
cmp dword [ebp - 8], ecx
jb 0x41325a
ja 0x413237
cmp dword [ebp - 0xc], eax
jb 0x41325a
mov ecx, dword [ebp - 0x30]
add eax, 2
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x1c]
adc eax, 0
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x24], eax
jmp 0x4132ef
and dword [ebp - 4], 0
jmp 0x4131e8
cmp dword [ebp - 0x30], 0x7e
jne 0x41329b
test edx, edx
jne 0x41329b
mov ecx, dword [ebp - 0x1c]
mov edx, eax
add edx, 4
adc ecx, 0
cmp dword [ebp - 8], ecx
jb 0x413298
ja 0x41327b
cmp dword [ebp - 0xc], edx
jb 0x413298
mov ax, word [edi + 2]
mov dword [ebp - 0x28], edx
push eax
mov dword [ebp - 0x24], ecx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
cdq
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], edx
jmp 0x4132ef
mov eax, dword [ebp - 0x20]
mov ecx, eax
mov eax, dword [ebp - 0x1c]
add ecx, 0xa
adc eax, 0
cmp dword [ebp - 8], eax
jb 0x4132ef
ja 0x4132b2
cmp dword [ebp - 0xc], ecx
jb 0x4132ef
push dword [edi + 2]
mov ebx, dword [sym.imp.WS2_32.dll_ntohl]
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], eax
call ebx
push 1
push 0
push 0
push eax
call fcn.004176d0
push dword [edi + 6]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], edx
call ebx
mov edx, dword [ebp - 0x30]
mov ebx, dword [ebp + 8]
xor ecx, ecx
add edx, eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x18], edx
adc eax, ecx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
add eax, dword [ebp - 0x18]
adc ecx, dword [ebp - 0x14]
mov dword [ebp - 0x38], eax
jne 0x413308
test eax, eax
jbe 0x4133f3
cmp ecx, dword [ebp - 8]
ja 0x4133f3
jb 0x41331c
cmp eax, dword [ebp - 0xc]
ja 0x4133f3
mov eax, dword [ebp - 0x18]
mov cl, byte [edi]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x28]
mov byte [ebp - 0x3c], cl
xor ecx, ecx
add eax, edi
cmp dword [ebp - 0x1c], ecx
mov dword [ebp - 8], 1
mov dword [ebp - 0x44], eax
ja 0x413342
cmp dword [ebp - 0x20], ecx
jbe 0x41337d
cmp dword [ebp - 0x14], 0
mov dword [ebp - 0x2c], ecx
jb 0x41337d
ja 0x413353
cmp dword [ebp - 0x18], 0
jbe 0x41337d
mov edx, ecx
and edx, 3
sub edx, dword [ebp - 0x20]
add edx, dword [ebp - 0x28]
mov dl, byte [edx + edi]
xor byte [eax + ecx], dl
add ecx, 1
adc dword [ebp - 0x2c], 0
mov edx, dword [ebp - 0x2c]
cmp edx, dword [ebp - 0x14]
jb 0x413353
ja 0x41337a
cmp ecx, dword [ebp - 0x18]
jb 0x413353
mov ebx, dword [ebp + 8]
cmp dword [ebp - 4], 0
je 0x4133f9
push dword [ebp - 0x3c]
call fcn.00413441
test eax, eax
pop ecx
je 0x4133ac
mov eax, dword [ebx + 0x34]
add eax, 4
push eax
lea eax, [ebx + 0x2c]
push eax
call fcn.0040b888
and byte [esi], 0xf0
and dword [esi + 1], 0
pop ecx
lea edi, [esi + 5]
pop ecx
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x44]
push eax
push dword [ebp - 0x44]
push edi
call dword [sym.imp.MSVCRT.dll_memmove]
mov eax, dword [ebp - 0x40]
add esp, 0xc
add dword [esi + 1], eax
mov eax, edi
sub eax, dword [ebp - 0x44]
add dword [ebx + 0x30], eax
test byte [ebp - 0x3c], 0x80
je 0x413412
lea eax, [esi + 5]
mov dword [ebp - 0x44], eax
mov eax, dword [esi + 1]
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x44]
push eax
push ebx
call fcn.00413456
mov eax, dword [esi + 1]
add eax, 5
push eax
jmp 0x413406
and dword [ebp - 8], 0
jmp 0x413424
lea eax, [ebp - 0x44]
push eax
push ebx
call fcn.00413456
push dword [ebp - 0x38]
lea eax, [ebx + 0x2c]
push eax
call fcn.0040b9ad
add esp, 0x10
cmp dword [ebp - 4], 0
jne 0x413424
mov al, byte [edi]
and al, 0xf
cmp al, 8
jne 0x413424
or byte [ebx + 0x79], 4
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret