Il2CppProtoExtractor-FallGuys icon indicating copy to clipboard operation
Il2CppProtoExtractor-FallGuys copied to clipboard

A value (Immediate) is invalid when the type is (Memory).

Open ventouris opened this issue 3 years ago • 3 comments

Trying to tweak the code and make it run in another App. However, the code

 if ((ins.Id == X86InstructionId.X86_INS_JMP || ins.Id == X86InstructionId.X86_INS_CALL)
                    && ins.Details.Operands[0].Immediate == protoMemberCtor)

returns the

An unhandled exception of type 'System.InvalidOperationException' occurred in Gee.External.Capstone.dll
A value (Immediate) is invalid when the type is (Memory).

The Gee repository has nothing about it in their issues. Do you have any idea what that might be?

ventouris avatar Jun 14 '21 22:06 ventouris

You might want to read up on using Capstone first. But what this looks like ins.Details.Operands[0] does not have the Immediate attribute because it's of type Memory so before trying to access ins.Details.Operands[0].Immediate you have to check if ins.Details.Operands[0].Type == X86OperandType.Immediate.

OsOmE1 avatar Jun 15 '21 07:06 OsOmE1

Thank you. I tried that but then the If statement is never true and all the indexes ended up as 0.

ventouris avatar Jun 15 '21 07:06 ventouris

As I said read up on Capstone and x86 reverse engineering I don't know what game you're working with and I'm not gonna reverse engineer it for you either.

OsOmE1 avatar Jun 15 '21 07:06 OsOmE1