https://github.com/pawn-lang/amx_assembly
Interesting #emit stuff
https://github.com/pawn-lang/amx_assembly
amx assembly pawn pawn-package sa-mp
Last synced: 29 days ago
JSON representation
Interesting #emit stuff
- Host: GitHub
- URL: https://github.com/pawn-lang/amx_assembly
- Owner: pawn-lang
- Created: 2012-01-30T15:14:38.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2023-11-08T15:36:55.000Z (over 1 year ago)
- Last Synced: 2025-04-07T02:06:27.322Z (about 2 months ago)
- Topics: amx, assembly, pawn, pawn-package, sa-mp
- Language: Pawn
- Homepage:
- Size: 859 KB
- Stars: 59
- Watchers: 10
- Forks: 14
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Overview
* [`addressof.inc`](addressof.inc) - Provide `addressof` to get the compiled address of a function, plus runtime compilation to a simple constant, and a lightweight version with no *disasm* dependency.
* [`amx.inc`](amx.inc) - Read/write contents of the AMX structure (`AMX` struct in C code).
* [`amx_base.inc`](amx_base.inc) - Get base address of the AMX in memory (`amx->base`).
* [`amx_header.inc`](amx_header.inc) - Read contents of the AMX header (`AMX_HEADER`) and query header tables such as publics, natives, tags, etc.
* [`amx_memory.inc`](amx_memory.inc) - Read/write contents of variables using their AMX address (kind of like pointers in C).
* [`asm.inc`](asm.inc) - `@emit()` for generating new assembly at runtime, similar to what `#emit` and `__emit` are for compile-time.
* [`codescan.inc`](codescan.inc) - Find patterns in bytecode.
* [`disasm.inc`](disasm.inc) - Example of how to disassemble AMX bytecode (i.e. self-disassembly).
* [`dynamic_call.inc`](dynamic_call.inc) - Call any function by address or index. Can be very powerful in combination with [`amx_header.inc`](amx_header.inc).
* [`frame_info.inc`](frame_info.inc) - Get information about call frames from the stack.
* [`heap_alloc.inc`](heap_alloc.inc) - Allocate memory on the AMX heap.
* [`jit.inc`](jit.inc) - Check if running under the [JIT](https://github.com/Zeex/samp-plugin-jit) plugin.
* [`opcode.inc`](opcode.inc) - List of AMX opcodes and utility functions for (un-)relocating opcodes on Linux.
* [`os.inc`](os.inc) - Detect operating system (Windows vs Linux).
* [`phys_memory.inc`](phys_memory.inc) - Read/write memory of the host process (outside of AMX data).
* [`profiler.inc`](profile.inc) - Simple profiler written purely in Pawn. It can measure execution time of public functions.
* [`shellcode.inc`](shellcode.inc) - Execute arbitrary native code (doesn't work on Linux).
* [`stack_dump.inc`](stack_dump.inc) - Print stack contents to the console.
* [`stack_trace.inc`](stack_trace.inc) - Print stack trace.
* [`windows/import_table.inc`](windows/import_table.inc) - Read the PE import table of the host process.
* [`windows/ShellExecute.inc`](windows/ShellExecute.inc) - How to use `shellcode` and `import_table` to call a Win32 API function (in this case `ShellExecuteA`).## Installation
Simply install to your project:
```bash
sampctl package install amx_assembly
```Include in your code and begin using the library:
```pawn
#include
```## Usage
There are a few example scripts in the `test` directory that show how to use some of these includes.