Announcement
Collapse
No announcement yet.
PHexVEditor 1.0
Collapse
X
-
Well good to hear it's solvedOriginally posted by Desrat View PostWell 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.)
what filetype are you working with?
Leave a comment:
-
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.)Originally posted by C B programming and webdesign View PostIt 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:
-
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:
-
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:
-
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.Originally posted by Dermot View PostUse Crypto.Base64EncodeToString() to convert the file to text. Then use Crypto.Base64DecodeFromString() to convert it back to a file.
Leave a comment:
-
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:
-
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 againOriginally posted by C B programming and webdesign View PostCode: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();Attached Files
Leave a comment:
-
I'm making this lua action plugin and a tutorial to go with it. So you'll be fine within a week ^^Originally posted by ShadowUK View PostBLAH. I really need to learn that.
Leave a comment:
-
Use Crypto.Base64EncodeToString() to convert the file to text. Then use Crypto.Base64DecodeFromString() to convert it back to a file.Originally posted by Centauri Soldier View PostA 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:
-
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:
-
BLAH. I really need to learn that.Originally posted by C B programming and webdesign View PostCode: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:
-
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:
Leave a comment: