AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/magic/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/magic/loader.py
from ctypes.util import find_library
import ctypes
import sys
import glob
import os.path

def _lib_candidates():

  yield find_library('magic')

  if sys.platform == 'darwin':

    paths = [
      '/opt/local/lib',
      '/usr/local/lib',
      '/opt/homebrew/lib',
    ] + glob.glob('/usr/local/Cellar/libmagic/*/lib')

    for i in paths:
      yield os.path.join(i, 'libmagic.dylib')

  elif sys.platform in ('win32', 'cygwin'):

    prefixes = ['libmagic', 'magic1', 'cygmagic-1', 'libmagic-1', 'msys-magic-1']

    for i in prefixes:
      # find_library searches in %PATH% but not the current directory,
      # so look for both
      yield './%s.dll' % (i,)
      yield find_library(i)

  elif sys.platform == 'linux':
    # This is necessary because alpine is bad
    yield 'libmagic.so.1'


def load_lib():

  for lib in _lib_candidates():
    # find_library returns None when lib not found
    if lib is None:
      continue
    try:
      return ctypes.CDLL(lib)
    except OSError:
      pass
  else:
    # It is better to raise an ImportError since we are importing magic module
    raise ImportError('failed to find libmagic.  Check your installation')


Anon7 - 2022
AnonSec Team