Follow us on Twitter!
It is the path of least resistance that makes rivers and men crooked. - Bj Palmer
Wednesday, April 23, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 20
Guests Online: 18
Members Online: 2

Registered Members: 82886
Newest Member: The Slummy
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

appending a binary file (C/++)


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 01:31
well im trying to append to a binary file like so
Code

if(!(elf = fopen(file, "a+b"))){  return;}
   fseek(elf,elfpheader->offset+address,SEEK_SET);
   printf("offset 0x%0x\n",elfpheader->offset+address);
   fwrite((void*)value, sizeof(u32), 1, elf);




the offset is the line in the file i want to edit and the value is obviously the new value i want to append, but when i try this it runs smoothely until it trys to write the value. ive had to cast the value from a "unsigned int" to "void*" VC Express just gives me an error inside the fread.c line 93 saying "Expression: buffer != NULL" this also happens when i try to read from here aswell.

Edited by on 29-10-06 01:32