Пример #1
0
def apply_skin(init = False):

    with open(root_dir + "style_template.css", "r") as r:
        style = r.read()

    skin_values = config["current_skin"][:9] if init else (item[2] for item in buttons)

    for i, c in enumerate(item for item in skin_values):
    	style = style.replace("{%s}" % (i), "#" + c)

    for group in ("Disassembly", "Hex View", "Text input"):

        try: 
            s = QtCore.QSettings()
            s.beginGroup("Font")
            s.beginGroup(group)
            font_name = s.value("Name")
            font_size = s.value("Size")
            style = style.replace("{%s %s}" % (group, "Name"), font_name)
            style = style.replace("{%s %s}" % (group, "Size"), str(font_size))
        except:
            pass



    if not init:
        config["current_skin"] = [item[2] for item in buttons]
        save_config()

    set_style()

    QtWidgets.qApp.setStyleSheet(QtWidgets.qApp.styleSheet().split("/*IDA EA START*/")[0] + style)
Пример #2
0
def get_text(form, restart):

    global malloc_offset
    global main_arena_offset

    offsets = [
        form.lineEdit.text(),
        form.lineEdit_2.text(),
        form.lineEdit_3.text(),
        form.lineEdit_4.text()
    ]

    for x in range(4):
        if offsets[x][:2] == "0x":
            offsets[x] = int(offsets[x][2:], 16)
        else:
            offsets[x] = int(offsets[x])

    config["libc_offsets"] = offsets
    main_arena_offset, malloc_offset = offsets[:
                                               2] if int_size == 8 else offsets[
                                                   2:]
    b.close()
    save_config()

    if restart:
        ea_heap()
Пример #3
0
def save_preset_2(form_2, name_ui):

    name = form_2.lineEdit.text()
    form.comboBox.addItem(name)
    config["skins"].append([name] + [item[2] for item in buttons])
    save_config()
    form.comboBox.setCurrentIndex(len(config["skins"]) - 1)
    name_ui.close()
Пример #4
0
def toggle_match_background(state):
    config["match_background"] = True if state else False
    save_config()

    if state:
        buttons[9][0].setStyleSheet("background: #" + buttons[0][0].styleSheet().split("#")[1])
    else:
        buttons[9][0].setStyleSheet("background: #" + config["current_skin"][9])
Пример #5
0
def apply_skin():

    with open(root_dir + "style_template.css", "r") as r:
        style = r.read()

    for i, c in enumerate(item[2] for item in buttons):
        style = style.replace("{%s}" % (i), "#" + c)

    config["current_skin"] = [item[2] for item in buttons]
    save_config()

    QtGui.qApp.setStyleSheet(QtGui.qApp.styleSheet().split("/*IDA EA START*/")[0] + style)
Пример #6
0
def select_dir():

    config["trace_dir"] = QtWidgets.QFileDialog.getExistingDirectory()
    save_config()
    form.lineEdit.clear()
    form.lineEdit.insert(config["trace_dir"])
Пример #7
0
def change_stack_length(x):
    config["stack_display_length"] = x
    save_config()
Пример #8
0
def toggle_apply_onstartup(state):
    config["apply_skin_on_startup"] = True if state else False
    save_config()
Пример #9
0
def set_warning_display(state):
    config["show_rewind_warning"] = False if state else True
    save_config()