Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 511 Vote(s) - 3.57 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem when executing a PE in memory c/c++

#1
I'm trying to load a PE into memory and run it, I tried to make a shellcode out of it but it's really huge file so I'll need a month trying to do that especially with my little experience.


this is the function used to load the PE image (which is the argument passed to the function).


The problem here is that when virtual-allocating a memory using VirtualAllocEx() it keeps returning 000000 and gets stuck in a loop of trying to allocate and get's 0 returned then kill the process created thn tries again.


But why does it return 0 constantly?


sometimes it just works right away but other times it doesn't it gets stuck in that loop.




Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.

Reply

#2
Moved from Software & Programs to C, C++, & Obj-C.
Reply

#3
First of all, I don't know how this code was even compiling for you. There were a lot of errors. But I managed to fix all of them. There are still some conversion warnings left, but for now they shouldn't matter. I also took the liberty of reformatting everything to make your code more readable. Just some extra lines though, nothing major.



Also, when you copy code from a 6 year old video, expect errors.


Reply

#4
I didn't know that video exists I found it on Github and a guy also on GitHub submitted a partial solution which is the part when you compare the returned value from virtualalloc with 00000000.

But thank you so much for you effort


Quote: (02-07-2022, 07:44 PM)socialwaste Wrote:

[To see links please register here]

I didn't know that video exists I found it on Github and a guy also on GitHub submitted a partial solution which is the part when you compare the returned value from virtualalloc with 00000000.

But thank you so much for you effort

I honestly didn't find any difference in your version of the code. and the result after running it is the same. you didn't make any changes!!!!!!!!
Reply

#5
Quote:(02-07-2022, 07:44 PM)socialwaste Wrote:

[To see links please register here]

I didn't know that video exists I found it on Github and a guy also on GitHub submitted a partial solution which is the part when you compare the returned value from virtualalloc with 00000000.

But thank you so much for you effort


Quote: (02-07-2022, 07:44 PM)socialwaste Wrote:

[To see links please register here]

I didn't know that video exists I found it on Github and a guy also on GitHub submitted a partial solution which is the part when you compare the returned value from virtualalloc with 00000000.

But thank you so much for you effort

I honestly didn't find any difference in your version of the code. and the result after running it is the same. you didn't make any changes!!!!!!!!

I don't use Windows API calls frequently, so I'm not familiar enough with them to give you a good solution. I just fixed the errors to get the program running with GCC 11.2 and GDB 11.1. Different compilers and debuggers require different things.

If you want a better solution, it would be a good idea to make a post in the

[To see links please register here]

subreddit.
Reply

#6
Just delete this source .

U don't need to allocate a new memory in target process you only need to unmapviewofsections then start writing image using writeprocessmemory
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through