Files
Richard Liebigandr0b0t 455aae2a8e Remove the size limit for memory read and write (revamped) (#2144)
* modify uc_priv.h to use 64 bit hwaddr type for length for uc_write_mem_t and uc_read_mem_t

* propogate 64 bit address support to memory function inside unicorn.h

* modify physical memory functions to ensure 64 bit support for size parameters

* apply  uint64_t size handling inside the memory handling main functions

* remove INT_MAX size check as we now use a 64 bit address

* add @secretnonempty unit test for large memory addresses to avoid regression

* replace size_t in python3 bindings with u64

* adjust rust bindings

* use format.sh script to improve formatting

* small adjustments to java bindings, because jlong type is sometimes already used

* adjust dotnet bindings to reflect new type sizes

* adjust pascal bindings

* adjust ruby bindings

* adjust vb6 bindings

* adjust zig bindings for 64 bit size support

* fix build.zig.zon for newer zig versions

* add haskell binding support for 64 bit sizes

* use mlugg/setup-zig instead of goto-bus-stop/setup-zig github action to get access to current zig releases

* use uint64_t instead of size_t for uc_mem_unmap

* add whitespace between functions to preserver formatting

* add precompiler check for android and abort execution of testcase to avoid infinite low memory killer loop

* downgrade zig version to 0.14.0 again to ensure that pipeline can run through

* adjust rust mmio_unwrap type to use u64

* change ffi size type of uc_mem_map_ptr into u64

* add warning to rust slicing

* return read_mem_as_vec to earlier state, leave usize as argument because there cannot be larger vec![] anyway

* adjust regions inside MmioCallbackScope to use u64 for region sizes

* adjust regions inside MmioCallbackScope to use u64 for region sizes inside search vec

* finalize dotnet bindings inside IBinding.fs

* fix typo

* adjust types inside Unicorn.fs

* finalize type wrangling inside F# bindings, setting MemRead and MemWrite to correct types

* fix missing bracket inside bindings/rust/src/lib.rs

* replace ffi interface to hook interface inside rust lib

* fix testcases to use u64 for longer references

Co-authored-by: r0b0t <[email protected]>
2025-04-15 11:42:40 +08:00
..

Unicorn engine bindings for VB6 

A sample class for the 32bit x86 emulator is provided.

Contributed by: FireEye FLARE team
Author:         David Zimmer <[email protected]>, <[email protected]>
License:        Apache 2.0

' supported api: 
'        ucs_version
'        ucs_arch_supported
'        ucs_open
'        ucs_close
'        uc_reg_write
'        uc_reg_read
'        uc_mem_write
'        UC_MEM_READ
'        uc_emu_start
'        uc_emu_stop
'        ucs_hook_add
'        uc_mem_map
'        uc_hook_del
'        uc_mem_regions
'        uc_mem_map_ptr
'        uc_context_alloc
'        uc_free
'        uc_context_save
'        uc_context_restore
'        uc_mem_unmap
'        uc_mem_protect
'        uc_strerror
'        uc_errno
'
' supported hooks:
'        UC_HOOK_CODE
'        UC_HOOK_BLOCK
'        memory READ/WRITE/FETCH
'        invalid memory access
'        interrupts
'
' bonus:
'        disasm_addr     (conditional compile - uses libdasm)
'        mem_write_block (map and write data auto handles alignment)
'        get_memMap      (wrapper for uc_mem_regions)
'

dependancies: (all in same directory or unicorn package in %windir%)
   vb6Test.exe
     ucvbshim.dll           _
       unicorn.dll           -
         libgcc_s_dw2-1.dll   \
         libiconv-2.dll        \__ unicorn package
         libintl-8.dll         /
         libpcre-1.dll        /
         libwinpthread-1.dll_-

Notes:

   c dll was built using VS2008
   build notes are included at the top of main.c
   this dll serves as a stdcall shim so vb6 can access the cdecl api and receive data from the callbacks.
 
   huge thanks to the unicorn and qemu authors who took on a gigantic task to create this library!