Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 03:36

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Reading from binary file

Discussion on Reading from binary file within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
Dwarfche's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 1,195
Received Thanks: 38
Reading from binary file

I would like to put into my array of type structure information from a binary file.

My code:
Code:
file_.open("D:/ТУРИСТ.dat",ios::binary | ios::in);
file_.seekg(0l,ios::end);
		pos=file_.tellg();
nused=pos/sizeof(danni);

for (int z(0);z<nused;z++)
	{file_.read((char*)&masiv[z],sizeof(masiv[z]));}
masiv is the array i created, its from type: structure
and i'd like to fill it with all the info from the ТУРИСТ file

Suggestions why its not working?
Dwarfche is offline  
Old 12/19/2015, 15:58   #2
 
hazejp's Avatar
 
elite*gold: 0
Join Date: Jan 2015
Posts: 62
Received Thanks: 13
Seems that the file pointer remains in end position, you probably forgot seekg()-ing back to ios::beg.
hazejp is offline  
Reply


Similar Threads Similar Threads
[C#] Write Hex to Binary File & Compare binary & hex
07/20/2014 - Coding Snippets - 0 Replies
For those who like to make a binary hack (write hexadecimal to a specified adress in a binary file) and use a checkbox - checker if the hack has already been enabled or not, here are two usefull functions: This code snippets require the IO namespace. using System.IO; To use this functions, you'll need 3 other ones that were not written by me, but unfortunatelly I couldn't find the original author of them again, sorry.
Reading Encrypted file, possible?
02/17/2013 - Elsword - 10 Replies
Hey guys, I wonder if it's possible to read Item.lua files in Elsword Box, pretty much I can do everything but not to .lua files, any help anyone? Pretty much thanks (For reading)
[Help]When reading/writing from a file
10/08/2010 - CO2 Private Server - 3 Replies
Hello guys...I have 1 or 2 question about reading and writing from a file. Reading: After you have read all the infos from the file you use filestream.close(); binaryreader.close I am wondering...if I insert a filstream.flush() (before filestream.close()) does it have any effect? or is it necessary in reading a file? (as the flush() void says it clears all buffers and causes any buffered data to be writen to the file) Writing:
Toast's turtorial to binary string reading.
07/17/2009 - Rohan - 10 Replies
We'll useually using CE, and tracing the address back to a larger control structure. but i'll show you how anyways. Note: "This is all based off memory, since i do not have rohan anymore but the concept is always the same FOR MOST GAMES." Mapping out the strings is pretty easy, 1)First go over to OllyDbg v1.10 and download the latest version of OLLYDBG enither olly 1 or 2 will achieve the same thing. 2)Run the rohan bypass through the bot. 3)Attach olly to the bot 4)You'll find...
reading through a file
04/12/2009 - Silkroad Online - 2 Replies
when people post files on this site, other people always wanna know or it is safe but an antivirus check doesn't always work since your antivirus considers bots and hacks almost always as a virus /trojan and then people say, it's safe, i read through it but now i wonder how can you see the source of the program? how can i check it by myself because i got yesterday a big virus from a fake sibibot



All times are GMT +1. The time now is 03:36.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.