Skip to content

Instantly share code, notes, and snippets.

@eternaleclipse
Last active November 9, 2019 02:15
Show Gist options
  • Save eternaleclipse/d113be1113b431596d8c5515807c88b9 to your computer and use it in GitHub Desktop.
Save eternaleclipse/d113be1113b431596d8c5515807c88b9 to your computer and use it in GitHub Desktop.
IDA Pro upload functions to Google Spreadsheet
# Go to https://console.developers.google.com/apis/api/sheets.googleapis.com/
# Grant access to Spreadsheet API, Create credentials for Service Account
# as Editor, download keyfile JSON
import gspread
import datetime
import time
from oauth2client.service_account import ServiceAccountCredentials
from idaapi import *
from idc import *
def get_sheet():
scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive']
keyfile = r'keyfile.json'
creds = ServiceAccountCredentials.from_json_keyfile_name(keyfile, scope)
client = gspread.authorize(creds)
return client.open('Notepad').sheet1
class Ida:
@staticmethod
def get_funcs():
ea = BeginEA()
functions = Functions(SegStart(ea), SegEnd(ea))
return [(GetFunctionName(addr), hex(addr)) for addr in functions]
def main():
sheet = get_sheet()
funcs = Ida.get_funcs()
print(funcs)
cells = sheet.range(1, 1, len(funcs), 2)
for cell in cells:
cell.value = funcs[cell.row - 1][cell.col - 1]
sheet.update_cells(cells)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment