Skip to main content

Python bindings to XbSymbolDatabase

Project description

PyXbSymbolDatabase CI Status

Python bindings to the Xbox Symbol Database. Useful for scanning Xbox Executables (XBEs) for known XDK symbols using pattern matching.

Install

You will need CMake and a compiler installed in order to build. Then install using PIP:

python3 -m pip install --user git+https://github.com/mborgerson/PyXbSymbolDatabase

Example Usage

As a command-line tool

Invoke the module with a path to an XBE file to scan the XBE for any known symbols.

$ python -m XbSymbolDatabase default.xbe
    D3D8    0    1 00192390 D3DDEVICE
    D3D8    0    1 0018f57c D3DRS_CULLMODE
    D3D8    0    1 0018f4c8 D3DDeferredRenderState
    D3D8    0    1 0018f180 D3DDeferredTextureState
    D3D8    0    1 0018f5c0 g_Stream
  DSOUND 3911    8 001946ea CDirectSoundStream_Constructor
  DSOUND 3911    8 00194358 CDirectSoundStream_AddRef
  DSOUND 3911    8 00194368 CDirectSoundStream_Release
  DSOUND 3911    8 001937aa CDirectSoundStream_GetInfo
  DSOUND 3911    8 0019384f CDirectSoundStream_GetStatus
  DSOUND 3911    8 00193884 CDirectSoundStream_Process
  DSOUND 3911    8 001937f5 CDirectSoundStream_Discontinuity
  DSOUND 3911    8 00193822 CDirectSoundStream_Flush
 XAPILIB 3911   40 00012d01 CreateMutex
 XAPILIB 3911   40 00012be3 CreateThread
 XAPILIB 3911   40 00014d39 MoveFileA
 XAPILIB 3911   40 00012aa3 SwitchToThread
 XAPILIB 3911   40 00015ba5 XCalculateSignatureBegin
 XAPILIB 3911   40 00018b0c XapiBootDash
 XAPILIB 3911   40 00018b71 XapiInitProcess
[...]

As a library

Import the XbSymbolScan function from the XbSymbolDatabase module and give it your XBE data.

#!/usr/bin/env python
import argparse
from XbSymbolDatabase import XbSymbolScan

def main():
	p = argparse.ArgumentParser()
	p.add_argument('xbefile')
	args = p.parse_args()

	with open(args.xbefile, 'rb') as f:
		xbe = f.read()
		for lib, flags, sym, addr, ver in XbSymbolScan(xbe):
			print('%8s %4d %4x %08x %s' % (
				str(lib, encoding='ascii'), ver, flags, addr,
				str(sym, encoding='ascii')))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyXbSymbolDatabase-0.0.1.tar.gz (1.5 MB view details)

Uploaded Source

File details

Details for the file PyXbSymbolDatabase-0.0.1.tar.gz.

File metadata

  • Download URL: PyXbSymbolDatabase-0.0.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.8

File hashes

Hashes for PyXbSymbolDatabase-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0739ac96c08826b23d8696f9b499c57be42ef498f2f4328be81052f42403fd7b
MD5 06691e4075b3206aa1f0a1302fbdb90e
BLAKE2b-256 1c51dc7d80525f52aa5b403e1c32650461543b3d0f40bcdeca2105eefb01574f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page