Function at 0x5311a0
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.004ca2d0
push edi
call fcn.004ca080
push edi
mov dword [ebp - 0x20], eax
call fcn.004ca080
push edi
mov dword [ebp - 0x1c], eax
call fcn.004ca080
mov esi, eax
push edi
mov dword [ebp - 0x2c], esi
call fcn.004ca080
mov edi, eax
add esp, 0x14
mov dword [ebp - 0x30], edi
test edi, edi
je 0x53161c
push ebx
mov ebx, dword [ebp + 0x10]
lea eax, [ebp - 0x58]
push 6
push eax
push ebx
call fcn.00531ec0
add esp, 0xc
test eax, eax
je 0x531600
cmp eax, 6
jg 0x531600
lea eax, [ebp - 0x58]
push eax
push dword [ebp + 0xc]
push esi
call fcn.00530d60
add esp, 0xc
test eax, eax
je 0x53161b
push esi
call fcn.004a1140
add esp, 4
test eax, eax
jne 0x53161b
push ebx
push edi
call fcn.004a0eb0
add esp, 8
test eax, eax
je 0x53161b
push esi
call fcn.004a1220
push edi
mov dword [ebp - 0x14], eax
call fcn.004a1220
mov edi, dword [ebx + 4]
push edi
push esi
mov dword [ebp - 0x24], eax
mov dword [ebp - 4], edi
call fcn.004a19a0
add esp, 0x10
test eax, eax
je 0x53161b
mov edx, dword [ebp - 0x2c]
mov esi, dword [esi]
mov dword [ebp - 0x18], esi
mov eax, dword [edx + 4]
cmp eax, edi
jge 0x531292
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.004a19a0
add esp, 8
test eax, eax
je 0x53161b
mov edx, dword [ebp - 0x20]
mov ebx, dword [edx]
mov dword [ebp - 0xc], ebx
mov dword [ebx], 1
cmp edi, 1
jle 0x5312c9
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.004a19a0
add esp, 8
test eax, eax
je 0x53161b
mov eax, dword [ebp - 0x1c]
mov edx, dword [eax]
mov dword [ebp - 0x10], edx
test edi, edi
jle 0x5312fa
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 0x5313d4
mov ebx, dword [esi]
test bl, 1
jne 0x5313ce
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 0x5313b0
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 0x531360
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 0x531310
jmp 0x5313d1
mov ebx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
cmp ecx, 0x20
jg 0x5313ec
mov eax, dword [esi]
test eax, eax
je 0x53161b
cmp eax, 1
je 0x5315da
cmp ecx, dword [ebp - 0x24]
jge 0x53142b
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 0x531588
cmp edi, 4
jb 0x531540
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 0x53145d
cmp eax, dword [ebp - 0x10]
jae 0x53153d
mov edi, dword [ebp - 4]
dec edi
lea edi, [esi + edi*4]
cmp ebx, edi
ja 0x531470
cmp eax, esi
jae 0x53153d
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 0x53148f
cmp eax, dword [ebp - 8]
jae 0x53153d
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 0x5314ac
cmp edi, dword [ebp - 0x10]
jae 0x53153d
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 0x5314cb
mov eax, dword [ebp - 8]
cmp edi, eax
jae 0x5315d2
mov ecx, dword [ebp - 4]
mov eax, ecx
and eax, reloc.WS2_32.dll_closesocket
jns 0x5314dc
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 0x531507
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 0x531588
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 0x531566
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 0x531308
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 0x5315b5
test edi, edi
je 0x5315b5
mov eax, dword [esi + edi*4 - 4]
dec edi
test eax, eax
je 0x5315a8
push eax
call fcn.004a12d0
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 0x531308
mov edi, dword [ebp - 4]
jmp 0x531543
mov ebx, dword [ebp - 0x20]
push ebx
call fcn.004a1820
push ebx
push dword [ebp + 8]
call fcn.004a0eb0
xor ecx, ecx
add esp, 0xc
test eax, eax
mov edx, 1
cmovne ecx, edx
mov dword [ebp - 0x34], ecx
jmp 0x53161b
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.004576a0
add esp, 0x14
pop ebx
push dword [ebp + 0x14]
call fcn.004c9f80
mov eax, dword [ebp - 0x34]
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret