From a0181651c332a9f9fa586dfb10f628eea16a8428 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 20 Jan 2022 16:02:21 -0500 Subject: Move generator fake architecture into core --- python/generator.cpp | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) (limited to 'python') diff --git a/python/generator.cpp b/python/generator.cpp index 2f277cd8..135bc958 100644 --- a/python/generator.cpp +++ b/python/generator.cpp @@ -26,35 +26,6 @@ using namespace BinaryNinja; using namespace std; -class GeneratorArchitecture: public Architecture -{ -public: - GeneratorArchitecture(): Architecture("generator") - { - } - - virtual bool GetInstructionInfo(const uint8_t*, uint64_t, size_t, InstructionInfo&) override - { - return false; - } - - virtual bool GetInstructionText(const uint8_t*, uint64_t, size_t&, vector&) override - { - return false; - } - - virtual BNEndianness GetEndianness() const override - { - return LittleEndian; - } - - virtual size_t GetAddressSize() const override - { - return 8; - } -}; - - map g_pythonKeywordReplacements = { {"False", "False_"}, {"True", "True_"}, @@ -264,18 +235,10 @@ int main(int argc, char* argv[]) return 1; } - Architecture::Register(new GeneratorArchitecture()); - // Parse API header to get type and function information map> types, vars, funcs; string errors; - auto arch = Architecture::GetByName("generator"); - if (!arch) - { - printf("ERROR: License file validation failed (most likely)\n"); - return 1; - } - + auto arch = new CoreArchitecture(BNGetNativeTypeParserArchitecture()); bool ok = arch->GetStandalonePlatform()->ParseTypesFromSourceFile(argv[1], types, vars, funcs, errors); fprintf(stderr, "Errors: %s\n", errors.c_str()); if (!ok) -- cgit v1.3.1