title: exe file made with pyinstaller being reported as a virus threat by windows defender
body: <p>I'm trying to create an exe using pyinstaller for a school project but, windows defender seems to report a virus threat and blocks the file. I want to send this exe to some other people but i wouldn't be able to do that unless I fix this. So these are my queries- <strong>Why does the exe file get reported as a virus?</strong> A quick scan on virus total says that <a href="https://www.virustotal.com/gui/file/66f2c59bc52722ed36b72d3da3fb12e59dfef1d6b16a3e2a9e9be17447bb4959/detection" rel="noreferrer">16 engines detect this file as a Trojan</a>. Also, <strong>is there any way to prevent windows defender or any other antivirus from alerting users of a virus threat</strong> , I mean, is there any way to make my file look safe to antiviruses in case it was just a false threat? And in case that is not possible, <strong>what are the other safe alternatives to pyinstaller?</strong> I'm just a beginner so any tips would be really appreciated. Thanks.</p>
  <p><strong>EDIT:</strong> as requested by @Pro Chess, ive included my script.</p>
  <pre><code>import socket 
  import threading
  import pickle
  
  class Server :
      def __init__(self) :
          self.HEADER = 64
          self.PORT = 5050
          self.SERVER =  socket.gethostbyname(socket.gethostname())
          self.ADDR = (self.SERVER, self.PORT)
          self.FORMAT = 'utf-8'
          self.DISCONNECT_MESSAGE = &quot;!DISCONNECT&quot;
  
          self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          self.server.bind(self.ADDR)
          self.save_dict = {}
  
      def file_access(self) :
          with open(&quot;project_data\\savedata.dat&quot;,&quot;rb&quot;) as save_file :
              save_dict = pickle.load(save_file)
              return save_dict
  
      def file_dump(self) :
          with open(&quot;project_data\\savedata.dat&quot;,&quot;wb&quot;) as save_file :
              pickle.dump(self.save_dict,save_file)
  
      def recieve(self,conn) :
          msg_length = conn.recv(self.HEADER).decode(self.FORMAT)
          if msg_length:
              msg_length = int(msg_length)
              msg = conn.recv(msg_length).decode(self.FORMAT)
              return msg
  
      def handle_client(self,conn, addr):
          print(f&quot;[NEW CONNECTION] {addr} connected.&quot;)
  
          connected = True
          while connected:
              try :
                  self.save_dict = self.file_access()
                  msg = self.recieve(conn)
                  if msg == self.DISCONNECT_MESSAGE:
                      connected = False
                  elif msg == &quot;Save Data&quot; :
                      player_id = conn.recv(5000)
                      try :
                          name,code = pickle.loads(player_id)
                      except EOFError :
                          pass
                      if (name,code) not in self.save_dict :
                          conn.send(&quot;Available&quot;.encode(self.FORMAT))
                          msg1 = self.recieve(conn)
                          if msg1 == &quot;Game Data&quot; :
                              game_data = conn.recv(5000)
                              #msg = pickle.loads(msg_data)
                              self.save_dict[(name,code)] = game_data
                              print(self.save_dict)
                              conn.send(&quot;Success&quot;.encode(self.FORMAT))
                      else :
                          conn.send(&quot;Exists&quot;.encode(self.FORMAT))
                          msg1 = self.recieve(conn)
                          if msg1 == &quot;Game Data&quot; :
                              game_data = conn.recv(5000)
                              self.save_dict[(name,code)] = game_data
                              conn.send(&quot;Success&quot;.encode(self.FORMAT))
                  elif msg == &quot;Wipe&quot; :
                      self.save_dict.pop((name,code))
                      print(f&quot;new dict is &quot;,self.save_dict)
                  elif msg == &quot;Load&quot; :
                      player_id = conn.recv(5000)
                      try :
                          name,code = pickle.loads(player_id)
                      except EOFError :
                          pass
                      if (name,code) in self.save_dict :
                          conn.send(&quot;Present&quot;.encode(self.FORMAT))
                          conn.send(self.save_dict[(name,code)])
                      else :
                          conn.send(&quot;Absent&quot;.encode(self.FORMAT))
                  elif msg == &quot;Check Data&quot; :
                      player_id = conn.recv(5000)
                      try :
                          name,code = pickle.loads(player_id)
                      except EOFError :
                          pass
                      if (name,code) in self.save_dict :
                          conn.send(&quot;Exists&quot;.encode(self.FORMAT))
                      else :
                          conn.send(&quot;New&quot;.encode(self.FORMAT))
                  self.file_dump()
              except ConnectionResetError :
                  connected = False
  
          conn.close()
          print(f&quot;[Terminated] connection terminated for {addr}&quot;)
              
  
      def start(self):
          self.server.listen()
          print(f&quot;[LISTENING] Server is listening on {self.SERVER}&quot;)
          while True:
              conn, addr = self.server.accept()
              thread = threading.Thread(target=self.handle_client, args=(conn, addr))
              thread.start()
              print(f&quot;[ACTIVE CONNECTIONS] {threading.activeCount() - 1}&quot;)
  
  
  print(&quot;[STARTING] server is starting...&quot;)
  server = Server()
  server.start()
  
  </code></pre>
  <p>Ive used the socket package to run a server on my local network.</p>