Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am providing the assembly generate_hash: movabsq $6892602702244265115, %rdx movq %rdi, %rax imulq %rdx sarq $27, %rdx movq %rdi, %rax sarq $63, %rax subq %rax,

I am providing the assembly generate_hash: movabsq $6892602702244265115, %rdx movq %rdi, %rax imulq %rdx sarq $27, %rdx movq %rdi, %rax sarq $63, %rax subq %rax, %rdx imulq $359208297, %rdx, %rax movq %rdi, %rdx subq %rax, %rdx addq %rdx, %rdi movq %rdi, %rsi shrq $63, %rsi addq %rdi, %rsi movq %rsi, %rcx sarq %rcx movabsq $838450567299412615, %rdx movq %rcx, %rax imulq %rdx sarq $20, %rdx sarq $63, %rsi subq %rsi, %rdx imulq $23069712, %rdx, %rax movq %rcx, %rdx subq %rax, %rdx imulq %rdx, %rcx movabsq $861544275413644431, %rdx movq %rcx, %rax imulq %rdx movq %rdx, %rax sarq $16, %rax movq %rcx, %rdx sarq $63, %rdx subq %rdx, %rax imulq $1403208, %rax, %rdx movq %rcx, %rax subq %rdx, %rax ret * Reverse the given x86-64 assembly to figure out the code for the below #include #define ORIGINAL_HASH 1021969 long generate_hash(long num) { long hashed_value; /* * _REDACTED CODE_ * * Reverse the given x86-64 assembly to figure out the code */ return hashed_value; } int main() { long input; printf("Welcome to School of Reversing! "); printf("To enter into the school, you need to prove your worth "); printf("Please enter the password that will hash to the value: %ld ", ORIGINAL_HASH); scanf("%ld", &input); long hashed_value = generate_hash(input); if (hashed_value == ORIGINAL_HASH) printf("Congrats! Enter into the path of Wizardry! "); else printf("Sorry! Please go and come back when you're ready. "); } Reverse the assembly and find the password and code of the "generate_hash" function and make it functional so that it shows "Congrats! Enter into the path of Wizardry!" in the output.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions