Function at 0x420160
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
mov ebx, ecx
push edi
xor edi, edi
mov eax, edx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], edi
test ebx, ebx
jne 0x420185
mov eax, 0xffffff9a
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebx + 0x9c]
test esi, esi
je 0x420179
cmp dword [esi], edi
jne 0x42019f
mov eax, 0xffffff9c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 8]
test edx, edx
jne 0x4201af
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x10], eax
mov eax, dword [esi + 0x5c]
mov dword [esi + 0x14], edx
cmp edx, eax
jbe 0x4201c7
cmp dword [esi + 0x8c], edi
jne 0x4201c7
mov dword [esi + 0x14], eax
mov eax, dword [esi + 8]
add eax, dword [esi + 0x58]
cmp edx, eax
jbe 0x4201dc
cmp dword [esi + 0x8c], edi
je 0x4201dc
mov dword [esi + 0x14], eax
cmp dword [esi + 0x14], edi
jbe 0x4203b8
cmp dword [esi + 8], 0
jne 0x4202c6
mov eax, dword [esi + 0x58]
test eax, eax
je 0x4202c6
mov edi, 0x4000
cmp eax, edi
cmovb edi, eax
mov eax, dword [esi + 0x88]
add eax, dword [esi + 0x3c]
push 0
push eax
push dword [esi + 0x80]
mov eax, dword [esi + 0x70]
push dword [esi + 0x7c]
call eax
add esp, 0x10
test eax, eax
jne 0x4203a5
mov eax, dword [esi + 0x64]
push edi
push dword [esi]
push dword [esi + 0x80]
push dword [esi + 0x7c]
call eax
add esp, 0x10
cmp eax, edi
jne 0x4203a5
cmp dword [ebx + 0xa0], 0
je 0x4202b5
xor edx, edx
mov dword [ebp - 8], edx
test edi, edi
je 0x4202b5
jmp 0x420260
mov ecx, dword [ebx + 0xac]
add edx, dword [esi]
and ecx, 0xfffd
or ecx, 2
movsx eax, byte [edx]
mov ebx, ecx
xor ebx, 1
imul ebx, ecx
shr ebx, 8
and ebx, 0xff
xor ebx, eax
mov byte [edx], bl
movsx eax, bl
mov ebx, dword [ebp - 0xc]
push eax
mov edx, dword [ebx + 0xb0]
lea ecx, [ebx + 0xa4]
call fcn.0041f310
mov edx, dword [ebp - 8]
mov ecx, dword [esi]
inc edx
mov byte [edx + ecx - 1], al
add esp, 4
mov dword [ebp - 8], edx
cmp edx, edi
jb 0x420260
add dword [esi + 0x3c], edi
mov eax, dword [esi]
sub dword [esi + 0x58], edi
mov dword [esi + 8], edi
mov edi, dword [ebp - 4]
mov dword [esi + 4], eax
mov eax, dword [esi + 0x84]
test eax, eax
je 0x42033c
cmp dword [esi + 0x8c], 0
jne 0x42033c
cmp eax, 0xc
je 0x420397
mov eax, dword [esi + 0x18]
mov dword [ebp - 8], eax
mov eax, dword [esi + 0x10]
lea ecx, [esi + 4]
mov dword [ebp - 0x10], eax
call fcn.00421590
mov ebx, eax
test ebx, ebx
js 0x420308
cmp dword [esi + 0x1c], 0
mov eax, 0xfffffffd
cmovne ebx, eax
mov edi, dword [esi + 0x18]
sub edi, dword [ebp - 8]
mov edx, dword [ebp - 0x10]
mov ecx, dword [esi + 0x50]
push edi
call fcn.00421220
sub dword [esi + 0x5c], edi
mov dword [esi + 0x50], eax
mov eax, dword [ebp - 4]
add eax, edi
add esp, 4
mov dword [ebp - 4], eax
cmp ebx, 1
je 0x4203ba
test ebx, ebx
jne 0x4203af
mov edi, eax
jmp 0x420397
mov ebx, dword [esi + 8]
test ebx, ebx
jne 0x420348
cmp dword [esi + 0x58], ebx
je 0x4203b8
cmp dword [esi + 0x14], ebx
cmovb ebx, dword [esi + 0x14]
xor edx, edx
test ebx, ebx
je 0x420366
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, ebx
jb 0x420355
mov edi, dword [esi + 0x10]
mov ecx, dword [esi + 0x50]
push ebx
mov edx, edi
call fcn.00421220
sub dword [esi + 0x5c], ebx
sub dword [esi + 8], ebx
sub dword [esi + 0x14], ebx
add dword [esi + 4], ebx
add dword [esi + 0x18], ebx
mov dword [esi + 0x50], eax
lea eax, [edi + ebx]
mov edi, dword [ebp - 4]
add esp, 4
add edi, ebx
mov dword [esi + 0x10], eax
mov dword [ebp - 4], edi
cmp dword [esi + 0x14], 0
jbe 0x4203b8
mov ebx, dword [ebp - 0xc]
jmp 0x4201e5
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret