Jump to content
Sign in to follow this  
pbsds

Needs to find a function

Recommended Posts

pbsds

Hi, this is my first post here and im glad i registered!

I need a function that does the same a htonl() does in C.

Can anybody tell me where to get/find this or make an UDF for me?

I need it to make a IMET Header.

Thanks.


Fuck 'em if they can't take a joke.

Share this post


Link to post
Share on other sites
hunt

Try this:

Func htonl($hostlong)
    DllCall("Ws2_32.dll","ulong","htonl","ulong",$hostlong)
EndFunc

You can make a function with DllCall and msdn

Edited by hunt

Share this post


Link to post
Share on other sites
pbsds

it didn't work.

I tried to make some changes and even download the dll and put it in the scripts directory:

Func htonl($hostlong)
    return DllCall(@ScriptDir & "\WS2_32.dll","htonl",$hostlong)
EndFunc

got an another idea?


Fuck 'em if they can't take a joke.

Share this post


Link to post
Share on other sites
martin

it didn't work.

I tried to make some changes and even download the dll and put it in the scripts directory:

Func htonl($hostlong)
 return DllCall(@ScriptDir & "\WS2_32.dll","htonl",$hostlong)
EndFunc

got an another idea?

YES!.

Things often don't work and it is usually because of an error in the script or in your understanding. So the first thing you do is to study the help file to check that you are using the functions etc correctly. Then you examine any errors that occur becuause they tell you what, if anything, went wrong. So the next thing to do is to add error checking to see if something went wrong, and make sure that you can react to the error, and to make sure that the result you are getting is being dealt with correctly.

Maybe you are expecting a ulong return from the function when that's not what it returns, maybe the DllCall fails and therre is nothing there to tell you that. I think that it would be better for your programming development and understanding if you spent a bit of time on what is not working and then, if you can't solve it then post again with information that would enable us to give some helpful suggestions.

EDIT: Well I see that hunt has scuppered my enforced eduction policy.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.