Reputation: 1
\`#include \<iostream\>
#include \<cstring\>
void secretFunction() {
std::cout \<\< " Exploit Successful! You've gained control! " \<\< std::endl;
}
void vulnerableFunction() {
char buffer\[32\]; // Small buffer
std::cout \<\< "Enter your input: ";
std::cin \>\> buffer; // Dangerous function: No bounds checking!
std::cout << "You entered: " << buffer << std::endl;
}
int main() {
vulnerableFunction();
return 0;
}\`
I'm trying to resolve this but I'm using x64dbg, I got the address of secret func, but I just don't know how to overflow it, I put 32 A's, then the address of the function in little endian format but still windows shows the error, wtf?
I needed to achieve the buffer overflow on the program by overwriting the return address to go to the secretFunction instead.
Upvotes: 0
Views: 19