Function at 0x4039e0
Capabilities:
Encode data using xor
Encrypt data using rc4 prga
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x1144
push ebx
push ebp
push esi
push edi
push 0x101c
lea eax, [esp + 0x134]
mov edi, ecx
push 0
push eax
mov dword [esp + 0x24], edi
call fcn.004042c0
xor esi, esi
add esp, 0xc
xor eax, eax
cmp dword [edi], esi
jne 0x403c5d
push 0x100
push eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
lea eax, [esp + 0x38]
push eax
call fcn.004042c0
add esp, 0xc
xor ebx, ebx
xor eax, eax
mov edi, edi
mov byte [esp + eax + 0x30], al
inc eax
cmp eax, 0x100
jb 0x403a40
xor edi, edi
mov edi, edi
mov dl, byte [esp + edi + 0x30]
mov eax, edi
and eax, 3
movzx ecx, dl
movzx eax, byte [eax + 0x41e1d0]
add eax, ebx
add ecx, eax
movzx ebx, cl
mov al, byte [esp + ebx + 0x30]
mov byte [esp + edi + 0x30], al
inc edi
mov byte [esp + ebx + 0x30], dl
cmp edi, 0x100
jb 0x403a50
xor ebx, ebx
xor ebp, ebp
xor edi, edi
lea eax, [ebx + 1]
movzx ebx, al
mov cl, byte [esp + ebx + 0x30]
movzx edx, cl
lea eax, [edx + ebp]
movzx ebp, al
movzx eax, byte [esp + ebp + 0x30]
mov byte [esp + ebx + 0x30], al
mov byte [esp + ebp + 0x30], cl
movzx eax, byte [esp + ebx + 0x30]
add eax, edx
movzx eax, al
movzx eax, byte [esp + eax + 0x30]
xor al, byte [edi + 0x41e1d4]
mov byte [esp + edi + 0x1c], al
inc edi
cmp edi, 0x14
jb 0x403a85
lea edx, [esp + 0x1c]
call fcn.004012e0
test eax, eax
je 0x403c5b
mov edx, dword [eax + 0x18]
mov dword [esp + 0x14], edx
test edx, edx
je 0x403c5b
mov eax, dword [edx + 0x3c]
add eax, edx
je 0x403c5b
add eax, 0x78
je 0x403c5b
mov ecx, dword [eax]
test ecx, ecx
je 0x403c5b
cmp dword [eax + 4], esi
je 0x403c5b
lea eax, [edx + ecx]
test eax, eax
je 0x403c5b
mov ecx, dword [eax + 0x1c]
mov ebp, dword [eax + 0x24]
add ecx, edx
mov edi, dword [eax + 0x18]
add ebp, 0xfffffffe
mov dword [esp + 0x10], ecx
mov ecx, dword [eax + 0x20]
mov eax, 0x775a
add ecx, edx
add ebp, edx
lea ebx, [edi - 1]
lea ebp, [ebp + edi*2]
lea ebx, [ecx + ebx*4]
mov edi, edi
mov ecx, dword [ebx]
add ecx, edx
je 0x403b9e
cmp word [ecx], ax
jne 0x403b9e
add ecx, 2
mov edx, 0x4605186c
cmp byte [ecx], 0
je 0x403b73
jmp 0x403b60
movzx eax, word [ecx]
lea ecx, [ecx + 1]
imul edx, edx, 0x1003f
add edx, eax
cmp byte [ecx], 0
jne 0x403b60
movzx eax, word [ebp]
mov ecx, dword [esp + 0x10]
mov dword [esp + esi*8 + 0x134], edx
mov eax, dword [ecx + eax*4]
mov dword [esp + esi*8 + 0x138], eax
inc esi
cmp esi, 0x203
je 0x403ba9
mov edx, dword [esp + 0x14]
mov eax, 0x775a
sub ebx, 4
sub ebp, 2
sub edi, 1
jne 0x403b40
lea eax, [esi - 1]
mov dword [esp + 0x130], esi
xor ebp, ebp
test eax, eax
je 0x403c25
lea esp, [esp]
mov ecx, esi
xor eax, eax
sub ecx, ebp
sub ecx, 1
je 0x403c1d
jmp 0x403bd0
mov ebx, dword [esp + eax*8 + 0x138]
mov edi, dword [esp + eax*8 + 0x140]
cmp ebx, edi
jbe 0x403c13
mov edx, dword [esp + eax*8 + 0x134]
mov ecx, dword [esp + eax*8 + 0x13c]
mov dword [esp + eax*8 + 0x134], ecx
mov dword [esp + eax*8 + 0x138], edi
mov dword [esp + eax*8 + 0x13c], edx
mov dword [esp + eax*8 + 0x140], ebx
mov esi, dword [esp + 0x130]
mov ecx, esi
inc eax
sub ecx, ebp
dec ecx
cmp eax, ecx
jb 0x403bd0
inc ebp
lea eax, [esi - 1]
cmp ebp, eax
jb 0x403bc0
mov ebx, dword [esp + 0x18]
xor ecx, ecx
mov dword [ebx], esi
test esi, esi
je 0x403c46
lea edx, [ebx + 4]
mov eax, dword [esp + ecx*8 + 0x134]
lea edx, [edx + 4]
inc ecx
mov dword [edx - 4], eax
cmp ecx, esi
jb 0x403c34
cmp dword [ebx], 0
je 0x403c5b
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1144
ret
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1144
ret