Function at 0x4a6c60
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
shr eax, 9
not al
and eax, 0xffffff01
mov dword [ebp + 0xc], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
xor esi, esi
mov edx, dword [eax]
mov ecx, dword [eax + 4]
mov dword [ebp + 0x10], ecx
movzx ecx, word [eax + 8]
lea ebx, [edx + 3]
mov dword [ebp - 4], edx
and ebx, 0xfffffffc
push edi
mov edi, ecx
cmp ecx, 8
jae 0x4a6ca7
mov eax, 8
xor edx, edx
div edi
mov edi, eax
jmp 0x4a6caa
shr edi, 3
push str.read_RGB_image_32bit_alpha_hack
imul ebx, edi
push str.C:dev_allegro_winpkguniversal_allegro_addonsimage_bmp.c
push 0x3b2
push ebx
call fcn.0048b6d0
add esp, 0x10
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x4a6d05
push str.read_RGB_image_32bit_alpha_hack
push 0x3b5
push str.C:dev_allegro_winpkguniversal_allegro_addonsimage_bmp.c
push 2
push dword [0x6aa6d8]
call fcn.0048b2f0
add esp, 0x14
test al, al
je 0x4a6cfc
push str.Failed_to_allocate_pixel_row_buffer_n
call fcn.0048b4d0
add esp, 4
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 0x10]
xor ebx, ebx
test edx, edx
lea eax, [edx - 1]
cmovns ebx, eax
mov eax, edx
sar eax, 0x1f
mov ecx, ebx
and eax, 2
mov dword [ebp - 0xc], ebx
dec eax
mov dword [ebp - 0x10], ecx
mov dword [ebp - 8], eax
mov eax, edx
cdq
xor eax, edx
sub eax, edx
mov dword [ebp + 0x10], eax
test eax, eax
jle 0x4a6e47
mov ebx, dword [ebp - 4]
mov dword [ebp - 0x14], eax
nop
mov eax, dword [ebp + 0x14]
push 0
push ebx
mov edi, dword [eax + 8]
imul edi, ecx
add edi, dword [eax]
push edi
push dword [ebp - 0x18]
push dword [ebp + 8]
call fcn.004a6820
add esp, 0x14
test ebx, ebx
jle 0x4a6d78
lea ecx, [edi + 3]
mov edx, ebx
xor eax, eax
lea ecx, [ecx + 4]
cmp byte [ecx - 4], al
setne al
or esi, eax
sub edx, 1
jne 0x4a6d66
mov ecx, dword [ebp - 0x10]
mov edi, dword [ebp - 8]
add ecx, edi
sub dword [ebp - 0x14], 1
mov dword [ebp - 0x10], ecx
jne 0x4a6d40
mov ebx, dword [ebp - 0xc]
test esi, esi
jne 0x4a6dbf
mov edx, dword [ebp - 4]
mov esi, dword [ebp + 0x14]
mov eax, dword [esi + 8]
imul eax, ebx
add eax, 3
test edx, edx
jle 0x4a6db2
add eax, dword [esi]
mov ecx, edx
mov byte [eax], 0xff
lea eax, [eax + 4]
sub ecx, 1
jne 0x4a6da7
add ebx, edi
sub dword [ebp + 0x10], 1
jne 0x4a6d96
jmp 0x4a6e47
cmp byte [ebp + 0xc], 0
je 0x4a6e47
mov eax, dword [ebp - 4]
mov esi, edi
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
mov edi, dword [ecx + 8]
imul edi, ebx
inc edi
test eax, eax
jle 0x4a6e3a
add edi, dword [ecx]
mov ebx, eax
movzx esi, byte [edi + 2]
lea edi, [edi + 4]
movzx ecx, byte [edi - 5]
mov eax, 0x80808081
imul ecx, esi
mul ecx
movzx ecx, byte [edi - 4]
mov eax, 0x80808081
imul ecx, esi
shr edx, 7
mov byte [edi - 5], dl
mul ecx
movzx ecx, byte [edi - 3]
mov eax, 0x80808081
imul ecx, esi
shr edx, 7
mov byte [edi - 4], dl
mul ecx
shr edx, 7
mov byte [edi - 3], dl
sub ebx, 1
jne 0x4a6de3
mov ebx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
mov esi, dword [ebp - 8]
add ebx, esi
sub edx, 1
mov dword [ebp - 0xc], ebx
mov dword [ebp + 0x10], edx
jne 0x4a6dd4
push str.read_RGB_image_32bit_alpha_hack
push str.C:dev_allegro_winpkguniversal_allegro_addonsimage_bmp.c
push 0x3e3
push dword [ebp - 0x18]
call fcn.0048b6b0
add esp, 0x10
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret