Function at 0x410290
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x38
mov eax, dword [esp + 0x3c]
mov ecx, dword [eax + 0x30]
push ebx
push ebp
push esi
xor edx, edx
push edi
mov edi, dword [eax + 0x2c]
mov dword [esp + 0x20], ecx
add ecx, edi
xor ebp, ebp
xor ebx, ebx
xor esi, esi
mov dword [esp + 0x38], edx
mov dword [esp + 0x24], edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], edx
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], ecx
test edx, edx
ja 0x4102d5
cmp dword [esp + 0x20], edx
jbe 0x4103b0
mov cl, byte [edi]
test cl, cl
jns 0x4102e4
test cl, 0xf
jne 0x4103b0
test dword [eax + 0x80], 0x1000
jne 0x4103b0
mov dword [esp + 0x14], 1
test cl, cl
js 0x410305
test cl, 0xf
jne 0x410341
test edx, edx
ja 0x410310
cmp dword [esp + 0x20], 5
jb 0x410341
mov eax, dword [edi + 1]
add eax, 5
mov dword [esp + 0x40], eax
xor eax, eax
cmp edx, eax
jb 0x410341
ja 0x41032c
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 0x40]
jb 0x410341
mov eax, dword [edi + 1]
mov ecx, dword [esp + 0x40]
sub dword [esp + 0x20], ecx
lea edi, [eax + edi + 5]
mov eax, edx
sbb dword [esp + 0x24], eax
cmp dword [esp + 0x24], edx
ja 0x410352
cmp dword [esp + 0x20], 2
jb 0x410445
mov cl, byte [edi + 1]
mov dl, cl
and dl, 0x7f
movzx eax, dl
cdq
shr cl, 5
and cl, 4
mov dword [esp + 0x40], eax
movzx eax, cl
mov dword [esp + 0x44], edx
mov ecx, dword [esp + 0x44]
cdq
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
test ecx, ecx
ja 0x4103b6
jb 0x410389
cmp dword [esp + 0x40], 0x7e
jae 0x4103bb
cmp dword [esp + 0x24], edx
jb 0x4103b6
ja 0x410397
cmp dword [esp + 0x20], eax
jb 0x4103b6
mov esi, dword [esp + 0x40]
mov dword [esp + 0x38], esi
mov ebx, eax
add ebx, 2
mov esi, edx
mov ebp, ecx
adc esi, 0
jmp 0x410445
mov dword [esp + 0x14], edx
jmp 0x410341
cmp dword [esp + 0x40], 0x7e
jne 0x4103f5
test ecx, ecx
jne 0x4103f5
mov ecx, dword [esp + 0x34]
mov edx, eax
add edx, 4
adc ecx, ebx
cmp dword [esp + 0x24], ecx
jb 0x4103f1
ja 0x4103da
cmp dword [esp + 0x20], edx
jb 0x4103f1
movzx eax, word [edi + 2]
push eax
mov ebx, edx
mov esi, ecx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
cdq
mov ebp, edx
jmp 0x410441
mov edx, dword [esp + 0x34]
mov ecx, eax
add ecx, 0xa
mov eax, edx
adc eax, 0
cmp dword [esp + 0x24], eax
jb 0x410445
ja 0x41040d
cmp dword [esp + 0x20], ecx
jb 0x410445
mov ebp, dword [sym.imp.WS2_32.dll_ntohl]
mov ebx, ecx
mov ecx, dword [edi + 2]
push ecx
mov esi, eax
call ebp
push 1
push 0
push 0
push eax
call fcn.0042ff00
mov dword [esp + 0x44], edx
mov edx, dword [edi + 6]
push edx
mov dword [esp + 0x44], eax
call ebp
xor ebp, ebp
add eax, dword [esp + 0x40]
adc ebp, dword [esp + 0x44]
mov dword [esp + 0x38], eax
mov ecx, dword [esp + 0x38]
mov eax, ebx
add eax, ecx
adc esi, ebp
mov dword [esp + 0x40], eax
jne 0x410459
test eax, eax
jbe 0x410467
cmp esi, dword [esp + 0x24]
ja 0x410467
jb 0x410471
cmp eax, dword [esp + 0x20]
jbe 0x410471
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
cmp dword [esp + 0x34], 0
mov dl, byte [edi]
lea esi, [ebx + edi]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x20], esi
mov byte [esp + 0x28], dl
ja 0x410490
cmp dword [esp + 0x30], 0
jbe 0x4104c7
xor eax, eax
xor ecx, ecx
test ebp, ebp
jb 0x4104c7
ja 0x4104a0
cmp dword [esp + 0x38], ecx
jbe 0x4104c3
mov edx, eax
and edx, 3
sub edx, dword [esp + 0x30]
add edx, ebx
mov dl, byte [edx + edi]
xor byte [esi + eax], dl
add eax, 1
adc ecx, 0
cmp ecx, ebp
jb 0x4104a0
ja 0x4104c3
cmp eax, dword [esp + 0x38]
jb 0x4104a0
mov dl, byte [esp + 0x28]
cmp dword [esp + 0x14], 0
je 0x4105be
test dl, dl
js 0x410522
test dl, 0xf
je 0x410522
mov esi, dword [esp + 0x4c]
mov edi, dword [esi + 0x34]
mov eax, dword [esi + 0x34]
add edi, 4
cmp edi, eax
ja 0x4104f3
jae 0x41050e
cmp edi, dword [esi + 0x30]
jb 0x41050e
mov eax, dword [esi + 0x2c]
push edi
push eax
call fcn.0042cb59
add esp, 8
test eax, eax
jne 0x410508
test edi, edi
jne 0x41050e
mov dword [esi + 0x2c], eax
mov dword [esi + 0x34], edi
mov ebp, dword [esp + 0x18]
and byte [ebp], 0xf0
lea edi, [ebp + 5]
mov dword [ebp + 1], 0
jmp 0x41052a
mov ebp, dword [esp + 0x18]
mov esi, dword [esp + 0x4c]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
sub eax, ecx
push eax
push ecx
push edi
call fcn.0042b010
mov ecx, dword [esp + 0x30]
add dword [ebp + 1], ecx
mov al, byte [esp + 0x34]
mov edx, edi
sub edx, dword [esp + 0x2c]
add esp, 0xc
add dword [esi + 0x30], edx
test al, al
jns 0x410620
mov edx, dword [ebp + 1]
lea ecx, [ebp + 5]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], edx
test al, 8
je 0x41057d
mov ecx, dword [esi + 0x6c]
lea eax, [esp + 0x20]
push eax
push ecx
mov ebx, 0x72
jmp 0x41058b
mov eax, dword [esi + 0x6c]
lea edx, [esp + 0x20]
push edx
push eax
mov ebx, 0x71
call fcn.0040d4a0
mov ebp, dword [ebp + 1]
add esp, 8
add ebp, 5
je 0x410620
mov eax, dword [esi + 0x30]
cmp ebp, eax
ja 0x410620
mov ecx, dword [esi + 0x2c]
sub eax, ebp
push eax
lea edx, [ecx + ebp]
push edx
push ecx
call fcn.0042b010
add esp, 0xc
sub dword [esi + 0x30], ebp
jmp 0x410620
mov esi, dword [esp + 0x4c]
test dl, 8
je 0x4105d7
mov ecx, dword [esi + 0x6c]
lea eax, [esp + 0x20]
push eax
push ecx
mov ebx, 0x72
jmp 0x4105e5
mov eax, dword [esi + 0x6c]
lea edx, [esp + 0x20]
push edx
push eax
mov ebx, 0x71
call fcn.0040d4a0
mov esi, dword [esp + 0x48]
add esp, 8
test esi, esi
jbe 0x41061c
mov ecx, dword [esp + 0x4c]
mov eax, dword [ecx + 0x30]
cmp esi, eax
ja 0x41061c
mov ebx, ecx
mov ecx, dword [ebx + 0x2c]
sub eax, esi
push eax
lea edx, [ecx + esi]
push edx
push ecx
call fcn.0042b010
add esp, 0xc
sub dword [ebx + 0x30], esi
mov esi, ebx
jmp 0x410620
mov esi, dword [esp + 0x4c]
mov al, byte [edi]
and al, 0xf
cmp al, 8
mov eax, 1
jne 0x410637
or dword [esi + 0x80], 0x400
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret