Function at 0x4038d0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x580
lea eax, [esp + 0x38]
push ebx
push esi
push edi
push ebp
push 0x44
push eax
call fcn.004038b0
mov edx, dword [esp + 0x59c]
mov ecx, dword [esp + 0x5a0]
add esp, 8
mov eax, edx
mov esi, dword [eax]
add eax, 4
inc dword [esp + esi*4 + 0x48]
dec ecx
jne 0x4038f9
mov eax, dword [esp + 0x598]
cmp eax, dword [esp + 0x48]
jne 0x40393a
xor ax, ax
mov ecx, dword [esp + 0x5a8]
mov ebx, dword [esp + 0x5ac]
pop ebp
pop edi
mov dword [ecx], 0
pop esi
mov dword [ebx], 0
pop ebx
add esp, 0x580
ret
mov ebx, dword [esp + 0x5ac]
mov ecx, 1
mov eax, dword [ebx]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x4c]
cmp dword [eax], 0
jne 0x403964
add eax, 4
inc ecx
lea esi, [esp + 0x88]
cmp eax, esi
jbe 0x403950
mov dword [esp + 0x1c], ecx
mov esi, ecx
cmp dword [esp + 0x10], ecx
jae 0x403974
mov dword [esp + 0x10], esi
mov edi, 0x10
lea eax, [esp + 0x88]
cmp dword [eax], 0
jne 0x403991
sub eax, 4
dec edi
lea ebp, [esp + 0x48]
cmp eax, ebp
jne 0x403980
mov dword [esp + 0x30], edi
cmp dword [esp + 0x10], edi
jbe 0x40399f
mov dword [esp + 0x10], edi
mov eax, dword [esp + 0x10]
mov dword [ebx], eax
mov eax, 1
shl eax, cl
mov dword [esp + 0x20], eax
cmp ecx, edi
jae 0x4039d2
lea eax, [esp + ecx*4 + 0x48]
mov ebx, dword [eax]
sub dword [esp + 0x20], ebx
js 0x4039ed
add eax, 4
inc ecx
mov ebx, dword [esp + 0x20]
add ebx, ebx
cmp ecx, edi
mov dword [esp + 0x20], ebx
jb 0x4039b8
lea eax, [esp + edi*4 + 0x48]
mov ecx, dword [eax]
sub dword [esp + 0x20], ecx
jns 0x4039fc
mov ax, 0xfffb
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
mov ax, 0xfffb
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
add ecx, dword [esp + 0x20]
xor ebx, ebx
dec edi
mov dword [eax], ecx
lea eax, [esp + 0x4c]
lea ecx, [esp + 0x94]
mov dword [esp + 0x90], ebx
je 0x403a26
add ebx, dword [eax]
add eax, 4
mov dword [ecx], ebx
add ecx, 4
dec edi
jne 0x403a19
xor edi, edi
mov eax, dword [edx]
add edx, 4
test eax, eax
je 0x403a44
lea ecx, [esp + eax*4 + 0x8c]
mov eax, dword [ecx]
inc eax
mov dword [ecx], eax
mov dword [esp + eax*4 + 0x10c], edi
inc edi
cmp dword [esp + 0x598], edi
ja 0x403a28
xor edx, edx
lea eax, [esp + 0x110]
mov dword [esp + 0x18], edx
mov dword [esp + 0x8c], edx
mov dword [esp + 0x38], eax
mov dword [esp + 0xd0], edx
mov eax, dword [esp + 0x10]
mov dword [esp + 0x3c], edx
neg eax
mov dword [esp + 0x14], eax
cmp esi, dword [esp + 0x30]
mov dword [esp + 0x2c], 0xffffffff
jg 0x403cf4
mov eax, dword [esp + 0x1c]
lea ecx, [esp + eax*4 + 0x48]
mov dword [esp + 0x44], ecx
mov eax, dword [ecx]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x34]
dec dword [esp + 0x34]
test eax, eax
je 0x403ce2
mov eax, dword [esp + 0x10]
add eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x1c]
jge 0x403bc5
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x34]
shl esi, 2
inc eax
mov dword [esp + 0x40], eax
add esi, 4
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x30]
inc dword [esp + 0x2c]
add dword [esp + 0x14], eax
sub edi, dword [esp + 0x14]
cmp eax, edi
jae 0x403aee
mov edi, eax
mov ebx, dword [esp + 0x1c]
mov edx, 1
sub ebx, dword [esp + 0x14]
mov cl, bl
shl edx, cl
cmp dword [esp + 0x40], edx
jae 0x403b28
mov eax, dword [esp + 0x34]
inc ebx
inc eax
sub edx, eax
mov eax, dword [esp + 0x44]
cmp ebx, edi
jae 0x403b28
mov ecx, dword [eax + 4]
add edx, edx
add eax, 4
cmp ecx, edx
jae 0x403b28
sub edx, ecx
inc ebx
cmp ebx, edi
jb 0x403b15
mov eax, 1
mov cl, bl
shl eax, cl
mov dword [esp + 0x3c], eax
lea ecx, [eax*8 + 8]
push ecx
call fcn.00402840
add esp, 4
test eax, eax
je 0x403d11
lea edx, [eax + 8]
mov ecx, dword [esp + 0x5a8]
add eax, 4
mov dword [esp + esi + 0xd0], edx
mov dword [ecx], edx
mov dword [esp + 0x5a8], eax
mov dword [eax], 0
test esi, esi
je 0x403bb3
mov eax, dword [esp + 0x18]
mov cl, byte [esp + 0x10]
add bl, 0x10
mov dword [esp + esi + 0x8c], eax
mov byte [esp + 0x25], cl
mov byte [esp + 0x24], bl
mov ebx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
sub cl, byte [esp + 0x10]
mov dword [esp + 0x28], edx
shr ebx, cl
shl ebx, 3
mov eax, dword [esp + 0x24]
add ebx, dword [esp + esi + 0xcc]
mov dword [ebx], eax
mov dword [ebx + 4], edx
mov eax, dword [esp + 0x14]
add eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x1c]
jl 0x403ad1
mov bl, byte [esp + 0x14]
mov cl, byte [esp + 0x1c]
sub cl, bl
mov eax, dword [esp + 0x598]
mov byte [esp + 0x25], cl
lea ebp, [esp + eax*4 + 0x110]
cmp ebp, dword [esp + 0x38]
ja 0x403bee
mov byte [esp + 0x24], 0x63
jmp 0x403c39
mov eax, dword [esp + 0x38]
mov esi, dword [eax]
cmp dword [esp + 0x59c], esi
jbe 0x403c0d
mov al, 0x10
cmp esi, 0x100
adc al, 0xff
mov byte [esp + 0x24], al
jmp 0x403c2f
sub esi, dword [esp + 0x59c]
mov eax, dword [esp + 0x5a4]
add esi, esi
mov ebp, dword [esp + 0x5a0]
mov al, byte [esi + eax]
mov si, word [esi + ebp]
mov byte [esp + 0x24], al
add dword [esp + 0x38], 4
mov word [esp + 0x28], si
mov esi, 1
mov edi, dword [esp + 0x18]
shl esi, cl
mov cl, bl
shr edi, cl
cmp edi, dword [esp + 0x3c]
jae 0x403c75
lea ecx, [edx + edi*8]
lea eax, [esi*8]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x24]
mov ebp, dword [esp + 0x28]
add edi, esi
mov dword [ecx], eax
mov dword [ecx + 4], ebp
add ecx, dword [esp + 0x40]
cmp edi, dword [esp + 0x3c]
jb 0x403c5c
mov eax, 1
mov cl, byte [esp + 0x1c]
dec cl
shl eax, cl
test dword [esp + 0x18], eax
je 0x403c95
xor dword [esp + 0x18], eax
shr eax, 1
test dword [esp + 0x18], eax
jne 0x403c88
mov cl, bl
xor dword [esp + 0x18], eax
mov eax, dword [esp + 0x2c]
lea esi, [esp + eax*4 + 0x8c]
mov eax, 1
shl eax, cl
dec eax
and eax, dword [esp + 0x18]
cmp eax, dword [esi]
je 0x403a9f
sub esi, 4
mov eax, dword [esp + 0x10]
dec dword [esp + 0x2c]
sub dword [esp + 0x14], eax
mov eax, 1
mov cl, byte [esp + 0x14]
shl eax, cl
dec eax
and eax, dword [esp + 0x18]
cmp eax, dword [esi]
jne 0x403cba
jmp 0x403a9f
inc dword [esp + 0x1c]
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x30]
jle 0x403a8d
cmp dword [esp + 0x20], 0
je 0x403d37
cmp dword [esp + 0x30], 0
je 0x403d37
mov ax, 0xfffc
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
cmp dword [esp + 0x2c], 0
je 0x403d28
mov eax, dword [esp + 0xd0]
push eax
call fcn.00403d50
add esp, 4
mov ax, 0xfffa
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
xor ax, ax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret