Function at 0x4705f0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
push ebx
push esi
push edi
mov ebx, ecx
call fcn.004705b0
mov esi, dword [ebp + 0x10]
push 8
push 0x49def0
push esi
mov byte [ebp - 1], 0
call fcn.00470d90
add esp, 0xc
test al, al
je 0x470d31
mov edi, dword [ebp + 0x14]
lea esi, [esi + 8]
mov dword [ebp - 0x3c], 0x471010
mov al, 0
mov byte [ebp + 0x13], al
mov dword [ebp - 0x38], 0x470ff0
mov dword [ebp - 0x34], 0
sub edi, 8
je 0x470d31
jmp 0x470650
movzx eax, byte [esi]
shl ax, 8
movzx edx, ax
movzx eax, byte [esi + 1]
or edx, eax
movzx eax, byte [esi + 2]
shl ax, 8
movzx ecx, ax
movzx eax, byte [esi + 3]
or ecx, eax
shl edx, 0x10
or ecx, edx
mov dword [ebp - 0x18], edx
mov eax, 0xfffffff4
sub eax, ecx
add edi, eax
movzx eax, byte [esi + 2]
shl ax, 8
movzx ecx, ax
movzx eax, byte [esi + 3]
or eax, ecx
mov dword [ebp + 0x14], edi
or eax, edx
add eax, 0xc
add eax, esi
mov dword [ebp - 0x24], eax
movzx eax, byte [esi + 2]
shl ax, 8
movzx ecx, ax
movzx eax, byte [esi + 3]
or ecx, eax
or edx, ecx
add edx, esi
movzx eax, byte [edx + 8]
shl ax, 8
movzx edi, ax
movzx eax, byte [edx + 9]
or edi, eax
movzx eax, byte [edx + 0xa]
shl ax, 8
movzx ecx, ax
movzx eax, byte [edx + 0xb]
or ecx, eax
shl edi, 0x10
movzx eax, byte [esi + 2]
or edi, ecx
shl ax, 8
movzx ecx, ax
movzx eax, byte [esi + 3]
or eax, ecx
mov ecx, ebx
or eax, dword [ebp - 0x18]
push edi
add eax, 4
lea edi, [esi + 4]
push eax
push edi
call fcn.00470e70
test al, al
je 0x470cf1
push 4
push 0x49df0c
push edi
call fcn.00470d90
add esp, 0xc
test al, al
jne 0x470d13
push 4
push str.IHDR
push edi
call fcn.00470d90
add esp, 0xc
test al, al
je 0x4708d8
movzx eax, byte [esi + 8]
shl ax, 8
movzx edx, ax
movzx eax, byte [esi + 9]
or edx, eax
movzx eax, byte [esi + 0xa]
shl ax, 8
movzx ecx, ax
movzx eax, byte [esi + 0xb]
or ecx, eax
shl edx, 0x10
or edx, ecx
mov dword [ebx], edx
movzx eax, byte [esi + 0xc]
shl ax, 8
movzx edx, ax
movzx eax, byte [esi + 0xd]
or edx, eax
movzx eax, byte [esi + 0xe]
shl ax, 8
movzx ecx, ax
movzx eax, byte [esi + 0xf]
or ecx, eax
shl edx, 0x10
or edx, ecx
mov dword [ebx + 4], edx
movzx eax, byte [esi + 0x10]
mov dword [ebx + 8], eax
movzx eax, byte [esi + 0x11]
mov dword [ebx + 0xc], eax
movzx eax, byte [esi + 0x12]
mov dword [ebx + 0x10], eax
movzx eax, byte [esi + 0x13]
mov dword [ebx + 0x14], eax
movzx eax, byte [esi + 0x14]
mov dword [ebx + 0x18], eax
mov eax, dword [ebx + 0xc]
mov dword [ebx + 0x1c], 1
cmp eax, 6
ja case.0x4707bd.1
jmp dword [eax*4 + 0x470d44]
mov dword [ebx + 0x1c], 1
jmp case.0x4707bd.1
mov dword [ebx + 0x1c], 3
jmp case.0x4707bd.1
mov dword [ebx + 0x1c], 2
jmp case.0x4707bd.1
mov dword [ebx + 0x1c], 4
mov eax, dword [ebx + 8]
imul eax, dword [ebx]
add eax, 7
cdq
and edx, 7
lea ecx, [edx + eax]
mov edx, dword [ebx + 0x1c]
sar ecx, 3
mov eax, edx
imul eax, ecx
cmp dword [ebp + 8], 0
mov dword [ebx + 0x28], eax
je 0x47081f
mov eax, dword [ebx + 4]
imul eax, ecx
imul eax, dword [ebp + 0x18]
cmp dword [ebp + 0xc], eax
jb 0x470d17
jmp 0x470848
push dword [ebx + 0x2c]
mov dword [ebp + 0x18], edx
call fcn.0047252e
mov eax, dword [ebx + 0x28]
imul eax, dword [ebx + 4]
push eax
call fcn.00472c49
add esp, 8
mov dword [ebp + 8], eax
mov dword [ebx + 0x2c], eax
test eax, eax
je 0x470d17
push dword [ebx + 0x30]
call fcn.0047252e
push dword [ebx + 0x34]
mov dword [ebx + 0x30], 0
call fcn.0047252e
mov dword [ebx + 0x34], 0
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x1c]
push eax
call fcn.00472c49
add esp, 0xc
mov dword [ebx + 0x30], eax
test eax, eax
je 0x470d01
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x1c]
push eax
call fcn.00472c49
add esp, 4
mov dword [ebx + 0x34], eax
test eax, eax
je 0x470d01
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x1c]
push eax
push 0
push dword [ebx + 0x30]
call fcn.00470e40
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x1c]
push eax
push 0
push dword [ebx + 0x34]
call fcn.00470e40
push 0x38
lea eax, [ebp - 0x5c]
push 0x494420
push eax
call fcn.004307e0
add esp, 0x24
mov byte [ebp + 0x13], 1
jmp 0x470cf1
push 4
push str.sBIT
push edi
call fcn.00470d90
add esp, 0xc
test al, al
jne 0x470cf1
push 4
push str.PLTE
push edi
call fcn.00470d90
add esp, 0xc
test al, al
je 0x4709b3
movzx eax, byte [esi + 2]
shl ax, 8
movzx edx, ax
movzx eax, byte [esi + 3]
or edx, eax
movzx eax, byte [esi]
push dword [ebx + 0x20]
shl ax, 8
movzx ecx, ax
movzx eax, byte [esi + 1]
add esi, 8
or ecx, eax
mov eax, 0x55555556
shl ecx, 0x10
or edx, ecx
imul edx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebx + 0x24], eax
call fcn.0047252e
mov eax, dword [ebx + 0x24]
xor ecx, ecx
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00472c49
add esp, 8
mov dword [ebx + 0x20], eax
test eax, eax
je 0x470d01
xor edx, edx
cmp dword [ebx + 0x24], edx
jle 0x470cf1
lea esp, [esp]
mov ecx, dword [ebx + 0x20]
lea esi, [esi + 3]
mov al, byte [esi - 3]
mov byte [ecx + edx*4], al
mov ecx, dword [ebx + 0x20]
mov al, byte [esi - 2]
mov byte [ecx + edx*4 + 1], al
mov ecx, dword [ebx + 0x20]
mov al, byte [esi - 1]
mov byte [ecx + edx*4 + 2], al
mov eax, dword [ebx + 0x20]
mov byte [eax + edx*4 + 3], 0xff
inc edx
cmp edx, dword [ebx + 0x24]
jl 0x470980
jmp 0x470cf1
push 4
push str.tRNS
push edi
call fcn.00470d90
add esp, 0xc
test al, al
je 0x470a07
mov edi, dword [ebx + 0x24]
mov ecx, esi
call fcn.004705c0
cmp eax, edi
jg 0x4709de
mov ecx, esi
call fcn.004705c0
mov edi, eax
add esi, 8
xor edx, edx
test edi, edi
jle 0x470cf1
jmp 0x4709f0
mov ecx, dword [ebx + 0x20]
lea esi, [esi + 1]
mov al, byte [esi - 1]
mov byte [ecx + edx*4 + 3], al
inc edx
cmp edx, edi
jl 0x4709f0
jmp 0x470cf1
push 4
push 0x49df04
push edi
call fcn.00470d90
add esp, 0xc
test al, al
je 0x470cf1
mov ecx, esi
call fcn.004705c0
add esi, 8
mov dword [ebp - 0x58], eax
mov eax, dword [ebx + 0x40]
xor ecx, ecx
mov dword [ebp - 0x5c], esi
cmp eax, dword [ebx + 4]
jge 0x470ce3
lea ecx, [ecx]
cmp dword [ebp - 0x58], 0
je 0x470cf1
test ecx, ecx
jne 0x470ce3
mov edx, dword [ebx + 0x40]
mov eax, edx
mov ecx, dword [ebx + 0x1c]
and eax, 1
not edx
and edx, 1
mov eax, dword [ebx + eax*4 + 0x30]
lea edi, [ecx - 1]
add edi, eax
dec ecx
mov eax, dword [ebx + edx*4 + 0x30]
add eax, ecx
mov ecx, dword [ebx + 0x3c]
mov dword [ebp - 0xc], eax
lea eax, [ecx + edi]
mov dword [ebp - 0x50], eax
mov eax, dword [ebx + 0x28]
sub eax, ecx
mov ecx, 0
inc eax
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x4c], eax
je 0x470aae
test ecx, ecx
jne 0x470aae
push ecx
lea eax, [ebp - 0x5c]
push eax
call fcn.0042efe0
mov ecx, eax
add esp, 8
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x18], ecx
test eax, eax
jne 0x470a91
mov esi, dword [ebx + 0x28]
mov ecx, dword [ebx + 0x3c]
sub esi, ecx
sub esi, eax
inc esi
mov dword [ebp - 8], esi
je 0x470cd4
test ecx, ecx
jne 0x470af3
mov ecx, dword [ebx + 0x40]
mov al, byte [edi]
and ecx, 1
mov byte [ecx + ebx + 0x38], al
xor ecx, ecx
cmp dword [ebx + 0x1c], ecx
jle 0x470aec
mov eax, edi
jmp 0x470ae0
mov byte [eax], 0
lea eax, [eax - 1]
inc ecx
cmp ecx, dword [ebx + 0x1c]
jl 0x470ae0
inc dword [ebx + 0x3c]
dec esi
mov dword [ebp - 8], esi
mov eax, dword [ebx + 0x40]
and eax, 1
movzx eax, byte [eax + ebx + 0x38]
dec eax
cmp eax, 3
ja case.default.0x470b08
jmp dword [eax*4 + 0x470d60]
xor eax, eax
mov dword [ebp - 0xc], eax
test esi, esi
jle case.default.0x470b08
lea esp, [esp]
mov edx, dword [ebx + 0x3c]
lea ecx, [edx + eax]
sub edx, dword [ebx + 0x1c]
add edx, dword [ebp - 0xc]
mov al, byte [edx + edi]
add byte [ecx + edi], al
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 0xc], eax
cmp eax, esi
jl 0x470b20
jmp case.default.0x470b08
xor edx, edx
test esi, esi
jle case.default.0x470b08
lea esp, [esp]
mov eax, dword [ebx + 0x3c]
mov esi, dword [ebp - 0xc]
add eax, edx
lea ecx, [eax + edi]
inc edx
mov al, byte [eax + esi]
add byte [ecx], al
mov esi, dword [ebp - 8]
cmp edx, esi
jl 0x470b50
jmp case.default.0x470b08
xor edx, edx
mov dword [ebp - 0x10], edx
test esi, esi
jle case.default.0x470b08
mov ecx, dword [ebx + 0x3c]
lea eax, [ecx + edx]
sub ecx, dword [ebx + 0x1c]
add ecx, edx
lea esi, [eax + edi]
mov edx, dword [ebp - 0xc]
movzx ecx, byte [ecx + edi]
movzx eax, byte [eax + edx]
add eax, ecx
cdq
sub eax, edx
mov edx, dword [ebp - 0x10]
sar eax, 1
inc edx
add byte [esi], al
mov esi, dword [ebp - 8]
mov dword [ebp - 0x10], edx
cmp edx, esi
jl 0x470b76
jmp case.default.0x470b08
xor edx, edx
mov dword [ebp - 0x10], edx
test esi, esi
jle case.default.0x470b08
mov ecx, dword [ebx + 0x3c]
mov eax, ecx
sub eax, dword [ebx + 0x1c]
add ecx, dword [ebp - 0x10]
add edx, eax
mov eax, dword [ebp - 0xc]
lea esi, [ecx + edi]
movzx eax, byte [edx + eax]
push eax
mov eax, dword [ebp - 0xc]
movzx eax, byte [ecx + eax]
push eax
movzx eax, byte [edx + edi]
push eax
call fcn.00470fa0
mov edx, dword [ebp - 0x10]
add esp, 0xc
add byte [esi], al
inc edx
mov esi, dword [ebp - 8]
mov dword [ebp - 0x10], edx
cmp edx, esi
jl 0x470bb1
mov edx, dword [ebp + 0x18]
cmp dword [ebx + 0x1c], edx
jne 0x470c1d
mov ecx, dword [ebx + 0x3c]
push esi
lea eax, [ecx + edi]
push eax
mov eax, dword [ebx]
imul eax, edx
imul eax, dword [ebx + 0x40]
add eax, ecx
mov ecx, dword [ebp + 8]
dec ecx
add eax, ecx
push eax
call fcn.00470dc0
add esp, 0xc
jmp 0x470cbe
mov eax, dword [ebx + 0x3c]
lea ecx, [eax + edi]
dec eax
imul eax, edx
xor edx, edx
mov edi, dword [ebx]
mov dword [ebp - 0xc], ecx
div dword [ebx + 0x1c]
mov edx, dword [ebp + 0x18]
add eax, dword [ebp + 8]
imul edi, edx
imul edi, dword [ebx + 0x40]
add edi, eax
mov eax, dword [ebx + 0x1c]
cmp edx, eax
mov dword [ebp - 0x10], edi
cmovb eax, edx
mov dword [ebp - 0x1c], eax
mov eax, esi
cdq
idiv dword [ebx + 0x1c]
mov dword [ebp - 0x14], eax
test eax, eax
jle 0x470cbe
mov esi, dword [ebp + 0x18]
mov edi, edi
mov eax, dword [ebp - 0x1c]
xor edx, edx
test eax, eax
jle 0x470c8a
mov esi, dword [ebp - 0xc]
mov ecx, edi
sub esi, edi
mov dword [ebp - 0x20], eax
mov edx, eax
mov al, byte [esi + ecx]
lea ecx, [ecx + 1]
mov byte [ecx - 1], al
dec edx
jne 0x470c75
mov edx, dword [ebp - 0x20]
mov ecx, dword [ebp - 0xc]
mov esi, dword [ebp + 0x18]
cmp edx, esi
jae 0x470cab
add edi, edx
mov ecx, esi
sub ecx, edx
or eax, 0xffffffff
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
add ecx, dword [ebx + 0x1c]
add edi, esi
dec dword [ebp - 0x14]
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], ecx
jne 0x470c60
mov esi, dword [ebp - 8]
mov eax, dword [ebx + 0x28]
add dword [ebx + 0x3c], esi
inc eax
cmp dword [ebx + 0x3c], eax
jl 0x470cd4
inc dword [ebx + 0x40]
mov dword [ebx + 0x3c], 0
mov eax, dword [ebx + 0x40]
mov ecx, dword [ebp - 0x18]
cmp eax, dword [ebx + 4]
jl 0x470a40
cmp dword [ebp - 0x58], 0
je 0x470cf1
mov eax, dword [ebx + 0x40]
cmp eax, dword [ebx + 4]
jl 0x470d17
mov edi, dword [ebp + 0x14]
mov esi, dword [ebp - 0x24]
test edi, edi
jne 0x470650
jmp 0x470d17
mov ecx, ebx
call fcn.004705b0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov byte [ebp - 1], 1
mov al, byte [ebp + 0x13]
test al, al
je 0x470d2a
lea eax, [ebp - 0x5c]
push eax
call fcn.004306f0
add esp, 4
mov al, byte [ebp - 1]
test al, al
jne 0x470d3b
mov ecx, ebx
call fcn.004705b0
mov al, byte [ebp - 1]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14