1. To instantiate the 32-bit emulator is: `emu = pyscemu.init32()`.
2. To instantiate the 64-bit emulator is: `emu = pyscemu.init64()`.
3. Then the maps are specified: `emu.load_maps('/home/sha0/src/scemu/maps32/')`.
- The maps can be downloaded by cloning the git repo: https://github.com/sha0coder/scemu.git
4. After doing init and loading maps, it is possible to load the code, shellcode, or PE32/64 or ELF64 with `emu.load_binary(filename)` or `emu.load_code_bytes(code: bytearray)`.
5. For reading memory, it is possible to do `read_word(addr)`, `read_dword`, `read_qword`, `read_bytes(addr, sz)` and so does for writing, it's little endian.
6. The params can be numbers or buffers allocated with: `buff = emu.alloc("buffer1", 1024)`.
7. You can write on those buffers with `emu.write_dword(buff, 0x11223344)` and `emu.write_buffer(to:addr, from:bytes)`.
8. There are several ways to start emulation, the simpler way is calling a function like: `eax = emu.call32(addr, [123, buff])`. The function parameters are in a Python list.
9. For viewing the instructions `emu.set_verbose(3)`.
10. For single step emulation `emu.step()`.
11. Or controlling the emulation loop: `while emu.step():`.
12. Run forever is `emu.run()` or run until an address is reached `emu.run(addr)`.
13. There are things that can be configured like verbosity, base address, stack address but has to be located in the right place, for example setting the stack address between init and load_maps, and set base address before loading the code.
14. It is possible to spawn a console with `emu.spawn_console()` and `emu.spawn_console_at_pos(33)`. In instruction 33 will be spawned the scemu console, or `emu.spawn_console_at_addr(0x1234)`.
15. If there is an unimplemented API error, the way to solve it is enabling the banzai mode `emu.enable_banazi_mode()`. If the problem persists, put the API on banzai `emu.banzai_add('TheApiName', num_of_parameters)`. The number of parameters can be guessed by consulting the documentation of the API. The emulator, knowing the number of parameters, will be able to continue emulation.
16. For more information, the documentation is available here: https://github.com/sha0coder/pyscemu/blob/main/DOCUMENTATION.md.