-- 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 > 0 then for i = #disassembler_history, 1, -1 do items.add(disassembler_history[i]) end end end if type == "memory_view" then if #memory_view_history > 0 then for i = #memory_view_history, 1, -1 do items.add(memory_view_history[i]) end end end end local function centre_to_memory_view_form(form) local dpi = getScreenDPI() / 96 local memory_form = getMemoryViewForm() local memory_form_x, memory_form_y = memory_form.getPosition() local goto_form_x = memory_form_x + ((memory_form.width - form.width) / 2) local goto_form_y = memory_form_y + ((memory_form.height - form.height) / 2) form.setPosition(goto_form_x, goto_form_y) end local function go_to_address(type, offset) local version = {1, 3, 0, 0} local title_bar_colour = 0x181818 --BGR local form_colour = 0x242424 --BGR local bevel_colour = 0x303030 --BGR local font_colour = 0xBBBBBB --BGR local red_colour = 0x453ACC --BGR local dpi = getScreenDPI() / 96 local small_spacing = 4 * dpi local spacing = 8 * dpi local goto_form_caption = "Superior Go to Address by GHD" local default_label = "Enter an address" -- Create main window local goto_form = createForm(false) goto_form.Caption = goto_form_caption goto_form.AutoSize = true goto_form.Constraints.MaxHeight = 114 * dpi goto_form.Constraints.MinWidth = 400 * dpi goto_form.Height = 114 * dpi goto_form.Width = 400 * dpi goto_form.Constraints.MaxWidth = 1300 * dpi goto_form.Font.Color = font_colour goto_form.BorderStyle = 'bsNone' -- Create custom title bar local title_bar = createPanel(goto_form) title_bar.Align = alTop title_bar.Height = 26 * dpi title_bar.Color = title_bar_colour title_bar.BevelColor = bevel_colour title_bar.OnMouseDown = function(sender, button, x, y) if button == mbLeft then goto_form.dragNow() end end -- Create title label local title_label = createLabel(title_bar) title_label.Caption = goto_form_caption title_label.Font.Color = font_colour title_label.Font.Style = "fsBold" title_label.Font.Size = 9 title_label.Left = small_spacing title_label.AnchorSideTop.Control = title_bar title_label.AnchorSideTop.Side = asrCenter title_label.BorderSpacing.Left = small_spacing title_label.OnMouseDown = function(sender, button, x, y) if button == mbLeft then goto_form.dragNow() end end -- Create main panel local main_panel = createPanel(goto_form) main_panel.Align = alClient main_panel.ClientHeight = goto_form.ClientHeight main_panel.ClientWidth = goto_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(title_bar) version_label.Caption = "v"..version[1].."."..version[2].."."..version[3].."."..version[4] version_label.font.Color = red_colour version_label.font.Style = "fsBold" version_label.font.size = 8 version_label.Anchors = "akTop, akRight" version_label.AnchorSideRight.Control = title_bar version_label.AnchorSideRight.Side = asrRight version_label.AnchorSideTop.Control = title_bar version_label.AnchorSideTop.Side = asrCenter version_label.BorderSpacing.Right = small_spacing -- Create button panel local button_panel = createPanel(goto_form) button_panel.ClientHeight = 40 * dpi button_panel.Align = alBottom button_panel.BevelColor = bevel_colour -- Create cancel button local cancel_button = createButton(button_panel) cancel_button.Caption = "Cancel" cancel_button.Width = 75 * dpi cancel_button.Height = 25 * dpi cancel_button.Anchors = "akTop, akRight" cancel_button.AnchorSideRight.Control = button_panel cancel_button.AnchorSideRight.Side = asrRight cancel_button.AnchorSideTop.Control = button_panel cancel_button.AnchorSideTop.Side = asrCenter cancel_button.BorderSpacing.Left = spacing cancel_button.BorderSpacing.Right = spacing cancel_button.OnClick = function() goto_form.close() end -- Create go button local go_button = createButton(button_panel) go_button.Caption = "Go" go_button.Width = 75 * dpi go_button.Height = 25 * dpi go_button.Anchors = "akTop, akRight" go_button.AnchorSideRight.Control = cancel_button go_button.AnchorSideTop.Control = cancel_button go_button.AnchorSideTop.Side = asrCenter 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 if disassembler_history[#disassembler_history] ~= inputbox.text then table.insert(disassembler_history, inputbox.text) end end if type == "memory_view" then getMemoryViewForm().HexadecimalView.Address = address if memory_view_history[#memory_view_history] ~= inputbox.text then table.insert(memory_view_history, inputbox.text) end end goto_form.close() end -- Create offset checkbox local offset_checkbox = createCheckBox(button_panel) local initial_offset_input = "" offset_checkbox.Caption = "Go to Offset" offset_checkbox.left = spacing offset_checkbox.AnchorSideTop.Control = cancel_button offset_checkbox.AnchorSideTop.Side = asrCenter offset_checkbox.Constraints.MinWidth = 80 * dpi offset_checkbox.Constraints.MaxHeight = 19 * dpi 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.AnchorSideTop.Control = cancel_button module_symbol_checkbox.AnchorSideTop.Side = asrCenter module_symbol_checkbox.AnchorSideLeft.Control = offset_checkbox module_symbol_checkbox.AnchorSideLeft.Side = asrBottom module_symbol_checkbox.Constraints.MinWidth = 110 * dpi module_symbol_checkbox.Constraints.MaxHeight = 19 * dpi module_symbol_checkbox.setAllowGrayed(true) module_symbol_checkbox.onChange = function() inputbox.text = alias(inputbox.text) if readInteger("kernel32.dll") == nil or getAddressSafe(inputbox.text) == nil then module_symbol_checkbox.state = cbUnchecked return end -- check if attached to a process & if it's a valid address 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 = 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 = 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 goto_form.close() end end -- Disable this section if you get 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 goto_form.Close() end collectgarbage("count") end hotkeys_timer.Enabled = true --]] -------------------- End of section -------------------- centre_to_memory_view_form(goto_form) goto_form.showModal() 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