Function at 0x586930
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push esi
push edi
mov edi, dword [ebp + 0x14]
push edi
mov dword [ebp - 0x34], 0
call fcn.0051fa40
push edi
call fcn.0051f7f0
push edi
mov dword [ebp - 0x20], eax
call fcn.0051f7f0
push edi
mov dword [ebp - 0x1c], eax
call fcn.0051f7f0
mov esi, eax
push edi
mov dword [ebp - 0x2c], esi
call fcn.0051f7f0
mov edi, eax
add esp, 0x14
mov dword [ebp - 0x30], edi
test edi, edi
je 0x586dac
push ebx
mov ebx, dword [ebp + 0x10]
lea eax, [ebp - 0x58]
push 6
push eax
push ebx
call fcn.00587650
add esp, 0xc
test eax, eax
je 0x586d90
cmp eax, 6
jg 0x586d90
lea eax, [ebp - 0x58]
push eax
push dword [ebp + 0xc]
push esi
call fcn.005864f0
add esp, 0xc
test eax, eax
je 0x586dab
push esi
call fcn.004f68d0
add esp, 4
test eax, eax
jne 0x586dab
push ebx
push edi
call fcn.004f6640
add esp, 8
test eax, eax
je 0x586dab
push esi
call fcn.004f69b0
push edi
mov dword [ebp - 0x14], eax
call fcn.004f69b0
mov edi, dword [ebx + 4]
push edi
push esi
mov dword [ebp - 0x24], eax
mov dword [ebp - 4], edi
call fcn.004f7130
add esp, 0x10
test eax, eax
je 0x586dab
mov edx, dword [ebp - 0x2c]
mov esi, dword [esi]
mov dword [ebp - 0x18], esi
mov eax, dword [edx + 4]
cmp eax, edi
jge 0x586a22
mov ecx, dword [ebp - 4]
lea edi, [esi + eax*4]
sub ecx, eax
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, dword [ebp - 4]
push edi
push dword [ebp - 0x20]
mov dword [edx + 4], edi
call fcn.004f7130
add esp, 8
test eax, eax
je 0x586dab
mov edx, dword [ebp - 0x20]
mov ebx, dword [edx]
mov dword [ebp - 0xc], ebx
mov dword [ebx], 1
cmp edi, 1
jle 0x586a59
lea ecx, [edi - 1]
xor eax, eax
lea edi, [ebx + 4]
rep stosd dword es:[edi], eax
mov edi, dword [ebp - 4]
push edi
push dword [ebp - 0x1c]
mov dword [edx + 4], edi
call fcn.004f7130
add esp, 8
test eax, eax
je 0x586dab
mov eax, dword [ebp - 0x1c]
mov edx, dword [eax]
mov dword [ebp - 0x10], edx
test edi, edi
jle 0x586a8a
mov ecx, edi
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov edi, dword [ebp - 4]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x14]
mov dword [eax + 4], edi
mov eax, dword [ebp - 0x30]
mov eax, dword [eax]
mov dword [ebp - 8], eax
test ecx, ecx
je 0x586b64
mov ebx, dword [esi]
test bl, 1
jne 0x586b5e
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp + 0x10]
mov eax, dword [eax]
mov edx, eax
mov ecx, dword [ecx]
and edx, 1
neg edx
mov dword [ebp - 0x3c], edx
mov ecx, dword [ecx]
and ecx, edx
lea edx, [edi - 1]
xor eax, ecx
xor ecx, ecx
mov dword [ebp - 0x28], ecx
test edx, edx
jle 0x586b40
mov ecx, dword [ebp - 0xc]
mov edx, esi
sub edx, ecx
mov dword [ebp - 0x40], edx
lea edi, [ecx + 4]
mov ecx, 0xfffffffc
sub ecx, dword [ebp - 0xc]
mov dword [ebp - 0x38], ecx
nop dword [eax]
mov edx, dword [edx + edi]
mov ecx, edx
shl ecx, 0x1f
shr ebx, 1
or ecx, ebx
shr eax, 1
mov ebx, dword [ebp - 0x28]
mov dword [esi + ebx*4], ecx
mov ebx, edx
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 0x38]
mov esi, dword [ebp - 0x18]
add edx, edi
mov ecx, dword [ecx]
mov edx, dword [edx + ecx + 4]
and edx, dword [ebp - 0x3c]
xor edx, dword [edi]
mov ecx, edx
shl ecx, 0x1f
or ecx, eax
mov eax, edx
mov edx, dword [ebp - 4]
mov dword [edi - 4], ecx
dec edx
mov ecx, dword [ebp - 0x28]
add edi, 4
inc ecx
cmp ecx, edx
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x40]
jl 0x586af0
mov edi, dword [ebp - 4]
shr ebx, 1
mov dword [esi + ecx*4], ebx
mov ebx, dword [ebp - 0xc]
shr eax, 1
mov dword [ebx + ecx*4], eax
mov ecx, dword [ebp - 0x14]
sub ecx, 1
mov dword [ebp - 0x14], ecx
jne 0x586aa0
jmp 0x586b61
mov ebx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
cmp ecx, 0x20
jg 0x586b7c
mov eax, dword [esi]
test eax, eax
je 0x586dab
cmp eax, 1
je 0x586d6a
cmp ecx, dword [ebp - 0x24]
jge 0x586bbb
mov ebx, dword [ebp - 0x30]
mov eax, ecx
mov ecx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x1c]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x2c], ebx
mov ebx, eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x20], esi
mov esi, dword [ebp - 8]
mov ebx, dword [ebx]
mov dword [ebp - 8], ebx
mov ebx, edx
mov edx, dword [eax]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], esi
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], edx
xor edx, edx
test edi, edi
jle 0x586d18
cmp edi, 4
jb 0x586cd0
mov esi, dword [ebp - 0x10]
lea eax, [edi - 1]
sub esi, 4
lea eax, [ebx + eax*4]
lea edi, [esi + edi*4]
mov esi, dword [ebp - 0x18]
cmp ebx, edi
ja 0x586bed
cmp eax, dword [ebp - 0x10]
jae 0x586ccd
mov edi, dword [ebp - 4]
dec edi
lea edi, [esi + edi*4]
cmp ebx, edi
ja 0x586c00
cmp eax, esi
jae 0x586ccd
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 4]
sub ebx, 4
lea esi, [ebx + esi*4]
mov ebx, dword [ebp - 0xc]
cmp ebx, esi
mov esi, dword [ebp - 0x18]
ja 0x586c1f
cmp eax, dword [ebp - 8]
jae 0x586ccd
mov ebx, dword [ebp - 4]
mov ecx, dword [ebp - 0x10]
dec ebx
lea eax, [ecx + ebx*4]
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
cmp esi, eax
ja 0x586c3c
cmp edi, dword [ebp - 0x10]
jae 0x586ccd
mov ebx, dword [ebp - 4]
mov ecx, dword [ebp - 8]
dec ebx
lea eax, [ecx + ebx*4]
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
cmp esi, eax
ja 0x586c5b
mov eax, dword [ebp - 8]
cmp edi, eax
jae 0x586d62
mov ecx, dword [ebp - 4]
mov eax, ecx
and eax, reloc.WS2_32.dll_closesocket
jns 0x586c6c
dec eax
or eax, 0xfffffffc
inc eax
mov ebx, dword [ebp - 8]
mov edi, ecx
sub ebx, esi
sub edi, eax
mov dword [ebp - 0x40], ebx
mov eax, esi
mov ebx, dword [ebp - 0x10]
sub ebx, esi
mov esi, dword [ebp - 0x18]
mov dword [ebp - 0x3c], ebx
mov ebx, dword [ebp - 0xc]
mov dword [ebp - 0x28], ebx
sub dword [ebp - 0x28], esi
mov ebx, dword [ebp - 0x40]
mov esi, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x28]
movups xmm0, xmmword [eax]
add edx, 4
lea eax, [eax + 0x10]
movups xmm1, xmmword [ebx + eax - 0x10]
pxor xmm1, xmm0
movups xmm0, xmmword [ecx + eax - 0x10]
movups xmmword [eax - 0x10], xmm1
movups xmm1, xmmword [esi + eax - 0x10]
pxor xmm1, xmm0
movups xmmword [ecx + eax - 0x10], xmm1
cmp edx, edi
jl 0x586c97
mov esi, dword [ebp - 0x18]
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
mov edi, dword [ebp - 4]
mov eax, dword [ebp - 8]
cmp edx, edi
jge 0x586d18
sub eax, esi
lea ecx, [esi + edx*4]
mov dword [ebp - 0x40], eax
sub ebx, esi
mov eax, dword [ebp - 0x10]
sub eax, esi
mov dword [ebp - 0x38], ebx
mov ebx, dword [ebp - 0x40]
sub edi, edx
mov esi, dword [ebp - 0x38]
mov edx, eax
mov dword [ebp - 0x3c], eax
mov eax, dword [ecx + ebx]
lea ecx, [ecx + 4]
xor dword [ecx - 4], eax
mov eax, dword [ecx + edx - 4]
xor dword [ecx + esi - 4], eax
sub edi, 1
jne 0x586cf6
mov esi, dword [ebp - 0x18]
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
mov edi, dword [ebp - 4]
mov edx, dword [ebp - 0x10]
cmp ecx, dword [ebp - 0x24]
jne 0x586a98
lea eax, [ecx - 1]
cdq
and edx, 0x1f
lea edi, [edx + eax]
sar edi, 5
mov eax, dword [esi + edi*4]
test eax, eax
jne 0x586d45
test edi, edi
je 0x586d45
mov eax, dword [esi + edi*4 - 4]
dec edi
test eax, eax
je 0x586d38
push eax
call fcn.004f6a60
mov edx, dword [ebp - 0x10]
add esp, 4
shl edi, 5
lea ecx, [edi + eax]
mov edi, dword [ebp - 4]
mov dword [ebp - 0x14], ecx
jmp 0x586a98
mov edi, dword [ebp - 4]
jmp 0x586cd3
mov ebx, dword [ebp - 0x20]
push ebx
call fcn.004f6fb0
push ebx
push dword [ebp + 8]
call fcn.004f6640
xor ecx, ecx
add esp, 0xc
test eax, eax
mov edx, 1
cmovne ecx, edx
mov dword [ebp - 0x34], ecx
jmp 0x586dab
push 0x18e
push str.c:_cygwin_home_shachar_zon_new_pkg_lib_openssl_crypto_bn_bn_gf2m.c
push 0x6a
push 0x83
push 3
call fcn.004ace10
add esp, 0x14
pop ebx
push dword [ebp + 0x14]
call fcn.0051f6f0
mov eax, dword [ebp - 0x34]
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret