diff --git a/idarling/core/core.py b/idarling/core/core.py index 6ba115b..b031066 100644 --- a/idarling/core/core.py +++ b/idarling/core/core.py @@ -65,7 +65,7 @@ def __init__(self, plugin): self._group = None self._project = None self._database = None - self._tick = 0 + self._tick = -1 self._users = {} self._idb_hooks = None @@ -241,8 +241,8 @@ def unhook_all(self): def load_netnode(self): """ Load data from our custom netnode. Netnodes are the mechanism used by - IDA to load and save information into a database. IDArling uses its own - netnode to remember which project and database a database belongs to. + IDA to load and save information into an idb. IDArling uses its own + netnode to remember which group, project and database an idb belongs to. """ node = ida_netnode.netnode(Core.NETNODE_NAME, 0, True) @@ -269,7 +269,9 @@ def save_netnode(self): node.hashset_buf("project", str(self._project)) if self._database: node.hashset_buf("database", str(self._database)) - if self._tick: + # We need the test to be non-zero as we need to reset and save tick=0 + # when saving an IDB to a new snapshot + if self._tick != -1: node.hashset_buf("tick", str(self._tick)) self._plugin.logger.debug( diff --git a/idarling/core/hooks.py b/idarling/core/hooks.py index 2f6e9a0..e3e5d59 100644 --- a/idarling/core/hooks.py +++ b/idarling/core/hooks.py @@ -497,7 +497,8 @@ def extra_cmt_changed(self, ea, line_idx, cmt): return 0 def item_color_changed(self, ea, color): - self._plugin.logger.debug("item_color_changed() not implemented yet") + # See #31 on fidgetingbits/IDArling + #self._plugin.logger.debug("item_color_changed() not implemented yet") return 0 def callee_addr_changed(self, ea, callee): diff --git a/idarling/interface/actions.py b/idarling/interface/actions.py index 0bcbcdc..5f5e16f 100644 --- a/idarling/interface/actions.py +++ b/idarling/interface/actions.py @@ -295,7 +295,8 @@ class SaveActionHandler(ActionHandler): @staticmethod def upload_file(plugin, packet): - # Save the current database + # Save the current database with a tick=0 since it is a new snapshot + plugin.core.tick = 0 plugin.core.save_netnode() input_path = ida_loader.get_path(ida_loader.PATH_TYPE_IDB) ida_loader.save_database(input_path, 0) diff --git a/idarling/shared/sockets.py b/idarling/shared/sockets.py index 1df8537..3191f9f 100644 --- a/idarling/shared/sockets.py +++ b/idarling/shared/sockets.py @@ -21,7 +21,9 @@ from PyQt5.QtCore import QCoreApplication, QEvent, QObject, QSocketNotifier from .packets import Container, Packet, PacketDeferred, Query, Reply - +from ..shared.commands import ( + UpdateLocation, +) class PacketEvent(QEvent): """ @@ -324,7 +326,9 @@ def send_packet(self, packet): self._logger.warning("Sending packet while disconnected") return None - self._logger.debug("Sending packet: %s" % packet) + # UpdateLocation are sent very often so not logging + if not isinstance(packet, UpdateLocation): + self._logger.debug("Sending packet: %s" % packet) # Enqueue the packet self._outgoing.append(packet)