Function at 0x401d70
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov esi, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
test esi, esi
je 0x401fc5
mov ebx, dword [esi + 0x9c]
test ebx, ebx
je 0x401fc5
mov edi, 0xffffff9c
cmp dword [ebx], 0
je 0x401fcf
xor edi, edi
test edx, edx
je 0x401fcf
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0x14], edx
mov dword [ebx + 0x10], eax
mov eax, dword [ebx + 0x5c]
cmp edx, eax
jbe 0x401dc9
cmp dword [ebx + 0x8c], 0
jne 0x401dc9
mov dword [ebx + 0x14], eax
mov eax, dword [ebx + 8]
add eax, dword [ebx + 0x58]
cmp edx, eax
jbe 0x401ddf
cmp dword [ebx + 0x8c], 0
je 0x401ddf
mov dword [ebx + 0x14], eax
lea eax, [esi + 0xa4]
lea edx, [esi + 0xac]
mov dword [ebp - 0x30], eax
lea eax, [ebx + 4]
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x1c], 0
jmp 0x401fb9
cmp dword [ebx + 8], 0
jne 0x401ee4
mov edx, dword [ebx + 0x58]
test edx, edx
je 0x401ee4
cmp edx, 0x3fff
jbe 0x401e25
mov edx, 0x4000
mov dword [esp + 0xc], 0
mov dword [ebp - 0x34], edx
mov eax, dword [ebx + 0x88]
add eax, dword [ebx + 0x3c]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x80]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x7c]
mov dword [esp], eax
call dword [ebx + 0x70]
mov edx, dword [ebp - 0x34]
test eax, eax
jne 0x401fcc
mov dword [esp + 0xc], edx
mov eax, dword [ebx]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x80]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x7c]
mov dword [esp], eax
call dword [ebx + 0x64]
mov edx, dword [ebp - 0x34]
mov edi, eax
cmp eax, edx
jne 0x401fcc
cmp dword [esi + 0xa0], 0
je 0x401ed6
mov dword [ebp - 0x20], 0
mov edx, dword [ebp - 0x20]
add edx, dword [ebx]
mov dword [ebp - 0x24], edx
mov edx, dword [ebp - 0x28]
movzx eax, word [edx]
or eax, 2
mov ecx, eax
xor ecx, 1
imul ecx, eax
mov eax, dword [ebp - 0x24]
movzx ecx, ch
xor cl, byte [eax]
mov byte [eax], cl
mov edx, dword [esi + 0xb0]
mov eax, dword [ebp - 0x30]
movsx ecx, cl
call fcn.00401330
mov edx, dword [ebp - 0x24]
mov byte [edx], al
inc dword [ebp - 0x20]
cmp dword [ebp - 0x20], edi
jb 0x401e95
add dword [ebx + 0x3c], edi
mov eax, dword [ebx]
sub dword [ebx + 0x58], edi
mov dword [ebx + 4], eax
mov dword [ebx + 8], edi
cmp dword [ebx + 0x84], 0
je 0x401ef6
cmp dword [ebx + 0x8c], 0
je 0x401f55
mov eax, dword [ebx + 8]
test eax, eax
jne 0x401f07
cmp dword [ebx + 0x58], 0
je 0x401fd9
mov edi, dword [ebx + 0x14]
cmp edi, eax
jbe 0x401f10
mov edi, eax
xor eax, eax
jmp 0x401f21
mov ecx, dword [ebx + 4]
mov edx, dword [ebx + 0x10]
mov cl, byte [ecx + eax]
mov byte [edx + eax], cl
inc eax
cmp eax, edi
jb 0x401f14
mov dword [esp + 8], edi
mov eax, dword [ebx + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x50]
mov dword [esp], eax
call fcn.0055ed1a
sub dword [ebx + 0x5c], edi
mov dword [ebx + 0x50], eax
sub dword [ebx + 8], edi
sub dword [ebx + 0x14], edi
add dword [ebx + 0x10], edi
add dword [ebx + 4], edi
add dword [ebx + 0x18], edi
add dword [ebp - 0x1c], edi
jmp 0x401fb9
mov ecx, dword [ebx + 0x10]
mov eax, dword [ebx + 0x18]
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x20], eax
mov dword [esp + 4], 2
mov dword [esp], edx
call fcn.0055d6d1
mov ecx, dword [ebp - 0x34]
mov edi, eax
test eax, eax
js 0x401f88
cmp dword [ebx + 0x1c], 0
je 0x401f88
mov edi, 0xfffffffd
mov edx, dword [ebx + 0x18]
mov dword [esp + 4], ecx
sub edx, dword [ebp - 0x20]
mov dword [esp + 8], edx
mov dword [ebp - 0x34], edx
mov eax, dword [ebx + 0x50]
mov dword [esp], eax
call fcn.0055ed1a
mov edx, dword [ebp - 0x34]
mov dword [ebx + 0x50], eax
sub dword [ebx + 0x5c], edx
add dword [ebp - 0x1c], edx
cmp edi, 1
je 0x401fd9
test edi, edi
jne 0x401fcf
cmp dword [ebx + 0x14], 0
jne 0x401e03
jmp 0x401fd9
mov edi, 0xffffff9a
jmp 0x401fcf
or edi, 0xffffffff
add esp, 0x3c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [ebp - 0x1c]
jmp 0x401fcf