Invalid opcodes in rectavoider.svc16 #13

Closed
opened 2025-04-09 15:00:07 +00:00 by tcsenpai · 0 comments
Owner

Originally created by @xyloflake on 12/19/2024

Hello, cool repo you've got here :)

I have created a simple disassembler that just reads bytes from the svc16 file as an Vec<u8> buffer and then converts them to an Vec<u16> containing the instructions while using from_le_bytes.

I then iterate through the u16 vec taking 4 values at a time. Then map through them and I have an array [String; 0x10] called op_codes that basically has the opcodes listed in the readme file in order. The disassembler then matches the 1st out of the 4 values to the op_codes and replaces them with the string version of the opcode (for example 0 gets replaced with "Set").

The disassembler works fine with all_colors.svc16 but throws invalid opcode when disassembling rectavoider.svc16. Upon further inspection, I found out that the file has invalid opcodes, the first occurence of which occurs at line 4711 after executing

hexyl rectavoider.svc16 -pv --panels 1 > hex.txt

The result is:
Screenshot_20241219-132803-1.jpg

The opcode observed is c8 00 in hex which translates to 200 in decimal. From my understanding, there is no opcode beyond 16(?).

On further inspection, dozens of such invalid opcodes were observed.

Is there anything I'm missing out on or doing wrong?

I obviously have executed rectavoider.svc16 with svc16 and the game works as expected.

Any help is much appreciated and thanks for creating this amazing repo!

*Originally created by @xyloflake on 12/19/2024* Hello, cool repo you've got here :) I have created a simple disassembler that just reads bytes from the svc16 file as an `Vec<u8>` buffer and then converts them to an `Vec<u16>` containing the instructions while using `from_le_bytes`. I then iterate through the u16 vec taking 4 values at a time. Then map through them and I have an array [String; 0x10] called op_codes that basically has the opcodes listed in the readme file in order. The disassembler then matches the 1st out of the 4 values to the op_codes and replaces them with the string version of the opcode (for example 0 gets replaced with "Set"). The disassembler works fine with `all_colors.svc16` but **throws invalid opcode when disassembling `rectavoider.svc16`**. Upon further inspection, I found out that **the file has invalid opcodes, the first occurence of which occurs at line 4711** after executing ```bash hexyl rectavoider.svc16 -pv --panels 1 > hex.txt ``` The result is: ![Screenshot_20241219-132803-1.jpg](https://github.com/user-attachments/assets/20cf8772-40ca-4a05-8eb8-e3d2a7708c95) The opcode observed is `c8 00` in hex which translates to `200` in decimal. From my understanding, there is no opcode beyond 16(?). On further inspection, dozens of such invalid opcodes were observed. Is there anything I'm missing out on or doing wrong? I obviously have executed `rectavoider.svc16` with svc16 and the game works as expected. Any help is much appreciated and thanks for creating this amazing repo!
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/SVC16#13
No description provided.