:
:

Powered by GetResponse email marketing software

Make Money Online Instantly

Make Money Online Instantly - Your One Stop Resource For "Make Money Online Instantly"

Saturday, January 27, 2024

Reversing Some C++ Io Operations

In general decompilers are not friendly with c++ let's analyse a simple program to get familiar with it.
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.




Read more


  1. Hacking Tools Pc
  2. Pentest Box Tools Download
  3. Tools For Hacker
  4. Hacking Tools Download
  5. Hacking Tools Kit
  6. Hacking Tools For Games
  7. Hacking Tools Windows 10
  8. Hacker Tools Apk
  9. Nsa Hack Tools
  10. Underground Hacker Sites
  11. Hacker Tools Hardware
  12. Hacker Tools Github
  13. Hack And Tools
  14. Hacker Tools For Pc
  15. Hack Tools For Games
  16. Install Pentest Tools Ubuntu
  17. Hacker Search Tools
  18. Hack Tools For Ubuntu
  19. Hack Tools Online
  20. Physical Pentest Tools
  21. Best Hacking Tools 2019
  22. Pentest Automation Tools
  23. What Is Hacking Tools
  24. Hack Tools For Ubuntu
  25. Hack Tools For Windows
  26. Pentest Tools For Android
  27. Pentest Tools Kali Linux
  28. Hacking Tools For Beginners
  29. Hacking Tools
  30. Ethical Hacker Tools
  31. Pentest Tools
  32. Free Pentest Tools For Windows
  33. Hack Tools For Windows
  34. Hack Tools
  35. Hacker Tools Mac
  36. Hacker Tools Mac
  37. Install Pentest Tools Ubuntu
  38. Pentest Tools Windows
  39. Hack Tool Apk No Root
  40. Growth Hacker Tools
  41. Wifi Hacker Tools For Windows
  42. Pentest Tools Website
  43. Hack Tools Pc
  44. Hacking Tools Windows 10
  45. Hacking Tools Usb
  46. Hack And Tools
  47. New Hacker Tools
  48. Hacking Tools Kit
  49. Pentest Tools Download
  50. Nsa Hack Tools Download
  51. Android Hack Tools Github
  52. Hacking Apps
  53. Hacking Tools Kit
  54. Hacking Tools For Mac
  55. Usb Pentest Tools
  56. Pentest Tools Alternative
  57. What Are Hacking Tools
  58. Hack Tools 2019
  59. Hack Tools
  60. Pentest Tools Kali Linux
  61. Hacker Tools Windows
  62. Hacker Hardware Tools
  63. Hacker Hardware Tools
  64. Hacker Tools 2019
  65. Best Pentesting Tools 2018
  66. Hack Tool Apk No Root
  67. Top Pentest Tools
  68. Best Hacking Tools 2020
  69. Hacker Security Tools
  70. Hack Tools For Pc
  71. Hack Website Online Tool
  72. Beginner Hacker Tools
  73. Hack Tool Apk No Root
  74. Hacking Tools For Pc
  75. Hack Tools For Mac
  76. Hak5 Tools
  77. Hack Tools For Games
  78. Hacker Hardware Tools
  79. Pentest Tools Windows
  80. Hack Tools For Mac
  81. Hacker Tools For Windows
  82. Free Pentest Tools For Windows
  83. Top Pentest Tools
  84. Pentest Tools Framework
  85. Hacking Tools For Mac
  86. Hacker
  87. Nsa Hack Tools
  88. New Hack Tools
  89. Termux Hacking Tools 2019
  90. Hacker Tools Software
  91. Pentest Tools Nmap
  92. What Are Hacking Tools
  93. Pentest Tools Url Fuzzer
  94. Hacker
  95. Pentest Tools Subdomain
  96. Pentest Tools For Windows
  97. Hacking Tools 2019
  98. Tools 4 Hack
  99. Hacker Tools
  100. Pentest Tools
  101. How To Hack
  102. Android Hack Tools Github
  103. Hacker Hardware Tools
  104. Hacking Tools For Kali Linux
  105. Hacking Apps
  106. Hackrf Tools
  107. Pentest Tools Windows
  108. Underground Hacker Sites
  109. Hacking Tools Mac
  110. Hacking Tools 2019
  111. Pentest Recon Tools
  112. Hacker Tools Hardware
  113. Hacking Tools Kit
  114. Hacker Tools Linux
  115. Hacker Search Tools
  116. Growth Hacker Tools
  117. Hackrf Tools
  118. Beginner Hacker Tools
  119. Easy Hack Tools
  120. Hacking Tools Mac
  121. Pentest Tools Apk
  122. Hacker Tools Apk Download
  123. Hack Tool Apk
  124. Hacking Tools For Windows
  125. Hacker Tool Kit
  126. Hacking Tools For Pc
  127. Hack Tool Apk No Root
  128. Pentest Tools Website
  129. Pentest Tools Github
  130. Hacker Tools For Pc
  131. Pentest Tools For Windows
  132. Hacking Tools For Windows 7
  133. Hacking Tools Kit
  134. Best Hacking Tools 2020
  135. Hacking Tools Windows
  136. Termux Hacking Tools 2019
  137. Game Hacking
  138. Pentest Tools Open Source
  139. Pentest Tools Review
  140. Hack Tools
  141. Nsa Hack Tools
  142. Hack Tool Apk
  143. Pentest Tools Url Fuzzer
  144. Hacker Tools For Mac
  145. Tools 4 Hack
  146. Pentest Recon Tools

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home