Function at 0x408120
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
mov edx, dword [ebp + 0xc]
push ebx
push esi
xor esi, esi
push edi
mov dword [ebp - 8], esi
mov dword [ebp - 4], esi
cmp edx, esi
je 0x40813b
mov byte [edx], 0
cmp eax, esi
jne 0x408147
push 0xffffffffffffff9a
pop eax
jmp 0x408322
mov edi, dword [eax + 0x7c]
cmp edi, esi
je 0x40813f
cmp dword [edi], esi
jne 0x408156
push 0xffffffffffffff9c
jmp 0x408141
cmp ecx, esi
jne 0x408161
xor eax, eax
jmp 0x408322
mov eax, dword [ebp + 8]
mov dword [edi + 0x10], eax
mov eax, dword [edi + 0x5c]
mov dword [edi + 0x14], ecx
cmp ecx, eax
jbe 0x408174
mov dword [edi + 0x14], eax
cmp dword [edi + 0x14], esi
jbe 0x40834d
jmp 0x408182
mov edx, dword [ebp + 0xc]
cmp dword [edi + 8], 0
jne 0x408232
mov eax, dword [edi + 0x58]
test eax, eax
jbe 0x408232
mov ebx, 0x4000
mov dword [ebp - 0x10], ebx
cmp eax, ebx
jae 0x4081b0
mov dword [ebp - 0x10], eax
test eax, eax
je 0x408327
mov ebx, eax
mov edx, dword [edi + 0x68]
add edx, dword [edi + 0x3c]
mov eax, dword [edi + 0x60]
xor esi, esi
call fcn.0040771b
test eax, eax
jne 0x408337
mov esi, dword [edi + 0x60]
push 1
push ebx
push dword [edi]
call fcn.0040777a
add esp, 0xc
cmp eax, 1
jne 0x408337
add dword [edi + 0x3c], ebx
sub dword [edi + 0x58], ebx
cmp byte [edi + 0x6c], 0
mov esi, dword [edi]
mov dword [edi + 4], esi
mov dword [edi + 8], ebx
je 0x408232
and dword [ebp - 0xc], 0
test ebx, ebx
jbe 0x408232
lea ecx, [edi + 0x70]
mov eax, dword [ecx + 8]
and eax, 0xfffd
or eax, 2
mov ebx, eax
xor ebx, 1
imul ebx, eax
mov eax, dword [ebp - 0xc]
shr ebx, 8
xor bl, byte [eax + esi]
mov dl, bl
call fcn.00407105
mov eax, dword [ebp - 0xc]
mov byte [eax + esi], bl
inc eax
mov dword [ebp - 0xc], eax
cmp eax, dword [ebp - 0x10]
jb 0x408200
mov eax, dword [edi + 0x7c]
mov ecx, dword [edi + 8]
cmp eax, ecx
jbe 0x40823e
mov eax, ecx
test eax, eax
jbe 0x408267
mov edx, dword [edi + 4]
lea esi, [edx + eax]
mov dl, byte [esi - 1]
sub dword [edi + 0x5c], eax
sub ecx, eax
sub dword [edi + 0x7c], eax
mov dword [edi + 8], ecx
mov dword [edi + 4], esi
jne 0x408267
cmp dl, byte [edi + 0x80]
jne 0x40833c
cmp dword [edi + 0x64], 0
jne 0x4082cd
mov eax, dword [edi + 0x14]
mov esi, dword [edi + 8]
cmp eax, esi
jae 0x408279
mov esi, eax
xor eax, eax
test esi, esi
jbe 0x408290
mov ecx, dword [edi + 4]
mov cl, byte [eax + ecx]
mov edx, dword [edi + 0x10]
mov byte [eax + edx], cl
inc eax
cmp eax, esi
jb 0x40827f
mov ebx, dword [edi + 0x10]
mov eax, dword [edi + 0x50]
mov edx, esi
mov ecx, ebx
call fcn.0040702a
sub dword [edi + 0x5c], esi
sub dword [edi + 8], esi
sub dword [edi + 0x14], esi
add dword [edi + 4], esi
add dword [edi + 0x18], esi
add dword [ebp - 4], esi
mov dword [edi + 0x50], eax
mov eax, dword [edi + 0x5c]
add ebx, esi
mov dword [edi + 0x10], ebx
test eax, eax
jne 0x40830f
cmp dword [ebp + 0xc], eax
je 0x40830f
mov eax, dword [ebp + 0xc]
mov byte [eax], 1
jmp 0x40830f
mov eax, dword [edi + 0x10]
mov ebx, dword [edi + 0x18]
mov dword [ebp - 0x10], eax
lea eax, [edi + 4]
call fcn.004073aa
mov esi, dword [edi + 0x18]
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 8], eax
mov eax, dword [edi + 0x50]
sub esi, ebx
mov edx, esi
call fcn.0040702a
sub dword [edi + 0x5c], esi
add dword [ebp - 4], esi
cmp dword [ebp - 8], 1
mov dword [edi + 0x50], eax
mov eax, dword [edi + 0x5c]
je 0x408343
test eax, eax
je 0x408343
cmp dword [ebp - 8], 0
jne 0x40831f
cmp dword [edi + 0x14], 0
ja 0x40817f
cmp dword [ebp - 8], 0
je 0x40834d
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret
test edx, edx
je 0x40815a
mov byte [edx], 1
jmp 0x40815a
or eax, 0xffffffff
jmp 0x408322
push 0xffffffffffffff96
jmp 0x408141
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40834d
mov byte [eax], 1
mov eax, dword [ebp - 4]
jmp 0x408322