You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromunicornimport*fromunicorn.x86_constimport*#Uc(UC_ARCH_X86, UC_MODE_16) can't change ip usefully?# 16-bit code to be executed (example: simple infinite loop)# Memory address where emulation startsADDRESS=0x1000defhook_code(uc, address, size, user_data):
# Read the current instruction pointerip=uc.reg_read(UC_X86_REG_IP)
print(f"IP: {ip:#04x}")
# Hook condition: jump to a new address if IP is at specific locationifip==ADDRESS:
new_ip=0x1002uc.reg_write(UC_X86_REG_IP, new_ip)
print('ok?')
defmain():
CODE=b'\xeb\xfe'*1024# JMP $mu=Uc(UC_ARCH_X86, UC_MODE_16)
mu.mem_map(ADDRESS, 2*1024*1024)
mu.mem_write(ADDRESS, CODE)
mu.hook_add(UC_HOOK_CODE, hook_code)
try:
mu.emu_start(ADDRESS, ADDRESS+len(CODE))
exceptUcErrorase:
print(f"ERROR: {e}")
if__name__=='__main__':
main()
maybe i just make a mistake
environment:win10,x86.
PS D:\Vscode\spark> pip show unicorn
Name: unicorn
Version: 2.0.1.post1
The text was updated successfully, but these errors were encountered:
maybe i just make a mistake
environment:win10,x86.
PS D:\Vscode\spark> pip show unicorn
Name: unicorn
Version: 2.0.1.post1
The text was updated successfully, but these errors were encountered: