Function at 0x403290
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x2c
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x40]
test edi, edi
je 0x4034a0
push edi
call dword [sym.imp.KERNEL32.DLL_GlobalLock]
mov esi, eax
cmp word [esi + 0xe], 4
je 0x4032c4
push edi
call dword [sym.imp.KERNEL32.DLL_GlobalUnlock]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret
mov eax, dword [esi + 8]
mov ebp, dword [esi + 4]
cdq
mov edi, eax
lea eax, [ebp*4 + 0x1f]
shr eax, 5
shl eax, 2
mov dword [esp + 0x30], eax
lea eax, [ebp + ebp*2]
xor edi, edx
lea ecx, [eax*8 + 0x1f]
sub edi, edx
shr ecx, 5
shl ecx, 2
mov ebx, ecx
mov dword [esp + 0x34], ecx
imul ebx, edi
test ebx, ebx
je 0x403495
cmp ebp, 0xf3e58
ja 0x403495
cmp edi, 0xf3e58
ja 0x403495
mov eax, ebx
xor edx, edx
div edi
cmp eax, ecx
jb 0x403495
cmp ebx, 0xfffffbd7
ja 0x403495
lea ecx, [ebx + 0x28]
push ecx
push 0x40
call dword [sym.imp.KERNEL32.DLL_GlobalAlloc]
test eax, eax
mov dword [esp + 0x38], eax
jne 0x40335f
mov edx, dword [esp + 0x40]
push edx
call dword [sym.imp.KERNEL32.DLL_GlobalUnlock]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret
push eax
call dword [sym.imp.KERNEL32.DLL_GlobalLock]
xor edx, edx
mov dword [eax], 0x28
mov dword [eax + 4], ebp
mov dword [eax + 8], edi
mov word [eax + 0xc], 1
mov word [eax + 0xe], 0x18
mov dword [eax + 0x10], edx
mov dword [eax + 0x14], edx
mov ecx, dword [esi + 0x18]
dec ebx
mov dword [eax + 0x18], ecx
mov ecx, dword [esi + 0x1c]
mov dword [eax + 0x1c], ecx
mov dword [eax + 0x20], edx
mov dword [eax + 0x24], edx
mov ecx, dword [esi + 0x20]
cmp edi, edx
mov dword [esp + 0x28], ebx
lea ecx, [esi + ecx*4 + 0x28]
jbe 0x403477
lea ebx, [ebp + 1]
mov dword [esp + 0x10], edx
shr ebx, 1
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], edi
mov ebp, ecx
mov ecx, dword [esp + 0x10]
cmp ebx, edx
mov dword [esp + 0x14], edx
jbe 0x40344c
mov dl, byte [ebp]
mov bl, dl
and dl, 0xf
shr bl, 4
mov byte [esp + 0x24], bl
mov byte [esp + 0x2c], dl
mov edi, dword [esp + 0x24]
inc ebp
and edi, 0xff
inc ecx
inc ecx
mov dl, byte [esi + edi*4 + 0x28]
mov byte [ecx + eax + 0x26], dl
mov dl, byte [esi + edi*4 + 0x29]
mov byte [ecx + eax + 0x27], dl
mov dl, byte [esi + edi*4 + 0x2a]
mov byte [ecx + eax + 0x28], dl
mov edx, dword [esp + 0x28]
inc ecx
cmp ecx, edx
jae 0x403446
mov edi, dword [esp + 0x2c]
and edi, 0xff
inc ecx
inc ecx
mov dl, byte [esi + edi*4 + 0x28]
mov byte [ecx + eax + 0x26], dl
mov dl, byte [esi + edi*4 + 0x29]
mov byte [ecx + eax + 0x27], dl
mov dl, byte [esi + edi*4 + 0x2a]
mov edi, dword [esp + 0x18]
mov byte [ecx + eax + 0x28], dl
mov edx, dword [esp + 0x14]
inc ecx
inc edx
cmp edx, edi
mov dword [esp + 0x14], edx
jb 0x4033cf
mov ebx, dword [esp + 0x18]
xor edx, edx
mov ecx, dword [esp + 0x1c]
mov edi, dword [esp + 0x30]
mov ebp, dword [esp + 0x10]
add ecx, edi
mov edi, dword [esp + 0x34]
mov dword [esp + 0x1c], ecx
add ebp, edi
mov edi, dword [esp + 0x20]
dec edi
mov dword [esp + 0x10], ebp
mov dword [esp + 0x20], edi
jne 0x4033c1
mov eax, dword [esp + 0x40]
mov esi, dword [sym.imp.KERNEL32.DLL_GlobalUnlock]
push eax
call esi
mov edi, dword [esp + 0x38]
push edi
call esi
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov ecx, dword [esp + 0x40]
push ecx
call dword [sym.imp.KERNEL32.DLL_GlobalUnlock]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret