Last active
November 9, 2019 02:15
-
-
Save eternaleclipse/d113be1113b431596d8c5515807c88b9 to your computer and use it in GitHub Desktop.
IDA Pro upload functions to Google Spreadsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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