Let's implement a simple code that loads a file into a vector and then save the vector with following functions:
- err
- load
- save
- main
Lets identify the typical way in C++ to print to stdout with the operator "<<"
The basic_ostream is initialized writing the word "error" to the cout, and then the operator<< again to add the endl.
The Main function simply calls "vec = load(filename)" but the compiler modified it and passed the vector pointer as a parámeter. Then it bulds and prints "loaded " << size << " users".
And finally saves the vector to /tmp/pwd and print "saved".
Most of the mess is basically the operator "<<" to concat and print values.
Also note that the vectors and strings are automatically deallocated when exit the function.
And here is the code:
Let's take a look to the load function, which iterates the ifs.getline() and push to the vector.
First of all there is a mess on the function definition, __return_storage_ptr is the vector.
the ifstream object ifs is initialized as a basic_ifstream and then operator! checks if it wasn't possible to open the file and in that case calls err()
We see the memset and a loop, getline read a cstr like line from the file, and then is converted to a string before pushing it to the vector. lVar1 is the stack canary value.
In this situations dont obfuscate with the vector pointer vec initialization at the begining, in this case the logic is quite clear.
The function save is a bit more tricky, but it's no more than a vector iteration and ofs writing.
Looping a simple "for (auto s : *vec)" in the decompiler is quite dense, but we can see clearly two write, the second write DAT_0010400b is a "\n"
As we see, save implememtation is quite straightforward.
Related posts
- Hacker Tools For Ios
- Hacker Tools Free Download
- Hacker Tools Mac
- Hack Tools For Windows
- Pentest Tools Kali Linux
- Tools For Hacker
- Pentest Tools For Windows
- Beginner Hacker Tools
- Hack Tools
- Hacker Tools Linux
- Hacking Tools Windows
- Pentest Tools Apk
- Hacking Tools Online
- Hacker Hardware Tools
- Hacking Tools Windows
- Hacker Tools
- Hack Tools Online
- Hack Tools For Ubuntu
- Hack App
- Hacking Tools For Pc
- Pentest Tools Url Fuzzer
- Pentest Tools Kali Linux
- Pentest Tools Windows
- Hacker Tools List
- Hack Tools For Windows
- Hacker Tools 2020
- Pentest Tools Linux
- Hack Rom Tools
- Pentest Tools Nmap
- Pentest Tools Apk
- Hack App
- Hacker Tools Apk
- Hacker Tools For Pc
- Hacking Tools For Pc
- Ethical Hacker Tools
- Hacking Tools Online
- Ethical Hacker Tools
- Hacker Tools Hardware
- Hack Tools
- Hacker Tools Free
- Hak5 Tools
- Hack Tools For Mac
- Pentest Tools Url Fuzzer
- Hacking Tools Windows 10
- Wifi Hacker Tools For Windows
- Hacking Tools For Windows 7
- Easy Hack Tools
- Hack Tools For Games
- Easy Hack Tools
- Hack Tools
- Hacker Tools Apk
- New Hacker Tools
- Pentest Tools Subdomain
- Hacking Tools Windows 10
- Pentest Tools Online
- Pentest Reporting Tools
- Pentest Tools Apk
- Hacker Tools For Mac
- Pentest Tools Apk
- Free Pentest Tools For Windows
- Pentest Tools List
- Hack Tools Online
- Pentest Tools Open Source
- Hacker Search Tools
- Ethical Hacker Tools
- Kik Hack Tools
- Hacker Security Tools
- Blackhat Hacker Tools
- Pentest Tools
- Hacking Apps
- Hacker Tools For Windows
- Hack And Tools
- New Hack Tools
- Hacking Tools Kit
- Hack Tools
- Pentest Tools Nmap
- Hacker Tools Windows
- Easy Hack Tools
- Hacker Tools Apk Download
- Tools 4 Hack
- Hacking Tools Hardware
- Hacker Tools Github
- Kik Hack Tools
- Hacker Tool Kit
- Pentest Tools Review
- Pentest Tools Url Fuzzer
- Hacker Tools Github
- Best Hacking Tools 2019
- Underground Hacker Sites
- Android Hack Tools Github
- Hacking Tools 2020
- Hack Tools For Games
- Hacker Tools Apk
- Hacking Tools Software
- How To Make Hacking Tools
- Hacker Tools Hardware
- Hacking Tools Github
- Hack Tool Apk No Root
- Hacking Tools Online
- Hackrf Tools
- Hacking Tools
- Wifi Hacker Tools For Windows
- How To Hack
- Tools 4 Hack
- Pentest Tools For Mac
- Pentest Tools Android
- Easy Hack Tools
- Pentest Tools Bluekeep
- Hack Tools For Ubuntu
- Hacker Tools For Mac
- Pentest Tools Bluekeep
- Hacker Tools Free Download
- Termux Hacking Tools 2019
- Easy Hack Tools
- Hacking Tools And Software
- Pentest Tools Linux
- Hack Tools Mac
- Hack Tools For Windows
- Pentest Recon Tools
- Pentest Tools Bluekeep
- Hack App
- Hacking Tools For Windows 7
- Pentest Tools Windows
- Hacker Tools
- Hack Tools For Games
- Pentest Tools Kali Linux
- Hacker Tools Github
- Hack Tools For Games
- Hacking Tools Windows 10
- Hacker Tools List
- Wifi Hacker Tools For Windows
- Game Hacking
- Beginner Hacker Tools
- Hack Tools Download
- Pentest Recon Tools
- Hacking Tools
- Kik Hack Tools
- Hacking Tools For Windows Free Download
- Kik Hack Tools
- Hacking Tools Download
- Bluetooth Hacking Tools Kali
- Hacking Tools For Games
- Kik Hack Tools
- Hacker Security Tools
- Hacking Tools Name
- Hacking Tools For Mac
- Pentest Tools Website Vulnerability
- Hacks And Tools
- Hacking Tools Pc
- Hack Tools For Windows
- Hacking Tools For Windows Free Download
- Pentest Tools Website
- Hack And Tools
- Pentest Tools Url Fuzzer
- Hacking Tools Download
No comments:
Post a Comment