Function at 0x575e60
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xdc
mov eax, dword [0x675978]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xd4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0xdc], eax
mov eax, dword [ebx]
mov dword [ebp - 0xd0], ebx
mov dword [eax + 8], 0
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0xa4], eax
cmp eax, 4
ja 0x5768d2
push ebx
call fcn.00578ba0
mov edx, dword [ebx]
add esp, 4
test eax, eax
jne 0x575ee0
push eax
push dword [edx + 8]
push ebx
call fcn.00578ea0
add esp, 0xc
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b6a10
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xa4]
push esi
mov esi, dword [edx + 8]
mov dword [ebp - 0xc0], esi
test eax, eax
jne 0x575f07
cmp esi, 3
setge al
lea eax, [eax*2 + 1]
mov dword [ebp - 0xa4], eax
cmp esi, 3
jne 0x575f33
cmp dword [ebx + 0x47ec], esi
je 0x575f26
cmp dword [ebx + 0x47e8], 0
jne 0x575f33
cmp dword [ebx + 0x47e4], 0
jne 0x575f33
mov ecx, 1
mov dword [ebp - 0xc8], ecx
jmp 0x575f44
xor ecx, ecx
mov dword [ebp - 0xc8], ecx
cmp esi, 3
jne 0x576041
cmp eax, 3
jge 0x576041
test ecx, ecx
jne 0x576041
mov esi, 1
mov dword [ebp - 0xc0], esi
xor eax, eax
mov ecx, edx
push edi
xor edi, edi
mov dword [ebp - 0xa0], eax
mov dword [ebp - 0xc4], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xac], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 0xbc], eax
mov dword [ebp - 8], eax
mov dword [ebp - 0x98], eax
test esi, esi
jle 0x5760dc
lea eax, [ebp - 0x88]
lea esi, [ebx + 0x46a0]
mov dword [ebp - 0xb0], eax
mov dword [ebp - 0x9c], esi
mov eax, dword [ebx]
mov eax, dword [eax]
add eax, 3
push eax
call sym.BZDPatcher.exe_SDL_malloc
add esp, 4
mov dword [esi + 0x34], eax
test eax, eax
je 0x57618b
mov eax, dword [ebx + 0x4684]
cdq
idiv dword [esi]
mov edi, dword [ebp - 0x9c]
mov esi, eax
mov ecx, dword [ebp - 0xb0]
mov eax, dword [ebx + 0x4688]
cdq
idiv dword [edi + 4]
mov dword [ecx], esi
xor edx, edx
mov dword [ecx + 4], eax
mov ecx, eax
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp - 0xb0]
sar ecx, 1
mov dword [eax + 0xc], ecx
mov ecx, dword [ebx]
mov eax, dword [ecx]
dec eax
mov ecx, dword [ebp - 0xb0]
add eax, esi
div esi
mov dword [ecx + 0x10], 0
mov dword [ecx + 8], eax
mov eax, edi
mov eax, dword [eax + 0x28]
mov dword [ecx - 4], eax
mov dword [ecx - 8], eax
mov eax, dword [ebp - 0xa8]
cmp esi, 1
jne 0x576078
cmp eax, esi
jne 0x576067
mov eax, 0x576900
jmp 0x57609f
test esi, esi
jg 0x575f60
push 0
push esi
push ebx
call fcn.00578ea0
add esp, 0xc
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b6a10
mov esp, ebp
pop ebp
ret
mov esi, 1
cmp eax, 2
jne 0x576089
mov eax, 0x57def0
jmp 0x57609f
cmp esi, 2
jne 0x57609a
cmp eax, 1
jne 0x576089
mov eax, 0x57dbe0
jmp 0x57609f
cmp esi, 2
jne 0x57609a
cmp eax, esi
jne 0x57609a
mov eax, dword [ebx + 0x4814]
jmp 0x57609f
mov eax, 0x57dba0
mov esi, dword [ebp - 0x9c]
mov edi, 0
mov dword [ecx - 0xc], eax
add esi, 0x48
mov eax, dword [ebp - 0x98]
add ecx, 0x20
inc eax
mov dword [ebp - 0xb0], ecx
mov dword [ebp - 0x98], eax
mov dword [ebp - 0x9c], esi
cmp eax, dword [ebp - 0xc0]
jl 0x575fb1
mov edx, dword [ebx]
mov ecx, edx
mov eax, dword [edx + 4]
mov esi, dword [ebp - 0xa4]
mov dword [ebp - 0x9c], eax
mov eax, dword [edx]
mov edx, ecx
mov dword [ebp - 0xa8], eax
test esi, esi
js 0x57619c
test eax, eax
js 0x57619c
je 0x576121
mov eax, 0x7fffffff
cdq
idiv dword [ebp - 0xa8]
cmp esi, eax
jg 0x57619e
mov eax, dword [ebp - 0xa8]
mov edx, eax
mov dword [ebp - 0x98], ecx
imul edx, esi
mov dword [ebp - 0xb0], edx
test edx, edx
js 0x576194
mov edx, dword [ebp - 0x9c]
mov dword [ebp - 0x98], ecx
test edx, edx
js 0x576194
je 0x576168
mov eax, 0x7fffffff
cdq
idiv dword [ebp - 0x9c]
cmp dword [ebp - 0xb0], eax
jg 0x57619e
mov eax, dword [ebp - 0xa8]
mov edx, dword [ebp - 0x9c]
imul eax, edx
imul eax, esi
cmp eax, 0x7ffffffe
jg 0x57619e
inc eax
push eax
call sym.BZDPatcher.exe_SDL_malloc
mov ecx, dword [ebx]
add esp, 4
mov edx, eax
mov dword [ebp - 0xa8], eax
jmp 0x5761a6
mov eax, dword [ebx]
push 0
push dword [eax + 8]
jmp 0x5761ae
mov ecx, dword [ebp - 0x98]
jmp 0x57619e
mov ecx, edx
xor edx, edx
mov dword [ebp - 0xa8], edx
test edx, edx
jne 0x5761d9
push edx
push dword [ecx + 8]
push ebx
call fcn.00578ea0
push str.Out_of_memory
push 0x652d7c
call sym.BZDPatcher.exe_SDL_SetError
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b6a10
mov esp, ebp
pop ebp
ret
xor eax, eax
mov dword [ebp - 0xb0], eax
cmp dword [ecx + 4], eax
jbe 0x576876
lea ebx, [ebx]
mov esi, eax
mov dword [ebp - 0x98], 0
mov eax, dword [ebp - 0xa4]
imul esi, eax
imul esi, dword [ecx]
add esi, edx
cmp dword [ebp - 0xc0], 0
mov dword [ebp - 0x9c], esi
jle 0x5762db
mov esi, dword [ebp - 0xc0]
lea eax, [ebx + 0x46bc]
mov dword [ebp - 0xc4], eax
lea edi, [ebp - 0x7c]
mov ebx, eax
mov eax, dword [edi - 8]
sar eax, 1
cmp dword [edi], eax
jl 0x576242
mov edx, dword [edi - 0x14]
jmp 0x576245
mov edx, dword [edi - 0x10]
jl 0x57624c
mov eax, dword [edi - 0x10]
jmp 0x57624f
mov eax, dword [edi - 0x14]
push dword [edi - 0xc]
push dword [edi - 4]
push edx
push eax
push dword [ebx + 0x18]
call dword [edi - 0x18]
mov edx, dword [ebp - 0x98]
add esp, 0x14
mov dword [ebp + edx*4 - 0x14], eax
mov eax, dword [edi]
inc eax
mov dword [edi], eax
cmp eax, dword [edi - 8]
jl 0x576292
inc dword [edi + 4]
mov eax, dword [edi + 4]
mov ecx, dword [edi - 0x10]
mov dword [edi], 0
mov dword [edi - 0x14], ecx
cmp eax, dword [ebx]
jge 0x576292
mov eax, dword [ebx + 4]
add eax, ecx
mov dword [edi - 0x10], eax
inc edx
add edi, 0x20
add ebx, 0x48
mov dword [ebp - 0x98], edx
cmp edx, esi
jl 0x576234
mov eax, dword [ebp - 8]
mov ebx, dword [ebp - 0xd0]
mov edi, dword [ebp - 0x14]
mov esi, dword [ebp - 0x9c]
mov dword [ebp - 0xbc], eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebx]
mov dword [ebp - 0xac], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xa0], eax
mov eax, dword [ebp - 0xa4]
mov dword [ebp - 0xc4], edi
cmp eax, 3
jl 0x576593
mov edx, dword [ecx + 8]
cmp edx, 3
jne 0x57638b
cmp dword [ebp - 0xc8], 0
je 0x576368
xor edx, edx
cmp dword [ecx], edx
jbe 0x57658c
mov ecx, dword [ebp - 0xa0]
mov eax, edi
mov edi, dword [ebp - 0xac]
sub eax, ecx
add esi, 2
mov dword [ebp - 0x9c], eax
sub edi, ecx
mov dword [ebp - 0x98], edi
mov edi, dword [ebp - 0xa4]
lea ebx, [ebx]
movzx eax, byte [eax + ecx]
lea ecx, [ecx + 1]
mov byte [esi - 2], al
inc edx
movzx eax, byte [ecx - 1]
mov byte [esi - 1], al
mov eax, dword [ebp - 0x98]
movzx eax, byte [eax + ecx - 1]
mov byte [esi], al
mov byte [esi + 1], 0xff
add esi, edi
mov eax, dword [ebx]
cmp edx, dword [eax]
mov eax, dword [ebp - 0x9c]
jb 0x576330
mov ecx, dword [ebx]
jmp 0x576854
push eax
push dword [ecx]
mov eax, dword [ebx + 0x4810]
push dword [ebp - 0xac]
push dword [ebp - 0xa0]
push edi
push esi
call eax
mov ecx, dword [ebx]
add esp, 0x18
jmp 0x576854
cmp edx, 4
jne 0x576568
mov edx, dword [ebx + 0x47e8]
test edx, edx
jne 0x576486
mov dword [ebp - 0x98], edx
cmp dword [ecx], edx
jbe 0x57658c
mov ecx, dword [ebp - 0xbc]
mov eax, edi
mov edx, dword [ebp - 0xa0]
mov edi, ecx
sub edx, edi
mov dword [ebp - 0x9c], ecx
mov dword [ebp - 0xcc], edx
sub eax, edi
mov edx, dword [ebp - 0xac]
add esi, 2
sub edx, edi
mov dword [ebp - 0xb8], eax
mov edi, dword [ebp - 0xa4]
mov dword [ebp - 0xb4], edx
lea ecx, [ecx]
movzx edx, byte [ecx]
movzx ecx, byte [eax + ecx]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0xcc]
shr eax, 8
mov byte [esi - 2], al
mov eax, dword [ebp - 0x9c]
movzx ecx, byte [ecx + eax]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0xb4]
shr eax, 8
mov byte [esi - 1], al
mov eax, dword [ebp - 0x9c]
movzx ecx, byte [ecx + eax]
imul ecx, edx
mov edx, dword [ebp - 0x98]
mov byte [esi + 1], 0xff
inc edx
mov dword [ebp - 0x98], edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0x9c]
shr eax, 8
inc ecx
mov byte [esi], al
add esi, edi
mov eax, dword [ebx]
mov dword [ebp - 0x9c], ecx
cmp edx, dword [eax]
mov eax, dword [ebp - 0xb8]
jb 0x5763f0
mov ecx, dword [ebx]
jmp 0x576854
mov ecx, dword [ecx]
mov edi, dword [ebx + 0x4810]
mov dword [ebp - 0x98], edi
mov edi, dword [ebp - 0xc4]
push eax
push ecx
push dword [ebp - 0xac]
push dword [ebp - 0xa0]
push edi
push esi
cmp edx, 2
jne 0x576558
call dword [ebp - 0x98]
mov eax, dword [ebx]
xor ecx, ecx
add esp, 0x18
mov dword [ebp - 0x98], ecx
cmp dword [eax], ecx
jbe 0x57658c
mov edi, dword [ebp - 0xa4]
add esi, 2
jmp 0x5764e0
mov eax, dword [ebp - 0xbc]
movzx edx, byte [ecx + eax]
movzx eax, byte [esi - 2]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 2], al
movzx eax, byte [esi - 1]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 1], al
movzx eax, byte [esi]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0x98]
shr eax, 8
inc ecx
mov byte [esi], al
add esi, edi
mov eax, dword [ebx]
mov dword [ebp - 0x98], ecx
cmp ecx, dword [eax]
jb 0x5764e0
mov ecx, eax
jmp 0x576854
call dword [ebp - 0x98]
mov ecx, dword [ebx]
add esp, 0x18
jmp 0x576854
xor edx, edx
cmp dword [ecx], edx
jbe 0x57658c
inc esi
nop
mov al, byte [edx + edi]
inc edx
mov byte [esi + 1], al
mov byte [esi], al
mov byte [esi - 1], al
mov byte [esi + 2], 0xff
mov eax, dword [ebx]
add esi, dword [ebp - 0xa4]
cmp edx, dword [eax]
jb 0x576570
mov ecx, dword [ebx]
jmp 0x576854
cmp dword [ebp - 0xc8], 0
je 0x57669c
mov edx, dword [ecx]
mov dword [ebp - 0x98], 0
cmp eax, 1
jne 0x576625
test edx, edx
je 0x576854
mov eax, dword [ebp - 0xa0]
mov edx, edi
sub eax, edi
mov dword [ebp - 0xb8], eax
mov eax, dword [ebp - 0xac]
sub eax, edi
sub esi, edi
mov edi, dword [ebp - 0xb8]
mov dword [ebp - 0xb4], eax
nop
movzx eax, byte [eax + edx]
lea edx, [edx + 1]
imul ecx, eax, 0x1d
movzx eax, byte [edi + edx - 1]
imul eax, eax, 0x96
add ecx, eax
movzx eax, byte [edx - 1]
imul eax, eax, 0x4d
add ecx, eax
mov eax, dword [ebp - 0x98]
shr ecx, 8
inc eax
mov byte [esi + edx - 1], cl
mov ecx, dword [ebx]
mov dword [ebp - 0x98], eax
cmp eax, dword [ecx]
mov eax, dword [ebp - 0xb4]
jb 0x5765e0
jmp 0x576854
test edx, edx
je 0x576854
mov eax, dword [ebp - 0xa0]
mov edx, edi
sub eax, edi
mov dword [ebp - 0xb8], eax
mov eax, dword [ebp - 0xac]
sub eax, edi
mov edi, dword [ebp - 0xb8]
mov dword [ebp - 0xb4], eax
movzx eax, byte [edx + eax]
lea edx, [edx + 1]
imul ecx, eax, 0x1d
lea esi, [esi + 2]
movzx eax, byte [edx + edi - 1]
imul eax, eax, 0x96
add ecx, eax
movzx eax, byte [edx - 1]
imul eax, eax, 0x4d
mov byte [esi - 1], 0xff
add ecx, eax
mov eax, dword [ebp - 0x98]
shr ecx, 8
inc eax
mov byte [esi - 2], cl
mov ecx, dword [ebx]
mov dword [ebp - 0x98], eax
cmp eax, dword [ecx]
mov eax, dword [ebp - 0xb4]
jb 0x576651
jmp 0x576854
cmp dword [ecx + 8], 4
jne 0x576808
mov edx, dword [ebx + 0x47e8]
test edx, edx
jne 0x5767a8
mov dword [ebp - 0x98], edx
cmp dword [ecx], edx
jbe 0x576854
mov ecx, dword [ebp - 0xbc]
mov edx, ecx
mov eax, dword [ebp - 0xa0]
sub edi, ecx
sub eax, ecx
mov dword [ebp - 0x9c], edx
mov dword [ebp - 0xb8], eax
mov eax, dword [ebp - 0xac]
sub eax, ecx
mov dword [ebp - 0xcc], edi
mov dword [ebp - 0xb4], eax
jmp 0x576700
movzx eax, byte [edx]
mov ecx, dword [ebp - 0xb8]
movzx edi, byte [edx + edi]
mov ebx, dword [ebp - 0xb4]
imul edi, eax
movzx ecx, byte [edx + ecx]
imul ecx, eax
movzx edx, byte [edx + ebx]
imul edx, eax
mov ebx, dword [ebp - 0xd0]
sub edi, 0xffffff80
mov byte [esi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
sub edx, 0xffffff80
add eax, ecx
shr eax, 8
movzx eax, al
imul ecx, eax, 0x96
mov eax, edx
shr eax, 8
add eax, edx
mov edx, dword [ebp - 0x9c]
shr eax, 8
inc edx
movzx eax, al
imul eax, eax, 0x1d
mov dword [ebp - 0x9c], edx
add ecx, eax
mov eax, edi
shr eax, 8
add eax, edi
mov edi, dword [ebp - 0xcc]
shr eax, 8
movzx eax, al
imul eax, eax, 0x4d
add ecx, eax
mov eax, dword [ebp - 0x98]
shr ecx, 8
inc eax
mov byte [esi], cl
mov ecx, dword [ebx]
add esi, dword [ebp - 0xa4]
mov dword [ebp - 0x98], eax
cmp eax, dword [ecx]
jb 0x576700
jmp 0x576854
cmp edx, 2
jne 0x576808
cmp dword [ecx], 0
mov dword [ebp - 0x98], 0
jbe 0x576854
mov edx, dword [ebp - 0xbc]
sub edi, edx
mov al, byte [edx + edi]
lea edx, [edx + 1]
not al
movzx ecx, al
movzx eax, byte [edx - 1]
imul ecx, eax
mov byte [esi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi], al
mov eax, dword [ebp - 0x98]
mov ecx, dword [ebx]
inc eax
add esi, dword [ebp - 0xa4]
mov dword [ebp - 0x98], eax
cmp eax, dword [ecx]
jb 0x5767c8
jmp 0x576854
mov edx, dword [ecx]
mov dword [ebp - 0x98], edx
xor edx, edx
cmp eax, 1
jne 0x576833
cmp dword [ebp - 0x98], edx
jbe 0x576854
sub edi, esi
mov al, byte [edi + esi]
lea esi, [esi + 1]
mov byte [esi - 1], al
inc edx
mov ecx, dword [ebx]
cmp edx, dword [ecx]
jb 0x576821
jmp 0x576854
cmp dword [ebp - 0x98], edx
jbe 0x576854
jmp 0x576840
mov al, byte [edx + edi]
lea esi, [esi + 2]
mov byte [esi - 2], al
inc edx
mov byte [esi - 1], 0xff
mov ecx, dword [ebx]
cmp edx, dword [ecx]
jb 0x576840
mov eax, dword [ebp - 0xb0]
mov edi, dword [ebp - 0xc4]
inc eax
mov edx, dword [ebp - 0xa8]
mov dword [ebp - 0xb0], eax
cmp eax, dword [ecx + 4]
jb 0x5761f0
push 0
push dword [ecx + 8]
push ebx
call fcn.00578ea0
mov eax, dword [ebx]
add esp, 0xc
mov ecx, dword [ebp - 0xd4]
mov edx, dword [ebp - 0xdc]
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [ebx]
mov ecx, dword [ebp - 0xd8]
mov eax, dword [eax + 4]
mov dword [ecx], eax
test edx, edx
je 0x5768bb
mov eax, dword [ebx]
xor ecx, ecx
cmp dword [eax + 8], 3
setge cl
lea ecx, [ecx*2 + 1]
mov dword [edx], ecx
mov eax, dword [ebp - 0xa8]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b6a10
mov esp, ebp
pop ebp
ret
push str.Internal_error
push 0x652d7c
call sym.BZDPatcher.exe_SDL_SetError
mov ecx, dword [ebp - 4]
add esp, 8
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.005b6a10
mov esp, ebp
pop ebp
ret