Skip to content

Instantly share code, notes, and snippets.

View lkmidas's full-sized avatar
🍃
The fallen leaves tell a story...

Dang (midas) Le lkmidas

🍃
The fallen leaves tell a story...
View GitHub Profile
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)
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):
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