GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Jun-2007, 09:40
thebrighter thebrighter is offline
New Member
 
Join Date: Jun 2007
Posts: 8
thebrighter is on a distinguished road
Smile

Compressing C programme


How can I compress the c programme according to my requirements. My written chatting server and client programme exe are 390K and 363K. I need to compress this as much as I can. After that it should work.
How can I do this?

thanks
  #2  
Old 30-Jun-2007, 10:24
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,627
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Compressing C programme


Quote:
Originally Posted by thebrighter
How can I compress the c programme according to my requirements.

What are your requirements?

In any case, it is very easy to give a definite answer to your question.

The answer is: It Depends!

What compiler and operating system are you using? (If more than one compiler is available, sometimes the variation in executable file sizes is huge.)

1. Sometimes the source code can be tweaked to obtain more efficient in use of memory at run-time. Note that the size of the executable file does not tell the whole story about how much memory is actually used by the program when it executes. Which do you want to reduce? In other words, what are your requirements? (But I asked that already, didn't I?)

2. In my experience, compiler switches for optimization may be much more important than trying to tweak source code. (Well, not always, but it's pretty hard to give a lot of general rules for minimizing executable file size. That's why I gave the answer that I did.)

Also, whether you are compiling with debugging information in the file.

Also for Linux/UNIX operating systems, a utility named strip can get rid of certain things in the executable that aren't strictly necessary for execution.

Also...

Regards,

Dave
  #3  
Old 30-Jun-2007, 10:28
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,108
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough

Re: Compressing C programme


Quote:
Originally Posted by davekw7x
Also for Linux/UNIX operating systems, a utility named strip can get rid of certain things in the executable that aren't strictly necessary for execution.

I've used UPX to squish the stuffing out of exe's. It's available in a variety of flavors.

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #4  
Old 30-Jun-2007, 11:21
thebrighter thebrighter is offline
New Member
 
Join Date: Jun 2007
Posts: 8
thebrighter is on a distinguished road
Smile

Re: Compressing C programme


I am trying to code Trojan in c for my project in Msc. I need to compress it for much a s possible that it would act as a real Trojan. Now it is coded as chat server and client but I am further develop it as to send email to certain mail address with the required files as attachments from inflected computer after it inflected. Compiled Chatting exe without mailing function size I ve given. But if I ve add mail sending codes it will again become bigger
to 589k.

I am using dev c++ complier. I ve tried with MVC but its giving bigger file.
In dev c++ how can I reduce the file ? and how can I remove debugging information attach to the exe file?. What are the possible ways to reduce exe more, like previous method. what will be the other information that I can reduce?

Pls tell me if I use dll (dynamic link libraries) then is it possible to reduce the file.
If it is, how can I use the dll?

Pls help me for my work.

Thanks for your comments...
  #5  
Old 30-Jun-2007, 15:07
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 889
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: Compressing C programme


Quote:
Originally Posted by thebrighter
I am trying to code Trojan in c for my project in Msc. I need to compress it for much a s possible that it would act as a real Trojan. Now it is coded as chat server and client but I am further develop it as to send email to certain mail address with the required files as attachments from inflected computer after it inflected. Compiled Chatting exe without mailing function size I ve given. But if I ve add mail sending codes it will again become bigger
to 589k.

I am using dev c++ complier. I ve tried with MVC but its giving bigger file.
In dev c++ how can I reduce the file ? and how can I remove debugging information attach to the exe file?. What are the possible ways to reduce exe more, like previous method. what will be the other information that I can reduce?

Pls tell me if I use dll (dynamic link libraries) then is it possible to reduce the file.
If it is, how can I use the dll?

Pls help me for my work.

Thanks for your comments...

What is this all about?
Are you actually trying to code a Trojan and expect us to help you do it? Is your intention to actually infect computers and have them unknowingly send emails for you? Because if it is, you will find no help here!

Please provide more information as to what your intentions are.
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #6  
Old 30-Jun-2007, 21:48
thebrighter thebrighter is offline
New Member
 
Join Date: Jun 2007
Posts: 8
thebrighter is on a distinguished road
Smile

Re: Compressing C programme


Quote:
Originally Posted by LuciWiz
What is this all about?
Are you actually trying to code a Trojan and expect us to help you do it? Is your intention to actually infect computers and have them unknowingly send emails for you? Because if it is, you will find no help here!

Please provide more information as to what your intentions are.


Really I am studying for a Msc in Policy Oriented Information Security Systems. I have tried to work for my subject.

If you feel that the thread is not suitable for discuss you can avoid this as well as I also giveup and findout any other way to get the nuts and bolts of this.

Thanks so much and I am appologise if I break the rules of the forums.
 
 

Recent GIDBlogNARMY by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
triangle (polygon), drawing, sizing, and rotation programme using linked lists... promsan C Programming Language 12 14-May-2007 14:03
i need help on a programme... samsam2021 Miscellaneous Programming Forum 3 12-Aug-2006 11:32
call another programme mag_um C Programming Language 4 05-May-2006 01:36
Compressing files? toddm123 .NET Forum 2 11-Apr-2005 08:37
A Comprehensive Digest of C++ mithunjacob CPP / C++ Forum 39 20-Jun-2004 19:09

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:08.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.