Encode ARM64 instruction from Capstone "cs_arm64" structure

Job ID: 36401128

Budget: $250 – $750 USD

Hello,

If you are familiar with Capstone, you can see that it can decode a given instruction into a structure with the detailed information of the instruction.

In particular I'm only interested in arm64 instructions.

I want a function that receives a "cs_arm64" parameter and it generates the encoding of that instruction, that is, do exactly the opposite that Capstone does.

REQUIREMENTS
---------------------------

1) We will only handle general instructions (common Xn, Wn), not floating point or vector. So, you don't have to process the whole instruction set

2) You cannot use an external library (like Keystone or LLVM, etc). You cannot make memory allocations or external calls. That is, basic transformation with possible encoding table or what you want. To give you an idea, refer to the attached example which tries to encode an "add" instruction from a "cs_arm64" structure. It was generated with ChatGPT so don't expect to be perfect.

The main point in my attached example is that you can see that no external library or Windows calls are required, just plain "math"

3) The solution must be implemented in C or C++ with Visual Studio (I'm using VS 2022)

If you have any questions, feel free to ask.

Thanks!
Related categories: Assembly x86/x64 Assembler