Function at 0x402d20
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x40
push ebx
mov ebx, dword [esp + 0x48]
push ebp
push esi
test ebx, ebx
push edi
je 0x4031b2
mov esi, dword [sym.imp.KERNEL32.dll_GlobalLock]
push ebx
call esi
mov edi, eax
cmp word [edi + 0xe], 1
je 0x402d56
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret
mov ebx, dword [edi + 4]
mov edx, dword [edi + 8]
mov dword [esp + 0x40], ebx
mov dword [esp + 0x28], edx
lea ecx, [ebx*8 + 0x1f]
lea eax, [ebx + 0x1f]
shr ecx, 5
shl ecx, 2
shr eax, 5
mov ebp, ecx
mov dword [esp + 0x44], ecx
shl eax, 2
imul ebp, edx
test ebx, ebx
mov dword [esp + 0x48], eax
jbe 0x4031a7
test edx, edx
jbe 0x4031a7
test ecx, ecx
jbe 0x4031a7
test ebp, ebp
jbe 0x4031a7
cmp ebx, 0xf3e58
ja 0x4031a7
cmp edx, 0xf3e58
ja 0x4031a7
mov eax, ebp
xor edx, edx
div dword [esp + 0x28]
cmp eax, ecx
jb 0x4031a7
cmp ebp, 0xfffffbd7
ja 0x4031a7
lea eax, [ebp + 0x428]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [esp + 0x4c], eax
je 0x4031a7
push eax
call esi
mov edx, dword [esp + 0x28]
mov esi, eax
xor eax, eax
mov dword [esi], 0x28
mov dword [esi + 4], ebx
mov dword [esi + 8], edx
mov word [esi + 0xc], 1
mov word [esi + 0xe], 8
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], ebp
mov ecx, dword [edi + 0x18]
mov dword [esi + 0x18], ecx
mov edx, dword [edi + 0x1c]
mov dword [esi + 0x1c], edx
mov dword [esi + 0x20], pe_nt_image_headers32
mov dword [esi + 0x24], eax
mov cl, byte [edi + 0x29]
mov dl, byte [edi + 0x28]
mov al, byte [edi + 0x2a]
mov byte [esp + 0x14], cl
mov cl, byte [edi + 0x2e]
mov byte [esp + 0x18], dl
mov dl, byte [edi + 0x2c]
mov byte [esp + 0x13], cl
mov byte [esp + 0x1c], cl
mov cl, byte [edi + 0x2d]
mov byte [esp + 0x2c], al
test al, al
mov byte [esp + 0x20], cl
mov byte [esp + 0x24], dl
jne 0x402e8c
mov cl, byte [esp + 0x14]
test cl, cl
jne 0x402eb8
mov cl, byte [esp + 0x18]
test cl, cl
jne 0x402eb8
cmp byte [esp + 0x1c], 0xff
jne 0x402eb8
cmp byte [esp + 0x20], 0xff
jne 0x402eb8
mov cl, dl
cmp cl, 0xff
jmp 0x402eb2
cmp al, 0xff
jne 0x402eb8
cmp byte [esp + 0x14], al
jne 0x402eb8
cmp byte [esp + 0x18], al
jne 0x402eb8
mov cl, byte [esp + 0x1c]
test cl, cl
jne 0x402eb8
mov cl, byte [esp + 0x20]
test cl, cl
jne 0x402eb8
mov cl, byte [esp + 0x24]
test cl, cl
je 0x402fd4
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x1c]
and ecx, 0xff
and edx, 0xff
sub edx, ecx
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x20]
and ecx, 0xff
fild dword [esp + 0x2c]
and edx, 0xff
mov dword [esp + 0x34], ecx
sub edx, ecx
mov ecx, dword [esp + 0x18]
fmul dword [0x43f2fc]
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x24]
fild dword [esp + 0x2c]
and ecx, 0xff
and edx, 0xff
sub edx, ecx
mov byte [esi + 0x2a], al
fmul dword [0x43f2fc]
mov al, byte [esp + 0x14]
mov dword [esp + 0x2c], edx
fild dword [esp + 0x2c]
mov dl, byte [esp + 0x1c]
mov dword [esp + 0x38], ecx
mov cl, byte [esp + 0x18]
mov byte [esi + 0x29], al
fmul dword [0x43f2fc]
mov al, byte [esp + 0x20]
mov byte [esi + 0x28], cl
fild dword [esp + 0x30]
mov cl, byte [esp + 0x24]
mov byte [esi + 0x425], al
fild dword [esp + 0x34]
fild dword [esp + 0x38]
mov eax, 1
mov byte [esi + 0x426], dl
mov byte [esi + 0x424], cl
mov dword [esp + 0x24], eax
lea ebp, [esi + 0x2d]
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], 0
fild qword [esp + 0x38]
fld st(0)
fmul st(7)
fadd st(4)
call fcn.0040f6c8
fld st(0)
fmul st(6)
mov byte [ebp + 1], al
fadd st(3)
call fcn.0040f6c8
fmul st(4)
mov byte [ebp], al
fadd st(1)
call fcn.0040f6c8
mov byte [ebp - 1], al
mov eax, dword [esp + 0x24]
inc eax
add ebp, 4
cmp eax, 0xff
mov dword [esp + 0x24], eax
jb 0x402f77
fstp st(0)
fstp st(0)
mov ebx, dword [esp + 0x40]
fstp st(0)
fstp st(0)
fstp st(0)
fstp st(0)
jmp 0x403011
mov cl, byte [esp + 0x13]
cmp al, cl
lea ecx, [esi + 0x29]
jbe 0x402ffc
xor edx, edx
or al, 0xff
add ecx, 4
sub al, dl
inc edx
mov byte [ecx - 3], al
mov byte [ecx - 4], al
mov byte [ecx - 5], al
cmp edx, 0x100
jb 0x402fe1
jmp 0x403011
xor eax, eax
mov byte [ecx + 1], al
mov byte [ecx], al
mov byte [ecx - 1], al
inc eax
add ecx, 4
cmp eax, 0x100
jb 0x402ffe
mov edx, dword [edi + 0x20]
mov ecx, dword [esi + 0x20]
mov ebp, ebx
shr ebp, 3
lea eax, [edi + edx*4 + 0x28]
lea edi, [esi + ecx*4 + 0x28]
lea edx, [ebp*8]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x28]
sub ebx, edx
mov edx, ebx
test eax, eax
mov dword [esp + 0x20], edx
jbe 0x403189
xor ebx, ebx
xor ecx, ecx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x14], eax
mov eax, ecx
xor ecx, ecx
test ebp, ebp
jbe 0x403113
mov edx, dword [esp + 0x24]
lea esi, [ebx + edx]
mov dl, byte [esi + ecx]
and dl, 0x80
neg dl
sbb dl, dl
and edx, 0xff
mov byte [edi + eax], dl
mov dl, byte [esi + ecx]
and dl, 0x40
inc eax
neg dl
sbb dl, dl
and edx, 0xff
mov byte [edi + eax], dl
mov dl, byte [esi + ecx]
and dl, 0x20
inc eax
neg dl
sbb dl, dl
and edx, 0xff
mov byte [edi + eax], dl
mov dl, byte [esi + ecx]
and dl, 0x10
inc eax
neg dl
sbb dl, dl
and edx, 0xff
mov byte [edi + eax], dl
mov dl, byte [esi + ecx]
and dl, 8
inc eax
neg dl
sbb dl, dl
and edx, 0xff
mov byte [edi + eax], dl
mov dl, byte [esi + ecx]
and dl, 4
inc eax
neg dl
sbb dl, dl
and edx, 0xff
mov byte [edi + eax], dl
mov dl, byte [esi + ecx]
and dl, 2
inc eax
neg dl
sbb dl, dl
and edx, 0xff
mov byte [edi + eax], dl
mov dl, byte [esi + ecx]
and dl, 1
inc eax
neg dl
sbb dl, dl
and edx, 0xff
mov byte [edi + eax], dl
inc eax
inc ecx
cmp ecx, ebp
jb 0x403066
mov edx, dword [esp + 0x20]
test edx, edx
jbe 0x403162
mov esi, dword [esp + 0x24]
lea ecx, [ebx + ebp]
mov dword [esp + 0x28], edx
mov cl, byte [ecx + esi]
mov byte [esp + 0x40], cl
mov ecx, 7
mov esi, dword [esp + 0x40]
and esi, 0xff
add eax, edi
mov edx, 1
shl edx, cl
test esi, edx
je 0x40314a
mov byte [eax], 0xff
jmp 0x40314d
mov byte [eax], 0
mov edx, dword [esp + 0x28]
inc eax
dec ecx
dec edx
mov dword [esp + 0x28], edx
jne 0x40313a
mov ebx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x44]
mov esi, dword [esp + 0x48]
add ecx, eax
mov eax, dword [esp + 0x14]
add ebx, esi
dec eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
jne 0x403053
mov eax, dword [esp + 0x54]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push eax
call esi
mov edi, dword [esp + 0x4c]
push edi
call esi
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret
mov ecx, dword [esp + 0x54]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret