Function at 0x58b0d4
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff30
push ebx
push esi
push edi
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x24], 0x6dd028
mov dword [ebp - 0x20], esp
mov eax, 0x50d923
mov dword [ebp - 0x28], eax
xor edx, edx
mov word [ebp - 0x1c], 0
mov dword [ebp - 0x10], edx
mov ecx, dword fs:[0]
mov dword [ebp - 0x2c], ecx
lea eax, [ebp - 0x2c]
mov dword fs:[0], eax
cmp byte [ebp + 8], 0
je 0x58b163
mov word [ebp - 0x1c], 8
mov eax, str.TLG_cannot_be_used_as_universal_transition_rule__province__p__or_mask__m__images.
call fcn.00408c54
mov dword [ebp - 4], eax
inc dword [ebp - 0x10]
lea edx, [ebp - 4]
cmp dword [0x7bf848], 0
je 0x58b148
mov eax, dword [0x7bf848]
jmp 0x58b14d
mov eax, dword [0x7bf844]
call fcn.00668f54
dec dword [ebp - 0x10]
cmp dword [ebp - 4], 0
je 0x58b163
mov eax, dword [ebp - 4]
call fcn.00408920
lea edx, [ebp - 0xb0]
mov ecx, 1
mov eax, dword [ebp + 0x10]
call fcn.0043b954
xor edx, edx
mov dl, byte [ebp - 0xb0]
mov dword [ebp - 0x44], edx
mov eax, dword [ebp + 0x10]
call fcn.0043b9e0
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 0x10]
call fcn.0043b9e0
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + 0x10]
call fcn.0043b9e0
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x44], 3
je 0x58b1f2
cmp dword [ebp - 0x44], 4
je 0x58b1f2
mov word [ebp - 0x1c], 0x20
mov eax, str.Unsupported_color_type.
call fcn.00408c54
mov dword [ebp - 8], eax
inc dword [ebp - 0x10]
lea edx, [ebp - 8]
cmp dword [0x7bf848], 0
je 0x58b1d7
mov eax, dword [0x7bf848]
jmp 0x58b1dc
mov eax, dword [0x7bf844]
call fcn.00668f54
dec dword [ebp - 0x10]
cmp dword [ebp - 8], 0
je 0x58b1f2
mov eax, dword [ebp - 8]
call fcn.00408920
mov eax, dword [ebp - 0x40]
dec eax
cdq
idiv dword [ebp - 0x48]
inc eax
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp + 0x10]
call fcn.0043b904
push edx
push eax
mov eax, dword [ebp - 0x4c]
shl eax, 2
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
push edx
push eax
mov eax, dword [ebp + 0x10]
call fcn.0043b914
mov ecx, dword [ebp - 0x40]
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x34]
call dword [ebp - 0x38]
xor edx, edx
mov dword [ebp - 0x50], edx
xor ecx, ecx
mov dword [ebp - 0x54], ecx
xor eax, eax
mov dword [ebp - 0x58], eax
xor edx, edx
mov dword [ebp - 0x5c], edx
lea ebx, [ebp - 0xc0]
mov eax, dword [ebp - 0x5c]
cmp eax, dword [ebp - 0x44]
jge 0x58b264
xor edx, edx
mov dword [ebx], edx
inc dword [ebp - 0x5c]
add ebx, 4
mov ecx, dword [ebp - 0x5c]
cmp ecx, dword [ebp - 0x44]
jl 0x58b252
mov word [ebp - 0x1c], 0x38
mov edx, 4
mov eax, 0x1000
call fcn.00506b50
mov dword [ebp - 0x54], eax
push 0x1000
push 0
mov ecx, dword [ebp - 0x54]
push ecx
call fcn.0050d1a0
add esp, 0xc
mov eax, dword [ebp - 0x48]
imul dword [ebp - 0x3c]
add eax, 0xa
mov edx, 4
call fcn.00506b50
mov dword [ebp - 0x50], eax
xor ecx, ecx
mov dword [ebp - 0x60], ecx
mov word [ebp - 0x1c], 0x38
lea ebx, [ebp - 0xc0]
mov eax, dword [ebp - 0x60]
cmp eax, dword [ebp - 0x44]
jge 0x58b2e1
mov eax, dword [ebp - 0x48]
imul dword [ebp - 0x3c]
add eax, 0xa
mov edx, 4
call fcn.00506b50
mov dword [ebx], eax
inc dword [ebp - 0x60]
add ebx, 4
mov ecx, dword [ebp - 0x60]
cmp ecx, dword [ebp - 0x44]
jl 0x58b2be
xor eax, eax
mov dword [ebp - 0x64], eax
mov word [ebp - 0x1c], 0x38
xor edx, edx
mov dword [ebp - 0x68], edx
mov ecx, dword [ebp - 0x68]
cmp ecx, dword [ebp - 0x40]
jge 0x58b62f
mov word [ebp - 0x1c], 0x38
xor edi, edi
lea ebx, [ebp - 0xc0]
cmp edi, dword [ebp - 0x44]
jge 0x58b376
lea edx, [ebp - 0xb0]
mov ecx, 1
mov eax, dword [ebp + 0x10]
call fcn.0043b954
mov eax, dword [ebp + 0x10]
call fcn.0043b9e0
cmp byte [ebp - 0xb0], 0
mov esi, eax
jne 0x58b361
mov ecx, esi
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp + 0x10]
call fcn.0043b954
mov eax, dword [ebp - 0x58]
push eax
mov edx, dword [ebp - 0x54]
push edx
push esi
mov ecx, dword [ebp - 0x50]
push ecx
mov eax, dword [ebx]
push eax
call dword [0x7ae3d0]
add esp, 0x14
mov dword [ebp - 0x58], eax
jmp 0x58b36d
mov edx, dword [ebx]
mov ecx, esi
mov eax, dword [ebp + 0x10]
call fcn.0043b954
inc edi
add ebx, 4
cmp edi, dword [ebp - 0x44]
jl 0x58b310
mov edx, dword [ebp - 0x68]
add edx, dword [ebp - 0x48]
mov dword [ebp - 0x6c], edx
mov word [ebp - 0x1c], 0x38
mov ecx, dword [ebp - 0x6c]
cmp ecx, dword [ebp - 0x40]
jle 0x58b393
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x6c], eax
xor edx, edx
lea eax, [ebp - 0xd0]
lea ebx, [ebp - 0xc0]
cmp edx, dword [ebp - 0x44]
jge 0x58b3b6
mov ecx, dword [ebx]
mov dword [eax], ecx
inc edx
add eax, 4
add ebx, 4
cmp edx, dword [ebp - 0x44]
jl 0x58b3a6
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x70], eax
mov word [ebp - 0x1c], 0x38
mov edx, dword [ebp - 0x70]
cmp edx, dword [ebp - 0x6c]
jge 0x58b61d
mov edx, dword [ebp - 0x70]
mov eax, dword [ebp - 0x34]
call dword [ebp + 0x14]
mov word [ebp - 0x1c], 0x38
mov dword [ebp - 0x74], eax
cmp dword [ebp - 0x64], 0
je 0x58b475
mov ecx, dword [ebp - 0x44]
sub ecx, 3
je 0x58b3fa
dec ecx
je 0x58b433
jmp 0x58b5ff
mov edx, dword [ebp - 0x3c]
lea ecx, [ebp - 0xd0]
push edx
push ecx
mov edx, dword [ebp - 0x64]
push edx
push eax
call dword [0x7ae3c8]
add esp, 0x10
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0xd0], eax
mov ecx, dword [ebp - 0x3c]
add dword [ebp - 0xcc], ecx
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0xc8], eax
jmp 0x58b5ff
mov edx, dword [ebp - 0x3c]
lea ecx, [ebp - 0xd0]
push edx
push ecx
mov edx, dword [ebp - 0x64]
push edx
push eax
call dword [0x7ae3cc]
add esp, 0x10
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0xd0], eax
mov ecx, dword [ebp - 0x3c]
add dword [ebp - 0xcc], ecx
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0xc8], eax
mov edx, dword [ebp - 0x3c]
add dword [ebp - 0xc4], edx
jmp 0x58b5ff
mov ecx, dword [ebp - 0x44]
sub ecx, 3
je 0x58b489
dec ecx
je 0x58b51c
jmp 0x58b5ff
xor edx, edx
mov dword [ebp - 0x78], edx
xor ecx, ecx
mov dword [ebp - 0x7c], ecx
xor edx, edx
mov dword [ebp - 0x80], edx
xor edx, edx
cmp edx, dword [ebp - 0x3c]
jge 0x58b4fc
mov ecx, dword [ebp - 0xd0]
movzx ecx, byte [ecx + edx]
mov word [ebp - 0x1c], 0x38
mov ebx, dword [ebp - 0xcc]
movzx esi, byte [ebx + edx]
mov ebx, dword [ebp - 0xc8]
movzx ebx, byte [ebx + edx]
mov dword [ebp - 0x84], ebx
add ecx, esi
add dword [ebp - 0x84], esi
add dword [ebp - 0x80], ecx
mov cl, byte [ebp - 0x80]
mov byte [eax], cl
inc eax
add dword [ebp - 0x7c], esi
mov cl, byte [ebp - 0x7c]
mov byte [eax], cl
inc eax
mov ecx, dword [ebp - 0x84]
add dword [ebp - 0x78], ecx
mov cl, byte [ebp - 0x78]
mov byte [eax], cl
inc eax
mov byte [eax], 0xff
inc eax
inc edx
cmp edx, dword [ebp - 0x3c]
jl 0x58b49f
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0xd0], eax
mov edx, dword [ebp - 0x3c]
add dword [ebp - 0xcc], edx
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0xc8], eax
jmp 0x58b5ff
xor edx, edx
mov dword [ebp - 0x88], edx
xor ecx, ecx
mov dword [ebp - 0x8c], ecx
xor edx, edx
mov dword [ebp - 0x90], edx
xor ecx, ecx
mov dword [ebp - 0x94], ecx
xor edx, edx
cmp edx, dword [ebp - 0x3c]
jge 0x58b5db
mov ecx, dword [ebp - 0xd0]
movzx ecx, byte [ecx + edx]
mov word [ebp - 0x1c], 0x38
mov ebx, dword [ebp - 0xcc]
movzx esi, byte [ebx + edx]
mov ebx, dword [ebp - 0xc8]
movzx ebx, byte [ebx + edx]
mov dword [ebp - 0x98], ebx
mov ebx, dword [ebp - 0xc4]
movzx ebx, byte [ebx + edx]
mov dword [ebp - 0x9c], ebx
add ecx, esi
add dword [ebp - 0x98], esi
add dword [ebp - 0x90], ecx
mov cl, byte [ebp - 0x90]
mov byte [eax], cl
inc eax
add dword [ebp - 0x8c], esi
mov cl, byte [ebp - 0x8c]
mov byte [eax], cl
inc eax
mov ecx, dword [ebp - 0x98]
add dword [ebp - 0x88], ecx
mov cl, byte [ebp - 0x88]
mov byte [eax], cl
inc eax
mov ecx, dword [ebp - 0x9c]
add dword [ebp - 0x94], ecx
mov cl, byte [ebp - 0x94]
mov byte [eax], cl
inc eax
inc edx
cmp edx, dword [ebp - 0x3c]
jl 0x58b547
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0xd0], eax
mov edx, dword [ebp - 0x3c]
add dword [ebp - 0xcc], edx
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0xc8], eax
mov edx, dword [ebp - 0x3c]
add dword [ebp - 0xc4], edx
or edx, 0xffffffff
mov eax, dword [ebp - 0x34]
call dword [ebp + 0x14]
mov ecx, dword [ebp - 0x74]
mov dword [ebp - 0x64], ecx
inc dword [ebp - 0x70]
mov eax, dword [ebp - 0x70]
cmp eax, dword [ebp - 0x6c]
jl 0x58b3ce
mov edx, dword [ebp - 0x48]
add dword [ebp - 0x68], edx
mov ecx, dword [ebp - 0x68]
cmp ecx, dword [ebp - 0x40]
jl 0x58b2fd
mov word [ebp - 0x1c], 0
jmp 0x58b6a9
cmp dword [ebp - 0x50], 0
je 0x58b6b7
mov eax, dword [ebp - 0x50]
call fcn.00506b90
cmp dword [ebp - 0x54], 0
je 0x58b6c5
mov eax, dword [ebp - 0x54]
call fcn.00506b90
xor edx, edx
mov dword [ebp - 0xa4], edx
mov ecx, dword [ebp - 0xa4]
cmp ecx, dword [ebp - 0x44]
jge 0x58b70b
mov eax, dword [ebp - 0xa4]
cmp dword [ebp + eax*4 - 0xc0], 0
je 0x58b6fa
mov edx, dword [ebp - 0xa4]
mov eax, dword [ebp + edx*4 - 0xc0]
call fcn.00506b90
inc dword [ebp - 0xa4]
mov edx, dword [ebp - 0xa4]
cmp edx, dword [ebp - 0x44]
jl 0x58b6d8
mov ecx, dword [ebp - 0x2c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10