Lazycat Posted January 23, 2005 Share Posted January 23, 2005 (edited) Today I'm overcome my laziness , found stupid mistake with which I stuck before and finished dll for reading/writing binary data. Dll allow reading given number bytes at given offset into hex string and writing hex data back, also at given offset. Although reading can be done only with Autoit, this method should be faster. Source included, so if you inetersting and know how to improve this, suggestions and comments are welcome.binary_dll.zip Edited January 25, 2005 by Lazycat Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
layer Posted January 23, 2005 Share Posted January 23, 2005 (edited) looks great :Dim starting to feel a little more confident in C++ for making my own dll... maybe mine will be done in 2 weeks and it will be shorter then yours good work EDIT i think you should also post this on the developers section where the Dll Examples are wanted.. btw: what compiler/IDE did you use for this? Edited January 23, 2005 by layer FootbaG Link to comment Share on other sites More sharing options...
BasicOs Posted January 24, 2005 Share Posted January 24, 2005 Great for low level programming, Thanks Autoit.es - Foro Autoit en EspaƱol Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http Link to comment Share on other sites More sharing options...
Lazycat Posted January 25, 2005 Author Share Posted January 25, 2005 Thanks all for replies!I'm reuploaded dll, fixed crash when given number bytes > 32768. This is DllCall limitation as was said here. Thanks LOULOU for pointing me.Now dll will return 0 (error) if given number bytes > 32768. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
layer Posted January 25, 2005 Share Posted January 25, 2005 also... what did you use to compile this? FootbaG Link to comment Share on other sites More sharing options...
Lazycat Posted January 25, 2005 Author Share Posted January 25, 2005 Ups... I have used LCC Compiler. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
layer Posted January 25, 2005 Share Posted January 25, 2005 Ups...Ā I have used LCC Compiler.<{POST_SNAPBACK}>ahh, ok, i was just curious... i wanna see what compilers ppl use, maybe i should make a poll? FootbaG Link to comment Share on other sites More sharing options...
Alex Posted May 21, 2005 Share Posted May 21, 2005 It's great. It's that what I was so looking for. I want to suggest two functions, that will simplify using of this dll: 1. for reading from binary files: FUNC _FileReadBin ($file, $offset, $bytes ) DIM $ret[2] $word = DllCall(@ScriptDir & "\binary.dll", "int", "FileReadBinary", "str", $file, "int", $offset, "int", $bytes, "str", "") $ret[0] = $word[0] $ret[1] = $word[4] Return $ret ENDFUNC ussage is following: _FileReadBin ( "file", "offset", "bytes" ) Parameters: file - name of file to be read; offset - number of bytes to scip; bytes - number of bytes to read. Returnes an array, wich nas elements: [0] - return value ( 1 - success, 0 - failure) [1] - result string 2. For writing to binary files: FUNC _FileWriteBin ($file, $offset, $string ) DIM $ret $word = DllCall(@ScriptDir & "\binary.dll", "int", "FileWriteBinary", "str", $file, "str", $string, "int", $offset) $ret = $word[0] Return $ret ENDFUNC ussage is following: _FileWriteBin ( "file", "offset", "string" ) Parameters: file - name of destination file; offset - number of bytes to scip string - string to write. Return value: 1 - success, 0 - failure I hope, that it will be helpful for users. PS - happy birthday to you, LAZYCAT. Link to comment Share on other sites More sharing options...
Lazycat Posted May 22, 2005 Author Share Posted May 22, 2005 Hmm, I think with DllStruct* functions this dll is become useless Now we can read/write binary data without this dll. So one of my dreams is come true, and now I prefer to make new UDF with the native Autoit functions for working with binary data. When time allow, though...PS - happy birthday to you, LAZYCAT.It's only coming, but thanks! Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
Ejoc Posted May 22, 2005 Share Posted May 22, 2005 DllStruct.au3 which can be found at the link in my sig, has a UDF for reading binary files, but it means using DllStruct* functions. Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now