Writing&Saving a TXT File

Please read. Thanks

Page 1 of 1

8 Replies - 1331 Views - Last Post: 21 January 2010 - 08:59 AM Rate Topic: -----

#1 malloc   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 21-January 10

Writing&Saving a TXT File

Posted 21 January 2010 - 04:35 AM

Hello.

I am still a beginner in C# and FileWriting is my new learning step.

I created a project. Among other complicated things It needs to do the following:

1. Open EXE file
2. Click a button
3. Write&Save EXE information to a TXT file

Explanation:

There is a program that has an option to extract some information from it. I connected with that program and everything is fine.
Now, I need to make it able when I click EXPORT button to get a TXT file with information from the EXE file provided (I can load any EXE in Main program).

I need to information from EXE and save it to TXT. I already coded everything needed. I just need the code on how to save the contents of that particular section (I got that covered, there are multi sections to be extracted).
Is there some simple code snippet to do this? I already have a directive with all the code needed except code to write information from EXE to a TXT file.

Thanks for any help and best regards!

--
Software Reverse Engineering Wizard

This post has been edited by malloc: 21 January 2010 - 04:37 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Writing&Saving a TXT File

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6258
  • View blog
  • Posts: 24,026
  • Joined: 23-August 08

Re: Writing&Saving a TXT File

Posted 21 January 2010 - 05:31 AM

How to Write Text to a File from MSDN
Was This Post Helpful? 0
  • +
  • -

#3 malloc   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 21-January 10

Re: Writing&Saving a TXT File

Posted 21 January 2010 - 05:44 AM

Yes, I seen that. Not much success. Still trying.

But could you just write me those few lines of code to when I press a button, save a TXT file with data that is in memory waiting to be written.

Because when I press that button, all that information is in the buffer, just need to -> File.txt

I DO NOT NEED to write PREDEFINED TEXT AND SAVE IT IN TXT. I need to save INFORMATION in MEMORY!

Please. I am not asking much...

Thanks.

This post has been edited by malloc: 21 January 2010 - 06:06 AM

Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6258
  • View blog
  • Posts: 24,026
  • Joined: 23-August 08

Re: Writing&Saving a TXT File

Posted 21 January 2010 - 06:04 AM

No. We don't write code on demand. Put in a little effort yourself...you haven't even demonstrated you can write code. Certainly a "Software Reverse Engineering Wizard" can figure out how to save a text file!
Was This Post Helpful? 0
  • +
  • -

#5 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1536
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: Writing&Saving a TXT File

Posted 21 January 2010 - 06:38 AM

how about posting the code that you have, and telling us what part doesn't work or what errors you are getting.
Was This Post Helpful? 0
  • +
  • -

#6 malloc   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 21-January 10

Re: Writing&Saving a TXT File

Posted 21 January 2010 - 07:47 AM

TO: eclipsed4utoo

I don't get any errors. I need a code snippet to save a file. Thanks for normal Reply!


View PostJackOfAllTrades, on 21 Jan, 2010 - 05:04 AM, said:

No. We don't write code on demand. Put in a little effort yourself...you haven't even demonstrated you can write code. Certainly a "Software Reverse Engineering Wizard" can figure out how to save a text file!


A little effort? I DON'T KNOW C# THAT GOOD! That's why I AM ASKING!
And why would be I asking question like this if I don't have some code ready to use it with? Use your brain.

And I know how to use WriteLine and stupid things like that. I need to:

1. Press "Dump Header" button
2. Other command line program processes the header dump information from EXE request
3. Write that dump information in TXT file

And don't mock me if you don't know what I can or can't do. So it means... "If you don't know C# you can't possibly do RCE of C/C++/Delphi/ARM"

Go to { Link removed by moderator } you fool and see who is smarter. C# Programmer...

AND YOU ARE NOT A CODER, YOU ARE A PROGRAMMER! NEVER FORGET THAT!

Adio.

This post has been edited by SixOfEleven: 21 January 2010 - 10:35 AM

Was This Post Helpful? 0
  • +
  • -

#7 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1536
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: Writing&Saving a TXT File

Posted 21 January 2010 - 08:00 AM

are you really claiming to be smarter, when you can't even read directions?

This is the #1 rule at the top of the page when you post a new topic:

1. We will not do your homework for you! Do not ask us to give you code!

And what did you do?

Quote

But could you just write me those few lines of code to when I press a button, save a TXT file with data that is in memory waiting to be written.



So once again we ask, post the code that you have(not all of it, just the relevant parts), and tell us any errors you are getting. Going by your post, you already have the EXE header information(and other sections) in memory, so you simply need to write this information to a text file. Show us what you are trying.

This post has been edited by eclipsed4utoo: 21 January 2010 - 08:01 AM

Was This Post Helpful? 0
  • +
  • -

#8 malloc   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 21-January 10

Re: Writing&Saving a TXT File

Posted 21 January 2010 - 08:02 AM

TO: eclipsed4utoo

I know about not giving homework. But I just need a few lines of code, not the whole procedure...

I don't get any errors during compile or anything. I need a code snippet to save a file:

1. Press "Dump Header" button
2. Other command line program processes the header dump information from EXE request
3. Write that dump information in TXT file


// I cannot post the code because work is private. It would reveal several weakneses in some areas and work is being done for private company.
// I am making a C# version because of practice. C# is interesting and while I know the basics I always hunger for more and memory streams are good.

Thanks for normal Reply!

I think there is no point in continuing this thread. You have your rules and that's it.

Thanks anyway.

BR

This post has been edited by malloc: 21 January 2010 - 08:07 AM

Was This Post Helpful? 0
  • +
  • -

#9 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6258
  • View blog
  • Posts: 24,026
  • Joined: 23-August 08

Re: Writing&Saving a TXT File

Posted 21 January 2010 - 08:59 AM

OK by me. Closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1