Function at 0x404020
Capabilities:
Encode data using xor

Disassembly:
push ecx
push edi
mov edi, dword [esp + 0xc]
test edi, edi
mov dword [esp + 4], 0
jne 0x40403a
lea eax, [edi - 0x66]
pop edi
pop ecx
ret 0xc
push ebx
mov ebx, dword [edi + 0x9c]
test ebx, ebx
jne 0x40404e
lea eax, [ebx - 0x66]
pop ebx
pop edi
pop ecx
ret 0xc
cmp dword [ebx], 0
jne 0x40405e
pop ebx
mov eax, 0xffffff9c
pop edi
pop ecx
ret 0xc
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x40406c
pop ebx
pop edi
pop ecx
ret 0xc
mov ecx, dword [esp + 0x14]
mov dword [ebx + 0x10], ecx
mov ecx, dword [ebx + 0x5c]
cmp eax, ecx
mov dword [ebx + 0x14], eax
jbe 0x404089
cmp dword [ebx + 0x8c], 0
jne 0x404089
mov dword [ebx + 0x14], ecx
mov edx, dword [ebx + 0x58]
mov ecx, dword [ebx + 8]
add ecx, edx
cmp eax, ecx
jbe 0x4040a1
cmp dword [ebx + 0x8c], 0
je 0x4040a1
mov dword [ebx + 0x14], ecx
cmp dword [ebx + 0x14], 0
push ebp
push esi
jbe 0x40423a
lea ecx, [ecx]
cmp dword [ebx + 8], 0
jne 0x404176
mov eax, dword [ebx + 0x58]
test eax, eax
jbe 0x404176
mov esi, 0x4000
cmp eax, esi
mov dword [esp + 0x20], esi
jae 0x4040d8
mov dword [esp + 0x20], eax
mov esi, eax
mov edx, dword [ebx + 0x88]
add edx, dword [ebx + 0x3c]
mov eax, dword [ebx + 0x80]
mov ecx, dword [ebx + 0x7c]
push 0
push edx
mov edx, dword [ebx + 0x70]
push eax
push ecx
call edx
add esp, 0x10
test eax, eax
jne 0x404246
mov eax, dword [ebx]
mov ecx, dword [ebx + 0x80]
mov edx, dword [ebx + 0x7c]
push esi
push eax
mov eax, dword [ebx + 0x64]
push ecx
push edx
call eax
add esp, 0x10
cmp eax, esi
jne 0x404246
cmp dword [edi + 0xa0], 0
je 0x404168
xor ebp, ebp
test esi, esi
jbe 0x404168
lea esi, [edi + 0xa4]
mov ecx, dword [ebx]
mov eax, esi
lea edx, [ecx + ebp]
call fcn.00403570
xor byte [edx], al
mov edx, dword [ebx]
movsx eax, byte [edx + ebp]
mov edi, dword [edi + 0xb0]
call fcn.00403590
mov ecx, dword [ebx]
mov edi, dword [esp + 0x18]
mov byte [ecx + ebp], al
add ebp, 1
cmp ebp, dword [esp + 0x20]
jb 0x404133
mov esi, dword [esp + 0x20]
mov edx, dword [ebx]
add dword [ebx + 0x3c], esi
sub dword [ebx + 0x58], esi
mov dword [ebx + 4], edx
mov dword [ebx + 8], esi
cmp dword [ebx + 0x84], 0
je 0x4041db
cmp dword [ebx + 0x8c], 0
jne 0x4041db
mov eax, dword [ebx + 0x10]
mov edi, dword [ebx + 0x18]
push 2
lea ecx, [ebx + 4]
push ecx
mov dword [esp + 0x28], eax
call fcn.00405080
mov ebp, eax
test ebp, ebp
jl 0x4041ae
cmp dword [ebx + 0x1c], 0
je 0x4041ae
mov ebp, 0xfffffffd
mov esi, dword [ebx + 0x18]
mov edx, dword [esp + 0x20]
mov eax, dword [ebx + 0x50]
sub esi, edi
push esi
push edx
push eax
call fcn.00406d00
sub dword [ebx + 0x5c], esi
add dword [esp + 0x10], esi
cmp ebp, 1
mov dword [ebx + 0x50], eax
je 0x40423a
test ebp, ebp
jne 0x404251
mov edi, dword [esp + 0x18]
jmp 0x404230
mov eax, dword [ebx + 8]
test eax, eax
jne 0x4041e7
cmp dword [ebx + 0x58], eax
je 0x40423a
mov esi, dword [ebx + 0x14]
cmp esi, eax
jb 0x4041f0
mov esi, eax
xor eax, eax
test esi, esi
jbe 0x404209
mov ecx, dword [ebx + 4]
mov cl, byte [eax + ecx]
mov edx, dword [ebx + 0x10]
mov byte [eax + edx], cl
add eax, 1
cmp eax, esi
jb 0x4041f6
mov edx, dword [ebx + 0x10]
mov eax, dword [ebx + 0x50]
push esi
push edx
push eax
call fcn.00406d00
sub dword [ebx + 0x5c], esi
sub dword [ebx + 8], esi
sub dword [ebx + 0x14], esi
add dword [ebx + 0x10], esi
add dword [ebx + 4], esi
add dword [ebx + 0x18], esi
add dword [esp + 0x10], esi
mov dword [ebx + 0x50], eax
cmp dword [ebx + 0x14], 0
ja 0x4040b0
mov eax, dword [esp + 0x10]
pop esi
pop ebp
pop ebx
pop edi
pop ecx
ret 0xc
pop esi
pop ebp
pop ebx
or eax, 0xffffffff
pop edi
pop ecx
ret 0xc
pop esi
mov eax, ebp
pop ebp
pop ebx
pop edi
pop ecx
ret 0xc