-- Made by the GameHackingDojo -- Special thanks to: -- ParkourPenguin -- AylinCE -- Dark Byte local disassembler_history = {} local memory_view_history = {} local function get_address(type) if type == "disassembler" then return getNameFromAddress(getMemoryViewForm().DisassemblerView.SelectedAddress, true, false) end if type == "memory_view" then return getNameFromAddress(getMemoryViewForm().HexadecimalView.Address, true, false) end end local function alias(str) return string.gsub(string.gsub(str, ":%$", "$process+0"), "0x", "") --define :$ as $process (x64dbg expression) end local function fix_input(str) return string.gsub("$process+"..str:gsub("%$process%+", ""), "0x", "") end local function update_history(items, type) if type == "disassembler" then if disassembler_history ~= {} then for i = 1, #disassembler_history do items.add(disassembler_history[i]) end end end if type == "memory_view" then if memory_view_history ~= {} then for i = 1, #memory_view_history do items.add(memory_view_history[i]) end end end end local function go_to_address(type, offset) local version = {1, 2, 0, 0} local form_colour = 0x242424 --BGR local bevel_colour = 0x404040 --BGR local font_colour = 0xBBBBBB --BGR local red_colour = 0x453ACC --BGR local small_spacing = 4 local spacing = 8 local default_label = "Enter an address" -- Create main window local form = createForm(false) form.Caption = "Superior Go to Address by GHD" form.AutoSize = true form.Constraints.MaxHeight = 92 form.Constraints.MinWidth = 400 form.Constraints.MaxWidth = 1300 form.Font.Color = font_colour --form.BorderStyle = 'bsNone' --[[local title_bar = createPanel(form) title_bar.Align = alTop title_bar.Height = 26 title_bar.Color = 0x282828 title_bar.BevelColor = bevel_colour title_bar.Color = form_colour title_bar.OnMouseDown = function(sender, button, x, y) if button == mbLeft then form.dragNow() end end local title_label = createLabel(title_bar) title_label.Caption = "Go to address" title_label.Font.Color = font_colour title_label.Font.Size = 9 title_label.Align = asrCenter title_label.BorderSpacing.Left = small_spacing title_label.Alignment = "taLeft" title_label.OnMouseDown = function(sender, button, x, y) if button == mbLeft then form.dragNow() end end]] -- Create main panel local main_panel = createPanel(form) main_panel.Align = alClient main_panel.ClientHeight = form.ClientHeight main_panel.ClientWidth = form.ClientWidth main_panel.BevelColor = bevel_colour -- Create label local label = createLabel(main_panel) label.Align = alLeft label.Caption = default_label label.BorderSpacing.Top = spacing label.BorderSpacing.Left = small_spacing label.BorderSpacing.Right = small_spacing -- Create combo box local inputbox = createComboBox(main_panel) inputbox.Text = get_address(type) inputbox.Align = asrCenter inputbox.BorderSpacing.Left = small_spacing inputbox.BorderSpacing.Right = small_spacing update_history(inputbox.Items, type) -- Create version label local version_label = createLabel(main_panel) version_label.Caption = "v"..version[1].."."..version[2].."."..version[3].."."..version[4] version_label.font.Color = red_colour version_label.font.size = 8 version_label.Align = alRight version_label.AnchorSideTop.Control = label version_label.BorderSpacing.Top = spacing version_label.BorderSpacing.Left = small_spacing version_label.BorderSpacing.Right = small_spacing -- Create button panel local button_panel = createPanel(form) button_panel.ClientHeight = 40 button_panel.Align = alBottom button_panel.BevelColor = bevel_colour -- Create go button local go_button = createButton(button_panel) go_button.Caption = "Go" go_button.Align = alRight go_button.Constraints.MinWidth = 75 go_button.Constraints.MinHeight = 25 go_button.AutoSize = true go_button.BorderSpacing.around = spacing go_button.OnCLick = function() if process == nil or process == "" then return end if offset == true then inputbox.text = fix_input(inputbox.text) end inputbox.text = alias(inputbox.text) local address = getAddressSafe(inputbox.text) or nil if address == nil then return end if type == "disassembler" then getMemoryViewForm().DisassemblerView.TopAddress = address table.insert(disassembler_history, inputbox.text) end if type == "memory_view" then getMemoryViewForm().HexadecimalView.Address = address table.insert(memory_view_history, inputbox.text) end form.close() end -- Create cancel button local cancel_button = createButton(button_panel) cancel_button.Caption = "Cancel" cancel_button.Align = alRight cancel_button.Constraints.MinWidth = 75 cancel_button.Constraints.MinHeight = 25 cancel_button.AutoSize = true cancel_button.BorderSpacing.around = spacing cancel_button.OnClick = function() form.close() end -- Create offset checkbox local offset_checkbox = createCheckBox(button_panel) local initial_offset_input = "" offset_checkbox.Caption = "Go to Offset" offset_checkbox.Align = alLeft offset_checkbox.Constraints.MinWidth = 50 offset_checkbox.Constraints.MaxHeight = 19 offset_checkbox.BorderSpacing.around = spacing if offset == true then offset_checkbox.state = cbChecked end offset_checkbox.onChange = function() if offset_checkbox.state == cbChecked then offset = true else offset = false end inputbox.text = alias(inputbox.text) if offset_checkbox.state == cbChecked then initial_offset_input = inputbox.text:gsub("%s+$", "") else if initial_offset_input ~= "" then inputbox.text = initial_offset_input end end end -- Create module or symbol checkbox local module_symbol_checkbox = createCheckBox(button_panel) local initial_module_symbol_input = "" module_symbol_checkbox.Caption = "Module or Symbol" module_symbol_checkbox.Align = alLeft module_symbol_checkbox.Left = 60 module_symbol_checkbox.Constraints.MinWidth = 110 module_symbol_checkbox.Constraints.MaxHeight = 19 module_symbol_checkbox.BorderSpacing.around = spacing module_symbol_checkbox.setAllowGrayed(true) module_symbol_checkbox.onChange = function() inputbox.text = alias(inputbox.text) if getAddressSafe(inputbox.text) == nil then module_symbol_checkbox.state = cbUnchecked return end if module_symbol_checkbox.state ~= cbUnchecked then if module_symbol_checkbox.state == cbGrayed then initial_module_symbol_input = inputbox.text:gsub("%s+$", "") if offset == true then --inputbox.text = "$process+"..inputbox.text:gsub("%$process%+", "") inputbox.text = fix_input(inputbox.text) offset = false offset_checkbox.state = cbUnchecked end inputbox.text = getNameFromAddress(inputbox.text, true, false) end if module_symbol_checkbox.state == cbChecked then if offset == true then --inputbox.text = "$process+"..inputbox.text:gsub("%$process%+", "") inputbox.text = fix_input(inputbox.text) offset = false offset_checkbox.state = cbUnchecked end inputbox.text = getNameFromAddress(inputbox.text, true, true) end end if module_symbol_checkbox.state == cbUnchecked then inputbox.text = initial_module_symbol_input end end -- Add OnKeyDown event for Enter key inputbox.OnKeyDown = function(sender, key) if key == VK_RETURN then go_button.DoClick() end end inputbox.OnKeyDown = function(sender, key) if key == VK_ESCAPE then form.close() end end -- Disable this section to get rid of access violation --[[ if hotkeys_timer then hotkeys_timer.Destroy() hotkeys_timer = nil end hotkeys_timer = createTimer() hotkeys_timer.Interval = 100 hotkeys_timer.OnTimer = function() if isKeyPressed(VK_RETURN) then go_button.DoClick() end if isKeyPressed(VK_CONTROL) and isKeyPressed(VK_F) then if offset_checkbox.state == cbChecked and offset == true then offset_checkbox.state = cbUnchecked offset = false else offset_checkbox.state = cbChecked offset = true end end if isKeyPressed(VK_ESCAPE) then hotkeys_timer.Destroy() hotkeys_timer = nil form.Close() end collectgarbage("count") end hotkeys_timer.Enabled = true --]] -------------------- End of section -------------------- form.showModal() -- Centre to MemoryViewForm window local memory_form_x, memory_form_y = getMemoryViewForm().getPosition() memory_form_x = memory_form_x + getMemoryViewForm().width / 2 - form.width / 2 memory_form_y = memory_form_y + getMemoryViewForm().height / 2 - form.height / 2 form.setPosition(memory_form_x, memory_form_y) end for i = 0, getMemoryViewForm().DisassemblerView.PopupMenu.items.count - 1 do local item = getMemoryViewForm().DisassemblerView.PopupMenu.items[i] if item.name == "Gotoaddress1" then local offset_item_index = i + 1 local popup_menu = getMemoryViewForm().DisassemblerView.PopupMenu local menu_item = createMenuItem(popup_menu) menu_item.Caption = "Go to Offset" menu_item.ImageIndex = 35 menu_item.ShortCut = textToShortCut("Ctrl+F") menu_item.OnClick = function(s) go_to_address("disassembler", true) end popup_menu.Items.insert(offset_item_index, menu_item) item.OnClick = function() go_to_address("disassembler", false) end end end for i = 0, getMemoryViewForm().HexadecimalView.PopupMenu.items.count - 1 do local item = getMemoryViewForm().HexadecimalView.PopupMenu.items[i] if item.name == "Goto1" then local offset_item_index = i + 1 local popup_menu = getMemoryViewForm().HexadecimalView.PopupMenu local menu_item = createMenuItem(popup_menu) menu_item.Caption = "Go to Offset" menu_item.ImageIndex = 35 --menu_item.ShortCut = textToShortCut("Ctrl+F") --## ENABLE THIS IF YOU DISABLED OR DELETED THE HOTKEYS_TIMER SECTION ##-- menu_item.OnClick = function(s) go_to_address("memory_view", true) end popup_menu.Items.insert(offset_item_index, menu_item) item.OnClick = function() go_to_address("memory_view", false) end end end