Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help] Expanding A EXE's Size.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sat Nov 15, 2008 6:49 pm    Post subject: [Help] Expanding A EXE's Size. Reply with quote

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
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sun Nov 16, 2008 6:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Nov 16, 2008 7:02 am    Post subject: Reply with quote

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
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Nov 16, 2008 9:44 am    Post subject: Reply with quote

I ment with code as in C++ or something.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Nov 16, 2008 10:18 am    Post subject: Reply with quote

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.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sun Nov 16, 2008 10:40 am    Post subject: Reply with quote

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
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Sun Nov 16, 2008 1:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Nov 16, 2008 1:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
ElectroFusion
Grandmaster Cheater
Reputation: 0

Joined: 17 Dec 2006
Posts: 786

PostPosted: Sun Nov 16, 2008 2:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Nov 16, 2008 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
nwongfeiying
Grandmaster Cheater
Reputation: 2

Joined: 25 Jun 2007
Posts: 695

PostPosted: Sun Nov 16, 2008 8:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hokurai
Advanced Cheater
Reputation: 0

Joined: 18 Sep 2008
Posts: 95

PostPosted: Sun Nov 16, 2008 8:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Sun Nov 16, 2008 9:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Tue Nov 18, 2008 12:52 am    Post subject: Reply with quote

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..

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Tue Nov 18, 2008 1:40 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites