Generate ASM hook at a specific ROM address. More...
#include <code_gen_tool.h>


Public Member Functions | |
| std::string | GetName () const override |
| Get the command name. | |
| std::string | GetDescription () const |
| std::string | GetUsage () const override |
| Get the command usage string. | |
Public Member Functions inherited from yaze::cli::resources::CommandHandler | |
| virtual | ~CommandHandler ()=default |
| absl::Status | Run (const std::vector< std::string > &args, Rom *rom_context, std::string *captured_output=nullptr) |
| Execute the command. | |
| virtual Descriptor | Describe () const |
| Provide metadata for TUI/help summaries. | |
| virtual bool | RequiresLabels () const |
| Check if the command requires ROM labels. | |
| virtual void | SetProjectContext (project::YazeProject *project) |
| Set the YazeProject context. Default implementation does nothing, override if tool needs project info. | |
| virtual void | SetAsarWrapper (core::AsarWrapper *asar_wrapper) |
| Set the AsarWrapper context. Default implementation does nothing, override if tool needs Asar access. | |
| virtual void | SetRomContext (Rom *rom) |
| Set the ROM context for tools that need ROM access. Default implementation stores the ROM pointer for subclass use. | |
Protected Member Functions | |
| absl::Status | ValidateArgs (const resources::ArgumentParser &parser) override |
| Validate command arguments. | |
| absl::Status | Execute (Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override |
| Execute the command business logic. | |
| bool | RequiresRom () const override |
| Check if the command requires a loaded ROM. | |
Protected Member Functions inherited from yaze::cli::agent::tools::CodeGenToolBase | |
| absl::Status | ValidateHookAddress (Rom *rom, uint32_t address) const |
| Validate that an address is safe for hooking. | |
| std::vector< FreeSpaceRegion > | DetectFreeSpace (Rom *rom, size_t min_size=0x100) const |
| Detect available free space regions in ROM. | |
| std::string | SubstitutePlaceholders (const std::string &template_code, const std::map< std::string, std::string > ¶ms) const |
| Substitute placeholders in template with parameter values. | |
| absl::StatusOr< AsmTemplate > | GetTemplate (const std::string &name) const |
| Get a built-in ASM template by name. | |
| const std::vector< AsmTemplate > & | GetAllTemplates () const |
| Get all available built-in templates. | |
| std::string | FormatResultAsJson (const CodeGenerationResult &result) const |
| Format code generation result as JSON. | |
| std::string | FormatResultAsText (const CodeGenerationResult &result) const |
| Format code generation result as text. | |
| bool | IsKnownHookLocation (uint32_t address) const |
| Check if an address is within a known safe hook location. | |
| std::string | GetHookLocationDescription (uint32_t address) const |
| Get description of a known hook location. | |
Protected Member Functions inherited from yaze::cli::resources::CommandHandler | |
| virtual std::string | GetDefaultFormat () const |
| Get the default output format ("json" or "text") | |
| virtual std::string | GetOutputTitle () const |
| Get the output title for formatting. | |
Additional Inherited Members | |
Protected Attributes inherited from yaze::cli::resources::CommandHandler | |
| Rom * | rom_ = nullptr |
| project::YazeProject * | project_ = nullptr |
| core::AsarWrapper * | asar_wrapper_ = nullptr |
Generate ASM hook at a specific ROM address.
Creates a JSL hook at the specified address that jumps to new code in freespace. Validates that the address is safe for hooking.
Usage: codegen-asm-hook –address=0x008040 –label=MyHook [–nop-fill=N] [–format=<json|text>]
Definition at line 173 of file code_gen_tool.h.
|
inlineoverridevirtual |
Get the command name.
Override this to provide a unique identifier for the command. This is used for command registration and lookup.
Implements yaze::cli::resources::CommandHandler.
Definition at line 175 of file code_gen_tool.h.
|
inline |
Definition at line 177 of file code_gen_tool.h.
|
inlineoverridevirtual |
Get the command usage string.
Implements yaze::cli::resources::CommandHandler.
Definition at line 181 of file code_gen_tool.h.
|
inlineoverrideprotectedvirtual |
Validate command arguments.
Override this to check required arguments and perform custom validation. Called before Execute().
Implements yaze::cli::resources::CommandHandler.
Definition at line 186 of file code_gen_tool.h.
References yaze::cli::resources::ArgumentParser::RequireArgs().

|
overrideprotectedvirtual |
Execute the command business logic.
Override this to implement command-specific functionality. The ROM is guaranteed to be loaded and labels initialized.
Implements yaze::cli::resources::CommandHandler.
Definition at line 332 of file code_gen_tool.cc.
|
inlineoverrideprotectedvirtual |
Check if the command requires a loaded ROM.
Override to return false if ROM is not needed (e.g., filesystem tools).
Reimplemented from yaze::cli::resources::CommandHandler.
Definition at line 193 of file code_gen_tool.h.