mirror of
https://github.com/siemens-mobile-hacks/ptr89.git
synced 2026-11-26 02:37:25 +00:00
BREAKING CHANGE: CLI JSON and TypeScript search/xref result structures now expose resolved addresses, source offsets, and bytes separately.
32 lines
916 B
C++
32 lines
916 B
C++
#include <emscripten/bind.h>
|
|
|
|
#include "Ptr89Wasm.h"
|
|
|
|
using namespace emscripten;
|
|
using namespace Ptr89;
|
|
|
|
EMSCRIPTEN_BINDINGS(ptr89) {
|
|
value_object<Ptr89SearchResult>("Ptr89SearchResult")
|
|
.field("address", &Ptr89SearchResult::address)
|
|
.field("offset", &Ptr89SearchResult::offset)
|
|
.field("bytes", &Ptr89SearchResult::bytes);
|
|
|
|
value_object<Ptr89XRef>("Ptr89XRef")
|
|
.field("type", &Ptr89XRef::type)
|
|
.field("xref", &Ptr89XRef::xref)
|
|
.field("offset", &Ptr89XRef::offset)
|
|
.field("bytes", &Ptr89XRef::bytes);
|
|
|
|
register_vector<Ptr89SearchResult>("Ptr89SearchResults");
|
|
register_vector<Ptr89XRef>("Ptr89XRefs");
|
|
|
|
class_<Ptr89Wasm>("Ptr89")
|
|
.constructor<>()
|
|
.function("open", &Ptr89Wasm::open)
|
|
.function("close", &Ptr89Wasm::close)
|
|
.function("setDebug", &Ptr89Wasm::setDebug)
|
|
.function("find", &Ptr89Wasm::find)
|
|
.function("findXRefs", &Ptr89Wasm::findXRefs);
|
|
|
|
function("prettify", &prettify);
|
|
}
|