Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/30/2012 in all areas

  1. Ward

    Inline C Source In AutoIt

    TCC is a small and fast C compiler. And the LibTCC use TCC as a backend for dynamic code generation. With LibTCC, we can add some C source to speed up the time-consuming subroutines. For example: Func Fib($n) Local $C $C = 'int fib(int n) ' & @LF $C &= '{ ' & @LF $C &= ' if (n <= 2) ' & @LF $C &= ' return 1; ' & @LF $C &= ' else ' & @LF $C &= ' return fib(n-1) + fib(n-2); ' & @LF $C &= '} ' Local $TCC = TCC_New() TCC_Compile_String($TCC, $C) Local $Size = TCC_Relocate($TCC, 0) Local $CodeBuffer = _MemVirtualAlloc(0, $Size, $MEM_COMMIT, $PAGE_EXECUTE_READWRITE) TCC_Relocate($TCC, $CodeBuffer) Local $Ptr = TCC_Get_Symbol($TCC, "fib") Local $Ret = MemoryFuncCall("int:cdecl", $Ptr, "int", $n) _MemVirtualFree($CodeBuffer, 0, $MEM_RELEASE) TCC_Delete($TCC) Return $Ret[0] EndFunc There is also an example using the C source (MD5.C) to count the MD5 in AutoIt (Include in the ZIP). Just like run the C source as script. For detail usage of the LibTCC functions. Please see libtcc.h in the TCC source. (The examples already demonstrate most functions) AutoIt x64 it not supported now. LibTCC.zip 2011/08/03 Update Note: Fix the bug in TCC_Run, thanks rchockxm.Add example for TCC_RunLibTCC.zip 2011/08/29 Update Note: Add some function to generated binary code that can be used in other script without LibTCC. If the C source using Windows API, then the code can't run on other system. A solution is getting the API address in AutoIt and pass it to C code by function pointer. NOTICE: These functions and examples need my LibTCC_Binary.zip
    1 point
  2. Hi, Updated: 7 Aug 2012 Some Tool scripts to help you with your USB drive management: ChangeUSBdriveLetter: Easily change a USB drive Letter The script will pop-up the ejectable USB drives only. Double Click to select Select the new drive letter and press OK Keep in mind that the script will require elevated rights, same as Computer/Disk Management ChangeUSBdriveLetter 1.1.zip EjectUSB: Easily eject a USB drive. The script will pop-up all the ejectable USB drives. Double Click to eject The script will automatically (by default without pop-up) eject the USB drive if only one USB drive is identified on the system. This script has an optional ini file (see the Description in the header of the script, example in the zip file) This script uses wraithdu's _USB_UDF.au3 and can be found here: _USB_UDF.au3 EjectUSB 1.2.zip New: USBScanAndFix: Correct recurring Scan and fix message on USB devices When a FAT formatted "removable" USB drive is attached under Vista and Win7, the "Scan and Fix" dialog is sometimes shown each time you insert the USB device. Performing Scan and fix does not seem to resolve the issue, however, no errors are found on the device. The reason for the error is that the USB drive was formatted FAT(32) on Windows XP. When the device was not properly dismounted by Windows XP, an archive bit in the drive's boot sector is set that needs to reset before it will stop reporting that there is an error. The script will perform a checkdsk /f on the selected USB device. The script will pop-up the ejectable USB drives only as in the previous 2 scripts but will grey out the non-FAT formated devices. Please note that the script is OS language sensitive (chkdsk !) and currently only supports English and Dutch. Any help would be appreciated if you could send me your language settings (line 63 to 66) Issue: StdoutRead seems sometime to miss some console data. I am not sure why this is happening. I made the loop as tight as possible. If anyone has a suggestion, let me know... Anyhow, most of the time, the script runs correctly and it's all about cosmetics anyhow, the chkdsk is performed. USBScanAndFix 1.0.zip All scripts tested in Windows XP, Windows Vista, Windows 7, x64 Greencan
    1 point
  3. Bowmore

    Gestapo Tactics?

    From my observations Melba23 is one of the most helpful and patient people I have ever seen on a forum. He has guided many new users through the steps of learning to use AutoIt. Just because you didn't get what you want through being too dumb to read and work with the rules, you feel the need to insult people. who have done their best to help you. Di you never hear of the saying "I want never gets".
    1 point
×
×
  • Create New...