-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jmp imm bug #129
Comments
I've created a small test function using the information you provided. TEST(SerializationTests, Issue_129)
{
int64_t rva = 0x3471fe;
int64_t jmp_rva = 0x347486;
Program program(zasm::MachineMode::AMD64);
x86::Assembler assembler(program);
assembler.jmp(zasm::Imm(jmp_rva));
zasm::Serializer serializer{};
auto res = serializer.serialize(program, rva);
if (res == zasm::ErrorCode::None)
{
auto ptr = serializer.getCode();
auto size = serializer.getCodeSize();
ASSERT_EQ(size, 5);
auto decoder = zasm::Decoder(zasm::MachineMode::AMD64);
auto decoded = decoder.decode(ptr, size, rva);
auto& op0 = decoded->getOperand<Imm>(0);
ASSERT_EQ(op0.value<int64_t>(), jmp_rva);
}
} This test however passes on my end, the immediate has the expected value 0x347486. Are you using the latest commit? |
yes,i use latest commit. |
I created a new project, pulled the commit again, recompiled, and the issue was resolved. |
Glad it worked out, for good measure I added a new test #130 based on this to prevent such an issue in the future. |
My target address is 0x347486 (0x224AB8A1486), but the generated assembly instruction's target address is 0x347485 (0x224AB8A1485). Is this a bug?
The text was updated successfully, but these errors were encountered: