Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
athre0z committed Jun 21, 2018
2 parents 96a7307 + eb44569 commit 5acae46
Show file tree
Hide file tree
Showing 123 changed files with 950 additions and 1,614 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build-*
dist
.DS_Store
.vscode
*.pyc
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,14 @@ Changelog
- fixed issue with IDA installations with unaltered font-settings

### 1.4.0 -> 1.4.1:
- added support for IDA versions 6.9 and higher (Qt5)
- added support for IDA versions 6.9 and higher (Qt5)

### 1.4.1 -> 2.0.0:
- rewrote the entire plugin in Python
- ditches the madness of cross platform building native IDA plugins
- the theme selector now displays the path of the color theme
recommended to use with the IDASkins theme (contributed by @tostercx)
- updated the "IDASkins dark" CLR file to skin the output window correctly
- use IDA's registry API instead of QSettings
- dropped support for any IDA version older than 7.0
- various minor bug-fixes
58 changes: 0 additions & 58 deletions CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 athre0z
Copyright (c) 2018 Joel Höner <athre0z@zyantific.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
IDA Skins
=========

Plugin providing advanced skinning support for the Qt version of IDA Pro utilizing [Qt stylesheets](http://qt-project.org/doc/qt-4.7/stylesheet.html), similar to CSS.
Plugin providing advanced skinning support for IDA Pro utilizing [Qt stylesheets](http://qt-project.org/doc/qt-4.7/stylesheet.html), similar to CSS.

## Screenshot
![Screenshot 1](https://raw.githubusercontent.com/athre0z/ida-skins/master/media/screenshots/screencap1.png)
![Screenshot](https://raw.githubusercontent.com/athre0z/ida-skins/master/media/screenshots/screencap1.png)

Screenshot above shows the enclosed `stylesheet.css` in combination with the [idaConsonance](https://github.com/eugeneching/ida-consonance) theme.
The screenshot above shows the "IDASkins Dark" theme in combination with the [idaConsonance](https://github.com/eugeneching/ida-consonance) theme.

## Binary distribution
[Download latest binary version from github](https://github.com/athre0z/ida-skins/releases/latest)
## Download
[Download the latest version from GitHub](https://github.com/athre0z/ida-skins/releases/latest)

## Installation
Place `IDASkins.plX` into the `plugins` directory of your IDA installation. The theme files (the `skin` directory) needs to be copied to the root of your IDA installation.
Copy the contents of the `plugins` directory into the `plugins` directory of your IDA installation.

## Theming
Theming IDA using IDASkins works using [Qt stylesheets](http://qt-project.org/doc/qt-4.8/stylesheet.html). For information on the most important IDA-specific UI elements, take a look in the enclosed default `stylesheet.css`. **Pull-requests for new themes are very welcome!**
Theming IDA using IDASkins works using [Qt stylesheets](http://qt-project.org/doc/qt-4.8/stylesheet.html). For information on the most important IDA-specific UI elements, take a look in the enclosed default `stylesheet.qss`. **Pull-requests for new themes are very welcome!**
1 change: 0 additions & 1 deletion ida-cmake
Submodule ida-cmake deleted from 3ff015
Binary file modified media/screenshots/screencap1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions plugins/idaskins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import absolute_import, division, print_function

def PLUGIN_ENTRY(*args, **kwargs):
from idaskins.plugin import IdaSkinsPlugin
return IdaSkinsPlugin(*args, **kwargs)
8 changes: 8 additions & 0 deletions plugins/idaskins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import absolute_import, print_function, division

import os

PLUGIN_DIR = os.path.dirname(os.path.realpath(__file__))
IDA_DIR = os.path.abspath(os.path.join(PLUGIN_DIR, '..', '..'))
UI_DIR = os.path.join(PLUGIN_DIR, 'ui')
THEMES_DIR = os.path.join(PLUGIN_DIR, 'themes')
42 changes: 42 additions & 0 deletions plugins/idaskins/idafontconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from __future__ import absolute_import, division, print_function

import os

import idaapi
from PyQt5.QtGui import QFontDatabase

_type_key_table = {
'disas': 'Font\\Disassembly',
'hexview': 'Font\\Hex view',
'debug_regs': 'Font\\Debug registers',
'text_input': 'Font\\Text input',
'output_wnd': 'Font\\Output window',
}


class IdaFontConfig(object):
"""Read access to IDA's (undocumented) font config."""
def __init__(self, type):
self._key = _type_key_table[type]

@property
def family(self):
return idaapi.reg_read_string(
'Name',
self._key,
'Consolas'
if os.name == 'nt' else
QFontDatabase.systemFont(QFontDatabase.FixedFont).family()
)

@property
def size(self):
return idaapi.reg_read_int('Size', 10, self._key)

@property
def bold(self):
return idaapi.reg_read_bool('Bold', False, self._key)

@property
def italic(self):
return idaapi.reg_read_bool('Italic', False, self._key)
77 changes: 77 additions & 0 deletions plugins/idaskins/objectinspector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
from __future__ import absolute_import, division, print_function

import os

from idaskins import UI_DIR
from PyQt5 import uic
from PyQt5.Qt import qApp
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QCursor, QFont, QKeySequence
from PyQt5.QtWidgets import QShortcut, QWidget

Ui_ObjectInspector, ObjectInspectorBase = uic.loadUiType(
os.path.join(UI_DIR, 'ObjectInspector.ui')
)


class ObjectInspector(ObjectInspectorBase):
"""
Rudimentary Qt object inspector.
Allows for easier finding of object names and classes
for usage in QSS stylesheets.
"""
def __init__(self, *args, **kwargs):
super(ObjectInspector, self).__init__(*args, **kwargs)

self._selected_widget = None
self._ui = Ui_ObjectInspector()
self._ui.setupUi(self)

# Make everything monospace.
font = QFont('Monospace')
font.setStyleHint(QFont.TypeWriter)
self._ui.teInspectionResults.setFont(font)

# Register signals.
self._update_key = QShortcut(QKeySequence(Qt.Key_F7), self)
self._ui.btnSelectParent.released.connect(self.select_parent)
self._update_key.activated.connect(self.update_inspection)

def update_inspection(self):
widget = qApp.widgetAt(QCursor.pos())
self.update_selected_widget(widget)

def select_parent(self):
if self._selected_widget:
parent = self._selected_widget.parent()
if parent and parent.inherits('QWidget'):
self.update_selected_widget(parent)

def update_selected_widget(self, widget):
if self._selected_widget:
self._selected_widget.destroyed.disconnect(
self.on_selected_widget_destroyed
)

self._selected_widget = widget

if widget:
self._ui.btnSelectParent.setEnabled(widget.parent() is not None)
self._ui.teInspectionResults.setText((
"Type: {}\n"
"Name: {}\n"
"Number of children: {}"
).format(
widget.metaObject().className(),
widget.objectName() or '<none>',
len(widget.children()),
))

self._selected_widget.destroyed.connect(
self.on_selected_widget_destroyed
)
else:
self._ui.teInspectionResults.setText('<no object under cursor>')

def on_selected_widget_destroyed(self, obj):
self._selected_widget = None
Loading

0 comments on commit 5acae46

Please sign in to comment.