Aquí Hay Trabajo

Empresa con experiencia en la asistencia a las personas busca franquiciados nacionales (internacionales en un futuro próximo), para ofrecer sus servicios a las familias, mayores y niños, que resuelven cualquier imprevisto en nuestra rutina diaria: Salud, colegio, viajes, hogar, etc.

jueves, 25 de enero de 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.




More articles


  1. Hack Tool Apk
  2. Hack Tools Github
  3. Pentest Tools Github
  4. Pentest Tools Port Scanner
  5. Underground Hacker Sites
  6. Hack Tools 2019
  7. Pentest Tools Alternative
  8. Pentest Tools Download
  9. How To Install Pentest Tools In Ubuntu
  10. Free Pentest Tools For Windows
  11. Hack Tools Mac
  12. Hacker Tools Free Download
  13. Pentest Tools Github
  14. Hacking Tools And Software
  15. Hacking Tools
  16. Hack Tool Apk No Root
  17. Pentest Tools Free
  18. Hacker Tools For Mac
  19. Hacker Tools Linux
  20. Pentest Box Tools Download
  21. Pentest Tools Framework
  22. Hacker Tools Free
  23. Pentest Tools Find Subdomains
  24. Wifi Hacker Tools For Windows
  25. Hacker Tools For Mac
  26. Hacking Tools Free Download
  27. Hackers Toolbox
  28. Pentest Tools Review
  29. Pentest Tools Framework
  30. Pentest Tools Find Subdomains
  31. New Hacker Tools
  32. Hacker Tools Linux
  33. Hacking Tools 2019
  34. Nsa Hack Tools Download
  35. New Hacker Tools
  36. Pentest Tools Url Fuzzer
  37. Pentest Tools Url Fuzzer
  38. Usb Pentest Tools
  39. Pentest Tools For Ubuntu
  40. Game Hacking
  41. Hacking Tools Kit
  42. Bluetooth Hacking Tools Kali
  43. Free Pentest Tools For Windows
  44. Hacking Tools For Windows Free Download
  45. Hacker Tools For Windows
  46. Android Hack Tools Github
  47. How To Install Pentest Tools In Ubuntu
  48. Hack Tools For Pc
  49. Hacking Tools Windows
  50. Pentest Reporting Tools
  51. Pentest Tools For Windows
  52. New Hack Tools
  53. Pentest Tools Kali Linux
  54. Hacking Tools Software
  55. Pentest Tools Free
  56. Pentest Tools List
  57. Kik Hack Tools
  58. Hacker Tools For Windows
  59. Pentest Tools Nmap
  60. Hack Rom Tools
  61. World No 1 Hacker Software
  62. World No 1 Hacker Software
  63. Hack Website Online Tool
  64. Hacking Tools For Games
  65. Android Hack Tools Github
  66. Pentest Tools Alternative
  67. Hacker Security Tools
  68. Pentest Tools Url Fuzzer
  69. Pentest Tools Website Vulnerability
  70. Hacker
  71. Hack Rom Tools
  72. Hack Tools
  73. Hack Tools For Mac
  74. Pentest Tools Bluekeep
  75. Pentest Tools Bluekeep
  76. Hack Tools Mac
  77. Hacking Tools Free Download
  78. Pentest Tools For Windows
  79. Hak5 Tools
  80. How To Make Hacking Tools
  81. Pentest Tools List
  82. Hacking Tools Mac
  83. How To Install Pentest Tools In Ubuntu
  84. Free Pentest Tools For Windows
  85. Hacking Tools For Windows 7
  86. Pentest Tools Website Vulnerability
  87. Hack Tools For Windows
  88. Hack Tools For Pc
  89. Hack Tools Download
  90. Hack Tools For Games
  91. Termux Hacking Tools 2019
  92. Pentest Recon Tools
  93. Hacking Tools Kit
  94. How To Hack
  95. Pentest Recon Tools
  96. Hacker Tools Apk Download
  97. Kik Hack Tools
  98. Beginner Hacker Tools
  99. Pentest Tools Subdomain
  100. Hacker Tools 2020
  101. Computer Hacker
  102. Pentest Tools For Android
  103. Hacking Tools 2020
  104. Hack Tools
  105. Hacking Tools
  106. Pentest Tools For Windows
  107. Hacking Tools Github
  108. Hacking Tools Kit
  109. Hacker Tools 2019
  110. Android Hack Tools Github
  111. Hacker Tools Hardware
  112. Wifi Hacker Tools For Windows
  113. Top Pentest Tools
  114. Android Hack Tools Github
  115. Physical Pentest Tools
  116. Hacking Tools 2020
  117. Hacker Tools 2019
  118. Hack App
  119. Hack Tool Apk
  120. Hacker Techniques Tools And Incident Handling
  121. Hack Tool Apk
  122. Hacker Tools Github
  123. Pentest Tools Linux
  124. Hack Tool Apk No Root
  125. Hack Website Online Tool
  126. Pentest Tools Linux
  127. Pentest Recon Tools
  128. Hack Tools Mac
  129. Hackers Toolbox
  130. Hack Tools 2019
  131. Hack Tools Download
  132. Wifi Hacker Tools For Windows
  133. Hacker Tools 2019
  134. Hacking Tools Free Download
  135. Wifi Hacker Tools For Windows
  136. Hackers Toolbox
  137. Wifi Hacker Tools For Windows
  138. Hacker Tool Kit
  139. How To Hack
  140. Pentest Tools Tcp Port Scanner
  141. Underground Hacker Sites
  142. What Is Hacking Tools
  143. Hacker Tools
  144. Hacker Security Tools
  145. Bluetooth Hacking Tools Kali
  146. Pentest Tools Tcp Port Scanner
  147. Hacking Tools Hardware
  148. Hacking Tools Usb
  149. Pentest Tools Windows
  150. Hacking Tools Software
  151. Hacker Tools Online
  152. Usb Pentest Tools
  153. Underground Hacker Sites
  154. Pentest Tools Kali Linux
  155. Hacking Tools Windows 10
  156. Hacking Tools 2019
  157. Hacking Tools Windows
  158. Hacker Tools Free
  159. New Hacker Tools
  160. Hack Tools
  161. Hack Tools For Windows
  162. Hacking Tools For Mac
  163. Pentest Tools Port Scanner
  164. Hacker Tools Software
  165. Bluetooth Hacking Tools Kali
  166. Hacking Tools For Beginners
  167. Pentest Tools Linux
  168. Hack App
  169. Hacking Tools For Windows 7
  170. Hacking Tools Usb
  171. Hacker
  172. Hacking Tools For Beginners
  173. Pentest Tools For Ubuntu
  174. Hacker Tools 2020
  175. Pentest Tools Apk
  176. Pentest Tools Bluekeep
  177. How To Make Hacking Tools
  178. Pentest Tools Online

Archivo del blog

Con la tecnología de Blogger.

Disqus for La Franquicia de los Servicios a las Personas

wibiya widget

Directorio Blogs

Directorio de Blogs

Suscribirse ahora standard