Function at 0x596040
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x118
push ebx
push esi
push edi
lea edi, [ebp - 0x118]
mov ecx, 0x46
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x2c]
mov dword [ebp - 0x38], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0x3c]
sub edx, dword [ecx + 0x74]
mov eax, dword [ebp + 8]
sub edx, dword [eax + 0x6c]
mov dword [ebp - 0x2c], edx
xor eax, eax
je 0x5960af
cmp dword [ebp - 0x2c], 0
jne 0x5960a0
mov eax, dword [ebp + 8]
cmp dword [eax + 0x6c], 0
jne 0x5960a0
mov eax, dword [ebp + 8]
cmp dword [eax + 0x74], 0
jne 0x5960a0
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x2c], eax
jmp 0x5960af
cmp dword [ebp - 0x2c], 0xffffffff
jne 0x5960af
mov eax, dword [ebp - 0x2c]
sub eax, 1
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x2c]
mov edx, dword [ebp - 0x38]
lea eax, [edx + ecx - 0x106]
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x6c], eax
jb 0x5961df
mov eax, dword [ebp - 0x38]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x38]
add edx, dword [ebp - 0x38]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x38]
push ecx
call 0x6a0880
add esp, 0xc
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x70]
sub ecx, dword [ebp - 0x38]
mov edx, dword [ebp + 8]
mov dword [edx + 0x70], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x6c]
sub ecx, dword [ebp - 0x38]
mov edx, dword [ebp + 8]
mov dword [edx + 0x6c], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x5c]
sub ecx, dword [ebp - 0x38]
mov edx, dword [ebp + 8]
mov dword [edx + 0x5c], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x4c]
mov dword [ebp - 8], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x44]
mov edx, dword [ebp - 8]
lea eax, [ecx + edx*2]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sub eax, 2
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x20]
movzx edx, word [ecx]
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x38]
jb 0x596155
mov ecx, dword [ebp - 0x14]
sub ecx, dword [ebp - 0x38]
mov dword [ebp - 0x118], ecx
jmp 0x59615f
mov dword [ebp - 0x118], 0
mov edx, dword [ebp - 0x20]
mov ax, word [ebp - 0x118]
mov word [edx], ax
mov eax, dword [ebp - 8]
sub eax, 1
mov dword [ebp - 8], eax
jne 0x59612d
mov eax, dword [ebp - 0x38]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x40]
mov edx, dword [ebp - 8]
lea eax, [ecx + edx*2]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sub eax, 2
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x20]
movzx edx, word [ecx]
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x38]
jb 0x5961b4
mov ecx, dword [ebp - 0x14]
sub ecx, dword [ebp - 0x38]
mov dword [ebp - 0x118], ecx
jmp 0x5961be
mov dword [ebp - 0x118], 0
mov edx, dword [ebp - 0x20]
mov ax, word [ebp - 0x118]
mov word [edx], ax
mov eax, dword [ebp - 8]
sub eax, 1
mov dword [ebp - 8], eax
jne 0x59618c
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x38]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
cmp dword [ecx + 4], 0
jne 0x5961ef
jmp 0x596387
mov eax, dword [ebp - 0x2c]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x38]
mov eax, dword [ebp + 8]
add edx, dword [eax + 0x6c]
mov ecx, dword [ebp + 8]
add edx, dword [ecx + 0x74]
push edx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call fcn.005963a0
add esp, 0xc
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x74]
add ecx, dword [ebp - 8]
mov edx, dword [ebp + 8]
mov dword [edx + 0x74], ecx
mov eax, dword [ebp + 8]
cmp dword [eax + 0x74], 3
jb 0x596272
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x38]
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x6c]
movzx ecx, byte [ecx + eax]
mov edx, dword [ebp + 8]
mov dword [edx + 0x48], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0x48]
mov ecx, dword [ecx + 0x58]
shl edx, cl
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x6c]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
movzx ecx, byte [eax + ecx + 1]
xor edx, ecx
mov eax, dword [ebp + 8]
and edx, dword [eax + 0x54]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x48], edx
mov eax, dword [ebp + 8]
cmp dword [eax + 0x74], 0x106
jae 0x59628d
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
cmp dword [ecx + 4], 0
jne 0x596067
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0x16c0]
cmp edx, dword [ecx + 0x3c]
jae 0x596387
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x6c]
mov edx, dword [ebp + 8]
add ecx, dword [edx + 0x74]
mov dword [ebp - 0x44], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x16c0]
cmp ecx, dword [ebp - 0x44]
jae 0x596307
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x3c]
sub ecx, dword [ebp - 0x44]
mov dword [ebp - 0x50], ecx
cmp dword [ebp - 0x50], 0x102
jbe 0x5962db
mov dword [ebp - 0x50], 0x102
mov eax, dword [ebp - 0x50]
push eax
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x38]
add edx, dword [ebp - 0x44]
push edx
call 0x6a0bf0
add esp, 0xc
mov eax, dword [ebp - 0x44]
add eax, dword [ebp - 0x50]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x16c0], eax
jmp 0x596387
mov eax, dword [ebp - 0x44]
add eax, 0x102
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x16c0], eax
jae 0x596387
mov eax, dword [ebp - 0x44]
add eax, 0x102
mov ecx, dword [ebp + 8]
sub eax, dword [ecx + 0x16c0]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0x3c]
sub edx, dword [ecx + 0x16c0]
cmp dword [ebp - 0x50], edx
jbe 0x596354
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0x3c]
sub edx, dword [ecx + 0x16c0]
mov dword [ebp - 0x50], edx
mov eax, dword [ebp - 0x50]
push eax
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x38]
mov eax, dword [ebp + 8]
add edx, dword [eax + 0x16c0]
push edx
call 0x6a0bf0
add esp, 0xc
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x16c0]
add ecx, dword [ebp - 0x50]
mov edx, dword [ebp + 8]
mov dword [edx + 0x16c0], ecx
pop edi
pop esi
pop ebx
add esp, 0x118
cmp ebp, esp
call 0x6a07fa
mov esp, ebp
pop ebp
ret