🇻🇳 Nếu bạn là người Việt Nam, vui lòng chuyển sang Guide.vi.md để xem hướng dẫn bằng tiếng Việt.
Use comments to annotate your code. RAC supports both single-line and multi-line comments.
# This is a single-line comment
/*
This is a multi-line
comment block
*/
Set the base address for code mapping.
org 0xe9e0
Define a label for jumps or references.
lbl start
call 0x1234
goto end
lbl end
Insert raw hexadecimal data or reversed hex data.
0x1234ABCD
hex CD AB 34 12
Call an address or built-in function, or jump to a label.
call 0x5678
call line_print
goto label
Get the address of a label (optionally with offset).
adr(main)
eval(adr(loop) + 0x4)
Insert the current program length at this point.
pr_length
Insert strings with variable expansion using curly braces {}.
var ten = "World"
"Xin~chào,~{ten}!"
Note: Use ~ to replace in strings.
Define reusable code blocks and call them with arguments.
func greet(person) {
"Hello,~{person}!"
}
greet("Alice")
greet("Bob")
Evaluate math or address expressions at compile time.
eval(0x1 + 0x2 * 0x3)
eval(adr(label1) - adr(label2))
# We can use calc() instead of eval() because they have the same function.
Define variables (int, hex, string) and assign values to registers.
var count = 10
var hexval = 0x1A2B
var message = "Test"
reg r1 = 0x5
r2 = 0xFF
The way to call a variable is varname, and the same applies to strings.
Combine multiple statements in one line using ;.
call 0x1234 ; goto end
Use key constants for fx580vnx (see labels.txt for full list).
KEY_SHIFT
KEY_1
KEY_ADD
Define a Python function, then call and use it.
org 0xe9e0
def check_even_odd(n) {
if n%2==0{
return 0x1 # Even
} else {
return 0x0 # Odd
}
}
py.check_even_odd(0x2)
py.check_even_odd(0x3)
Repeat a block of code a fixed number of times at compile time.
loop 4 {
0x67
}
hex 00 00
Search for suitable gadgets.
find_gadgets {
mov er{a[1]}, er{b[1]}
pop pc
}
Use {var} to specify a hypothetical variable with a value from 0 to 15, {var[1]} to specify a hypothetical variable from 0 to 9.
Sections allow you to divide a file into multiple independent areas.
@set.main
org 0xe9e0
hex 30 30 30 30
@set.launcher
org 0xd180
xr0 = hex 30 30 30 30
[
0x1
0x2
]
[0x1; 0x2]
'sin( 90 )'
You can define new syntax and macros via extensions.txt.
Example extension syntax:
---syntax---
print {msg}
---logic---
print(msg)
---output---
call print
org 0xe9e0
var name = "Nick"
lbl main
"Hello,~{name}!"
Written by: luongvantam