Interesting (or maybe not) #emit stuff
Switch branches/tags
Clone or download
Latest commit e5e8256 Nov 21, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Tests compiling again. Jan 6, 2018
windows Include guards. Jan 6, 2018
.gitattributes Create .gitattributes Oct 25, 2018
.gitignore sampctl Jan 6, 2018
README.md Return Usage section Jan 8, 2018
addressof.inc Const-correctness fixes for `addressof` macro. Oct 2, 2018
addressof_jit.inc Most const correctness. Jun 16, 2018
amx.inc Documented x86 assembly. Tiny codescan fix for wildcards. Dec 9, 2016
amx_base.inc Small cleanup Oct 7, 2013
amx_header.inc Don't use binary search on the header - most of it isn't sorted. Oct 2, 2018
amx_jit.inc `ResolveJITAddress`. Oct 29, 2017
amx_memory.inc Correctly return from stack manipulation function with JIT. Oct 29, 2017
asm.inc Most const correctness. Jun 16, 2018
asm_macros.inc All these now correctly generate code: Nov 4, 2017
codescan.inc Hole counts (useful for zeroes). Aug 10, 2018
disasm.inc Most const correctness. Jun 16, 2018
dynamic_call.inc Removing the dependency on a_samp (except in tests). Jan 6, 2018
frame_info.inc Fix mistake in optimisation. Feb 4, 2018
heap_alloc.inc Small cleanup Oct 7, 2013
jit.inc Tests compiling again. Jan 6, 2018
opcode.inc Minor compile errors fixed. Jan 6, 2018
os.inc Small cleanup Oct 7, 2013
pawn.json sampctl Jan 6, 2018
phys_memory.inc phys_memory: Rewrite of refabs() Oct 15, 2013
profiler.inc `#else if` to `#elseif`. Jan 6, 2018
shellcode.inc shellcode: Add missing SHELLCODE_INC define Oct 12, 2013
stack_dump.inc Removing the dependency on a_samp (except in tests). Jan 6, 2018
stack_trace.inc Removing the dependency on a_samp (except in tests). Jan 6, 2018

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.