Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/18/2013 in all areas

  1. RTFC

    BuildPartitionTable

    Hello World! (always wanted to say that) Wrote this when I needed low-level access to unmountable parts of a physical drive. The resulting UDF is BuildPartitionTable, and takes as single argument a designated physical drive ID, for example: BuildPartitionTable(".physicaldrive0") for your first harddisk. This UDF scans a physical drive's partition table to fill three partition-related arrays: partition_table extracted from the MBR and its linked list(s) allocation_table entire disk mapping volumes_table subset of $allocation_table with volumes only It does NOT alter your data or drives; it just reads and reports. BuildPartitionTable.v1.1.zip (AutoIt 3.3.12-1 compliant updated version, with small example) You can use the UDF's output for low-level drive I/O (use at your own risk!), for example (NB code for this is not included): identify unallocated regions for space optimisation or hidden storage (listed in allocation table array) resize/remove existing partitions change which single partition is primary (i.e., used for booting) change an existing partition's type add new partitions of any type hide/unhide logical volumes (simply set/reset bit4 of a volume's Partition_Type in its (E)MBR partition entry) It should in theory be able to handle many types of MBR partition tables, not just Microsoft-approved ones. If you're going to analyse Linux MBRs or ancient tech, you may want to replace internal calls to _Partition_type_string() (DOS/Microsoft only) to its internal alternative _Partition_Anytype_string(), which supports many types I'd never heard of before (but results can be unreliable). Furthermore, you may be puzzled by references in the annotations to my "FATsuite UDF". Please follow the link in my signature if you wish to know more. Should the script crash or produce wrong results at your end, there's unfortunately not much I can do at this end, since the problem is likely related to the specific hardware you're testing. Of course, I'll try to fix whatever bugs I am able to reproduce... Hope it helps! RT
    1 point
  2. Special thanks to Ward for his udf and Trancexx for her assembly examples as they have played a huge role in my learning of asm. UDF Requires >Beta version 3.3.9.19 or higher. Also Requires >Wards Fasm UDF. Direct Download Link FASMEx.zip FasmEx 9-29-2013.zip This is dead. See new version here :
    1 point
  3. corgano

    SEND problem

    type send in SciTE, click it, and hit F1. This opens the help file, which is really awesome. It gives you examples for everything, gives you all the info you need, and lets you search And while you're at it, you should search "string" or "datatype" and read up on strings, variables, and arrays
    1 point
  4. FireFox

    Quick Question

    Sure, add TOPMOST and TOOLWINDOW exstyles. GUICtrlSetState, like its name is made for GUI controls, not the GUI itself. Br, FireFox.
    1 point
  5. FireFox

    Quick Question

    Hi, There are plenty of examples in the forum, search for these keywords "layered png". Br, FireFox.
    1 point
  6. $SecondsToWait = 2 $Timer = TimerInit() While TimerDiff($Timer) < ($SecondsToWait * 1000) $var = ControlGetText("[CLASS:#32770]", "", "Button1") Sleep(1000) If $var = "OK" Then Run("ImportReg.bat") Sleep(1000) Send("{SPACE}") ExitLoop EndIf WEnd
    1 point
  7. I found out today, due to my collegue, that in Windows 7 Microsoft build an easy way to change the logon screen (computer lock screen as well) wallpaper. I build a GUI around that in AutoIt to make life easy Edit: Edited 256 * 1024 to 250 * 1024 so that the outcome will become the intended 256Kb. Reported by ERSL #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 (beta) Author: Triblade Last change: 29-may-2009 Changes: Changed 256*1024 to 250*1024, cause pictures may still be too large at 256*1024. Thanks to ERSL. Script Function: Script to easely change Windows 7 logon wallpaper. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #RequireAdmin #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Dim $underscore If @OSArch = "X64" Then $destination_path = @WindowsDir & "\Sysnative\oobe\info\backgrounds" Else $destination_path = @WindowsDir & "\System32\oobe\info\backgrounds" EndIf $file = "backgroundDefault.jpg" $destination_file = $destination_path & "\" & $file $gui = GUICreate("Windows 7 logonscreen wallpaper changer", 450, 130) GUICtrlCreateGroup("Picture && path", 10, 10, 430, 50) $picture_label = GUICtrlCreateLabel("No picture selected.", 20, 33, 300, 25, $SS_LEFTNOWORDWRAP) $select_picture = GUICtrlCreateButton("Select JPG", 330, 25, 100, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Messages && commit button", 10, 70, 430, 50) $msg_label = GUICtrlCreateLabel("All systems are go.", 20, 93, 300, 25, $SS_LEFTNOWORDWRAP) $commit_button = GUICtrlCreateButton("Commit", 330, 85, 100, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlSetState($commit_button, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $select_picture $picture = FileOpenDialog("Choose the new logon screen wallpaper", @DocumentsCommonDir, "Images (*.jpg)", 1) If @error = 1 Then $picture = "" GUICtrlSetData($picture_label, "No picture selected.") Else GUICtrlSetData($picture_label, $picture) check_picture() EndIf Case $commit_button $underscore = "" set_registry() check_picture_destination() copy_picture() GUICtrlSetData($msg_label, "Picture set as new logon screen wallpaper!") EndSwitch ;Sleep(100) WEnd Func copy_picture() FileCopy($picture, $destination_file, 8) EndFunc Func check_picture_destination() If FileExists($destination_path) = 0 Then DirCreate($destination_path) EndIf While FileExists($destination_file) = 1 $underscore = $underscore & "_" If FileMove($destination_file, $destination_path & "\old" & $underscore & $file) = 1 Then ExitLoop WEnd EndFunc Func set_registry() If @OSArch = "X64" Then RegWrite("HKEY_LOCAL_MACHINE64\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", "REG_DWORD", 1) Else RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", "REG_DWORD", 1) EndIf EndFunc Func check_picture() $filesize = FileGetSize($picture) If @error Then GUICtrlSetData($msg_label, "There is a error checking the filesize.") GUICtrlSetState($commit_button, $GUI_DISABLE) Else If $filesize > (250 * 1024) Then GUICtrlSetData($msg_label, "Picture is to heavy. It has to be 256 Kb or smaller.") GUICtrlSetState($commit_button, $GUI_DISABLE) Else GUICtrlSetData($msg_label, "Picture accepted.") GUICtrlSetState($commit_button, $GUI_ENABLE) EndIf EndIf EndFunc Since I work in 64 bit, some 64-bit check where needed. And damn, that 32-bit redirection of the system32 folder is annoying After some googeling I found that "Sysnative" works instead of "system32". This works only in 64-bit systems that want to specifically write in the "system32" folder instead of the redirected "syswow64".
    1 point
×
×
  • Create New...