Function at 0x402c60
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 0x4030d8
mov esi, dword [sym.imp.KERNEL32.DLL_GlobalLock]
push ebx
call esi
mov edi, eax
cmp word [edi + 0xe], 1
je 0x402c96
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
mov ebp, ecx
mov dword [esp + 0x44], ecx
imul ebp, edx
shr eax, 5
shl eax, 2
test ebp, ebp
mov dword [esp + 0x48], eax
je 0x4030cd
cmp ebx, 0xf3e58
ja 0x4030cd
cmp edx, 0xf3e58
ja 0x4030cd
mov eax, ebp
xor edx, edx
div dword [esp + 0x28]
cmp eax, ecx
jb 0x4030cd
cmp ebp, 0xfffffbd7
ja 0x4030cd
lea eax, [ebp + 0x428]
push eax
push 0x40
call dword [sym.imp.KERNEL32.DLL_GlobalAlloc]
test eax, eax
mov dword [esp + 0x4c], eax
je 0x4030cd
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 0x402db4
mov cl, byte [esp + 0x14]
test cl, cl
jne 0x402de0
mov cl, byte [esp + 0x18]
test cl, cl
jne 0x402de0
cmp byte [esp + 0x1c], 0xff
jne 0x402de0
cmp byte [esp + 0x20], 0xff
jne 0x402de0
mov cl, dl
cmp cl, 0xff
jmp 0x402dda
cmp al, 0xff
jne 0x402de0
cmp byte [esp + 0x14], al
jne 0x402de0
cmp byte [esp + 0x18], al
jne 0x402de0
mov cl, byte [esp + 0x1c]
test cl, cl
jne 0x402de0
mov cl, byte [esp + 0x20]
test cl, cl
jne 0x402de0
mov cl, byte [esp + 0x24]
test cl, cl
je 0x402efc
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.0040f5d8
fld st(0)
fmul st(6)
mov byte [ebp + 1], al
fadd st(3)
call fcn.0040f5d8
fmul st(4)
mov byte [ebp], al
fadd st(1)
call fcn.0040f5d8
mov byte [ebp - 1], al
mov eax, dword [esp + 0x24]
inc eax
add ebp, 4
cmp eax, 0xff
mov dword [esp + 0x24], eax
jb 0x402e9f
fstp st(0)
fstp st(0)
mov ebx, dword [esp + 0x40]
fstp st(0)
fstp st(0)
fstp st(0)
fstp st(0)
jmp 0x402f39
mov cl, byte [esp + 0x13]
cmp al, cl
lea ecx, [esi + 0x29]
jbe 0x402f24
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 0x402f09
jmp 0x402f39
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 0x402f26
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]
mov ecx, dword [esp + 0x28]
lea edx, [ebp*8]
sub ebx, edx
mov dword [esp + 0x24], eax
mov edx, ebx
test ecx, ecx
mov dword [esp + 0x20], edx
jbe 0x4030af
xor ebx, ebx
xor eax, eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], ecx
xor ecx, ecx
test ebp, ebp
jbe 0x403039
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 0x402f8c
mov edx, dword [esp + 0x20]
test edx, edx
jbe 0x403088
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 0x403070
mov byte [eax], 0xff
jmp 0x403073
mov byte [eax], 0
mov edx, dword [esp + 0x28]
inc eax
dec ecx
dec edx
mov dword [esp + 0x28], edx
jne 0x403060
mov ebx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x44]
mov esi, dword [esp + 0x48]
add eax, ecx
mov ecx, dword [esp + 0x14]
add ebx, esi
dec ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], ecx
jne 0x402f7b
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