| View previous topic :: View next topic |
| Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Nov 15, 2008 6:49 pm Post subject: [Help] Expanding A EXE's Size. |
|
|
| If I were to add bytes to the end of an exe, it would not get loaded into the memory. Is there a way to load more bytes at the end? |
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sun Nov 16, 2008 6:49 am Post subject: |
|
|
So you want to make the exe bigger but not load those bytes into the memory? Or do you wánt to load them into the memory?
If you want to load them in the memory I guess you could make one of the sections bigger, or add a few extra sections.
If you only want to make the file bigger, just add the bytes to the file and make sure the PE header stays correct. |
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun Nov 16, 2008 7:02 am Post subject: |
|
|
| consider adding a new section but you'd need to edit section headers, etc. too and cff explorer is a good tool for that. |
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Nov 16, 2008 9:44 am Post subject: |
|
|
| I ment with code as in C++ or something. |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Sun Nov 16, 2008 10:18 am Post subject: |
|
|
| dnsi0 wrote: | | I ment with code as in C++ or something. |
| Slugsnack wrote: | | consider adding a new section but you'd need to edit section headers, etc. too and cff explorer is a good tool for that. |
_________________
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sun Nov 16, 2008 10:40 am Post subject: |
|
|
| I still don't get the purpose... but you could also add a custom file as a resource. For example you could have a random file of any type, which might be any size, like 10 mb, and you could add it as a resource, and your exe size will be a lot bigger. |
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Sun Nov 16, 2008 1:40 pm Post subject: |
|
|
| tombana wrote: | | I still don't get the purpose... but you could also add a custom file as a resource. For example you could have a random file of any type, which might be any size, like 10 mb, and you could add it as a resource, and your exe size will be a lot bigger. |
ya...add some huge ass photo. _________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Nov 16, 2008 1:59 pm Post subject: |
|
|
| Create a file with all the same characters, keep going until it's the size you want. It may compress to nothingness as well depending on what you use as well |
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Sun Nov 16, 2008 2:50 pm Post subject: |
|
|
| kitterz wrote: | | tombana wrote: | | I still don't get the purpose... but you could also add a custom file as a resource. For example you could have a random file of any type, which might be any size, like 10 mb, and you could add it as a resource, and your exe size will be a lot bigger. |
ya...add some huge ass photo. |
yur sick _________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Nov 16, 2008 2:53 pm Post subject: |
|
|
I want to create a built in code cave. But I wanna make a exe that automatically does it.
I added a new section but the exe is giving me errors... @.@ |
|
| Back to top |
|
 |
nwongfeiying Grandmaster Cheater
Reputation: 2
Joined: 25 Jun 2007 Posts: 695
|
Posted: Sun Nov 16, 2008 8:40 pm Post subject: |
|
|
| ElectroFusion wrote: | | kitterz wrote: | | tombana wrote: | | I still don't get the purpose... but you could also add a custom file as a resource. For example you could have a random file of any type, which might be any size, like 10 mb, and you could add it as a resource, and your exe size will be a lot bigger. |
ya...add some huge ass photo. |
yur sick |
I think he means huge-ass photo, not huge ass photo :p |
|
| Back to top |
|
 |
Hokurai Advanced Cheater
Reputation: 0
Joined: 18 Sep 2008 Posts: 95
|
Posted: Sun Nov 16, 2008 8:42 pm Post subject: |
|
|
| nwongfeiying wrote: | | ElectroFusion wrote: | | kitterz wrote: | | tombana wrote: | | I still don't get the purpose... but you could also add a custom file as a resource. For example you could have a random file of any type, which might be any size, like 10 mb, and you could add it as a resource, and your exe size will be a lot bigger. |
ya...add some huge ass photo. |
yur sick |
I think he means huge-ass photo, not huge ass photo :p |
That reminds me of an XKCD comic strip. o.o |
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Sun Nov 16, 2008 9:33 pm Post subject: |
|
|
| nwongfeiying wrote: | | ElectroFusion wrote: | | kitterz wrote: | | tombana wrote: | | I still don't get the purpose... but you could also add a custom file as a resource. For example you could have a random file of any type, which might be any size, like 10 mb, and you could add it as a resource, and your exe size will be a lot bigger. |
ya...add some huge ass photo. |
yur sick |
I think he means huge-ass photo, not huge ass photo :p |
lol ya. I never though some1 would misunderstand my statement. _________________
|
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Tue Nov 18, 2008 12:52 am Post subject: |
|
|
adding a bunch of nops at the end of the program should make the size bigger without messing up the program..
so just get a file to load up in ur C++ program as binary then get filesize of it and filesize +1 +2 +3 etc.. how big you want to make it +1024 would add around 1KB and keep adding 0x90 using strcat() and fputs() or something
but u dont have to get filesize etc.. if you open the file in append mode so it will end bytes to end anyways..
something like
| Code: |
int count = 0;
FILE* file;
char buffer[5000];
file = fopen ("smallvirus.exe","ab"); //b for binary i dont think it matters
buffer[0] = 0x90
for(int i=0;i<1024;i++) {
strcat(buffer, 90);
count++;
}
buffer[count] = '\0';
fputs (buffer,file);
fclose (file);
|
but i dont know if it will work might be different things in the header that gotta be changed as well.. _________________
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Tue Nov 18, 2008 1:40 am Post subject: |
|
|
| Code: |
#include <Imagehlp.h>
#pragma comment(lib, "Imagehlp.lib");
#define ExtraBytes 1024
LOADED_IMAGE li;
bool isDll = false;
if( MapAndLoad("ImageNameWithoutExtension","ImagePath",&li,isDll,false))
{
HANDLE pImg = CreateFileMapping(
-1,lpAttributes,PAGE_EXECUTE_READWRITE
,0,li.SizeOfImage+ExtraBytes,"ImageMap");
memcpy(pImg,li.MappedAddress,li.SizeOfImaege+ExtraBytes);
MapViewOfFile(pImg,FILE_MAP_ALL_ACCESS,0,0,li.SizeOfImage+ExtraBytes);
}
|
got bored... |
|
| Back to top |
|
 |
|