Commit Graph

58 Commits

Author SHA1 Message Date
lockbox
c850db1125 Inherit architecture support from cfg features
While the bindings conditionally compile code based on the cfg
flags, we still include the architecture support in emitted rust
code. This patch removes the ability to refer to architectures
that cannot possibly be supported.
2024-03-27 17:30:53 -04:00
lockbox
30b99601d2 apply default rust 2021 formatting 2024-03-27 16:54:51 -04:00
Mark Giraud
00680412d3 feat: Add start and end address to rust block hook binding 2024-02-26 11:20:27 +01:00
Mark Giraud
ce1ee5ac4d refactor: Make clippy happy 2023-08-25 15:40:00 +02:00
Mark Giraud
fbe1b4421a feat: Add ctl_context_mode to rust bindings 2023-08-16 14:13:50 +02:00
Mark Giraud
fd3b7082b4 refactor: Make rust bindings more rusty 2023-08-15 11:04:50 +02:00
Mark Giraud
5fd12af68a formating: Use rustfmt style for rust bindings 2023-08-14 13:55:24 +02:00
Mark Giraud
5318fcda33 fix: Make from handle function unsafe 2023-08-14 13:38:26 +02:00
Mark Giraud
bb7df65a1c fix: Wrap uc_hook to not expose ffi types in public api 2023-08-14 10:38:27 +02:00
Mark Giraud
4e194a54d9 fix: Make functions that deref ptr unsafe 2023-08-11 13:18:04 +02:00
Mark Giraud
c43ab92326 fix: Add missing Copy derive 2023-07-26 09:58:09 +02:00
Mark Giraud
5a5b1bbb05 fix: update bitflags dependency and fix flippy warnings 2023-07-26 09:55:04 +02:00
239766aa66 Merge pull request #1849 from mlgiraud/fix/rust_compiler_warnings
Fix rust compiler warnings
2023-07-26 15:35:33 +08:00
Mark Giraud
546561f3cc fix: Remove unnecessary use statement that causes warnings 2023-07-18 11:49:18 +02:00
lockbox
2f2bf8d96f add cpu model to architectures for rust bindings 2023-07-13 13:58:14 -04:00
lockbox
84fe5d1756 expose ffi in rust bindings 2023-07-13 13:57:04 -04:00
Philipp Takacs
a9f0dabc64 rust add tlb callback 2023-04-05 18:57:22 +02:00
Philipp Takacs
0729dc0312 rust update uc_ctl_flush_tlb and add uc_ctl_tlb_mode 2023-04-05 18:57:15 +02:00
Kevin Schneider
5ff654c77b add rust bindings for uc_ctl 2023-04-05 18:48:39 +02:00
a07a83ac75 Merge pull request #1767 from PhilippTakacs/rustcallback
rust only add mmio callback funktion, if callback is requested
2023-01-24 21:46:40 +01:00
Takacs, Philipp
ed9164e47a rust only add mmio callback funktion, if callback is requested
The C function uc_mmio_map() allows to add seperate callback functions
and userdata for read and write. When the callback functions are NULL
unicorn don't try to call this functions.

Previous this patch, when i.e. read_callback was None the callback was set
to mmio_read_callback_proxy and the userdata was set to NULL. On a callback
the mmio_read_callback_proxy then tried to dereference the userdata and
caused a segfault.

fixes #1762
2023-01-23 13:22:55 +01:00
Luca Gladiator
aded30f5a8 Fix insn_in_hook_proxy return type 2023-01-21 13:50:11 +01:00
Luca Gladiator
014cee5bd1 Fix Rust binding memory leak 2023-01-18 10:52:35 +01:00
Mio
af1c661a12 Update bindings 2022-07-06 09:33:45 +08:00
Bet4
3cc9005a47 Add TriCore constants to Rust bindings 2022-05-11 17:29:03 +08:00
1cce884c40 Format 2022-04-23 22:41:59 +02:00
ca81d46ad5 Merge pull request #1574 from nviennot/dev
Rust bindings for insn_invalid_hook
2022-04-03 10:27:00 +02:00
ec808c94a7 Merge pull request #1575 from n1tram1/dev
Fix rust binding for insn_in hook callback
2022-04-03 00:42:45 +02:00
Martin Schmidt
9702e657a2 rust: return u32 from insn_in_hook callback 2022-03-26 15:41:37 +01:00
Nicolas Viennot
af8a409141 Rust bindings for insn_invalid_hook 2022-03-25 21:49:26 -04:00
Ilya Leoshkevich
28c4c665f0 Add "holes" to where the removed x86 registers used to be
A number of x86 registers were removed for #1440, causing a change in
numbering for many other registers. This is causing inconveniences at
the moment, e.g. it's not possible to use the Unicorn2 shared library
as a drop-in replacement for the Unicorn1 one.

Restore the old numbering.

Fixes #1492.
2022-03-22 11:31:58 +01:00
Bet4
504b31b928 Update constants of bindings 2022-02-19 21:24:40 +08:00
Bet4
394f25b1fa rust: Add get_handle to expose unicorn handle 2022-01-23 08:22:09 +08:00
Bet4
2977c9ca47 Support to pass unicorn handle to rust through FFI 2022-01-21 22:37:15 +08:00
Bet4
5559c097d5 rust: Allow to remove self inside a hook 2022-01-17 21:56:33 +08:00
Sven Bartscher
59fb8a2733 rust: Add RISCV CSR registers
The addition of these registers in the C base caused the rust values
for all floating point registers and the PC to point to some of the
CSR registers instead.
2021-11-30 16:09:24 +01:00
Sven Bartscher
a237505adb rust: Implement deallocation of MMIO callbacks
Previously the user data of MMIO callbacks would live until the end of
the containing Unicorn engine. Now they are deallocated once all
memory referencing those callbacks has been unmapped.
2021-11-24 12:15:20 +01:00
Sven Bartscher
20d97a0c00 Add map_mmio to rust bindings 2021-11-24 12:15:20 +01:00
Dominik Maier
67cd9b1c2f fixed doc tests 2021-11-10 04:49:27 +01:00
Dominik Maier
7adcced19b cleanup 2021-11-10 04:26:56 +01:00
Dominik Maier
7873e60740 reverted unfinished commit 2021-11-10 04:21:30 +01:00
Dominik Maier
a231440cf8 reverted build.rs 2021-11-10 04:14:56 +01:00
Dominik Maier
177b21c2af removed need for extra api; no_std 2021-11-10 04:11:14 +01:00
Dominik Maier
492779d7d4 fixed context 2021-11-09 16:19:27 +01:00
Dominik Maier
3b0ce89a7a missing pcs 2021-11-09 16:09:02 +01:00
Dominik Maier
a3e139847d reapply missing changes 2021-11-09 16:04:59 +01:00
Dominik Maier
d7ead41a51 fixed testcases 2021-11-09 14:49:18 +01:00
Dominik Maier
0dfc0cba1f removed duplicate 2021-11-08 19:39:15 +01:00
Dominik Maier
a8f9655189 lifetime 2021-11-08 19:37:38 +01:00
Dominik Maier
f8f0d4471f Unicorn rust bindings improvements 2021-11-08 19:34:53 +01:00