Jump to content

Garath

Members
  • Joined

Everything posted by Garath

  1. Garath posted a post in a topic in Computer Discussion
    I never claimed I knew anything about creating an admin plugin. I'm just pointing out that he obviously has no programming experience, and is therefor overly-optimistic player who thinks that coding anything is easy, and can be done using an app with a GUI.
  2. Garath posted a post in a topic in Computer Discussion
    Whatever. I did this by myself. So there.
  3. Yeah, there are already a couple of live linux distros you can run off cd, why is this one so special?
  4. Garath posted a post in a topic in Computer Discussion
    Well, I say finished, I mean I basically finished it, you can't delete any files, but you can pack and extract them. #include <cstdlib> #include <iostream> #include <windows.h> using namespace std; void MoveResourceBlock(FILE* resourcefile, long int initialoffset, long int newoffset, long int blocksize) { fseek(resourcefile,initialoffset,SEEK_SET); char* buffer = (char*)malloc(blocksize); fread(buffer,1,blocksize,resourcefile); fseek(resourcefile,newoffset,SEEK_SET); fwrite(buffer,1,blocksize,resourcefile); free(buffer); } FILE* CreateResourceFile(const char* resourcename) { long int temp = -1; FILE* file = fopen(resourcename,"w+b"); fwrite(&temp,4,1,file); return file; } FILE* OpenResourceFile(const char* resourcename) { return fopen(resourcename,"r+b"); } long int GetFileCount(FILE* resourcefile) { long int temp; long int points = ftell(resourcefile); fseek(resourcefile,0,SEEK_SET); fread(&temp,4,1,resourcefile); fseek(resourcefile,points,SEEK_SET); return temp; } long int GetItemOffset(FILE* resourcefile, int idnumber) { long int temp; long int points = ftell(resourcefile); fseek(resourcefile,4+(4*idnumber),SEEK_SET); fread(&temp,4,1,resourcefile); fseek(resourcefile,points,SEEK_SET); return temp; } void SetItemOffset(FILE* resourcefile, int idnumber, int newoffset) { long int temp = newoffset; long int points = ftell(resourcefile); fseek(resourcefile,4+(4*idnumber),SEEK_SET); fwrite(&temp,4,1,resourcefile); fseek(resourcefile,points,SEEK_SET); } long int GetFileSize(FILE* resourcefile) { long int temp; long int points = ftell(resourcefile); fseek(resourcefile,0,SEEK_END); temp = ftell(resourcefile); fseek(resourcefile,points,SEEK_SET); return temp; } long int GetContentsOffset(FILE* resourcefile, int idnumber) { long filenamesize; long int points = ftell(resourcefile); fseek(resourcefile,GetItemOffset(resourcefile,idnumber)+4,SEEK_SET); fread(&filenamesize,4,1,resourcefile); fseek(resourcefile,filenamesize,SEEK_CUR); filenamesize = ftell(resourcefile); fseek(resourcefile,points,SEEK_SET); return filenamesize; } long int GetContentsSize(FILE* resourcefile, int idnumber) { long contentssize; long int points = ftell(resourcefile); fseek(resourcefile,GetItemOffset(resourcefile,idnumber),SEEK_SET); fread(&contentssize,4,1,resourcefile); fseek(resourcefile,points,SEEK_SET); return contentssize; } void GetContents(FILE* resourcefile, int idnumber, char* buffer) { long int points = ftell(resourcefile); fseek(resourcefile,GetContentsOffset(resourcefile,idnumber),SEEK_SET); fread(buffer,1,GetContentsSize(resourcefile,idnumber),resourcefile); fseek(resourcefile,points,SEEK_SET); } long int GetFilenameSize(FILE* resourcefile, int idnumber) { long int points = ftell(resourcefile); long int filenamesize; fseek(resourcefile,GetItemOffset(resourcefile,idnumber)+4,SEEK_SET); fread(&filenamesize,4,1,resourcefile); fseek(resourcefile,points,SEEK_SET); return filenamesize; } void GetFileName(FILE* resourcefile, int idnumber, char* buffer) { long int points = ftell(resourcefile); fseek(resourcefile,GetItemOffset(resourcefile,idnumber)+8,SEEK_SET); fread(buffer,1,GetFilenameSize(resourcefile,idnumber),resourcefile); fseek(resourcefile,points,SEEK_SET); } bool SetFileEnd(const char* filename, long position) { HANDLE hFile = CreateFile(filename,FILE_ALL_ACCESS,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); if (hFile == NULL) return false; SetFilePointer(hFile,position,NULL,FILE_BEGIN); SetEndOfFile(hFile); CloseHandle(hFile); return true; } void PackFile(FILE* resourcefile, const char* filename) { int count; FILE* file = fopen(filename,"rb"); long int filenamesize = strlen(filename); long int resourcesize = GetFileSize(resourcefile); long int filesize = GetFileSize(file); long int filecount = GetFileCount(resourcefile)+1; char* buffer = (char*)malloc(filesize); fseek(file,0,SEEK_SET); fread(buffer,1,filesize,file); // Begin Packing fseek(resourcefile,0,SEEK_SET); fwrite(&filecount,4,1,resourcefile); MoveResourceBlock(resourcefile,4+(filecount*4),8+(filecount*4),(resourcesize-(4+(filecount*4)))); resourcesize += 4; fseek(resourcefile,4+(filecount*4),SEEK_SET); fwrite(&resourcesize,4,1,resourcefile); for (count = 0; count < filecount; count++){ long temp = GetItemOffset(resourcefile,count)+4; fseek(resourcefile,4+(4*count),SEEK_SET); fwrite(&temp,4,1,resourcefile); } fseek(resourcefile,resourcesize,SEEK_SET); fwrite(&filesize,4,1,resourcefile); fseek(resourcefile,resourcesize+4,SEEK_SET); fwrite(&filenamesize,4,1,resourcefile); fseek(resourcefile,resourcesize+8,SEEK_SET); fwrite(filename,1,filenamesize,resourcefile); fseek(resourcefile,resourcesize+8+filenamesize,SEEK_SET); fwrite(buffer,1,filesize,resourcefile); // End Packing free(buffer); } void UnpackFile(FILE* resourcefile, const char* filename, int idnumber) { char* buffer; int count; buffer = (char*)malloc(GetContentsSize(resourcefile,idnumber)); GetContents(resourcefile,idnumber,buffer); FILE* tempfile = fopen(filename,"w+b"); fwrite(buffer,1,GetContentsSize(resourcefile,idnumber),tempfile); free(buffer); fclose(tempfile); } int main(int argc, char *argv[]) { char line[MAX_PATH]; if (argc > 1){ if (strcmp(argv[1],"-c") == 0){ if (argc == 3){ FILE* file = CreateResourceFile(argv[2]); cout << "Resource File " << argv[2] << " created." << endl; fclose(file); } else cout << "Usage: " << argv[0] << " -c <filename>" << endl; } else if (strcmp(argv[1],"-a") == 0){ if (argc == 4){ cout << "Packing File " << argv[3] << " into " << argv[2] << "... "; FILE* file = OpenResourceFile(argv[2]); PackFile(file,argv[3]); cout << "Done!" << endl; fclose(file); } else cout << "Usage: " << argv[0] << " -a <resource> <filename>" << endl; } else if (strcmp(argv[1],"-u") == 0){ if (argc == 5){ FILE* file = OpenResourceFile(argv[2]); UnpackFile(file,argv[4],atoi(argv[3])); fclose(file); } else cout << "Usage: " << argv[0] << " -u <resource> <idnumber> <filename>" << endl << endl; } else if (strcmp(argv[1],"-h") == 0){ cout << "Command List for Packing Utility - By Eriond" << endl << endl; cout << "-c <resource> -- Creates a Resource with the Specified Name" << endl; cout << "-a <resource> <filename> -- Adds the specified file to the resource." << endl; cout << "-u <resource> <idnumber> <filename> -- Extracts the file at the ID number specified to the filename specified." << endl; } } else cout << "More Arguments Needed. For help, type " << argv[0] << " -h" << endl; return EXIT_SUCCESS; }
  5. Garath posted a post in a topic in Computer Discussion
    I just finished writing an archiving program in C. Anyone want the source?
  6. Garath posted a post in a topic in Flames
    Invisible Pink Unicorn for the win, k?
  7. Garath posted a post in a topic in Computer Discussion
    About the Disc read errors... it's causing me to get the ISO and .1x which is fucked up. The surface of the disk is slightly scratched, but it's readable and installs/plays the game on it. Is there anyway to stop these things?
  8. Garath posted a post in a topic in Computer Discussion
    Okay then. EDIT: Problem. I'm getting Disc read errors, alot of them, but the disc reads fine when I'm using it outside of the burning program. It's scratched, but not overly so... is there anyway to get around this?
  9. Garath posted a post in a topic in Computer Discussion
    I need a relatively good free burning program that'll crack through cd protection... any suggestions?
  10. Garath posted a post in a topic in Computer Discussion
    This is myg0t, 'tard. I'm saying what I think. You don't have any programming experience, do you?
  11. Garath posted a post in a topic in Computer Discussion
    Do you have any programming ability at all? Juding by your grammar and demeanor, I'd say no.
  12. Garath posted a post in a topic in General Discussion
    I've heard that Intel is generally better than AMD, but for price vs power, Intel can't compete. Or so I've heard.
  13. Garath posted a post in a topic in Flames
    Rage?
  14. BAT files don't work as viruses, because any idiot can look at the bat file's source and see what it does.
  15. Garath posted a post in a topic in Flames
    No.
  16. I FIND THIS RATHER AMUSING.
  17. Garath posted a post in a topic in Flames
    Wait, wait wait. Are you saying that the universe has random mathematical constants? No way. That's crazy.
  18. Garath posted a post in a topic in Flames
    You're totally retarded, no I don't beleieve in a supernatural jesus and shut the fuck up.
  19. Garath posted a post in a topic in Flames
    Allor1c, shut the fuck up, we didn't evolve from apes. It's you people who give creationists their fucking insane ideas.
  20. Garath posted a post in a topic in General Discussion
    I don't understand why anyone finds any of these movies scary. I've been exposed to worse shit on myg0t.
  21. Garath posted a post in a topic in Flames
    It might have always been there?
  22. Garath posted a post in a topic in Flames
    WOW. Badguy, why are you quintuple posting? Your arguments are incredibly weak. First, Hitler was a christian, no going around it. He was brought up with Christianity, and nowhere did he denouce Jesus or his Religion. (If you want to start pulling up bullshit Hitler's Table-Talk stuff, don't even bother, it's an incredibly unreliable source). Second of all, Evolution is a FACT. Get it through your head. It's been proven. Period. If you want to spout some crazy creationist babble and dribble off websites like http://www.answersingenesis.org/ or the ICR, that's fine, but just remember that those sites and their creators have been discredited many times by many people. Third of all, we do not know just exactly how life started on this planet, but we HAVE generated complex organic molecules from inorganic matter. And lastly, this bullshit about saying that you have no responsibilties if there is no god is totally retarded. Morality is neccesary for society to funciton. We humans like to take care of the necessities. We don't need a supreme being to do it for us, we can handle it on our own. Our system of laws is based on logic (most of it anyway, I don't know about tax law), not religion. Anyone who spouts the bullshit that America's legal system is based on the ten commandments is totally retarded. Oh, and radiometric dating is a tested theory, and is VALID. Don't even bother trying to debunk it.
  23. Garath posted a post in a topic in General Discussion
    I used to blink through the ground on occasion. Nothign special.
  24. Garath posted a post in a topic in General Discussion
    o rly?