Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/giteesync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
jobs:
deploy:
runs-on: ubuntu-latest
if: github.repository_owner == 'qilingframework'
steps:
- uses: actions/checkout@v2
with:
Expand Down
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
- danielmoos
- sigeryang
- bet4it
- nullableVoidPtr


#### Legacy Core Developers
Expand Down
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

7 changes: 4 additions & 3 deletions qiling/arch/evm/analysis/signatures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import inspect
from pathlib import Path
import re
import logging
import json
Expand Down Expand Up @@ -92,8 +93,8 @@ def analysis_func_sign(insns:list, engine_num=1):
class signatures_engine_1:
@staticmethod
def find_signature(sign):
path = os.path.split(os.path.realpath(__file__))[0] + '/signatures.json'
with open(path) as data_file:
path = Path(inspect.getfile(inspect.getframe())).parent / 'signatures.json'
with path.open('r') as data_file:
data = json.load(data_file)

list_name = [name for name, hexa in data.items() if hexa == sign]
Expand Down
11 changes: 6 additions & 5 deletions qiling/debugger/gdb/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# documentation: according to https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Protocol.html#Remote-Protocol

import struct, os, socket
import inspect
from pathlib import Path
from binascii import unhexlify
from typing import Iterator, Literal

Expand Down Expand Up @@ -482,14 +484,13 @@ def handle_q(subcmd):
self.send("PacketSize=47ff;QPassSignals+;QProgramSignals+;QStartupWithShell+;QEnvironmentHexEncoded+;QEnvironmentReset+;QEnvironmentUnset+;QSetWorkingDir+;QCatchSyscalls+;qXfer:libraries-svr4:read+;augmented-libraries-svr4-read+;qXfer:auxv:read+;qXfer:siginfo:read+;qXfer:siginfo:write+;qXfer:features:read+;QStartNoAckMode+;qXfer:osdata:read+;multiprocess+;fork-events+;vfork-events+;exec-events+;QNonStop+;QDisableRandomization+;qXfer:threads:read+;ConditionalTracepoints+;TraceStateVariables+;TracepointSource+;DisconnectedTracing+;FastTracepoints+;StaticTracepoints+;InstallInTrace+;qXfer:statictrace:read+;qXfer:traceframe-info:read+;EnableDisableTracepoints+;QTBuffer:size+;tracenz+;ConditionalBreakpoints+;BreakpointCommands+;QAgent+;Qbtrace:bts+;Qbtrace-conf:bts:size+;Qbtrace:pt+;Qbtrace-conf:pt:size+;Qbtrace:off+;qXfer:btrace:read+;qXfer:btrace-conf:read+;swbreak+;hwbreak+;qXfer:exec-file:read+;vContSupported+;QThreadEvents+;no-resumed+")
elif subcmd.startswith('Xfer:features:read'):
xfercmd_file = subcmd.split(':')[3]
xfercmd_abspath = os.path.dirname(os.path.abspath(__file__))
xfercmd_abspath = Path(inspect.getfile(inspect.currentframe())).parent
xml_folder = self.ql.arch.type.name.lower()
xfercmd_file = os.path.join(xfercmd_abspath,"xml",xml_folder, xfercmd_file)
xfercmd_file = xfercmd_abspath / 'xml' / xml_folder / xfercmd_file

if os.path.exists(xfercmd_file) and self.ql.os.type is not QL_OS.WINDOWS:
with open(xfercmd_file, 'r') as f:
if xfercmd_file.exists() and self.ql.os.type is not QL_OS.WINDOWS:
with xfercmd_file.open('r') as f:
file_contents = f.read()
self.send("l%s" % file_contents)
else:
self.ql.log.info("gdb> Platform is not supported by xml or xml file not found: %s\n" % (xfercmd_file))
self.send("l")
Expand Down
8 changes: 4 additions & 4 deletions qiling/os/uefi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import csv
from typing import Mapping
from os import path
import inspect
from pathlib import Path

def __init_guids_db() -> Mapping[str, str]:
"""Initialize GUIDs dictionary from a local database.
"""

csv_path = path.dirname(path.abspath(__file__))
csv_path = path.join(csv_path, 'guids.csv')
csv_path = Path(inspect.getfile(inspect.currentframe())).parent / 'guids.csv'

with open(csv_path) as guids_file:
with csv_path.open('r') as guids_file:
guids_reader = csv.reader(guids_file)

return dict(tuple(entry) for entry in guids_reader)
Expand Down
7 changes: 4 additions & 3 deletions qiling/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"""

from functools import partial
import importlib, os
from pathlib import Path
import importlib, inspect, os

from configparser import ConfigParser
from types import ModuleType
Expand Down Expand Up @@ -415,8 +416,8 @@ def profile_setup(ostype: QL_OS, filename: Optional[str]):
config = {}

else:
qiling_home = os.path.dirname(os.path.abspath(__file__))
os_profile = os.path.join(qiling_home, 'profiles', f'{ostype.name.lower()}.ql')
qiling_home = Path(inspect.getfile(inspect.currentframe())).parent
os_profile = qiling_home / 'profiles' / f'{ostype.name.lower()}.ql'

profiles = [os_profile]

Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@

packages=find_packages(),
scripts=['qltool'],
include_package_data=True,
package_data={
'qiling': ['profiles/*.ql'],
'qiling.debugger.gdb': ['xml/*/*'],
'qiling.os.uefi': ['guids.csv'],
'qiling.arch.evm.analysis': ['signatures.json']
},
install_requires=requirements,
extras_require=extras,
)