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
from idc import * | |
import idautils | |
import ida_allins | |
def find_call_with_arg(func_name, arg_no, arg_value): | |
func_ea = idaapi.get_name_ea(0, func_name) | |
for ref in idautils.CodeRefsTo(func_ea, 0): | |
arg_addrs = idaapi.get_arg_addrs(ref) |
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
from Crypto.Util.number import long_to_bytes, bytes_to_long, GCD | |
from random import randint | |
def recover_p_q(n, e, d): | |
k = d*e - 1 | |
if k & 1: | |
return -1 | |
t = 0 | |
r = k | |
while (r & 1 == 0): |
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
def _rol16(x, s): | |
return ((x << s) & 0xFFFF) | (x >> (16 - s)) | |
def _trans(x): | |
a = x & 0xff | |
b = (x >> 8) & 0xff | |
c = (x >> 16) & 0xff | |
d = (x >> 24) & 0xff | |
e = (x >> 32) & 0xff |