0000 Posted January 1, 2009 Share Posted January 1, 2009 This is C++ function, which I need to convert to AutoIt...void TakeRes() { HRSRC hRes; HGLOBAL hRLoad; HANDLE hFile; char *cRes; DWORD BWritten,SzRsc; hRes = FindResource(NULL, MAKEINTRESOURCE(101), TEXT("S")); if(hRes == NULL) MessageBox(NULL,"Error","Error",MB_OK); hRLoad = LoadResource(NULL,hRes); cRes = (char*)LockResource(hRLoad); SzRsc = SizeofResource(NULL,hRes); hFile = CreateFile("Loader.exe",GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); WriteFile(hFile,cRes,SzRsc,&BWritten,NULL); CloseHandle(hFile); }I tried convert it, using this topic:http://www.autoitscript.com/forum/index.php?showtopic=66538But it didint help me so much, there is another information which maybe will need:http://msdn.microsoft.com/en-us/library/ms648042.aspBecause most errors I get with: hRes = FindResource(NULL, MAKEINTRESOURCE(101), TEXT("S")); Thanks, 0000. Link to comment Share on other sites More sharing options...
Zedna Posted January 1, 2009 Share Posted January 1, 2009 You can look at my resources UDF where I use these API functionshttp://www.autoitscript.com/forum/index.php?showtopic=51103 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
0000 Posted January 1, 2009 Author Share Posted January 1, 2009 (edited) Ok, I will check it. Im training to make .exe dropper, which would be Unique from checkbox'es, like user selects his favorite answers, and my .exe generates .exe with his answers, and he can show that .exe to his friends or smthere But I cant get Main.exe inside generator, because I still cant fix Resource Reader ;( Edited January 1, 2009 by Guest Link to comment Share on other sites More sharing options...
0000 Posted January 2, 2009 Author Share Posted January 2, 2009 *BUMP* Link to comment Share on other sites More sharing options...
0000 Posted January 4, 2009 Author Share Posted January 4, 2009 Func SetFilePointer($hFile,$nOffset, $nMethod = 0) $Callresult = DllCall("kernel32.dll", "int", "SetFilePointer", "ptr", $hFile, "long", $nOffset,"ptr", 0, "dword", $nMethod) ; FILE_BEGIN Return $Callresult[0] EndFunc Func WriteFile($hFile,$lpBuffer,$nNumberOfBytesToWrite) Local $pRead = DllStructCreate("dword") $Callresult = DllCall("kernel32.dll", "int", "WriteFile", "int", $hFile,"long",$lpBuffer,"int", $nNumberOfBytesToWrite,"ptr",DllStructGetPtr($pRead),"int", 0) Return $Callresult[0] EndFunc Could somebody say, if I made correct functions, with DllCall, because basiclly, its not working for me, and I don't know what here can be bad . Also try to fix it Link to comment Share on other sites More sharing options...
Zedna Posted January 4, 2009 Share Posted January 4, 2009 Look here http://www.autoitscript.com/forum/index.php?showtopic=76829 Resources UDF ResourcesEx UDF AutoIt Forum Search 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