Announcement

Collapse
No announcement yet.

PHexVEditor 1.0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Desrat
    replied
    its encrypted data so could be anything really

    Leave a comment:


  • Imagine Programming
    replied
    Originally posted by Desrat View Post
    Well works on every file I tested except the ones I actually need the function for, however I did find a way around my problem using the apz from the original post to replace the first 50bytes (just means the target files now have to have 50 useless bytes in the header rather than just inserting them they get replaced.)
    Well good to hear it's solved what filetype are you working with?

    Leave a comment:


  • Desrat
    replied
    Originally posted by C B programming and webdesign View Post
    It does work on binary/bytecode mate... that's where "wb" and "rb" stands for... (write binary and read binary)

    Tested here on images and executables
    Well works on every file I tested except the ones I actually need the function for, however I did find a way around my problem using the apz from the original post to replace the first 50bytes (just means the target files now have to have 50 useless bytes in the header rather than just inserting them they get replaced.)

    Leave a comment:


  • Dermot
    replied
    Remember that there is a limit to how long an SQL statement can be. I can't remember what it is. So if your files are very large and you encode them as text, the insert statement will fail if the statement is too long.

    Leave a comment:


  • Centauri Soldier
    replied
    COOL! Thanks much Dermot.

    Leave a comment:


  • Dermot
    replied
    Encoding the file to text is the only way to save a file to a database as far as I know. BLOBS are another way but you can't do that with AMS, at least not using SQLite.

    Leave a comment:


  • Centauri Soldier
    replied
    Does ne1 happen to know how?

    Leave a comment:


  • Centauri Soldier
    replied
    Originally posted by Dermot View Post
    Use Crypto.Base64EncodeToString() to convert the file to text. Then use Crypto.Base64DecodeFromString() to convert it back to a file.
    Thanks for your suggestion Dermot. I have done that before and it increases the file size significantly. I want to store the file contents in a database but that method makes the file content increase. I am looking for a way to read the raw code without using that method.

    Leave a comment:


  • Imagine Programming
    replied
    It does work on binary/bytecode mate... that's where "wb" and "rb" stands for... (write binary and read binary)

    Tested here on images and executables

    Leave a comment:


  • Desrat
    replied
    Originally posted by C B programming and webdesign View Post
    Code:
    local old=io.open("file2.bin");
    local old_content=old:read("*all");
    old:close();
    local f=io.open("file1.bin", "rb");
    local w=io.open("file2.bin", "wb");
    
    
    w:write(f:read(50)..old_content);
    w:close();
    f:close();
    works on standard files (txt etc) but not on the files I need editing I have attached a sample of the 2 files below, if you wouldnt mind taking a look again i need the first 50bytes of file1 inserting at the beginning of file2 thx again
    Attached Files

    Leave a comment:


  • Imagine Programming
    replied
    Originally posted by ShadowUK View Post
    BLAH. I really need to learn that.
    I'm making this lua action plugin and a tutorial to go with it. So you'll be fine within a week ^^

    Leave a comment:


  • Dermot
    replied
    Originally posted by Centauri Soldier View Post
    A somewhat related question...how can I copy a file's (ascii?) code (such as all info from a jpg image) and pass it to a string variable?
    Use Crypto.Base64EncodeToString() to convert the file to text. Then use Crypto.Base64DecodeFromString() to convert it back to a file.

    Leave a comment:


  • Centauri Soldier
    replied
    A somewhat related question...how can I copy a file's (ascii?) code (such as all info from a jpg image) and pass it to a string variable?

    Leave a comment:


  • ShadowUK
    replied
    Originally posted by C B programming and webdesign View Post
    Code:
    local old=io.open("file2.bin");
    local old_content=old:read("*all");
    old:close();
    local f=io.open("file1.bin", "rb");
    local w=io.open("file2.bin", "wb");
    
    
    w:write(f:read(50)..old_content);
    w:close();
    f:close();
    BLAH. I really need to learn that.

    Leave a comment:


  • Imagine Programming
    replied
    Code:
    local old=io.open("file2.bin");
    local old_content=old:read("*all");
    old:close();
    local f=io.open("file1.bin", "rb");
    local w=io.open("file2.bin", "wb");
    
    
    w:write(f:read(50)..old_content);
    w:close();
    f:close();

    Leave a comment:

Working...
X