Install & Compatibility
Where this runs
tested against v0.8.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 68.1MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 5.3s · import 0.000s · 69MB
70MB installed
● package 70MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
API
✓ from viv_utils import API
✗ from viv_utils.api import from_vivisect
This quickstart demonstrates how to initialize `viv-utils` with a `vivisect` workspace (using a minimal mock for runnable example) and iterate through functions, accessing their basic properties. In a real scenario, `vw` would be a fully loaded and analyzed `vivisect.VivWorkspace` object.
import viv_utils.api as viv_api
from unittest.mock import MagicMock
# --- Start Minimal Mock for Demonstrative vivisect Workspace ---
# In a real scenario, 'vw' would be an actual vivisect.VivWorkspace
# loaded with a binary and analyzed (e.g., vw.loadFromFile("path/to/binary"); vw.analyze()).
class MockVivWorkspace:
def __init__(self):
self.arch = "amd64" # Required by viv_utils
self._functions = {
0x1000: {"name": "entry_point", "blocks_count": 3},
0x1050: {"name": "utility_func", "blocks_count": 2},
}
def getMetaInfo(self, key, default=None):
# viv_utils queries meta info, e.g., 'Platform'
return {"Platform": "windows"}.get(key, default)
def getFunctions(self):
return list(self._functions.keys())
def getFunction(self, va):
if va not in self._functions:
return None
# viv_utils expects specific attributes on the function object
func_data = self._functions[va]
mock_func = MagicMock()
mock_func.va = va
mock_func.name = func_data["name"]
mock_func.basic_blocks = [MagicMock() for _ in range(func_data["blocks_count"])] # Simulate basic blocks
mock_func.getBasicBlocks.return_value = {0x1000: (0x10, 5)} # dummy for internal access if needed
return mock_func
def getComments(self, va): return None # Often queried
def getCodeBlocks(self): return [] # Often queried
def getVivTaint(self): return MagicMock() # For emulator, though not used in this quickstart
vw = MockVivWorkspace()
# --- End Minimal Mock ---
# Wrap the mock vivisect workspace with viv-utils API
utils_workspace = viv_api.from_vivisect(vw)
print("Listing functions from the viv-utils wrapped workspace:")
for func in utils_workspace.get_functions():
print(f" Function VA: {hex(func.va)}, Name: '{func.name}', Basic Blocks: {len(func.basic_blocks)}")
# Example: Access a specific function by VA
target_va = 0x1050
target_func = utils_workspace.get_function(target_va)
if target_func:
print(f"\nDetails for function '{target_func.name}' at {hex(target_func.va)}:")
print(f" Number of basic blocks: {len(target_func.basic_blocks)}")
else:
print(f"\nFunction at {hex(target_va)} not found.")
Upgrade
Version history
0.8.1latest on PyPI · released Oct 1, 2025
Audit
Dependencies
vivisect_v8requiredCore dependency for vivisect workspace interaction (pip installable since v0.8.0 of viv-utils)
mnemonistrequiredUsed for various data structures and memoization
tqdmrequiredProvides progress bars for long-running operations