Function at 0x5086cc
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff94
push ebx
push esi
push edi
mov esi, edx
lea edi, [ebp - 0x68]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov esi, eax
lea edi, [ebp - 0x58]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov dword [ebp - 4], ecx
mov edi, dword [ebp + 0x18]
cmp dword [ebp + 0x1c], 0
je 0x50927b
mov dl, 7
mov eax, dword [ebp + 0x1c]
call fcn.0042a49c
lea eax, [ebp - 0x68]
mov dl, 1
call fcn.00501894
push eax
lea eax, [ebp - 0x58]
mov dl, 1
call fcn.00501894
pop edx
call fcn.0042b578
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x20]
mov edx, eax
sub edx, dword [ebp - 0x54]
mov eax, dword [ebp - 0x14]
call fcn.0042b578
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0x1c]
mov edx, dword [eax]
call dword [edx + 0x20]
mov edx, eax
sub edx, dword [ebp - 0x64]
mov eax, dword [ebp - 0x14]
call fcn.0042b578
dec eax
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jl 0x50927b
lea eax, [ebp - 0x68]
mov dl, 1
call fcn.00501880
push eax
lea eax, [ebp - 0x58]
mov dl, 1
call fcn.00501880
pop edx
call fcn.0042b578
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, eax
sub edx, dword [ebp - 0x58]
mov eax, dword [ebp - 0x18]
call fcn.0042b578
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 0x1c]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, eax
sub edx, dword [ebp - 0x68]
mov eax, dword [ebp - 0x18]
call fcn.0042b578
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jl 0x50927b
mov eax, dword [ebp - 0x68]
cmp eax, dword [ebp - 0x58]
jle 0x5087f0
cmp dword [ebp - 0x58], 0
jge 0x508824
mov eax, dword [ebp - 0x58]
neg eax
add dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x58]
neg eax
sub dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x58], eax
mov eax, dword [ebp + 0x1c]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, eax
sub edx, dword [ebp - 0x68]
mov eax, dword [ebp - 0x18]
call fcn.0042b578
dec eax
mov dword [ebp - 0x18], eax
jmp 0x508824
cmp dword [ebp - 0x68], 0
jge 0x508824
mov eax, dword [ebp - 0x68]
neg eax
add dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x68]
neg eax
sub dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, eax
sub edx, dword [ebp - 0x58]
mov eax, dword [ebp - 0x18]
call fcn.0042b578
dec eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x64]
cmp eax, dword [ebp - 0x54]
jle 0x508862
cmp dword [ebp - 0x54], 0
jge 0x508896
mov eax, dword [ebp - 0x54]
neg eax
add dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x54]
neg eax
sub dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x54], eax
mov eax, dword [ebp + 0x1c]
mov edx, dword [eax]
call dword [edx + 0x20]
mov edx, eax
sub edx, dword [ebp - 0x64]
mov eax, dword [ebp - 0x14]
call fcn.0042b578
dec eax
mov dword [ebp - 0x14], eax
jmp 0x508896
cmp dword [ebp - 0x64], 0
jge 0x508896
mov eax, dword [ebp - 0x64]
neg eax
add dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x64]
neg eax
sub dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x20]
mov edx, eax
sub edx, dword [ebp - 0x54]
mov eax, dword [ebp - 0x14]
call fcn.0042b578
dec eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, eax
sub edx, dword [ebp - 0x58]
mov eax, dword [ebp - 0x18]
call fcn.0042b578
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 0x1c]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, eax
sub edx, dword [ebp - 0x68]
mov eax, dword [ebp - 0x18]
call fcn.0042b578
dec eax
mov dword [ebp - 0x18], eax
cmp dword [ebp + 0x10], 0x1fffffff
je 0x508a1f
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x24], eax
xor eax, eax
mov al, byte [ebp - 0x24]
mov dword [ebp - 0x6c], eax
fild dword [ebp - 0x6c]
fld dword [0x509284]
call fcn.00403668
fstp qword [ebp - 0x30]
wait
xor eax, eax
mov al, byte [ebp - 0x23]
mov dword [ebp - 0x6c], eax
fild dword [ebp - 0x6c]
fld dword [0x509284]
call fcn.00403668
fstp qword [ebp - 0x38]
wait
xor eax, eax
mov al, byte [ebp - 0x22]
mov dword [ebp - 0x6c], eax
fild dword [ebp - 0x6c]
fld dword [0x509284]
call fcn.00403668
fstp qword [ebp - 0x40]
wait
mov eax, dword [ebp - 0x14]
test eax, eax
jl 0x508a1f
inc eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x10], 0
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp + 0x1c]
call fcn.004295fc
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x508a13
inc eax
mov dword [ebp - 0x48], eax
xor esi, esi
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + esi*4]
mov dword [ebp - 0x28], eax
mov eax, dword [0x521320]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
je 0x508a09
xor eax, eax
mov al, byte [ebp - 0x26]
xor edx, edx
mov dl, byte [ebp - 0x27]
add eax, edx
xor edx, edx
mov dl, byte [ebp - 0x28]
add eax, edx
mov ecx, 3
xor edx, edx
div ecx
mov ebx, eax
xor eax, eax
mov al, bl
mov dword [ebp - 0x6c], eax
fild dword [ebp - 0x6c]
fmul qword [ebp - 0x30]
call fcn.00403048
push edx
push eax
push 0
push 0xff
call fcn.0042b580
mov byte [ebp - 0x26], al
xor eax, eax
mov al, bl
mov dword [ebp - 0x6c], eax
fild dword [ebp - 0x6c]
fmul qword [ebp - 0x38]
call fcn.00403048
push edx
push eax
push 0
push 0xff
call fcn.0042b580
mov byte [ebp - 0x27], al
xor eax, eax
mov al, bl
mov dword [ebp - 0x6c], eax
fild dword [ebp - 0x6c]
fmul qword [ebp - 0x40]
call fcn.00403048
push edx
push eax
push 0
push 0xff
call fcn.0042b580
mov byte [ebp - 0x28], al
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x28]
mov dword [eax + esi*4], edx
inc esi
dec dword [ebp - 0x48]
jne 0x508960
inc dword [ebp - 0x10]
dec dword [ebp - 0x44]
jne 0x50893e
cmp dword [ebp + 0xc], 0
je 0x508d47
cmp byte [edi + 0x10], 0
jne 0x508b65
mov eax, dword [ebp - 0x14]
test eax, eax
jl 0x50909b
inc eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x10], 0
mov edx, dword [ebp - 0x54]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004295fc
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp + 0x1c]
call fcn.004295fc
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x508b54
inc eax
mov dword [ebp - 0x48], eax
xor esi, esi
mov eax, dword [ebp - 0x58]
add eax, esi
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x68]
add eax, esi
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x20]
mov eax, dword [eax + edx*4]
mov dword [ebp - 0x28], eax
xor eax, eax
mov al, byte [ebp - 0x25]
mov edx, 0x64
sub edx, dword [ebp + 0xc]
imul edx
mov ecx, 0x64
cdq
idiv ecx
mov ebx, eax
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
movzx edx, byte [edx + eax + 2]
xor ecx, ecx
mov cl, byte [ebp - 0x26]
sub ecx, edx
xor edx, edx
mov dl, bl
imul ecx, edx
mov edx, dword [ebp - 0x1c]
lea edx, [edx + edx*2]
mov edi, dword [ebp - 8]
movzx edx, byte [edi + edx + 2]
shl edx, 8
add ecx, edx
shr ecx, 8
and cl, 0xff
mov edx, dword [ebp - 8]
mov byte [edx + eax + 2], cl
mov edx, dword [ebp - 8]
movzx edx, byte [edx + eax + 1]
xor ecx, ecx
mov cl, byte [ebp - 0x27]
sub ecx, edx
xor edx, edx
mov dl, bl
imul ecx, edx
mov edx, dword [ebp - 8]
movzx edx, byte [edx + eax + 1]
shl edx, 8
add ecx, edx
shr ecx, 8
and cl, 0xff
mov edx, dword [ebp - 8]
mov byte [edx + eax + 1], cl
mov edx, dword [ebp - 8]
movzx edx, byte [edx + eax]
xor ecx, ecx
mov cl, byte [ebp - 0x28]
sub ecx, edx
xor edx, edx
mov dl, bl
imul ecx, edx
mov edx, dword [ebp - 8]
movzx edx, byte [edx + eax]
shl edx, 8
add ecx, edx
shr ecx, 8
and cl, 0xff
mov edx, dword [ebp - 8]
mov byte [edx + eax], cl
inc esi
dec dword [ebp - 0x48]
jne 0x508a7c
inc dword [ebp - 0x10]
dec dword [ebp - 0x44]
jne 0x508a49
jmp 0x50909b
mov eax, dword [ebp - 0x14]
test eax, eax
jl 0x50909b
inc eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x10], 0
mov edx, dword [ebp - 0x54]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004295fc
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp + 0x1c]
call fcn.004295fc
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x508d36
inc eax
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x20]
mov eax, dword [eax + edx*4]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0xff00ff
je 0x508c94
xor eax, eax
mov al, byte [ebp - 0x25]
mov edx, 0x64
sub edx, dword [ebp + 0xc]
imul edx
mov ecx, 0x64
cdq
idiv ecx
mov ebx, eax
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
movzx edx, byte [edx + eax + 2]
xor ecx, ecx
mov cl, byte [ebp - 0x26]
sub ecx, edx
xor edx, edx
mov dl, bl
imul ecx, edx
mov edx, dword [ebp - 0x1c]
lea edx, [edx + edx*2]
mov esi, dword [ebp - 8]
movzx edx, byte [esi + edx + 2]
shl edx, 8
add ecx, edx
shr ecx, 8
and cl, 0xff
mov edx, dword [ebp - 8]
mov byte [edx + eax + 2], cl
mov edx, dword [ebp - 8]
movzx edx, byte [edx + eax + 1]
xor ecx, ecx
mov cl, byte [ebp - 0x27]
sub ecx, edx
xor edx, edx
mov dl, bl
imul ecx, edx
mov edx, dword [ebp - 0x1c]
lea edx, [edx + edx*2]
mov esi, dword [ebp - 8]
movzx edx, byte [esi + edx + 1]
shl edx, 8
add ecx, edx
shr ecx, 8
and cl, 0xff
mov edx, dword [ebp - 8]
mov byte [edx + eax + 1], cl
mov edx, dword [ebp - 8]
movzx edx, byte [edx + eax]
xor ecx, ecx
mov cl, byte [ebp - 0x28]
sub ecx, edx
xor edx, edx
mov dl, bl
imul ecx, edx
mov edx, dword [ebp - 0x1c]
lea edx, [edx + edx*2]
mov ebx, dword [ebp - 8]
movzx edx, byte [ebx + edx]
shl edx, 8
add ecx, edx
shr ecx, 8
and cl, 0xff
mov edx, dword [ebp - 8]
mov byte [edx + eax], cl
jmp 0x508d27
cmp byte [ebp + 0x14], 0
je 0x508d27
mov eax, dword [edi]
mov edx, dword [eax]
call dword [edx + 0x20]
mov edx, dword [edi + 8]
add edx, dword [ebp - 0x54]
add edx, dword [ebp - 0x10]
cmp eax, edx
jle 0x508d2d
mov eax, dword [edi]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, dword [edi + 4]
add edx, dword [ebp - 0x1c]
cmp eax, edx
jle 0x508d36
mov eax, dword [edi + 8]
add eax, dword [ebp - 0x54]
add eax, dword [ebp - 0x10]
test eax, eax
jl 0x508d36
mov eax, dword [edi + 4]
add eax, dword [ebp - 0x1c]
test eax, eax
jl 0x508d2d
mov eax, dword [edi]
call fcn.0042948c
mov ecx, dword [edi + 8]
add ecx, dword [ebp - 0x54]
add ecx, dword [ebp - 0x10]
mov edx, dword [edi + 4]
add edx, dword [ebp - 0x1c]
call fcn.00424f4c
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
mov cl, byte [ebp - 0x24]
mov byte [edx + eax + 2], cl
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
mov cl, byte [ebp - 0x23]
mov byte [edx + eax + 1], cl
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
mov cl, byte [ebp - 0x22]
mov byte [edx + eax], cl
inc dword [ebp - 0x1c]
inc dword [ebp - 0x20]
dec dword [ebp - 0x48]
jne 0x508bb8
inc dword [ebp - 0x10]
dec dword [ebp - 0x44]
jne 0x508b7b
jmp 0x50909b
cmp byte [edi + 0x10], 0
jne 0x508eac
mov eax, dword [ebp - 0x14]
test eax, eax
jl 0x50909b
inc eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x10], 0
mov edx, dword [ebp - 0x54]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004295fc
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp + 0x1c]
call fcn.004295fc
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x508e9b
inc eax
mov dword [ebp - 0x48], eax
xor ecx, ecx
push ebp
push 0x508dff
push dword fs:[ecx]
mov dword fs:[ecx], esp
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x20]
movzx ecx, byte [ecx + ebx*4 + 2]
mov edx, dword [ebp - 0x1c]
lea edx, [edx + edx*2]
mov eax, dword [ebp - 8]
mov al, byte [eax + edx + 2]
xor ebx, ebx
mov bl, al
sub ecx, ebx
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x20]
movzx ebx, byte [ebx + esi*4 + 3]
imul ecx, ebx
and eax, 0xff
shl eax, 8
add ecx, eax
shr ecx, 8
and cl, 0xff
mov eax, dword [ebp - 8]
mov byte [eax + edx + 2], cl
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x508e09
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x20]
movzx ecx, byte [ecx + ebx*4 + 1]
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
mov dl, byte [edx + eax + 1]
xor ebx, ebx
mov bl, dl
sub ecx, ebx
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x20]
movzx ebx, byte [ebx + esi*4 + 3]
imul ecx, ebx
and edx, 0xff
shl edx, 8
add ecx, edx
shr ecx, 8
and cl, 0xff
mov edx, dword [ebp - 8]
mov byte [edx + eax + 1], cl
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x20]
movzx edx, byte [edx + ecx*4]
mov ecx, dword [ebp - 8]
movzx ecx, byte [ecx + eax]
sub edx, ecx
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x20]
movzx ecx, byte [ecx + ebx*4 + 3]
imul edx, ecx
mov ecx, dword [ebp - 0x1c]
lea ecx, [ecx + ecx*2]
mov ebx, dword [ebp - 8]
movzx ecx, byte [ebx + ecx]
shl ecx, 8
add edx, ecx
shr edx, 8
and dl, 0xff
mov ecx, dword [ebp - 8]
mov byte [ecx + eax], dl
inc dword [ebp - 0x1c]
inc dword [ebp - 0x20]
dec dword [ebp - 0x48]
jne 0x508da4
inc dword [ebp - 0x10]
dec dword [ebp - 0x44]
jne 0x508d67
jmp 0x50909b
mov eax, dword [ebp - 0x14]
test eax, eax
jl 0x50909b
inc eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x10], 0
mov edx, dword [ebp - 0x54]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004295fc
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp + 0x1c]
call fcn.004295fc
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x50908f
inc eax
mov dword [ebp - 0x48], eax
xor esi, esi
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x20]
mov eax, dword [eax + edx*4]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0xff00ff
je 0x508fea
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x20]
movzx edx, byte [edx + ecx*4 + 2]
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov ecx, dword [ebp - 8]
movzx ecx, byte [ecx + eax + 2]
sub edx, ecx
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x20]
movzx ecx, byte [ecx + ebx*4 + 3]
imul edx, ecx
mov ecx, dword [ebp - 0x1c]
lea ecx, [ecx + ecx*2]
mov ebx, dword [ebp - 8]
movzx ecx, byte [ebx + ecx + 2]
shl ecx, 8
add edx, ecx
shr edx, 8
and dl, 0xff
mov ecx, dword [ebp - 8]
mov byte [ecx + eax + 2], dl
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x20]
movzx edx, byte [edx + ecx*4 + 1]
mov ecx, dword [ebp - 8]
movzx ecx, byte [ecx + eax + 1]
sub edx, ecx
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x20]
movzx ecx, byte [ecx + ebx*4 + 3]
imul edx, ecx
mov ecx, dword [ebp - 0x1c]
lea ecx, [ecx + ecx*2]
mov ebx, dword [ebp - 8]
movzx ecx, byte [ebx + ecx + 1]
shl ecx, 8
add edx, ecx
shr edx, 8
and dl, 0xff
mov ecx, dword [ebp - 8]
mov byte [ecx + eax + 1], dl
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x20]
movzx edx, byte [edx + ecx*4]
mov ecx, dword [ebp - 8]
movzx ecx, byte [ecx + eax]
sub edx, ecx
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x20]
movzx ecx, byte [ecx + ebx*4 + 3]
imul edx, ecx
mov ecx, dword [ebp - 0x1c]
lea ecx, [ecx + ecx*2]
mov ebx, dword [ebp - 8]
movzx ecx, byte [ebx + ecx]
shl ecx, 8
add edx, ecx
shr edx, 8
and dl, 0xff
mov ecx, dword [ebp - 8]
mov byte [ecx + eax], dl
jmp 0x50907f
cmp byte [ebp + 0x14], 0
je 0x50907f
mov eax, dword [edi]
mov edx, dword [eax]
call dword [edx + 0x20]
mov edx, dword [edi + 8]
add edx, dword [ebp - 0x54]
add edx, dword [ebp - 0x10]
cmp eax, edx
jle 0x509085
mov eax, dword [edi]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, dword [edi + 4]
add edx, dword [ebp - 0x1c]
cmp eax, edx
jle 0x50908f
mov eax, dword [edi + 8]
add eax, dword [ebp - 0x54]
add eax, dword [ebp - 0x10]
test eax, eax
jl 0x50908f
mov eax, dword [edi + 4]
add eax, dword [ebp - 0x1c]
test eax, eax
jl 0x509085
mov eax, dword [edi]
call fcn.0042948c
mov ecx, dword [edi + 8]
add ecx, dword [ebp - 0x54]
add ecx, dword [ebp - 0x10]
mov edx, dword [edi + 4]
add edx, dword [ebp - 0x58]
add edx, esi
call fcn.00424f4c
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
mov cl, byte [ebp - 0x24]
mov byte [edx + eax + 2], cl
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
mov cl, byte [ebp - 0x23]
mov byte [edx + eax + 1], cl
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 8]
mov cl, byte [ebp - 0x22]
mov byte [edx + eax], cl
inc dword [ebp - 0x1c]
inc dword [ebp - 0x20]
inc esi
dec dword [ebp - 0x48]
jne 0x508f01
inc dword [ebp - 0x10]
dec dword [ebp - 0x44]
jne 0x508ec2
cmp byte [ebp + 8], 0
je 0x50927b
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x20]
sub eax, dword [ebp - 0x4c]
dec eax
push eax
mov eax, dword [ebp + 0x1c]
mov edx, dword [eax]
call dword [edx + 0x20]
sar eax, 1
jns 0x5090c1
adc eax, 0
dec eax
pop edx
call fcn.0042b578
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0x1c]
mov edx, dword [eax]
call dword [edx + 0x20]
sar eax, 1
jns 0x5090da
adc eax, 0
push eax
mov eax, 0xff
pop edx
mov ecx, edx
cdq
idiv ecx
mov byte [ebp - 0x21], al
mov byte [ebp - 0x24], 0xff
mov eax, dword [ebp - 0x14]
test eax, eax
jle 0x50927b
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x10], 1
mov edx, dword [ebp - 0x4c]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
call fcn.004295fc
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0x5c]
sub edx, dword [ebp - 0x10]
dec edx
mov eax, dword [ebp + 0x1c]
call fcn.004295fc
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x509269
inc eax
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x20]
mov eax, dword [eax + edx*4]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0xff00ff
je 0x50925a
cmp dword [ebp + 0xc], 0
jne 0x509188
xor eax, eax
mov al, byte [ebp - 0x25]
mov ecx, 3
xor edx, edx
div ecx
xor edx, edx
mov dl, byte [ebp - 0x24]
imul edx
mov ecx, 0xff
xor edx, edx
div ecx
xor edx, edx
call fcn.0042b5f4
mov ebx, eax
jmp 0x5091b7
xor eax, eax
mov al, byte [ebp - 0x25]
mov edx, 0x64
sub edx, dword [ebp + 0xc]
imul edx
mov ecx, 0x12c
cdq
idiv ecx
xor edx, edx
mov dl, byte [ebp - 0x24]
imul edx
mov ecx, 0xff
cdq
idiv ecx
xor edx, edx
call fcn.0042b5f4
mov ebx, eax
mov eax, dword [ebp - 0x1c]
lea eax, [eax + eax*2]
mov ecx, dword [ebp - 8]
movzx ecx, byte [ecx + eax + 2]
push ecx
xor ecx, ecx
mov cl, byte [ebp - 0x26]
pop esi
sub ecx, esi
xor edx, edx
mov dl, bl
imul ecx, edx
mov esi, dword [ebp - 0x1c]
lea esi, [esi + esi*2]
mov edi, dword [ebp - 8]
movzx esi, byte [edi + esi + 2]
shl esi, 8
add ecx, esi
shr ecx, 8
and cl, 0xff
mov esi, dword [ebp - 8]
mov byte [esi + eax + 2], cl
mov ecx, dword [ebp - 8]
movzx ecx, byte [ecx + eax + 1]
push ecx
xor ecx, ecx
mov cl, byte [ebp - 0x27]
pop esi
sub ecx, esi
imul ecx, edx
mov esi, dword [ebp - 0x1c]
lea esi, [esi + esi*2]
mov edi, dword [ebp - 8]
movzx esi, byte [edi + esi + 1]
shl esi, 8
add ecx, esi
shr ecx, 8
and cl, 0xff
mov esi, dword [ebp - 8]
mov byte [esi + eax + 1], cl
mov ecx, dword [ebp - 8]
movzx ecx, byte [ecx + eax]
push ecx
xor ecx, ecx
mov cl, byte [ebp - 0x28]
pop esi
sub ecx, esi
imul ecx, edx
mov edx, dword [ebp - 0x1c]
lea edx, [edx + edx*2]
mov ebx, dword [ebp - 8]
movzx edx, byte [ebx + edx]
shl edx, 8
add ecx, edx
shr ecx, 8
and cl, 0xff
mov edx, dword [ebp - 8]
mov byte [edx + eax], cl
inc dword [ebp - 0x1c]
inc dword [ebp - 0x20]
dec dword [ebp - 0x48]
jne 0x509140
mov al, byte [ebp - 0x21]
sub byte [ebp - 0x24], al
inc dword [ebp - 0x10]
dec dword [ebp - 0x44]
jne 0x509102
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18