Function at 0x403fa0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x2c
mov eax, dword [0x5b339c]
xor eax, esp
mov dword [esp + 0x28], eax
push ebx
mov ebx, dword [esp + 0x3c]
push esi
mov esi, dword [esp + 0x38]
push edi
mov edi, ecx
cmp dword [edi], 0
je 0x403fd9
pop edi
pop esi
mov eax, 0xfffffffb
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051973e
add esp, 0x2c
ret 0xc
cmp dword [edi + 8], 1
je 0x403ff8
pop edi
pop esi
mov eax, 0xfffffffa
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051973e
add esp, 0x2c
ret 0xc
test esi, esi
je 0x4041fb
mov eax, dword [esp + 0x40]
test eax, eax
jle 0x4041fb
mov ecx, eax
and ecx, reloc.OLEAUT32.dll_SafeArrayDestroy
jns 0x40401b
dec ecx
or ecx, 0xfffffff0
inc ecx
je 0x404036
pop edi
pop esi
mov eax, 0xfffffff9
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051973e
add esp, 0x2c
ret 0xc
mov ecx, dword [edi + 4]
cdq
and edx, 0xf
add eax, edx
sar eax, 4
sub ecx, 0
push ebp
mov dword [esp + 0x10], eax
je 0x404190
sub ecx, 1
je 0x40406d
pop ebp
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051973e
add esp, 0x2c
ret 0xc
mov eax, dword [edi + 0x14]
mov edx, dword [edi + 0x10]
mov ecx, dword [edi + 0x18]
mov ebp, dword [edi + 0xc]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], eax
test eax, eax
jle 0x404100
lea edx, [esp + 0x28]
push edx
push esi
call fcn.004048b0
mov edx, dword [esp + 0x1c]
xor dword [esp + 0x30], edx
mov edx, dword [esp + 0x20]
xor dword [esp + 0x34], edx
mov edx, dword [esi + 4]
mov ecx, dword [esp + 0x2c]
xor ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x28]
xor eax, ebp
mov ebp, dword [esi]
mov dword [esp + 0x18], edx
mov edx, dword [esi + 8]
mov dword [esp + 0x28], eax
mov dword [esp + 0x1c], edx
mov edx, dword [esi + 0xc]
mov dword [ebx], eax
mov eax, dword [esp + 0x30]
mov dword [ebx + 4], ecx
mov dword [ebx + 8], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x34]
dec eax
mov dword [ebx + 0xc], ecx
add esi, 0x10
add ebx, 0x10
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], eax
test eax, eax
jg 0x404092
lea edx, [esp + 0x28]
push edx
push esi
call fcn.004048b0
mov eax, dword [esp + 0x18]
xor dword [esp + 0x2c], eax
mov eax, dword [esp + 0x34]
xor eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
xor dword [esp + 0x28], ebp
xor dword [esp + 0x30], ecx
mov dword [esp + 0x34], eax
shr eax, 0x18
mov esi, eax
lea edx, [esi - 1]
cmp edx, 0xf
ja 0x4041e1
mov ecx, 0x10
sub ecx, esi
mov eax, ecx
cmp eax, 0x10
jge 0x404163
lea ebx, [ebx]
movzx edx, byte [esp + eax + 0x28]
cmp edx, esi
jne 0x4041e1
inc eax
cmp eax, 0x10
jl 0x404150
push ecx
lea eax, [esp + 0x2c]
push eax
push ebx
call sub.MSVCR90.dll_memcpy
mov eax, dword [esp + 0x1c]
add esp, 0xc
pop ebp
shl eax, 4
pop edi
sub eax, esi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051973e
add esp, 0x2c
ret 0xc
lea ebp, [eax - 1]
test ebp, ebp
jle 0x4041a9
push ebx
push esi
call fcn.004048b0
dec ebp
add esi, 0x10
add ebx, 0x10
test ebp, ebp
jg 0x404197
lea ecx, [esp + 0x28]
push ecx
push esi
call fcn.004048b0
movzx esi, byte [esp + 0x37]
cmp esi, 0x10
jge 0x4041e1
mov ecx, 0x10
sub ecx, esi
mov eax, ecx
cmp eax, 0x10
jge 0x404163
lea esp, [esp]
movzx edx, byte [esp + eax + 0x28]
cmp edx, esi
jne 0x4041e1
inc eax
cmp eax, 0x10
jl 0x4041d0
jmp 0x404163
pop ebp
pop edi
pop esi
mov eax, 0xfffffff9
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051973e
add esp, 0x2c
ret 0xc
mov ecx, dword [esp + 0x34]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0051973e
add esp, 0x2c
ret 0xc