samp@phazer 7ca5050e5d init 2 vuotta sitten
..
test 7ca5050e5d init 2 vuotta sitten
windows 7ca5050e5d init 2 vuotta sitten
.gitattributes 7ca5050e5d init 2 vuotta sitten
.gitignore 7ca5050e5d init 2 vuotta sitten
README.md 7ca5050e5d init 2 vuotta sitten
addressof.inc 7ca5050e5d init 2 vuotta sitten
addressof_jit.inc 7ca5050e5d init 2 vuotta sitten
amx.inc 7ca5050e5d init 2 vuotta sitten
amx_base.inc 7ca5050e5d init 2 vuotta sitten
amx_header.inc 7ca5050e5d init 2 vuotta sitten
amx_jit.inc 7ca5050e5d init 2 vuotta sitten
amx_memory.inc 7ca5050e5d init 2 vuotta sitten
asm.inc 7ca5050e5d init 2 vuotta sitten
asm_macros.inc 7ca5050e5d init 2 vuotta sitten
codescan.inc 7ca5050e5d init 2 vuotta sitten
disasm.inc 7ca5050e5d init 2 vuotta sitten
dynamic_call.inc 7ca5050e5d init 2 vuotta sitten
frame_info.inc 7ca5050e5d init 2 vuotta sitten
heap_alloc.inc 7ca5050e5d init 2 vuotta sitten
jit.inc 7ca5050e5d init 2 vuotta sitten
opcode.inc 7ca5050e5d init 2 vuotta sitten
os.inc 7ca5050e5d init 2 vuotta sitten
pawn.json 7ca5050e5d init 2 vuotta sitten
phys_memory.inc 7ca5050e5d init 2 vuotta sitten
profiler.inc 7ca5050e5d init 2 vuotta sitten
shellcode.inc 7ca5050e5d init 2 vuotta sitten
stack_dump.inc 7ca5050e5d init 2 vuotta sitten
stack_trace.inc 7ca5050e5d init 2 vuotta sitten

README.md

Overview

  • amx.inc - Read/write contents of the AMX strcture (AMX struct in C code).
  • amx_base.inc - Get base address of the AMX in memory (amx->base).
  • amx_header.inc - Read contents of the AMX header (AMX_HEADER) and query header tables such as publics, natives, tags, etc.
  • amx_memory.inc - Read/write contents of variables using their AMX address (kind of like pointers in C).
  • codescan.inc - Find patterns in bytecode.
  • disasm.inc - Example of how to disassemble AMX bytecode (i.e. self-disassembly).
  • dynamic_call.inc - Call any function by address or index. Can be very powerful in combination with amx_header.inc.
  • frame_info.inc - Get information about call frames from the stack.
  • heap_alloc.inc - Allocate memory on the AMX heap.
  • jit.inc - Check if running under the JIT plugin.
  • opcode.inc - List of AMX opcodes and utility functions for (un-)relocating opcodes on Linux.
  • os.inc - Detect operating system (Windows vs Linux).
  • phys_memory.inc - Read/write memory of the host process (outside of AMX data).
  • profile.inc - Simple profiler written purely in Pawn. It can measure execution time of public functions.
  • shellcode.inc - Execute arbitrary native code (doesn't work on Linux).
  • stack_dump.inc - Print stack contents to the console.
  • stack_trace.inc - Print stack trace.
  • windows/import_table.inc - Read the PE import table of the host process.
  • 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:

sampctl package install amx_assembly

Include in your code and begin using the library:

#include <amx_assembly\include_name_here>

Usage

There are a few example scripts in the test directory that show how to use some of these includes.