102 Commits
Author SHA1 Message Date
ptitSeb 3c98cbccbe Bumped to v0.1.8 2020-12-16 07:58:23 +01:00
ptitSeb 3a5c6751e2 Many fixes to Double->Int x87 opcodes ([DYNAREC] too) 2020-12-15 15:53:38 +01:00
ptitSeb 002d3d7b9b This also fixes 66 D9 and 66 DD opcodes 2020-12-15 15:52:53 +01:00
ptitSeb e57a66da04 [DYNAREC] Fixed AAD opcode 2020-12-15 15:51:13 +01:00
ptitSeb b1ecad2d49 Fixed 66 D9 and 66 DD opcodes 2020-12-15 15:50:18 +01:00
ptitSeb 658a107f60 Better log for FE xx and FF xx Illegal Instructions on interpretor 2020-12-15 15:49:39 +01:00
ptitSeb 7b419ce5f1 Fix a callback for pulse audio (help #268, seems to be working now) 2020-12-15 15:40:58 +01:00
ptitSeb 367df08989 Fix Zoom hack for libturbojpeg.so (for #268) 2020-12-15 07:59:04 +01:00
ptitSeb 2004006a9d Added Zoom detection and hack to first try to use system libturbojpeg.so if loaded (still for #268) 2020-12-14 21:45:57 +01:00
ptitSeb bed0f24f2b Wrapped libturbojpeg.so.0 with a small set of functions (should help #268) 2020-12-14 20:48:56 +01:00
ptitSeb 7995dfc70a Fixed a potential SIGBUS on DF /7 FISTP opcode 2020-12-14 14:12:43 +01:00
ptitSeb b29d569f6b Reworked libpulse wrappers (should be more stable and little tad faster) 2020-12-14 12:22:39 +01:00
ptitSeb 3c166c438a [DYNAREC] Added BOX86_DYNAREC_SAFEMMAP (can be usefull to speedup Wine progs, but may also introduce crash) 2020-12-13 20:25:55 +01:00
ptitSeb 03dac0ef6a [DYNAREC] Use a table read that is not thread safe in linker (I don't think thread safe is a must-have in this case) 2020-12-13 19:26:31 +01:00
ptitSeb 27cb5219ae [DYNAREC] Various simplifications 2020-12-13 19:24:27 +01:00
ptitSeb 97a7459f5d [DYNAREC] Small optims 2020-12-13 16:12:17 +01:00
ptitSeb 1eac337e59 [DYNAREC] Don't flush dynarec_log 2020-12-13 16:11:59 +01:00
ptitSeb 1613358927 [DYNAREC] Fixed a type is FS: Cache handling (should give back some speed on Wine stuff) 2020-12-13 15:38:32 +01:00
ptitSeb 2f0da26f14 [DYNAREC] Presize dblists 2020-12-13 14:21:05 +01:00
ptitSeb 45fa32cb9d [DYNAREC] Small fixes for cancelled dynablock 2020-12-13 14:19:56 +01:00
ptitSeb 9e9f2a37be [DYNAREC] Precalc exact instsize array size 2020-12-13 14:19:04 +01:00
ptitSeb 7b37bb6825 [DYNAREC] simplify this structure 2020-12-13 14:18:36 +01:00
ptitSeb 081378a178 Added empty wrapped libnsl.so 2020-12-13 10:05:28 +01:00
ptitSeb ff72343429 [DYNAREC] Removed a debug leftover 2020-12-13 10:04:57 +01:00
ptitSeb b0b8a2ca1c Fixed a warning 2020-12-13 09:09:35 +01:00
ptitSeb 55be6835b8 Removed a debug leftover (should help #227 and box-compatibility-list/#46) 2020-12-13 08:38:43 +01:00
ptitSeb c465e1de21 [VULKAN] fixed SDL2 wrapping of SDL_Vulkan_GetVkGetInstanceProcAddr 2020-12-12 19:50:04 +01:00
ptitSeb 0f255de201 Made box86context_t lighter for easier debugging (also reorganised member order) 2020-12-12 19:50:04 +01:00
ptitSeb deb04610b5 Revert commit 31a108b685, previous method seems better 2020-12-12 19:25:53 +01:00
ptitSeb a9887fe471 Fixed an old type on Bridge handling 2020-12-12 17:09:35 +01:00
ptitSeb 4b3c5a7f6f [DYNAREC] Reworked Dynablock memory manager 2020-12-12 15:24:05 +01:00
ptitSeb 0058d3563d Added 66 F0 0F B1 opcode 2020-12-12 10:18:13 +01:00
ptitSeb 52a4808f2c Added a few more function to wrapped libfontconfig 2020-12-12 10:09:17 +01:00
ptitSeb 7a0874165f Added 1 wrapped function to libfontconfig 2020-12-12 09:37:44 +01:00
ptitSeb 7c7acd134b Small wrapped libmpg123 and pulse change 2020-12-11 22:27:43 +01:00
ptitSeb ddd4874baa [DYNAREC] Some small optim on support function for the Dynarec 2020-12-11 21:04:11 +01:00
ptitSeb 23f91b1a0d [DYNAREC] All Interpretor to switch back to Dynarec on more opcodes 2020-12-11 20:47:23 +01:00
ptitSeb b8c32d580b [DYNAREC] If a block wasn't created because executable memory was not allocated, delete the whole dynablocks to try again later 2020-12-11 20:35:39 +01:00
ptitSeb c0e67004d5 [DYNAREC] Reworked the dynarec signal handling, to improve its performances 2020-12-11 20:25:24 +01:00
ptitSeb 38a557b7e9 [DYNAREC] Don't try to create 0 sized Map block 2020-12-11 17:28:32 +01:00
ptitSeb 7d6d5d673d [DYNAREC] added 64 A2 opcode 2020-12-11 17:27:23 +01:00
ptitSeb 2cf067f004 [DYNAREC] Don't try to a free a 0 sized of NULL pos Map 2020-12-11 17:27:08 +01:00
ptitSeb 92d9bc525f [DYNAREC] Try to avoid some deadlock with dynarec that could happens in some specific cases involving signals 2020-12-11 16:43:25 +01:00
ptitSeb dca91b1efc added 64 A0 opcode ([DYNAREC] too) 2020-12-11 16:32:14 +01:00
ptitSeb 6bf1ea7539 [DYNAREC] Remove some old code behind ifdefs 2020-12-11 14:23:18 +01:00
ptitSeb 670b13595b Improved the PltRelocator detection of elfloader 2020-12-10 17:14:17 +01:00
ptitSeb dcbb8b29de Added some X11 wrapped functions 2020-12-10 17:12:40 +01:00
ptitSeb 7284c817b2 And more libxcb* wrapped functions 2020-12-10 17:05:54 +01:00
ptitSeb b16912132f Added some xcb_xrandr wrapped functions 2020-12-10 15:44:53 +01:00
ptitSeb 9805ad7f3a Initialize context as soon as possible in library (should help #265 and #266) 2020-12-10 15:11:26 +01:00
ptitSeb 4e7e0f6aab Added a few libdrm wrapped function 2020-12-10 13:56:24 +01:00
ptitSeb c905ebfdd2 Added wrapped libSDL2_ttf-2.0.so.0 (copy if the sdl1 version) 2020-12-10 13:51:31 +01:00
ptitSeb b5c787938c Fixed commented code, in case it gets uncommented someday 2020-12-10 13:38:59 +01:00
ptitSeb 69ca5351b4 Added a bunch of wrapped xcb* functions 2020-12-10 12:35:52 +01:00
ptitSeb 3f42372603 Added liblcms2 wrapped lib (partial wrapping, just enough for wine) 2020-12-09 15:54:33 +01:00
ptitSeb 595028e9ec Reworked Exit, to avoid segfault and lockup and end of execution 2020-12-09 11:25:14 +01:00
ptitSeb 7358a049ef Huge refactoring (again), completly removed old Callback mecanism (working to have only 1 x86emu_t structure per thread, almost there) 2020-12-08 22:38:51 +01:00
ptitSeb 792aeda72e Be more smart to when to apply PltRelacator or not (fix SuperHexagon's libGLEW loading) 2020-12-08 21:44:21 +01:00
ptitSeb 53bf2d277b Added wrapped libldap_r and liblber 2020-12-08 08:10:02 +01:00
ptitSeb 0cbc55ba24 Fix potential build error on old system (at least with old headers) 2020-12-08 07:56:18 +01:00
ptitSeb 7b0d228972 Added a few XTandr wrapped functions 2020-12-08 07:54:40 +01:00
ptitSeb 8ac0b66836 Improved Segment offset Cache, and enable GS: caching (some speed boost on Linux apps) 2020-12-07 13:56:29 +01:00
ptitSeb 2756b1b9dd [DYNAREC] fixed some warning and a typo from last commit 2020-12-06 22:31:15 +01:00
ptitSeb e3f44bae26 [DYNAREC] Huge refactor to simplify Dynablock handling 2020-12-06 21:52:27 +01:00
ptitSeb 1963589186 Mooore Thread Cancel slots 2020-12-06 21:14:38 +01:00
ptitSeb a5c9675b84 [DYNAREC] Removed Mark mecanism (it needs mutex to run properly, so it's too heavy) 2020-12-06 15:13:40 +01:00
ptitSeb 76747d5c38 [DYNAREC] Immprove log for SMC debugging option 2020-12-06 15:12:36 +01:00
ptitSeb 59bfeb9fb2 [DYNAREC] This barrier optimization seems to break Mono on Linux, so reverting it for now 2020-12-06 13:15:09 +01:00
ptitSeb c40669b429 [DYNAREC] Optimized AddMark function to not redo what is already done 2020-12-05 23:22:09 +01:00
ptitSeb d83cdbfeeb Fixed a potential segfault 2020-12-05 23:21:29 +01:00
ptitSeb d8773e96d6 Not sure if awesomium_process needs or not emulated libpng12. Commenting for now 2020-12-05 20:59:24 +01:00
ptitSeb 78571698c2 Some improvements in wrapped libpng handling 2020-12-05 19:43:52 +01:00
ptitSeb 77282f1ff1 Added one more wrapped function to libglib2 2020-12-05 17:07:57 +01:00
ptitSeb 953fcb7f1b Fixed handling of TLS object with a 0 offset (help Garry's Mod, probably a few other too) 2020-12-05 16:59:08 +01:00
ptitSeb 1905e4a7f6 Better handling of libtcmalloc_minimum.so.4 2020-12-05 16:15:35 +01:00
ptitSeb 31e6ae0705 Improved the BOX86_NOBANNER behaviour 2020-12-05 12:49:17 +01:00
ptitSeb 31a108b685 Change method used for Thread Cancel registeration 2020-12-04 21:47:39 +01:00
ptitSeb b122c68b16 Improved a bit XImage handling 2020-12-04 21:47:04 +01:00
ptitSeb 0efae1fdf5 Added BOX86_NOGTK to disable use of wrapped gtk libs (can be used with Steam) 2020-12-04 19:52:10 +01:00
ptitSeb 0850180861 Fixed and improved wrapped libdbus-1 2020-12-04 19:49:25 +01:00
ptitSeb 528478b379 Improved a bit wrapped libusb-1 2020-12-04 17:55:30 +01:00
ptitSeb 65302010db Small remork on cancel tread registration mecanism (should fix memory leaks) 2020-12-03 12:01:07 +01:00
ptitSeb 6b32440347 Small fix (mostly cosmetic) in a pthread wrapped function signature 2020-12-03 12:00:32 +01:00
ptitSeb 5a0b6c419e [DYNAREC] Fixed some memory leak 2020-12-03 11:59:43 +01:00
ptitSeb 94c5d0205b fixed some warning 2020-12-03 11:58:49 +01:00
ptitSeb 0f2998a672 More libxml2 wrapping improvment for wine 2020-12-02 21:39:27 +01:00
ptitSeb 1ba7936ef7 Improve wrapping of libxml2 (especially for wine msxml3.dll.so) 2020-12-02 21:16:19 +01:00
ptitSeb 5192aacb22 [RPI] Added runtime hack to get TokiTori2+ running on Pi 2020-12-01 15:13:22 +01:00
ptitSeb ac2adcaf52 A bit more logs when function name is not found 2020-12-01 15:01:12 +01:00
ptitSeb 1b3e707f62 Added SDL_LogGetOutputFunction to wrapped libsdl2 and refactored remaining callback functions 2020-12-01 08:59:01 +01:00
ptitSeb 925fc67c66 Fixed a typo in wrapped libxml2 2020-12-01 08:33:47 +01:00
ptitSeb 54ce6deb1c Wrapped libxslt (should help #259) 2020-11-30 20:02:57 +01:00
ptitSeb 754859d28a Wrapped libxml2 (should help #259) 2020-11-30 18:42:09 +01:00
ptitSeb 269bc9e289 [DYNAREC] Disable one of the new optim, it breaks some installer 2020-11-29 17:26:54 +01:00
ptitSeb 35c768c040 [DYNAREC] Fixed an issue with an optimisation that was too agressive 2020-11-29 13:51:11 +01:00
ptitSeb ff45cfed83 [DYNAREC] Various fixes on some dynarec optimisation mecanism 2020-11-28 16:07:04 +01:00
ptitSeb 38c5c1c17a [DYNAREC] Added 64 FF /2 CALL FS:Ed opcode 2020-11-28 15:32:22 +01:00
ptitSeb 423b301596 Added syscal 356 (and code to emulate it if not present) 2020-11-28 12:26:40 +01:00
ptitSeb 000c11f9ea [PANDORA] Added basic implementation of renameat2 2020-11-28 12:17:12 +01:00
ptitSeb cea4a02ad9 Fixed RPATH handling when a list of path was set 2020-11-28 11:10:01 +01:00
ptitSeb 4e9bc39381 [DYNAREC] Some rework on dynablock management 2020-11-27 17:40:16 +01:00
ptitSeb ad084da13d Start a new dev. cycle with v0.1.7 2020-11-27 10:18:13 +01:00
157 changed files with 9685 additions and 3337 deletions

No files matched your search

+15
View File
@@ -1,3 +1,18 @@
v0.1.8
======
* Fixes on some float to int x87 convertions opcodes
* Reworked all callback mecanisms
* Added libturbojpeg wrapping (and a hack for zoom to force using native one)
* Added BOX86_SAFEMMAP env. var.
* Reworked dynarec memory manager
* Added a few opcodes
* Improve elfloader to not force PltResolver all the time (fixing SuperHexagon and maybe other)
* Reworked Exet and Cancel Thread mecanism
* Added wrapped libldap_r and liblber library (used by wine)
* Reworked Dynarec block handling, and remove the "AddMark" mecanism that wasn't efficient enough
* Added TokiTori 2+ detection and runtime patch on PI
* Fixes on elfloader with TLS object
v0.1.6
======
* Changes in Dynarec to make flags optimizations before CALL and RET opcode less aggressive
+8
View File
@@ -232,6 +232,7 @@ set(WRAPPEDS
"${BOX86_ROOT}/src/wrapped/wrappedsdl2.c"
"${BOX86_ROOT}/src/wrapped/wrappedsdl2mixer.c"
"${BOX86_ROOT}/src/wrapped/wrappedsdl2image.c"
"${BOX86_ROOT}/src/wrapped/wrappedsdl2ttf.c"
"${BOX86_ROOT}/src/wrapped/wrappedsmpeg.c"
"${BOX86_ROOT}/src/wrapped/wrappedsmpeg2.c"
"${BOX86_ROOT}/src/wrapped/wrappedvorbisfile.c"
@@ -273,6 +274,7 @@ set(WRAPPEDS
"${BOX86_ROOT}/src/wrapped/wrappedalut.c"
"${BOX86_ROOT}/src/wrapped/wrappedlibjpeg.c"
"${BOX86_ROOT}/src/wrapped/wrappedlibjpeg62.c"
"${BOX86_ROOT}/src/wrapped/wrappedturbojpeg.c"
"${BOX86_ROOT}/src/wrapped/wrappedcurl.c"
"${BOX86_ROOT}/src/wrapped/wrappedudev0.c"
"${BOX86_ROOT}/src/wrapped/wrappedudev1.c"
@@ -329,6 +331,12 @@ set(WRAPPEDS
"${BOX86_ROOT}/src/wrapped/wrappedd3dadapter9.c"
"${BOX86_ROOT}/src/wrapped/wrappedvulkan.c"
"${BOX86_ROOT}/src/wrapped/wrappedwaylandclient.c"
"${BOX86_ROOT}/src/wrapped/wrappedxml2.c"
"${BOX86_ROOT}/src/wrapped/wrappedxslt.c"
"${BOX86_ROOT}/src/wrapped/wrappedldapr.c"
"${BOX86_ROOT}/src/wrapped/wrappedlber.c"
"${BOX86_ROOT}/src/wrapped/wrappedlcms2.c"
"${BOX86_ROOT}/src/wrapped/wrappednsl.c"
"${BOX86_ROOT}/src/wrapped/wrappedldlinux.c"
)
+1
View File
@@ -94,6 +94,7 @@ Linux Steam can run now with box86. But it's still a bit unstable., and not ever
Once open, Steam will only work on "Small mode" and in "Big Picture", not in the regular "Browser mode". So go in the "View" menu and witch to Small view (or Compact view?), else the list will stay empty (this is because some steam component used in the browser view are only 64bits now).
Final word, to avoid the "libc.so.6 is absent" message, you can use `STEAMOS=1` and `STEAM_RUNTIME=1` export.
(Steam for Windows install fine but doesn't work yet)
Some steam games (most of Source engine one, like "Portal" or "Half-Life 2") use libtcmalloc. Box86 will detect it's use and will try to LD_PRELOAD it, for better compatibility. While it should work without, it is better to add it to your system if you intend to play those game (something like `sudo apt install libtcmalloc-minimal4` on debian familly)
----
+9
View File
@@ -108,6 +108,10 @@ Set level of DynaRec log
* 0 : Disable Dynarec Linker (use that on debug, with dynarec log >= 2, to have detail on wich block get executed)
* 1 : Enable Dynarec Linker (default)
#### BOX86_DYNAREC_SAFEMMAP
* 0 : Default. Some mmp/mmap64 are consider unsafe (depending of flags mainly)
* 1 : Consider all mmap/mmap64 safe to use linker (potential speedup, but potential crash for apps using JIT/Dynarec)
#### BOX86_DYNAREC_TRACE
* 0 : Disable trace for generated code (default)
* 1 : Enable trace for generated code (like regular Trace, this will slow down a lot and generate huge logs)
@@ -136,6 +140,11 @@ Disable the load of pulseaudio libs
* 0 : default, load pulseaudio libs if present
* 1 : disable the load of pulse audio libs (libpulse and libpulse-simple), both native and x86 version
#### BOX86_NOGTK
Disable the load of wrapped gtk libs
* 0 : default, load wrapped gtk libs if present
* 1 : disable the load of wrapped gtk libs (can be used with Steam, along with STEAM_RUNTIME=1 to use i386 versio of gtk)
#### BOX86_FIX_64BIT_INODES
* 0 : Don't fix 64bit inodes (default)
* 1 : Fix 64bit inodes. Helps when running on filesystems with 64bit inodes, the program uses API functions which don't support it and the program doesn't use inodes information.
+281 -154
View File
@@ -22,192 +22,303 @@
#ifdef DYNAREC
#include <sys/mman.h>
#include "dynablock.h"
#include "khash.h"
#define MMAPSIZE (4*1024*1024) // allocate 4Mo sized blocks
#define MMAPBLOCK 256 // minimum size of a block
//#define USE_MMAP
#define MMAPSIZE (256*1024) // allocate 256kb sized blocks
// init inside dynablocks.c
KHASH_MAP_INIT_INT(dynablocks, dynablock_t*)
typedef union mark_s {
struct {
unsigned int fill:1;
unsigned int size:31;
};
uint32_t x32;
} mark_t;
typedef struct blockmark_s {
mark_t prev;
mark_t next;
} blockmark_t;
typedef struct mmaplist_s {
void* block;
uint8_t map[MMAPSIZE/(8*MMAPBLOCK)]; // map of allocated sub-block
void* block;
int maxfree;
kh_dynablocks_t* dblist;
} mmaplist_t;
// get first subblock free in map, stating at start. return -1 if no block, else first subblock free, filling size (in subblock unit)
static int getFirstBlock(mmaplist_t *map, int start, int maxsize, int* size)
// get first subblock free in block, stating at start (from block). return NULL if no block, else first subblock free (mark included), filling size
static void* getFirstBlock(void* block, int maxsize, int* size)
{
#define ISFREE(A) (((map->map[(A)>>3]>>((A)&7))&1)?0:1)
if(start<0) start = 0;
while(start<MMAPSIZE/(8*MMAPBLOCK)) { // still a chance...
if(ISFREE(start)) {
// free, now get size...
int end = start+1;
while(end<MMAPSIZE/(8*MMAPBLOCK)) {
if(!ISFREE(end) || (end-start==maxsize)) {
if(size) *size = end-start;
return start;
// get start of block
blockmark_t *m = (blockmark_t*)block;
while(m->next.x32) { // while there is a subblock
if(!m->next.fill && m->next.size>=maxsize+sizeof(blockmark_t)) {
*size = m->next.size;
return m;
}
m = (blockmark_t*)((uintptr_t)m + m->next.size);
}
return NULL;
}
static int getMaxFreeBlock(void* block)
{
// get start of block
blockmark_t *m = (blockmark_t*)((uintptr_t)block+MMAPSIZE-sizeof(blockmark_t)); // styart with the end
int maxsize = 0;
while(m->prev.x32) { // while there is a subblock
if(!m->prev.fill && m->prev.size>maxsize) {
maxsize = m->prev.size;
if((uintptr_t)block+maxsize>(uintptr_t)m)
return maxsize; // no block large enough left...
}
m = (blockmark_t*)((uintptr_t)m - m->prev.size);
}
return maxsize;
}
static void* allocBlock(void* block, void *sub, int size)
{
blockmark_t *s = (blockmark_t*)sub;
blockmark_t *n = (blockmark_t*)((uintptr_t)s + s->next.size);
s->next.fill = 1;
s->next.size = size+sizeof(blockmark_t);
blockmark_t *m = (blockmark_t*)((uintptr_t)s + s->next.size); // this is new n
m->prev.fill = 1;
m->prev.size = s->next.size;
if(n!=m) {
// new mark
m->prev.fill = 1;
m->prev.size = s->next.size;
m->next.fill = 0;
m->next.size = (uintptr_t)n - (uintptr_t)m;
n->prev.fill = 0;
n->prev.size = m->next.size;
}
return (void*)((uintptr_t)sub + sizeof(blockmark_t));
}
static void freeBlock(void *block, void* sub, int size)
{
blockmark_t *m = (blockmark_t*)block;
blockmark_t *s = (blockmark_t*)sub;
blockmark_t *n = (blockmark_t*)((uintptr_t)s + s->next.size);
if(block!=sub)
m = (blockmark_t*)((uintptr_t)s - s->prev.size);
s->next.fill = 0;
n->prev.fill = 0;
// check if merge with previous
if (s->prev.x32 && !s->prev.fill) {
// remove s...
m->next.size += s->next.size;
n->prev.size = m->next.size;
s = m;
}
// check if merge with next
if(n->next.x32 && !n->next.fill) {
blockmark_t *n2 = (blockmark_t*)((uintptr_t)n + n->next.size);
//remove n
s->next.size += n->next.size;
n2->prev.size = s->next.size;
}
}
uintptr_t FindFreeDynarecMap(dynablock_t* db, int size)
{
// look for free space
void* sub = NULL;
for(int i=0; i<my_context->mmapsize; ++i) {
if(my_context->mmaplist[i].maxfree>=size) {
int rsize = 0;
sub = getFirstBlock(my_context->mmaplist[i].block, size, &rsize);
if(sub) {
uintptr_t ret = (uintptr_t)allocBlock(my_context->mmaplist[i].block, sub, size);
if(rsize==my_context->mmaplist[i].maxfree)
my_context->mmaplist[i].maxfree = getMaxFreeBlock(my_context->mmaplist[i].block);
kh_dynablocks_t *blocks = my_context->mmaplist[i].dblist;
if(!blocks) {
blocks = my_context->mmaplist[i].dblist = kh_init(dynablocks);
kh_resize(dynablocks, blocks, 64);
}
++end;
khint_t k;
int r;
k = kh_put(dynablocks, blocks, (uintptr_t)db, &r);
kh_value(blocks, k) = db;
return ret;
}
if(size) *size = end-start;
return start;
}
++start;
}
return -1;
return 0;
}
static void allocBlock(mmaplist_t *map, int start, int size)
uintptr_t AddNewDynarecMap(dynablock_t* db, int size)
{
for(int i=0; i<size; ++i) {
map->map[start/8]|=(1<<(start&7));
++start;
}
}
static void freeBlock(mmaplist_t *map, int start, int size)
{
for(int i=0; i<size; ++i) {
map->map[start/8]&=~(1<<(start&7));
++start;
int i = my_context->mmapsize++; // yeah, useful post incrementation
dynarec_log(LOG_DEBUG, "Ask for DynaRec Block Alloc #%d\n", my_context->mmapsize);
my_context->mmaplist = (mmaplist_t*)realloc(my_context->mmaplist, my_context->mmapsize*sizeof(mmaplist_t));
void *p = NULL;
if(posix_memalign(&p, box86_pagesize, MMAPSIZE)) {
dynarec_log(LOG_INFO, "Cannot create memory map of %d byte for dynarec block #%d\n", MMAPSIZE, i);
--my_context->mmapsize;
return 0;
}
mprotect(p, MMAPSIZE, PROT_READ | PROT_WRITE | PROT_EXEC);
my_context->mmaplist[i].block = p;
// setup marks
blockmark_t* m = (blockmark_t*)p;
m->prev.x32 = 0;
m->next.fill = 0;
m->next.size = MMAPSIZE-sizeof(blockmark_t);
m = (blockmark_t*)(p+MMAPSIZE-sizeof(blockmark_t));
m->next.x32 = 0;
m->prev.fill = 0;
m->prev.size = MMAPSIZE-sizeof(blockmark_t);
// alloc 1st block
uintptr_t sub = (uintptr_t)allocBlock(my_context->mmaplist[i].block, p, size);
my_context->mmaplist[i].maxfree = getMaxFreeBlock(my_context->mmaplist[i].block);
kh_dynablocks_t *blocks = my_context->mmaplist[i].dblist = kh_init(dynablocks);
kh_resize(dynablocks, blocks, 64);
khint_t k;
int ret;
k = kh_put(dynablocks, blocks, (uintptr_t)db, &ret);
kh_value(blocks, k) = db;
return sub;
}
uintptr_t AllocDynarecMap(int size, int nolinker)
void ActuallyFreeDynarecMap(dynablock_t* db, uintptr_t addr, int size)
{
if(size>MMAPSIZE) {
#ifdef USE_MMAP
void* p = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if(p==MAP_FAILED) {
dynarec_log(LOG_INFO, "Cannot create dynamic map of %d bytes\n", size);
return 0;
if(!addr || !size)
return;
for(int i=0; i<my_context->mmapsize; ++i) {
if ((addr>(uintptr_t)my_context->mmaplist[i].block)
&& (addr<((uintptr_t)my_context->mmaplist[i].block+MMAPSIZE))) {
void* sub = (void*)(addr-sizeof(blockmark_t));
freeBlock(my_context->mmaplist[i].block, sub, size);
my_context->mmaplist[i].maxfree = getMaxFreeBlock(my_context->mmaplist[i].block);
kh_dynablocks_t *blocks = my_context->mmaplist[i].dblist;
if(blocks) {
khint_t k = kh_get(dynablocks, blocks, (uintptr_t)db);
if(k!=kh_end(blocks))
kh_del(dynablocks, blocks, k);
}
return;
}
#else
}
if(my_context->mmapsize)
dynarec_log(LOG_NONE, "Warning, block %p (size %d) not found in mmaplist for Free\n", (void*)addr, size);
}
dynablock_t* FindDynablockFromNativeAddress(void* addr)
{
// look in actual list
for(int i=0; i<my_context->mmapsize; ++i) {
if ((uintptr_t)addr>=(uintptr_t)my_context->mmaplist[i].block
&& ((uintptr_t)addr<(uintptr_t)my_context->mmaplist[i].block+MMAPSIZE))
return FindDynablockDynablocklist(addr, my_context->mmaplist[i].dblist);
}
// look in oversized
return FindDynablockDynablocklist(addr, my_context->dblist_oversized);
}
uintptr_t AllocDynarecMap(dynablock_t* db, int size)
{
if(!size)
return 0;
if(size>MMAPSIZE-2*sizeof(blockmark_t)) {
void *p = NULL;
if(posix_memalign(&p, box86_pagesize, size)) {
dynarec_log(LOG_INFO, "Cannot create dynamic map of %d bytes\n", size);
return 0;
}
mprotect(p, size, PROT_READ | PROT_WRITE | PROT_EXEC);
#endif
kh_dynablocks_t *blocks = my_context->dblist_oversized;
if(!blocks) {
blocks = my_context->dblist_oversized = kh_init(dynablocks);
kh_resize(dynablocks, blocks, 64);
}
khint_t k;
int ret;
k = kh_put(dynablocks, blocks, (uintptr_t)db, &ret);
kh_value(blocks, k) = db;
return (uintptr_t)p;
}
pthread_mutex_lock(&my_context->mutex_mmap);
int bsize = (size+MMAPBLOCK-1)/MMAPBLOCK;
// look for free space
for(int i=0; i<my_context->mmapsize; ++i) {
int rsize = 0;
int start = 0;
do {
start = getFirstBlock(my_context->mmaplist+i, start, bsize, &rsize);
if(start!=-1 && rsize>=bsize) {
allocBlock(my_context->mmaplist+i, start, bsize);
uintptr_t ret = (uintptr_t)my_context->mmaplist[i].block + start*MMAPBLOCK;
pthread_mutex_unlock(&my_context->mutex_mmap);
return ret;
}
if(start!=-1)
start += rsize;
} while (start!=-1);
if(pthread_mutex_trylock(&my_context->mutex_mmap)) {
sched_yield(); // give it a chance
if(pthread_mutex_trylock(&my_context->mutex_mmap))
return 0; // cannot lock, baillout
}
// no luck, add a new one !
int i = my_context->mmapsize++; // yeah, useful post incrementation
dynarec_log(LOG_DEBUG, "Ask for DynaRec Block Alloc #%d\n", my_context->mmapsize);
my_context->mmaplist = (mmaplist_t*)realloc(my_context->mmaplist, my_context->mmapsize*sizeof(mmaplist_t));
#ifdef USE_MMAP
void* p = mmap(NULL, MMAPSIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if(p==MAP_FAILED) {
dynarec_log(LOG_INFO, "Cannot create memory map of %d byte for dynarec block #%d\n", MMAPSIZE, i);
--my_context->mmapsize;
pthread_mutex_unlock(&my_context->mutex_mmap);
return 0;
}
#else
void *p = NULL;
if(posix_memalign(&p, box86_pagesize, MMAPSIZE)) {
dynarec_log(LOG_INFO, "Cannot create memory map of %d byte for dynarec block #%d\n", MMAPSIZE, i);
--my_context->mmapsize;
pthread_mutex_unlock(&my_context->mutex_mmap);
return 0;
}
mprotect(p, MMAPSIZE, PROT_READ | PROT_WRITE | PROT_EXEC);
#endif
my_context->mmaplist[i].block = p;
memset(my_context->mmaplist[i].map, 0, sizeof(my_context->mmaplist[i].map));
allocBlock(my_context->mmaplist+i, 0, bsize);
uintptr_t ret = FindFreeDynarecMap(db, size);
if(!ret)
ret = AddNewDynarecMap(db, size);
pthread_mutex_unlock(&my_context->mutex_mmap);
return (uintptr_t)p;
return ret;
}
void FreeDynarecMap(uintptr_t addr, uint32_t size)
void FreeDynarecMap(dynablock_t* db, uintptr_t addr, uint32_t size)
{
if(size>MMAPSIZE) {
munmap((void*)addr, size);
kh_dynablocks_t *blocks = my_context->dblist_oversized;
if(blocks) {
khint_t k = kh_get(dynablocks, blocks, (uintptr_t)db);
if(k!=kh_end(blocks))
kh_del(dynablocks, blocks, k);
}
return;
}
pthread_mutex_lock(&my_context->mutex_mmap);
int bsize = (size+MMAPBLOCK-1)/MMAPBLOCK;
// look for free space
for(int i=0; i<my_context->mmapsize; ++i) {
if(addr>=(uintptr_t)my_context->mmaplist[i].block && ((uintptr_t)my_context->mmaplist[i].block+MMAPSIZE)>=addr+size) {
int start = (addr - (uintptr_t)my_context->mmaplist[i].block) / MMAPBLOCK;
freeBlock(my_context->mmaplist+i, start, bsize);
pthread_mutex_unlock(&my_context->mutex_mmap);
return;
}
}
ActuallyFreeDynarecMap(db, addr, size);
pthread_mutex_unlock(&my_context->mutex_mmap);
}
// each dynmap is 64k of size
dynablocklist_t* getDBFromAddress(uintptr_t addr)
{
int idx = (addr>>DYNAMAP_SHIFT);
if(!my_context->dynmap[idx]) {
return NULL;
}
return my_context->dynmap[idx]->dynablocks;
}
void addDBFromAddressRange(uintptr_t addr, uintptr_t size, int nolinker)
void addDBFromAddressRange(box86context_t* context, uintptr_t addr, uintptr_t size, int nolinker)
{
dynarec_log(LOG_DEBUG, "addDBFromAddressRange %p -> %p\n", (void*)addr, (void*)(addr+size-1));
uintptr_t idx = (addr>>DYNAMAP_SHIFT);
uintptr_t end = ((addr+size-1)>>DYNAMAP_SHIFT);
for (uintptr_t i=idx; i<=end; ++i) {
if(!my_context->dynmap[i]) {
my_context->dynmap[i] = (dynmap_t*)calloc(1, sizeof(dynmap_t));
my_context->dynmap[i]->dynablocks = NewDynablockList(i<<DYNAMAP_SHIFT, i<<DYNAMAP_SHIFT, 1<<DYNAMAP_SHIFT, nolinker, 0);
} else {
ProtectkDynablockList(&my_context->dynmap[i]->dynablocks);
if(!context->dynmap[i]) {
context->dynmap[i] = NewDynablockList(i<<DYNAMAP_SHIFT, i<<DYNAMAP_SHIFT, 1<<DYNAMAP_SHIFT, nolinker, 0);
}
}
}
void cleanDBFromAddressRange(uintptr_t addr, uintptr_t size, int destroy)
void cleanDBFromAddressRange(box86context_t* context, uintptr_t addr, uintptr_t size, int destroy)
{
dynarec_log(LOG_DEBUG, "cleanDBFromAddressRange %p -> %p %s\n", (void*)addr, (void*)(addr+size-1), destroy?"destroy":"mark");
uintptr_t idx = (addr>box86_dynarec_largest && !destroy)?((addr-box86_dynarec_largest)>>DYNAMAP_SHIFT):(addr>>DYNAMAP_SHIFT);
uintptr_t end = ((addr+size-1)>>DYNAMAP_SHIFT);
for (uintptr_t i=idx; i<=end; ++i) {
dynmap_t* dynmap = my_context->dynmap[i];
if(dynmap) {
uintptr_t startdb = StartDynablockList(dynmap->dynablocks);
uintptr_t enddb = EndDynablockList(dynmap->dynablocks);
dynablocklist_t* dblist = context->dynmap[i];
if(dblist) {
uintptr_t startdb = StartDynablockList(dblist);
uintptr_t enddb = EndDynablockList(dblist);
uintptr_t startaddr = addr;
if(startaddr<startdb) startaddr = startdb;
uintptr_t endaddr = addr + size - 1;
if(endaddr>enddb) endaddr = enddb;
if(startaddr==startdb && endaddr==enddb) {
if(destroy) {
my_context->dynmap[i] = NULL;
FreeDynablockList(&dynmap->dynablocks);
free(dynmap);
context->dynmap[i] = NULL;
FreeDynablockList(&dblist);
} else
MarkDynablockList(&dynmap->dynablocks);
MarkDynablockList(&dblist);
} else
if(destroy)
FreeRangeDynablock(dynmap->dynablocks, startaddr, endaddr-startaddr+1);
FreeRangeDynablock(dblist, startaddr, endaddr-startaddr+1);
else
MarkRangeDynablock(dynmap->dynablocks, startaddr, endaddr-startaddr+1);
MarkRangeDynablock(dblist, startaddr, endaddr-startaddr+1);
}
}
@@ -231,7 +342,7 @@ void unprotectDB(uintptr_t addr, uintptr_t size)
uintptr_t end = (addr+size+(box86_pagesize-1))&~(box86_pagesize-1);
// should get "end" according to last block inside the window
mprotect((void*)start, end-start, PROT_READ|PROT_WRITE|PROT_EXEC);
cleanDBFromAddressRange(start, end-start, 0);
cleanDBFromAddressRange(my_context, start, end-start, 0);
}
#endif
@@ -245,16 +356,20 @@ void initAllHelpers(box86context_t* context)
my_context = context;
init_pthread_helper();
init_signal_helper(context);
#ifdef DYNAREC
if(box86_dynarec)
DynablockEmuMarker(context);
#endif
inited = 1;
}
EXPORTDYN
void finiAllHelpers()
void finiAllHelpers(box86context_t* context)
{
static int finied = 0;
if(finied)
return;
fini_pthread_helper();
fini_pthread_helper(context);
fini_signal_helper();
cleanAlternate();
finied = 1;
@@ -300,11 +415,19 @@ box86context_t *NewBox86Context(int argc)
#else
context->deferedInit = 1;
#endif
context->sel_serial = 1;
#ifdef DYNAREC
pthread_mutex_init(&context->mutex_blocks, NULL);
pthread_mutex_init(&context->mutex_mmap, NULL);
context->dynmap = (dynablocklist_t**)calloc(DYNAMAP_SIZE, sizeof(dynablocklist_t*));
#endif
context->maplib = NewLibrarian(context, 1);
context->local_maplib = NewLibrarian(context, 1);
context->system = NewBridge();
// create vsyscall
context->vsyscall = AddBridge(context->system, vFv, x86Syscall, 0);
context->vsyscall = AddBridge(context->system, context, vFv, x86Syscall, 0);
#ifdef BUILD_LIB
context->box86lib = RTLD_DEFAULT; // not ideal
#else
@@ -312,8 +435,6 @@ box86context_t *NewBox86Context(int argc)
#endif
context->dlprivate = NewDLPrivate();
context->callbacks = NewCallbackList();
context->argc = argc;
context->argv = (char**)calloc(context->argc+1, sizeof(char*));
@@ -330,11 +451,6 @@ box86context_t *NewBox86Context(int argc)
#endif
pthread_key_create(&context->tlskey, free_tlsdatasize);
#ifdef DYNAREC
pthread_mutex_init(&context->mutex_blocks, NULL);
pthread_mutex_init(&context->mutex_mmap, NULL);
context->dynablocks = NewDynablockList(0, 0, 0, 0, 0);
#endif
InitFTSMap(context);
for (int i=0; i<4; ++i) context->canary[i] = 1 + getrand(255);
@@ -391,19 +507,34 @@ void FreeBox86Context(box86context_t** context)
free(ctx->envv[i]);
free(ctx->envv);
if(ctx->atfork_sz) {
free(ctx->atforks);
ctx->atforks = NULL;
ctx->atfork_sz = ctx->atfork_cap = 0;
}
for(int i=0; i<MAX_SIGNAL; ++i)
if(ctx->signals[i]!=0 && ctx->signals[i]!=1) {
signal(i, SIG_DFL);
}
#ifdef DYNAREC
dynarec_log(LOG_DEBUG, "Free global Dynarecblocks\n");
if(ctx->dynablocks)
FreeDynablockList(&ctx->dynablocks);
for (int i=0; i<ctx->mmapsize; ++i)
for (int i=0; i<ctx->mmapsize; ++i) {
if(ctx->mmaplist[i].block)
#ifdef USE_MMAP
munmap(ctx->mmaplist[i].block, MMAPSIZE);
#else
free(ctx->mmaplist[i].block);
#endif
if(ctx->mmaplist[i].dblist) {
kh_destroy(dynablocks, ctx->mmaplist[i].dblist);
ctx->mmaplist[i].dblist = NULL;
}
}
if(ctx->dblist_oversized) {
kh_destroy(dynablocks, ctx->dblist_oversized);
ctx->dblist_oversized = NULL;
}
ctx->mmapsize = 0;
dynarec_log(LOG_DEBUG, "Free dynamic Dynarecblocks\n");
cleanDBFromAddressRange(0, 0xffffffff, 1);
cleanDBFromAddressRange(ctx, 0, 0xffffffff, 1);
pthread_mutex_destroy(&ctx->mutex_blocks);
pthread_mutex_destroy(&ctx->mutex_mmap);
free(ctx->mmaplist);
@@ -430,8 +561,6 @@ void FreeBox86Context(box86context_t** context)
freeGLProcWrapper(ctx);
freeALProcWrapper(ctx);
FreeCallbackList(&ctx->callbacks);
void* ptr;
if ((ptr = pthread_getspecific(ctx->tlskey)) != NULL) {
free_tlsdatasize(ptr);
@@ -459,25 +588,16 @@ void FreeBox86Context(box86context_t** context)
pthread_mutex_destroy(&ctx->mutex_thread);
#ifdef DYNAREC
pthread_mutex_destroy(&ctx->mutex_dyndump);
free(ctx->dynmap);
ctx->dynmap = NULL;
#endif
free_neededlib(&ctx->neededlibs);
if(ctx->atfork_sz) {
free(ctx->atforks);
ctx->atforks = NULL;
ctx->atfork_sz = ctx->atfork_cap = 0;
}
for(int i=0; i<MAX_SIGNAL; ++i)
if(ctx->signals[i]!=0 && ctx->signals[i]!=1) {
signal(i, SIG_DFL);
}
if(ctx->emu_sig)
FreeX86Emu(&ctx->emu_sig);
finiAllHelpers();
finiAllHelpers(ctx);
free(ctx);
}
@@ -501,6 +621,13 @@ int AddTLSPartition(box86context_t* context, int tlssize) {
context->tlsdata = realloc(context->tlsdata, context->tlssize);
memmove(context->tlsdata+tlssize, context->tlsdata, oldsize); // move to the top, using memmove as regions will probably overlap
memset(context->tlsdata, 0, tlssize); // fill new space with 0 (not mandatory)
// clean GS segment for current emu
if(my_context) {
ResetSegmentsCache(thread_get_emu());
if(!(++context->sel_serial))
++context->sel_serial;
}
return -context->tlssize; // negative offset
}
+1 -1
View File
@@ -3,6 +3,6 @@
#define BOX86_MAJOR 0
#define BOX86_MINOR 1
#define BOX86_REVISION 6
#define BOX86_REVISION 8
#endif //__BOX86_VERSION_H_
+9
View File
@@ -210,6 +210,12 @@ Op is 20-27
// cmp.s dst, src1, src2, lsl #imm
#define CMPS_REG_LSL_IMM5(src1, src2, imm5) \
EMIT(0xe1500000 | ((0) << 12) | ((src1) << 16) | brLSL(imm5, src2) )
// cmp.cond.s dst, src1, src2, lsl #imm
#define CMPS_REG_LSL_IMM5_COND(cond, src1, src2, imm5) \
EMIT((cond) | 0x01500000 | ((0) << 12) | ((src1) << 16) | brLSL(imm5, src2) )
// cmp.s dst, src, #imm
#define CMPS_IMM8_COND(cond, src, imm8) \
EMIT((cond) | 0x03500000 | ((0) << 12) | ((src) << 16) | brIMM(imm8) )
// cmp.s dst, src, #imm
#define CMPS_IMM8(src, imm8) \
EMIT(0xe3500000 | ((0) << 12) | ((src) << 16) | brIMM(imm8) )
@@ -433,6 +439,9 @@ Op is 20-27
#define SSAT_gen(cond, sat_imm, Rd, imm5, sh, Rn) (cond | 0b0110101<<21 | (sat_imm)<<16 | (Rd)<<12 | (imm5)<<7 | (sh)<<6 | 0b01<<4 | (Rn))
// Signed Staturate Rn to 2^(staturate_to-1) into Rd. Optionnaly shift left Rn before saturate
#define SSAT_REG_LSL_IMM5(Rd, saturate_to, Rn, shift) EMIT(SSAT_gen(c__, (saturate_to)-1, Rd, shift, 0, Rn))
// Signed Staturate Rn to 2^(staturate_to-1) into Rd. Optionnaly shift left Rn before saturate
#define SSAT_REG_LSL_IMM5_COND(cond, Rd, saturate_to, Rn, shift) EMIT(SSAT_gen((cond), (saturate_to)-1, Rd, shift, 0, Rn))
#define USAT_gen(cond, sat_imm, Rd, imm5, sh, Rn) (cond | 0b0110111<<21 | (sat_imm)<<16 | (Rd)<<12 | (imm5)<<7 | (sh)<<6 | 0b01<<4 | (Rn))
// Unsigned Staturate Rn to 2^(staturate_to-1) into Rd. Optionnaly shift left Rn before saturate
#define USAT_REG_LSL_IMM5(Rd, saturate_to, Rn, shift) EMIT(SSAT_gen(c__, (saturate_to), Rd, shift, 0, Rn))
+39 -1
View File
@@ -7,10 +7,15 @@
.global arm_lock_read_b
.global arm_lock_write_b
.global arm_lock_read_h
.global arm_lock_write_h
.global arm_lock_read_d
.global arm_lock_write_d
.global arm_lock_read_dd
.global arm_lock_write_dd
.global arm_lock_xchg
.global arm_lock_storeifnull
arm_lock_read_b:
// address is r0, return is r0
@@ -23,6 +28,17 @@ arm_lock_write_b:
strexb r0, r1, [r2]
bx lr
arm_lock_read_h:
// address is r0, return is r0
ldrexh r0, [r0]
bx lr
arm_lock_write_h:
// address is r0, value is r1, return is r0
mov r2, r0
strexh r0, r1, [r2]
bx lr
arm_lock_read_d:
// address is r0, return is r0
// r0 needs to be aligned
@@ -48,4 +64,26 @@ arm_lock_write_dd:
// r0 needs to be aligned
strexd r3, r0, r1, [r2]
mov r0, r3
bx lr
bx lr
arm_lock_xchg:
// address is r0, value is r1, return old value in r0
// r0 needs to be aligned
ldrex r2, [r0]
strex r3, r1, [r0]
cmp r3, #1
beq arm_lock_xchg
mov r0, r2
bx lr
arm_lock_storeifnull:
// address is r0, value is r1, r1 store to r0 only if [r0] is 0. return new [r0] value (so r1 or old value)
// r0 needs to be aligned
ldrex r2, [r0]
cmp r2, #0
moveq r2, r1
strex r3, r2, [r0]
cmp r3, #1
beq arm_lock_storeifnull
mov r0, r2
bx lr
+11
View File
@@ -7,6 +7,11 @@ extern uint8_t arm_lock_read_b(void* addr);
// STREXB of ADDR, return 0 if ok, 1 if not
extern int arm_lock_write_b(void* addr, uint8_t val);
// LDREXH of ADDR
extern uint16_t arm_lock_read_h(void* addr);
// STREXH of ADDR, return 0 if ok, 1 if not
extern int arm_lock_write_h(void* addr, uint16_t val);
// LDREX of ADDR
extern uint32_t arm_lock_read_d(void* addr);
// STREX of ADDR, return 0 if ok, 1 if not
@@ -17,4 +22,10 @@ extern void arm_lock_read_dd(uint32_t* a, uint32_t* b, void* addr);
// STREX of ADDR, return 0 if ok, 1 if not
extern int arm_lock_write_dd(uint32_t a, uint32_t b, void* addr);
// Atomicaly exchange value at [p] with val, return old p
extern uintptr_t arm_lock_xchg(void* p, uintptr_t val);
// Atomicaly store value to [p] only if [p] is NULL. Return new [p] value (so val or old)
extern void* arm_lock_storeifnull(void*p, void* val);
#endif //__ARM_LOCK_HELPER__H__
+89 -345
View File
@@ -20,6 +20,7 @@
#include "elfloader.h"
#ifdef ARM
#include "dynarec_arm.h"
#include "arm_lock_helper.h"
#else
#error Unsupported architecture!
#endif
@@ -28,8 +29,6 @@
KHASH_MAP_INIT_INT(dynablocks, dynablock_t*)
KHASH_SET_INIT_INT(mark)
uint32_t X31_hash_code(void* addr, int len)
{
if(!len) return 0;
@@ -41,13 +40,15 @@ uint32_t X31_hash_code(void* addr, int len)
dynablocklist_t* NewDynablockList(uintptr_t base, uintptr_t text, int textsz, int nolinker, int direct)
{
if(!textsz) {
printf_log(LOG_NONE, "Error, creating a NULL sized Dynablock\n");
return NULL;
}
dynablocklist_t* ret = (dynablocklist_t*)calloc(1, sizeof(dynablocklist_t));
ret->blocks = (nolinker && direct)?NULL:kh_init(dynablocks);
ret->base = base;
ret->text = text;
ret->textsz = textsz;
ret->nolinker = nolinker;
pthread_rwlock_init(&ret->rwlock_blocks, NULL);
if(direct && textsz) {
ret->direct = (dynablock_t**)calloc(textsz, sizeof(dynablock_t*));
if(!ret->direct) {printf_log(LOG_NONE, "Warning, fail to create direct block for dynablock @%p\n", (void*)text);}
@@ -58,8 +59,11 @@ dynablocklist_t* NewDynablockList(uintptr_t base, uintptr_t text, int textsz, in
void FreeDynablock(dynablock_t* db)
{
if(db) {
dynarec_log(LOG_DEBUG, "FreeDynablock(%p), db->block=%p x86=%p:%p father=%p, tablesz=%d, %swith %d son(s)\n", db, db->block, db->x86_addr, db->x86_addr+db->x86_size, db->father, db->tablesz, db->marks?"with marks, ":"", db->sons_size);
dynarec_log(LOG_DEBUG, "FreeDynablock(%p), db->block=%p x86=%p:%p father=%p, tablesz=%d, with %d son(s) already gone=%d\n", db, db->block, db->x86_addr, db->x86_addr+db->x86_size, db->father, db->tablesz, db->sons_size, db->gone);
if(db->gone)
return; // already in the process of deletion!
db->done = 0;
db->gone = 1;
// remove from direct if there
uintptr_t startdb = db->parent->text;
uintptr_t enddb = db->parent->text + db->parent->textsz;
@@ -68,53 +72,19 @@ void FreeDynablock(dynablock_t* db)
if(addr>=startdb && addr<enddb)
db->parent->direct[addr-startdb] = NULL;
}
if(db->marks) {
// Follow mark and set arm_linker instead
khint_t k;
kh_foreach_key(db->marks, k,
void** p = (void**)(uintptr_t)k;
dynarec_log(LOG_DEBUG, " -- resettable(%p)\n", p);
resettable(p);
);
// free mark
kh_destroy(mark, db->marks);
db->marks = NULL;
}
for(int i=0; i<db->tablesz; i+=4) {
dynablock_t* p = (dynablock_t*)db->table[i+3];
dynarec_log(LOG_DEBUG, " -- table[%d+3] = %p ", i, p);
if(p && p!=db && p->marks) {
khint_t kd = kh_get(mark, p->marks, (uintptr_t)(&db->table[i+0]));
if(kd!=kh_end(p->marks)) {
kh_del(mark, p->marks, kd);
dynarec_log(LOG_DEBUG, "cleaned");
}
else {dynarec_log(LOG_DEBUG, "not found");}
}
dynarec_log(LOG_DEBUG, "\n");
}
// remove from hash if there
if (db->parent->blocks) {
pthread_rwlock_wrlock(&db->parent->rwlock_blocks);
khint_t kdb;
kdb = kh_get(dynablocks, db->parent->blocks, (uintptr_t) db->x86_addr - db->parent->base);
if(kdb!=kh_end(db->parent->blocks))
kh_del(dynablocks, db->parent->blocks, kdb);
pthread_rwlock_unlock(&db->parent->rwlock_blocks);
}
// remove and free the sons
for (int i=0; i<db->sons_size; ++i) {
dynablock_t *son = db->sons[i];
db->sons[i] = NULL;
dynablock_t *son = (dynablock_t*)arm_lock_xchg(&db->sons[i], 0);
FreeDynablock(son);
}
// only the father free the DynarecMap
if(!db->father) {
dynarec_log(LOG_DEBUG, " -- FreeDyrecMap(%p, %d)\n", db->block, db->size);
FreeDynarecMap((uintptr_t)db->block, db->size);
FreeDynarecMap(db, (uintptr_t)db->block, db->size);
}
free(db->sons);
free(db->table);
free(db->instsize);
free(db);
}
}
@@ -125,21 +95,7 @@ void FreeDynablockList(dynablocklist_t** dynablocks)
return;
if(!*dynablocks)
return;
dynarec_log(LOG_DEBUG, "Free %d Blocks from Dynablocklist (with %d buckets, nolinker=%d) %s\n", (*dynablocks)->blocks?kh_size((*dynablocks)->blocks):0, (*dynablocks)->blocks?kh_n_buckets((*dynablocks)->blocks):0, (*dynablocks)->nolinker, ((*dynablocks)->direct)?" With Direct mapping enabled":"");
dynablock_t* db;
if((*dynablocks)->blocks) {
// create a list of the parent db to delete (because there are sons in the middle that will be invalid if father is removed)
dynablock_t** list = (dynablock_t**)calloc(kh_size((*dynablocks)->blocks), sizeof(dynablock_t*));
int n = 0;
kh_foreach_value((*dynablocks)->blocks, db,
if(!db->father) list[n++] = db;
);
for (int i=0; i<n; ++i)
FreeDynablock(list[i]);
kh_destroy(dynablocks, (*dynablocks)->blocks);
(*dynablocks)->blocks = NULL;
free(list);
}
dynarec_log(LOG_DEBUG, "Free Direct Blocks %p from Dynablocklist nolinker=%d\n", (*dynablocks)->direct, (*dynablocks)->nolinker);
if((*dynablocks)->direct) {
for (int i=0; i<(*dynablocks)->textsz; ++i) {
if((*dynablocks)->direct[i] && !(*dynablocks)->direct[i]->father)
@@ -147,8 +103,7 @@ void FreeDynablockList(dynablocklist_t** dynablocks)
}
free((*dynablocks)->direct);
}
(*dynablocks)->direct = 0;
pthread_rwlock_destroy(&(*dynablocks)->rwlock_blocks);
(*dynablocks)->direct = NULL;
free(*dynablocks);
*dynablocks = NULL;
@@ -159,17 +114,8 @@ void MarkDynablock(dynablock_t* db)
if(db) {
if(db->father)
db = db->father; // mark only father
if(db->marks && !db->need_test) {
// Follow mark and set arm_linker instead
khint_t k;
kh_foreach_key(db->marks, k,
void** p = (void**)(uintptr_t)k;
resettable(p);
);
// free mark
kh_clear(mark, db->marks);
}
db->need_test = 1;
if(db->nolinker)
db->need_test = 1; // test only blocks that can be marked (and so deleted)
}
}
@@ -182,43 +128,6 @@ void ProtectDynablock(dynablock_t* db)
}
}
void RemoveMark(void** table)
{
// remove old value if any
dynablock_t *old = (dynablock_t*)table[3];
if(old && old->father)
old = old->father;
if(old && old->marks) {
khint_t kd = kh_get(mark, old->marks, (uintptr_t)table);
if(kd!=kh_end(old->marks))
kh_del(mark, old->marks, kd);
}
table[3] = NULL;
}
// source is linked to dest (i.e. source->table[x] = dest->block), so add a "mark" in dest, add a "linked" info to source
void AddMark(dynablock_t* source, dynablock_t* dest, void** table)
{
int ret;
// remove old value if any
dynablock_t *old = (dynablock_t*)table[3];
if(old && old->father)
old = old->father;
if(old && old->marks) {
khint_t kd = kh_get(mark, old->marks, (uintptr_t)table);
if(kd!=kh_end(old->marks))
kh_del(mark, old->marks, kd);
}
// add mark if needed
if(dest->father)
dest = dest->father;
if(dest->marks) {
kh_put(mark, dest->marks, (uintptr_t)table, &ret);
table[3] = (void*)dest;
} else
table[3] = NULL;
}
void MarkDynablockList(dynablocklist_t** dynablocks)
{
if(!dynablocks)
@@ -227,36 +136,30 @@ void MarkDynablockList(dynablocklist_t** dynablocks)
return;
if(!(*dynablocks)->nolinker)
return;
dynarec_log(LOG_DEBUG, "Marked %d Blocks from Dynablocklist (with %d buckets, nolinker=%d) %p:0x%x %s\n", (*dynablocks)->blocks?(kh_size((*dynablocks)->blocks)):0, (*dynablocks)->blocks?(kh_n_buckets((*dynablocks)->blocks)):0, (*dynablocks)->nolinker, (void*)(*dynablocks)->text, (*dynablocks)->textsz, ((*dynablocks)->direct)?" With Direct mapping enabled":"");
dynarec_log(LOG_DEBUG, "Marked Blocks from Dynablocklist nolinker=%d %p:0x%x\n", (*dynablocks)->nolinker, (void*)(*dynablocks)->text, (*dynablocks)->textsz);
dynablock_t* db;
if((*dynablocks)->blocks) {
kh_foreach_value((*dynablocks)->blocks, db,
MarkDynablock(db);
);
}
if((*dynablocks)->direct) {
for (int i=0; i<(*dynablocks)->textsz; ++i) {
MarkDynablock((*dynablocks)->direct[i]);
db = (*dynablocks)->direct[i];
if(db)
MarkDynablock(db);
}
}
}
void ProtectkDynablockList(dynablocklist_t** dynablocks)
void ProtectDynablockList(dynablocklist_t** dynablocks)
{
if(!dynablocks)
return;
if(!*dynablocks)
return;
dynarec_log(LOG_DEBUG, "Protect %d Blocks from Dynablocklist (with %d buckets, nolinker=%d) %p:0x%x %s\n", (*dynablocks)->blocks?(kh_size((*dynablocks)->blocks)):0, (*dynablocks)->blocks?(kh_n_buckets((*dynablocks)->blocks)):0, (*dynablocks)->nolinker, (void*)(*dynablocks)->text, (*dynablocks)->textsz, ((*dynablocks)->direct)?" With Direct mapping enabled":"");
dynarec_log(LOG_DEBUG, "Protect Blocks from Dynablocklist nolinker=%d %p:0x%x\n", (*dynablocks)->nolinker, (void*)(*dynablocks)->text, (*dynablocks)->textsz);
dynablock_t* db;
if((*dynablocks)->blocks) {
kh_foreach_value((*dynablocks)->blocks, db,
ProtectDynablock(db);
);
}
if((*dynablocks)->direct) {
for (int i=0; i<(*dynablocks)->textsz; ++i) {
ProtectDynablock((*dynablocks)->direct[i]);
db = (*dynablocks)->direct[i];
if(db)
ProtectDynablock(db);
}
}
}
@@ -270,7 +173,7 @@ uintptr_t StartDynablockList(dynablocklist_t* db)
uintptr_t EndDynablockList(dynablocklist_t* db)
{
if(db)
return db->text+db->textsz;
return db->text+db->textsz-1;
return 0;
}
void MarkDirectDynablock(dynablocklist_t* dynablocks, uintptr_t addr, uintptr_t size)
@@ -315,26 +218,12 @@ void FreeRangeDynablock(dynablocklist_t* dynablocks, uintptr_t addr, uintptr_t s
if(!dynablocks)
return;
if(dynablocks->blocks || dynablocks->direct) {
if(dynablocks->direct) {
dynablock_t* db;
uintptr_t s, e;
int ret;
khint_t k;
kh_dynablocks_t *blocks = kh_init(dynablocks);
// copy in a temporary list
if(dynablocks->blocks) {
kh_foreach_value(dynablocks->blocks, db,
if(db->father)
db =db->father;
s = (uintptr_t)db->x86_addr;
e = (uintptr_t)db->x86_addr+db->x86_size-1;
if((s>=addr && s<(addr+size)) || (e>=addr && e<(addr+size))) {
//ProtectDynablock(db);
k = kh_put(dynablocks, blocks, (uintptr_t)db, &ret);
kh_value(blocks, k) = db;
}
);
}
if(dynablocks->direct) {
uintptr_t startdb = dynablocks->text;
uintptr_t enddb = startdb + dynablocks->textsz;
@@ -345,14 +234,15 @@ void FreeRangeDynablock(dynablocklist_t* dynablocks, uintptr_t addr, uintptr_t s
if(end>enddb)
end = enddb;
if(end>startdb && start<enddb)
for(uintptr_t i = start; i<end; ++i)
if(dynablocks->direct[i-startdb]) {
db = dynablocks->direct[i-startdb];
for(uintptr_t i = start; i<end; ++i) {
db = (dynablock_t*)arm_lock_xchg(&dynablocks->direct[i-startdb], 0);
if(db) {
if(db->father)
db =db->father;
db = db->father;
k = kh_put(dynablocks, blocks, (uintptr_t)db, &ret);
kh_value(blocks, k) = db;
}
}
}
// purge the list
kh_foreach_value(blocks, db,
@@ -369,150 +259,45 @@ void MarkRangeDynablock(dynablocklist_t* dynablocks, uintptr_t addr, uintptr_t s
return;
if(dynablocks->direct)
MarkDirectDynablock(dynablocks, addr, size);
if(dynablocks->blocks) {
dynablock_t* db;
uintptr_t s, e;
kh_foreach_value(dynablocks->blocks, db,
s = (uintptr_t)db->x86_addr;
e = (uintptr_t)db->x86_addr+db->x86_size-1;
if((s>=addr && s<(addr+size)) || (e>=addr && e<(addr+size)))
MarkDynablock(db);
);
}
}
dynablock_t* FindDynablockDynablocklist(void* addr, dynablocklist_t* dynablocks)
dynablock_t* FindDynablockDynablocklist(void* addr, kh_dynablocks_t* dynablocks)
{
if(!dynablocks)
return NULL;
if(dynablocks->direct)
for(int i=0; i<dynablocks->textsz; ++i) {
dynablock_t* db;
if((db = dynablocks->direct[i])) {
uintptr_t s = (uintptr_t)db->block;
uintptr_t e = (uintptr_t)db->block+db->size;
if((uintptr_t)addr>=s && (uintptr_t)addr<e)
return db->father?db->father:db;
}
}
if(dynablocks->blocks) {
dynablock_t* db;
uintptr_t s, e;
kh_foreach_value(dynablocks->blocks, db,
s = (uintptr_t)db->block;
e = (uintptr_t)db->block+db->size;
if((uintptr_t)addr>=s && (uintptr_t)addr<e)
return db->father?db->father:db;
);
}
dynablock_t* db;
kh_foreach_value(dynablocks, db,
uintptr_t s = (uintptr_t)db->block;
uintptr_t e = (uintptr_t)db->block+db->size;
if((uintptr_t)addr>=s && (uintptr_t)addr<e)
return db->father?db->father:db;
)
return NULL;
}
dynablock_t* FindDynablockFromNativeAddress(void* addr)
static dynablocklist_t* getDBFromAddress(uintptr_t addr)
{
// unoptimized search through all dynablockslist for the dynablock that contains native addr (NULL if not found)
// search "volatile" dynarec first
dynablock_t *ret = NULL;
for(int idx=0; idx<DYNAMAP_SIZE && !ret; ++idx)
if(my_context->dynmap[idx])
ret = FindDynablockDynablocklist(addr, my_context->dynmap[idx]->dynablocks);
if(ret)
return ret;
// last, search context dynablocks
if(my_context->dynablocks)
ret = FindDynablockDynablocklist(addr, my_context->dynablocks);
return ret;
const int idx = (addr>>DYNAMAP_SHIFT);
return (my_context->dynmap[idx])?my_context->dynmap[idx]:NULL;
}
void ConvertHash2Direct(dynablocklist_t* dynablocks)
{
if(dynablocks->textsz==0 || dynablocks->text==0 || !dynablocks->blocks)
return; // nothing to do
// create the new set
dynablock_t **direct = (dynablock_t**)calloc(dynablocks->textsz, sizeof(dynablock_t*));
kh_dynablocks_t *blocks = kh_init(dynablocks);
// transfert
int ret;
khint_t k;
dynablock_t* db;
uintptr_t key;
uintptr_t start = dynablocks->text;
uintptr_t end = start + dynablocks->textsz;
kh_foreach(dynablocks->blocks, key, db,
key += dynablocks->base;
if(key>=start && key<end)
direct[key-start] = db;
else {
k = kh_put(dynablocks, blocks, key-dynablocks->base, &ret);
if(ret) { // don't try to insert if already done...
kh_value(blocks, k) = db;
}
}
);
// destroy old and do the swap (should swap before destroy, but hash access is always behind mutex)
kh_destroy(dynablocks, dynablocks->blocks);
dynablocks->blocks = NULL;
dynablocks->direct = direct;
// move the one that doesn't fit to other dynablocks
// first check if everything can be moved
int ok = 1;
kh_foreach(blocks, key, db,
key += dynablocks->base;
dynablocklist_t *newdbs = getDBFromAddress(key); // will crash if no dynablocks is found
if(!newdbs)
ok = 0;
else {
if(newdbs->direct) {
if(newdbs->direct[key-newdbs->text])
ok = 0;
} else {
khint_t k;
pthread_rwlock_rdlock(&newdbs->rwlock_blocks);
k = kh_get(dynablocks, newdbs->blocks, key-newdbs->base);
if(k!=kh_end(newdbs->blocks))
ok = 0;
pthread_rwlock_unlock(&newdbs->rwlock_blocks);
}
}
);
if(ok) {
kh_foreach(blocks, key, db,
key += dynablocks->base;
dynablocklist_t *newdbs = getDBFromAddress(key); // will crash if no dynablocks is found
if(newdbs->direct) {
newdbs->direct[key-newdbs->text] = db;
} else {
khint_t k;
int ret;
pthread_rwlock_wrlock(&newdbs->rwlock_blocks);
k = kh_put(dynablocks, newdbs->blocks, key-newdbs->base, &ret);
kh_value(newdbs->blocks, k) = db;
pthread_rwlock_unlock(&newdbs->rwlock_blocks);
}
);
kh_destroy(dynablocks, blocks);
} else {
dynablocks->blocks = blocks;
dynarec_log(LOG_DEBUG, "Cannot convert dynablocks(%p) to pure direct\n", (void*)dynablocks->text);
}
}
// a block is 4096 byte, so get a low magic size or no block will get "direct" treatment
#define MAGIC_SIZE 8
#define MAGIC_SIZE2 16
dynablock_t *AddNewDynablock(dynablocklist_t* dynablocks, uintptr_t addr, int with_marks, int* created)
dynablock_t *AddNewDynablock(dynablocklist_t* dynablocks, uintptr_t addr, int* created)
{
if(!dynablocks) {
dynarec_log(LOG_INFO, "Warning: Ask to create a dynblock with a NULL dynablocklist (addr=%p)\n", (void*)addr);
dynarec_log(LOG_INFO, "Warning: Ask to create a dynablock with a NULL dynablocklist (addr=%p)\n", (void*)addr);
*created = 0;
return NULL;
}
khint_t k;
int ret;
if((addr<dynablocks->text) || (addr>=(dynablocks->text+dynablocks->textsz))) {
// this should be useless
//dynarec_log(LOG_INFO, "Warning: Refused to create a Direct Block that is out-of-bound: dynablocks=%p (%p:%p), addr=%p\n", dynablocks, (void*)(dynablocks->text), (void*)(dynablocks->text+dynablocks->textsz), (void*)addr);
//*created = 0;
//return NULL;
return AddNewDynablock(getDBFromAddress(addr), addr, created);
}
dynablock_t* block = NULL;
// first, check if it exist in direct access mode
if(dynablocks->direct && (addr>=dynablocks->text) && (addr<(dynablocks->text+dynablocks->textsz))) {
if(dynablocks->direct) {
block = dynablocks->direct[addr-dynablocks->text];
if(block) {
dynarec_log(LOG_DUMP, "Block already exist in Direct Map\n");
@@ -521,68 +306,25 @@ dynablock_t *AddNewDynablock(dynablocklist_t* dynablocks, uintptr_t addr, int wi
}
}
if(dynablocks->blocks) {
pthread_rwlock_rdlock(&dynablocks->rwlock_blocks);
// check again, in case it's been converted to direct in another thread
if(dynablocks->blocks) {
// check if the block exist
khint_t k;
k = kh_get(dynablocks, dynablocks->blocks, addr-dynablocks->base);
if(k!=kh_end(dynablocks->blocks)) {
block = kh_value(dynablocks->blocks, k);
pthread_rwlock_unlock(&dynablocks->rwlock_blocks);
dynarec_log(LOG_DUMP, "Block already exist in Hash Map\n");
*created = 0;
return block;
}
}
pthread_rwlock_unlock(&dynablocks->rwlock_blocks);
}
if (!*created)
return block;
// Lock as write now!
int need_unlock = 0;
if(dynablocks->blocks) {
pthread_rwlock_wrlock(&dynablocks->rwlock_blocks);
need_unlock = 1;
}
if(!dynablocks->direct)
dynablocks->direct = (dynablock_t**)calloc(dynablocks->textsz, sizeof(dynablock_t*));
// create and add new block
dynarec_log(LOG_DUMP, "Ask for DynaRec Block creation @%p\n", (void*)addr);
if(dynablocks->direct && (addr>=dynablocks->text) && (addr<(dynablocks->text+dynablocks->textsz))) {
block = dynablocks->direct[addr-dynablocks->text] = (dynablock_t*)calloc(1, sizeof(dynablock_t));
} else {
if(dynablocks->textsz && ((addr<dynablocks->text) || (addr>=(dynablocks->text+dynablocks->textsz)))) {
if(need_unlock)
pthread_rwlock_unlock(&dynablocks->rwlock_blocks);
//dynarec_log(LOG_INFO, "Warning: Refused to create a Direct Block that is out-of-bound: dynablocks=%p (%p:%p), addr=%p\n", dynablocks, (void*)(dynablocks->text), (void*)(dynablocks->text+dynablocks->textsz), (void*)addr);
//*created = 0;
//return NULL;
return AddNewDynablock(getDBFromAddress(addr), addr, with_marks, created);
}
k = kh_put(dynablocks, dynablocks->blocks, addr-dynablocks->base, &ret);
if(!ret) {
// Ooops, block is already there? retreive it and bail out
dynarec_log(LOG_DUMP, "Block already exist in Hash Map\n");
block = kh_value(dynablocks->blocks, k);
if(need_unlock)
pthread_rwlock_unlock(&dynablocks->rwlock_blocks);
*created = 0;
return block;
}
block = kh_value(dynablocks->blocks, k) = (dynablock_t*)calloc(1, sizeof(dynablock_t));
// check if size of hash map == magic size, if yes, convert to direct before unlocking
if(!dynablocks->direct && dynablocks->textsz && kh_size(dynablocks->blocks)>=MAGIC_SIZE && kh_size(dynablocks->blocks)<(MAGIC_SIZE2))
ConvertHash2Direct(dynablocks);
}
block->parent = dynablocks;
// add mark if needed
if(with_marks)
block->marks = kh_init(mark);
// create an empty block first, so if other thread want to execute the same block, they can, but using interpretor path
if(need_unlock)
pthread_rwlock_unlock(&dynablocks->rwlock_blocks);
block = (dynablock_t*)calloc(1, sizeof(dynablock_t));
dynablock_t* tmp = (dynablock_t*)arm_lock_storeifnull(&dynablocks->direct[addr-dynablocks->text], block);
if(tmp != block) {
// a block appeard!
free(block);
*created = 0;
return tmp;
}
block->parent = dynablocks;
*created = 1;
return block;
@@ -598,40 +340,42 @@ static dynablock_t* internalDBGetBlock(x86emu_t* emu, uintptr_t addr, uintptr_t
dynablocklist_t *dynablocks = NULL;
dynablock_t* block = NULL;
if(current) {
dynablocks = current->parent;
if(!(addr>=dynablocks->text && addr<(dynablocks->text+dynablocks->textsz)))
dynablocks = current->parent;
if(dynablocks && !(addr>=dynablocks->text && addr<(dynablocks->text+dynablocks->textsz)))
dynablocks = NULL;
else if(dynablocks->direct && (addr>=dynablocks->text) && (addr<(dynablocks->text+dynablocks->textsz))) {
block = dynablocks->direct[addr-dynablocks->text];
if(block)
return block;
}
}
// nope, lets do the long way
if(!dynablocks)
dynablocks = GetDynablocksFromAddress(emu->context, addr);
if(!dynablocks)
return NULL;
if(!dynablocks) {
dynablocks = getDBFromAddress(addr);
if(!dynablocks) {
dynablocks = GetDynablocksFromAddress(emu->context, addr);
if(!dynablocks)
return NULL;
}
}
// check direct first, without lock
if(dynablocks->direct && (addr>=dynablocks->text) && (addr<(dynablocks->text+dynablocks->textsz)))
block = dynablocks->direct[addr-dynablocks->text];
if(block)
return block;
if(dynablocks->direct/* && (addr>=dynablocks->text) && (addr<(dynablocks->text+dynablocks->textsz))*/)
if((block = dynablocks->direct[addr-dynablocks->text]))
return block;
int created = create;
block = AddNewDynablock(dynablocks, addr, (dynablocks->nolinker)&&(dynablocks->direct), &created);
if(!created || !create)
block = AddNewDynablock(dynablocks, addr, &created);
if(!created)
return block; // existing block...
if(box86_dynarec_dump)
pthread_mutex_lock(&my_context->mutex_dyndump);
// fill the block
block->x86_addr = (void*)addr;
FillBlock(block, filladdr);
if(!FillBlock(block, filladdr)) {
dynablocks->direct[addr-dynablocks->text] = NULL;
free(block);
block = NULL;
}
if(box86_dynarec_dump)
pthread_mutex_unlock(&my_context->mutex_dyndump);
dynarec_log(LOG_DEBUG, " --- DynaRec Block %s @%p:%p (%p, 0x%x bytes, %swith %d son(s))\n", created?"created":"recycled", (void*)addr, (void*)(addr+block->x86_size), block->block, block->size, block->marks?"with Marks, ":"", block->sons_size);
dynarec_log(LOG_DEBUG, " --- DynaRec Block %s @%p:%p (%p, 0x%x bytes, with %d son(s))\n", created?"created":"recycled", (void*)addr, (void*)(addr-((block)?block->x86_size:0)), (block)?block->block:0, (block)?block->size:0, (block)?block->sons_size:0);
return block;
}
@@ -643,7 +387,7 @@ dynablock_t* DBGetBlock(x86emu_t* emu, uintptr_t addr, int create, dynablock_t**
dynablock_t *father = db->father?db->father:db;
uint32_t hash = father->nolinker?X31_hash_code(father->x86_addr, father->x86_size):0;
if(hash!=father->hash) {
dynarec_log(LOG_DEBUG, "Invalidating block %p from %p:%p (hash:%X/%X)%s with %d son(s)\n", father, father->x86_addr, father->x86_addr+father->x86_size, hash, father->hash, father->marks?" with Mark,":"", father->sons_size);
dynarec_log(LOG_DEBUG, "Invalidating block %p from %p:%p (hash:%X/%X) with %d son(s)\n", father, father->x86_addr, father->x86_addr+father->x86_size, hash, father->hash, father->sons_size);
// no more current if it gets invalidated too
if(*current && father->x86_addr>=(*current)->x86_addr && (father->x86_addr+father->x86_size)<(*current)->x86_addr)
*current = NULL;
@@ -668,7 +412,7 @@ dynablock_t* DBAlternateBlock(x86emu_t* emu, uintptr_t addr, uintptr_t filladdr)
dynablock_t *father = db->father?db->father:db;
uint32_t hash = father->nolinker?X31_hash_code(father->x86_addr, father->x86_size):0;
if(hash!=father->hash) {
dynarec_log(LOG_DEBUG, "Invalidating block %p from %p:%p (hash:%X/%X)%s with %d son(s)\n", father, father->x86_addr, father->x86_addr+father->x86_size, hash, father->hash, father->marks?" with Mark,":"", father->sons_size);
dynarec_log(LOG_DEBUG, "Invalidating block %p from %p:%p (hash:%X/%X) with %d son(s)\n", father, father->x86_addr, father->x86_addr+father->x86_size, hash, father->hash, father->sons_size);
// Free father, it's now invalid!
FreeDynablock(father);
// start again... (will create a new block)
+10 -17
View File
@@ -2,45 +2,38 @@
#define __DYNABLOCK_PRIVATE_H_
typedef struct dynablocklist_s dynablocklist_t;
typedef struct kh_dynablocks_s kh_dynablocks_t;
typedef struct kh_mark_s kh_mark_t;
typedef union instsize_s {
uint8_t c;
struct {
unsigned int x86:4;
unsigned int nat:4;
};
typedef struct instsize_s {
unsigned int x86:4;
unsigned int nat:4;
} instsize_t;
typedef struct dynablock_s {
dynablocklist_t* parent;
kh_mark_t* marks; // List of blocks that marked this block
void* block;
int size;
void* x86_addr;
int x86_size;
uint32_t hash;
int need_test;
uintptr_t* table;
int tablesz;
int done;
uint8_t need_test;
uint8_t done;
uint8_t gone;
uint8_t nolinker;
int isize;
dynablock_t** sons; // sons (kind-of dummy dynablock...)
int sons_size;
dynablock_t* father; // set only in the case of a son
int nolinker;
instsize_t *instsize;
instsize_t* instsize;
} dynablock_t;
typedef struct dynablocklist_s {
kh_dynablocks_t *blocks;
pthread_rwlock_t rwlock_blocks;
uintptr_t base;
uintptr_t text;
int textsz;
uintptr_t base;
int nolinker; // in case this dynablock can disapear (also, block memory are allocated with a temporary scheme)
dynablock_t **direct; // direct mapping (waste of space, so not always there)
dynablock_t** direct; // direct mapping (waste of space, so not always there)
} dynablocklist_t;
#endif //__DYNABLOCK_PRIVATE_H_
+9 -14
View File
@@ -56,18 +56,15 @@ void* UpdateLinkTable(x86emu_t* emu, void** table, uintptr_t addr)
dynablock_t* current = (dynablock_t*)table[2];
if(current->father)
current = current->father;
void * jblock;
dynablock_t* block = DBGetBlock(emu, addr, 1, &current);
if(!current) { // current has been invalidated, stop running it...
//dynarec_log(LOG_DEBUG, "--- Current invalidated while linking.\n");
return arm_epilog_fast;
}
if(table[3]) {
//dynarec_log(LOG_DEBUG, "--- Remove mark from %p (%p)\n", current, table[3]);
RemoveMark(table);
}
if(!block) {
// no block, don't try again, ever
tableupdate(arm_epilog, addr, table);
// no block, let link table as is...
//tableupdate(arm_epilog, addr, table);
return arm_epilog_fast;
}
if(!block->done) {
@@ -75,20 +72,18 @@ void* UpdateLinkTable(x86emu_t* emu, void** table, uintptr_t addr)
//tableupdate(arm_linker, addr, table);
return arm_epilog_fast;
}
if(!block->block) {
if(!(jblock=block->block)) {
// null block, but done: go to epilog, no linker here
tableupdate(arm_epilog, addr, table);
return arm_epilog_fast;
}
dynablock_t *father = block->father?block->father:block;
if(!block->parent->nolinker || (current && father->marks)) {
//dynablock_t *father = block->father?block->father:block;
if(!block->parent->nolinker) {
//dynarec_log(LOG_DEBUG, "--- Linking %p/%p to %p (table=%p[%p/%p/%p/%p])\n", block, block->block, current, table, table[0], table[1], table[2], table[3]);
// only update block if linker is allowed or if marks is possibe
if(current && father->marks && current!=father)
AddMark(current, father, table);
tableupdate(block->block, addr, table);
// only update block if linker is allowed
tableupdate(jblock, addr, table);
}
return block->block;
return jblock;
}
#endif
+17 -12
View File
@@ -161,17 +161,15 @@ uint32_t needed_flags(dynarec_arm_t *dyn, int ninst, uint32_t setf, int recurse)
instsize_t* addInst(instsize_t* insts, size_t* size, size_t* cap, int x86_size, int arm_size)
{
// x86 instruction is <16 bytes anyway
if(!x86_size && !arm_size)
return insts;
// x86 instruction is <16 bytes
int toadd;
if(x86_size>arm_size)
toadd = 1 + x86_size/15;
else
toadd = 1 + arm_size/15;
if(*size+toadd>*cap) {
*cap = *size+toadd;
insts = (instsize_t*)realloc(insts, *cap*sizeof(instsize_t));
if((*size)+toadd>(*cap)) {
*cap = (*size)+toadd;
insts = (instsize_t*)realloc(insts, (*cap)*sizeof(instsize_t));
}
while(toadd) {
if(x86_size>15)
@@ -242,11 +240,12 @@ void* FillBlock(dynablock_t* block, uintptr_t addr) {
arm_pass2(&helper, addr);
// ok, now allocate mapped memory, with executable flag on
int sz = helper.arm_size;
void* p = (void*)AllocDynarecMap(sz, block->parent->nolinker);
void* p = (void*)AllocDynarecMap(block, sz);
if(p==NULL) {
dynarec_log(LOG_DEBUG, "AllocDynarecMap(%p, %d) failed, cancelling block\n", block, sz);
free(helper.insts);
free(helper.next);
return (void*)block;
return NULL;
}
helper.block = p;
helper.arm_start = (uintptr_t)p;
@@ -281,12 +280,14 @@ void* FillBlock(dynablock_t* block, uintptr_t addr) {
__clear_cache(p, p+sz); // need to clear the cache before execution...
// keep size of instructions for signal handling
{
size_t cap = helper.size+1;
size_t cap = 1;
for(int i=0; i<helper.size; ++i)
cap += 1 + ((helper.insts[i].x86.size>helper.insts[i].size)?helper.insts[i].x86.size:helper.insts[i].size)/15;
size_t size = 0;
block->instsize = (instsize_t*)calloc(cap, sizeof(instsize_t));
for(int i=0; i<helper.size; ++i)
block->instsize = addInst(block->instsize, &size, &cap, helper.insts[i].x86.size, helper.insts[i].size/4);
addInst(block->instsize, &size, &cap, 0, 0); // add a "end of block" mark, just in case
block->instsize = addInst(block->instsize, &size, &cap, 0, 0); // add a "end of block" mark, just in case
}
// ok, free the helper now
free(helper.insts);
@@ -312,8 +313,8 @@ void* FillBlock(dynablock_t* block, uintptr_t addr) {
sons = (dynablock_t**)calloc(helper.sons_size, sizeof(dynablock_t*));
for (int i=0; i<helper.sons_size; ++i) {
int created = 1;
dynablock_t *son = AddNewDynablock(block->parent, helper.sons_x86[i], 0, &created);
if(created) { // avoid breaking a working block! also, block could be outside this parent...
dynablock_t *son = AddNewDynablock(block->parent, helper.sons_x86[i], &created);
if(created || !son->parent) { // avoid breaking a working block! also, block could be outside this parent...
son->block = helper.sons_arm[i];
son->x86_addr = (void*)helper.sons_x86[i];
son->x86_size = end-helper.sons_x86[i];
@@ -321,6 +322,8 @@ void* FillBlock(dynablock_t* block, uintptr_t addr) {
son->father = block;
son->done = 1;
sons[sons_size++] = son;
if(!son->parent)
son->parent = block->parent;
}
}
if(sons_size) {
@@ -331,6 +334,8 @@ void* FillBlock(dynablock_t* block, uintptr_t addr) {
}
if(block->parent->nolinker)
protectDB((uintptr_t)block->x86_addr, block->x86_size);
free(helper.sons_x86);
free(helper.sons_arm);
block->done = 1;
return (void*)block;
}
+4 -4
View File
@@ -103,7 +103,7 @@ uintptr_t dynarec00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
POP(xESP, 1<<x2);
STRH_REG(x2, xEmu, x1);
MOVW(x1, 0);
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_clean[_ES]));
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_serial[_ES]));
break;
case 0x08:
INST_NAME("OR Eb, Gb");
@@ -281,7 +281,7 @@ uintptr_t dynarec00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
POP(xESP, 1<<x2);
STRH_REG(x2, xEmu, x1);
MOVW(x1, 0);
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_clean[_DS]));
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_serial[_DS]));
break;
case 0x20:
INST_NAME("AND Eb, Gb");
@@ -1156,7 +1156,7 @@ uintptr_t dynarec00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
STRH_IMM8(ed, x2, 0);
}
MOVW(x1, 0);
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_clean[(nextop&0x38)>>3]));
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_serial[(nextop&0x38)>>3]));
break;
case 0x8F:
INST_NAME("POP Ed");
@@ -1953,7 +1953,7 @@ uintptr_t dynarec00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
UBFX(x1, xEAX, 0, 16); // load AX
u8 = F8;
MOVW(x2, u8);
CALL_(aam16, x1, 0);
CALL_(aad16, x1, 0);
BFI(xEAX, x1, 0, 16);
break;
case 0xD6:
+2 -2
View File
@@ -1405,7 +1405,7 @@ uintptr_t dynarec0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
POP(xESP, 1<<x2);
STRH_REG(x2, xEmu, x1);
MOVW(x1, 0);
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_clean[_FS]));
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_serial[_FS]));
break;
case 0xA2:
INST_NAME("CPUID");
@@ -1468,7 +1468,7 @@ uintptr_t dynarec0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
POP(xESP, 1<<x2);
STRH_REG(x2, xEmu, x1);
MOVW(x1, 0);
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_clean[_GS]));
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_serial[_GS]));
break;
case 0xAB:
+48 -1
View File
@@ -205,6 +205,17 @@ uintptr_t dynarecFS(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
}
break;
case 0xA0:
INST_NAME("MOV AL, FS:Id");
grab_fsdata(dyn, addr, ninst, x1);
i32 = F32S;
if(i32>-4096 && i32<4096) {
LDRB_IMM9(xEAX, x1, i32);
} else {
MOV32(x2, i32);
LDRB_REG_LSL_IMM5(xEAX, x1, x2, 0);
}
break;
case 0xA1:
INST_NAME("MOV EAX, FS:Id");
grab_fsdata(dyn, addr, ninst, x1);
@@ -216,7 +227,17 @@ uintptr_t dynarecFS(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
LDR_REG_LSL_IMM5(xEAX, x1, x2, 0);
}
break;
case 0xA2:
INST_NAME("MOV FS:Od, AL");
grab_fsdata(dyn, addr, ninst, x1);
i32 = F32S;
if(i32>-4096 && i32<4096) {
STRB_IMM9(xEAX, x1, i32);
} else {
MOV32(x2, i32);
STRB_REG_LSL_IMM5(xEAX, x1, x2, 0);
}
break;
case 0xA3:
INST_NAME("MOV FS:Od, EAX");
grab_fsdata(dyn, addr, ninst, x1);
@@ -255,6 +276,32 @@ uintptr_t dynarecFS(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
nextop = F8;
grab_fsdata(dyn, addr, ninst, x12);
switch((nextop>>3)&7) {
case 2: // CALL Ed
INST_NAME("CALL Ed");
PASS2IF(ninst && dyn->insts && dyn->insts[ninst-1].x86.set_flags, 1) {
READFLAGS(X_PEND); // that's suspicious
} else {
SETFLAGS(X_ALL, SF_SET); //Hack to put flag in "don't care" state
}
if((nextop&0xC0)==0xC0) { // reg
MOV_REG(xEIP, xEAX+(nextop&7));
} else { // mem
addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0);
LDR_REG_LSL_IMM5(xEIP, ed, x12, 0);
}
BARRIER(1);
BARRIER_NEXT(1);
if(!dyn->nolinker && (!dyn->insts || ninst!=dyn->size-1)) {
PASS2(cstack_push(dyn, ninst, addr, dyn->insts[ninst+1].address, x1, x2);)
} else {
PASS2(cstack_push(dyn, ninst, 0, 0, x1, x2);)
*need_epilog = 0;
*ok = 0;
MOV32(x2, addr);
}
PUSH(xESP, 1<<x2);
jump_to_linker(dyn, 0, xEIP, ninst); // smart linker
break;
case 6: // Push Ed
INST_NAME("PUSH FS:Ed");
if((nextop&0xC0)==0xC0) { // reg
+2 -2
View File
@@ -83,7 +83,7 @@ uintptr_t dynarec66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
STRH_IMM8(x2, x1, 0);
ADD_IMM8(xESP, xESP, 2);
MOVW(x1, 0);
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_clean[_ES]));
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_serial[_ES]));
break;
case 0x09:
@@ -553,7 +553,7 @@ uintptr_t dynarec66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
STRH_REG(x1, xEmu, x2);
}
MOVW(x1, 0);
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_clean[(nextop&0x38)>>3]));
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_serial[(nextop&0x38)>>3]));
break;
case 0x90:
+34 -27
View File
@@ -151,22 +151,23 @@ uintptr_t dynarecDF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
case 1:
INST_NAME("FISTTP Ew, ST0");
v1 = x87_get_st(dyn, ninst, x1, x2, 0);
u8 = x87_setround(dyn, ninst, x1, x2, x12);
addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 255, 0);
ed = x1;
s0 = fpu_get_scratch_single(dyn);
VCVT_S32_F64(s0, v1);
MSR_nzcvq_0();
// x1 already have FPCSR reg to clear exceptions flags
ORR_IMM8(x3, x1, 0b001, 6); // enable exceptions
BIC_IMM8(x3, x3, 0b10011111, 0);
VMSR(x3);
VCVTR_S32_F64(s0, v1);
VMRS(x3); // get the FPCSR reg and test FPU execption (invalid operation only)
VMOVfrV(ed, s0);
MSR_nzcvq_0(); // reset Q flag (and all other flags too)
SSAT_REG_LSL_IMM5(ed, 16, ed, 0);
MRS_aspr(x3); // check Q flag
TSTS_IMM8_ROR(x3, 0b10, 3);
B_MARK(cEQ); // not saturated, continue
MOV32(ed, 0xffff8000);
MARK;
STRH_IMM8(ed, wback, fixedaddress);
TSTS_IMM8_ROR(x3, 0b00000001, 0);
SSAT_REG_LSL_IMM5_COND(cEQ, x3, 16, ed, 0);
CMPS_REG_LSL_IMM5_COND(cEQ, ed, x3, 0);
MOVW_COND(cNE, x3, 0x8000); // saturated
STRH_IMM8(x3, wback, fixedaddress);
x87_do_pop(dyn, ninst);
x87_restoreround(dyn, ninst, u8);
break;
case 2:
INST_NAME("FIST Ew, ST0");
@@ -175,16 +176,19 @@ uintptr_t dynarecDF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 255, 0);
ed = x1;
s0 = fpu_get_scratch_single(dyn);
MSR_nzcvq_0();
// x1 already have FPCSR reg to clear exceptions flags
ORR_IMM8(x3, x1, 0b001, 6); // enable exceptions
BIC_IMM8(x3, x3, 0b10011111, 0);
VMSR(x3);
VCVTR_S32_F64(s0, v1);
VMRS(x3); // get the FPCSR reg and test FPU execption (invalid operation only)
VMOVfrV(ed, s0);
MSR_nzcvq_0(); // reset Q flag (and all other flags too)
SSAT_REG_LSL_IMM5(ed, 16, ed, 0);
MRS_aspr(x3); // check Q flag
TSTS_IMM8_ROR(x3, 0b10, 3);
B_MARK(cEQ); // not saturated, continue
MOV32(ed, 0xffff8000);
MARK;
STRH_IMM8(ed, wback, fixedaddress);
TSTS_IMM8_ROR(x3, 0b00000001, 0);
SSAT_REG_LSL_IMM5_COND(cEQ, x3, 16, ed, 0);
CMPS_REG_LSL_IMM5_COND(cEQ, ed, x3, 0);
MOVW_COND(cNE, x3, 0x8000); // saturated
STRH_IMM8(x3, wback, fixedaddress);
x87_restoreround(dyn, ninst, u8);
break;
case 3:
@@ -194,16 +198,19 @@ uintptr_t dynarecDF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst,
addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, 255, 0);
ed = x1;
s0 = fpu_get_scratch_single(dyn);
MSR_nzcvq_0();
// x1 already have FPCSR reg to clear exceptions flags
ORR_IMM8(x3, x1, 0b001, 6); // enable exceptions
BIC_IMM8(x3, x3, 0b10011111, 0);
VMSR(x3);
VCVTR_S32_F64(s0, v1);
VMRS(x3); // get the FPCSR reg and test FPU execption (invalid operation only)
VMOVfrV(ed, s0);
MSR_nzcvq_0(); // reset Q flag (and all other flags too)
SSAT_REG_LSL_IMM5(ed, 16, ed, 0);
MRS_aspr(x3); // check Q flag
TSTS_IMM8_ROR(x3, 0b10, 3);
B_MARK(cEQ); // not saturated, continue
MOV32(ed, 0xffff8000);
MARK;
STRH_IMM8(ed, wback, fixedaddress);
TSTS_IMM8_ROR(x3, 0b00000001, 0);
SSAT_REG_LSL_IMM5_COND(cEQ, x3, 16, ed, 0);
CMPS_REG_LSL_IMM5_COND(cEQ, ed, x3, 0);
MOVW_COND(cNE, x3, 0x8000); // saturated
STRH_IMM8(x3, wback, fixedaddress);
x87_do_pop(dyn, ninst);
x87_restoreround(dyn, ninst, u8);
break;
+2 -2
View File
@@ -136,10 +136,10 @@ void arm_fistp64(x86emu_t* emu, int64_t* ed)
memcpy(ed, &STll(0).ll, sizeof(int64_t));
} else {
int64_t tmp;
if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, (double)(int64_t)0x8000000000000000LL))
if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, (double)(int64_t)0x8000000000000000LL) || !isfinite(ST0.d))
tmp = 0x8000000000000000LL;
else
tmp = (int64_t)ST0.d;
tmp = fpu_round(emu, ST0.d);
memcpy(ed, &tmp, sizeof(tmp));
}
}
+26 -11
View File
@@ -17,6 +17,7 @@
#include "x86trace.h"
#include "dynarec_arm.h"
#include "dynarec_arm_private.h"
#include "dynablock_private.h"
#include "arm_printer.h"
#include "../tools/bridge_private.h"
@@ -292,6 +293,8 @@ void jump_to_linker(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst)
MOV32_(x1, (uintptr_t)table);
// TODO: This is not thread safe.
if(!ip) { // no IP, jump address in a reg, so need smart linker
#if 0
//version thread safe
MARK;
LDREXD(x2, x1); // load dest address in x2 and planned ip in x3
CMPS_REG_LSL_IMM5(xEIP, x3, 0);
@@ -304,6 +307,16 @@ void jump_to_linker(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst)
MOV_REG(x12, x3); // put back IP in place...
B_MARK(cEQ);
BX(x2); // go to linker
#else
// not thread safe, is that still ok?
LDRD_IMM8(x2, x1, 0);
CMPS_REG_LSL_IMM5(xEIP, x3, 0);
BXcond(cEQ, x2);
MOV32_(x2, (uintptr_t)arm_linker);
MOV_REG(x3, x12);
STRD_IMM8(x2, x1, 0);
BX(x2);
#endif
} else {
LDR_IMM9(x2, x1, 0);
BX(x2); // jump
@@ -411,7 +424,7 @@ void iret_to_epilog(dynarec_arm_t* dyn, int ninst)
POP(xESP, 1<<x2);
STRH_REG(x2, xEmu, x1);
MOVW(x1, 0);
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_clean[_CS]));
STR_IMM9(x1, xEmu, offsetof(x86emu_t, segs_serial[_CS]));
// POP EFLAGS
POP(xESP, (1<<x1));
CALL(arm_popf, -1, (1<<xEIP));
@@ -444,12 +457,14 @@ void call_c(dynarec_arm_t* dyn, int ninst, void* fnc, int reg, int ret, uint32_t
void grab_tlsdata(dynarec_arm_t* dyn, uintptr_t addr, int ninst, int reg)
{
MESSAGE(LOG_DUMP, "Get TLSData\n");
//int32_t i32;
//MAYUSE(i32);
//LDR_IMM9(x12, xEmu, offsetof(x86emu_t, segs_clean[_GS]));
//CMPS_IMM8(x12, 1);
//LDR_IMM9_COND(cEQ, reg, xEmu, offsetof(x86emu_t, segs_offs[_GS]));
//B_MARKSEG(cEQ);
int32_t j32;
MAYUSE(j32);
LDR_IMM9(x1, xEmu, offsetof(x86emu_t, context));
LDR_IMM9(x12, xEmu, offsetof(x86emu_t, segs_serial[_GS])); // complete check here
LDR_IMM9(x1, x1, offsetof(box86context_t, sel_serial));
CMPS_REG_LSL_IMM5(x12, x1, 0);
LDR_IMM9_COND(cEQ, reg, xEmu, offsetof(x86emu_t, segs_offs[_GS]));
B_MARKSEG(cEQ);
MOVW(x1, _GS);
call_c(dyn, ninst, GetSegmentBaseEmu, 12, reg, 0);
MARKSEG;
@@ -461,10 +476,10 @@ void grab_fsdata(dynarec_arm_t* dyn, uintptr_t addr, int ninst, int reg)
int32_t j32;
MAYUSE(j32);
MESSAGE(LOG_DUMP, "Get FS: Offset\n");
LDR_IMM9(x12, xEmu, offsetof(x86emu_t, segs_clean[_FS]));
CMPS_IMM8(x12, 1);
LDR_IMM9_COND(cEQ, reg, xEmu, offsetof(x86emu_t, segs_offs[_FS]));
B_MARKSEG(cEQ);
LDR_IMM9(x12, xEmu, offsetof(x86emu_t, segs_serial[_FS]));// fast check here
CMPS_IMM8(x12, 0);
LDR_IMM9_COND(cNE, reg, xEmu, offsetof(x86emu_t, segs_offs[_FS]));
B_MARKSEG(cNE);
MOVW(x1, _FS);
call_c(dyn, ninst, GetSegmentBaseEmu, 12, reg, 0);
MARKSEG;
+1 -1
View File
@@ -283,7 +283,7 @@
#ifndef READFLAGS
#define READFLAGS(A) \
if(dyn->state_flags!=SF_SET) { \
if(((A)!=X_PEND) && dyn->state_flags!=SF_SET) { \
if(dyn->state_flags!=SF_PENDING) { \
LDR_IMM9(x3, xEmu, offsetof(x86emu_t, df)); \
TSTS_REG_LSL_IMM5(x3, x3, 0); \
+1 -1
View File
@@ -8,7 +8,7 @@
#define SETFLAGS(A,B) {dyn->insts[ninst].x86.set_flags = A; dyn->insts[ninst].x86.state_flags = B;}
#define JUMP(A) dyn->insts[ninst].x86.jmp = A
#define BARRIER(A) dyn->insts[ninst].x86.barrier = A
#define BARRIER_NEXT(A) if(ninst+1<dyn->size) dyn->insts[ninst+1].x86.barrier = A
#define BARRIER_NEXT(A) if(ninst<dyn->size) dyn->insts[ninst+1].x86.barrier = A
#define NEW_INST \
dyn->insts[ninst].x86.addr = ip; \
+71 -38
View File
@@ -66,7 +66,7 @@ void FreeElfHeader(elfheader_t** head)
#ifdef DYNAREC
if(h->text) {
dynarec_log(LOG_INFO, "Free Dynarec block for %s\n", h->path);
cleanDBFromAddressRange(h->text, h->textsz, 1);
cleanDBFromAddressRange(my_context, h->text, h->textsz, 1);
}
#endif
free(h->name);
@@ -267,7 +267,7 @@ int LoadElfMemory(FILE* f, box86context_t* context, elfheader_t* head)
#ifdef DYNAREC
if(e->p_flags & PF_X) {
dynarec_log(LOG_DEBUG, "Add ELF eXecutable Memory %p:%p\n", dest, (void*)e->p_memsz);
addDBFromAddressRange((uintptr_t)dest, e->p_memsz, 0);
addDBFromAddressRange(context, (uintptr_t)dest, e->p_memsz, 0);
}
#endif
}
@@ -333,6 +333,7 @@ int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, elfheader_t* head, int cn
uint32_t *p = (uint32_t*)(rel[i].r_offset + head->delta);
uintptr_t offs = 0;
uintptr_t end = 0;
uintptr_t tmp = 0;
elfheader_t* h_tls = head;
if(bind==STB_LOCAL) {
offs = sym->st_value + head->delta;
@@ -459,8 +460,13 @@ int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, elfheader_t* head, int cn
}
break;
case R_386_JMP_SLOT:
// apply immediatly for gobject closure marshal or for LOCAL binding
if(bind==STB_LOCAL || ((symname && strstr(symname, "g_cclosure_marshal_")==symname))) {
// apply immediatly for gobject closure marshal or for LOCAL binding. Also, apply immediatly if it doesn't jump in the got
tmp = (uintptr_t)(*p);
if (bind==STB_LOCAL
|| ((symname && strstr(symname, "g_cclosure_marshal_")==symname))
|| !tmp
|| !((tmp>=head->plt && tmp<head->plt_end) || (tmp>=head->gotplt && tmp<head->gotplt_end))
) {
if (!offs) {
if(bind==STB_WEAK) {
printf_log(LOG_INFO, "Warning: Weak Symbol %s not found, cannot apply R_386_JMP_SLOT @%p (%p)\n", symname, p, *(void**)p);
@@ -575,7 +581,7 @@ int RelocateElfPlt(lib_t *maplib, lib_t *local_maplib, elfheader_t* head)
return -1;
}
if(pltResolver==~0) {
pltResolver = AddBridge(my_context->system, vFE, PltResolver, 0);
pltResolver = AddBridge(my_context->system, my_context, vFE, PltResolver, 0);
}
if(head->pltgot) {
*(uintptr_t*)(head->pltgot+head->delta+8) = pltResolver;
@@ -764,7 +770,7 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, needed_libs_t* neededlibs, int
printf_log(LOG_INFO, "BOX86: Warning, RPATH with $ variable not supported yet (%s)\n", rpath);
} else {
printf_log(LOG_DEBUG, "Prepending path \"%s\" to BOX86_LD_LIBRARY_PATH\n", rpath);
PrependPath(rpath, &box86->box86_ld_lib, 1);
PrependList(&box86->box86_ld_lib, rpath, 1);
}
if(rpath!=rpathref)
free(rpath);
@@ -787,12 +793,27 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, needed_libs_t* neededlibs, int
return 0;
}
int ElfCheckIfUseTCMallocMinimal(elfheader_t* h)
{
if(!h)
return 0;
for (int i=0; i<h->numDynamic; ++i)
if(h->Dynamic[i].d_tag==DT_NEEDED) {
char *needed = h->DynStrTab+h->delta+h->Dynamic[i].d_un.d_val;
if(!strcmp(needed, "libtcmalloc_minimal.so.4")) // tcmalloc needs to be the 1st lib loaded
return 1;
else
return 0;
}
return 0;
}
void RunElfInit(elfheader_t* h, x86emu_t *emu)
{
if(!h || h->init_done)
return;
// reset Segs Cache
memset(emu->segs_clean, 0, sizeof(emu->segs_clean));
memset(emu->segs_serial, 0, sizeof(emu->segs_serial));
uintptr_t p = h->initentry + h->delta;
box86context_t* context = GetEmuContext(emu);
if(context->deferedInit) {
@@ -980,24 +1001,19 @@ void* GetTLSPointer(box86context_t* context, elfheader_t* h)
#ifdef DYNAREC
dynablocklist_t* GetDynablocksFromAddress(box86context_t *context, uintptr_t addr)
{
// this is one is fast, so start with that
dynablocklist_t* ret = getDBFromAddress(addr);
// if we are here, the there is not block in standard "space"
/*dynablocklist_t* ret = getDBFromAddress(addr);
if(ret) {
return ret;
}*/
if(box86_dynarec_forced) {
addDBFromAddressRange(my_context, addr, 1, 1);
return my_context->dynmap[addr>>DYNAMAP_SHIFT];
}
// nope
if(addr>0x100)
if((*(uint8_t*)addr)==0xCC || (((*(uint8_t*)addr)==0xC3 || (*(uint8_t*)addr)==0xC2) /*&& (*(uint8_t*)(addr-11))==0xCC*/) )
return context->dynablocks;
if(box86_dynarec_forced)
return context->dynablocks;
// check if the adress has an alternate one
if(hasAlternate((void*)addr))
return context->dynablocks;
//check if address is in an elf... if yes, grant a block (should I warn)
Dl_info info;
if(dladdr((void*)addr, &info)) {
printf_log(LOG_INFO, "Address %p is in a native Elf memory space (function \"%s\" in %s)\n", (void*)addr, info.dli_sname, info.dli_fname);
dynarec_log(LOG_INFO, "Address %p is in a native Elf memory space (function \"%s\" in %s)\n", (void*)addr, info.dli_sname, info.dli_fname);
return NULL;
}
dynarec_log(LOG_INFO, "Address %p not found in Elf memory and is not a native call wrapper\n", (void*)addr);
@@ -1012,29 +1028,49 @@ typedef struct my_dl_phdr_info_s {
int dlpi_phnum;
} my_dl_phdr_info_t;
static int dl_iterate_phdr_callback(x86emu_t *emu, my_dl_phdr_info_t *info, size_t size, void* data)
static int dl_iterate_phdr_callback(x86emu_t *emu, void* F, my_dl_phdr_info_t *info, size_t size, void* data)
{
SetCallbackArgs(emu, 2, info, size);
int ret = RunCallback(emu);
int ret = RunFunctionWithEmu(emu, 0, (uintptr_t)F, 3, info, size, data);
return ret;
}
static int dl_iterate_phdr_native(struct dl_phdr_info* info, size_t size, void* data)
{
if(!info->dlpi_name)
return 0;
if(!info->dlpi_name[0]) // don't send informations about box86 itself
return 0;
#define SUPER() \
GO(0) \
GO(1) \
GO(2) \
GO(3) \
GO(4)
x86emu_t* emu = (x86emu_t*)data;
SetCallbackArgs(emu, 2, info, size);
int ret = RunCallback(emu);
return ret;
// dl_iterate_phdr ...
#define GO(A) \
static uintptr_t my_dl_iterate_phdr_fct_##A = 0; \
static int my_dl_iterate_phdr_##A(struct dl_phdr_info* a, size_t b, void* c)\
{ \
if(!a->dlpi_name) \
return 0; \
if(!a->dlpi_name[0]) /*don't send informations about box86 itself*/ \
return 0; \
return RunFunction(my_context, my_dl_iterate_phdr_fct_##A, 3, a, b, c); \
}
SUPER()
#undef GO
static void* find_dl_iterate_phdr_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_dl_iterate_phdr_fct_##A == (uintptr_t)fct) return my_dl_iterate_phdr_##A;
SUPER()
#undef GO
#define GO(A) if(my_dl_iterate_phdr_fct_##A == 0) {my_dl_iterate_phdr_fct_##A = (uintptr_t)fct; return my_dl_iterate_phdr_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for elfloader dl_iterate_phdr callback\n");
return NULL;
}
#undef SUPER
EXPORT int my_dl_iterate_phdr(x86emu_t *emu, void* F, void *data) {
printf_log(LOG_INFO, "Warning: call to partially implemented dl_iterate_phdr(%p, %p)\n", F, data);
x86emu_t* cbemu = AddSharedCallback(emu, (uintptr_t)F, 3, NULL, NULL, data, NULL);
box86context_t *context = GetEmuContext(emu);
const char* empty = "";
int ret = 0;
@@ -1044,15 +1080,12 @@ EXPORT int my_dl_iterate_phdr(x86emu_t *emu, void* F, void *data) {
info.dlpi_name = idx?context->elfs[idx]->name:empty; //1st elf is program, and this one doesn't get a name
info.dlpi_phdr = context->elfs[idx]->PHEntries;
info.dlpi_phnum = context->elfs[idx]->numPHEntries;
if((ret = dl_iterate_phdr_callback(cbemu, &info, sizeof(info), data))) {
FreeCallback(cbemu);
if((ret = dl_iterate_phdr_callback(emu, F, &info, sizeof(info), data))) {
return ret;
}
}
// and now, go on native version
ret = dl_iterate_phdr(dl_iterate_phdr_native, cbemu);
// all done
FreeCallback(cbemu);
ret = dl_iterate_phdr(find_dl_iterate_phdr_Fct(F), data);
return ret;
}
+4
View File
@@ -52,8 +52,12 @@ struct elfheader_s {
int pltent;
uint32_t pltrel;
uintptr_t gotplt;
uintptr_t gotplt_end;
uintptr_t pltgot;
uintptr_t got;
uintptr_t got_end;
uintptr_t plt;
uintptr_t plt_end;
uintptr_t text;
int textsz;
+9 -1
View File
@@ -254,12 +254,20 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec)
int ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".got.plt");
if(ii) {
h->gotplt = h->SHEntries[ii].sh_addr;
h->gotplt_end = h->gotplt + h->SHEntries[ii].sh_size;
printf_log(LOG_DEBUG, "The GOT.PLT Table is at address %p\n", (void*)h->gotplt);
}
ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".got");
if(ii) {
h->got = h->SHEntries[ii].sh_addr;
printf_log(LOG_DEBUG, "The GOT Table is at address %p\n", (void*)h->got);
h->got_end = h->got + h->SHEntries[ii].sh_size;
printf_log(LOG_DEBUG, "The GOT Table is at address %p..%p\n", (void*)h->got, (void*)h->got_end);
}
ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".plt");
if(ii) {
h->plt = h->SHEntries[ii].sh_addr;
h->plt_end = h->plt + h->SHEntries[ii].sh_size;
printf_log(LOG_DEBUG, "The PLT Table is at address %p..%p\n", (void*)h->plt, (void*)h->plt_end);
}
// look for .init entry point
ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".init");
+2 -2
View File
@@ -682,7 +682,7 @@
NEXT;
_0f_0xA1: /* POP FS */
emu->segs[_FS] = Pop(emu); // no check, no use....
emu->segs_clean[_FS] = 0;
emu->segs_serial[_FS] = 0;
NEXT;
_0f_0xA2: /* CPUID */
tmp32u = R_EAX;
@@ -716,7 +716,7 @@
NEXT;
_0f_0xA9: /* POP GS */
emu->segs[_GS] = Pop(emu);
emu->segs_clean[_GS] = 0;
emu->segs_serial[_GS] = 0;
NEXT;
+13 -2
View File
@@ -30,7 +30,7 @@
NEXT;
_66_0x07: /* POP ES */
emu->segs[_ES] = Pop16(emu); // no check, no use....
emu->segs_clean[_ES] = 0;
emu->segs_serial[_ES] = 0;
NEXT;
_66_0x0F: /* 66 0f prefix */
@@ -39,6 +39,7 @@
Run660F(emu); // implemented in Run660f.c
ip = R_EIP;
if(emu->quit) goto fini;
STEP
NEXT;
_66_0x26: /* ES: */
@@ -215,7 +216,7 @@
nextop = F8;
GET_EW;
emu->segs[((nextop&0x38)>>3)] = EW->word[0];
emu->segs_clean[((nextop&0x38)>>3)] = 0;
emu->segs_serial[((nextop&0x38)>>3)] = 0;
NEXT;
_66_0x8F: /* POP Ew */
nextop = F8;
@@ -355,6 +356,7 @@
Run66D9(emu);
ip = R_EIP;
if(emu->quit) goto fini;
STEP
NEXT;
_66_0xDD:
@@ -363,8 +365,17 @@
Run66DD(emu);
ip = R_EIP;
if(emu->quit) goto fini;
STEP
NEXT;
_66_0xF0: /* LOCK prefix */
emu->old_ip = R_EIP;
R_EIP = ip;
RunLock66(emu);
ip = R_EIP;
if(emu->quit) goto fini;
STEP
NEXT;
_66_0xF2: /* REPNZ prefix */
_66_0xF3: /* REPZ prefix */
+2 -2
View File
@@ -111,7 +111,7 @@
break;
case 2: /* FIST Ed, ST0 */
GET_ED;
if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, -(double)(int32_t)0x7fffffff))
if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, -(double)(int32_t)0x7fffffff) || !isfinite(ST0.d))
ED->sdword[0] = 0x80000000;
else {
volatile int32_t tmp = fpu_round(emu, ST0.d); // tmp to avoid BUS ERROR
@@ -120,7 +120,7 @@
break;
case 3: /* FISTP Ed, ST0 */
GET_ED;
if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, -(double)(int32_t)0x7fffffff))
if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, -(double)(int32_t)0x7fffffff) || !isfinite(ST0.d))
ED->sdword[0] = 0x80000000;
else {
volatile int32_t tmp = fpu_round(emu, ST0.d); // tmp to avoid BUS ERROR
+23 -25
View File
@@ -98,28 +98,14 @@
break;
case 2: /* FIST Ew, ST0 */
GET_EW;
if(isgreater(ST0.d, (double)(int32_t)0x7fff) || isless(ST0.d, -(double)(int32_t)0x7fff))
if(isgreater(ST0.d, (double)(int32_t)0x7fff) || isless(ST0.d, -(double)(int32_t)0x7fff) || !isfinite(ST0.d))
EW->sword[0] = 0x8000;
else {
switch(emu->round) {
case ROUND_Nearest:
EW->sword[0] = floor(ST0.d+0.5);
break;
case ROUND_Down:
EW->sword[0] = floor(ST0.d);
break;
case ROUND_Up:
EW->sword[0] = ceil(ST0.d);
break;
case ROUND_Chop:
EW->sword[0] = ST0.d;
break;
}
}
else
EW->sword[0] = fpu_round(emu, ST0.d);
break;
case 3: /* FISTP Ew, ST0 */
GET_EW;
if(isgreater(ST0.d, (double)(int32_t)0x7fff) || isless(ST0.d, -(double)(int32_t)0x7fff))
if(isgreater(ST0.d, (double)(int32_t)0x7fff) || isless(ST0.d, -(double)(int32_t)0x7fff) || !isfinite(ST0.d))
EW->sword[0] = 0x8000;
else
EW->sword[0] = fpu_round(emu, ST0.d);
@@ -145,14 +131,26 @@
break;
case 7: /* FISTP i64 */
GET_ED;
if(STll(0).ref==ST(0).ll) {
*(int64_t*)ED = STll(0).ll;
} else {
if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, -(double)(int64_t)0x7fffffffffffffffLL))
*(int64_t*)ED = 0x8000000000000000LL;
if((uintptr_t)ED & 0x7) {
// un-aligned!
if(STll(0).ref==ST(0).ll)
memcpy(ED, &STll(0).ll, sizeof(int64_t));
else {
int64_t i64 = fpu_round(emu, ST0.d);
*(int64_t*)ED = i64;
int64_t i64;
if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, -(double)(int64_t)0x7fffffffffffffffLL) || !isfinite(ST0.d))
i64 = 0x8000000000000000LL;
else
i64 = fpu_round(emu, ST0.d);
memcpy(ED, &i64, sizeof(int64_t));
}
} else {
if(STll(0).ref==ST(0).ll)
*(int64_t*)ED = STll(0).ll;
else {
if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, -(double)(int64_t)0x7fffffffffffffffLL) || !isfinite(ST0.d))
*(int64_t*)ED = 0x8000000000000000LL;
else
*(int64_t*)ED = fpu_round(emu, ST0.d);
}
}
fpu_do_pop(emu);
+15 -1
View File
@@ -35,6 +35,13 @@ static uint32_t x86emu_parity_tab[8] =
};
static uint8_t EndEmuMarker[] = {0xcc, 'S', 'C', 0, 0, 0, 0};
#ifdef DYNAREC
void DynablockEmuMarker(box86context_t* context)
{
dynarec_log(LOG_DUMP, "Create bridge memory map for PushExit\n");
addDBFromAddressRange(context, (uintptr_t)&EndEmuMarker[0], sizeof(EndEmuMarker), 0);
}
#endif
void PushExit(x86emu_t* emu)
{
Push(emu, (uint32_t)&EndEmuMarker);
@@ -195,7 +202,7 @@ void CloneEmu(x86emu_t *newemu, const x86emu_t* emu)
memcpy(&newemu->flags, &emu->flags, sizeof(emu->flags));
newemu->old_ip = emu->old_ip;
memcpy(newemu->segs, emu->segs, sizeof(emu->segs));
memset(newemu->segs_clean, 0, sizeof(newemu->segs_clean));
memset(newemu->segs_serial, 0, sizeof(newemu->segs_serial));
memcpy(newemu->fpu, emu->fpu, sizeof(emu->fpu));
memcpy(newemu->fpu_ld, emu->fpu_ld, sizeof(emu->fpu_ld));
memcpy(newemu->fpu_ll, emu->fpu_ll, sizeof(emu->fpu_ll));
@@ -460,3 +467,10 @@ uint64_t ReadTSC(x86emu_t* emu)
return (uint64_t)(tv.tv_sec) * 1000000 + tv.tv_usec;
#endif
}
void ResetSegmentsCache(x86emu_t *emu)
{
if(!emu)
return;
memset(emu->segs_serial, 0, sizeof(emu->segs_serial));
}
+4 -3
View File
@@ -56,7 +56,7 @@ typedef struct x86emu_s {
// segments
uint32_t segs[6]; // only 32bits value?
uintptr_t segs_offs[6]; // computed offset associate with segment
int segs_clean[6]; // are seg offset clean (1) or does they need to be re-computed (0)?
uint32_t segs_serial[6]; // are seg offset clean (not 0) or does they need to be re-computed (0)? For GS, serial need to be the same as context->sel_serial
// emu control
int quit;
int error;
@@ -65,12 +65,13 @@ typedef struct x86emu_s {
int exit;
int quitonlongjmp; // quit if longjmp is called
int longjmp; // if quit because of longjmp
// parent context
box86context_t *context;
#ifdef DYNAREC
// virtual return stack
int cstacki; // current index
uint64_t cstack[CSTACK+1]; // pair of x86 address / native address for call/ret, using uint64_t for alignement, +1 for allignment
#endif
// parent context
box86context_t *context;
// cpu helpers
reg32_t zero;
reg32_t *sbiidx[8];
+30 -24
View File
@@ -164,7 +164,7 @@ int Run(x86emu_t *emu, int step)
&&_default, &&_66_0xD9, &&_default, &&_default, &&_default ,&&_66_0xDD, &&_default, &&_default, //0xD8-0xDF
&&_default, &&_default, &&_default, &&_default, &&_default ,&&_default, &&_default, &&_default, //0xE0-0xE7
&&_default, &&_default, &&_default, &&_default, &&_default ,&&_default, &&_default, &&_default, //0xE8-0xEF
&&_default, &&_default, &&_66_0xF2, &&_66_0xF3, &&_default, &&_default, &&_default, &&_66_0xF7,
&&_66_0xF0, &&_default, &&_66_0xF2, &&_66_0xF3, &&_default, &&_default, &&_default, &&_66_0xF7,
&&_66_0xF8, &&_66_0xF9, &&_default, &&_default, &&_default, &&_default, &&_default, &&_66_0xFF
};
@@ -263,7 +263,7 @@ _trace:
NEXT;
_0x07: /* POP ES */
emu->segs[_ES] = Pop(emu); // no check, no use....
emu->segs_clean[_ES] = 0;
emu->segs_serial[_ES] = 0;
NEXT;
_0x0E: /* PUSH CS */
@@ -278,7 +278,7 @@ _trace:
NEXT;
_0x17: /* POP SS */
emu->segs[_SS] = Pop(emu); // no check, no use....
emu->segs_clean[_SS] = 0;
emu->segs_serial[_SS] = 0;
NEXT;
_0x1E: /* PUSH DS */
@@ -286,7 +286,7 @@ _trace:
NEXT;
_0x1F: /* POP DS */
emu->segs[_DS] = Pop(emu); // no check, no use....
emu->segs_clean[_DS] = 0;
emu->segs_serial[_DS] = 0;
NEXT;
_0x26: /* ES: */
@@ -399,6 +399,7 @@ _trace:
RunFS(emu); // implemented in Run66.c
ip = R_EIP;
if(emu->quit) goto fini;
STEP
NEXT;
_0x65: /* GS: */
emu->old_ip = R_EIP;
@@ -406,6 +407,7 @@ _trace:
RunGS(emu); // implemented in Run66.c
ip = R_EIP;
if(emu->quit) goto fini;
STEP
NEXT;
_0x66: /* Prefix to change width of intructions, so here, down to 16bits */
@@ -416,6 +418,7 @@ _trace:
Run67(emu); // implemented in Run66.c
ip = R_EIP;
if(emu->quit) goto fini;
STEP
NEXT;
_0x68: /* Push Id */
@@ -642,13 +645,11 @@ _trace:
// not aligned, dont't try to "LOCK"
tmp32u = ED->dword[0];
ED->dword[0] = GD.dword[0];
GD.dword[0] = tmp32u;
} else {
// XCHG is supposed to automaticaly LOCK memory bus
do {
tmp32u = arm_lock_read_d(ED);
} while(arm_lock_write_d(ED, GD.dword[0]));
GD.dword[0] = arm_lock_xchg(ED, GD.dword[0]);
}
GD.dword[0] = tmp32u;
}
#else
GET_ED;
@@ -695,7 +696,7 @@ _trace:
nextop = F8;
GET_EW;
emu->segs[((nextop&0x38)>>3)] = EW->word[0];
emu->segs_clean[((nextop&0x38)>>3)] = 0;
emu->segs_serial[((nextop&0x38)>>3)] = 0;
if(((nextop&0x38)>>3)==_FS)
default_fs = EW->word[0];
NEXT;
@@ -896,14 +897,14 @@ _trace:
nextop = F8;
GET_ED;
emu->segs[_ES] = ED->word[0];
emu->segs_clean[_ES] = 0;
emu->segs_serial[_ES] = 0;
GD.dword[0] = *(uint32_t*)(((void*)ED)+2);
NEXT;
_0xC5: /* LDS Gd,Ed */
nextop = F8;
GET_ED;
emu->segs[_DS] = ED->word[0];
emu->segs_clean[_DS] = 0;
emu->segs_serial[_DS] = 0;
GD.dword[0] = *(uint32_t*)(((void*)ED)+2);
NEXT;
_0xC6: /* MOV Eb,Ib */
@@ -941,7 +942,7 @@ _trace:
_0xCB: /* FAR RET */
ip = Pop(emu);
emu->segs[_CS] = Pop(emu); // no check, no use....
emu->segs_clean[_CS] = 0;
emu->segs_serial[_CS] = 0;
// need to check status of CS register!
STEP
NEXT;
@@ -974,7 +975,7 @@ _trace:
_0xCF: /* IRET */
ip = Pop(emu);
emu->segs[_CS] = Pop(emu);
emu->segs_clean[_CS] = 0;
emu->segs_serial[_CS] = 0;
emu->packed_eflags.x32 = ((Pop(emu) & 0x3F7FD7)/* & (0xffff-40)*/ ) | 0x2; // mask off res2 and res3 and on res1
UnpackFlags(emu);
RESET_FLAGS(emu);
@@ -1056,6 +1057,7 @@ _trace:
--R_ECX; // don't update flags
if(R_ECX && !ACCESS_FLAG(F_ZF))
ip += tmp8s;
STEP
NEXT;
_0xE1: /* LOOPZ */
CHECK_FLAGS(emu);
@@ -1063,19 +1065,20 @@ _trace:
--R_ECX; // don't update flags
if(R_ECX && ACCESS_FLAG(F_ZF))
ip += tmp8s;
STEP
NEXT;
_0xE2: /* LOOP */
tmp8s = F8S;
--R_ECX; // don't update flags
if(R_ECX)
ip += tmp8s;
STEP
NEXT;
_0xE3: /* JECXZ */
tmp8s = F8S;
if(!R_ECX) {
if(!R_ECX)
ip += tmp8s;
STEP
}
STEP
NEXT;
_0xE4: /* IN AL, Ib */
tmp32s = F8; // port address
@@ -1136,6 +1139,7 @@ _trace:
} else {
#include "runf20f.h"
}
STEP
NEXT;
} else if(nextop==0x66) {
nextop = F8;
@@ -1503,6 +1507,7 @@ _trace:
NEXT;
_0xFE: /* GRP 5 Eb */
nextop = F8;
tmp32u2 = ip;
GET_EB;
switch((nextop>>3)&7) {
case 0: /* INC Eb */
@@ -1513,8 +1518,8 @@ _trace:
break;
default:
emu->old_ip = R_EIP;
R_EIP = ip;
printf_log(LOG_NONE, "Illegal Opcode %02X %02X\n", opcode, nextop);
R_EIP = ip = tmp32u2;
printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X\n", (void*)ip, opcode, nextop, PK(2), PK(3));
emu->quit=1;
emu->error |= ERR_ILLEGAL;
goto fini;
@@ -1522,6 +1527,7 @@ _trace:
NEXT;
_0xFF: /* GRP 5 Ed */
nextop = F8;
tmp32u2 = ip;
GET_ED;
switch((nextop>>3)&7) {
case 0: /* INC Ed */
@@ -1539,8 +1545,8 @@ _trace:
case 3: /* CALL FAR Ed */
if(nextop>0xc0) {
emu->old_ip = R_EIP;
R_EIP = ip;
printf_log(LOG_NONE, "Illegal Opcode %02X %02X\n", opcode, nextop);
R_EIP = ip = tmp32u2;
printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X\n", (void*)ip, opcode, nextop, PK(2), PK(3));
emu->quit=1;
emu->error |= ERR_ILLEGAL;
goto fini;
@@ -1559,8 +1565,8 @@ _trace:
case 5: /* JMP FAR Ed */
if(nextop>0xc0) {
emu->old_ip = R_EIP;
R_EIP = ip;
printf_log(LOG_NONE, "Illegal Opcode 0x%02X 0x%02X\n", opcode, nextop);
R_EIP = ip = tmp32u2;
printf_log(LOG_NONE, "Illegal Opcode %p: 0x%02X 0x%02X %02X %02X\n", (void*)ip, opcode, nextop, PK(2), PK(3));
emu->quit=1;
emu->error |= ERR_ILLEGAL;
goto fini;
@@ -1576,8 +1582,8 @@ _trace:
break;
default:
emu->old_ip = R_EIP;
R_EIP = ip;
printf_log(LOG_NONE, "Illegal Opcode %02X %02X %02X %02X %02X %02X\n", opcode, nextop, PK(2), PK(3), PK(4), PK(5));
R_EIP = ip = tmp32u2;
printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X %02X %02X\n",(void*)ip, opcode, nextop, PK(2), PK(3), PK(4), PK(5));
emu->quit=1;
emu->error |= ERR_ILLEGAL;
goto fini;
+56 -1
View File
@@ -624,6 +624,57 @@ void RunLock(x86emu_t *emu)
R_EIP = ip;
}
void RunLock66(x86emu_t *emu)
{
uintptr_t ip = R_EIP+1;
uint8_t opcode = F8;
uint8_t nextop;
reg32_t *oped;
uint16_t tmp16u;
int32_t tmp32s;
switch(opcode) {
case 0x0f:
opcode = F8;
switch (opcode) {
case 0xB1: /* CMPXCHG Ew,Gw */
nextop = F8;
GET_EW;
#ifdef DYNAREC
do {
tmp16u = arm_lock_read_h(ED);
cmp16(emu, R_AX, tmp16u);
if(ACCESS_FLAG(F_ZF)) {
tmp32s = arm_lock_write_h(ED, GW.word[0]);
} else {
R_AX = tmp16u;
tmp32s = 0;
}
} while(tmp32s);
#else
pthread_mutex_lock(&emu->context->mutex_lock);
GET_EW;
cmp16(emu, R_AX, EW->word[0]);
if(ACCESS_FLAG(F_ZF)) {
EW->word[0] = GW.word[0];
} else {
R_AX = EW->word[0];
}
pthread_mutex_unlock(&emu->context->mutex_lock);
#endif
break;
default:
ip-=4; // unfetch nextop, 0F, F0 & 66
UnimpOpcode(emu);
}
break;
default:
ip-=3; // unfetch nextop, F0 & 66
UnimpOpcode(emu);
// should trigger invalid unlock ?
}
R_EIP = ip;
}
void RunGS(x86emu_t *emu)
{
uintptr_t ip = R_EIP+1;
@@ -1022,13 +1073,17 @@ void RunFS(x86emu_t *emu)
nextop = F8;
GET_ED_OFFS(tlsdata);
emu->segs[((nextop&0x38)>>3)] = ED->word[0];
emu->segs_clean[((nextop&0x38)>>3)] = 0;
emu->segs_serial[((nextop&0x38)>>3)] = 0;
break;
case 0x8F: /* POP Ed */
nextop = F8;
GET_ED_OFFS(tlsdata);
ED->dword[0] = Pop(emu);
break;
case 0xA0: /* MOV AL,Ob */
tmp32s = F32S;
R_AL = *(uint8_t*)((tlsdata) + tmp32s);
break;
case 0xA1: /* MOV EAX,Ov */
tmp32s = F32S;
R_EAX = *(uint32_t*)((tlsdata) + tmp32s);
+8 -7
View File
@@ -56,23 +56,24 @@ int32_t EXPORT my___libc_start_main(x86emu_t* emu, int *(main) (int, char * *, c
const char* GetNativeName(void* p)
{
static char unknown[10] = "???";
static char buff[500] = {0};
Dl_info info;
if(dladdr(p, &info)==0) {
const char *ret = GetNameOffset(my_context->maplib, p);
if(ret)
return ret;
return unknown;
sprintf(buff, "%s(%p)", "???", p);
return buff;
} else {
if(info.dli_sname) {
strcpy(buff, info.dli_sname);
if(info.dli_fname) {
strcat(buff, " ("); strcat(buff, info.dli_fname); strcat(buff, ")");
}
} else
return unknown;
} else {
sprintf(buff, "%s(%s/%p)", "???", info.dli_fname, p);
return buff;
}
}
return buff;
}
@@ -744,9 +745,9 @@ void UnpackFlags(x86emu_t* emu)
uintptr_t GetSegmentBaseEmu(x86emu_t* emu, int seg)
{
if(!emu->segs_clean[seg] || seg==_GS) {
if(emu->segs_serial[seg] != emu->context->sel_serial) {
emu->segs_offs[seg] = (uintptr_t)GetSegmentBase(emu->segs[seg]);
emu->segs_clean[seg] = 1;
emu->segs_serial[seg] = emu->context->sel_serial;
}
return emu->segs_offs[seg];
}
+1
View File
@@ -202,6 +202,7 @@ void Run6766(x86emu_t *emu);
void RunGS(x86emu_t *emu);
void RunFS(x86emu_t *emu);
void RunLock(x86emu_t *emu);
void RunLock66(x86emu_t *emu);
void x86Syscall(x86emu_t *emu);
void x86Int3(x86emu_t* emu);
+17 -1
View File
@@ -56,6 +56,9 @@ typedef struct x86_sigaction_s x86_sigaction_t;
int32_t my_getrandom(x86emu_t* emu, void* buf, uint32_t buflen, uint32_t flags);
int of_convert(int flag);
int32_t my_open(x86emu_t* emu, void* pathname, int32_t flags, uint32_t mode);
#ifndef __NR_memfd_create
int my_memfd_create(x86emu_t* emu, void* name, uint32_t flags);
#endif
#ifndef NOALIGN
int my_epoll_create(x86emu_t* emu, int size);
@@ -220,6 +223,9 @@ scwrap_t syscallwrap[] = {
#ifdef __NR_getrandom
{ 355, __NR_getrandom, 3 },
#endif
#ifdef __NR_memfd_create
{ 356, __NR_memfd_create, 2},
#endif
};
struct mmap_arg_struct {
@@ -325,7 +331,8 @@ void EXPORT x86Syscall(x86emu_t *emu)
case 1: // sys_exit
emu->quit = 1;
emu->exit = 1;
R_EAX = R_EBX; // faking the syscall here, we don't want to really terminate the program now
//R_EAX = syscall(__NR_exit, R_EBX); // the syscall should exit only current thread
R_EAX = R_EBX; // faking the syscall here, we don't want to really terminate the thread now
break;
case 3: // sys_read
R_EAX = (uint32_t)read((int)R_EBX, (void*)R_ECX, (size_t)R_EDX);
@@ -579,6 +586,11 @@ void EXPORT x86Syscall(x86emu_t *emu)
case 355: // getrandom
R_EAX = my_getrandom(emu, (void*)R_EBX, R_ECX, R_EDX);
break;
#endif
#ifndef __NR_memfd_create
case 356: // memfd_create
R_EAX = my_memfd_create(emu, (void*)R_EBX, R_ECX);
break;
#endif
default:
printf_log(LOG_INFO, "Error: Unsupported Syscall 0x%02Xh (%d)\n", s, s);
@@ -663,6 +675,10 @@ uint32_t EXPORT my_syscall(x86emu_t *emu)
#ifndef __NR_getrandom
case 355: // getrandom
return (uint32_t)my_getrandom(emu, p(4), u32(8), u32(12));
#endif
#ifndef __NR_memfd_create
case 356: // memfd_create
return (uint32_t)my_memfd_create(emu, (void*)R_EBX, R_ECX);
#endif
default:
printf_log(LOG_INFO, "Error: Unsupported libc Syscall 0x%02X (%d)\n", s, s);
+4
View File
@@ -89,6 +89,8 @@ uint32_t my_set_thread_area(thread_area_t* td)
pthread_setspecific(my_context->segtls[idx-7].key, (void*)my_context->segtls[idx-7].base);
ResetSegmentsCache(thread_get_emu());
return 0;
}
@@ -120,6 +122,8 @@ uint32_t my_modify_ldt(x86emu_t* emu, int op, thread_area_t* td, int size)
my_context->segtls[idx].limit = td->limit;
pthread_setspecific(my_context->segtls[idx].key, (void*)my_context->segtls[idx].base);
*/
ResetSegmentsCache(thread_get_emu());
return 0;
}
+32 -16
View File
@@ -16,11 +16,21 @@
#include "x86trace.h"
#include "x86run.h"
#define F8 *(uint8_t*)(ip++)
#define F8S *(int8_t*)(ip++)
#define F16 *(uint16_t*)(ip+=2, ip-2)
#define F16S *(int16_t*)(ip+=2, ip-2)
#define F32 *(uint32_t*)(ip+=4, ip-4)
#define F32S *(int32_t*)(ip+=4, ip-4)
#define PK(a) *(uint8_t*)(ip+a)
#include "modrm.h"
void Run66D9(x86emu_t *emu)
{
uint8_t nextop;
reg32_t *op1;
nextop = Fetch8(emu);
uintptr_t ip = R_EIP;
uint8_t nextop = F8;
reg32_t *oped;
switch (nextop) {
case 0xC0:
case 0xC1:
@@ -66,31 +76,34 @@ void Run66D9(x86emu_t *emu)
case 0xFD:
case 0xFE:
case 0xFF:
ip = R_EIP-2;
UnimpOpcode(emu);
break;
default:
switch((nextop>>3)&7) {
case 4: /* FLDENV m */
// warning, incomplete
op1=GetEw(emu, nextop);
fpu_loadenv(emu, (char*)op1, 1);
GET_EW;
fpu_loadenv(emu, (char*)ED, 1);
break;
case 6: /* FNSTENV m */
// warning, incomplete
op1=GetEw(emu, nextop);
fpu_savenv(emu, (char*)op1, 1);
GET_EW;
fpu_savenv(emu, (char*)ED, 1);
break;
default:
ip = R_EIP-2;
UnimpOpcode(emu);
}
}
R_EIP = ip;
}
void Run66DD(x86emu_t *emu)
{
uint8_t nextop;
reg32_t *op1;
nextop = Fetch8(emu);
uintptr_t ip = R_EIP;
uint8_t nextop = F8;
reg32_t *oped;
switch(nextop) {
case 0xC0:
@@ -137,17 +150,18 @@ void Run66DD(x86emu_t *emu)
case 0xFD:
case 0xFE:
case 0xFF:
ip = R_EIP-2;
UnimpOpcode(emu);
break;
default:
switch((nextop>>3)&7) {
case 4: /* FRSTOR m94byte */
op1=GetEw(emu, nextop);
fpu_loadenv(emu, (char*)op1, 1);
GET_EW;
fpu_loadenv(emu, (char*)ED, 1);
// get the STx
{
char* p =(char*)op1;
char* p =(char*)ED;
p += 14;
for (int i=0; i<8; ++i) {
LD2D(p, &ST(i).d);
@@ -156,12 +170,12 @@ void Run66DD(x86emu_t *emu)
}
break;
case 6: /* FNSAVE m94byte */
op1=GetEw(emu, nextop);
GET_EW;
// ENV first...
fpu_savenv(emu, (char*)op1, 1);
fpu_savenv(emu, (char*)ED, 1);
// save the STx
{
char* p =(char*)op1;
char* p =(char*)ED;
p += 14;
for (int i=0; i<8; ++i) {
D2LD(&ST(i).d, p);
@@ -171,7 +185,9 @@ void Run66DD(x86emu_t *emu)
reset_fpu(emu);
break;
default:
ip = R_EIP-2; // unfetch
UnimpOpcode(emu);
}
}
R_EIP = ip;
}
+23 -26
View File
@@ -12,7 +12,6 @@ typedef struct lib_s lib_t;
typedef struct bridge_s bridge_t;
typedef struct dlprivate_s dlprivate_t;
typedef struct kh_symbolmap_s kh_symbolmap_t;
typedef struct callbacklist_s callbacklist_t;
typedef struct library_s library_t;
typedef struct kh_fts_s kh_fts_t;
typedef struct kh_threadstack_s kh_threadstack_t;
@@ -25,11 +24,10 @@ typedef struct atfork_fnc_s {
void* handle;
} atfork_fnc_t;
#ifdef DYNAREC
typedef struct dynablocklist_s dynablocklist_t;
typedef struct mmaplist_s mmaplist_t;
typedef struct dynmap_s {
dynablocklist_t* dynablocks; // the dynabockist of the block
} dynmap_t;
typedef struct dynablock_s dynablock_t;
typedef struct dynablocklist_s dynablocklist_t;
typedef struct mmaplist_s mmaplist_t;
typedef struct kh_dynablocks_s kh_dynablocks_t;
#define DYNAMAP_SIZE (1<<20)
#define DYNAMAP_SHIFT 12
#endif
@@ -63,6 +61,16 @@ typedef struct base_segment_s {
} base_segment_t;
typedef struct box86context_s {
#ifdef DYNAREC
dynablocklist_t** dynmap; // 4G of memory mapped by 4K block
int trace_dynarec;
pthread_mutex_t mutex_dyndump;
pthread_mutex_t mutex_blocks;
pthread_mutex_t mutex_mmap;
mmaplist_t *mmaplist;
int mmapsize;
kh_dynablocks_t *dblist_oversized; // store the list of oversized dynablocks (normal sized are inside mmaplist)
#endif
path_collection_t box86_path; // PATH env. variable
path_collection_t box86_ld_lib; // LD_LIBRARY_PATH env. variable
@@ -70,10 +78,9 @@ typedef struct box86context_s {
int x86trace;
int trace_tid;
#ifdef DYNAREC
int trace_dynarec;
pthread_mutex_t mutex_dyndump;
#endif
uint32_t sel_serial; // will be increment each time selectors changes
zydis_t *zydis; // dlopen the zydis dissasembler
void* box86lib; // dlopen on box86 itself
@@ -116,8 +123,6 @@ typedef struct box86context_s {
kh_symbolmap_t *vkmymap; // link to the mysymbolmap of libGL
vkprocaddess_t vkprocaddress;
callbacklist_t *callbacks; // all callbacks
pthread_mutex_t mutex_once;
pthread_mutex_t mutex_once2;
pthread_mutex_t mutex_trace;
@@ -171,14 +176,6 @@ typedef struct box86context_s {
cleanup_t *cleanups; // atexit functions
int clean_sz;
int clean_cap;
#ifdef DYNAREC
pthread_mutex_t mutex_blocks;
pthread_mutex_t mutex_mmap;
dynablocklist_t *dynablocks;
mmaplist_t *mmaplist;
int mmapsize;
dynmap_t* dynmap[DYNAMAP_SIZE]; // 4G of memory mapped by 4K block
#endif
#ifndef NOALIGN
kh_fts_t *ftsmap;
#endif
@@ -204,6 +201,8 @@ typedef struct box86context_s {
#endif
} box86context_t;
extern box86context_t *my_context; // global context
box86context_t *NewBox86Context(int argc);
void FreeBox86Context(box86context_t** context);
@@ -214,13 +213,11 @@ int AddElfHeader(box86context_t* ctx, elfheader_t* head);
int AddTLSPartition(box86context_t* context, int tlssize);
#ifdef DYNAREC
// the nolinker specified if static map or dynamic (can be deleted) has to be used
uintptr_t AllocDynarecMap(int size, int nolinker);
void FreeDynarecMap(uintptr_t addr, uint32_t size);
uintptr_t AllocDynarecMap(dynablock_t* db, int size);
void FreeDynarecMap(dynablock_t* db, uintptr_t addr, uint32_t size);
dynablocklist_t* getDBFromAddress(uintptr_t addr);
void addDBFromAddressRange(uintptr_t addr, uintptr_t size, int nolinker);
void cleanDBFromAddressRange(uintptr_t addr, uintptr_t size, int destroy);
void addDBFromAddressRange(box86context_t* context, uintptr_t addr, uintptr_t size, int nolinker);
void cleanDBFromAddressRange(box86context_t* context, uintptr_t addr, uintptr_t size, int destroy);
void protectDB(uintptr_t addr, uintptr_t size);
void unprotectDB(uintptr_t addr, uintptr_t size);
+3 -2
View File
@@ -4,14 +4,15 @@
typedef struct x86emu_s x86emu_t;
typedef struct bridge_s bridge_t;
typedef struct box86context_s box86context_t;
typedef void (*wrapper_t)(x86emu_t* emu, uintptr_t fnc);
bridge_t *NewBridge();
void FreeBridge(bridge_t** bridge);
uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N);
uintptr_t AddBridge(bridge_t* bridge, box86context_t* context, wrapper_t w, void* fnc, int N);
uintptr_t CheckBridged(bridge_t* bridge, void* fnc);
uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N);
uintptr_t AddCheckBridge(bridge_t* bridge, box86context_t* context, wrapper_t w, void* fnc, int N);
uintptr_t AddAutomaticBridge(x86emu_t* emu, bridge_t* bridge, wrapper_t w, void* fnc, int N);
void* GetNativeFnc(uintptr_t fnc);
void* GetNativeFncOrFnc(uintptr_t fnc);
-24
View File
@@ -3,36 +3,12 @@
#include <stdint.h>
typedef struct callbacklist_s callbacklist_t;
typedef struct x86emu_s x86emu_t;
callbacklist_t* NewCallbackList();
void FreeCallbackList(callbacklist_t** callbacks);
x86emu_t* AddCallback(x86emu_t* emu, uintptr_t fnc, int nb_args, void* arg1, void* arg2, void* arg3, void* arg4);
x86emu_t* AddVariableCallback(x86emu_t* emu, int stsize, uintptr_t fnc, int nb_args, void* arg1, void* arg2, void* arg3, void* arg4);
x86emu_t* AddSmallCallback(x86emu_t* emu, uintptr_t fnc, int nb_args, void* arg1, void* arg2, void* arg3, void* arg4);
x86emu_t* AddSharedCallback(x86emu_t* emu, uintptr_t fnc, int nb_args, void* arg1, void* arg2, void* arg3, void* arg4);
x86emu_t* GetCallback1Arg(x86emu_t* emu, uintptr_t fnc, int nb_args, void* arg1);
x86emu_t* FreeCallback(x86emu_t* emu);
uint32_t RunCallback(x86emu_t* emu);
void SetCallbackArg(x86emu_t* emu, int arg, void* val);
// set args starting from 0
void SetCallbackArgs(x86emu_t* emu, int nargs, ...);
// set args starting from N
void SetCallbackNArgs(x86emu_t* emu, int N, int nargs, ...);
void* GetCallbackArg(x86emu_t* emu, int arg);
void SetCallbackNArg(x86emu_t* emu, int narg);
void SetCallbackAddress(x86emu_t* emu, uintptr_t address);
uintptr_t GetCallbackAddress(x86emu_t* emu);
int IsCallback(box86context_t* context, x86emu_t* cb);
// use thread local emu to run the function (context is unused now)
uint32_t RunFunction(box86context_t *context, uintptr_t fnc, int nargs, ...);
// use thread local emu to run the function (context is unused now)
uint64_t RunFunction64(box86context_t *context, uintptr_t fnc, int nargs, ...);
// use emu state to run function
uint32_t RunFunctionWithEmu(x86emu_t *emu, int QuitOnLongJump, uintptr_t fnc, int nargs, ...);
// Find a cb using FNC address and argN as a key
x86emu_t* FindCallbackFnc1Arg(x86emu_t* emu, uintptr_t fnc, int argn, void* arg);
#endif //__CALLBACK_H__
+5 -3
View File
@@ -14,6 +14,7 @@ extern int box86_dynarec_trace;
extern int box86_dynarec_forced;
extern int box86_dynarec_largest;
extern int box86_dynarec_smc;
extern int box86_dynarec_safemmap;
#ifdef ARM
extern int arm_vfp; // vfp version (3 or 4), with 32 registers is mendatory
extern int arm_swap;
@@ -25,13 +26,14 @@ extern int trace_xmm; // include XMM reg in trace?
extern int trace_emm; // include EMM reg in trace?
extern int allow_missing_libs;
extern int box86_steam;
extern int box86_nopulse; // diabling the use of pulseaudio
extern int box86_nopulse; // diabling the use of wrapped pulseaudio
extern int box86_nogtk; // disabling the use of wrapped gtk
extern uintptr_t trace_start, trace_end;
extern box86context_t *my_context; // global context
extern char* trace_func;
extern uintptr_t fmod_smc_start, fmod_smc_end; // to handle libfmod (from Unreal) SMC (self modifying code)
extern uint32_t default_fs;
extern int jit_gdb; // launch gdb when a segfault is trapped
extern int box86_tcmalloc_minimal; // when using tcmalloc_minimal
#define LOG_NONE 0
#define LOG_INFO 1
#define LOG_DEBUG 2
@@ -41,7 +43,7 @@ extern FILE* ftrace;
#define printf_log(L, ...) do {if(L<=box86_log) {fprintf(ftrace, __VA_ARGS__); fflush(ftrace);}} while(0)
#define dynarec_log(L, ...) do {if(L<=box86_dynarec_log) {fprintf(ftrace, __VA_ARGS__); fflush(ftrace);}} while(0)
#define dynarec_log(L, ...) do {if(L<=box86_dynarec_log) {fprintf(ftrace, __VA_ARGS__); /*fflush(ftrace);*/}} while(0)
#define EXPORT __attribute__((visibility("default")))
#ifdef BUILD_DYNAMIC
+5 -11
View File
@@ -2,10 +2,9 @@
#define __DYNABLOCK_H_
typedef struct x86emu_s x86emu_t;
typedef struct dynablock_s dynablock_t;
typedef struct dynablocklist_s dynablocklist_t;
typedef struct kh_dynablocks_s kh_dynablocks_t;
uint32_t X31_hash_code(void* addr, int len);
dynablocklist_t* NewDynablockList(uintptr_t base, uintptr_t text, int textsz, int nolinker, int direct);
@@ -14,13 +13,13 @@ void FreeDynablock(dynablock_t* db);
void MarkDynablock(dynablock_t* db);
void MarkDynablockList(dynablocklist_t** dynablocks);
void ProtectDynablock(dynablock_t* db);
void ProtectkDynablockList(dynablocklist_t** dynablocks);
void ProtectDynablockList(dynablocklist_t** dynablocks);
void ProtectDirectDynablock(dynablocklist_t* dynablocks, uintptr_t addr, uintptr_t size);
void FreeRangeDynablock(dynablocklist_t* dynablocks, uintptr_t addr, uintptr_t size);
void MarkRangeDynablock(dynablocklist_t* dynablocks, uintptr_t addr, uintptr_t size);
// for debugging purpose
dynablock_t* FindDynablockFromNativeAddress(void* addr);
dynablock_t* FindDynablockFromNativeAddress(void* addr); // defined in box86context.h
dynablock_t* FindDynablockDynablocklist(void* addr, kh_dynablocks_t* dynablocks);
uintptr_t StartDynablockList(dynablocklist_t* db);
uintptr_t EndDynablockList(dynablocklist_t* db);
@@ -30,12 +29,7 @@ void MarkDirectDynablock(dynablocklist_t* dynablocks, uintptr_t addr, uintptr_t
dynablock_t* DBGetBlock(x86emu_t* emu, uintptr_t addr, int create, dynablock_t** current); // return NULL if block is not found / cannot be created. Don't create if create==0
dynablock_t* DBAlternateBlock(x86emu_t* emu, uintptr_t addr, uintptr_t filladdr);
// source is linked to dest (i.e. source->table[x] = dest->block), so add a "mark" in dest, add a "linked" info to source
void AddMark(dynablock_t* source, dynablock_t* dest, void** table);
// remove a Table mark (and also remove lined info from other dynablock, if any)
void RemoveMark(void** table);
// Create and Add an new dynablock in the list, handling direct/map
dynablock_t *AddNewDynablock(dynablocklist_t* dynablocks, uintptr_t addr, int with_marks, int* created);
dynablock_t *AddNewDynablock(dynablocklist_t* dynablocks, uintptr_t addr, int* created);
#endif //__DYNABLOCK_H_
+2
View File
@@ -53,5 +53,7 @@ dynablocklist_t* GetDynablocksFromElf(elfheader_t* h);
void ResetSpecialCaseMainElf(elfheader_t* h);
void CreateMemorymapFile(box86context_t* context, int fd);
int ElfCheckIfUseTCMallocMinimal(elfheader_t* h); // return 1 if tcmalloc is used
#endif //__ELF_LOADER_H_
+2 -2
View File
@@ -132,8 +132,8 @@ typedef struct {
} fpu_ld_t;
typedef struct {
uint64_t ll;
uint64_t ref;
int64_t ll;
int64_t ref;
} fpu_ll_t;
typedef union {
+4 -1
View File
@@ -15,6 +15,9 @@ void CleanStackSize(box86context_t* context);
emu_jmpbuf_t* GetJmpBuf();
void init_pthread_helper();
void fini_pthread_helper();
void fini_pthread_helper(box86context_t* context);
// prepare an "emuthread structure" in pet and return address of function pointer for a "thread creation routine"
void* my_prepare_thread(x86emu_t *emu, void* f, void* arg, int ssize, void** pet);
#endif //_THREADS_H_
+4
View File
@@ -6,4 +6,8 @@ void wine_prereserve(const char* reserve);
extern int wine_preloaded;
void* get_wine_prereserve();
#ifdef DYNAREC
void dynarec_wine_prereserve();
#endif
#endif //__WINE_TOOLS_H__
+4
View File
@@ -29,9 +29,13 @@ void SetFS(x86emu_t *emu, uint16_t v);
uint16_t GetFS(x86emu_t *emu);
uint32_t GetESP(x86emu_t *emu);
void ResetFlags(x86emu_t *emu);
void ResetSegmentsCache(x86emu_t *emu);
const char* DumpCPURegs(x86emu_t* emu, uintptr_t ip);
void StopEmu(x86emu_t* emu, const char* reason);
#ifdef DYNAREC
void DynablockEmuMarker(box86context_t* context);
#endif
void PushExit(x86emu_t* emu);
void* GetExit();
void EmuCall(x86emu_t* emu, uintptr_t addr);
+15 -13
View File
@@ -39,10 +39,13 @@ void FreeLibrarian(lib_t **maplib)
if(!maplib || !*maplib)
return;
if((*maplib)->ownlibs)
if((*maplib)->ownlibs) {
printf_log(LOG_DEBUG, "Closing %d libs from maplib %p\n", (*maplib)->libsz, *maplib);
for (int i=0; i<(*maplib)->libsz; ++i) {
printf_log(LOG_DEBUG, "Unloading %s\n", (*maplib)->libraries[i].lib->name);
Free1Library(&(*maplib)->libraries[i].lib);
}
}
free((*maplib)->libraries);
(*maplib)->libraries = NULL;
@@ -386,21 +389,18 @@ elfheader_t* GetGlobalSymbolElf(lib_t *maplib, const char* name)
uintptr_t start = 0;
uintptr_t end = 0;
if(GetSymbolStartEnd(maplib->mapsymbols, name, &start, &end))
if(start)
return maplib->context->elfs[0];
return maplib->context->elfs[0];
if(GetSymbolStartEnd(maplib->weaksymbols, name, &start, &end))
if(start)
return maplib->context->elfs[0];
return maplib->context->elfs[0];
for(int i=0; i<maplib->libsz; ++i) {
if(GetLibSymbolStartEnd(maplib->libraries[i].lib, name, &start, &end))
if(start) {
int idx = GetElfIndex(maplib->libraries[i].lib);
if(idx==-1) {
printf_log(LOG_NONE, "Warning, getting Elf info for a native symbol \"%s\" from lib \"%s\"\n", name, GetNameLib(maplib->libraries[i].lib));
return NULL;
}
return maplib->context->elfs[idx];
if(GetLibSymbolStartEnd(maplib->libraries[i].lib, name, &start, &end)) {
int idx = GetElfIndex(maplib->libraries[i].lib);
if(idx==-1) {
printf_log(LOG_NONE, "Warning, getting Elf info for a native symbol \"%s\" from lib \"%s\"\n", name, GetNameLib(maplib->libraries[i].lib));
return NULL;
}
return maplib->context->elfs[idx];
}
}
// nope, not found
return NULL;
@@ -557,6 +557,8 @@ void AddOffsetSymbol(lib_t *maplib, void* offs, const char* name)
const char* GetNameOffset(lib_t *maplib, void* offs)
{
if(!maplib || !maplib->mapoffsets)
return NULL;
khint_t k = kh_get(mapoffsets, maplib->mapoffsets, (uintptr_t)offs);
if (k!=kh_end(maplib->mapoffsets))
return kh_value(maplib->mapoffsets, k);
+10 -10
View File
@@ -93,14 +93,14 @@ int EmuLib_Get(library_t* lib, const char* name, uintptr_t *offs, uint32_t *sz)
if(k!=kh_end(lib->priv.n.mapsymbols)) {
*offs = kh_value(lib->priv.n.mapsymbols, k).offs;
*sz = kh_value(lib->priv.n.mapsymbols, k).sz;
return *offs;
return 1;
}
// weak symbols...
k = kh_get(mapsymbols, lib->priv.n.weaksymbols, name);
if(k!=kh_end(lib->priv.n.weaksymbols)) {
*offs = kh_value(lib->priv.n.weaksymbols, k).offs;
*sz = kh_value(lib->priv.n.weaksymbols, k).sz;
return *offs;
return 1;
}
return 0;
}
@@ -111,7 +111,7 @@ int EmuLib_GetNoWeak(library_t* lib, const char* name, uintptr_t *offs, uint32_t
if(k!=kh_end(lib->priv.n.mapsymbols)) {
*offs = kh_value(lib->priv.n.mapsymbols, k).offs;
*sz = kh_value(lib->priv.n.mapsymbols, k).sz;
return *offs;
return 1;
}
return 0;
}
@@ -122,7 +122,7 @@ int EmuLib_GetLocal(library_t* lib, const char* name, uintptr_t *offs, uint32_t
if(k!=kh_end(lib->priv.n.localsymbols)) {
*offs = kh_value(lib->priv.n.localsymbols, k).offs;
*sz = kh_value(lib->priv.n.localsymbols, k).sz;
return *offs;
return 1;
}
return 0;
}
@@ -201,7 +201,6 @@ static int loadEmulatedLib(const char* libname, library_t *lib, box86context_t*
ElfAttachLib(elf_header, lib);
lib->type = 1;
lib->context = context;
lib->fini = EmuLib_Fini;
lib->get = EmuLib_Get;
lib->getnoweak = EmuLib_GetNoWeak;
@@ -242,6 +241,7 @@ library_t *NewLibrary(const char* path, box86context_t* context)
lib->path = strdup(path);
lib->name = Path2Name(path);
lib->nbdot = NbDot(lib->name);
lib->context = context;
lib->type = -1;
printf_log(LOG_DEBUG, "Simplified name is \"%s\"\n", lib->name);
if(box86_nopulse) {
@@ -581,7 +581,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
printf_log(LOG_NONE, "Warning, function %s not found\n", buff);
} else
AddOffsetSymbol(lib->context->maplib, symbol, name);
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->mysymbolmap, k), symbol, 0);
*addr = AddBridge(lib->priv.w.bridge, lib->context, kh_value(lib->mysymbolmap, k), symbol, 0);
*size = sizeof(void*);
return 1;
}
@@ -599,7 +599,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
printf_log(LOG_NONE, "Warning, function %s not found\n", buff);
} else
AddOffsetSymbol(lib->context->maplib, symbol, name);
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->stsymbolmap, k), symbol, 4); // all of this for this little "4"
*addr = AddBridge(lib->priv.w.bridge, lib->context, kh_value(lib->stsymbolmap, k), symbol, 4); // all of this for this little "4"
*size = sizeof(void*);
return 1;
}
@@ -618,7 +618,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
return 0;
} else
AddOffsetSymbol(lib->context->maplib, symbol, name);
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->symbolmap, k), symbol, 0);
*addr = AddBridge(lib->priv.w.bridge, lib->context, kh_value(lib->symbolmap, k), symbol, 0);
*size = sizeof(void*);
return 1;
}
@@ -637,7 +637,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
return 0;
} else
AddOffsetSymbol(lib->context->maplib, symbol, name);
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->wsymbolmap, k), symbol, 0);
*addr = AddBridge(lib->priv.w.bridge, lib->context, kh_value(lib->wsymbolmap, k), symbol, 0);
*size = sizeof(void*);
return 1;
}
@@ -655,7 +655,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
return 0;
} else
AddOffsetSymbol(lib->context->maplib, symbol, name);
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->symbol2map, k).w, symbol, 0);
*addr = AddBridge(lib->priv.w.bridge, lib->context, kh_value(lib->symbol2map, k).w, symbol, 0);
*size = sizeof(void*);
return 1;
}
+8
View File
@@ -18,6 +18,7 @@ GO("libSDL2.so", sdl2)
GO("libsdl2-2.0.so.0", sdl2)
GO("libSDL2_mixer-2.0.so.0", sdl2mixer)
GO("libSDL2_image-2.0.so.0", sdl2image)
GO("libSDL2_ttf-2.0.so.0", sdl2ttf)
GO("libSDL-1.2.so.0", sdl1)
GO("libSDL-1.1.so.0", sdl1)
GO("libSDL_mixer-1.2.so.0", sdl1mixer)
@@ -67,6 +68,7 @@ GO("openal.so", openal)
GO("libalut.so.0", alut)
GO("libjpeg.so.8", libjpeg)
GO("libjpeg.so.62", libjpeg62)
GO("libturbojpeg.so.0", turbojpeg)
GO("libcurl.so.4", curl)
GO("libcurl-gnutls.so.4", curl)
GO("libudev.so.0", udev0)
@@ -128,5 +130,11 @@ GO("d3dadapter9.so.1", d3dadapter9)
GO("libvulkan.so.1", vulkan)
GO("libvulkan.so", vulkan)
GO("libwayland-client.so.0", waylandclient)
GO("libxml2.so.2", xml2)
GO("libxslt.so.1", xslt)
GO("libldap_r-2.4.so.2", ldapr)
GO("liblber-2.4.so.2", lber)
GO("libnsl.so.1", nsl)
GO("liblcms2.so.2", lcms2)
GO("ld-linux.so.2", ldlinux)
+3 -3
View File
@@ -70,7 +70,7 @@ static void* reverse_chunkfunFct(library_t* lib, void* fct)
#define GO(A) if(my_chunkfun_##A == fct) return (void*)my_chunkfun_fct_##A;
SUPER()
#undef GO
return (void*)AddBridge(lib->priv.w.bridge, pFL, fct, 0);
return (void*)AddBridge(lib->priv.w.bridge, lib->context, pFL, fct, 0);
}
// freefun
#define GO(A) \
@@ -103,7 +103,7 @@ static void* reverse_freefunFct(library_t* lib, void* fct)
#define GO(A) if(my_freefun_##A == fct) return (void*)my_freefun_fct_##A;
SUPER()
#undef GO
return (void*)AddBridge(lib->priv.w.bridge, vFp, fct, 0);
return (void*)AddBridge(lib->priv.w.bridge, lib->context, vFp, fct, 0);
}
#undef SUPER
@@ -217,7 +217,7 @@ void obstackSetup()
// save the real function
real_obstack_alloc_failed_handler = obstack_alloc_failed_handler;
// bridge the real function for x86 world
my_obstack_alloc_failed_handler = (void*)AddCheckBridge(my_context->system, vFv, real_obstack_alloc_failed_handler, 0);
my_obstack_alloc_failed_handler = (void*)AddCheckBridge(my_context->system, my_context, vFv, real_obstack_alloc_failed_handler, 0);
ref_obstack_alloc_failed_handler = my_obstack_alloc_failed_handler;
// setup our version of the function
obstack_alloc_failed_handler = actual_obstack_alloc_failed_handler;
+1 -2
View File
@@ -107,8 +107,7 @@ SDL1_RWops_t* AddNativeRW(x86emu_t* emu, SDL1_RWops_t* ops)
// get or create wrapper, add it to map and change to the emulated one if rw
#define GO(A, W) \
fnc = CheckBridged(system, my_native_##A); \
if(!fnc) fnc = AddBridge(system, W, my_native_##A, 0); \
fnc = AddCheckBridge(system, my_context, W, my_native_##A, 0); \
newrw->A = (sdl1_##A)fnc;
GO(seek, iFpii)
+10 -45
View File
@@ -49,7 +49,6 @@ typedef struct SDL2_RWops_s {
struct {
SDL2_RWops_t *orig;
sdl2_freerw custom_free;
x86emu_t *emu;
} my;
} hidden;
} SDL2_RWops_t;
@@ -78,58 +77,27 @@ EXPORT int32_t my2_native_close(SDL2_RWops_t *context)
}
EXPORT int64_t my2_emulated_size(SDL2_RWops_t *context)
{
x86emu_t *emu = context->hidden.my.emu;
SetCallbackNArg(emu, 1);
SetCallbackArg(emu, 0, context->hidden.my.orig);
SetCallbackAddress(emu, (uintptr_t)context->hidden.my.orig->size);
RunCallback(emu);
return (int64_t)GetEDXEAX(emu);
return (int64_t)RunFunction64(my_context, (uintptr_t)context->hidden.my.orig->size, 1, context->hidden.my.orig);
}
EXPORT int64_t my2_emulated_seek(SDL2_RWops_t *context, int64_t offset, int32_t whence)
{
x86emu_t *emu = context->hidden.my.emu;
SetCallbackNArg(emu, 4);
SetCallbackArg(emu, 0, context->hidden.my.orig);
SetCallbackArg(emu, 1, (void*)(uintptr_t)(offset&0xffffffff));
SetCallbackArg(emu, 2, (void*)(uintptr_t)((offset>>32)&0xffffffff));
SetCallbackArg(emu, 3, (void*)whence);
SetCallbackAddress(emu, (uintptr_t)context->hidden.my.orig->seek);
RunCallback(emu);
return (int64_t)GetEDXEAX(emu);
return (int64_t)RunFunction64(my_context,
(uintptr_t)context->hidden.my.orig->seek, 4, context->hidden.my.orig,
(void*)(uintptr_t)(offset&0xffffffff),
(void*)(uintptr_t)((offset>>32)&0xffffffff),
whence);
}
EXPORT int32_t my2_emulated_read(SDL2_RWops_t *context, void *ptr, int32_t size, int32_t maxnum)
{
x86emu_t *emu = context->hidden.my.emu;
SetCallbackNArg(emu, 4);
SetCallbackArg(emu, 0, context->hidden.my.orig);
SetCallbackArg(emu, 1, ptr);
SetCallbackArg(emu, 2, (void*)size);
SetCallbackArg(emu, 3, (void*)maxnum);
SetCallbackAddress(emu, (uintptr_t)context->hidden.my.orig->read);
RunCallback(emu);
return (int32_t)GetEAX(emu);
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->read, 4, context->hidden.my.orig, ptr, size, maxnum);
}
EXPORT int32_t my2_emulated_write(SDL2_RWops_t *context, const void *ptr, int32_t size, int32_t num)
{
x86emu_t *emu = context->hidden.my.emu;
SetCallbackNArg(emu, 4);
SetCallbackArg(emu, 0, context->hidden.my.orig);
SetCallbackArg(emu, 1, (void*)ptr);
SetCallbackArg(emu, 2, (void*)size);
SetCallbackArg(emu, 3, (void*)num);
SetCallbackAddress(emu, (uintptr_t)context->hidden.my.orig->write);
RunCallback(emu);
return (int32_t)GetEAX(emu);
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->write, 4, context->hidden.my.orig, ptr, size, num);
}
EXPORT int32_t my2_emulated_close(SDL2_RWops_t *context)
{
x86emu_t *emu = context->hidden.my.emu;
SetCallbackNArg(emu, 1);
SetCallbackArg(emu, 0, context->hidden.my.orig);
SetCallbackAddress(emu, (uintptr_t)context->hidden.my.orig->close);
int32_t ret = RunCallback(emu);
FreeCallback(emu);
return ret;
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->close, 1, context->hidden.my.orig);
}
SDL2_RWops_t* AddNativeRW2(x86emu_t* emu, SDL2_RWops_t* ops)
@@ -149,8 +117,7 @@ SDL2_RWops_t* AddNativeRW2(x86emu_t* emu, SDL2_RWops_t* ops)
// get or create wrapper, add it to map and change to the emulated one if rw
#define GO(A, W) \
fnc = CheckBridged(system, my2_native_##A); \
if(!fnc) fnc = AddBridge(system, W, my2_native_##A, 0); \
fnc = AddCheckBridge(system, my_context, W, my2_native_##A, 0); \
newrw->A = (sdl2_##A)fnc;
GO(size, IFp)
@@ -178,7 +145,6 @@ SDL2_RWops_t* RWNativeStart2(x86emu_t* emu, SDL2_RWops_t* ops)
SDL2_RWops_t* newrw = Alloc();
newrw->type = BOX86RW;
newrw->hidden.my.orig = ops;
newrw->hidden.my.emu = AddSmallCallback(emu, 0, 0, NULL, NULL, NULL, NULL);
// create wrapper
#define GO(A, W) \
@@ -203,7 +169,6 @@ void RWNativeEnd2(SDL2_RWops_t* ops)
if(ops->type != BOX86RW)
return; // do nothing
FreeCallback(ops->hidden.my.emu);
ops->hidden.my.custom_free(ops);
}
+18 -5
View File
@@ -273,7 +273,7 @@ uint32_t RunFunctionHandler(int* exit, uintptr_t fnc, int nargs, ...)
/*SetFS(emu, default_fs);*/
for (int i=0; i<6; ++i)
emu->segs_clean[i] = 0;
emu->segs_serial[i] = 0;
R_ESP -= nargs*4; // need to push in reverse order
@@ -403,6 +403,7 @@ void my_sigactionhandler_oldpc(int32_t sig, siginfo_t* info, void * ucntx, void*
// need to create some x86_ucontext????
pthread_mutex_unlock(&my_context->mutex_trace); // just in case
printf_log(LOG_DEBUG, "Sigactionhanlder for signal #%d called (jump to %p/%s)\n", sig, (void*)my_context->signals[sig], GetNativeName((void*)my_context->signals[sig]));
uintptr_t restorer = my_context->restorer[sig];
// get that actual ESP first!
x86emu_t *emu = thread_get_emu();
@@ -545,7 +546,7 @@ void my_sigactionhandler_oldpc(int32_t sig, siginfo_t* info, void * ucntx, void*
// flags
if(sigcontext->uc_mcontext.gregs[REG_EFL]!=sigcontext_copy.uc_mcontext.gregs[REG_EFL]) ejb->emu->packed_eflags.x32=sigcontext->uc_mcontext.gregs[REG_EFL];
// get segments
#define GO(S) if(sigcontext->uc_mcontext.gregs[REG_##S]!=sigcontext_copy.uc_mcontext.gregs[REG_##S]) {ejb->emu->segs[_##S]=sigcontext->uc_mcontext.gregs[REG_##S]; ejb->emu->segs_clean[_##S] = 0;}
#define GO(S) if(sigcontext->uc_mcontext.gregs[REG_##S]!=sigcontext_copy.uc_mcontext.gregs[REG_##S]) {ejb->emu->segs[_##S]=sigcontext->uc_mcontext.gregs[REG_##S]; ejb->emu->segs_serial[_##S] = 0;}
GO(GS);
GO(FS);
GO(ES);
@@ -570,6 +571,15 @@ void my_sigactionhandler_oldpc(int32_t sig, siginfo_t* info, void * ucntx, void*
if(used_stack) // release stack
new_ss->ss_flags = 0;
}
#ifdef DYNAREC
static int hasDBFromAddress(uintptr_t addr)
{
int idx = (addr>>DYNAMAP_SHIFT);
return my_context->dynmap[idx]?1:0;
}
#endif
void my_box86signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
{
// sig==SIGSEGV || sig==SIGBUS || sig==SIGILL here!
@@ -585,7 +595,7 @@ void my_box86signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
#warning Unhandled architecture
#endif
#ifdef DYNAREC
if(sig==SIGSEGV && addr && info->si_code == SEGV_ACCERR && getDBFromAddress((uintptr_t)addr)) {
if(sig==SIGSEGV && addr && info->si_code == SEGV_ACCERR && hasDBFromAddress((uintptr_t)addr)) {
if(box86_dynarec_smc) {
dynablock_t* db_pc = NULL;
dynablock_t* db_addr = NULL;
@@ -597,6 +607,9 @@ void my_box86signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
dynarec_log(LOG_NONE, "Warning: Access to protected %p from %p, inside same dynablock\n", addr, pc);
}
}
if(db_addr && !db_addr->nolinker) {
dynarec_log(LOG_NONE, "Warning: Access to protected %p from %p, inside a dynablock with linker\n", addr, pc);
}
}
dynarec_log(LOG_DEBUG, "Access to protected %p from %p, unprotecting memory\n", addr, pc);
// access error
@@ -608,7 +621,6 @@ void my_box86signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
static int old_code = -1;
static void* old_pc = 0;
static void* old_addr = 0;
static int old_tid = 0;
const char* signame = (sig==SIGSEGV)?"SIGSEGV":((sig==SIGBUS)?"SIGBUS":"SIGILL");
if(old_code==info->si_code && old_pc==pc && old_addr==addr) {
printf_log(LOG_NONE, "%04d|Double %s!\n", GetTID(), signame);
@@ -984,8 +996,9 @@ EXPORT int my_swapcontext(x86emu_t* emu, void* ucp1, void* ucp2)
void init_signal_helper(box86context_t* context)
{
// setup signal handling
for(int i=0; i<MAX_SIGNAL; ++i)
for(int i=0; i<MAX_SIGNAL; ++i) {
context->signals[i] = 1; // SIG_DFL
}
struct sigaction action;
action.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER;
action.sa_sigaction = my_box86signalhandler;
+41 -11
View File
@@ -133,15 +133,17 @@ static void FreeCancelThread(box86context_t* context)
kh_foreach_value(context->cancelthread, buff, free(buff))
kh_destroy(cancelthread, context->cancelthread);
pthread_mutex_unlock(&context->mutex_thread);
my_context->cancelthread = NULL;
context->cancelthread = NULL;
}
static __pthread_unwind_buf_t* AddCancelThread(uintptr_t buff)
{
int ret;
pthread_mutex_lock(&my_context->mutex_thread);
khint_t k = kh_put(cancelthread, my_context->cancelthread, buff, &ret);
if(ret)
kh_value(my_context->cancelthread, k) = (__pthread_unwind_buf_t*)calloc(1, sizeof(__pthread_unwind_buf_t));
__pthread_unwind_buf_t* r = kh_value(my_context->cancelthread, k);
pthread_mutex_unlock(&my_context->mutex_thread);
return r;
}
@@ -212,6 +214,15 @@ static void* pthread_routine(void* p)
{
// create the key
pthread_once(&thread_key_once, thread_key_alloc);
// free current emuthread if it exist
{
void* t = pthread_getspecific(thread_key);
if(t) {
// not sure how this could happens
printf_log(LOG_INFO, "Clean of an existing ET for Thread %04d\n", GetTID());
emuthread_destroy(t);
}
}
pthread_setspecific(thread_key, p);
// call the function
emuthread_t *et = (emuthread_t*)p;
@@ -295,6 +306,26 @@ EXPORT int my_pthread_create(x86emu_t *emu, void* t, void* attr, void* start_rou
pthread_routine, et);
}
void* my_prepare_thread(x86emu_t *emu, void* f, void* arg, int ssize, void** pet)
{
int stacksize = (ssize)?ssize:(2*1024*1024); //default stack size is 2Mo
void* stack = malloc(stacksize);
emuthread_t *et = (emuthread_t*)calloc(1, sizeof(emuthread_t));
x86emu_t *emuthread = NewX86Emu(emu->context, (uintptr_t)f, (uintptr_t)stack, stacksize, 1);
SetupX86Emu(emuthread);
SetFS(emuthread, GetFS(emu));
et->emu = emuthread;
et->fnc = (uintptr_t)f;
et->arg = arg;
#ifdef DYNAREC
// pre-creation of the JIT code for the entry point of the thread
dynablock_t *current = NULL;
DBGetBlock(emu, (uintptr_t)f, 1, &current);
#endif
*pet = et;
return pthread_routine;
}
void my_longjmp(x86emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val);
#define CANCEL_MAX 8
@@ -305,13 +336,13 @@ EXPORT void my___pthread_register_cancel(void* E, void* B)
{
// get a stack local copy of the args, as may be live in some register depending the architecture (like ARM)
if(cancel_deep<0) {
printf_log(LOG_INFO, "BOX86: Warning, inconsistant value in __pthread_register_cancel (%d)\n", cancel_deep);
printf_log(LOG_NONE/*LOG_INFO*/, "BOX86: Warning, inconsistant value in __pthread_register_cancel (%d)\n", cancel_deep);
cancel_deep = 0;
}
if(cancel_deep!=CANCEL_MAX-1)
++cancel_deep;
else
{printf_log(LOG_INFO, "BOX86: Warning, calling __pthread_register_cancel(...) too many time\n");}
{printf_log(LOG_NONE/*LOG_INFO*/, "BOX86: Warning, calling __pthread_register_cancel(...) too many time\n");}
cancel_emu[cancel_deep] = (x86emu_t*)E;
// on i386, the function as __cleanup_fct_attribute attribute: so 1st parameter is in register
@@ -344,12 +375,11 @@ EXPORT void my___pthread_unwind_next(x86emu_t* emu, void* p)
{
// on i386, the function as __cleanup_fct_attribute attribute: so 1st parameter is in register
x86_unwind_buff_t* buff = (x86_unwind_buff_t*)R_EAX;
__pthread_unwind_buf_t *pbuff = AddCancelThread((uintptr_t)buff);
// function is noreturn, so putting stuff on the stack is not a good idea
__pthread_unwind_next(pbuff);
// just in case it does return
// no clear way to clean up this, unless it does return...
__pthread_unwind_buf_t pbuff = *AddCancelThread((uintptr_t)buff);
DelCancelThread((uintptr_t)buff);
// function is noreturn, putting stuff on the stack to have it auto-free (is that correct?)
__pthread_unwind_next(&pbuff);
// just in case it does return
emu->quit = 1;
}
@@ -675,10 +705,10 @@ void init_pthread_helper()
pthread_key_create(&jmpbuf_key, emujmpbuf_destroy);
}
void fini_pthread_helper()
void fini_pthread_helper(box86context_t* context)
{
FreeCancelThread(my_context);
CleanStackSize(my_context);
FreeCancelThread(context);
CleanStackSize(context);
pthread_cond_t *cond;
kh_foreach_value(mapcond, cond,
pthread_cond_destroy(cond);
+160 -14
View File
@@ -17,6 +17,9 @@
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include <dirent.h>
#include <signal.h>
#include <sys/syscall.h>
#ifdef DYNAREC
#ifdef ARM
#include <linux/auxvec.h>
@@ -50,6 +53,7 @@ int box86_dynarec_linker = 1;
int box86_dynarec_forced = 0;
int box86_dynarec_largest = 0;
int box86_dynarec_smc = 0;
int box86_dynarec_safemmap = 0;
#ifdef ARM
int arm_vfp = 0; // vfp version (3 or 4), with 32 registers is mendatory
int arm_swap = 0;
@@ -70,12 +74,17 @@ int box86_dynarec_trace = 0;
#ifdef PANDORA
int x11color16 = 0;
#endif
#ifdef RPI
int box86_tokitori2 = 0;
#endif
int box86_zoom = 0;
int x11threads = 0;
int x11glx = 1;
int allow_missing_libs = 0;
int fix_64bit_inodes = 0;
int box86_steam = 0;
int box86_nopulse = 0;
int box86_nogtk = 0;
char* libGL = NULL;
uintptr_t trace_start = 0, trace_end = 0;
char* trace_func = NULL;
@@ -83,6 +92,7 @@ uintptr_t fmod_smc_start = 0;
uintptr_t fmod_smc_end = 0;
uint32_t default_fs = 0;
int jit_gdb = 0;
int box86_tcmalloc_minimal = 0;
FILE* ftrace = NULL;
int ftrace_has_pid = 0;
@@ -110,7 +120,8 @@ void openFTrace()
ftrace = stdout;
printf_log(LOG_INFO, "Cannot open trace file \"%s\" for writing (error=%s)\n", p, strerror(errno));
} else {
printf("BOX86 Trace redirected to \"%s\"\n", p);
if(!box86_nobanner)
printf("BOX86 Trace redirected to \"%s\"\n", p);
}
}
}
@@ -186,7 +197,14 @@ EXPORTDYN
void LoadLogEnv()
{
ftrace = stdout;
const char *p = getenv("BOX86_LOG");
const char *p = getenv("BOX86_NOBANNER");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0' && p[1]<='1')
box86_nobanner = p[0]-'0';
}
}
p = getenv("BOX86_LOG");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0'+LOG_NONE && p[1]<='0'+LOG_DEBUG)
@@ -201,15 +219,8 @@ void LoadLogEnv()
else if(!strcasecmp(p, "DUMP"))
box86_log = LOG_DUMP;
}
printf_log(LOG_INFO, "Debug level is %d\n", box86_log);
}
p = getenv("BOX86_NOBANNER");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0' && p[1]<='1')
box86_nobanner = p[0]-'0';
}
printf_log(LOG_INFO, "Dynarec is %s\n", box86_nobanner?"On":"Off");
if(!box86_nobanner)
printf_log(LOG_INFO, "Debug level is %d\n", box86_log);
}
#ifdef DYNAREC
p = getenv("BOX86_DYNAREC_DUMP");
@@ -271,6 +282,14 @@ void LoadLogEnv()
if(box86_dynarec_smc)
printf_log(LOG_INFO, "Dynarec is trying to detect SMC in same dynablock\n");
}
p = getenv("BOX86_DYNAREC_SAFEMMAP");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0' && p[1]<='1')
box86_dynarec_safemmap = p[0]-'0';
}
printf_log(LOG_INFO, "Dynarec Safe mmap is %s\n", box86_dynarec_safemmap?"On":"Off");
}
#endif
#ifdef HAVE_TRACE
p = getenv("BOX86_TRACE_XMM");
@@ -374,6 +393,15 @@ void LoadLogEnv()
if(box86_nopulse)
printf_log(LOG_INFO, "Disable the use of pulseaudio libs\n");
}
p = getenv("BOX86_NOGTK");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0' && p[1]<='0'+1)
box86_nogtk = p[0]-'0';
}
if(box86_nogtk)
printf_log(LOG_INFO, "Disable the use of wraped gtk libs\n");
}
p = getenv("BOX86_FIX_64BIT_INODES");
if(p) {
if(strlen(p)==1) {
@@ -524,6 +552,7 @@ void PrintHelp() {
printf(" BOX86_LD_PRELOAD=XXXX[:YYYYY] force loading XXXX (and YYYY...) libraries with the binary\n");
printf(" BOX86_ALLOWMISSINGLIBS with 1 to allow to continue even if a lib is missing (unadvised, will probably crash later)\n");
printf(" BOX86_NOPULSE=1 to disable the loading of pulseaudio libs\n");
printf(" BOX86_NOGTK=1 to disable the loading of wrapped gtk libs\n");
printf(" BOX86_JITGDB with 1 to launch \"gdb\" when a segfault is trapped, attached to the offending process\n");
}
@@ -680,10 +709,47 @@ void endBox86()
printf_log(LOG_DEBUG, "Calling atexit registered functions\n");
CallAllCleanup(emu);
// than call all the Fini (some "smart" ordering of the fini may be needed, but for now, callign in this order should be good enough)
printf_log(LOG_DEBUG, "Calling fini for all loaded elfs\n");
for (int i=0; i<my_context->elfsize; ++i)
RunElfFini(my_context->elfs[i], emu);
printf_log(LOG_DEBUG, "Calling fini for all loaded elfs and unload native libs\n");
RunElfFini(my_context->elfs[0], emu);
FreeLibrarian(&my_context->maplib); // unload all libs
FreeLibrarian(&my_context->local_maplib); // unload all libs
// waiting for all thread except this one to finish
int this_thread = GetTID();
int pid = getpid();
int running = 1;
int attempt = 0;
printf_log(LOG_DEBUG, "Waiting for all threads to finish before unloading box86context\n");
while(running) {
DIR *proc_dir;
char dirname[100];
snprintf(dirname, sizeof dirname, "/proc/self/task");
proc_dir = opendir(dirname);
running = 0;
if (proc_dir)
{
struct dirent *entry;
while ((entry = readdir(proc_dir)) != NULL && !running)
{
if(entry->d_name[0] == '.')
continue;
int tid = atoi(entry->d_name);
// tid != pthread_t, so no pthread functions are available here
if(tid!=this_thread) {
if(attempt>4000) {
printf_log(LOG_INFO, "Stop waiting for remaining thread %04d\n", tid);
// enough wait, kill all thread!
syscall(__NR_tgkill, pid, tid, SIGABRT);
} else {
running = 1;
++attempt;
sched_yield();
}
}
}
closedir(proc_dir);
}
}
// all done, free context
FreeBox86Context(&my_context);
if(libGL) {
@@ -834,6 +900,8 @@ int main(int argc, const char **argv, const char **env) {
} else {
if(getenv("LD_PRELOAD")) {
char* p = getenv("LD_PRELOAD");
if(strstr(p, "libtcmalloc_minimal.so.4"))
box86_tcmalloc_minimal = 1;
ParseList(p, &ld_preload, 0);
if (ld_preload.size && box86_log) {
printf_log(LOG_INFO, "BOX86 try to Preload ");
@@ -881,6 +949,25 @@ int main(int argc, const char **argv, const char **env) {
free(my_context->argv[0]);
my_context->argv[0] = strdup("./UnrealLinux.bin");
}
#ifdef RPI
// special case for TokiTori 2+, that check if texture max size is > = 8192
if(strstr(prgname, "TokiTori2.bin.x86")==prgname) {
printf_log(LOG_INFO, "TokiTori 2+ detected, runtime patch to fix GPU non-power-of-two faillure\n");
box86_tokitori2 = 1;
}
#endif
// special case for zoom
if(strstr(prgname, "zoom")==prgname) {
printf_log(LOG_INFO, "Zoom detected, trying to use system libturbojpeg if possible\n");
box86_zoom = 1;
}
/*if(strstr(prgname, "awesomium_process")==prgname) {
printf_log(LOG_INFO, "awesomium_process detected, forcing emulated libpng12\n");
AddPath("libpng12.so.0", &my_context->box86_emulated_libs, 0);
}*/
/*if(!strcmp(prgname, "gdb")) {
exit(-1);
}*/
for(int i=1; i<my_context->argc; ++i) {
my_context->argv[i] = strdup(argv[i+nextarg]);
@@ -951,6 +1038,52 @@ int main(int argc, const char **argv, const char **env) {
}
// can close the file now
fclose(f);
if(ElfCheckIfUseTCMallocMinimal(elf_header)) {
if(!box86_tcmalloc_minimal) {
// need to reload with tcmalloc_minimal as a LD_PRELOAD!
printf_log(LOG_INFO, "BOX86: tcmalloc_minimal.so.4 used, reloading box86 with the lib preladed\n");
// need to get a new envv variable. so first count it and check if LD_PRELOAD is there
int preload=(getenv("LD_PRELOAD"))?1:0;
int nenv = 0;
while(env[nenv]) nenv++;
// alloc + "LD_PRELOAD" if needd + last NULL ending
char** newenv = (char**)calloc(nenv+1+((preload)?0:1), sizeof(char*));
// copy strings
for (int i=0; i<nenv; ++i)
newenv[i] = strdup(env[i]);
// add ld_preload
if(preload) {
// find the line
int l = 0;
while(l<nenv) {
if(strstr(newenv[l], "LD_PRELOAD=")==newenv[l]) {
// found it!
char *old = newenv[l];
newenv[l] = (char*)calloc(strlen(old)+strlen("libtcmalloc_minimal.so.4:")+1, sizeof(char));
strcpy(newenv[l], "LD_PRELOAD=libtcmalloc_minimal.so.4:");
strcat(newenv[l], old + strlen("LD_PRELOAD="));
free(old);
// done, end loop
l = nenv;
} else ++l;
}
} else {
//move last one
newenv[nenv] = strdup(newenv[nenv-1]);
free(newenv[nenv-1]);
newenv[nenv-1] = strdup("LD_PRELOAD=libtcmalloc_minimal.so.4");
}
// duplicate argv too
char** newargv = calloc(argc+1, sizeof(char*));
int narg = 0;
while(argv[narg]) {newargv[narg] = strdup(argv[narg]); narg++;}
// launch with new env...
if(execve(newargv[0], newargv, newenv)<0)
printf_log(LOG_NONE, "Failed to relaunch, error is %d/%s\n", errno, strerror(errno));
} else {
printf_log(LOG_INFO, "BOX86: Using tcmalloc_minimal.so.4, and it's in the LD_PRELOAD command\n");
}
}
// get and alloc stack size and align
if(CalcStackSize(my_context)) {
printf_log(LOG_NONE, "Error: allocating stack\n");
@@ -959,6 +1092,16 @@ int main(int argc, const char **argv, const char **env) {
FreeCollection(&ld_preload);
return -1;
}
#ifdef RPI
if(box86_tokitori2) {
uint32_t *patch = (uint32_t*)0x85897f4;
if(*patch==0x2000) {
*patch = 0x1000;
printf_log(LOG_NONE, "Runtime patching the game\n");
} else
printf_log(LOG_NONE, "Cannot patch the game\n");
}
#endif
// init x86 emu
x86emu_t *emu = NewX86Emu(my_context, my_context->ep, (uintptr_t)my_context->stack, my_context->stacksz, 0);
// stack setup is much more complicated then just that!
@@ -984,6 +1127,9 @@ int main(int argc, const char **argv, const char **env) {
*(void**)wineinfo = get_wine_prereserve();
printf_log(LOG_DEBUG, "WINE wine_main_preload_info found and updated\n");
}
#ifdef DYNAREC
dynarec_wine_prereserve();
#endif
}
// pre-load lib if needed
if(ld_preload.size) {
+11 -5
View File
@@ -9,8 +9,10 @@
#include "wrapper.h"
#include "khash.h"
#include "debug.h"
#include "x86emu.h"
#ifdef DYNAREC
#include "dynablock.h"
#include "box86context.h"
#endif
KHASH_MAP_INIT_INT(bridgemap, uintptr_t)
@@ -52,13 +54,13 @@ void FreeBridge(bridge_t** bridge)
*bridge = NULL;
}
uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N)
uintptr_t AddBridge(bridge_t* bridge, box86context_t* context, wrapper_t w, void* fnc, int N)
{
brick_t *b = bridge->last;
if(b->sz == NBRICK) {
b->next = (brick_t*)calloc(1, sizeof(brick_t));
b = b->next;
bridge->head = b;
bridge->last = b;
}
b->b[b->sz].CC = 0xCC;
b->b[b->sz].S = 'S'; b->b[b->sz].C='C';
@@ -70,6 +72,10 @@ uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N)
int ret;
khint_t k = kh_put(bridgemap, bridge->bridgemap, (uintptr_t)fnc, &ret);
kh_value(bridge->bridgemap, k) = (uintptr_t)&b->b[b->sz].CC;
#ifdef DYNAREC
if(box86_dynarec)
addDBFromAddressRange(context, (uintptr_t)&b->b[b->sz].CC, sizeof(onebridge_t), 0);
#endif
return (uintptr_t)&b->b[b->sz++].CC;
}
@@ -83,13 +89,13 @@ uintptr_t CheckBridged(bridge_t* bridge, void* fnc)
return kh_value(bridge->bridgemap, k);
}
uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N)
uintptr_t AddCheckBridge(bridge_t* bridge, box86context_t* context, wrapper_t w, void* fnc, int N)
{
if(!fnc)
return 0;
uintptr_t ret = CheckBridged(bridge, fnc);
if(!ret)
ret = AddBridge(bridge, w, fnc, N);
ret = AddBridge(bridge, context, w, fnc, N);
return ret;
}
@@ -99,7 +105,7 @@ uintptr_t AddAutomaticBridge(x86emu_t* emu, bridge_t* bridge, wrapper_t w, void*
return 0;
uintptr_t ret = CheckBridged(bridge, fnc);
if(!ret)
ret = AddBridge(bridge, w, fnc, N);
ret = AddBridge(bridge, GetEmuContext(emu), w, fnc, N);
if(!hasAlternate(fnc)) {
printf_log(LOG_DEBUG, "Adding AutomaticBridge for %p to %p\n", fnc, (void*)ret);
addAlternate(fnc, (void*)ret);
-265
View File
@@ -12,245 +12,6 @@
#include "box86context.h"
#include "box86stack.h"
#include "dynarec.h"
#include "khash.h"
typedef struct onecallback_s onecallback_t;
typedef struct onecallback_s {
x86emu_t *emu;
uintptr_t fnc;
int nb_args;
void* arg[10];
int shared;
onecallback_t *chain;
} onecallback_t;
KHASH_MAP_INIT_INT(callbacks, onecallback_t*)
typedef struct callbacklist_s {
kh_callbacks_t *list;
int cap;
int sz;
} callbacklist_t;
onecallback_t* FindCallback(x86emu_t* emu)
{
if(!emu)
return NULL;
// find the callback first
callbacklist_t *callbacks = emu->context->callbacks;
khint_t k = kh_get(callbacks, callbacks->list, (uintptr_t)emu);
if(k==kh_end(callbacks->list) || !kh_exist(callbacks->list, k))
return NULL;
return kh_value(callbacks->list, k);
}
x86emu_t* FindCallbackFnc1Arg(x86emu_t* emu, uintptr_t fnc, int argn, void* arg)
{
if(!emu)
return NULL;
// find the callback first
callbacklist_t *callbacks = emu->context->callbacks;
onecallback_t* cb;
kh_foreach_value(callbacks->list, cb,
if(cb->fnc==fnc && cb->arg[argn]==arg)
return cb->emu;
);
return NULL;
}
int IsCallback(box86context_t* context, x86emu_t* cb)
{
if(!cb)
return 0;
callbacklist_t *callbacks = context->callbacks;
khint_t k = kh_get(callbacks, callbacks->list, (uintptr_t)cb);
if(k==kh_end(callbacks->list) || !kh_exist(callbacks->list, k))
return 0;
return 1;
}
x86emu_t* AddVariableCallback(x86emu_t* emu, int stsize, uintptr_t fnc, int nb_args, void* arg1, void* arg2, void* arg3, void* arg4)
{
callbacklist_t *callbacks = emu->context->callbacks;
void* stack = calloc(1, stsize);
if(!stack) {
printf_log(LOG_NONE, "BOX86: Error, cannot allocate %d KB Stack for callback\n", stsize/1024);
}
x86emu_t * newemu = NewX86Emu(emu->context, fnc, (uintptr_t)stack, stsize, 1);
SetupX86Emu(newemu);
onecallback_t * cb;
int ret;
khint_t k = kh_put(callbacks, callbacks->list, (uintptr_t)newemu, &ret);
cb = kh_value(callbacks->list, k) = (onecallback_t*)calloc(1, sizeof(onecallback_t));
cb->emu = newemu;
cb->fnc = fnc;
cb->nb_args = nb_args;
cb->arg[0] = arg1;
cb->arg[1] = arg2;
cb->arg[2] = arg3;
cb->arg[3] = arg4;
cb->shared = 0;
return newemu;
}
x86emu_t* AddCallback(x86emu_t* emu, uintptr_t fnc, int nb_args, void* arg1, void* arg2, void* arg3, void* arg4)
{
// 2MB stack (1MB is not enough for Xenonauts)
return AddVariableCallback(emu, 2*1024*1024, fnc, nb_args, arg1, arg2, arg3, arg4);
}
x86emu_t* AddSmallCallback(x86emu_t* emu, uintptr_t fnc, int nb_args, void* arg1, void* arg2, void* arg3, void* arg4)
{
// 64KB stack
return AddVariableCallback(emu, 64*1024, fnc, nb_args, arg1, arg2, arg3, arg4);
}
x86emu_t* AddSharedCallback(x86emu_t* emu, uintptr_t fnc, int nb_args, void* arg1, void* arg2, void* arg3, void* arg4)
{
callbacklist_t *callbacks = emu->context->callbacks;
x86emu_t * newemu = emu;
onecallback_t * cb;
onecallback_t * old = FindCallback(emu);
int ret;
khint_t k = kh_put(callbacks, callbacks->list, (uintptr_t)newemu, &ret);
cb = kh_value(callbacks->list, k) = (onecallback_t*)calloc(1, sizeof(onecallback_t));
cb->emu = newemu;
cb->fnc = fnc;
cb->nb_args = nb_args;
cb->arg[0] = arg1;
cb->arg[1] = arg2;
cb->arg[2] = arg3;
cb->arg[3] = arg4;
cb->shared = 1;
cb->chain = old;
return newemu;
}
x86emu_t* GetCallback1Arg(x86emu_t* emu, uintptr_t fnc, int nb_args, void* arg1)
{
callbacklist_t *callbacks = emu->context->callbacks;
onecallback_t * cb;
kh_foreach_value(callbacks->list, cb,
if(cb->fnc==fnc && cb->nb_args==nb_args && cb->arg[0]==arg1) {
return cb->emu;
}
);
return NULL;
}
x86emu_t* FreeCallback(x86emu_t* emu)
{
// find the callback first
callbacklist_t *callbacks = emu->context->callbacks;
khint_t k = kh_get(callbacks, callbacks->list, (uintptr_t)emu);
if(k==kh_end(callbacks->list))
return emu;
onecallback_t* cb = kh_value(callbacks->list, k);
if(!cb->shared)
FreeX86Emu(&cb->emu);
x86emu_t* ret = NULL;
if(cb->chain) {
kh_value(callbacks->list, k) = cb->chain; // unchain, in case of shared callback inside callback
ret = cb->chain->emu;
} else {
kh_del(callbacks, callbacks->list, k);
}
free(cb);
return ret;
}
uint32_t RunCallback(x86emu_t* emu)
{
onecallback_t *cb = FindCallback(emu);
if(cb) {
// clean seg offs cache
memset(emu->segs_clean, 0, sizeof(emu->segs_clean));
for (int i=cb->nb_args-1; i>=0; --i) // reverse order
Push(emu, (uint32_t)cb->arg[i]);
DynaCall(emu, cb->fnc);
R_ESP+=(cb->nb_args*4);
return R_EAX;
}
printf_log(LOG_INFO, "Warning, Callback not found?!\n");
return 0;
}
void SetCallbackArg(x86emu_t* emu, int arg, void* val)
{
onecallback_t *cb = FindCallback(emu);
if(cb) {
cb->arg[arg] = val;
}
}
void SetCallbackNArg(x86emu_t* emu, int narg)
{
onecallback_t *cb = FindCallback(emu);
if(cb) {
cb->nb_args = narg;
}
}
void* GetCallbackArg(x86emu_t* emu, int arg)
{
onecallback_t *cb = FindCallback(emu);
if(cb) {
return cb->arg[arg];
}
return NULL;
}
void SetCallbackAddress(x86emu_t* emu, uintptr_t address)
{
onecallback_t *cb = FindCallback(emu);
if(cb) {
cb->fnc = address;
}
}
uintptr_t GetCallbackAddress(x86emu_t* emu)
{
onecallback_t *cb = FindCallback(emu);
if(cb) {
return cb->fnc;
}
return 0;
}
callbacklist_t* NewCallbackList()
{
callbacklist_t* callbacks = (callbacklist_t*)calloc(1, sizeof(callbacklist_t));
callbacks->list = kh_init(callbacks);
return callbacks;
}
void FreeCallbackList(callbacklist_t** callbacks)
{
if(!callbacks)
return;
if(!*callbacks)
return;
onecallback_t* cb;
kh_foreach_value((*callbacks)->list, cb,
FreeX86Emu(&cb->emu);
free(cb);
);
kh_destroy(callbacks, (*callbacks)->list);
free(*callbacks);
*callbacks = NULL;
}
EXPORTDYN
uint32_t RunFunction(box86context_t *context, uintptr_t fnc, int nargs, ...)
@@ -302,32 +63,6 @@ uint64_t RunFunction64(box86context_t *context, uintptr_t fnc, int nargs, ...)
return ret;
}
void SetCallbackArgs(x86emu_t* emu, int nargs, ...)
{
onecallback_t *cb = FindCallback(emu);
if(cb) {
va_list va;
va_start (va, nargs);
for (int i=0; i<nargs; ++i) {
cb->arg[i] = va_arg(va, void*);
}
va_end (va);
}
}
void SetCallbackNArgs(x86emu_t* emu, int N, int nargs, ...)
{
onecallback_t *cb = FindCallback(emu);
if(cb) {
va_list va;
va_start (va, nargs);
for (int i=0; i<nargs; ++i) {
cb->arg[N+i] = va_arg(va, void*);
}
va_end (va);
}
}
EXPORTDYN
uint32_t RunFunctionWithEmu(x86emu_t *emu, int QuitOnLongJump, uintptr_t fnc, int nargs, ...)
{
+8 -8
View File
@@ -71,9 +71,9 @@ static void* find_##NAME##_##A(void* fct) \
}
#define REVERSE(A, NAME) \
static void* reverse_##NAME##_##A(wrapper_t W, void* fct) \
{ \
if(!fct) return fct; \
static void* reverse_##NAME##_##A(wrapper_t W, void* fct) \
{ \
if(!fct) return fct; \
if((void*)my_##NAME##_##A##_0 == fct) return (void*)my_##NAME##_##A##_fct_0;\
if((void*)my_##NAME##_##A##_1 == fct) return (void*)my_##NAME##_##A##_fct_1;\
if((void*)my_##NAME##_##A##_2 == fct) return (void*)my_##NAME##_##A##_fct_2;\
@@ -82,10 +82,10 @@ static void* reverse_##NAME##_##A(wrapper_t W, void* fct) \
if((void*)my_##NAME##_##A##_5 == fct) return (void*)my_##NAME##_##A##_fct_5;\
if((void*)my_##NAME##_##A##_6 == fct) return (void*)my_##NAME##_##A##_fct_6;\
if((void*)my_##NAME##_##A##_7 == fct) return (void*)my_##NAME##_##A##_fct_7;\
Dl_info info; \
if(dladdr(fct, &info)) \
return (void*)AddCheckBridge(my_bridge, W, fct, 0); \
return fct; \
Dl_info info; \
if(dladdr(fct, &info)) \
return (void*)AddCheckBridge(my_bridge, my_context, W, fct, 0); \
return fct; \
}
#define AUTOBRIDGE(A, NAME) \
@@ -361,7 +361,7 @@ static void bridgeGtkWidgetClass(my_GtkWidgetClass_t* class)
WRAPPER(GtkContainer, add, void, (void* container, void* widget), 2, container, widget);
WRAPPER(GtkContainer, remove, void, (void* container, void* widget), 2, container, widget);
WRAPPER(GtkContainer, check_resize, void, (void* container), 1, container);
WRAPPER(GtkContainer, forall, void, (void* container, int include_internals, void* callback, void* callback_data), 4, container, include_internals, AddCheckBridge(my_bridge, vFpp, callback, 0), callback_data);
WRAPPER(GtkContainer, forall, void, (void* container, int include_internals, void* callback, void* callback_data), 4, container, include_internals, AddCheckBridge(my_bridge, my_context, vFpp, callback, 0), callback_data);
WRAPPER(GtkContainer, set_focus_child, void, (void* container, void* widget), 2, container, widget);
WRAPPER(GtkContainer, child_type, int, (void* container), 1, container);
WRAPPER(GtkContainer, composite_name, void*, (void* container, void* child), 2, container, child);
+17 -1
View File
@@ -7,6 +7,7 @@
#include "wine_tools.h"
#include "debug.h"
#include "box86context.h"
typedef struct wine_prereserve_s
{
@@ -86,4 +87,19 @@ void* get_wine_prereserve()
if(!wine_preloaded)
wine_prereserve(NULL);
return (void*)my_wine_reserve;
}
}
#ifdef DYNAREC
void dynarec_wine_prereserve()
{
#if 0
// disable for now, as it brack some installer
if(!wine_preloaded)
wine_prereserve(NULL);
// don't reserve the initial arbritrary block as "with linker", it's not true
for(int i=1; i<sizeof(my_wine_reserve)/sizeof(my_wine_reserve[0]); ++i)
if(my_wine_reserve[i].addr && my_wine_reserve[i].size)
addDBFromAddressRange(my_context, (uintptr_t)my_wine_reserve[i].addr, my_wine_reserve[i].size, 0); // prepare the prereserved area for exec, with linker
#endif
}
#endif
+46
View File
@@ -5,6 +5,7 @@
#() vFu
#() vFf
#() vFd
#() vFl
#() vFL
#() vFp
#() vFS
@@ -210,6 +211,7 @@
#() lFpi
#() lFpp
#() LFii
#() LFLi
#() LFLp
#() LFpL
#() LFpp
@@ -405,6 +407,7 @@
#() uFpii
#() uFpiu
#() uFpip
#() uFpCi
#() uFpui
#() uFpuu
#() uFpup
@@ -432,10 +435,12 @@
#() lFpLp
#() lFppi
#() lFppL
#() LFiii
#() LFpii
#() LFpLi
#() LFpLp
#() LFppi
#() LFppp
#() pFEip
#() pFEup
#() pFEpi
@@ -657,6 +662,7 @@
#() iFpipi
#() iFpipC
#() iFpipp
#() iFpipV
#() iFpIip
#() iFpCCC
#() iFpCpi
@@ -669,6 +675,7 @@
#() iFpuuu
#() iFpuup
#() iFpuUp
#() iFpuLL
#() iFpuLp
#() iFpupi
#() iFpupu
@@ -691,6 +698,7 @@
#() iFppui
#() iFppuu
#() iFppup
#() iFppdp
#() iFppll
#() iFpplp
#() iFppLi
@@ -768,6 +776,7 @@
#() pFiipi
#() pFipii
#() pFipip
#() pFippi
#() pFippu
#() pFuiii
#() pFffff
@@ -980,6 +989,7 @@
#() iFpplpp
#() iFppLwp
#() iFppLip
#() iFppLpi
#() iFppLpL
#() iFpppii
#() iFpppiu
@@ -1016,6 +1026,7 @@
#() LFEpppp
#() LFpuppi
#() LFpLppp
#() LFpppii
#() LFppppp
#() pFEpiii
#() pFEpipi
@@ -1025,8 +1036,11 @@
#() pFEppii
#() pFEppip
#() pFEppCC
#() pFEppuW
#() pFEppuu
#() pFEppup
#() pFEpppi
#() pFEpppu
#() pFEpppp
#() pFiiiii
#() pFipipu
@@ -1041,6 +1055,7 @@
#() pFpiipp
#() pFpiCCC
#() pFpiuuu
#() pFpippi
#() pFpippp
#() pFpuiii
#() pFpuuip
@@ -1138,6 +1153,7 @@
#() vFppiipp
#() vFppilpp
#() vFppippi
#() vFppippp
#() vFppuuuu
#() vFppupii
#() vFppuppp
@@ -1227,6 +1243,7 @@
#() iFpplppi
#() iFppLupp
#() iFppLpLp
#() iFppLppp
#() iFpppiuu
#() iFpppipp
#() iFpppuii
@@ -1255,20 +1272,25 @@
#() pFEppCuW
#() pFEppCuu
#() pFEppuWp
#() pFEppuuC
#() pFEppuuu
#() pFEppuup
#() pFEpppup
#() pFEppppi
#() pFEppppp
#() pFiiiiii
#() pFiCiiCi
#() pFdddddd
#() pFpiiiiu
#() pFpiiCCC
#() pFpiiuuu
#() pFpippip
#() pFpuuuuu
#() pFplpppp
#() pFppiiii
#() pFppiipp
#() pFppiCCC
#() pFppippi
#() pFppippp
#() pFpppiii
#() pFpppiui
@@ -1279,6 +1301,7 @@
#() pFSpiiii
#() vFEpipppp
#() vFEpuipuV
#() vFEpppppp
#() vFiiiiiip
#() vFiiiiuup
#() vFiiupuip
@@ -1395,10 +1418,12 @@
#() iFpppiiup
#() iFpppiipi
#() iFpppiuwu
#() iFpppippi
#() iFpppippp
#() iFpppuiii
#() iFpppuppp
#() iFppppiii
#() iFppppipp
#() iFppppdpi
#() iFpppppip
#() iFpppppup
@@ -1421,8 +1446,10 @@
#() pFuupupup
#() pFplppppp
#() pFppiiipp
#() pFppiiCCC
#() pFppiippp
#() pFppipipp
#() pFppuuuuu
#() pFppuuppp
#() pFppLiiip
#() pFppLipip
@@ -1512,6 +1539,9 @@
#() iFpppipipi
#() iFpppipppp
#() iFppppiipi
#() iFppppippp
#() iFppppppii
#() iFpppppppi
#() iFpppppppp
#() uFEipipppp
#() uFEpiupppp
@@ -1522,6 +1552,7 @@
#() pFEppCuuCC
#() pFEppCuuWW
#() pFEppCuuup
#() pFEppuuwwu
#() pFEppuuuuu
#() pFEppuuUUU
#() pFEppLiiip
@@ -1536,6 +1567,7 @@
#() pFpipppppp
#() pFpWWiCpup
#() pFpuuuupup
#() pFpupupuuu
#() pFpdwwWWui
#() pFplpppppp
#() pFppiiiiii
@@ -1570,6 +1602,7 @@
#() vFppuuiiiii
#() vFpplpppppi
#() vFpppiiiiii
#() vFppppipiip
#() vFpppppippp
#() vFppppppppp
#() iFEiiuuuuuu
@@ -1577,6 +1610,7 @@
#() iFEpuuiippu
#() iFEpuuuiipp
#() iFEpppipppp
#() iFEpppppupp
#() iFiiiiiiiip
#() iFiiiipiiip
#() iFipiipippi
@@ -1600,9 +1634,11 @@
#() LFEppppppii
#() pFEppiiuuui
#() pFEppCuwwWW
#() pFEppCuWCCC
#() pFEppCuuwwp
#() pFEppCuuuuu
#() pFEppuippuu
#() pFEppuuuwwu
#() pFEppuupwwC
#() pFEpppppiiV
#() pFEpppppppi
@@ -1614,6 +1650,7 @@
#() pFppipppppp
#() pFpppiiiiii
#() pFpppiipppp
#() pFpppppiipp
#() vFEiippppppp
#() vFEpippppppp
#() vFEpppiipppp
@@ -1649,6 +1686,7 @@
#() iFiiiiiiiiip
#() iFpuipuppppp
#() iFpuupiuiipp
#() iFppipiippii
#() iFppuuiiiiii
#() iFppuuiiuupi
#() iFpppLLipppp
@@ -1657,8 +1695,10 @@
#() pFEiippppppp
#() pFEpiiiiiipp
#() pFEpippppppp
#() pFEppCCuuwwC
#() pFEppCuwwWWu
#() pFEppCuuuCup
#() pFEppuuWWCuu
#() pFplllllllll
#() pFppuiipuuii
#() vFEpiiiupupup
@@ -1690,6 +1730,7 @@
#() iFEppppiiiiuu
#() iFiiiiiiiiiip
#() iFpipllippppp
#() iFppippipppip
#() iFppppiiuuiiu
#() uFEpiiupppiuV
#() uFEpiippppiup
@@ -1720,6 +1761,8 @@
#() iFpppppppppppp
#() lFpLpppppppppp
#() pFEppiiuuuipii
#() pFEppCuWCCuuCW
#() pFEppuwwWWuCuu
#() pFEppuuuwwwwWW
#() pFEppuuuWWWCCi
#() pFWWiCCCCiipup
@@ -1772,12 +1815,15 @@
#() pFppippipipipipipip
#() vFppuiiiiipuiiiiiiii
#() vFpppipppppppppppppp
#() LFpppppppppppppppppp
#() pFEppuuWWWWWWwwCCCuu
#() pFippppppppppppppppp
#() vFpiiiiiiiiiiiiiiiiii
#() iFpppippppppppppppppp
#() pFEppuuuuuwwuuuuUUUup
#() pFiiiippppppppppppppp
#() pFipppppppppppppppppppppp
#() iFpppppppppppppppppppppppppppppppppp
#defined(NOALIGN) IFpi
#defined(NOALIGN) dFpi
#defined(NOALIGN) iFppiiiip
+92
View File
@@ -76,6 +76,7 @@ typedef void (*vFi_t)(int32_t);
typedef void (*vFu_t)(uint32_t);
typedef void (*vFf_t)(float);
typedef void (*vFd_t)(double);
typedef void (*vFl_t)(intptr_t);
typedef void (*vFL_t)(uintptr_t);
typedef void (*vFp_t)(void*);
typedef void (*vFS_t)(void*);
@@ -281,6 +282,7 @@ typedef intptr_t (*lFll_t)(intptr_t, intptr_t);
typedef intptr_t (*lFpi_t)(void*, int32_t);
typedef intptr_t (*lFpp_t)(void*, void*);
typedef uintptr_t (*LFii_t)(int32_t, int32_t);
typedef uintptr_t (*LFLi_t)(uintptr_t, int32_t);
typedef uintptr_t (*LFLp_t)(uintptr_t, void*);
typedef uintptr_t (*LFpL_t)(void*, uintptr_t);
typedef uintptr_t (*LFpp_t)(void*, void*);
@@ -476,6 +478,7 @@ typedef uint32_t (*uFupp_t)(uint32_t, void*, void*);
typedef uint32_t (*uFpii_t)(void*, int32_t, int32_t);
typedef uint32_t (*uFpiu_t)(void*, int32_t, uint32_t);
typedef uint32_t (*uFpip_t)(void*, int32_t, void*);
typedef uint32_t (*uFpCi_t)(void*, uint8_t, int32_t);
typedef uint32_t (*uFpui_t)(void*, uint32_t, int32_t);
typedef uint32_t (*uFpuu_t)(void*, uint32_t, uint32_t);
typedef uint32_t (*uFpup_t)(void*, uint32_t, void*);
@@ -503,10 +506,12 @@ typedef intptr_t (*lFlll_t)(intptr_t, intptr_t, intptr_t);
typedef intptr_t (*lFpLp_t)(void*, uintptr_t, void*);
typedef intptr_t (*lFppi_t)(void*, void*, int32_t);
typedef intptr_t (*lFppL_t)(void*, void*, uintptr_t);
typedef uintptr_t (*LFiii_t)(int32_t, int32_t, int32_t);
typedef uintptr_t (*LFpii_t)(void*, int32_t, int32_t);
typedef uintptr_t (*LFpLi_t)(void*, uintptr_t, int32_t);
typedef uintptr_t (*LFpLp_t)(void*, uintptr_t, void*);
typedef uintptr_t (*LFppi_t)(void*, void*, int32_t);
typedef uintptr_t (*LFppp_t)(void*, void*, void*);
typedef void* (*pFEip_t)(x86emu_t*, int32_t, void*);
typedef void* (*pFEup_t)(x86emu_t*, uint32_t, void*);
typedef void* (*pFEpi_t)(x86emu_t*, void*, int32_t);
@@ -728,6 +733,7 @@ typedef int32_t (*iFpild_t)(void*, int32_t, intptr_t, double);
typedef int32_t (*iFpipi_t)(void*, int32_t, void*, int32_t);
typedef int32_t (*iFpipC_t)(void*, int32_t, void*, uint8_t);
typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*);
typedef int32_t (*iFpipV_t)(void*, int32_t, void*, void*);
typedef int32_t (*iFpIip_t)(void*, int64_t, int32_t, void*);
typedef int32_t (*iFpCCC_t)(void*, uint8_t, uint8_t, uint8_t);
typedef int32_t (*iFpCpi_t)(void*, uint8_t, void*, int32_t);
@@ -740,6 +746,7 @@ typedef int32_t (*iFpuui_t)(void*, uint32_t, uint32_t, int32_t);
typedef int32_t (*iFpuuu_t)(void*, uint32_t, uint32_t, uint32_t);
typedef int32_t (*iFpuup_t)(void*, uint32_t, uint32_t, void*);
typedef int32_t (*iFpuUp_t)(void*, uint32_t, uint64_t, void*);
typedef int32_t (*iFpuLL_t)(void*, uint32_t, uintptr_t, uintptr_t);
typedef int32_t (*iFpuLp_t)(void*, uint32_t, uintptr_t, void*);
typedef int32_t (*iFpupi_t)(void*, uint32_t, void*, int32_t);
typedef int32_t (*iFpupu_t)(void*, uint32_t, void*, uint32_t);
@@ -762,6 +769,7 @@ typedef int32_t (*iFppuw_t)(void*, void*, uint32_t, int16_t);
typedef int32_t (*iFppui_t)(void*, void*, uint32_t, int32_t);
typedef int32_t (*iFppuu_t)(void*, void*, uint32_t, uint32_t);
typedef int32_t (*iFppup_t)(void*, void*, uint32_t, void*);
typedef int32_t (*iFppdp_t)(void*, void*, double, void*);
typedef int32_t (*iFppll_t)(void*, void*, intptr_t, intptr_t);
typedef int32_t (*iFpplp_t)(void*, void*, intptr_t, void*);
typedef int32_t (*iFppLi_t)(void*, void*, uintptr_t, int32_t);
@@ -839,6 +847,7 @@ typedef void* (*pFiiup_t)(int32_t, int32_t, uint32_t, void*);
typedef void* (*pFiipi_t)(int32_t, int32_t, void*, int32_t);
typedef void* (*pFipii_t)(int32_t, void*, int32_t, int32_t);
typedef void* (*pFipip_t)(int32_t, void*, int32_t, void*);
typedef void* (*pFippi_t)(int32_t, void*, void*, int32_t);
typedef void* (*pFippu_t)(int32_t, void*, void*, uint32_t);
typedef void* (*pFuiii_t)(uint32_t, int32_t, int32_t, int32_t);
typedef void* (*pFffff_t)(float, float, float, float);
@@ -1051,6 +1060,7 @@ typedef int32_t (*iFppllp_t)(void*, void*, intptr_t, intptr_t, void*);
typedef int32_t (*iFpplpp_t)(void*, void*, intptr_t, void*, void*);
typedef int32_t (*iFppLwp_t)(void*, void*, uintptr_t, int16_t, void*);
typedef int32_t (*iFppLip_t)(void*, void*, uintptr_t, int32_t, void*);
typedef int32_t (*iFppLpi_t)(void*, void*, uintptr_t, void*, int32_t);
typedef int32_t (*iFppLpL_t)(void*, void*, uintptr_t, void*, uintptr_t);
typedef int32_t (*iFpppii_t)(void*, void*, void*, int32_t, int32_t);
typedef int32_t (*iFpppiu_t)(void*, void*, void*, int32_t, uint32_t);
@@ -1087,6 +1097,7 @@ typedef intptr_t (*lFppiip_t)(void*, void*, int32_t, int32_t, void*);
typedef uintptr_t (*LFEpppp_t)(x86emu_t*, void*, void*, void*, void*);
typedef uintptr_t (*LFpuppi_t)(void*, uint32_t, void*, void*, int32_t);
typedef uintptr_t (*LFpLppp_t)(void*, uintptr_t, void*, void*, void*);
typedef uintptr_t (*LFpppii_t)(void*, void*, void*, int32_t, int32_t);
typedef uintptr_t (*LFppppp_t)(void*, void*, void*, void*, void*);
typedef void* (*pFEpiii_t)(x86emu_t*, void*, int32_t, int32_t, int32_t);
typedef void* (*pFEpipi_t)(x86emu_t*, void*, int32_t, void*, int32_t);
@@ -1096,8 +1107,11 @@ typedef void* (*pFEpupp_t)(x86emu_t*, void*, uint32_t, void*, void*);
typedef void* (*pFEppii_t)(x86emu_t*, void*, void*, int32_t, int32_t);
typedef void* (*pFEppip_t)(x86emu_t*, void*, void*, int32_t, void*);
typedef void* (*pFEppCC_t)(x86emu_t*, void*, void*, uint8_t, uint8_t);
typedef void* (*pFEppuW_t)(x86emu_t*, void*, void*, uint32_t, uint16_t);
typedef void* (*pFEppuu_t)(x86emu_t*, void*, void*, uint32_t, uint32_t);
typedef void* (*pFEppup_t)(x86emu_t*, void*, void*, uint32_t, void*);
typedef void* (*pFEpppi_t)(x86emu_t*, void*, void*, void*, int32_t);
typedef void* (*pFEpppu_t)(x86emu_t*, void*, void*, void*, uint32_t);
typedef void* (*pFEpppp_t)(x86emu_t*, void*, void*, void*, void*);
typedef void* (*pFiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t);
typedef void* (*pFipipu_t)(int32_t, void*, int32_t, void*, uint32_t);
@@ -1112,6 +1126,7 @@ typedef void* (*pFpiipi_t)(void*, int32_t, int32_t, void*, int32_t);
typedef void* (*pFpiipp_t)(void*, int32_t, int32_t, void*, void*);
typedef void* (*pFpiCCC_t)(void*, int32_t, uint8_t, uint8_t, uint8_t);
typedef void* (*pFpiuuu_t)(void*, int32_t, uint32_t, uint32_t, uint32_t);
typedef void* (*pFpippi_t)(void*, int32_t, void*, void*, int32_t);
typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*);
typedef void* (*pFpuiii_t)(void*, uint32_t, int32_t, int32_t, int32_t);
typedef void* (*pFpuuip_t)(void*, uint32_t, uint32_t, int32_t, void*);
@@ -1209,6 +1224,7 @@ typedef void (*vFppiipi_t)(void*, void*, int32_t, int32_t, void*, int32_t);
typedef void (*vFppiipp_t)(void*, void*, int32_t, int32_t, void*, void*);
typedef void (*vFppilpp_t)(void*, void*, int32_t, intptr_t, void*, void*);
typedef void (*vFppippi_t)(void*, void*, int32_t, void*, void*, int32_t);
typedef void (*vFppippp_t)(void*, void*, int32_t, void*, void*, void*);
typedef void (*vFppuuuu_t)(void*, void*, uint32_t, uint32_t, uint32_t, uint32_t);
typedef void (*vFppupii_t)(void*, void*, uint32_t, void*, int32_t, int32_t);
typedef void (*vFppuppp_t)(void*, void*, uint32_t, void*, void*, void*);
@@ -1298,6 +1314,7 @@ typedef int32_t (*iFppdidd_t)(void*, void*, double, int32_t, double, double);
typedef int32_t (*iFpplppi_t)(void*, void*, intptr_t, void*, void*, int32_t);
typedef int32_t (*iFppLupp_t)(void*, void*, uintptr_t, uint32_t, void*, void*);
typedef int32_t (*iFppLpLp_t)(void*, void*, uintptr_t, void*, uintptr_t, void*);
typedef int32_t (*iFppLppp_t)(void*, void*, uintptr_t, void*, void*, void*);
typedef int32_t (*iFpppiuu_t)(void*, void*, void*, int32_t, uint32_t, uint32_t);
typedef int32_t (*iFpppipp_t)(void*, void*, void*, int32_t, void*, void*);
typedef int32_t (*iFpppuii_t)(void*, void*, void*, uint32_t, int32_t, int32_t);
@@ -1326,20 +1343,25 @@ typedef void* (*pFEppCWp_t)(x86emu_t*, void*, void*, uint8_t, uint16_t, void*);
typedef void* (*pFEppCuW_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint16_t);
typedef void* (*pFEppCuu_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint32_t);
typedef void* (*pFEppuWp_t)(x86emu_t*, void*, void*, uint32_t, uint16_t, void*);
typedef void* (*pFEppuuC_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint8_t);
typedef void* (*pFEppuuu_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint32_t);
typedef void* (*pFEppuup_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, void*);
typedef void* (*pFEpppup_t)(x86emu_t*, void*, void*, void*, uint32_t, void*);
typedef void* (*pFEppppi_t)(x86emu_t*, void*, void*, void*, void*, int32_t);
typedef void* (*pFEppppp_t)(x86emu_t*, void*, void*, void*, void*, void*);
typedef void* (*pFiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
typedef void* (*pFiCiiCi_t)(int32_t, uint8_t, int32_t, int32_t, uint8_t, int32_t);
typedef void* (*pFdddddd_t)(double, double, double, double, double, double);
typedef void* (*pFpiiiiu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t);
typedef void* (*pFpiiCCC_t)(void*, int32_t, int32_t, uint8_t, uint8_t, uint8_t);
typedef void* (*pFpiiuuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t);
typedef void* (*pFpippip_t)(void*, int32_t, void*, void*, int32_t, void*);
typedef void* (*pFpuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
typedef void* (*pFplpppp_t)(void*, intptr_t, void*, void*, void*, void*);
typedef void* (*pFppiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t);
typedef void* (*pFppiipp_t)(void*, void*, int32_t, int32_t, void*, void*);
typedef void* (*pFppiCCC_t)(void*, void*, int32_t, uint8_t, uint8_t, uint8_t);
typedef void* (*pFppippi_t)(void*, void*, int32_t, void*, void*, int32_t);
typedef void* (*pFppippp_t)(void*, void*, int32_t, void*, void*, void*);
typedef void* (*pFpppiii_t)(void*, void*, void*, int32_t, int32_t, int32_t);
typedef void* (*pFpppiui_t)(void*, void*, void*, int32_t, uint32_t, int32_t);
@@ -1350,6 +1372,7 @@ typedef void* (*pFpppppp_t)(void*, void*, void*, void*, void*, void*);
typedef void* (*pFSpiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t);
typedef void (*vFEpipppp_t)(x86emu_t*, void*, int32_t, void*, void*, void*, void*);
typedef void (*vFEpuipuV_t)(x86emu_t*, void*, uint32_t, int32_t, void*, uint32_t, void*);
typedef void (*vFEpppppp_t)(x86emu_t*, void*, void*, void*, void*, void*, void*);
typedef void (*vFiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*);
typedef void (*vFiiiiuup_t)(int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*);
typedef void (*vFiiupuip_t)(int32_t, int32_t, uint32_t, void*, uint32_t, int32_t, void*);
@@ -1466,10 +1489,12 @@ typedef int32_t (*iFpppiiuu_t)(void*, void*, void*, int32_t, int32_t, uint32_t,
typedef int32_t (*iFpppiiup_t)(void*, void*, void*, int32_t, int32_t, uint32_t, void*);
typedef int32_t (*iFpppiipi_t)(void*, void*, void*, int32_t, int32_t, void*, int32_t);
typedef int32_t (*iFpppiuwu_t)(void*, void*, void*, int32_t, uint32_t, int16_t, uint32_t);
typedef int32_t (*iFpppippi_t)(void*, void*, void*, int32_t, void*, void*, int32_t);
typedef int32_t (*iFpppippp_t)(void*, void*, void*, int32_t, void*, void*, void*);
typedef int32_t (*iFpppuiii_t)(void*, void*, void*, uint32_t, int32_t, int32_t, int32_t);
typedef int32_t (*iFpppuppp_t)(void*, void*, void*, uint32_t, void*, void*, void*);
typedef int32_t (*iFppppiii_t)(void*, void*, void*, void*, int32_t, int32_t, int32_t);
typedef int32_t (*iFppppipp_t)(void*, void*, void*, void*, int32_t, void*, void*);
typedef int32_t (*iFppppdpi_t)(void*, void*, void*, void*, double, void*, int32_t);
typedef int32_t (*iFpppppip_t)(void*, void*, void*, void*, void*, int32_t, void*);
typedef int32_t (*iFpppppup_t)(void*, void*, void*, void*, void*, uint32_t, void*);
@@ -1492,8 +1517,10 @@ typedef void* (*pFifffppp_t)(int32_t, float, float, float, void*, void*, void*);
typedef void* (*pFuupupup_t)(uint32_t, uint32_t, void*, uint32_t, void*, uint32_t, void*);
typedef void* (*pFplppppp_t)(void*, intptr_t, void*, void*, void*, void*, void*);
typedef void* (*pFppiiipp_t)(void*, void*, int32_t, int32_t, int32_t, void*, void*);
typedef void* (*pFppiiCCC_t)(void*, void*, int32_t, int32_t, uint8_t, uint8_t, uint8_t);
typedef void* (*pFppiippp_t)(void*, void*, int32_t, int32_t, void*, void*, void*);
typedef void* (*pFppipipp_t)(void*, void*, int32_t, void*, int32_t, void*, void*);
typedef void* (*pFppuuuuu_t)(void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
typedef void* (*pFppuuppp_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*);
typedef void* (*pFppLiiip_t)(void*, void*, uintptr_t, int32_t, int32_t, int32_t, void*);
typedef void* (*pFppLipip_t)(void*, void*, uintptr_t, int32_t, void*, int32_t, void*);
@@ -1583,6 +1610,9 @@ typedef int32_t (*iFpppiippp_t)(void*, void*, void*, int32_t, int32_t, void*, vo
typedef int32_t (*iFpppipipi_t)(void*, void*, void*, int32_t, void*, int32_t, void*, int32_t);
typedef int32_t (*iFpppipppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*);
typedef int32_t (*iFppppiipi_t)(void*, void*, void*, void*, int32_t, int32_t, void*, int32_t);
typedef int32_t (*iFppppippp_t)(void*, void*, void*, void*, int32_t, void*, void*, void*);
typedef int32_t (*iFppppppii_t)(void*, void*, void*, void*, void*, void*, int32_t, int32_t);
typedef int32_t (*iFpppppppi_t)(void*, void*, void*, void*, void*, void*, void*, int32_t);
typedef int32_t (*iFpppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*);
typedef uint32_t (*uFEipipppp_t)(x86emu_t*, int32_t, void*, int32_t, void*, void*, void*, void*);
typedef uint32_t (*uFEpiupppp_t)(x86emu_t*, void*, int32_t, uint32_t, void*, void*, void*, void*);
@@ -1593,6 +1623,7 @@ typedef uintptr_t (*LFEpiupppp_t)(x86emu_t*, void*, int32_t, uint32_t, void*, vo
typedef void* (*pFEppCuuCC_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint32_t, uint8_t, uint8_t);
typedef void* (*pFEppCuuWW_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint32_t, uint16_t, uint16_t);
typedef void* (*pFEppCuuup_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint32_t, uint32_t, void*);
typedef void* (*pFEppuuwwu_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, int16_t, int16_t, uint32_t);
typedef void* (*pFEppuuuuu_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
typedef void* (*pFEppuuUUU_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint64_t, uint64_t, uint64_t);
typedef void* (*pFEppLiiip_t)(x86emu_t*, void*, void*, uintptr_t, int32_t, int32_t, int32_t, void*);
@@ -1607,6 +1638,7 @@ typedef void* (*pFpiiiiiuu_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t
typedef void* (*pFpipppppp_t)(void*, int32_t, void*, void*, void*, void*, void*, void*);
typedef void* (*pFpWWiCpup_t)(void*, uint16_t, uint16_t, int32_t, uint8_t, void*, uint32_t, void*);
typedef void* (*pFpuuuupup_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t, void*);
typedef void* (*pFpupupuuu_t)(void*, uint32_t, void*, uint32_t, void*, uint32_t, uint32_t, uint32_t);
typedef void* (*pFpdwwWWui_t)(void*, double, int16_t, int16_t, uint16_t, uint16_t, uint32_t, int32_t);
typedef void* (*pFplpppppp_t)(void*, intptr_t, void*, void*, void*, void*, void*, void*);
typedef void* (*pFppiiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
@@ -1641,6 +1673,7 @@ typedef void (*vFppipppiip_t)(void*, void*, int32_t, void*, void*, void*, int32_
typedef void (*vFppuuiiiii_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
typedef void (*vFpplpppppi_t)(void*, void*, intptr_t, void*, void*, void*, void*, void*, int32_t);
typedef void (*vFpppiiiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
typedef void (*vFppppipiip_t)(void*, void*, void*, void*, int32_t, void*, int32_t, int32_t, void*);
typedef void (*vFpppppippp_t)(void*, void*, void*, void*, void*, int32_t, void*, void*, void*);
typedef void (*vFppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef int32_t (*iFEiiuuuuuu_t)(x86emu_t*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
@@ -1648,6 +1681,7 @@ typedef int32_t (*iFEpiiiiipi_t)(x86emu_t*, void*, int32_t, int32_t, int32_t, in
typedef int32_t (*iFEpuuiippu_t)(x86emu_t*, void*, uint32_t, uint32_t, int32_t, int32_t, void*, void*, uint32_t);
typedef int32_t (*iFEpuuuiipp_t)(x86emu_t*, void*, uint32_t, uint32_t, uint32_t, int32_t, int32_t, void*, void*);
typedef int32_t (*iFEpppipppp_t)(x86emu_t*, void*, void*, void*, int32_t, void*, void*, void*, void*);
typedef int32_t (*iFEpppppupp_t)(x86emu_t*, void*, void*, void*, void*, void*, uint32_t, void*, void*);
typedef int32_t (*iFiiiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*);
typedef int32_t (*iFiiiipiiip_t)(int32_t, int32_t, int32_t, int32_t, void*, int32_t, int32_t, int32_t, void*);
typedef int32_t (*iFipiipippi_t)(int32_t, void*, int32_t, int32_t, void*, int32_t, void*, void*, int32_t);
@@ -1671,9 +1705,11 @@ typedef uint32_t (*uFppppppppp_t)(void*, void*, void*, void*, void*, void*, void
typedef uintptr_t (*LFEppppppii_t)(x86emu_t*, void*, void*, void*, void*, void*, void*, int32_t, int32_t);
typedef void* (*pFEppiiuuui_t)(x86emu_t*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t);
typedef void* (*pFEppCuwwWW_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t);
typedef void* (*pFEppCuWCCC_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint16_t, uint8_t, uint8_t, uint8_t);
typedef void* (*pFEppCuuwwp_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint32_t, int16_t, int16_t, void*);
typedef void* (*pFEppCuuuuu_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
typedef void* (*pFEppuippuu_t)(x86emu_t*, void*, void*, uint32_t, int32_t, void*, void*, uint32_t, uint32_t);
typedef void* (*pFEppuuuwwu_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint32_t, int16_t, int16_t, uint32_t);
typedef void* (*pFEppuupwwC_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, void*, int16_t, int16_t, uint8_t);
typedef void* (*pFEpppppiiV_t)(x86emu_t*, void*, void*, void*, void*, void*, int32_t, int32_t, void*);
typedef void* (*pFEpppppppi_t)(x86emu_t*, void*, void*, void*, void*, void*, void*, void*, int32_t);
@@ -1685,6 +1721,7 @@ typedef void* (*pFppiiuuuuu_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_
typedef void* (*pFppipppppp_t)(void*, void*, int32_t, void*, void*, void*, void*, void*, void*);
typedef void* (*pFpppiiiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
typedef void* (*pFpppiipppp_t)(void*, void*, void*, int32_t, int32_t, void*, void*, void*, void*);
typedef void* (*pFpppppiipp_t)(void*, void*, void*, void*, void*, int32_t, int32_t, void*, void*);
typedef void (*vFEiippppppp_t)(x86emu_t*, int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*);
typedef void (*vFEpippppppp_t)(x86emu_t*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*);
typedef void (*vFEpppiipppp_t)(x86emu_t*, void*, void*, void*, int32_t, int32_t, void*, void*, void*, void*);
@@ -1720,6 +1757,7 @@ typedef int32_t (*iFEpuuuuiipp_t)(x86emu_t*, void*, uint32_t, uint32_t, uint32_t
typedef int32_t (*iFiiiiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*);
typedef int32_t (*iFpuipuppppp_t)(void*, uint32_t, int32_t, void*, uint32_t, void*, void*, void*, void*, void*);
typedef int32_t (*iFpuupiuiipp_t)(void*, uint32_t, uint32_t, void*, int32_t, uint32_t, int32_t, int32_t, void*, void*);
typedef int32_t (*iFppipiippii_t)(void*, void*, int32_t, void*, int32_t, int32_t, void*, void*, int32_t, int32_t);
typedef int32_t (*iFppuuiiiiii_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
typedef int32_t (*iFppuuiiuupi_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*, int32_t);
typedef int32_t (*iFpppLLipppp_t)(void*, void*, void*, uintptr_t, uintptr_t, int32_t, void*, void*, void*, void*);
@@ -1728,8 +1766,10 @@ typedef uint32_t (*uFpppppppppp_t)(void*, void*, void*, void*, void*, void*, voi
typedef void* (*pFEiippppppp_t)(x86emu_t*, int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*);
typedef void* (*pFEpiiiiiipp_t)(x86emu_t*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, void*);
typedef void* (*pFEpippppppp_t)(x86emu_t*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*);
typedef void* (*pFEppCCuuwwC_t)(x86emu_t*, void*, void*, uint8_t, uint8_t, uint32_t, uint32_t, int16_t, int16_t, uint8_t);
typedef void* (*pFEppCuwwWWu_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t, uint32_t);
typedef void* (*pFEppCuuuCup_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint32_t, uint32_t, uint8_t, uint32_t, void*);
typedef void* (*pFEppuuWWCuu_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint16_t, uint16_t, uint8_t, uint32_t, uint32_t);
typedef void* (*pFplllllllll_t)(void*, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t);
typedef void* (*pFppuiipuuii_t)(void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t);
typedef void (*vFEpiiiupupup_t)(x86emu_t*, void*, int32_t, int32_t, int32_t, uint32_t, void*, uint32_t, void*, uint32_t, void*);
@@ -1761,6 +1801,7 @@ typedef int32_t (*iFEpppipppppp_t)(x86emu_t*, void*, void*, void*, int32_t, void
typedef int32_t (*iFEppppiiiiuu_t)(x86emu_t*, void*, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t);
typedef int32_t (*iFiiiiiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*);
typedef int32_t (*iFpipllippppp_t)(void*, int32_t, void*, intptr_t, intptr_t, int32_t, void*, void*, void*, void*, void*);
typedef int32_t (*iFppippipppip_t)(void*, void*, int32_t, void*, void*, int32_t, void*, void*, void*, int32_t, void*);
typedef int32_t (*iFppppiiuuiiu_t)(void*, void*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, uint32_t);
typedef uint32_t (*uFEpiiupppiuV_t)(x86emu_t*, void*, int32_t, int32_t, uint32_t, void*, void*, void*, int32_t, uint32_t, void*);
typedef uint32_t (*uFEpiippppiup_t)(x86emu_t*, void*, int32_t, int32_t, void*, void*, void*, void*, int32_t, uint32_t, void*);
@@ -1791,6 +1832,8 @@ typedef int32_t (*iFpppllipppppp_t)(void*, void*, void*, intptr_t, intptr_t, int
typedef int32_t (*iFpppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef intptr_t (*lFpLpppppppppp_t)(void*, uintptr_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef void* (*pFEppiiuuuipii_t)(x86emu_t*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, void*, int32_t, int32_t);
typedef void* (*pFEppCuWCCuuCW_t)(x86emu_t*, void*, void*, uint8_t, uint32_t, uint16_t, uint8_t, uint8_t, uint32_t, uint32_t, uint8_t, uint16_t);
typedef void* (*pFEppuwwWWuCuu_t)(x86emu_t*, void*, void*, uint32_t, int16_t, int16_t, uint16_t, uint16_t, uint32_t, uint8_t, uint32_t, uint32_t);
typedef void* (*pFEppuuuwwwwWW_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint32_t, int16_t, int16_t, int16_t, int16_t, uint16_t, uint16_t);
typedef void* (*pFEppuuuWWWCCi_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint8_t, uint8_t, int32_t);
typedef void* (*pFWWiCCCCiipup_t)(uint16_t, uint16_t, int32_t, uint8_t, uint8_t, uint8_t, uint8_t, int32_t, int32_t, void*, uint32_t, void*);
@@ -1843,12 +1886,15 @@ typedef int32_t (*iFpppippppppppppppp_t)(void*, void*, void*, int32_t, void*, vo
typedef void* (*pFppippipipipipipip_t)(void*, void*, int32_t, void*, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*);
typedef void (*vFppuiiiiipuiiiiiiii_t)(void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
typedef void (*vFpppipppppppppppppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef uintptr_t (*LFpppppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef void* (*pFEppuuWWWWWWwwCCCuu_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, int16_t, int16_t, uint8_t, uint8_t, uint8_t, uint32_t, uint32_t);
typedef void* (*pFippppppppppppppppp_t)(int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef void (*vFpiiiiiiiiiiiiiiiiii_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
typedef int32_t (*iFpppippppppppppppppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef void* (*pFEppuuuuuwwuuuuUUUup_t)(x86emu_t*, void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, int16_t, int16_t, uint32_t, uint32_t, uint32_t, uint32_t, uint64_t, uint64_t, uint64_t, uint32_t, void*);
typedef void* (*pFiiiippppppppppppppp_t)(int32_t, int32_t, int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef void* (*pFipppppppppppppppppppppp_t)(int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef int32_t (*iFpppppppppppppppppppppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
#if defined(NOALIGN)
typedef int64_t (*IFpi_t)(void*, int32_t);
@@ -1898,6 +1944,7 @@ void vFi(x86emu_t *emu, uintptr_t fcn) { vFi_t fn = (vFi_t)fcn; fn(*(int32_t*)(R
void vFu(x86emu_t *emu, uintptr_t fcn) { vFu_t fn = (vFu_t)fcn; fn(*(uint32_t*)(R_ESP + 4)); }
void vFf(x86emu_t *emu, uintptr_t fcn) { vFf_t fn = (vFf_t)fcn; fn(*(float*)(R_ESP + 4)); }
void vFd(x86emu_t *emu, uintptr_t fcn) { vFd_t fn = (vFd_t)fcn; fn(*(double*)(R_ESP + 4)); }
void vFl(x86emu_t *emu, uintptr_t fcn) { vFl_t fn = (vFl_t)fcn; fn(*(intptr_t*)(R_ESP + 4)); }
void vFL(x86emu_t *emu, uintptr_t fcn) { vFL_t fn = (vFL_t)fcn; fn(*(uintptr_t*)(R_ESP + 4)); }
void vFp(x86emu_t *emu, uintptr_t fcn) { vFp_t fn = (vFp_t)fcn; fn(*(void**)(R_ESP + 4)); }
void vFS(x86emu_t *emu, uintptr_t fcn) { vFS_t fn = (vFS_t)fcn; fn(io_convert(*(void**)(R_ESP + 4))); }
@@ -2103,6 +2150,7 @@ void lFll(x86emu_t *emu, uintptr_t fcn) { lFll_t fn = (lFll_t)fcn; R_EAX=(intptr
void lFpi(x86emu_t *emu, uintptr_t fcn) { lFpi_t fn = (lFpi_t)fcn; R_EAX=(intptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8)); }
void lFpp(x86emu_t *emu, uintptr_t fcn) { lFpp_t fn = (lFpp_t)fcn; R_EAX=(intptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8)); }
void LFii(x86emu_t *emu, uintptr_t fcn) { LFii_t fn = (LFii_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8)); }
void LFLi(x86emu_t *emu, uintptr_t fcn) { LFLi_t fn = (LFLi_t)fcn; R_EAX=(uintptr_t)fn(*(uintptr_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8)); }
void LFLp(x86emu_t *emu, uintptr_t fcn) { LFLp_t fn = (LFLp_t)fcn; R_EAX=(uintptr_t)fn(*(uintptr_t*)(R_ESP + 4), *(void**)(R_ESP + 8)); }
void LFpL(x86emu_t *emu, uintptr_t fcn) { LFpL_t fn = (LFpL_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uintptr_t*)(R_ESP + 8)); }
void LFpp(x86emu_t *emu, uintptr_t fcn) { LFpp_t fn = (LFpp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8)); }
@@ -2298,6 +2346,7 @@ void uFupp(x86emu_t *emu, uintptr_t fcn) { uFupp_t fn = (uFupp_t)fcn; R_EAX=(uin
void uFpii(x86emu_t *emu, uintptr_t fcn) { uFpii_t fn = (uFpii_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12)); }
void uFpiu(x86emu_t *emu, uintptr_t fcn) { uFpiu_t fn = (uFpiu_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12)); }
void uFpip(x86emu_t *emu, uintptr_t fcn) { uFpip_t fn = (uFpip_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12)); }
void uFpCi(x86emu_t *emu, uintptr_t fcn) { uFpCi_t fn = (uFpCi_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(uint8_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12)); }
void uFpui(x86emu_t *emu, uintptr_t fcn) { uFpui_t fn = (uFpui_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12)); }
void uFpuu(x86emu_t *emu, uintptr_t fcn) { uFpuu_t fn = (uFpuu_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12)); }
void uFpup(x86emu_t *emu, uintptr_t fcn) { uFpup_t fn = (uFpup_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(void**)(R_ESP + 12)); }
@@ -2325,10 +2374,12 @@ void lFlll(x86emu_t *emu, uintptr_t fcn) { lFlll_t fn = (lFlll_t)fcn; R_EAX=(int
void lFpLp(x86emu_t *emu, uintptr_t fcn) { lFpLp_t fn = (lFpLp_t)fcn; R_EAX=(intptr_t)fn(*(void**)(R_ESP + 4), *(uintptr_t*)(R_ESP + 8), *(void**)(R_ESP + 12)); }
void lFppi(x86emu_t *emu, uintptr_t fcn) { lFppi_t fn = (lFppi_t)fcn; R_EAX=(intptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12)); }
void lFppL(x86emu_t *emu, uintptr_t fcn) { lFppL_t fn = (lFppL_t)fcn; R_EAX=(intptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12)); }
void LFiii(x86emu_t *emu, uintptr_t fcn) { LFiii_t fn = (LFiii_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12)); }
void LFpii(x86emu_t *emu, uintptr_t fcn) { LFpii_t fn = (LFpii_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12)); }
void LFpLi(x86emu_t *emu, uintptr_t fcn) { LFpLi_t fn = (LFpLi_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uintptr_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12)); }
void LFpLp(x86emu_t *emu, uintptr_t fcn) { LFpLp_t fn = (LFpLp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uintptr_t*)(R_ESP + 8), *(void**)(R_ESP + 12)); }
void LFppi(x86emu_t *emu, uintptr_t fcn) { LFppi_t fn = (LFppi_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12)); }
void LFppp(x86emu_t *emu, uintptr_t fcn) { LFppp_t fn = (LFppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12)); }
void pFEip(x86emu_t *emu, uintptr_t fcn) { pFEip_t fn = (pFEip_t)fcn; R_EAX=(uintptr_t)fn(emu, *(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8)); }
void pFEup(x86emu_t *emu, uintptr_t fcn) { pFEup_t fn = (pFEup_t)fcn; R_EAX=(uintptr_t)fn(emu, *(uint32_t*)(R_ESP + 4), *(void**)(R_ESP + 8)); }
void pFEpi(x86emu_t *emu, uintptr_t fcn) { pFEpi_t fn = (pFEpi_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8)); }
@@ -2550,6 +2601,7 @@ void iFpild(x86emu_t *emu, uintptr_t fcn) { iFpild_t fn = (iFpild_t)fcn; R_EAX=f
void iFpipi(x86emu_t *emu, uintptr_t fcn) { iFpipi_t fn = (iFpipi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void iFpipC(x86emu_t *emu, uintptr_t fcn) { iFpipC_t fn = (iFpipC_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint8_t*)(R_ESP + 16)); }
void iFpipp(x86emu_t *emu, uintptr_t fcn) { iFpipp_t fn = (iFpipp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void iFpipV(x86emu_t *emu, uintptr_t fcn) { iFpipV_t fn = (iFpipV_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), (void*)(R_ESP + 16)); }
void iFpIip(x86emu_t *emu, uintptr_t fcn) { iFpIip_t fn = (iFpIip_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(int64_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void iFpCCC(x86emu_t *emu, uintptr_t fcn) { iFpCCC_t fn = (iFpCCC_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint8_t*)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint8_t*)(R_ESP + 16)); }
void iFpCpi(x86emu_t *emu, uintptr_t fcn) { iFpCpi_t fn = (iFpCpi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint8_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
@@ -2562,6 +2614,7 @@ void iFpuui(x86emu_t *emu, uintptr_t fcn) { iFpuui_t fn = (iFpuui_t)fcn; R_EAX=f
void iFpuuu(x86emu_t *emu, uintptr_t fcn) { iFpuuu_t fn = (iFpuuu_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16)); }
void iFpuup(x86emu_t *emu, uintptr_t fcn) { iFpuup_t fn = (iFpuup_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void iFpuUp(x86emu_t *emu, uintptr_t fcn) { iFpuUp_t fn = (iFpuUp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint64_t*)(R_ESP + 12), *(void**)(R_ESP + 20)); }
void iFpuLL(x86emu_t *emu, uintptr_t fcn) { iFpuLL_t fn = (iFpuLL_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(uintptr_t*)(R_ESP + 16)); }
void iFpuLp(x86emu_t *emu, uintptr_t fcn) { iFpuLp_t fn = (iFpuLp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void iFpupi(x86emu_t *emu, uintptr_t fcn) { iFpupi_t fn = (iFpupi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void iFpupu(x86emu_t *emu, uintptr_t fcn) { iFpupu_t fn = (iFpupu_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16)); }
@@ -2584,6 +2637,7 @@ void iFppuw(x86emu_t *emu, uintptr_t fcn) { iFppuw_t fn = (iFppuw_t)fcn; R_EAX=f
void iFppui(x86emu_t *emu, uintptr_t fcn) { iFppui_t fn = (iFppui_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void iFppuu(x86emu_t *emu, uintptr_t fcn) { iFppuu_t fn = (iFppuu_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16)); }
void iFppup(x86emu_t *emu, uintptr_t fcn) { iFppup_t fn = (iFppup_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void iFppdp(x86emu_t *emu, uintptr_t fcn) { iFppdp_t fn = (iFppdp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(double*)(R_ESP + 12), *(void**)(R_ESP + 20)); }
void iFppll(x86emu_t *emu, uintptr_t fcn) { iFppll_t fn = (iFppll_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(intptr_t*)(R_ESP + 12), *(intptr_t*)(R_ESP + 16)); }
void iFpplp(x86emu_t *emu, uintptr_t fcn) { iFpplp_t fn = (iFpplp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(intptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void iFppLi(x86emu_t *emu, uintptr_t fcn) { iFppLi_t fn = (iFppLi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
@@ -2661,6 +2715,7 @@ void pFiiup(x86emu_t *emu, uintptr_t fcn) { pFiiup_t fn = (pFiiup_t)fcn; R_EAX=(
void pFiipi(x86emu_t *emu, uintptr_t fcn) { pFiipi_t fn = (pFiipi_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void pFipii(x86emu_t *emu, uintptr_t fcn) { pFipii_t fn = (pFipii_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void pFipip(x86emu_t *emu, uintptr_t fcn) { pFipip_t fn = (pFipip_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void pFippi(x86emu_t *emu, uintptr_t fcn) { pFippi_t fn = (pFippi_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void pFippu(x86emu_t *emu, uintptr_t fcn) { pFippu_t fn = (pFippu_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16)); }
void pFuiii(x86emu_t *emu, uintptr_t fcn) { pFuiii_t fn = (pFuiii_t)fcn; R_EAX=(uintptr_t)fn(*(uint32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void pFffff(x86emu_t *emu, uintptr_t fcn) { pFffff_t fn = (pFffff_t)fcn; R_EAX=(uintptr_t)fn(*(float*)(R_ESP + 4), *(float*)(R_ESP + 8), *(float*)(R_ESP + 12), *(float*)(R_ESP + 16)); }
@@ -2873,6 +2928,7 @@ void iFppllp(x86emu_t *emu, uintptr_t fcn) { iFppllp_t fn = (iFppllp_t)fcn; R_EA
void iFpplpp(x86emu_t *emu, uintptr_t fcn) { iFpplpp_t fn = (iFpplpp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(intptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void iFppLwp(x86emu_t *emu, uintptr_t fcn) { iFppLwp_t fn = (iFppLwp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(int16_t*)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void iFppLip(x86emu_t *emu, uintptr_t fcn) { iFppLip_t fn = (iFppLip_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void iFppLpi(x86emu_t *emu, uintptr_t fcn) { iFppLpi_t fn = (iFppLpi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20)); }
void iFppLpL(x86emu_t *emu, uintptr_t fcn) { iFppLpL_t fn = (iFppLpL_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(uintptr_t*)(R_ESP + 20)); }
void iFpppii(x86emu_t *emu, uintptr_t fcn) { iFpppii_t fn = (iFpppii_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20)); }
void iFpppiu(x86emu_t *emu, uintptr_t fcn) { iFpppiu_t fn = (iFpppiu_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20)); }
@@ -2909,6 +2965,7 @@ void lFppiip(x86emu_t *emu, uintptr_t fcn) { lFppiip_t fn = (lFppiip_t)fcn; R_EA
void LFEpppp(x86emu_t *emu, uintptr_t fcn) { LFEpppp_t fn = (LFEpppp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void LFpuppi(x86emu_t *emu, uintptr_t fcn) { LFpuppi_t fn = (LFpuppi_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20)); }
void LFpLppp(x86emu_t *emu, uintptr_t fcn) { LFpLppp_t fn = (LFpLppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uintptr_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void LFpppii(x86emu_t *emu, uintptr_t fcn) { LFpppii_t fn = (LFpppii_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20)); }
void LFppppp(x86emu_t *emu, uintptr_t fcn) { LFppppp_t fn = (LFppppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void pFEpiii(x86emu_t *emu, uintptr_t fcn) { pFEpiii_t fn = (pFEpiii_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void pFEpipi(x86emu_t *emu, uintptr_t fcn) { pFEpipi_t fn = (pFEpipi_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
@@ -2918,8 +2975,11 @@ void pFEpupp(x86emu_t *emu, uintptr_t fcn) { pFEpupp_t fn = (pFEpupp_t)fcn; R_EA
void pFEppii(x86emu_t *emu, uintptr_t fcn) { pFEppii_t fn = (pFEppii_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void pFEppip(x86emu_t *emu, uintptr_t fcn) { pFEppip_t fn = (pFEppip_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void pFEppCC(x86emu_t *emu, uintptr_t fcn) { pFEppCC_t fn = (pFEppCC_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint8_t*)(R_ESP + 16)); }
void pFEppuW(x86emu_t *emu, uintptr_t fcn) { pFEppuW_t fn = (pFEppuW_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint16_t*)(R_ESP + 16)); }
void pFEppuu(x86emu_t *emu, uintptr_t fcn) { pFEppuu_t fn = (pFEppuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16)); }
void pFEppup(x86emu_t *emu, uintptr_t fcn) { pFEppup_t fn = (pFEppup_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void pFEpppi(x86emu_t *emu, uintptr_t fcn) { pFEpppi_t fn = (pFEpppi_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void pFEpppu(x86emu_t *emu, uintptr_t fcn) { pFEpppu_t fn = (pFEpppu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16)); }
void pFEpppp(x86emu_t *emu, uintptr_t fcn) { pFEpppp_t fn = (pFEpppp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void pFiiiii(x86emu_t *emu, uintptr_t fcn) { pFiiiii_t fn = (pFiiiii_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20)); }
void pFipipu(x86emu_t *emu, uintptr_t fcn) { pFipipu_t fn = (pFipipu_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(uint32_t*)(R_ESP + 20)); }
@@ -2934,6 +2994,7 @@ void pFpiipi(x86emu_t *emu, uintptr_t fcn) { pFpiipi_t fn = (pFpiipi_t)fcn; R_EA
void pFpiipp(x86emu_t *emu, uintptr_t fcn) { pFpiipp_t fn = (pFpiipp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void pFpiCCC(x86emu_t *emu, uintptr_t fcn) { pFpiCCC_t fn = (pFpiCCC_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint8_t*)(R_ESP + 16), *(uint8_t*)(R_ESP + 20)); }
void pFpiuuu(x86emu_t *emu, uintptr_t fcn) { pFpiuuu_t fn = (pFpiuuu_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20)); }
void pFpippi(x86emu_t *emu, uintptr_t fcn) { pFpippi_t fn = (pFpippi_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20)); }
void pFpippp(x86emu_t *emu, uintptr_t fcn) { pFpippp_t fn = (pFpippp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void pFpuiii(x86emu_t *emu, uintptr_t fcn) { pFpuiii_t fn = (pFpuiii_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20)); }
void pFpuuip(x86emu_t *emu, uintptr_t fcn) { pFpuuip_t fn = (pFpuuip_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20)); }
@@ -3031,6 +3092,7 @@ void vFppiipi(x86emu_t *emu, uintptr_t fcn) { vFppiipi_t fn = (vFppiipi_t)fcn; f
void vFppiipp(x86emu_t *emu, uintptr_t fcn) { vFppiipp_t fn = (vFppiipp_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void vFppilpp(x86emu_t *emu, uintptr_t fcn) { vFppilpp_t fn = (vFppilpp_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(intptr_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void vFppippi(x86emu_t *emu, uintptr_t fcn) { vFppippi_t fn = (vFppippi_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void vFppippp(x86emu_t *emu, uintptr_t fcn) { vFppippp_t fn = (vFppippp_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void vFppuuuu(x86emu_t *emu, uintptr_t fcn) { vFppuuuu_t fn = (vFppuuuu_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24)); }
void vFppupii(x86emu_t *emu, uintptr_t fcn) { vFppupii_t fn = (vFppupii_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void vFppuppp(x86emu_t *emu, uintptr_t fcn) { vFppuppp_t fn = (vFppuppp_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
@@ -3120,6 +3182,7 @@ void iFppdidd(x86emu_t *emu, uintptr_t fcn) { iFppdidd_t fn = (iFppdidd_t)fcn; R
void iFpplppi(x86emu_t *emu, uintptr_t fcn) { iFpplppi_t fn = (iFpplppi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(intptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void iFppLupp(x86emu_t *emu, uintptr_t fcn) { iFppLupp_t fn = (iFppLupp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void iFppLpLp(x86emu_t *emu, uintptr_t fcn) { iFppLpLp_t fn = (iFppLpLp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(uintptr_t*)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void iFppLppp(x86emu_t *emu, uintptr_t fcn) { iFppLppp_t fn = (iFppLppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void iFpppiuu(x86emu_t *emu, uintptr_t fcn) { iFpppiuu_t fn = (iFpppiuu_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24)); }
void iFpppipp(x86emu_t *emu, uintptr_t fcn) { iFpppipp_t fn = (iFpppipp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void iFpppuii(x86emu_t *emu, uintptr_t fcn) { iFpppuii_t fn = (iFpppuii_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
@@ -3148,20 +3211,25 @@ void pFEppCWp(x86emu_t *emu, uintptr_t fcn) { pFEppCWp_t fn = (pFEppCWp_t)fcn; R
void pFEppCuW(x86emu_t *emu, uintptr_t fcn) { pFEppCuW_t fn = (pFEppCuW_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint16_t*)(R_ESP + 20)); }
void pFEppCuu(x86emu_t *emu, uintptr_t fcn) { pFEppCuu_t fn = (pFEppCuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20)); }
void pFEppuWp(x86emu_t *emu, uintptr_t fcn) { pFEppuWp_t fn = (pFEppuWp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint16_t*)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void pFEppuuC(x86emu_t *emu, uintptr_t fcn) { pFEppuuC_t fn = (pFEppuuC_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint8_t*)(R_ESP + 20)); }
void pFEppuuu(x86emu_t *emu, uintptr_t fcn) { pFEppuuu_t fn = (pFEppuuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20)); }
void pFEppuup(x86emu_t *emu, uintptr_t fcn) { pFEppuup_t fn = (pFEppuup_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void pFEpppup(x86emu_t *emu, uintptr_t fcn) { pFEpppup_t fn = (pFEpppup_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void pFEppppi(x86emu_t *emu, uintptr_t fcn) { pFEppppi_t fn = (pFEppppi_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20)); }
void pFEppppp(x86emu_t *emu, uintptr_t fcn) { pFEppppp_t fn = (pFEppppp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void pFiiiiii(x86emu_t *emu, uintptr_t fcn) { pFiiiiii_t fn = (pFiiiiii_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void pFiCiiCi(x86emu_t *emu, uintptr_t fcn) { pFiCiiCi_t fn = (pFiCiiCi_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(uint8_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint8_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void pFdddddd(x86emu_t *emu, uintptr_t fcn) { pFdddddd_t fn = (pFdddddd_t)fcn; R_EAX=(uintptr_t)fn(*(double*)(R_ESP + 4), *(double*)(R_ESP + 12), *(double*)(R_ESP + 20), *(double*)(R_ESP + 28), *(double*)(R_ESP + 36), *(double*)(R_ESP + 44)); }
void pFpiiiiu(x86emu_t *emu, uintptr_t fcn) { pFpiiiiu_t fn = (pFpiiiiu_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24)); }
void pFpiiCCC(x86emu_t *emu, uintptr_t fcn) { pFpiiCCC_t fn = (pFpiiCCC_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(uint8_t*)(R_ESP + 16), *(uint8_t*)(R_ESP + 20), *(uint8_t*)(R_ESP + 24)); }
void pFpiiuuu(x86emu_t *emu, uintptr_t fcn) { pFpiiuuu_t fn = (pFpiiuuu_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24)); }
void pFpippip(x86emu_t *emu, uintptr_t fcn) { pFpippip_t fn = (pFpippip_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void pFpuuuuu(x86emu_t *emu, uintptr_t fcn) { pFpuuuuu_t fn = (pFpuuuuu_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24)); }
void pFplpppp(x86emu_t *emu, uintptr_t fcn) { pFplpppp_t fn = (pFplpppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(intptr_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void pFppiiii(x86emu_t *emu, uintptr_t fcn) { pFppiiii_t fn = (pFppiiii_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void pFppiipp(x86emu_t *emu, uintptr_t fcn) { pFppiipp_t fn = (pFppiipp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void pFppiCCC(x86emu_t *emu, uintptr_t fcn) { pFppiCCC_t fn = (pFppiCCC_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(uint8_t*)(R_ESP + 16), *(uint8_t*)(R_ESP + 20), *(uint8_t*)(R_ESP + 24)); }
void pFppippi(x86emu_t *emu, uintptr_t fcn) { pFppippi_t fn = (pFppippi_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void pFppippp(x86emu_t *emu, uintptr_t fcn) { pFppippp_t fn = (pFppippp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void pFpppiii(x86emu_t *emu, uintptr_t fcn) { pFpppiii_t fn = (pFpppiii_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void pFpppiui(x86emu_t *emu, uintptr_t fcn) { pFpppiui_t fn = (pFpppiui_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
@@ -3172,6 +3240,7 @@ void pFpppppp(x86emu_t *emu, uintptr_t fcn) { pFpppppp_t fn = (pFpppppp_t)fcn; R
void pFSpiiii(x86emu_t *emu, uintptr_t fcn) { pFSpiiii_t fn = (pFSpiiii_t)fcn; R_EAX=(uintptr_t)fn(io_convert(*(void**)(R_ESP + 4)), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void vFEpipppp(x86emu_t *emu, uintptr_t fcn) { vFEpipppp_t fn = (vFEpipppp_t)fcn; fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void vFEpuipuV(x86emu_t *emu, uintptr_t fcn) { vFEpuipuV_t fn = (vFEpuipuV_t)fcn; fn(emu, *(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), (void*)(R_ESP + 24)); }
void vFEpppppp(x86emu_t *emu, uintptr_t fcn) { vFEpppppp_t fn = (vFEpppppp_t)fcn; fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void vFiiiiiip(x86emu_t *emu, uintptr_t fcn) { vFiiiiiip_t fn = (vFiiiiiip_t)fcn; fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void vFiiiiuup(x86emu_t *emu, uintptr_t fcn) { vFiiiiuup_t fn = (vFiiiiuup_t)fcn; fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void vFiiupuip(x86emu_t *emu, uintptr_t fcn) { vFiiupuip_t fn = (vFiiupuip_t)fcn; fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
@@ -3288,10 +3357,12 @@ void iFpppiiuu(x86emu_t *emu, uintptr_t fcn) { iFpppiiuu_t fn = (iFpppiiuu_t)fcn
void iFpppiiup(x86emu_t *emu, uintptr_t fcn) { iFpppiiup_t fn = (iFpppiiup_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void iFpppiipi(x86emu_t *emu, uintptr_t fcn) { iFpppiipi_t fn = (iFpppiipi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(int32_t*)(R_ESP + 28)); }
void iFpppiuwu(x86emu_t *emu, uintptr_t fcn) { iFpppiuwu_t fn = (iFpppiuwu_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(int16_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28)); }
void iFpppippi(x86emu_t *emu, uintptr_t fcn) { iFpppippi_t fn = (iFpppippi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(int32_t*)(R_ESP + 28)); }
void iFpppippp(x86emu_t *emu, uintptr_t fcn) { iFpppippp_t fn = (iFpppippp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void iFpppuiii(x86emu_t *emu, uintptr_t fcn) { iFpppuiii_t fn = (iFpppuiii_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28)); }
void iFpppuppp(x86emu_t *emu, uintptr_t fcn) { iFpppuppp_t fn = (iFpppuppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void iFppppiii(x86emu_t *emu, uintptr_t fcn) { iFppppiii_t fn = (iFppppiii_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28)); }
void iFppppipp(x86emu_t *emu, uintptr_t fcn) { iFppppipp_t fn = (iFppppipp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void iFppppdpi(x86emu_t *emu, uintptr_t fcn) { iFppppdpi_t fn = (iFppppdpi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(double*)(R_ESP + 20), *(void**)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
void iFpppppip(x86emu_t *emu, uintptr_t fcn) { iFpppppip_t fn = (iFpppppip_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void iFpppppup(x86emu_t *emu, uintptr_t fcn) { iFpppppup_t fn = (iFpppppup_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
@@ -3314,8 +3385,10 @@ void pFifffppp(x86emu_t *emu, uintptr_t fcn) { pFifffppp_t fn = (pFifffppp_t)fcn
void pFuupupup(x86emu_t *emu, uintptr_t fcn) { pFuupupup_t fn = (pFuupupup_t)fcn; R_EAX=(uintptr_t)fn(*(uint32_t*)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void pFplppppp(x86emu_t *emu, uintptr_t fcn) { pFplppppp_t fn = (pFplppppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(intptr_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void pFppiiipp(x86emu_t *emu, uintptr_t fcn) { pFppiiipp_t fn = (pFppiiipp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void pFppiiCCC(x86emu_t *emu, uintptr_t fcn) { pFppiiCCC_t fn = (pFppiiCCC_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint8_t*)(R_ESP + 20), *(uint8_t*)(R_ESP + 24), *(uint8_t*)(R_ESP + 28)); }
void pFppiippp(x86emu_t *emu, uintptr_t fcn) { pFppiippp_t fn = (pFppiippp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void pFppipipp(x86emu_t *emu, uintptr_t fcn) { pFppipipp_t fn = (pFppipipp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void pFppuuuuu(x86emu_t *emu, uintptr_t fcn) { pFppuuuuu_t fn = (pFppuuuuu_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28)); }
void pFppuuppp(x86emu_t *emu, uintptr_t fcn) { pFppuuppp_t fn = (pFppuuppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void pFppLiiip(x86emu_t *emu, uintptr_t fcn) { pFppLiiip_t fn = (pFppLiiip_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void pFppLipip(x86emu_t *emu, uintptr_t fcn) { pFppLipip_t fn = (pFppLipip_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
@@ -3405,6 +3478,9 @@ void iFpppiippp(x86emu_t *emu, uintptr_t fcn) { iFpppiippp_t fn = (iFpppiippp_t)
void iFpppipipi(x86emu_t *emu, uintptr_t fcn) { iFpppipipi_t fn = (iFpppipipi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
void iFpppipppp(x86emu_t *emu, uintptr_t fcn) { iFpppipppp_t fn = (iFpppipppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void iFppppiipi(x86emu_t *emu, uintptr_t fcn) { iFppppiipi_t fn = (iFppppiipi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
void iFppppippp(x86emu_t *emu, uintptr_t fcn) { iFppppippp_t fn = (iFppppippp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void iFppppppii(x86emu_t *emu, uintptr_t fcn) { iFppppppii_t fn = (iFppppppii_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
void iFpppppppi(x86emu_t *emu, uintptr_t fcn) { iFpppppppi_t fn = (iFpppppppi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
void iFpppppppp(x86emu_t *emu, uintptr_t fcn) { iFpppppppp_t fn = (iFpppppppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void uFEipipppp(x86emu_t *emu, uintptr_t fcn) { uFEipipppp_t fn = (uFEipipppp_t)fcn; R_EAX=(uint32_t)fn(emu, *(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void uFEpiupppp(x86emu_t *emu, uintptr_t fcn) { uFEpiupppp_t fn = (uFEpiupppp_t)fcn; R_EAX=(uint32_t)fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28)); }
@@ -3415,6 +3491,7 @@ void LFEpiupppp(x86emu_t *emu, uintptr_t fcn) { LFEpiupppp_t fn = (LFEpiupppp_t)
void pFEppCuuCC(x86emu_t *emu, uintptr_t fcn) { pFEppCuuCC_t fn = (pFEppCuuCC_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint8_t*)(R_ESP + 24), *(uint8_t*)(R_ESP + 28)); }
void pFEppCuuWW(x86emu_t *emu, uintptr_t fcn) { pFEppCuuWW_t fn = (pFEppCuuWW_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint16_t*)(R_ESP + 24), *(uint16_t*)(R_ESP + 28)); }
void pFEppCuuup(x86emu_t *emu, uintptr_t fcn) { pFEppCuuup_t fn = (pFEppCuuup_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void pFEppuuwwu(x86emu_t *emu, uintptr_t fcn) { pFEppuuwwu_t fn = (pFEppuuwwu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int16_t*)(R_ESP + 20), *(int16_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28)); }
void pFEppuuuuu(x86emu_t *emu, uintptr_t fcn) { pFEppuuuuu_t fn = (pFEppuuuuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28)); }
void pFEppuuUUU(x86emu_t *emu, uintptr_t fcn) { pFEppuuUUU_t fn = (pFEppuuUUU_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint64_t*)(R_ESP + 20), *(uint64_t*)(R_ESP + 28), *(uint64_t*)(R_ESP + 36)); }
void pFEppLiiip(x86emu_t *emu, uintptr_t fcn) { pFEppLiiip_t fn = (pFEppLiiip_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uintptr_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
@@ -3429,6 +3506,7 @@ void pFpiiiiiuu(x86emu_t *emu, uintptr_t fcn) { pFpiiiiiuu_t fn = (pFpiiiiiuu_t)
void pFpipppppp(x86emu_t *emu, uintptr_t fcn) { pFpipppppp_t fn = (pFpipppppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void pFpWWiCpup(x86emu_t *emu, uintptr_t fcn) { pFpWWiCpup_t fn = (pFpWWiCpup_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uint16_t*)(R_ESP + 8), *(uint16_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint8_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void pFpuuuupup(x86emu_t *emu, uintptr_t fcn) { pFpuuuupup_t fn = (pFpuuuupup_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void pFpupupuuu(x86emu_t *emu, uintptr_t fcn) { pFpupupuuu_t fn = (pFpupupuuu_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32)); }
void pFpdwwWWui(x86emu_t *emu, uintptr_t fcn) { pFpdwwWWui_t fn = (pFpdwwWWui_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(double*)(R_ESP + 8), *(int16_t*)(R_ESP + 16), *(int16_t*)(R_ESP + 20), *(uint16_t*)(R_ESP + 24), *(uint16_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36)); }
void pFplpppppp(x86emu_t *emu, uintptr_t fcn) { pFplpppppp_t fn = (pFplpppppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(intptr_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void pFppiiiiii(x86emu_t *emu, uintptr_t fcn) { pFppiiiiii_t fn = (pFppiiiiii_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
@@ -3463,6 +3541,7 @@ void vFppipppiip(x86emu_t *emu, uintptr_t fcn) { vFppipppiip_t fn = (vFppipppiip
void vFppuuiiiii(x86emu_t *emu, uintptr_t fcn) { vFppuuiiiii_t fn = (vFppuuiiiii_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36)); }
void vFpplpppppi(x86emu_t *emu, uintptr_t fcn) { vFpplpppppi_t fn = (vFpplpppppi_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(intptr_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(int32_t*)(R_ESP + 36)); }
void vFpppiiiiii(x86emu_t *emu, uintptr_t fcn) { vFpppiiiiii_t fn = (vFpppiiiiii_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36)); }
void vFppppipiip(x86emu_t *emu, uintptr_t fcn) { vFppppipiip_t fn = (vFppppipiip_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void vFpppppippp(x86emu_t *emu, uintptr_t fcn) { vFpppppippp_t fn = (vFpppppippp_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void vFppppppppp(x86emu_t *emu, uintptr_t fcn) { vFppppppppp_t fn = (vFppppppppp_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void iFEiiuuuuuu(x86emu_t *emu, uintptr_t fcn) { iFEiiuuuuuu_t fn = (iFEiiuuuuuu_t)fcn; R_EAX=fn(emu, *(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32)); }
@@ -3470,6 +3549,7 @@ void iFEpiiiiipi(x86emu_t *emu, uintptr_t fcn) { iFEpiiiiipi_t fn = (iFEpiiiiipi
void iFEpuuiippu(x86emu_t *emu, uintptr_t fcn) { iFEpuuiippu_t fn = (iFEpuuiippu_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(uint32_t*)(R_ESP + 32)); }
void iFEpuuuiipp(x86emu_t *emu, uintptr_t fcn) { iFEpuuuiipp_t fn = (iFEpuuuiipp_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void iFEpppipppp(x86emu_t *emu, uintptr_t fcn) { iFEpppipppp_t fn = (iFEpppipppp_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void iFEpppppupp(x86emu_t *emu, uintptr_t fcn) { iFEpppppupp_t fn = (iFEpppppupp_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void iFiiiiiiiip(x86emu_t *emu, uintptr_t fcn) { iFiiiiiiiip_t fn = (iFiiiiiiiip_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void iFiiiipiiip(x86emu_t *emu, uintptr_t fcn) { iFiiiipiiip_t fn = (iFiiiipiiip_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void iFipiipippi(x86emu_t *emu, uintptr_t fcn) { iFipiipippi_t fn = (iFipiipippi_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(int32_t*)(R_ESP + 36)); }
@@ -3493,9 +3573,11 @@ void uFppppppppp(x86emu_t *emu, uintptr_t fcn) { uFppppppppp_t fn = (uFppppppppp
void LFEppppppii(x86emu_t *emu, uintptr_t fcn) { LFEppppppii_t fn = (LFEppppppii_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
void pFEppiiuuui(x86emu_t *emu, uintptr_t fcn) { pFEppiiuuui_t fn = (pFEppiiuuui_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
void pFEppCuwwWW(x86emu_t *emu, uintptr_t fcn) { pFEppCuwwWW_t fn = (pFEppCuwwWW_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int16_t*)(R_ESP + 20), *(int16_t*)(R_ESP + 24), *(uint16_t*)(R_ESP + 28), *(uint16_t*)(R_ESP + 32)); }
void pFEppCuWCCC(x86emu_t *emu, uintptr_t fcn) { pFEppCuWCCC_t fn = (pFEppCuWCCC_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint16_t*)(R_ESP + 20), *(uint8_t*)(R_ESP + 24), *(uint8_t*)(R_ESP + 28), *(uint8_t*)(R_ESP + 32)); }
void pFEppCuuwwp(x86emu_t *emu, uintptr_t fcn) { pFEppCuuwwp_t fn = (pFEppCuuwwp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(int16_t*)(R_ESP + 24), *(int16_t*)(R_ESP + 28), *(void**)(R_ESP + 32)); }
void pFEppCuuuuu(x86emu_t *emu, uintptr_t fcn) { pFEppCuuuuu_t fn = (pFEppCuuuuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32)); }
void pFEppuippuu(x86emu_t *emu, uintptr_t fcn) { pFEppuippuu_t fn = (pFEppuippuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32)); }
void pFEppuuuwwu(x86emu_t *emu, uintptr_t fcn) { pFEppuuuwwu_t fn = (pFEppuuuwwu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(int16_t*)(R_ESP + 24), *(int16_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32)); }
void pFEppuupwwC(x86emu_t *emu, uintptr_t fcn) { pFEppuupwwC_t fn = (pFEppuupwwC_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(int16_t*)(R_ESP + 24), *(int16_t*)(R_ESP + 28), *(uint8_t*)(R_ESP + 32)); }
void pFEpppppiiV(x86emu_t *emu, uintptr_t fcn) { pFEpppppiiV_t fn = (pFEpppppiiV_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), (void*)(R_ESP + 32)); }
void pFEpppppppi(x86emu_t *emu, uintptr_t fcn) { pFEpppppppi_t fn = (pFEpppppppi_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(int32_t*)(R_ESP + 32)); }
@@ -3507,6 +3589,7 @@ void pFppiiuuuuu(x86emu_t *emu, uintptr_t fcn) { pFppiiuuuuu_t fn = (pFppiiuuuuu
void pFppipppppp(x86emu_t *emu, uintptr_t fcn) { pFppipppppp_t fn = (pFppipppppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void pFpppiiiiii(x86emu_t *emu, uintptr_t fcn) { pFpppiiiiii_t fn = (pFpppiiiiii_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36)); }
void pFpppiipppp(x86emu_t *emu, uintptr_t fcn) { pFpppiipppp_t fn = (pFpppiipppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void pFpppppiipp(x86emu_t *emu, uintptr_t fcn) { pFpppppiipp_t fn = (pFpppppiipp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void vFEiippppppp(x86emu_t *emu, uintptr_t fcn) { vFEiippppppp_t fn = (vFEiippppppp_t)fcn; fn(emu, *(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void vFEpippppppp(x86emu_t *emu, uintptr_t fcn) { vFEpippppppp_t fn = (vFEpippppppp_t)fcn; fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void vFEpppiipppp(x86emu_t *emu, uintptr_t fcn) { vFEpppiipppp_t fn = (vFEpppiipppp_t)fcn; fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
@@ -3542,6 +3625,7 @@ void iFEpuuuuiipp(x86emu_t *emu, uintptr_t fcn) { iFEpuuuuiipp_t fn = (iFEpuuuui
void iFiiiiiiiiip(x86emu_t *emu, uintptr_t fcn) { iFiiiiiiiiip_t fn = (iFiiiiiiiiip_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36), *(void**)(R_ESP + 40)); }
void iFpuipuppppp(x86emu_t *emu, uintptr_t fcn) { iFpuipuppppp_t fn = (iFpuipuppppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40)); }
void iFpuupiuiipp(x86emu_t *emu, uintptr_t fcn) { iFpuupiuiipp_t fn = (iFpuupiuiipp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40)); }
void iFppipiippii(x86emu_t *emu, uintptr_t fcn) { iFppipiippii_t fn = (iFppipiippii_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(int32_t*)(R_ESP + 36), *(int32_t*)(R_ESP + 40)); }
void iFppuuiiiiii(x86emu_t *emu, uintptr_t fcn) { iFppuuiiiiii_t fn = (iFppuuiiiiii_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36), *(int32_t*)(R_ESP + 40)); }
void iFppuuiiuupi(x86emu_t *emu, uintptr_t fcn) { iFppuuiiuupi_t fn = (iFppuuiiuupi_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32), *(void**)(R_ESP + 36), *(int32_t*)(R_ESP + 40)); }
void iFpppLLipppp(x86emu_t *emu, uintptr_t fcn) { iFpppLLipppp_t fn = (iFpppLLipppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(uintptr_t*)(R_ESP + 16), *(uintptr_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40)); }
@@ -3550,8 +3634,10 @@ void uFpppppppppp(x86emu_t *emu, uintptr_t fcn) { uFpppppppppp_t fn = (uFppppppp
void pFEiippppppp(x86emu_t *emu, uintptr_t fcn) { pFEiippppppp_t fn = (pFEiippppppp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void pFEpiiiiiipp(x86emu_t *emu, uintptr_t fcn) { pFEpiiiiiipp_t fn = (pFEpiiiiiipp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void pFEpippppppp(x86emu_t *emu, uintptr_t fcn) { pFEpippppppp_t fn = (pFEpippppppp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void pFEppCCuuwwC(x86emu_t *emu, uintptr_t fcn) { pFEppCCuuwwC_t fn = (pFEppCCuuwwC_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint8_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(int16_t*)(R_ESP + 28), *(int16_t*)(R_ESP + 32), *(uint8_t*)(R_ESP + 36)); }
void pFEppCuwwWWu(x86emu_t *emu, uintptr_t fcn) { pFEppCuwwWWu_t fn = (pFEppCuwwWWu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(int16_t*)(R_ESP + 20), *(int16_t*)(R_ESP + 24), *(uint16_t*)(R_ESP + 28), *(uint16_t*)(R_ESP + 32), *(uint32_t*)(R_ESP + 36)); }
void pFEppCuuuCup(x86emu_t *emu, uintptr_t fcn) { pFEppCuuuCup_t fn = (pFEppCuuuCup_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint8_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32), *(void**)(R_ESP + 36)); }
void pFEppuuWWCuu(x86emu_t *emu, uintptr_t fcn) { pFEppuuWWCuu_t fn = (pFEppuuWWCuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint16_t*)(R_ESP + 20), *(uint16_t*)(R_ESP + 24), *(uint8_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32), *(uint32_t*)(R_ESP + 36)); }
void pFplllllllll(x86emu_t *emu, uintptr_t fcn) { pFplllllllll_t fn = (pFplllllllll_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(intptr_t*)(R_ESP + 8), *(intptr_t*)(R_ESP + 12), *(intptr_t*)(R_ESP + 16), *(intptr_t*)(R_ESP + 20), *(intptr_t*)(R_ESP + 24), *(intptr_t*)(R_ESP + 28), *(intptr_t*)(R_ESP + 32), *(intptr_t*)(R_ESP + 36), *(intptr_t*)(R_ESP + 40)); }
void pFppuiipuuii(x86emu_t *emu, uintptr_t fcn) { pFppuiipuuii_t fn = (pFppuiipuuii_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36), *(int32_t*)(R_ESP + 40)); }
void vFEpiiiupupup(x86emu_t *emu, uintptr_t fcn) { vFEpiiiupupup_t fn = (vFEpiiiupupup_t)fcn; fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(void**)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(void**)(R_ESP + 32), *(uint32_t*)(R_ESP + 36), *(void**)(R_ESP + 40)); }
@@ -3583,6 +3669,7 @@ void iFEpppipppppp(x86emu_t *emu, uintptr_t fcn) { iFEpppipppppp_t fn = (iFEpppi
void iFEppppiiiiuu(x86emu_t *emu, uintptr_t fcn) { iFEppppiiiiuu_t fn = (iFEppppiiiiuu_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(uint32_t*)(R_ESP + 36), *(uint32_t*)(R_ESP + 40)); }
void iFiiiiiiiiiip(x86emu_t *emu, uintptr_t fcn) { iFiiiiiiiiiip_t fn = (iFiiiiiiiiiip_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36), *(int32_t*)(R_ESP + 40), *(void**)(R_ESP + 44)); }
void iFpipllippppp(x86emu_t *emu, uintptr_t fcn) { iFpipllippppp_t fn = (iFpipllippppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(intptr_t*)(R_ESP + 16), *(intptr_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44)); }
void iFppippipppip(x86emu_t *emu, uintptr_t fcn) { iFppippipppip_t fn = (iFppippipppip_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(int32_t*)(R_ESP + 40), *(void**)(R_ESP + 44)); }
void iFppppiiuuiiu(x86emu_t *emu, uintptr_t fcn) { iFppppiiuuiiu_t fn = (iFppppiiuuiiu_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36), *(int32_t*)(R_ESP + 40), *(uint32_t*)(R_ESP + 44)); }
void uFEpiiupppiuV(x86emu_t *emu, uintptr_t fcn) { uFEpiiupppiuV_t fn = (uFEpiiupppiuV_t)fcn; R_EAX=(uint32_t)fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(uint32_t*)(R_ESP + 36), (void*)(R_ESP + 40)); }
void uFEpiippppiup(x86emu_t *emu, uintptr_t fcn) { uFEpiippppiup_t fn = (uFEpiippppiup_t)fcn; R_EAX=(uint32_t)fn(emu, *(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(uint32_t*)(R_ESP + 36), *(void**)(R_ESP + 40)); }
@@ -3613,6 +3700,8 @@ void iFpppllipppppp(x86emu_t *emu, uintptr_t fcn) { iFpppllipppppp_t fn = (iFppp
void iFpppppppppppp(x86emu_t *emu, uintptr_t fcn) { iFpppppppppppp_t fn = (iFpppppppppppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48)); }
void lFpLpppppppppp(x86emu_t *emu, uintptr_t fcn) { lFpLpppppppppp_t fn = (lFpLpppppppppp_t)fcn; R_EAX=(intptr_t)fn(*(void**)(R_ESP + 4), *(uintptr_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48)); }
void pFEppiiuuuipii(x86emu_t *emu, uintptr_t fcn) { pFEppiiuuuipii_t fn = (pFEppiiuuuipii_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(void**)(R_ESP + 36), *(int32_t*)(R_ESP + 40), *(int32_t*)(R_ESP + 44)); }
void pFEppCuWCCuuCW(x86emu_t *emu, uintptr_t fcn) { pFEppCuWCCuuCW_t fn = (pFEppCuWCCuuCW_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint8_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint16_t*)(R_ESP + 20), *(uint8_t*)(R_ESP + 24), *(uint8_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32), *(uint32_t*)(R_ESP + 36), *(uint8_t*)(R_ESP + 40), *(uint16_t*)(R_ESP + 44)); }
void pFEppuwwWWuCuu(x86emu_t *emu, uintptr_t fcn) { pFEppuwwWWuCuu_t fn = (pFEppuwwWWuCuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int16_t*)(R_ESP + 16), *(int16_t*)(R_ESP + 20), *(uint16_t*)(R_ESP + 24), *(uint16_t*)(R_ESP + 28), *(uint32_t*)(R_ESP + 32), *(uint8_t*)(R_ESP + 36), *(uint32_t*)(R_ESP + 40), *(uint32_t*)(R_ESP + 44)); }
void pFEppuuuwwwwWW(x86emu_t *emu, uintptr_t fcn) { pFEppuuuwwwwWW_t fn = (pFEppuuuwwwwWW_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(int16_t*)(R_ESP + 24), *(int16_t*)(R_ESP + 28), *(int16_t*)(R_ESP + 32), *(int16_t*)(R_ESP + 36), *(uint16_t*)(R_ESP + 40), *(uint16_t*)(R_ESP + 44)); }
void pFEppuuuWWWCCi(x86emu_t *emu, uintptr_t fcn) { pFEppuuuWWWCCi_t fn = (pFEppuuuWWWCCi_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint16_t*)(R_ESP + 24), *(uint16_t*)(R_ESP + 28), *(uint16_t*)(R_ESP + 32), *(uint8_t*)(R_ESP + 36), *(uint8_t*)(R_ESP + 40), *(int32_t*)(R_ESP + 44)); }
void pFWWiCCCCiipup(x86emu_t *emu, uintptr_t fcn) { pFWWiCCCCiipup_t fn = (pFWWiCCCCiipup_t)fcn; R_EAX=(uintptr_t)fn(*(uint16_t*)(R_ESP + 4), *(uint16_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(uint8_t*)(R_ESP + 16), *(uint8_t*)(R_ESP + 20), *(uint8_t*)(R_ESP + 24), *(uint8_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36), *(void**)(R_ESP + 40), *(uint32_t*)(R_ESP + 44), *(void**)(R_ESP + 48)); }
@@ -3665,12 +3754,15 @@ void iFpppippppppppppppp(x86emu_t *emu, uintptr_t fcn) { iFpppippppppppppppp_t f
void pFppippipipipipipip(x86emu_t *emu, uintptr_t fcn) { pFppippipipipipipip_t fn = (pFppippipipipipipip_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(void**)(R_ESP + 36), *(int32_t*)(R_ESP + 40), *(void**)(R_ESP + 44), *(int32_t*)(R_ESP + 48), *(void**)(R_ESP + 52), *(int32_t*)(R_ESP + 56), *(void**)(R_ESP + 60), *(int32_t*)(R_ESP + 64), *(void**)(R_ESP + 68)); }
void vFppuiiiiipuiiiiiiii(x86emu_t *emu, uintptr_t fcn) { vFppuiiiiipuiiiiiiii_t fn = (vFppuiiiiipuiiiiiiii_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(void**)(R_ESP + 36), *(uint32_t*)(R_ESP + 40), *(int32_t*)(R_ESP + 44), *(int32_t*)(R_ESP + 48), *(int32_t*)(R_ESP + 52), *(int32_t*)(R_ESP + 56), *(int32_t*)(R_ESP + 60), *(int32_t*)(R_ESP + 64), *(int32_t*)(R_ESP + 68), *(int32_t*)(R_ESP + 72)); }
void vFpppipppppppppppppp(x86emu_t *emu, uintptr_t fcn) { vFpppipppppppppppppp_t fn = (vFpppipppppppppppppp_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48), *(void**)(R_ESP + 52), *(void**)(R_ESP + 56), *(void**)(R_ESP + 60), *(void**)(R_ESP + 64), *(void**)(R_ESP + 68), *(void**)(R_ESP + 72)); }
void LFpppppppppppppppppp(x86emu_t *emu, uintptr_t fcn) { LFpppppppppppppppppp_t fn = (LFpppppppppppppppppp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48), *(void**)(R_ESP + 52), *(void**)(R_ESP + 56), *(void**)(R_ESP + 60), *(void**)(R_ESP + 64), *(void**)(R_ESP + 68), *(void**)(R_ESP + 72)); }
void pFEppuuWWWWWWwwCCCuu(x86emu_t *emu, uintptr_t fcn) { pFEppuuWWWWWWwwCCCuu_t fn = (pFEppuuWWWWWWwwCCCuu_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint16_t*)(R_ESP + 20), *(uint16_t*)(R_ESP + 24), *(uint16_t*)(R_ESP + 28), *(uint16_t*)(R_ESP + 32), *(uint16_t*)(R_ESP + 36), *(uint16_t*)(R_ESP + 40), *(int16_t*)(R_ESP + 44), *(int16_t*)(R_ESP + 48), *(uint8_t*)(R_ESP + 52), *(uint8_t*)(R_ESP + 56), *(uint8_t*)(R_ESP + 60), *(uint32_t*)(R_ESP + 64), *(uint32_t*)(R_ESP + 68)); }
void pFippppppppppppppppp(x86emu_t *emu, uintptr_t fcn) { pFippppppppppppppppp_t fn = (pFippppppppppppppppp_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48), *(void**)(R_ESP + 52), *(void**)(R_ESP + 56), *(void**)(R_ESP + 60), *(void**)(R_ESP + 64), *(void**)(R_ESP + 68), *(void**)(R_ESP + 72)); }
void vFpiiiiiiiiiiiiiiiiii(x86emu_t *emu, uintptr_t fcn) { vFpiiiiiiiiiiiiiiiiii_t fn = (vFpiiiiiiiiiiiiiiiiii_t)fcn; fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(int32_t*)(R_ESP + 36), *(int32_t*)(R_ESP + 40), *(int32_t*)(R_ESP + 44), *(int32_t*)(R_ESP + 48), *(int32_t*)(R_ESP + 52), *(int32_t*)(R_ESP + 56), *(int32_t*)(R_ESP + 60), *(int32_t*)(R_ESP + 64), *(int32_t*)(R_ESP + 68), *(int32_t*)(R_ESP + 72), *(int32_t*)(R_ESP + 76)); }
void iFpppippppppppppppppp(x86emu_t *emu, uintptr_t fcn) { iFpppippppppppppppppp_t fn = (iFpppippppppppppppppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48), *(void**)(R_ESP + 52), *(void**)(R_ESP + 56), *(void**)(R_ESP + 60), *(void**)(R_ESP + 64), *(void**)(R_ESP + 68), *(void**)(R_ESP + 72), *(void**)(R_ESP + 76)); }
void pFEppuuuuuwwuuuuUUUup(x86emu_t *emu, uintptr_t fcn) { pFEppuuuuuwwuuuuUUUup_t fn = (pFEppuuuuuwwuuuuUUUup_t)fcn; R_EAX=(uintptr_t)fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(uint32_t*)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(uint32_t*)(R_ESP + 24), *(uint32_t*)(R_ESP + 28), *(int16_t*)(R_ESP + 32), *(int16_t*)(R_ESP + 36), *(uint32_t*)(R_ESP + 40), *(uint32_t*)(R_ESP + 44), *(uint32_t*)(R_ESP + 48), *(uint32_t*)(R_ESP + 52), *(uint64_t*)(R_ESP + 56), *(uint64_t*)(R_ESP + 64), *(uint64_t*)(R_ESP + 72), *(uint32_t*)(R_ESP + 80), *(void**)(R_ESP + 84)); }
void pFiiiippppppppppppppp(x86emu_t *emu, uintptr_t fcn) { pFiiiippppppppppppppp_t fn = (pFiiiippppppppppppppp_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48), *(void**)(R_ESP + 52), *(void**)(R_ESP + 56), *(void**)(R_ESP + 60), *(void**)(R_ESP + 64), *(void**)(R_ESP + 68), *(void**)(R_ESP + 72), *(void**)(R_ESP + 76)); }
void pFipppppppppppppppppppppp(x86emu_t *emu, uintptr_t fcn) { pFipppppppppppppppppppppp_t fn = (pFipppppppppppppppppppppp_t)fcn; R_EAX=(uintptr_t)fn(*(int32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48), *(void**)(R_ESP + 52), *(void**)(R_ESP + 56), *(void**)(R_ESP + 60), *(void**)(R_ESP + 64), *(void**)(R_ESP + 68), *(void**)(R_ESP + 72), *(void**)(R_ESP + 76), *(void**)(R_ESP + 80), *(void**)(R_ESP + 84), *(void**)(R_ESP + 88), *(void**)(R_ESP + 92)); }
void iFpppppppppppppppppppppppppppppppppp(x86emu_t *emu, uintptr_t fcn) { iFpppppppppppppppppppppppppppppppppp_t fn = (iFpppppppppppppppppppppppppppppppppp_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48), *(void**)(R_ESP + 52), *(void**)(R_ESP + 56), *(void**)(R_ESP + 60), *(void**)(R_ESP + 64), *(void**)(R_ESP + 68), *(void**)(R_ESP + 72), *(void**)(R_ESP + 76), *(void**)(R_ESP + 80), *(void**)(R_ESP + 84), *(void**)(R_ESP + 88), *(void**)(R_ESP + 92), *(void**)(R_ESP + 96), *(void**)(R_ESP + 100), *(void**)(R_ESP + 104), *(void**)(R_ESP + 108), *(void**)(R_ESP + 112), *(void**)(R_ESP + 116), *(void**)(R_ESP + 120), *(void**)(R_ESP + 124), *(void**)(R_ESP + 128), *(void**)(R_ESP + 132), *(void**)(R_ESP + 136)); }
#if defined(NOALIGN)
void IFpi(x86emu_t *emu, uintptr_t fcn) { IFpi_t fn = (IFpi_t)fcn; ui64_t r; r.i=fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8)); R_EAX=r.d[0]; R_EDX=r.d[1]; }
+46
View File
@@ -35,6 +35,7 @@ void vFi(x86emu_t *emu, uintptr_t fnc);
void vFu(x86emu_t *emu, uintptr_t fnc);
void vFf(x86emu_t *emu, uintptr_t fnc);
void vFd(x86emu_t *emu, uintptr_t fnc);
void vFl(x86emu_t *emu, uintptr_t fnc);
void vFL(x86emu_t *emu, uintptr_t fnc);
void vFp(x86emu_t *emu, uintptr_t fnc);
void vFS(x86emu_t *emu, uintptr_t fnc);
@@ -240,6 +241,7 @@ void lFll(x86emu_t *emu, uintptr_t fnc);
void lFpi(x86emu_t *emu, uintptr_t fnc);
void lFpp(x86emu_t *emu, uintptr_t fnc);
void LFii(x86emu_t *emu, uintptr_t fnc);
void LFLi(x86emu_t *emu, uintptr_t fnc);
void LFLp(x86emu_t *emu, uintptr_t fnc);
void LFpL(x86emu_t *emu, uintptr_t fnc);
void LFpp(x86emu_t *emu, uintptr_t fnc);
@@ -435,6 +437,7 @@ void uFupp(x86emu_t *emu, uintptr_t fnc);
void uFpii(x86emu_t *emu, uintptr_t fnc);
void uFpiu(x86emu_t *emu, uintptr_t fnc);
void uFpip(x86emu_t *emu, uintptr_t fnc);
void uFpCi(x86emu_t *emu, uintptr_t fnc);
void uFpui(x86emu_t *emu, uintptr_t fnc);
void uFpuu(x86emu_t *emu, uintptr_t fnc);
void uFpup(x86emu_t *emu, uintptr_t fnc);
@@ -462,10 +465,12 @@ void lFlll(x86emu_t *emu, uintptr_t fnc);
void lFpLp(x86emu_t *emu, uintptr_t fnc);
void lFppi(x86emu_t *emu, uintptr_t fnc);
void lFppL(x86emu_t *emu, uintptr_t fnc);
void LFiii(x86emu_t *emu, uintptr_t fnc);
void LFpii(x86emu_t *emu, uintptr_t fnc);
void LFpLi(x86emu_t *emu, uintptr_t fnc);
void LFpLp(x86emu_t *emu, uintptr_t fnc);
void LFppi(x86emu_t *emu, uintptr_t fnc);
void LFppp(x86emu_t *emu, uintptr_t fnc);
void pFEip(x86emu_t *emu, uintptr_t fnc);
void pFEup(x86emu_t *emu, uintptr_t fnc);
void pFEpi(x86emu_t *emu, uintptr_t fnc);
@@ -687,6 +692,7 @@ void iFpild(x86emu_t *emu, uintptr_t fnc);
void iFpipi(x86emu_t *emu, uintptr_t fnc);
void iFpipC(x86emu_t *emu, uintptr_t fnc);
void iFpipp(x86emu_t *emu, uintptr_t fnc);
void iFpipV(x86emu_t *emu, uintptr_t fnc);
void iFpIip(x86emu_t *emu, uintptr_t fnc);
void iFpCCC(x86emu_t *emu, uintptr_t fnc);
void iFpCpi(x86emu_t *emu, uintptr_t fnc);
@@ -699,6 +705,7 @@ void iFpuui(x86emu_t *emu, uintptr_t fnc);
void iFpuuu(x86emu_t *emu, uintptr_t fnc);
void iFpuup(x86emu_t *emu, uintptr_t fnc);
void iFpuUp(x86emu_t *emu, uintptr_t fnc);
void iFpuLL(x86emu_t *emu, uintptr_t fnc);
void iFpuLp(x86emu_t *emu, uintptr_t fnc);
void iFpupi(x86emu_t *emu, uintptr_t fnc);
void iFpupu(x86emu_t *emu, uintptr_t fnc);
@@ -721,6 +728,7 @@ void iFppuw(x86emu_t *emu, uintptr_t fnc);
void iFppui(x86emu_t *emu, uintptr_t fnc);
void iFppuu(x86emu_t *emu, uintptr_t fnc);
void iFppup(x86emu_t *emu, uintptr_t fnc);
void iFppdp(x86emu_t *emu, uintptr_t fnc);
void iFppll(x86emu_t *emu, uintptr_t fnc);
void iFpplp(x86emu_t *emu, uintptr_t fnc);
void iFppLi(x86emu_t *emu, uintptr_t fnc);
@@ -798,6 +806,7 @@ void pFiiup(x86emu_t *emu, uintptr_t fnc);
void pFiipi(x86emu_t *emu, uintptr_t fnc);
void pFipii(x86emu_t *emu, uintptr_t fnc);
void pFipip(x86emu_t *emu, uintptr_t fnc);
void pFippi(x86emu_t *emu, uintptr_t fnc);
void pFippu(x86emu_t *emu, uintptr_t fnc);
void pFuiii(x86emu_t *emu, uintptr_t fnc);
void pFffff(x86emu_t *emu, uintptr_t fnc);
@@ -1010,6 +1019,7 @@ void iFppllp(x86emu_t *emu, uintptr_t fnc);
void iFpplpp(x86emu_t *emu, uintptr_t fnc);
void iFppLwp(x86emu_t *emu, uintptr_t fnc);
void iFppLip(x86emu_t *emu, uintptr_t fnc);
void iFppLpi(x86emu_t *emu, uintptr_t fnc);
void iFppLpL(x86emu_t *emu, uintptr_t fnc);
void iFpppii(x86emu_t *emu, uintptr_t fnc);
void iFpppiu(x86emu_t *emu, uintptr_t fnc);
@@ -1046,6 +1056,7 @@ void lFppiip(x86emu_t *emu, uintptr_t fnc);
void LFEpppp(x86emu_t *emu, uintptr_t fnc);
void LFpuppi(x86emu_t *emu, uintptr_t fnc);
void LFpLppp(x86emu_t *emu, uintptr_t fnc);
void LFpppii(x86emu_t *emu, uintptr_t fnc);
void LFppppp(x86emu_t *emu, uintptr_t fnc);
void pFEpiii(x86emu_t *emu, uintptr_t fnc);
void pFEpipi(x86emu_t *emu, uintptr_t fnc);
@@ -1055,8 +1066,11 @@ void pFEpupp(x86emu_t *emu, uintptr_t fnc);
void pFEppii(x86emu_t *emu, uintptr_t fnc);
void pFEppip(x86emu_t *emu, uintptr_t fnc);
void pFEppCC(x86emu_t *emu, uintptr_t fnc);
void pFEppuW(x86emu_t *emu, uintptr_t fnc);
void pFEppuu(x86emu_t *emu, uintptr_t fnc);
void pFEppup(x86emu_t *emu, uintptr_t fnc);
void pFEpppi(x86emu_t *emu, uintptr_t fnc);
void pFEpppu(x86emu_t *emu, uintptr_t fnc);
void pFEpppp(x86emu_t *emu, uintptr_t fnc);
void pFiiiii(x86emu_t *emu, uintptr_t fnc);
void pFipipu(x86emu_t *emu, uintptr_t fnc);
@@ -1071,6 +1085,7 @@ void pFpiipi(x86emu_t *emu, uintptr_t fnc);
void pFpiipp(x86emu_t *emu, uintptr_t fnc);
void pFpiCCC(x86emu_t *emu, uintptr_t fnc);
void pFpiuuu(x86emu_t *emu, uintptr_t fnc);
void pFpippi(x86emu_t *emu, uintptr_t fnc);
void pFpippp(x86emu_t *emu, uintptr_t fnc);
void pFpuiii(x86emu_t *emu, uintptr_t fnc);
void pFpuuip(x86emu_t *emu, uintptr_t fnc);
@@ -1168,6 +1183,7 @@ void vFppiipi(x86emu_t *emu, uintptr_t fnc);
void vFppiipp(x86emu_t *emu, uintptr_t fnc);
void vFppilpp(x86emu_t *emu, uintptr_t fnc);
void vFppippi(x86emu_t *emu, uintptr_t fnc);
void vFppippp(x86emu_t *emu, uintptr_t fnc);
void vFppuuuu(x86emu_t *emu, uintptr_t fnc);
void vFppupii(x86emu_t *emu, uintptr_t fnc);
void vFppuppp(x86emu_t *emu, uintptr_t fnc);
@@ -1257,6 +1273,7 @@ void iFppdidd(x86emu_t *emu, uintptr_t fnc);
void iFpplppi(x86emu_t *emu, uintptr_t fnc);
void iFppLupp(x86emu_t *emu, uintptr_t fnc);
void iFppLpLp(x86emu_t *emu, uintptr_t fnc);
void iFppLppp(x86emu_t *emu, uintptr_t fnc);
void iFpppiuu(x86emu_t *emu, uintptr_t fnc);
void iFpppipp(x86emu_t *emu, uintptr_t fnc);
void iFpppuii(x86emu_t *emu, uintptr_t fnc);
@@ -1285,20 +1302,25 @@ void pFEppCWp(x86emu_t *emu, uintptr_t fnc);
void pFEppCuW(x86emu_t *emu, uintptr_t fnc);
void pFEppCuu(x86emu_t *emu, uintptr_t fnc);
void pFEppuWp(x86emu_t *emu, uintptr_t fnc);
void pFEppuuC(x86emu_t *emu, uintptr_t fnc);
void pFEppuuu(x86emu_t *emu, uintptr_t fnc);
void pFEppuup(x86emu_t *emu, uintptr_t fnc);
void pFEpppup(x86emu_t *emu, uintptr_t fnc);
void pFEppppi(x86emu_t *emu, uintptr_t fnc);
void pFEppppp(x86emu_t *emu, uintptr_t fnc);
void pFiiiiii(x86emu_t *emu, uintptr_t fnc);
void pFiCiiCi(x86emu_t *emu, uintptr_t fnc);
void pFdddddd(x86emu_t *emu, uintptr_t fnc);
void pFpiiiiu(x86emu_t *emu, uintptr_t fnc);
void pFpiiCCC(x86emu_t *emu, uintptr_t fnc);
void pFpiiuuu(x86emu_t *emu, uintptr_t fnc);
void pFpippip(x86emu_t *emu, uintptr_t fnc);
void pFpuuuuu(x86emu_t *emu, uintptr_t fnc);
void pFplpppp(x86emu_t *emu, uintptr_t fnc);
void pFppiiii(x86emu_t *emu, uintptr_t fnc);
void pFppiipp(x86emu_t *emu, uintptr_t fnc);
void pFppiCCC(x86emu_t *emu, uintptr_t fnc);
void pFppippi(x86emu_t *emu, uintptr_t fnc);
void pFppippp(x86emu_t *emu, uintptr_t fnc);
void pFpppiii(x86emu_t *emu, uintptr_t fnc);
void pFpppiui(x86emu_t *emu, uintptr_t fnc);
@@ -1309,6 +1331,7 @@ void pFpppppp(x86emu_t *emu, uintptr_t fnc);
void pFSpiiii(x86emu_t *emu, uintptr_t fnc);
void vFEpipppp(x86emu_t *emu, uintptr_t fnc);
void vFEpuipuV(x86emu_t *emu, uintptr_t fnc);
void vFEpppppp(x86emu_t *emu, uintptr_t fnc);
void vFiiiiiip(x86emu_t *emu, uintptr_t fnc);
void vFiiiiuup(x86emu_t *emu, uintptr_t fnc);
void vFiiupuip(x86emu_t *emu, uintptr_t fnc);
@@ -1425,10 +1448,12 @@ void iFpppiiuu(x86emu_t *emu, uintptr_t fnc);
void iFpppiiup(x86emu_t *emu, uintptr_t fnc);
void iFpppiipi(x86emu_t *emu, uintptr_t fnc);
void iFpppiuwu(x86emu_t *emu, uintptr_t fnc);
void iFpppippi(x86emu_t *emu, uintptr_t fnc);
void iFpppippp(x86emu_t *emu, uintptr_t fnc);
void iFpppuiii(x86emu_t *emu, uintptr_t fnc);
void iFpppuppp(x86emu_t *emu, uintptr_t fnc);
void iFppppiii(x86emu_t *emu, uintptr_t fnc);
void iFppppipp(x86emu_t *emu, uintptr_t fnc);
void iFppppdpi(x86emu_t *emu, uintptr_t fnc);
void iFpppppip(x86emu_t *emu, uintptr_t fnc);
void iFpppppup(x86emu_t *emu, uintptr_t fnc);
@@ -1451,8 +1476,10 @@ void pFifffppp(x86emu_t *emu, uintptr_t fnc);
void pFuupupup(x86emu_t *emu, uintptr_t fnc);
void pFplppppp(x86emu_t *emu, uintptr_t fnc);
void pFppiiipp(x86emu_t *emu, uintptr_t fnc);
void pFppiiCCC(x86emu_t *emu, uintptr_t fnc);
void pFppiippp(x86emu_t *emu, uintptr_t fnc);
void pFppipipp(x86emu_t *emu, uintptr_t fnc);
void pFppuuuuu(x86emu_t *emu, uintptr_t fnc);
void pFppuuppp(x86emu_t *emu, uintptr_t fnc);
void pFppLiiip(x86emu_t *emu, uintptr_t fnc);
void pFppLipip(x86emu_t *emu, uintptr_t fnc);
@@ -1542,6 +1569,9 @@ void iFpppiippp(x86emu_t *emu, uintptr_t fnc);
void iFpppipipi(x86emu_t *emu, uintptr_t fnc);
void iFpppipppp(x86emu_t *emu, uintptr_t fnc);
void iFppppiipi(x86emu_t *emu, uintptr_t fnc);
void iFppppippp(x86emu_t *emu, uintptr_t fnc);
void iFppppppii(x86emu_t *emu, uintptr_t fnc);
void iFpppppppi(x86emu_t *emu, uintptr_t fnc);
void iFpppppppp(x86emu_t *emu, uintptr_t fnc);
void uFEipipppp(x86emu_t *emu, uintptr_t fnc);
void uFEpiupppp(x86emu_t *emu, uintptr_t fnc);
@@ -1552,6 +1582,7 @@ void LFEpiupppp(x86emu_t *emu, uintptr_t fnc);
void pFEppCuuCC(x86emu_t *emu, uintptr_t fnc);
void pFEppCuuWW(x86emu_t *emu, uintptr_t fnc);
void pFEppCuuup(x86emu_t *emu, uintptr_t fnc);
void pFEppuuwwu(x86emu_t *emu, uintptr_t fnc);
void pFEppuuuuu(x86emu_t *emu, uintptr_t fnc);
void pFEppuuUUU(x86emu_t *emu, uintptr_t fnc);
void pFEppLiiip(x86emu_t *emu, uintptr_t fnc);
@@ -1566,6 +1597,7 @@ void pFpiiiiiuu(x86emu_t *emu, uintptr_t fnc);
void pFpipppppp(x86emu_t *emu, uintptr_t fnc);
void pFpWWiCpup(x86emu_t *emu, uintptr_t fnc);
void pFpuuuupup(x86emu_t *emu, uintptr_t fnc);
void pFpupupuuu(x86emu_t *emu, uintptr_t fnc);
void pFpdwwWWui(x86emu_t *emu, uintptr_t fnc);
void pFplpppppp(x86emu_t *emu, uintptr_t fnc);
void pFppiiiiii(x86emu_t *emu, uintptr_t fnc);
@@ -1600,6 +1632,7 @@ void vFppipppiip(x86emu_t *emu, uintptr_t fnc);
void vFppuuiiiii(x86emu_t *emu, uintptr_t fnc);
void vFpplpppppi(x86emu_t *emu, uintptr_t fnc);
void vFpppiiiiii(x86emu_t *emu, uintptr_t fnc);
void vFppppipiip(x86emu_t *emu, uintptr_t fnc);
void vFpppppippp(x86emu_t *emu, uintptr_t fnc);
void vFppppppppp(x86emu_t *emu, uintptr_t fnc);
void iFEiiuuuuuu(x86emu_t *emu, uintptr_t fnc);
@@ -1607,6 +1640,7 @@ void iFEpiiiiipi(x86emu_t *emu, uintptr_t fnc);
void iFEpuuiippu(x86emu_t *emu, uintptr_t fnc);
void iFEpuuuiipp(x86emu_t *emu, uintptr_t fnc);
void iFEpppipppp(x86emu_t *emu, uintptr_t fnc);
void iFEpppppupp(x86emu_t *emu, uintptr_t fnc);
void iFiiiiiiiip(x86emu_t *emu, uintptr_t fnc);
void iFiiiipiiip(x86emu_t *emu, uintptr_t fnc);
void iFipiipippi(x86emu_t *emu, uintptr_t fnc);
@@ -1630,9 +1664,11 @@ void uFppppppppp(x86emu_t *emu, uintptr_t fnc);
void LFEppppppii(x86emu_t *emu, uintptr_t fnc);
void pFEppiiuuui(x86emu_t *emu, uintptr_t fnc);
void pFEppCuwwWW(x86emu_t *emu, uintptr_t fnc);
void pFEppCuWCCC(x86emu_t *emu, uintptr_t fnc);
void pFEppCuuwwp(x86emu_t *emu, uintptr_t fnc);
void pFEppCuuuuu(x86emu_t *emu, uintptr_t fnc);
void pFEppuippuu(x86emu_t *emu, uintptr_t fnc);
void pFEppuuuwwu(x86emu_t *emu, uintptr_t fnc);
void pFEppuupwwC(x86emu_t *emu, uintptr_t fnc);
void pFEpppppiiV(x86emu_t *emu, uintptr_t fnc);
void pFEpppppppi(x86emu_t *emu, uintptr_t fnc);
@@ -1644,6 +1680,7 @@ void pFppiiuuuuu(x86emu_t *emu, uintptr_t fnc);
void pFppipppppp(x86emu_t *emu, uintptr_t fnc);
void pFpppiiiiii(x86emu_t *emu, uintptr_t fnc);
void pFpppiipppp(x86emu_t *emu, uintptr_t fnc);
void pFpppppiipp(x86emu_t *emu, uintptr_t fnc);
void vFEiippppppp(x86emu_t *emu, uintptr_t fnc);
void vFEpippppppp(x86emu_t *emu, uintptr_t fnc);
void vFEpppiipppp(x86emu_t *emu, uintptr_t fnc);
@@ -1679,6 +1716,7 @@ void iFEpuuuuiipp(x86emu_t *emu, uintptr_t fnc);
void iFiiiiiiiiip(x86emu_t *emu, uintptr_t fnc);
void iFpuipuppppp(x86emu_t *emu, uintptr_t fnc);
void iFpuupiuiipp(x86emu_t *emu, uintptr_t fnc);
void iFppipiippii(x86emu_t *emu, uintptr_t fnc);
void iFppuuiiiiii(x86emu_t *emu, uintptr_t fnc);
void iFppuuiiuupi(x86emu_t *emu, uintptr_t fnc);
void iFpppLLipppp(x86emu_t *emu, uintptr_t fnc);
@@ -1687,8 +1725,10 @@ void uFpppppppppp(x86emu_t *emu, uintptr_t fnc);
void pFEiippppppp(x86emu_t *emu, uintptr_t fnc);
void pFEpiiiiiipp(x86emu_t *emu, uintptr_t fnc);
void pFEpippppppp(x86emu_t *emu, uintptr_t fnc);
void pFEppCCuuwwC(x86emu_t *emu, uintptr_t fnc);
void pFEppCuwwWWu(x86emu_t *emu, uintptr_t fnc);
void pFEppCuuuCup(x86emu_t *emu, uintptr_t fnc);
void pFEppuuWWCuu(x86emu_t *emu, uintptr_t fnc);
void pFplllllllll(x86emu_t *emu, uintptr_t fnc);
void pFppuiipuuii(x86emu_t *emu, uintptr_t fnc);
void vFEpiiiupupup(x86emu_t *emu, uintptr_t fnc);
@@ -1720,6 +1760,7 @@ void iFEpppipppppp(x86emu_t *emu, uintptr_t fnc);
void iFEppppiiiiuu(x86emu_t *emu, uintptr_t fnc);
void iFiiiiiiiiiip(x86emu_t *emu, uintptr_t fnc);
void iFpipllippppp(x86emu_t *emu, uintptr_t fnc);
void iFppippipppip(x86emu_t *emu, uintptr_t fnc);
void iFppppiiuuiiu(x86emu_t *emu, uintptr_t fnc);
void uFEpiiupppiuV(x86emu_t *emu, uintptr_t fnc);
void uFEpiippppiup(x86emu_t *emu, uintptr_t fnc);
@@ -1750,6 +1791,8 @@ void iFpppllipppppp(x86emu_t *emu, uintptr_t fnc);
void iFpppppppppppp(x86emu_t *emu, uintptr_t fnc);
void lFpLpppppppppp(x86emu_t *emu, uintptr_t fnc);
void pFEppiiuuuipii(x86emu_t *emu, uintptr_t fnc);
void pFEppCuWCCuuCW(x86emu_t *emu, uintptr_t fnc);
void pFEppuwwWWuCuu(x86emu_t *emu, uintptr_t fnc);
void pFEppuuuwwwwWW(x86emu_t *emu, uintptr_t fnc);
void pFEppuuuWWWCCi(x86emu_t *emu, uintptr_t fnc);
void pFWWiCCCCiipup(x86emu_t *emu, uintptr_t fnc);
@@ -1802,12 +1845,15 @@ void iFpppippppppppppppp(x86emu_t *emu, uintptr_t fnc);
void pFppippipipipipipip(x86emu_t *emu, uintptr_t fnc);
void vFppuiiiiipuiiiiiiii(x86emu_t *emu, uintptr_t fnc);
void vFpppipppppppppppppp(x86emu_t *emu, uintptr_t fnc);
void LFpppppppppppppppppp(x86emu_t *emu, uintptr_t fnc);
void pFEppuuWWWWWWwwCCCuu(x86emu_t *emu, uintptr_t fnc);
void pFippppppppppppppppp(x86emu_t *emu, uintptr_t fnc);
void vFpiiiiiiiiiiiiiiiiii(x86emu_t *emu, uintptr_t fnc);
void iFpppippppppppppppppp(x86emu_t *emu, uintptr_t fnc);
void pFEppuuuuuwwuuuuUUUup(x86emu_t *emu, uintptr_t fnc);
void pFiiiippppppppppppppp(x86emu_t *emu, uintptr_t fnc);
void pFipppppppppppppppppppppp(x86emu_t *emu, uintptr_t fnc);
void iFpppppppppppppppppppppppppppppppppp(x86emu_t *emu, uintptr_t fnc);
#if defined(NOALIGN)
void IFpi(x86emu_t *emu, uintptr_t fnc);
+5
View File
@@ -6,6 +6,7 @@
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
@@ -14,6 +15,10 @@
const char* appindicatorName = "libappindicator.so.1";
#define LIBNAME appindicator
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.needed = 2; \
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
+5
View File
@@ -6,6 +6,7 @@
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
@@ -14,4 +15,8 @@
const char* atkName = "libatk-1.0.so.0";
#define LIBNAME atk
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#include "wrappedlib_init.h"
+4 -4
View File
@@ -48,7 +48,7 @@ GO(atk_coord_type_get_type, iFv)
//GO(atk_focus_tracker_init,
//GO(atk_focus_tracker_notify,
//GO(atk_get_binary_age,
//GO(atk_get_default_registry,
GO(atk_get_default_registry, pFv)
//GO(atk_get_focus_object,
//GO(atk_get_interface_age,
//GO(atk_get_major_version,
@@ -131,10 +131,10 @@ GO(atk_object_set_role, vFpi)
//GO(atk_plug_get_type,
//GO(atk_plug_new,
//GO(atk_rectangle_get_type,
//GO(atk_registry_get_factory,
//GO(atk_registry_get_factory_type,
GO(atk_registry_get_factory, pFpi)
GO(atk_registry_get_factory_type, iFpi)
//GO(atk_registry_get_type,
//GO(atk_registry_set_factory_type,
GO(atk_registry_set_factory_type, vFpii)
//GO(atk_relation_add_target,
//GO(atk_relation_get_relation_type,
//GO(atk_relation_get_target,
+86 -37
View File
@@ -20,6 +20,7 @@
const char* bz2Name = "libbz2.so.1";
#define LIBNAME bz2
static library_t* my_lib = NULL;
typedef int (*iFp_t)(void*);
typedef int (*iFpi_t)(void*, int);
@@ -56,6 +57,79 @@ void freeBz2My(void* lib)
//bz2_my_t *my = (bz2_my_t *)lib;
}
#define SUPER() \
GO(0) \
GO(1) \
GO(2) \
GO(3) \
GO(4)
// alloc ...
#define GO(A) \
static uintptr_t my_alloc_fct_##A = 0; \
static void* my_alloc_##A(void* opaque, int m, int n) \
{ \
return (void*)RunFunction(my_context, my_alloc_fct_##A, 3, opaque, m, n); \
}
SUPER()
#undef GO
static void* find_alloc_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_alloc_fct_##A == (uintptr_t)fct) return my_alloc_##A;
SUPER()
#undef GO
#define GO(A) if(my_alloc_fct_##A == 0) {my_alloc_fct_##A = (uintptr_t)fct; return my_alloc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for bz2 alloc callback\n");
return NULL;
}
static void* reverse_alloc_Fct(void* fct)
{
if(!fct) return fct;
if(CheckBridged(my_lib->priv.w.bridge, fct))
return (void*)CheckBridged(my_lib->priv.w.bridge, fct);
#define GO(A) if(my_alloc_##A == fct) return (void*)my_alloc_fct_##A;
SUPER()
#undef GO
return (void*)AddBridge(my_lib->priv.w.bridge, my_lib->context, pFpii, fct, 0);
}
// free ...
#define GO(A) \
static uintptr_t my_free_fct_##A = 0; \
static void my_free_##A(void* opaque, void* p) \
{ \
RunFunction(my_context, my_free_fct_##A, 2, opaque, p); \
}
SUPER()
#undef GO
static void* find_free_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_free_fct_##A == (uintptr_t)fct) return my_free_##A;
SUPER()
#undef GO
#define GO(A) if(my_free_fct_##A == 0) {my_free_fct_##A = (uintptr_t)fct; return my_free_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for bz2 free callback\n");
return NULL;
}
static void* reverse_free_Fct(void* fct)
{
if(!fct) return fct;
if(CheckBridged(my_lib->priv.w.bridge, fct))
return (void*)CheckBridged(my_lib->priv.w.bridge, fct);
#define GO(A) if(my_free_##A == fct) return (void*)my_free_fct_##A;
SUPER()
#undef GO
return (void*)AddBridge(my_lib->priv.w.bridge, my_lib->context, vFpp, fct, 0);
}
#undef SUPER
typedef struct {
char *next_in;
unsigned int avail_in;
@@ -74,41 +148,14 @@ typedef struct {
void *opaque;
} my_bz_stream_t;
static void* my_bz_malloc(void* opaque, int m, int n)
{
x86emu_t* emu = (x86emu_t*)opaque;
SetCallbackArg(emu, 0, GetCallbackArg(emu, 3));
SetCallbackArg(emu, 1, (void*)m);
SetCallbackArg(emu, 2, (void*)n);
SetCallbackNArg(emu, 3);
SetCallbackAddress(emu, (uintptr_t)GetCallbackArg(emu, 4));
return (void*)RunCallback(emu);
}
static void my_bz_free(void* opaque, void* p)
{
x86emu_t* emu = (x86emu_t*)opaque;
SetCallbackArg(emu, 0, GetCallbackArg(emu, 3));
SetCallbackArg(emu, 1, p);
SetCallbackNArg(emu, 2);
SetCallbackAddress(emu, (uintptr_t)GetCallbackArg(emu, 5));
RunCallback(emu);
}
#define WRAP_BZ(A) if(A->bzalloc || A->bzfree) { \
x86emu_t* cb = AddSharedCallback(emu, 0, 0, NULL, NULL, NULL, NULL); \
SetCallbackArg(cb, 3, A->opaque); \
SetCallbackArg(cb, 4, A->bzalloc); \
SetCallbackArg(cb, 5, A->bzfree); \
if(A->bzalloc) A->bzalloc = my_bz_malloc; \
if(A->bzfree) A->bzfree = my_bz_free; \
}
#define UNWRAP_BZ(A) if(A->bzalloc || A->bzfree) { \
x86emu_t* cb = (x86emu_t*)A->opaque;\
A->opaque = GetCallbackArg(cb, 3); \
A->bzalloc = GetCallbackArg(cb, 4); \
A->bzfree = GetCallbackArg(cb, 5); \
FreeCallback(cb); \
}
#define WRAP_BZ(A) \
A->bzalloc = find_alloc_Fct(A->bzalloc); \
A->bzfree = find_free_Fct(A->bzfree);
#define UNWRAP_BZ(A) if(A->bzalloc || A->bzfree) \
A->bzalloc = reverse_alloc_Fct(A->bzalloc); \
A->bzfree = reverse_free_Fct(A->bzfree);
EXPORT int my_BZ2_bzCompressInit(x86emu_t* emu, my_bz_stream_t* strm, int blocksize, int verbosity, int work)
{
@@ -171,11 +218,13 @@ EXPORT int my_BZ2_bzDecompressEnd(x86emu_t* emu, my_bz_stream_t* strm)
}
#define CUSTOM_INIT \
lib->priv.w.p2 = getBz2My(lib);
lib->priv.w.p2 = getBz2My(lib); \
my_lib = lib;
#define CUSTOM_FINI \
freeBz2My(lib->priv.w.p2); \
free(lib->priv.w.p2);
freeBz2My(lib->priv.w.p2); \
free(lib->priv.w.p2); \
my_lib = NULL;
#include "wrappedlib_init.h"
+1
View File
@@ -6,6 +6,7 @@
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
+4 -4
View File
@@ -79,15 +79,15 @@ static int my_GetDirect3D(x86emu_t* emu, void* This, void*** ppD3D9);
#define UNPACK(...) __VA_ARGS__
#define GO(name, type, size) \
new->name = (void*)AddBridge(emu->context->system, type, real->name, size*4)
new->name = (void*)AddBridge(emu->context->system, emu->context, type, real->name, size*4)
#define GOM(name, type, size) \
my_##name##_real = (void*)real->name; \
new->name = (void*)AddBridge(emu->context->system, type, my_##name, size*4)
new->name = (void*)AddBridge(emu->context->system, emu->context, type, my_##name, size*4)
#define GO2(name, type, size) \
my_##name##_real2 = (void*)real->name; \
new->name = (void*)AddBridge(emu->context->system, type, my_##name2, size*4)
new->name = (void*)AddBridge(emu->context->system, emu->context, type, my_##name2, size*4)
#include "wrappedd3dadapter9_gen.h"
@@ -407,7 +407,7 @@ EXPORT void* my_D3DAdapter9GetProc(x86emu_t* emu, void *ptr)
my->adapter.major_version = adapter->major_version;
my->adapter.minor_version = adapter->minor_version;
my->adapter.create_adapter = (void*)AddBridge(emu->context->system, iFEip, my_create_adapter, 8);
my->adapter.create_adapter = (void*)AddBridge(emu->context->system, emu->context, iFEip, my_create_adapter, 8);
return &my->adapter;
}
+194 -194
View File
@@ -20,14 +20,7 @@
const char* dbusName = "libdbus-1.so.3";
#define LIBNAME dbus
typedef int32_t(* DBusHandleMessageFunction) (void* connection, void* message, void* user_data);
typedef void (* DBusFreeFunction) (void *memory);
typedef int32_t(* DBusAddTimeoutFunction) (void* timeout, void *data);
typedef void(* DBusRemoveTimeoutFunction) (void *timeout, void *data);
typedef void(* DBusTimeoutToggledFunction) (void *timeout, void *data);
static library_t* my_lib = NULL;
typedef void (*vFppp_t)(void*, void*, void*);
typedef void (*vFpppp_t)(void*, void*, void*, void*);
@@ -37,19 +30,21 @@ typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*);
typedef int32_t (*iFppppp_t)(void*, void*, void*, void*, void*);
typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*);
#define SUPER() \
GO(dbus_timeout_set_data, vFppp_t) \
GO(dbus_connection_set_timeout_functions, iFpppppp_t) \
GO(dbus_connection_add_filter, iFpppp_t) \
GO(dbus_connection_remove_filter, vFppp_t) \
GO(dbus_message_get_args_valist, iFppip_t) \
GO(dbus_message_set_data, iFpipp_t) \
GO(dbus_pending_call_set_notify, iFpppp_t) \
GO(dbus_pending_call_set_data, iFpipp_t) \
GO(dbus_watch_set_data, vFppp_t) \
#define SUPER() \
GO(dbus_timeout_set_data, vFppp_t) \
GO(dbus_connection_set_timeout_functions, iFpppppp_t) \
GO(dbus_connection_add_filter, iFpppp_t) \
GO(dbus_connection_remove_filter, vFppp_t) \
GO(dbus_message_get_args_valist, iFppip_t) \
GO(dbus_message_set_data, iFpipp_t) \
GO(dbus_pending_call_set_notify, iFpppp_t) \
GO(dbus_pending_call_set_data, iFpipp_t) \
GO(dbus_watch_set_data, vFppp_t) \
GO(dbus_connection_set_dispatch_status_function, vFpppp_t) \
GO(dbus_connection_set_watch_functions, iFpppppp_t) \
GO(dbus_connection_try_register_object_path, iFppppp_t)
GO(dbus_connection_try_register_object_path, iFppppp_t) \
GO(dbus_connection_set_data, iFpipp_t) \
GO(dbus_connection_set_wakeup_main_function, vFpppp_t) \
typedef struct dbus_my_s {
// functions
@@ -73,143 +68,143 @@ static void freeDBusMy(void* lib)
//dbus_my_t *my = (dbus_my_t *)lib;
}
x86emu_t* dbus_timeout_free_emu = NULL;
static void my_dbus_timout_free_cb(void* memory)
{
if(dbus_timeout_free_emu) {
SetCallbackArg(dbus_timeout_free_emu, 0, memory);
RunCallback(dbus_timeout_free_emu);
}
}
EXPORT void my_dbus_timeout_set_data(x86emu_t* emu, void* e, void* p, void* f)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
if(dbus_timeout_free_emu) FreeCallback(dbus_timeout_free_emu);
dbus_timeout_free_emu = f?AddSmallCallback(emu, (uintptr_t)f, 1, NULL, NULL, NULL, NULL):NULL;
my->dbus_timeout_set_data(e, p, f?my_dbus_timout_free_cb:NULL);
}
x86emu_t *dbus_connection_timout_add_emu = NULL;
x86emu_t *dbus_connection_timout_remove_emu = NULL;
x86emu_t *dbus_connection_timout_toggle_emu = NULL;
x86emu_t *dbus_connection_timout_free_emu = NULL;
int32_t my_dbus_connection_timout_add_cb(void* timeout, void *data)
{
if(dbus_connection_timout_add_emu) {
SetCallbackArg(dbus_connection_timout_add_emu, 0, timeout);
SetCallbackArg(dbus_connection_timout_add_emu, 1, data);
return RunCallback(dbus_connection_timout_add_emu);
}
return 0;
}
void my_dbus_connection_timout_remove_cb(void *timeout, void *data)
{
if(dbus_connection_timout_remove_emu) {
SetCallbackArg(dbus_connection_timout_remove_emu, 0, timeout);
SetCallbackArg(dbus_connection_timout_remove_emu, 1, data);
RunCallback(dbus_connection_timout_remove_emu);
}
}
void my_dbus_connection_timout_toggle_cb(void *timeout, void *data)
{
if(dbus_connection_timout_toggle_emu) {
SetCallbackArg(dbus_connection_timout_toggle_emu, 0, timeout);
SetCallbackArg(dbus_connection_timout_toggle_emu, 1, data);
RunCallback(dbus_connection_timout_toggle_emu);
}
}
void my_dbus_connection_timout_free_cb(void *memory)
{
if(dbus_connection_timout_free_emu) {
SetCallbackArg(dbus_connection_timout_free_emu, 0, memory);
RunCallback(dbus_connection_timout_free_emu);
}
}
EXPORT int32_t my_dbus_connection_set_timeout_functions(x86emu_t* emu, void* c, void* a, void* r, void* t, void* d, void* f)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
if(dbus_connection_timout_add_emu) FreeCallback(dbus_connection_timout_add_emu);
if(dbus_connection_timout_remove_emu) FreeCallback(dbus_connection_timout_remove_emu);
if(dbus_connection_timout_toggle_emu) FreeCallback(dbus_connection_timout_toggle_emu);
if(dbus_connection_timout_free_emu) FreeCallback(dbus_connection_timout_free_emu);
dbus_connection_timout_add_emu = a?AddSmallCallback(emu, (uintptr_t)a, 2, NULL, NULL, NULL, NULL):NULL;
dbus_connection_timout_remove_emu = r?AddSmallCallback(emu, (uintptr_t)r, 2, NULL, NULL, NULL, NULL):NULL;
dbus_connection_timout_toggle_emu = t?AddSmallCallback(emu, (uintptr_t)t, 2, NULL, NULL, NULL, NULL):NULL;
dbus_connection_timout_free_emu = f?AddSmallCallback(emu, (uintptr_t)f, 1, NULL, NULL, NULL, NULL):NULL;
return my->dbus_connection_set_timeout_functions(c,
a?my_dbus_connection_timout_add_cb:NULL,
r?my_dbus_connection_timout_remove_cb:NULL,
t?my_dbus_connection_timout_toggle_cb:NULL,
d, f?my_dbus_connection_timout_free_cb:NULL);
}
#define NF 4
#define SUPER() \
GO(0) \
GO(1) \
GO(2) \
GO(3)
GO(0) \
GO(1) \
GO(2) \
GO(3)
static box86context_t *context = NULL;
static uintptr_t my_filter_fnc[NF] = {0};
static uintptr_t my_filter_free[NF] = {0};
#define GO(A) \
static int32_t my_filter_handler_##A (void* connection, void* message, void* data) { \
return RunFunction(context, my_filter_fnc[A], 3, connection, message, data); \
} \
static void my_filter_free_##A (void* memory) { \
RunFunction(context, my_filter_free[A], 1, memory); \
}
SUPER()
#undef GO
static int getSetFilter(uintptr_t fnc, uintptr_t fr, void** cbfnc, void** cbfree) {
#define GO(A) if(!my_filter_fnc[A]) {my_filter_fnc[A]=fnc; my_filter_free[A]=fr; *cbfnc = my_filter_handler_##A; *cbfree = my_filter_free_##A; return A+1;}
SUPER()
#undef GO
return 0;
}
static int getFilter(uintptr_t fnc, void** cbfnc) {
#define GO(A) if(my_filter_fnc[A]==fnc) {*cbfnc = my_filter_handler_##A; return A+1;}
SUPER()
#undef GO
return 0;
}
static void freeFilter(uintptr_t fnc) {
#define GO(A) if(fnc == my_filter_fnc[A]) {my_filter_fnc[A]=0; my_filter_free[A]=0; return;}
SUPER()
#undef GO
}
// free
// DBusFreeFunction
#define GO(A) \
static uintptr_t my_free_fct_##A = 0; \
static void my_free_##A(void* data) \
{ \
RunFunction(my_context, my_free_fct_##A, 1, data);\
static uintptr_t my_DBusFreeFunction_fct_##A = 0; \
static void my_DBusFreeFunction_##A(void* p) \
{ \
RunFunction(my_context, my_DBusFreeFunction_fct_##A, 1, p); \
}
SUPER()
#undef GO
static void* findFreeFct(void* fct)
static void* find_DBusFreeFunction_Fct(void* fct)
{
if(!fct) return NULL;
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_free_fct_##A == (uintptr_t)fct) return my_free_##A;
#define GO(A) if(my_DBusFreeFunction_fct_##A == (uintptr_t)fct) return my_DBusFreeFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_free_fct_##A == 0) {my_free_fct_##A = (uintptr_t)fct; return my_free_##A; }
#define GO(A) if(my_DBusFreeFunction_fct_##A == 0) {my_DBusFreeFunction_fct_##A = (uintptr_t)fct; return my_DBusFreeFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus free callback\n");
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusFreeFunction callback\n");
return NULL;
}
// DBusHandleMessageFunction
#define GO(A) \
static uintptr_t my_DBusHandleMessageFunction_fct_##A = 0; \
static int my_DBusHandleMessageFunction_##A(void* a, void* b, void* c) \
{ \
return RunFunction(my_context, my_DBusHandleMessageFunction_fct_##A, 3, a, b, c); \
}
SUPER()
#undef GO
static void* find_DBusHandleMessageFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusHandleMessageFunction_fct_##A == (uintptr_t)fct) return my_DBusHandleMessageFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusHandleMessageFunction_fct_##A == 0) {my_DBusHandleMessageFunction_fct_##A = (uintptr_t)fct; return my_DBusHandleMessageFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusHandleMessageFunction callback\n");
return NULL;
}
// DBusAddTimeoutFunction
#define GO(A) \
static uintptr_t my_DBusAddTimeoutFunction_fct_##A = 0; \
static int my_DBusAddTimeoutFunction_##A(void* a, void* b) \
{ \
return RunFunction(my_context, my_DBusAddTimeoutFunction_fct_##A, 2, a, b); \
}
SUPER()
#undef GO
static void* find_DBusAddTimeoutFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusAddTimeoutFunction_fct_##A == (uintptr_t)fct) return my_DBusAddTimeoutFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusAddTimeoutFunction_fct_##A == 0) {my_DBusAddTimeoutFunction_fct_##A = (uintptr_t)fct; return my_DBusAddTimeoutFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusAddTimeoutFunction callback\n");
return NULL;
}
// DBusRemoveTimeoutFunction
#define GO(A) \
static uintptr_t my_DBusRemoveTimeoutFunction_fct_##A = 0; \
static void my_DBusRemoveTimeoutFunction_##A(void* a, void* b) \
{ \
RunFunction(my_context, my_DBusRemoveTimeoutFunction_fct_##A, 2, a, b); \
}
SUPER()
#undef GO
static void* find_DBusRemoveTimeoutFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusRemoveTimeoutFunction_fct_##A == (uintptr_t)fct) return my_DBusRemoveTimeoutFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusRemoveTimeoutFunction_fct_##A == 0) {my_DBusRemoveTimeoutFunction_fct_##A = (uintptr_t)fct; return my_DBusRemoveTimeoutFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusRemoveTimeoutFunction callback\n");
return NULL;
}
// DBusTimeoutToggledFunction
#define GO(A) \
static uintptr_t my_DBusTimeoutToggledFunction_fct_##A = 0; \
static void my_DBusTimeoutToggledFunction_##A(void* a, void* b) \
{ \
RunFunction(my_context, my_DBusTimeoutToggledFunction_fct_##A, 2, a, b); \
}
SUPER()
#undef GO
static void* find_DBusTimeoutToggledFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusTimeoutToggledFunction_fct_##A == (uintptr_t)fct) return my_DBusTimeoutToggledFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusTimeoutToggledFunction_fct_##A == 0) {my_DBusTimeoutToggledFunction_fct_##A = (uintptr_t)fct; return my_DBusTimeoutToggledFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusTimeoutToggledFunction callback\n");
return NULL;
}
// DBusWakeupMainFunction
#define GO(A) \
static uintptr_t my_DBusWakeupMainFunction_fct_##A = 0; \
static void my_DBusWakeupMainFunction_##A(void* a) \
{ \
RunFunction(my_context, my_DBusWakeupMainFunction_fct_##A, 1, a); \
}
SUPER()
#undef GO
static void* find_DBusWakeupMainFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusWakeupMainFunction_fct_##A == (uintptr_t)fct) return my_DBusWakeupMainFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusWakeupMainFunction_fct_##A == 0) {my_DBusWakeupMainFunction_fct_##A = (uintptr_t)fct; return my_DBusWakeupMainFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusWakeupMainFunction callback\n");
return NULL;
}
@@ -398,43 +393,39 @@ static void* finddbus_internal_padFct(void* fct)
}
#undef SUPER
EXPORT void my_dbus_timeout_set_data(x86emu_t* emu, void* e, void* p, void* f)
{
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
my->dbus_timeout_set_data(e, p, find_DBusFreeFunction_Fct(f));
}
EXPORT int32_t my_dbus_connection_set_timeout_functions(x86emu_t* emu, void* c, void* a, void* r, void* t, void* d, void* f)
{
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
return my->dbus_connection_set_timeout_functions(c,
find_DBusAddTimeoutFunction_Fct(a),
find_DBusRemoveTimeoutFunction_Fct(r),
find_DBusTimeoutToggledFunction_Fct(t),
d, find_DBusFreeFunction_Fct(f));
}
EXPORT int my_dbus_connection_add_filter(x86emu_t* emu, void* connection, void* fnc, void* data, void* fr)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
if (!context)
context = emu->context;
void* cbfnc = NULL;
void* cbfree= NULL;
if(getSetFilter((uintptr_t)fnc, (uintptr_t)fr, &cbfnc, &cbfree)) {
return my->dbus_connection_add_filter(connection, cbfnc, data, fr?cbfree:NULL);
}
printf_log(LOG_NONE, "Error: no more slot for dbus_connection_add_filter\n");
return 0;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
return my->dbus_connection_add_filter(connection, find_DBusHandleMessageFunction_Fct(fnc), data, find_DBusFreeFunction_Fct(fr));
}
EXPORT void my_dbus_connection_remove_filter(x86emu_t* emu, void* connection, void* fnc, void* data)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
if (!context)
context = emu->context;
void* cbfnc = NULL;
if(getFilter((uintptr_t)fnc, &cbfnc)) {
my->dbus_connection_remove_filter(connection, cbfnc, data);
}
freeFilter((uintptr_t)fnc);
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
my->dbus_connection_remove_filter(connection, find_DBusHandleMessageFunction_Fct(fnc), data);
}
EXPORT int my_dbus_message_get_args_valist(x86emu_t* emu, void* message, void* e, int arg, void* b)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
// need to develop this specific alignment!
#if 0 //ndef NOALIGN
@@ -448,8 +439,7 @@ EXPORT int my_dbus_message_get_args_valist(x86emu_t* emu, void* message, void* e
EXPORT int my_dbus_message_get_args(x86emu_t* emu, void* message, void* e, int arg, void* V)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
// need to develop this specific alignment!
#if 0 //ndef NOALIGN
@@ -462,50 +452,44 @@ EXPORT int my_dbus_message_get_args(x86emu_t* emu, void* message, void* e, int a
EXPORT int my_dbus_message_set_data(x86emu_t* emu, void* message, int32_t slot, void* data, void* free_func)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
return my->dbus_message_set_data(message, slot, data, findFreeFct(free_func));
return my->dbus_message_set_data(message, slot, data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT int my_dbus_pending_call_set_notify(x86emu_t* emu, void* pending, void* func, void* data, void* free_func)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
return my->dbus_pending_call_set_notify(pending, findDBusPendingCallNotifyFunctionFct(func), data, findFreeFct(free_func));
return my->dbus_pending_call_set_notify(pending, findDBusPendingCallNotifyFunctionFct(func), data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT int my_dbus_pending_call_set_data(x86emu_t* emu, void* pending, int32_t slot, void* data, void* free_func)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
return my->dbus_pending_call_set_data(pending, slot, data, findFreeFct(free_func));
return my->dbus_pending_call_set_data(pending, slot, data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT void my_dbus_watch_set_data(x86emu_t* emu, void* watch, void* data, void* free_func)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
my->dbus_watch_set_data(watch, data, findFreeFct(free_func));
my->dbus_watch_set_data(watch, data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT void my_dbus_connection_set_dispatch_status_function(x86emu_t* emu, void* connection, void* dispatch, void* data, void* free_func)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
my->dbus_connection_set_dispatch_status_function(connection, findDBusDispatchStatusFunctionFct(dispatch), data, findFreeFct(free_func));
my->dbus_connection_set_dispatch_status_function(connection, findDBusDispatchStatusFunctionFct(dispatch), data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT int my_dbus_connection_set_watch_functions(x86emu_t* emu, void* connection, void* add, void* remove, void* toggled, void* data, void* free_func)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
return my->dbus_connection_set_watch_functions(connection, findDBusAddWatchFunctionFct(add), findDBusRemoveWatchFunctionFct(remove), findDBusWatchToggledFunctionFct(toggled), data, findFreeFct(free_func));
return my->dbus_connection_set_watch_functions(connection, findDBusAddWatchFunctionFct(add), findDBusRemoveWatchFunctionFct(remove), findDBusWatchToggledFunctionFct(toggled), data, find_DBusFreeFunction_Fct(free_func));
}
typedef struct my_DBusObjectPathVTable_s
@@ -520,8 +504,7 @@ typedef struct my_DBusObjectPathVTable_s
EXPORT int my_dbus_connection_try_register_object_path(x86emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data, void* error)
{
library_t * lib = GetLibInternal(dbusName);
dbus_my_t *my = (dbus_my_t*)lib->priv.w.p2;
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
my_DBusObjectPathVTable_t vt = {0};
if(vtable) {
@@ -536,12 +519,29 @@ EXPORT int my_dbus_connection_try_register_object_path(x86emu_t* emu, void* conn
return my->dbus_connection_try_register_object_path(connection, path, vtable?&vt:NULL, data, error);
}
EXPORT int my_dbus_connection_set_data(x86emu_t* emu, void* connection, int slot, void* data, void* free_func)
{
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
return my->dbus_connection_set_data(connection, slot, data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT void my_dbus_connection_set_wakeup_main_function(x86emu_t* emu, void* connection, void* wakeup, void* data, void* free_func)
{
dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2;
my->dbus_connection_set_wakeup_main_function(connection, find_DBusWakeupMainFunction_Fct(wakeup), data, find_DBusFreeFunction_Fct(free_func));
}
#define CUSTOM_INIT \
lib->priv.w.p2 = getDBusMy(lib);
lib->priv.w.p2 = getDBusMy(lib); \
my_lib = lib;
#define CUSTOM_FINI \
freeDBusMy(lib->priv.w.p2); \
free(lib->priv.w.p2);
free(lib->priv.w.p2); \
my_lib = NULL;
#include "wrappedlib_init.h"
+14 -13
View File
@@ -64,7 +64,7 @@ GO(dbus_connection_send_with_reply, iFpppi)
GO(dbus_connection_send_with_reply_and_block, pFppip)
GO(dbus_connection_set_allow_anonymous, vFpi)
GO(dbus_connection_set_change_sigpipe, vFi)
//GO(dbus_connection_set_data,
GOM(dbus_connection_set_data, iFEpipp)
GOM(dbus_connection_set_dispatch_status_function, vFEpppp)
GO(dbus_connection_set_exit_on_disconnect, vFpi)
GO(dbus_connection_set_max_message_size, vFpl)
@@ -72,7 +72,7 @@ GO(dbus_connection_set_max_received_size, vFpl)
GO(dbus_connection_set_route_peer_messages, vFpi)
GOM(dbus_connection_set_timeout_functions, iFEpppppp)
//GO(dbus_connection_set_unix_user_function,
//GO(dbus_connection_set_wakeup_main_function,
GOM(dbus_connection_set_wakeup_main_function, vFEpppp)
GOM(dbus_connection_set_watch_functions, iFEpppppp)
//GO(dbus_connection_set_windows_user_function,
GO(dbus_connection_steal_borrowed_message, vFpp)
@@ -196,14 +196,14 @@ GO(dbus_set_error, vFpppppppppp) //vaarg
GO(dbus_set_error_const, vFppp)
GO(dbus_set_error_from_message, iFpp)
GO(dbus_shutdown, vFv)
//GO(dbus_signature_iter_get_current_type,
//GO(dbus_signature_iter_get_element_type,
//GO(dbus_signature_iter_get_signature,
//GO(dbus_signature_iter_init,
//GO(dbus_signature_iter_next,
//GO(dbus_signature_iter_recurse,
//GO(dbus_signature_validate,
//GO(dbus_signature_validate_single,
GO(dbus_signature_iter_get_current_type, iFp)
GO(dbus_signature_iter_get_element_type, iFp)
GO(dbus_signature_iter_get_signature, pFp)
GO(dbus_signature_iter_init, vFpp)
GO(dbus_signature_iter_next, iFp)
GO(dbus_signature_iter_recurse, vFpp)
GO(dbus_signature_validate, iFpp)
GO(dbus_signature_validate_single, iFpp)
//GO(dbus_threads_init,
GO(dbus_threads_init_default, iFv)
GO(dbus_timeout_get_data, pFp)
@@ -211,9 +211,10 @@ GO(dbus_timeout_get_enabled, iFp)
GO(dbus_timeout_get_interval, iFp)
GO(dbus_timeout_handle, iFp)
GOM(dbus_timeout_set_data, vFEppp)
//GO(dbus_type_is_basic,
//GO(dbus_type_is_container,
//GO(dbus_type_is_fixed,
GO(dbus_type_is_basic, iFi)
GO(dbus_type_is_container, iFi)
GO(dbus_type_is_fixed, iFi)
GO(dbus_type_is_valid, iFi)
GO(dbus_watch_get_data, pFp)
GO(dbus_watch_get_enabled, iFp)
GO(dbus_watch_get_fd, iFp)
+55 -16
View File
@@ -75,6 +75,7 @@ SUPER()
static void* findGDestroyNotifyFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GDestroyNotify_fct_##A == (uintptr_t)fct) return my_GDestroyNotify_##A;
SUPER()
#undef GO
@@ -97,6 +98,7 @@ SUPER()
static void* findGClosureNotifyFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GClosureNotify_fct_##A == (uintptr_t)fct) return my_GClosureNotify_##A;
SUPER()
#undef GO
@@ -119,6 +121,7 @@ SUPER()
static void* findDBusGProxyCallNotifyFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusGProxyCallNotify_fct_##A == (uintptr_t)fct) return my_DBusGProxyCallNotify_##A;
SUPER()
#undef GO
@@ -141,6 +144,7 @@ SUPER()
static void* findGCallbackFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GCallback_fct_##A == (uintptr_t)fct) return my_GCallback_##A;
SUPER()
#undef GO
@@ -150,36 +154,67 @@ static void* findGCallbackFct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for dbus-glib1 GCallback callback\n");
return NULL;
}
// DBusGTypeSpecializedCollectionIterator
#define GO(A) \
static uintptr_t my_DBusGTypeSpecializedCollectionIterator_fct_##A = 0; \
static void my_DBusGTypeSpecializedCollectionIterator_##A(void* a, void* b) \
{ \
RunFunction(my_context, my_DBusGTypeSpecializedCollectionIterator_fct_##A, 2, a, b); \
}
SUPER()
#undef GO
static void* findDBusGTypeSpecializedCollectionIteratorFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusGTypeSpecializedCollectionIterator_fct_##A == (uintptr_t)fct) return my_DBusGTypeSpecializedCollectionIterator_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusGTypeSpecializedCollectionIterator_fct_##A == 0) {my_DBusGTypeSpecializedCollectionIterator_fct_##A = (uintptr_t)fct; return my_DBusGTypeSpecializedCollectionIterator_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus-glib1 DBusGTypeSpecializedCollectionIterator callback\n");
return NULL;
}
// DBusGTypeSpecializedMapIterator
#define GO(A) \
static uintptr_t my_DBusGTypeSpecializedMapIterator_fct_##A = 0; \
static void my_DBusGTypeSpecializedMapIterator_##A(void* a, void* b, void* c) \
{ \
RunFunction(my_context, my_DBusGTypeSpecializedMapIterator_fct_##A, 3, a, b, c); \
}
SUPER()
#undef GO
static void* findDBusGTypeSpecializedMapIteratorFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusGTypeSpecializedMapIterator_fct_##A == (uintptr_t)fct) return my_DBusGTypeSpecializedMapIterator_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusGTypeSpecializedMapIterator_fct_##A == 0) {my_DBusGTypeSpecializedMapIterator_fct_##A = (uintptr_t)fct; return my_DBusGTypeSpecializedMapIterator_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus-glib1 DBusGTypeSpecializedCollectionIterator callback\n");
return NULL;
}
#undef SUPER
static void my_DBusGTypeSpecializedCollectionIterator(void* value, x86emu_t* emu)
{
SetCallbackArg(emu, 0, value);
RunCallback(emu);
}
EXPORT void my_dbus_g_type_collection_value_iterate(x86emu_t* emu, void* value, void* cb, void* data)
{
library_t * lib = GetLibInternal(dbusglib1Name);
dbusglib1_my_t *my = (dbusglib1_my_t*)lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)cb, 2, NULL, data, NULL, NULL);
my->dbus_g_type_collection_value_iterate(value, my_DBusGTypeSpecializedCollectionIterator, emucb);
FreeCallback(emucb);
my->dbus_g_type_collection_value_iterate(value, findDBusGTypeSpecializedCollectionIteratorFct(cb), data);
}
static void my_DBusGTypeSpecializedMapIterator(void* key_val, void* value_val, x86emu_t* emu)
{
SetCallbackArgs(emu, 2, key_val, value_val);
RunCallback(emu);
}
EXPORT void my_dbus_g_type_map_value_iterate(x86emu_t* emu, void* value, void* cb, void* data)
{
library_t * lib = GetLibInternal(dbusglib1Name);
dbusglib1_my_t *my = (dbusglib1_my_t*)lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)cb, 3, NULL, NULL, data, NULL);
my->dbus_g_type_map_value_iterate(value, my_DBusGTypeSpecializedMapIterator, emucb);
FreeCallback(emucb);
my->dbus_g_type_map_value_iterate(value, findDBusGTypeSpecializedMapIteratorFct(cb), data);
}
EXPORT void* my_dbus_g_proxy_begin_call(x86emu_t* emu, void* proxy, void* method, void* notify, void* data, void* destroy, int first, int* next)
@@ -236,6 +271,10 @@ EXPORT void my_dbus_g_proxy_disconnect_signal(x86emu_t* emu, void* proxy, void*
my->dbus_g_proxy_disconnect_signal(proxy, name, findGCallbackFct(handler), data);
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.p2 = getDBusGLib1My(lib);
+4
View File
@@ -21,5 +21,9 @@
const char* dbusmenuglibName = "libdbusmenu-glib.so.4";
#define LIBNAME dbusmenuglib
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#include "wrappedlib_init.h"
+5
View File
@@ -6,6 +6,7 @@
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
@@ -14,6 +15,10 @@
const char* dbusmenugtkName = "libdbusmenu-gtk.so.4";
#define LIBNAME dbusmenugtk
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.needed = 1; \
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
+32 -31
View File
@@ -14,11 +14,11 @@ GO(FcAtomicLock, iFp)
//GO(FcBlanksCreate,
//GO(FcBlanksDestroy,
//GO(FcBlanksIsMember,
//GO(FcCacheCopySet,
GO(FcCacheCopySet, pFp)
//GO(FcCacheDir,
//GO(FcCacheNumFont,
//GO(FcCacheNumSubdir,
//GO(FcCacheSubdir,
GO(FcCacheNumSubdir, iFp)
GO(FcCacheSubdir, pFpi)
GO(FcCharSetAddChar, iFpu)
GO(FcCharSetCopy, pFp)
//GO(FcCharSetCount,
@@ -51,7 +51,7 @@ GO(FcConfigGetBlanks, pFp)
//GO(FcConfigGetConfigDirs,
//GO(FcConfigGetConfigFiles,
GO(FcConfigGetCurrent, pFv)
//GO(FcConfigGetFontDirs,
GO(FcConfigGetFontDirs, pFp)
GO(FcConfigGetFonts, pFpi)
//GO(FcConfigGetRescanInterval,
//GO(FcConfigGetRescanInverval,
@@ -67,9 +67,9 @@ GO(FcConfigSubstitute, iFppi)
GO(FcDefaultSubstitute, vFp)
//GO(FcDirCacheLoad,
//GO(FcDirCacheLoadFile,
//GO(FcDirCacheRead,
GO(FcDirCacheRead, pFpip)
//GO(FcDirCacheUnlink,
//GO(FcDirCacheUnload,
GO(FcDirCacheUnload, vFp)
//GO(FcDirCacheValid,
//GO(FcDirSave,
//GO(FcDirScan,
@@ -164,32 +164,33 @@ GO(FcPatternGetString, iFppip)
//GO(FcPatternReference,
//GO(FcPatternRemove,
GO(FcPatternVaBuild, pFpp)
//GO(FcStrBasename,
GO(FcStrBasename, pFp)
GO(FcStrCmp, iFpp)
//GO(FcStrCmpIgnoreCase,
//GO(FcStrCopy,
//GO(FcStrCopyFilename,
//GO(FcStrDirname,
//GO(FcStrDowncase,
//GO(FcStrFree,
//GO(FcStrListCreate,
//GO(FcStrListDone,
//GO(FcStrListNext,
//GO(FcStrPlus,
//GO(FcStrSetAdd,
//GO(FcStrSetAddFilename,
//GO(FcStrSetCreate,
//GO(FcStrSetDel,
//GO(FcStrSetDestroy,
//GO(FcStrSetEqual,
//GO(FcStrSetMember,
//GO(FcStrStr,
//GO(FcStrStrIgnoreCase,
//GO(FcUcs4ToUtf8,
//GO(FcUtf16Len,
//GO(FcUtf16ToUcs4,
//GO(FcUtf8Len,
//GO(FcUtf8ToUcs4,
GO(FcStrCmpIgnoreCase, iFpp)
GO(FcStrCopy, pFp)
GO(FcStrCopyFilename, pFp)
GO(FcStrDirname, pFp)
GO(FcStrDowncase, pFp)
GO(FcStrFree, vFp)
GO(FcStrListCreate, pFp)
GO(FcStrListDone, vFp)
GO(FcStrListFirst, vFp) //2.11.0+
GO(FcStrListNext, pFp)
GO(FcStrPlus, pFpp)
GO(FcStrSetAdd, iFpp)
GO(FcStrSetAddFilename, iFpp)
GO(FcStrSetCreate, pFv)
GO(FcStrSetDel, iFpp)
GO(FcStrSetDestroy, vFp)
GO(FcStrSetEqual, iFpp)
GO(FcStrSetMember, iFpp)
GO(FcStrStr, pFpp)
GO(FcStrStrIgnoreCase, pFpp)
GO(FcUcs4ToUtf8, iFup)
GO(FcUtf16Len, iFpipp)
GO(FcUtf16ToUcs4, iFpipi)
GO(FcUtf8Len, iFpipp)
GO(FcUtf8ToUcs4, iFppi)
//GO(FcValueDestroy,
//GO(FcValueEqual,
//GO(FcValuePrint,
+4
View File
@@ -170,6 +170,10 @@ EXPORT void my3_gdk_window_remove_filter(x86emu_t* emu, void* window, void* f, v
my->gdk_window_remove_filter(window, findFilterFct(f), data);
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
libname = lib->name; \
lib->altmy = strdup("my3_"); \
+35 -11
View File
@@ -47,26 +47,50 @@ void freeGdkpixbuf2My(void* lib)
//gdkpixbuf2_my_t *my = (gdkpixbuf2_my_t *)lib;
}
static void my_destroy_pixbuf(void* pixels, void* data)
{
x86emu_t *emu = (x86emu_t*)data;
SetCallbackArg(emu, 0, pixels);
RunCallback(emu);
FreeCallback(emu);
#define SUPER() \
GO(0) \
GO(1) \
GO(2) \
GO(3)
// destroy_pixbuf
#define GO(A) \
static uintptr_t my_destroy_pixbuf_fct_##A = 0; \
static void my_destroy_pixbuf_##A(void* pixels, void* data) \
{ \
RunFunction(my_context, my_destroy_pixbuf_fct_##A, 2, pixels, data); \
}
SUPER()
#undef GO
static void* finddestroy_pixbufFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_destroy_pixbuf_fct_##A == (uintptr_t)fct) return my_destroy_pixbuf_##A;
SUPER()
#undef GO
#define GO(A) if(my_destroy_pixbuf_fct_##A == 0) {my_destroy_pixbuf_fct_##A = (uintptr_t)fct; return my_destroy_pixbuf_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gdk-pixbuf2 destroy_pixbuf callback\n");
return NULL;
}
#undef SUPER
EXPORT void* my_gdk_pixbuf_new_from_data(x86emu_t* emu, void* data, int32_t colorspace, int32_t has_alpha, int32_t bpp, int32_t w, int32_t h, int32_t stride, void* destroy_func, void* destroy_data)
{
library_t * lib = GetLibInternal(gdkpixbuf2Name);
gdkpixbuf2_my_t *my = (gdkpixbuf2_my_t*)lib->priv.w.p2;
x86emu_t *emu_cb = NULL;
if(destroy_func) {
emu_cb = AddSmallCallback(emu, (uintptr_t)destroy_func, 2, NULL, destroy_data, NULL, NULL);
}
return my->gdk_pixbuf_new_from_data(data, colorspace, has_alpha, bpp, w, h, stride, destroy_func?my_destroy_pixbuf:NULL, emu_cb);
return my->gdk_pixbuf_new_from_data(data, colorspace, has_alpha, bpp, w, h, stride, finddestroy_pixbufFct(destroy_func), destroy_data);
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.p2 = getGdkpixbuf2My(lib);
+4
View File
@@ -172,6 +172,10 @@ EXPORT void my_gdk_window_remove_filter(x86emu_t* emu, void* window, void* f, vo
my->gdk_window_remove_filter(window, findFilterFct(f), data);
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
libname = lib->name; \
lib->priv.w.p2 = getGdkX112My(lib); \
+3
View File
@@ -715,6 +715,9 @@ EXPORT uint32_t my_g_bus_own_name_on_connection(x86emu_t* emu, void* connection,
return my->g_bus_own_name_on_connection(connection, name, flags, findGBusNameAcquiredCallbackFct(name_acquired), findGBusNameLostCallbackFct(name_lost), data, findGDestroyNotifyFct(notify));
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
libname = lib->name; \
+165 -143
View File
@@ -18,6 +18,7 @@
#include "emu/x86emu_private.h"
#include "myalign.h"
#include "gtkclass.h"
#include "threads.h"
const char* glib2Name = "libglib-2.0.so.0";
#define LIBNAME glib2
@@ -101,6 +102,7 @@ typedef int (*iFpppippppppp_t)(void*, void*, void*, int, void*, void*, void*, vo
GO(g_ptr_array_new_with_free_func, pFp_t) \
GO(g_ptr_array_new_full, pFup_t) \
GO(g_ptr_array_set_free_func, vFpp_t) \
GO(g_ptr_array_sort, vFpp_t) \
GO(g_ptr_array_sort_with_data, vFppp_t) \
GO(g_ptr_array_foreach, vFppp_t) \
GO(g_qsort_with_data, vFpiLpp_t) \
@@ -111,6 +113,7 @@ typedef int (*iFpppippppppp_t)(void*, void*, void*, int, void*, void*, void*, vo
GO(g_array_sort_with_data, vFppp_t) \
GO(g_array_set_clear_func, vFpp_t) \
GO(g_source_set_callback, vFpppp_t) \
GO(g_slist_insert_sorted, pFppp_t) \
GO(g_slist_insert_sorted_with_data, pFpppp_t) \
GO(g_slist_foreach, pFppp_t) \
GO(g_slist_find_custom, pFppp_t) \
@@ -132,6 +135,7 @@ typedef int (*iFpppippppppp_t)(void*, void*, void*, int, void*, void*, void*, vo
GO(g_list_find_custom, pFppp_t) \
GO(g_timeout_add_seconds, uFupp_t) \
GO(g_timeout_add_seconds_full, uFiuppp_t) \
GO(g_log_set_handler, uFpipp_t) \
typedef struct glib2_my_s {
@@ -156,49 +160,6 @@ void freeGlib2My(void* lib)
//glib2_my_t *my = (glib2_my_t *)lib;
}
static void my_destroy_notify(void* data) // data should be arg 8
{
x86emu_t *emu = (x86emu_t*)data;
uintptr_t f = (uintptr_t)GetCallbackArg(emu, 9);
if(f) {
SetCallbackNArg(emu, 1);
SetCallbackArg(emu, 0, GetCallbackArg(emu, 8));
SetCallbackAddress(emu, f);
RunCallback(emu);
}
FreeCallback(emu);
}
x86emu_t* my_free_full_emu = NULL;
static void my_free_full_cb(void* data)
{
if(!my_free_full_emu)
return;
SetCallbackArg(my_free_full_emu, 0, data);
RunCallback(my_free_full_emu);
}
EXPORT void my_g_list_free_full(x86emu_t* emu, void* list, void* free_func)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t *old = my_free_full_emu;
my_free_full_emu = AddSharedCallback(emu, (uintptr_t)free_func, 1, NULL, NULL, NULL, NULL);
my->g_list_free_full(list, my_free_full_cb);
FreeCallback(my_free_full_emu);
my_free_full_emu = old;
}
EXPORT void* my_g_markup_printf_escaped(x86emu_t *emu, void* fmt, void* b) {
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
#ifndef NOALIGN
// need to align on arm
myStackAlign((const char*)fmt, b, emu->scratch);
return my->g_markup_vprintf_escaped(fmt, emu->scratch);
#else
// other platform don't need that
return my->g_markup_vprintf_escaped(fmt, b);
#endif
}
EXPORT void* my_g_markup_vprintf_escaped(x86emu_t *emu, void* fmt, void* b) {
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
#ifndef NOALIGN
@@ -630,6 +591,116 @@ static void* findGIOFuncFct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for glib2 GIOFunc callback\n");
return NULL;
}
// GDestroyNotify ...
#define GO(A) \
static uintptr_t my_GDestroyNotify_fct_##A = 0; \
static void my_GDestroyNotify_##A(void* a) \
{ \
RunFunction(my_context, my_GDestroyNotify_fct_##A, 1, a); \
}
SUPER()
#undef GO
static void* findGDestroyNotifyFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GDestroyNotify_fct_##A == (uintptr_t)fct) return my_GDestroyNotify_##A;
SUPER()
#undef GO
#define GO(A) if(my_GDestroyNotify_fct_##A == 0) {my_GDestroyNotify_fct_##A = (uintptr_t)fct; return my_GDestroyNotify_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for glib2 GDestroyNotify callback\n");
return NULL;
}
// GFunc ...
#define GO(A) \
static uintptr_t my_GFunc_fct_##A = 0; \
static void my_GFunc_##A(void* a, void* b) \
{ \
RunFunction(my_context, my_GFunc_fct_##A, 2, a, b); \
}
SUPER()
#undef GO
static void* findGFuncFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GFunc_fct_##A == (uintptr_t)fct) return my_GFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GFunc_fct_##A == 0) {my_GFunc_fct_##A = (uintptr_t)fct; return my_GFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for glib2 GFunc callback\n");
return NULL;
}
// GHFunc ...
#define GO(A) \
static uintptr_t my_GHFunc_fct_##A = 0; \
static void my_GHFunc_##A(void* a, void* b, void* c) \
{ \
RunFunction(my_context, my_GHFunc_fct_##A, 3, a, b, c); \
}
SUPER()
#undef GO
static void* findGHFuncFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GHFunc_fct_##A == (uintptr_t)fct) return my_GHFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GHFunc_fct_##A == 0) {my_GHFunc_fct_##A = (uintptr_t)fct; return my_GHFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for glib2 GHFunc callback\n");
return NULL;
}
// GHRFunc ...
#define GO(A) \
static uintptr_t my_GHRFunc_fct_##A = 0; \
static int my_GHRFunc_##A(void* a, void* b, void* c) \
{ \
return RunFunction(my_context, my_GHRFunc_fct_##A, 3, a, b, c); \
}
SUPER()
#undef GO
static void* findGHRFuncFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GHRFunc_fct_##A == (uintptr_t)fct) return my_GHRFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GHRFunc_fct_##A == 0) {my_GHRFunc_fct_##A = (uintptr_t)fct; return my_GHRFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for glib2 GHRFunc callback\n");
return NULL;
}
// GChildWatchFunc ...
#define GO(A) \
static uintptr_t my_GChildWatchFunc_fct_##A = 0; \
static void my_GChildWatchFunc_##A(int a, int b, void* c) \
{ \
RunFunction(my_context, my_GChildWatchFunc_fct_##A, 3, a, b, c); \
}
SUPER()
#undef GO
static void* findGChildWatchFuncFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GChildWatchFunc_fct_##A == (uintptr_t)fct) return my_GChildWatchFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GChildWatchFunc_fct_##A == 0) {my_GChildWatchFunc_fct_##A = (uintptr_t)fct; return my_GChildWatchFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for glib2 GChildWatchFunc callback\n");
return NULL;
}
// GLogFunc ...
#define GO(A) \
static uintptr_t my_GLogFunc_fct_##A = 0; \
@@ -693,6 +764,25 @@ static void* reverseGPrintFuncFct(void* fct)
#undef SUPER
EXPORT void my_g_list_free_full(x86emu_t* emu, void* list, void* free_func)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
my->g_list_free_full(list, findFreeFct(free_func));
}
EXPORT void* my_g_markup_printf_escaped(x86emu_t *emu, void* fmt, void* b) {
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
#ifndef NOALIGN
// need to align on arm
myStackAlign((const char*)fmt, b, emu->scratch);
return my->g_markup_vprintf_escaped(fmt, emu->scratch);
#else
// other platform don't need that
return my->g_markup_vprintf_escaped(fmt, b);
#endif
}
EXPORT void my_g_datalist_id_set_data_full(x86emu_t* emu, void* datalist, uint32_t key, void* data, void* freecb)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
@@ -882,7 +972,7 @@ EXPORT void* my_g_main_context_get_poll_func(x86emu_t* emu, void* context)
void* r = reversePollFct(ret);
if(r) return r;
// needs to bridge....
return (void*)AddCheckBridge(my_lib->priv.w.bridge, iFpui, ret, 0);
return (void*)AddCheckBridge(my_lib->priv.w.bridge, my_lib->context, iFpui, ret, 0);
}
EXPORT void my_g_main_context_set_poll_func(x86emu_t* emu, void* context, void* func)
@@ -918,51 +1008,30 @@ EXPORT void* my_g_hash_table_new_full(x86emu_t* emu, void* hash, void* equal, vo
return my->g_hash_table_new_full(findHashFct(hash), findEqualFct(equal), findDestroyFct(destroy_key), findDestroyFct(destroy_val));
}
static void my_ghfunc(void* key, void* value, x86emu_t* emu)
{
SetCallbackArgs(emu, 2, key, value);
RunCallback(emu);
}
EXPORT void my_g_hash_table_foreach(x86emu_t* emu, void* table, void* f, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* cb = AddSharedCallback(emu, (uintptr_t)f, 3, NULL, NULL, data, NULL);
my->g_hash_table_foreach(table, my_ghfunc, cb);
FreeCallback(cb);
my->g_hash_table_foreach(table, findGHFuncFct(f), data);
}
static int my_ghrfunc(void* key, void* value, x86emu_t* emu)
{
SetCallbackArgs(emu, 2, key, value);
return RunCallback(emu);
}
EXPORT uint32_t my_g_hash_table_foreach_remove(x86emu_t* emu, void* table, void* f, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* cb = AddSharedCallback(emu, (uintptr_t)f, 3, NULL, NULL, data, NULL);
uint32_t ret = my->g_hash_table_foreach_remove(table, my_ghrfunc, cb);
FreeCallback(cb);
return ret;
return my->g_hash_table_foreach_remove(table, findGHRFuncFct(f), data);
}
EXPORT uint32_t my_g_hash_table_foreach_steal(x86emu_t* emu, void* table, void* f, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* cb = AddSharedCallback(emu, (uintptr_t)f, 3, NULL, NULL, data, NULL);
uint32_t ret = my->g_hash_table_foreach_steal(table, my_ghrfunc, cb);
FreeCallback(cb);
return ret;
return my->g_hash_table_foreach_steal(table, findGHRFuncFct(f), data);
}
EXPORT void* my_g_hash_table_find(x86emu_t* emu, void* table, void* f, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* cb = AddSharedCallback(emu, (uintptr_t)f, 3, NULL, NULL, data, NULL);
void* ret = my->g_hash_table_find(table, my_ghrfunc, cb);
FreeCallback(cb);
return ret;
return my->g_hash_table_find(table, findGHRFuncFct(f), data);
}
EXPORT int my_g_spawn_async_with_pipes(x86emu_t* emu, void* dir, void* argv, void* envp, int flags, void* f, void* data, void* child, void* input, void* output, void* err, void* error)
@@ -986,32 +1055,18 @@ EXPORT int my_g_spawn_sync(x86emu_t* emu, void* dir, void* argv, void* envp, int
return my->g_spawn_sync(dir, argv, envp, flags, findSpawnChildSetupFct(f), data, input, output, status, error);
}
static void my_gchildwatchfunc(int pid, int status, x86emu_t* emu)
{
SetCallbackArgs(emu, 2, pid, status);
RunCallback(emu);
}
EXPORT uint32_t my_g_child_watch_add(x86emu_t* emu, int pid, void* f, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
if(!f)
return my->g_child_watch_add(pid, f, data);
x86emu_t* cb = AddCallback(emu, (uintptr_t)f, 3, NULL, NULL, data, NULL);
SetCallbackArg(cb, 9, NULL);
SetCallbackArg(cb, 8, data);
return my->g_child_watch_add_full(0, pid, my_gchildwatchfunc, cb, my_destroy_notify);
return my->g_child_watch_add(pid, findGChildWatchFuncFct(f), data);
}
EXPORT uint32_t my_g_child_watch_add_full(x86emu_t* emu, int priority, int pid, void* f, void* data, void* notify)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* cb = AddCallback(emu, (uintptr_t)f, 3, NULL, NULL, data, NULL);
SetCallbackArg(cb, 9, notify);
SetCallbackArg(cb, 8, data);
return my->g_idle_add_full(priority, f?my_gchildwatchfunc:NULL, cb, my_destroy_notify);
return my->g_idle_add_full(priority, findGChildWatchFuncFct(f), data, findGDestroyNotifyFct(notify));
}
EXPORT void* my_g_private_new(x86emu_t* emu, void* notify)
@@ -1049,105 +1104,69 @@ EXPORT void my_g_ptr_array_set_free_func(x86emu_t* emu, void* array, void* notif
my->g_ptr_array_set_free_func(array, findFreeFct(notify));
}
static int my_compare_fnc(void* a, void* b, x86emu_t* emu)
{
SetCallbackArgs(emu, 2, a, b);
return RunCallback(emu);
}
EXPORT void my_g_ptr_array_sort(x86emu_t* emu, void* array, void* comp)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 2, NULL, NULL, NULL, NULL);
my->g_ptr_array_sort_with_data(array, my_compare_fnc, emucb);
FreeCallback(emucb);
my->g_ptr_array_sort(array, findGCompareFuncFct(comp));
}
EXPORT void my_g_ptr_array_sort_with_data(x86emu_t* emu, void* array, void* comp, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 3, NULL, NULL, data, NULL);
my->g_ptr_array_sort_with_data(array, my_compare_fnc, emucb);
FreeCallback(emucb);
my->g_ptr_array_sort_with_data(array, findGCompareDataFuncFct(comp), data);
}
EXPORT void my_g_qsort_with_data(x86emu_t* emu, void* pbase, int total, unsigned long size, void* comp, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 3, NULL, NULL, data, NULL);
my->g_qsort_with_data(pbase, total, size, my_compare_fnc, emucb);
FreeCallback(emucb);
my->g_qsort_with_data(pbase, total, size, findGCompareDataFuncFct(comp), data);
}
static void my_g_foreach_fnc(void* a, x86emu_t* emu)
{
SetCallbackArg(emu, 0, a);
RunCallback(emu);
}
EXPORT void my_g_ptr_array_foreach(x86emu_t* emu, void* array, void* func, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)func, 2, NULL, data, NULL, NULL);
my->g_ptr_array_foreach(array, my_g_foreach_fnc, emucb);
FreeCallback(emucb);
my->g_ptr_array_foreach(array, findGFuncFct(func), data);
}
static void* my_g_thread_create_fnc(x86emu_t* emu)
{
void* ret = (void*)RunCallback(emu);
FreeCallback(emu); // memory leak if thread is killed...
return ret;
}
EXPORT void* my_g_thread_create(x86emu_t* emu, void* func, void* data, int joinable, void* error)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddCallback(emu, (uintptr_t)func, 1, data, NULL, NULL, NULL);
void* ret = my->g_thread_create(my_g_thread_create_fnc, emucb, joinable, error);
if(!ret)
FreeCallback(emucb);
return ret;
void* et = NULL;
return my->g_thread_create(my_prepare_thread(emu, func, data, 0, &et), et, joinable, error);
}
EXPORT void* my_g_thread_create_full(x86emu_t* emu, void* func, void* data, unsigned long stack, int joinable, int bound, int priority, void* error)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddVariableCallback(emu, stack, (uintptr_t)func, 1, data, NULL, NULL, NULL);
void* ret = my->g_thread_create_full(my_g_thread_create_fnc, emucb, stack, joinable, bound, priority, error);
if(!ret)
FreeCallback(emucb);
return ret;
void* et = NULL;
return my->g_thread_create_full(my_prepare_thread(emu, func, data, stack, &et), et, stack, joinable, bound, priority, error);
}
EXPORT void my_g_thread_foreach(x86emu_t* emu, void* func, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)func, 2, NULL, data, NULL, NULL);
my->g_thread_foreach(my_g_foreach_fnc, emucb);
FreeCallback(emucb);
my->g_thread_foreach(findGFuncFct(func), data);
}
EXPORT void my_g_array_sort(x86emu_t* emu, void* array, void* comp)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 2, NULL, NULL, NULL, NULL);
my->g_array_sort_with_data(array, my_compare_fnc, emucb);
FreeCallback(emucb);
my->g_array_sort(array, findGCompareFuncFct(comp));
}
EXPORT void my_g_array_sort_with_data(x86emu_t* emu, void* array, void* comp, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 3, NULL, NULL, data, NULL);
my->g_array_sort_with_data(array, my_compare_fnc, emucb);
FreeCallback(emucb);
my->g_array_sort_with_data(array, findGCompareDataFuncFct(comp), data);
}
EXPORT void my_g_array_set_clear_func(x86emu_t* emu, void* array, void* notify)
@@ -1168,28 +1187,20 @@ EXPORT void* my_g_slist_insert_sorted(x86emu_t* emu, void* list, void* d, void*
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 2, NULL, NULL, NULL, NULL);
void* ret = my->g_slist_insert_sorted_with_data(list, d, my_compare_fnc, emucb);
FreeCallback(emucb);
return ret;
return my->g_slist_insert_sorted(list, d, findGCompareFuncFct(comp));
}
EXPORT void* my_g_slist_insert_sorted_with_data(x86emu_t* emu, void* list, void* d, void* comp, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 3, NULL, NULL, data, NULL);
void* ret = my->g_slist_insert_sorted_with_data(list, d, my_compare_fnc, emucb);
FreeCallback(emucb);
return ret;
return my->g_slist_insert_sorted_with_data(list, d, findGCompareDataFuncFct(comp), data);
}
EXPORT void my_g_slist_foreach(x86emu_t* emu, void* list, void* func, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)func, 2, NULL, data, NULL, NULL);
my->g_slist_foreach(list, my_g_foreach_fnc, emucb);
FreeCallback(emucb);
my->g_slist_foreach(list, findGFuncFct(func), data);
}
EXPORT void* my_g_slist_find_custom(x86emu_t* emu, void* list, void* data, void* comp)
@@ -1351,6 +1362,17 @@ EXPORT uint32_t my_g_timeout_add_seconds_full(x86emu_t *emu, int priority, uint3
return my->g_timeout_add_seconds_full(priority, interval, findGSourceFuncFct(f), data, findDestroyFct(notify));
}
EXPORT uint32_t my_g_log_set_handler(x86emu_t *emu, void* domain, int level, void* f, void* data)
{
glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
return my->g_log_set_handler(domain, level, findGLogFuncFct(f), data);
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
libname = lib->name;\
+1 -1
View File
@@ -616,7 +616,7 @@ GO(g_log_remove_handler, vFpu)
GO(g_log_set_always_fatal, iFi)
GOM(g_log_set_default_handler, pFEpp)
GO(g_log_set_fatal_mask, iFpi)
//GOM(g_log_set_handler, uFpiBp)
GOM(g_log_set_handler, uFEpipp)
GO(g_logv, vFpppp) // need align?
GO(g_lstat, iFpp)
GO(g_main_context_acquire, iFp)
+5
View File
@@ -6,6 +6,7 @@
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
@@ -14,6 +15,10 @@
const char* gmodule2Name = "libgmodule-2.0.so.0";
#define LIBNAME gmodule2
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.needed = 1; \
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
+30 -14
View File
@@ -34,6 +34,7 @@ typedef void* (*pFip_t)(int, void*);
typedef void* (*pFpi_t)(void*, int);
typedef void (*vFpi_t)(void*, int);
typedef void (*vFpp_t)(void*, void*);
typedef void* (*pFpp_t)(void*, void*);
typedef void (*vFpc_t)(void*, int8_t);
typedef void (*vFpC_t)(void*, uint8_t);
typedef void (*vFiip_t)(int, int, void*);
@@ -77,6 +78,7 @@ typedef uint32_t (*uFpiiupppiuppp_t)(void*, int, int, uint32_t, void*, void*, vo
GO(g_type_add_interface_static, vFiip_t) \
GO(g_param_spec_set_qdata_full, vFpupp_t) \
GO(g_param_type_register_static, iFpp_t) \
GO(g_value_array_sort, pFpp_t) \
GO(g_value_array_sort_with_data, pFppp_t) \
GO(g_object_set_data_full, vFpppp_t) \
GO(g_type_class_peek_parent, pFp_t) \
@@ -544,7 +546,28 @@ static void* findGInterfaceFinalizeFuncFct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for gobject GInterfaceFinalizeFunc callback\n");
return NULL;
}
// compare
#define GO(A) \
static uintptr_t my_compare_fct_##A = 0; \
static int my_compare_##A(void* a, void* b, void* data) \
{ \
return RunFunction(my_context, my_compare_fct_##A, 3, a, b, data); \
}
SUPER()
#undef GO
static void* findcompareFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_compare_fct_##A == (uintptr_t)fct) return my_compare_##A;
SUPER()
#undef GO
#define GO(A) if(my_compare_fct_##A == 0) {my_compare_fct_##A = (uintptr_t)fct; return my_compare_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gobject compare callback\n");
return NULL;
}
#undef SUPER
EXPORT int my_g_boxed_type_register_static(x86emu_t* emu, void* name, void* boxed_copy, void* boxed_free)
@@ -723,29 +746,18 @@ EXPORT int my_g_param_type_register_static(x86emu_t* emu, void* name, void* pspe
return my->g_param_type_register_static(name, findFreeGParamSpecTypeInfo(pspec_info));
}
static int my_compare_fnc(void* a, void* b, x86emu_t* emu)
{
SetCallbackArgs(emu, 2, a, b);
return RunCallback(emu);
}
EXPORT void* my_g_value_array_sort(x86emu_t* emu, void* array, void* comp)
{
gobject2_my_t *my = (gobject2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 2, NULL, NULL, NULL, NULL);
void* ret = my->g_value_array_sort_with_data(array, my_compare_fnc, emucb);
FreeCallback(emucb);
return ret;
return my->g_value_array_sort(array, findcompareFct(comp));
}
EXPORT void* my_g_value_array_sort_with_data(x86emu_t* emu, void* array, void* comp, void* data)
{
gobject2_my_t *my = (gobject2_my_t*)my_lib->priv.w.p2;
x86emu_t* emucb = AddSharedCallback(emu, (uintptr_t)comp, 3, NULL, NULL, data, NULL);
void* ret = my->g_value_array_sort_with_data(array, my_compare_fnc, emucb);
FreeCallback(emucb);
return ret;
return my->g_value_array_sort_with_data(array, findcompareFct(comp), data);
}
EXPORT void my_g_object_set_data_full(x86emu_t* emu, void* object, void* key, void* data, void* notify)
@@ -819,6 +831,10 @@ EXPORT void* my_g_param_spec_get_default_value(void* spec)
return &value[cnt++];
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
InitGTKClass(lib->priv.w.bridge); \
lib->priv.w.p2 = getGobject2My(lib); \
+5
View File
@@ -6,6 +6,7 @@
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
@@ -14,6 +15,10 @@
const char* gstinterfaces010Name = "libgstinterfaces-0.10.so.0";
#define LIBNAME gstinterfaces010
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.needed = 1; \
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
+5
View File
@@ -6,6 +6,7 @@
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
@@ -14,6 +15,10 @@
const char* gstreamer010Name = "libgstreamer-0.10.so.0";
#define LIBNAME gstreamer010
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.needed = 1; \
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
+4
View File
@@ -126,6 +126,10 @@ void** my_GetGthreadsGotInitialized()
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.p2 = getGthread2My(lib);
+87 -73
View File
@@ -158,7 +158,7 @@ static void* findMenuDetachFct(void* fct)
#define GO(A) if(my_menudetach_fct_##A == 0) {my_menudetach_fct_##A = (uintptr_t)fct; return my_menudetach_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GMenuDetachFunc callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GMenuDetachFunc callback\n");
return NULL;
}
@@ -181,7 +181,7 @@ static void* findMenuPositionFct(void* fct)
#define GO(A) if(my_menuposition_fct_##A == 0) {my_menuposition_fct_##A = (uintptr_t)fct; return my_menuposition_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkMenuPositionFunc callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkMenuPositionFunc callback\n");
return NULL;
}
@@ -204,7 +204,7 @@ static void* findGtkFunctionFct(void* fct)
#define GO(A) if(my3_gtkfunction_fct_##A == 0) {my3_gtkfunction_fct_##A = (uintptr_t)fct; return my3_gtkfunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkFunction callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkFunction callback\n");
return NULL;
}
@@ -227,7 +227,7 @@ static void* findClipboadGetFct(void* fct)
#define GO(A) if(my_clipboardget_fct_##A == 0) {my_clipboardget_fct_##A = (uintptr_t)fct; return my_clipboardget_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkClipboardGetFunc callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkClipboardGetFunc callback\n");
return NULL;
}
@@ -250,7 +250,7 @@ static void* findClipboadClearFct(void* fct)
#define GO(A) if(my_clipboardclear_fct_##A == 0) {my_clipboardclear_fct_##A = (uintptr_t)fct; return my_clipboardclear_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkClipboardClearFunc callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkClipboardClearFunc callback\n");
return NULL;
}
@@ -273,7 +273,7 @@ static void* findGtkCallbackFct(void* fct)
#define GO(A) if(my3_gtkcallback_fct_##A == 0) {my3_gtkcallback_fct_##A = (uintptr_t)fct; return my3_gtkcallback_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkCallback callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkCallback callback\n");
return NULL;
}
@@ -296,7 +296,7 @@ static void* findGtkTextCharPredicateFct(void* fct)
#define GO(A) if(my_textcharpredicate_fct_##A == 0) {my_textcharpredicate_fct_##A = (uintptr_t)fct; return my_textcharpredicate_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkTextCharPredicate callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkTextCharPredicate callback\n");
return NULL;
}
@@ -319,7 +319,7 @@ static void* findToolbarFct(void* fct)
#define GO(A) if(my_toolbar_fct_##A == 0) {my_toolbar_fct_##A = (uintptr_t)fct; return my_toolbar_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 Toolbar callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 Toolbar callback\n");
return NULL;
}
@@ -342,7 +342,76 @@ static void* findBuilderConnectFct(void* fct)
#define GO(A) if(my_builderconnect_fct_##A == 0) {my_builderconnect_fct_##A = (uintptr_t)fct; return my_builderconnect_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 BuilderConnect callback\n");
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 BuilderConnect callback\n");
return NULL;
}
// GtkTreeViewSearchEqualFunc
#define GO(A) \
static uintptr_t my_GtkTreeViewSearchEqualFunc_fct_##A = 0; \
static int my_GtkTreeViewSearchEqualFunc_##A(void* model, int column, void* key, void* iter, void* data) \
{ \
return RunFunction(my_context, my_GtkTreeViewSearchEqualFunc_fct_##A, 5, model, column, key, iter, data); \
}
SUPER()
#undef GO
static void* findGtkTreeViewSearchEqualFuncFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GtkTreeViewSearchEqualFunc_fct_##A == (uintptr_t)fct) return my_GtkTreeViewSearchEqualFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GtkTreeViewSearchEqualFunc_fct_##A == 0) {my_GtkTreeViewSearchEqualFunc_fct_##A = (uintptr_t)fct; return my_GtkTreeViewSearchEqualFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkTreeViewSearchEqualFunc callback\n");
return NULL;
}
// GDestroyNotify
#define GO(A) \
static uintptr_t my_GDestroyNotify_fct_##A = 0; \
static void my_GDestroyNotify_##A(void* data) \
{ \
RunFunction(my_context, my_GDestroyNotify_fct_##A, 1, data); \
}
SUPER()
#undef GO
static void* findGDestroyNotifyFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GDestroyNotify_fct_##A == (uintptr_t)fct) return my_GDestroyNotify_##A;
SUPER()
#undef GO
#define GO(A) if(my_GDestroyNotify_fct_##A == 0) {my_GDestroyNotify_fct_##A = (uintptr_t)fct; return my_GDestroyNotify_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GDestroyNotify callback\n");
return NULL;
}
// GtkTreeIterCompareFunc
#define GO(A) \
static uintptr_t my_GtkTreeIterCompareFunc_fct_##A = 0; \
static int my_GtkTreeIterCompareFunc_##A(void* model, void* a, void* b, void* data) \
{ \
return RunFunction(my_context, my_GtkTreeIterCompareFunc_fct_##A, 4, model, a, b, data); \
}
SUPER()
#undef GO
static void* findGtkTreeIterCompareFuncFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GtkTreeIterCompareFunc_fct_##A == (uintptr_t)fct) return my_GtkTreeIterCompareFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GtkTreeIterCompareFunc_fct_##A == 0) {my_GtkTreeIterCompareFunc_fct_##A = (uintptr_t)fct; return my_GtkTreeIterCompareFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkTreeIterCompareFunc callback\n");
return NULL;
}
@@ -501,38 +570,12 @@ EXPORT void my3_gtk_container_forall(x86emu_t* emu, void* container, void* f, vo
my->gtk_container_forall(container, findGtkCallbackFct(f), data);
}
static int my_tree_view_search_equal(void* model, int column, void* key, void* iter, x86emu_t* emu)
{
SetCallbackArgs(emu, 4, model, column, key, iter);
return (int)RunCallback(emu);
}
static void my_destroy_notify(void* data)
{
x86emu_t *emu = (x86emu_t*)data;
uintptr_t f = (uintptr_t)GetCallbackArg(emu, 9);
if(f) {
SetCallbackArg(emu, 0, GetCallbackArg(emu, 8));
SetCallbackNArg(emu, 1);
SetCallbackAddress(emu, f);
RunCallback(emu);
}
FreeCallback(emu);
}
EXPORT void my3_gtk_tree_view_set_search_equal_func(x86emu_t* emu, void* tree_view, void* f, void* data, void* notify)
{
library_t * lib = GetLibInternal(libname);
gtk3_my_t *my = (gtk3_my_t*)lib->priv.w.p2;
if(!f)
my->gtk_tree_view_set_search_equal_func(tree_view, f, data, notify); // notify will be NULL to right? But f can be NULL?
x86emu_t* cb = AddCallback(emu, (uintptr_t)f, 5, NULL, NULL, NULL, NULL);
SetCallbackArg(cb, 4, data);
SetCallbackNArgs(cb, 8, 2, data, notify);
my->gtk_tree_view_set_search_equal_func(tree_view, my_tree_view_search_equal, cb, my_destroy_notify);
my->gtk_tree_view_set_search_equal_func(tree_view, findGtkTreeViewSearchEqualFuncFct(f), data, findGDestroyNotifyFct(notify));
}
EXPORT int my3_gtk_text_iter_backward_find_char(x86emu_t* emu, void* iter, void* f, void* data, void* limit)
@@ -607,29 +650,12 @@ EXPORT void* my3_gtk_toolbar_insert_stock(x86emu_t* emu, void* toolbar, void* st
return my->gtk_toolbar_insert_stock(toolbar, stock_id, tooltip_text, tooltip_private, findToolbarFct(f), data, position);
}
static int my_tree_iter_compare(void* model, void* a, void* b, x86emu_t* emu)
{
SetCallbackArgs(emu, 3, model, a, b);
return (int)RunCallback(emu);
}
EXPORT void my3_gtk_tree_sortable_set_sort_func(x86emu_t* emu, void* sortable, int id, void* f, void* data, void* notify)
{
library_t * lib = GetLibInternal(libname);
gtk3_my_t *my = (gtk3_my_t*)lib->priv.w.p2;
if(!f)
my->gtk_tree_sortable_set_sort_func(sortable, id, f, data, notify);
void* native_f = GetNativeFnc((uintptr_t)f);
void* native_notify = GetNativeFnc((uintptr_t)notify);
if(native_f && (native_notify || !notify))
return my->gtk_tree_sortable_set_sort_func(sortable, id, native_f, data, native_notify);
x86emu_t* cb = AddCallback(emu, (uintptr_t)f, 4, NULL, NULL, NULL, data);
SetCallbackNArgs(cb, 8, 2, data, notify);
my->gtk_tree_sortable_set_sort_func(sortable, id, my_tree_iter_compare, cb, my_destroy_notify);
my->gtk_tree_sortable_set_sort_func(sortable, id, findGtkTreeIterCompareFuncFct(f), data, findGDestroyNotifyFct(notify));
}
EXPORT void my3_gtk_tree_sortable_set_default_sort_func(x86emu_t* emu, void* sortable, void* f, void* data, void* notify)
@@ -637,18 +663,7 @@ EXPORT void my3_gtk_tree_sortable_set_default_sort_func(x86emu_t* emu, void* sor
library_t * lib = GetLibInternal(libname);
gtk3_my_t *my = (gtk3_my_t*)lib->priv.w.p2;
if(!f)
my->gtk_tree_sortable_set_default_sort_func(sortable, f, data, notify);
void* native_f = GetNativeFnc((uintptr_t)f);
void* native_notify = GetNativeFnc((uintptr_t)notify);
if(native_f && (native_notify || !notify))
return my->gtk_tree_sortable_set_default_sort_func(sortable, native_f, data, native_notify);
x86emu_t* cb = AddCallback(emu, (uintptr_t)f, 4, NULL, NULL, NULL, data);
SetCallbackNArgs(cb, 8, 2, data, notify);
my->gtk_tree_sortable_set_default_sort_func(sortable, my_tree_iter_compare, cb, my_destroy_notify);
my->gtk_tree_sortable_set_default_sort_func(sortable, findGtkTreeIterCompareFuncFct(f), data, findGDestroyNotifyFct(notify));
}
EXPORT int my3_gtk_type_unique(x86emu_t* emu, int parent, my_GtkTypeInfo_t* gtkinfo)
@@ -669,13 +684,7 @@ EXPORT void my3_gtk_object_set_data_full(x86emu_t* emu, void* object, void* key,
library_t * lib = GetLibInternal(libname);
gtk3_my_t *my = (gtk3_my_t*)lib->priv.w.p2;
void* native_notify = GetNativeFnc((uintptr_t)notify);
if(!notify || native_notify)
return my->gtk_object_set_data_full(object, key, data, native_notify);
x86emu_t* cb = AddCallback(emu, 0, 0, NULL, NULL, NULL, NULL);
SetCallbackNArgs(cb, 8, 2, data, notify);
my->gtk_object_set_data_full(object, key, cb, my_destroy_notify);
my->gtk_object_set_data_full(object, key, data, findGDestroyNotifyFct(notify));
}
EXPORT float my3_gtk_spin_button_get_value_as_float(x86emu_t* emu, void* spinner)
@@ -694,6 +703,11 @@ EXPORT void my3_gtk_builder_connect_signals_full(x86emu_t* emu, void* builder, v
my->gtk_builder_connect_signals_full(builder, findBuilderConnectFct(f), data);
}
//GtkMisc is deprecated in GTK3, so use widget directly...
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
libname = lib->name; \
lib->priv.w.p2 = getGtk3My(lib); \
+54 -64
View File
@@ -529,6 +529,52 @@ static void* findGtkClipboardTextReceivedFuncFct(void* fct)
return NULL;
}
// GtkTreeViewSearchEqualFunc
#define GO(A) \
static uintptr_t my_GtkTreeViewSearchEqualFunc_fct_##A = 0; \
static int my_GtkTreeViewSearchEqualFunc_##A(void* model, int column, void* key, void* iter, void* data) \
{ \
return RunFunction(my_context, my_GtkTreeViewSearchEqualFunc_fct_##A, 5, model, column, key, iter, data); \
}
SUPER()
#undef GO
static void* findGtkTreeViewSearchEqualFuncFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GtkTreeViewSearchEqualFunc_fct_##A == (uintptr_t)fct) return my_GtkTreeViewSearchEqualFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GtkTreeViewSearchEqualFunc_fct_##A == 0) {my_GtkTreeViewSearchEqualFunc_fct_##A = (uintptr_t)fct; return my_GtkTreeViewSearchEqualFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkTreeViewSearchEqualFunc callback\n");
return NULL;
}
// GtkTreeIterCompareFunc
#define GO(A) \
static uintptr_t my_GtkTreeIterCompareFunc_fct_##A = 0; \
static int my_GtkTreeIterCompareFunc_##A(void* model, void* a, void* b, void* data) \
{ \
return RunFunction(my_context, my_GtkTreeIterCompareFunc_fct_##A, 4, model, a, b, data); \
}
SUPER()
#undef GO
static void* findGtkTreeIterCompareFuncFct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_GtkTreeIterCompareFunc_fct_##A == (uintptr_t)fct) return my_GtkTreeIterCompareFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GtkTreeIterCompareFunc_fct_##A == 0) {my_GtkTreeIterCompareFunc_fct_##A = (uintptr_t)fct; return my_GtkTreeIterCompareFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkTreeIterCompareFunc callback\n");
return NULL;
}
#undef SUPER
EXPORT void my_gtk_dialog_add_buttons(x86emu_t* emu, void* dialog, void* first, uintptr_t* b)
@@ -684,38 +730,12 @@ EXPORT void my_gtk_container_forall(x86emu_t* emu, void* container, void* f, voi
my->gtk_container_forall(container, findGtkCallbackFct(f), data);
}
static int my_tree_view_search_equal(void* model, int column, void* key, void* iter, x86emu_t* emu)
{
SetCallbackArgs(emu, 4, model, column, key, iter);
return (int)RunCallback(emu);
}
static void my_destroy_notify(void* data)
{
x86emu_t *emu = (x86emu_t*)data;
uintptr_t f = (uintptr_t)GetCallbackArg(emu, 9);
if(f) {
SetCallbackArg(emu, 0, GetCallbackArg(emu, 8));
SetCallbackNArg(emu, 1);
SetCallbackAddress(emu, f);
RunCallback(emu);
}
FreeCallback(emu);
}
EXPORT void my_gtk_tree_view_set_search_equal_func(x86emu_t* emu, void* tree_view, void* f, void* data, void* notify)
{
library_t * lib = GetLibInternal(libname);
gtkx112_my_t *my = (gtkx112_my_t*)lib->priv.w.p2;
if(!f)
my->gtk_tree_view_set_search_equal_func(tree_view, f, data, notify); // notify will be NULL to right? But f can be NULL?
x86emu_t* cb = AddCallback(emu, (uintptr_t)f, 5, NULL, NULL, NULL, NULL);
SetCallbackArg(cb, 4, data);
SetCallbackNArgs(cb, 8, 2, data, notify);
my->gtk_tree_view_set_search_equal_func(tree_view, my_tree_view_search_equal, cb, my_destroy_notify);
my->gtk_tree_view_set_search_equal_func(tree_view, findGtkTreeViewSearchEqualFuncFct(f), data, findGDestroyNotifyFct(notify));
}
EXPORT int my_gtk_text_iter_backward_find_char(x86emu_t* emu, void* iter, void* f, void* data, void* limit)
@@ -790,29 +810,12 @@ EXPORT void* my_gtk_toolbar_insert_stock(x86emu_t* emu, void* toolbar, void* sto
return my->gtk_toolbar_insert_stock(toolbar, stock_id, tooltip_text, tooltip_private, findToolbarFct(f), data, position);
}
static int my_tree_iter_compare(void* model, void* a, void* b, x86emu_t* emu)
{
SetCallbackArgs(emu, 3, model, a, b);
return (int)RunCallback(emu);
}
EXPORT void my_gtk_tree_sortable_set_sort_func(x86emu_t* emu, void* sortable, int id, void* f, void* data, void* notify)
{
library_t * lib = GetLibInternal(libname);
gtkx112_my_t *my = (gtkx112_my_t*)lib->priv.w.p2;
if(!f)
my->gtk_tree_sortable_set_sort_func(sortable, id, f, data, notify);
void* native_f = GetNativeFnc((uintptr_t)f);
void* native_notify = GetNativeFnc((uintptr_t)notify);
if(native_f && (native_notify || !notify))
return my->gtk_tree_sortable_set_sort_func(sortable, id, native_f, data, native_notify);
x86emu_t* cb = AddCallback(emu, (uintptr_t)f, 4, NULL, NULL, NULL, data);
SetCallbackNArgs(cb, 8, 2, data, notify);
my->gtk_tree_sortable_set_sort_func(sortable, id, my_tree_iter_compare, cb, my_destroy_notify);
my->gtk_tree_sortable_set_sort_func(sortable, id, findGtkTreeIterCompareFuncFct(f), data, findGDestroyNotifyFct(notify));
}
EXPORT void my_gtk_tree_sortable_set_default_sort_func(x86emu_t* emu, void* sortable, void* f, void* data, void* notify)
@@ -820,18 +823,7 @@ EXPORT void my_gtk_tree_sortable_set_default_sort_func(x86emu_t* emu, void* sort
library_t * lib = GetLibInternal(libname);
gtkx112_my_t *my = (gtkx112_my_t*)lib->priv.w.p2;
if(!f)
my->gtk_tree_sortable_set_default_sort_func(sortable, f, data, notify);
void* native_f = GetNativeFnc((uintptr_t)f);
void* native_notify = GetNativeFnc((uintptr_t)notify);
if(native_f && (native_notify || !notify))
return my->gtk_tree_sortable_set_default_sort_func(sortable, native_f, data, native_notify);
x86emu_t* cb = AddCallback(emu, (uintptr_t)f, 4, NULL, NULL, NULL, data);
SetCallbackNArgs(cb, 8, 2, data, notify);
my->gtk_tree_sortable_set_default_sort_func(sortable, my_tree_iter_compare, cb, my_destroy_notify);
my->gtk_tree_sortable_set_default_sort_func(sortable, findGtkTreeIterCompareFuncFct(f), data, findGDestroyNotifyFct(notify));
}
EXPORT int my_gtk_type_unique(x86emu_t* emu, int parent, my_GtkTypeInfo_t* gtkinfo)
@@ -852,13 +844,7 @@ EXPORT void my_gtk_object_set_data_full(x86emu_t* emu, void* object, void* key,
library_t * lib = GetLibInternal(libname);
gtkx112_my_t *my = (gtkx112_my_t*)lib->priv.w.p2;
void* native_notify = GetNativeFnc((uintptr_t)notify);
if(!notify || native_notify)
return my->gtk_object_set_data_full(object, key, data, native_notify);
x86emu_t* cb = AddCallback(emu, 0, 0, NULL, NULL, NULL, NULL);
SetCallbackNArgs(cb, 8, 2, data, notify);
my->gtk_object_set_data_full(object, key, cb, my_destroy_notify);
my->gtk_object_set_data_full(object, key, data, findGDestroyNotifyFct(notify));
}
EXPORT float my_gtk_spin_button_get_value_as_float(x86emu_t* emu, void* spinner)
@@ -1077,6 +1063,10 @@ EXPORT void my_gtk_clipboard_request_text(x86emu_t* emu, void* clipboard, void*
my->gtk_clipboard_request_text(clipboard, findGtkClipboardTextReceivedFuncFct(f), data);
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
libname = lib->name; \
lib->priv.w.p2 = getGtkx112My(lib); \
+5
View File
@@ -6,6 +6,7 @@
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
@@ -14,6 +15,10 @@
const char* gudev1Name = "libgudev-1.0.so.0";
#define LIBNAME gudev1
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.needed = 2; \
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
+18
View File
@@ -0,0 +1,18 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <dlfcn.h>
#include "wrappedlibs.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
#include "x86emu.h"
const char* lberName = "liblber-2.4.so.2";
#define LIBNAME lber
#include "wrappedlib_init.h"
+140
View File
@@ -0,0 +1,140 @@
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
#error Meh....
#endif
//GO(ber_alloc,
GO(ber_alloc_t, pFi)
//GO(ber_bprint,
GO(ber_bvarray_add, vFpp)
//GO(ber_bvarray_add_x,
//GO(ber_bvarray_dup_x,
GO(ber_bvarray_free, vFp)
//GO(ber_bvarray_free_x,
GO(ber_bvdup, pFp)
GO(ber_bvecadd, vFpp)
//GO(ber_bvecadd_x,
GO(ber_bvecfree, vFp)
//GO(ber_bvecfree_x,
GO(ber_bvfree, vFp)
//GO(ber_bvfree_x,
//GO(ber_bvreplace,
//GO(ber_bvreplace_x,
GO(ber_bvstr, pFp)
GO(ber_bvstrdup, pFp)
//GO(ber_decode_oid,
//GO(ber_dump,
//GO(ber_dup,
GO(ber_dupbv, pFpp)
//GO(ber_dupbv_x,
//GO(ber_encode_oid,
//GO(ber_errno_addr,
//GO(ber_error_print,
GO(ber_first_element, LFppp)
GO(ber_flatten, iFpp)
//GO(ber_flatten2,
GO(ber_flush, iFppi)
GO(ber_flush2, iFppi)
GO(ber_free, vFpi)
//GO(ber_free_buf,
GO(ber_get_bitstringa, LFppp)
GO(ber_get_boolean, LFpp)
GO(ber_get_enum, iFpp)
GO(ber_get_int, iFpp)
GO(ber_get_next, LFppp)
GO(ber_get_null, LFp)
//GO(ber_get_option,
GO(ber_get_stringa, LFpp)
GO(ber_get_stringal, LFpp)
//GO(ber_get_stringa_null,
GO(ber_get_stringb, LFppp)
GO(ber_get_stringbv, LFppi)
//GO(ber_get_stringbv_null,
//GO(ber_get_tag,
GO(ber_init, pFp)
GO(ber_init2, vFppi)
//GO(ber_init_w_nullc,
//DATAB(ber_int_errno_fn,
//DATAB(ber_int_log_proc,
//DATAB(ber_int_memory_fns,
//DATAB(ber_int_options,
//GO(ber_int_sb_close,
//GO(ber_int_sb_destroy,
//GO(ber_int_sb_init,
//GO(ber_int_sb_read,
//GO(ber_int_sb_write,
//GO(ber_len,
//GO(ber_log_bprint,
//GO(ber_log_dump,
//GO(ber_log_sos_dump,
//GO(ber_mem2bv,
//GO(ber_mem2bv_x,
//GO(ber_memalloc,
//GO(ber_memalloc_x,
//GO(ber_memcalloc,
//GO(ber_memcalloc_x,
//GO(ber_memfree,
//GO(ber_memfree_x,
//GO(ber_memrealloc,
//GO(ber_memrealloc_x,
//GO(ber_memvfree,
//GO(ber_memvfree_x,
GO(ber_next_element, LFppp)
//GO(ber_peek_element,
GO(ber_peek_tag, LFpp)
GO(ber_printf, iFpppppppppppppppppppppppppppppppppp) //VAArg. May need some wrapping...
//GO(ber_ptrlen,
//GO(ber_put_berval,
GO(ber_put_bitstring, iFppLL)
GO(ber_put_boolean, iFpiL)
GO(ber_put_enum, iFpiL)
GO(ber_put_int, iFpiL)
GO(ber_put_null, iFpL)
GO(ber_put_ostring, iFppLL)
GO(ber_put_seq, iFp)
GO(ber_put_set, iFp)
GO(ber_put_string, iFppL)
//DATAB(ber_pvt_err_file,
//GO(ber_pvt_log_output,
//DATA(ber_pvt_log_print,
//GO(ber_pvt_log_printf,
//DATAB(ber_pvt_opt_on,
//GO(ber_pvt_sb_buf_destroy,
//GO(ber_pvt_sb_buf_init,
//GO(ber_pvt_sb_copy_out,
//GO(ber_pvt_sb_do_write,
//GO(ber_pvt_sb_grow_buffer,
//GO(ber_pvt_socket_set_nonblock,
//GO(ber_read,
//GO(ber_realloc,
//GO(ber_remaining,
//GO(ber_reset,
//GO(ber_rewind,
GO(ber_scanf, LFpppppppppppppppppp) // VAArg
//GO(ber_set_option,
//GO(ber_skip_data,
//GO(ber_skip_element,
GO(ber_skip_tag, LFpp)
//GO(ber_sockbuf_add_io,
//GO(ber_sockbuf_alloc,
//GO(ber_sockbuf_ctrl,
//GO(ber_sockbuf_free,
//DATA(ber_sockbuf_io_debug,
//DATA(ber_sockbuf_io_fd,
//DATA(ber_sockbuf_io_readahead,
//DATA(ber_sockbuf_io_tcp,
//GO(ber_sockbuf_remove_io,
//GO(ber_sos_dump,
//GO(ber_start,
GO(ber_start_seq, iFpL)
GO(ber_start_set, iFpL)
GO(ber_str2bv, pFpLip)
//GO(ber_str2bv_x,
//GO(ber_strdup,
//GO(ber_strdup_x,
//GO(ber_strndup,
//GO(ber_strndup_x,
//GO(ber_strnlen,
//GO(ber_write,
//GO(der_alloc,
//GO(lutil_debug,
//GO(lutil_debug_file,
+102
View File
@@ -0,0 +1,102 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <dlfcn.h>
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
#include "x86emu.h"
#include "emu/x86emu_private.h"
#include "box86context.h"
#include "librarian.h"
#include "callback.h"
const char* lcms2Name = "liblcms2.so.2";
#define LIBNAME lcms2
static library_t* my_lib = NULL;
typedef void (*vFp_t) (void*);
#define SUPER() \
GO(cmsSetLogErrorHandler, vFp_t) \
typedef struct lcms2_my_s {
// functions
#define GO(A, B) B A;
SUPER()
#undef GO
} lcms2_my_t;
void* getLcms2My(library_t* lib)
{
lcms2_my_t* my = (lcms2_my_t*)calloc(1, sizeof(lcms2_my_t));
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
SUPER()
#undef GO
return my;
}
#undef SUPER
void freeLcms2My(void* lib)
{
//lcms2_my_t *my = (lcms2_my_t *)lib;
}
#define SUPER() \
GO(0) \
GO(1) \
GO(2) \
GO(3) \
GO(4)
// cmsLogErrorHandlerFunction ...
#define GO(A) \
static uintptr_t my_cmsLogErrorHandlerFunction_fct_##A = 0; \
static void my_cmsLogErrorHandlerFunction_##A(void* a, uint32_t b, void* c) \
{ \
RunFunction(my_context, my_cmsLogErrorHandlerFunction_fct_##A, 3, a, b, c); \
}
SUPER()
#undef GO
static void* find_cmsLogErrorHandlerFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_cmsLogErrorHandlerFunction_fct_##A == (uintptr_t)fct) return my_cmsLogErrorHandlerFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_cmsLogErrorHandlerFunction_fct_##A == 0) {my_cmsLogErrorHandlerFunction_fct_##A = (uintptr_t)fct; return my_cmsLogErrorHandlerFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for liblcms2 cmsLogErrorHandlerFunction callback\n");
return NULL;
}
#undef SUPER
EXPORT void my_cmsSetLogErrorHandler(x86emu_t* emu, void* f)
{
lcms2_my_t* my = (lcms2_my_t*)my_lib->priv.w.p2;
my->cmsSetLogErrorHandler(find_cmsLogErrorHandlerFunction_Fct(f));
}
#define PRE_INIT \
if(box86_nogtk) \
return -1;
#define CUSTOM_INIT \
lib->priv.w.p2 = getLcms2My(lib); \
my_lib = lib;
#define CUSTOM_FINI \
freeLcms2My(lib->priv.w.p2); \
free(lib->priv.w.p2); \
my_lib = NULL;
#include "wrappedlib_init.h"
+453
View File
@@ -0,0 +1,453 @@
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
#error meh!
#endif
//DATAB(__bss_end__,
//DATAB(_bss_end__,
//DATAB(__bss_start,
//DATAB(__bss_start__,
//GO(_cms15Fixed16toDouble,
//GO(_cms8Fixed8toDouble,
//GO(_cmsAdaptationMatrix,
//DATA(_cmsAdaptationStateChunk,
//GO(cmsAdaptToIlluminant,
//GO(_cmsAdjustEndianess16,
//GO(_cmsAdjustEndianess32,
//GO(_cmsAdjustEndianess64,
//DATA(_cmsAlarmCodesChunk,
//GO(_cmsAllocAdaptationStateChunk,
//GO(_cmsAllocAlarmCodesChunk,
//GO(_cmsAllocCurvesPluginChunk,
//GO(_cmsAllocFormattersPluginChunk,
//GO(_cmsAllocIntentsPluginChunk,
//GO(_cmsAllocInterpPluginChunk,
//GO(_cmsAllocLogErrorChunk,
//GO(_cmsAllocMemPluginChunk,
//GO(_cmsAllocMPETypePluginChunk,
//GO(_cmsAllocMutexPluginChunk,
//GO(cmsAllocNamedColorList,
//GO(_cmsAllocOptimizationPluginChunk,
//GO(cmsAllocProfileSequenceDescription,
//GO(_cmsAllocTagPluginChunk,
//GO(_cmsAllocTagTypePluginChunk,
//GO(_cmsAllocTransformPluginChunk,
//GO(cmsAppendNamedColor,
//GO(cmsBFDdeltaE,
//GO(cmsBuildGamma,
//GO(_cmsBuildKToneCurve,
//GO(cmsBuildParametricToneCurve,
//GO(_cmsBuildRGB2XYZtransferMatrix,
//GO(cmsBuildSegmentedToneCurve,
//GO(cmsBuildTabulatedToneCurve16,
//GO(cmsBuildTabulatedToneCurveFloat,
//GO(_cmsCalloc,
//GO(_cmsChain2Lab,
GO(cmsChangeBuffersFormat, iFpuu)
//GO(cmsChannelsOf,
//GO(cmsCIE2000DeltaE,
//GO(cmsCIE94DeltaE,
//GO(cmsCIECAM02Done,
//GO(cmsCIECAM02Forward,
//GO(cmsCIECAM02Init,
//GO(cmsCIECAM02Reverse,
//GO(cmsCloseIOhandler,
GO(cmsCloseProfile, iFp)
//GO(cmsCMCdeltaE,
//GO(_cmsCompileProfileSequence,
//GO(_cmsComputeInterpParams,
//GO(_cmsComputeInterpParamsEx,
//GO(_cmsContextGetClientChunk,
//GO(cmsCreateBCHSWabstractProfile,
//GO(cmsCreateBCHSWabstractProfileTHR,
//GO(cmsCreateContext,
//GO(cmsCreateExtendedTransform,
//GO(_cmsCreateGamutCheckPipeline,
//GO(cmsCreateGrayProfile,
//GO(cmsCreateGrayProfileTHR,
//GO(cmsCreateInkLimitingDeviceLink,
//GO(cmsCreateInkLimitingDeviceLinkTHR,
//GO(cmsCreateLab2Profile,
//GO(cmsCreateLab2ProfileTHR,
//GO(cmsCreateLab4Profile,
//GO(cmsCreateLab4ProfileTHR,
//GO(cmsCreateLinearizationDeviceLink,
//GO(cmsCreateLinearizationDeviceLinkTHR,
GO(cmsCreateMultiprofileTransform, pFpupupuuu)
//GO(cmsCreateMultiprofileTransformTHR,
//GO(_cmsCreateMutex,
//GO(cmsCreateNULLProfile,
//GO(cmsCreateNULLProfileTHR,
//GO(cmsCreateProfilePlaceholder,
GO(cmsCreateProofingTransform, pFppuuuuu)
//GO(cmsCreateProofingTransformTHR,
//GO(cmsCreateRGBProfile,
//GO(cmsCreateRGBProfileTHR,
GO(cmsCreate_sRGBProfile, pFv)
//GO(cmsCreate_sRGBProfileTHR,
//GO(_cmsCreateSubAlloc,
//GO(cmsCreateTransform,
//GO(cmsCreateTransformTHR,
//GO(cmsCreateXYZProfile,
//GO(cmsCreateXYZProfileTHR,
//DATAB(_cmsCurvesPluginChunk,
//GO(cmsD50_xyY,
//GO(cmsD50_XYZ,
//GO(_cmsDecodeDateTimeNumber,
//GO(_cmsDefaultICCintents,
//GO(cmsDeleteContext,
GO(cmsDeleteTransform, vFp)
//GO(cmsDeltaE,
//GO(cmsDesaturateLab,
//GO(_cmsDestroyMutex,
//GO(cmsDetectBlackPoint,
//GO(cmsDetectDestinationBlackPoint,
//GO(cmsDetectTAC,
//GO(cmsDictAddEntry,
//GO(cmsDictAlloc,
//GO(cmsDictDup,
//GO(cmsDictFree,
//GO(cmsDictGetEntryList,
//GO(cmsDictNextEntry,
GO(cmsDoTransform, vFpppu)
//GO(cmsDoTransformLineStride,
//GO(cmsDoTransformStride,
//GO(_cmsDoubleTo15Fixed16,
//GO(_cmsDoubleTo8Fixed8,
//GO(cmsDupContext,
//GO(_cmsDupMem,
//GO(cmsDupNamedColorList,
//GO(cmsDupProfileSequenceDescription,
//GO(cmsDupToneCurve,
//GO(_cmsEncodeDateTimeNumber,
//GO(_cmsEndPointsBySpace,
//GO(cmsEstimateGamma,
//GO(cmsEvalToneCurve16,
//GO(cmsEvalToneCurveFloat,
//GO(cmsfilelength,
//GO(_cmsFloat2Half,
//GO(cmsFloat2LabEncoded,
//GO(cmsFloat2LabEncodedV2,
//GO(cmsFloat2XYZEncoded,
//GO(cmsFormatterForColorspaceOfProfile,
//GO(cmsFormatterForPCSOfProfile,
//GO(_cmsFormatterIs8bit,
//GO(_cmsFormatterIsFloat,
//DATAB(_cmsFormattersPluginChunk,
//GO(_cmsFree,
//GO(_cmsFreeInterpParams,
//GO(cmsFreeNamedColorList,
//GO(cmsFreeProfileSequenceDescription,
//GO(cmsFreeToneCurve,
//GO(cmsFreeToneCurveTriple,
//GO(cmsGBDAlloc,
//GO(cmsGBDFree,
//GO(cmsGDBAddPoint,
//GO(cmsGDBCheckPoint,
//GO(cmsGDBCompute,
//GO(cmsGetAlarmCodes,
//GO(cmsGetAlarmCodesTHR,
//GO(cmsGetColorSpace,
//GO(_cmsGetContext,
//GO(cmsGetContextUserData,
//GO(cmsGetDeviceClass,
//GO(cmsGetEncodedCMMversion,
//GO(cmsGetEncodedICCversion,
//GO(_cmsGetFormatter,
//GO(cmsGetHeaderAttributes,
//GO(cmsGetHeaderCreationDateTime,
//GO(cmsGetHeaderCreator,
//GO(cmsGetHeaderFlags,
//GO(cmsGetHeaderManufacturer,
//GO(cmsGetHeaderModel,
//GO(cmsGetHeaderProfileID,
//GO(cmsGetHeaderRenderingIntent,
//GO(cmsGetNamedColorList,
//GO(cmsGetPCS,
//GO(cmsGetPipelineContextID,
//GO(cmsGetPostScriptColorResource,
//GO(cmsGetPostScriptCRD,
//GO(cmsGetPostScriptCSA,
//GO(cmsGetProfileContextID,
//GO(cmsGetProfileInfo,
//GO(cmsGetProfileInfoASCII,
//GO(cmsGetProfileIOhandler,
//GO(cmsGetProfileVersion,
//GO(cmsGetSupportedIntents,
//GO(cmsGetSupportedIntentsTHR,
GO(cmsGetTagCount, iFp)
//GO(_cmsGetTagDescriptor,
GO(cmsGetTagSignature, iFpu)
//GO(_cmsGetTagTrueType,
//GO(_cmsGetTagTypeHandler,
//GO(cmsGetToneCurveEstimatedTable,
//GO(cmsGetToneCurveEstimatedTableEntries,
//GO(cmsGetToneCurveParametricType,
//GO(cmsGetTransformContextID,
//GO(_cmsGetTransformFormatters16,
//GO(_cmsGetTransformFormattersFloat,
//GO(cmsGetTransformInputFormat,
//GO(cmsGetTransformOutputFormat,
//GO(_cmsGetTransformUserData,
//GO(_cmsHalf2Float,
//GO(_cmsHandleExtraChannels,
//GO(_cmsICCcolorSpace,
//GO(_cmsInstallAllocFunctions,
//DATAB(_cmsIntentsPluginChunk,
//DATAB(_cmsInterpPluginChunk,
//GO(_cmsIOPrintf,
//GO(cmsIsCLUT,
//GO(cmsIsIntentSupported,
//GO(cmsIsMatrixShaper,
GO(cmsIsTag, iFpi)
//GO(cmsIsToneCurveDescending,
//GO(cmsIsToneCurveLinear,
//GO(cmsIsToneCurveMonotonic,
//GO(cmsIsToneCurveMultisegment,
//GO(cmsIT8Alloc,
//GO(cmsIT8DefineDblFormat,
//GO(cmsIT8EnumDataFormat,
//GO(cmsIT8EnumProperties,
//GO(cmsIT8EnumPropertyMulti,
//GO(cmsIT8FindDataFormat,
//GO(cmsIT8Free,
//GO(cmsIT8GetData,
//GO(cmsIT8GetDataDbl,
//GO(cmsIT8GetDataRowCol,
//GO(cmsIT8GetDataRowColDbl,
//GO(cmsIT8GetPatchByName,
//GO(cmsIT8GetPatchName,
//GO(cmsIT8GetProperty,
//GO(cmsIT8GetPropertyDbl,
//GO(cmsIT8GetPropertyMulti,
//GO(cmsIT8GetSheetType,
//GO(cmsIT8LoadFromFile,
//GO(cmsIT8LoadFromMem,
//GO(cmsIT8SaveToFile,
//GO(cmsIT8SaveToMem,
//GO(cmsIT8SetComment,
//GO(cmsIT8SetData,
//GO(cmsIT8SetDataDbl,
//GO(cmsIT8SetDataFormat,
//GO(cmsIT8SetDataRowCol,
//GO(cmsIT8SetDataRowColDbl,
//GO(cmsIT8SetIndexColumn,
//GO(cmsIT8SetPropertyDbl,
//GO(cmsIT8SetPropertyHex,
//GO(cmsIT8SetPropertyMulti,
//GO(cmsIT8SetPropertyStr,
//GO(cmsIT8SetPropertyUncooked,
//GO(cmsIT8SetSheetType,
//GO(cmsIT8SetTable,
//GO(cmsIT8SetTableByLabel,
//GO(cmsIT8TableCount,
//GO(cmsJoinToneCurve,
//GO(cmsLab2LCh,
//GO(cmsLab2XYZ,
//GO(cmsLabEncoded2Float,
//GO(cmsLabEncoded2FloatV2,
//GO(cmsLCh2Lab,
//GO(_cmsLCMScolorSpace,
//GO(_cmsLinkProfiles,
//GO(cmsLinkTag,
//GO(_cmsLockMutex,
//DATA(_cmsLogErrorChunk,
//GO(_cmsMalloc,
//GO(_cmsMallocZero,
//GO(_cmsMAT3eval,
//GO(_cmsMAT3identity,
//GO(_cmsMAT3inverse,
//GO(_cmsMAT3isIdentity,
//GO(_cmsMAT3per,
//GO(_cmsMAT3solve,
//GO(cmsMD5computeID,
//DATA(_cmsMemPluginChunk,
//GO(cmsMLUalloc,
//GO(cmsMLUdup,
//GO(cmsMLUfree,
//GO(cmsMLUgetASCII,
//GO(cmsMLUgetTranslation,
//GO(cmsMLUgetWide,
//GO(cmsMLUsetASCII,
//GO(cmsMLUsetWide,
//GO(cmsMLUtranslationsCodes,
//GO(cmsMLUtranslationsCount,
//DATAB(_cmsMPETypePluginChunk,
//DATA(_cmsMutexPluginChunk,
//GO(cmsNamedColorCount,
//GO(cmsNamedColorIndex,
//GO(cmsNamedColorInfo,
//GO(cmsOpenIOhandlerFromFile,
//GO(cmsOpenIOhandlerFromMem,
//GO(cmsOpenIOhandlerFromNULL,
//GO(cmsOpenIOhandlerFromStream,
//GO(cmsOpenProfileFromFile,
//GO(cmsOpenProfileFromFileTHR,
//GO(cmsOpenProfileFromIOhandler2THR,
//GO(cmsOpenProfileFromIOhandlerTHR,
GO(cmsOpenProfileFromMem, pFpu)
//GO(cmsOpenProfileFromMemTHR,
//GO(cmsOpenProfileFromStream,
//GO(cmsOpenProfileFromStreamTHR,
//DATAB(_cmsOptimizationPluginChunk,
//GO(_cmsOptimizePipeline,
//GO(cmsPipelineAlloc,
//GO(cmsPipelineCat,
//GO(cmsPipelineCheckAndRetreiveStages,
//GO(cmsPipelineDup,
//GO(cmsPipelineEval16,
//GO(cmsPipelineEvalFloat,
//GO(cmsPipelineEvalReverseFloat,
//GO(cmsPipelineFree,
//GO(cmsPipelineGetPtrToFirstStage,
//GO(cmsPipelineGetPtrToLastStage,
//GO(cmsPipelineInputChannels,
//GO(cmsPipelineInsertStage,
//GO(cmsPipelineOutputChannels,
//GO(_cmsPipelineSetOptimizationParameters,
//GO(cmsPipelineSetSaveAs8bitsFlag,
//GO(cmsPipelineStageCount,
//GO(cmsPipelineUnlinkStage,
//GO(cmsPlugin,
//GO(_cmsPluginMalloc,
//GO(cmsPluginTHR,
//GO(_cmsQuantizeVal,
//GO(_cmsRead15Fixed16Number,
//GO(_cmsReadAlignment,
//GO(_cmsReadCHAD,
//GO(_cmsReadDevicelinkLUT,
//GO(_cmsReadFloat32Number,
//GO(_cmsReadHeader,
//GO(_cmsReadInputLUT,
//GO(_cmsReadMediaWhitePoint,
//GO(_cmsReadOutputLUT,
//GO(_cmsReadProfileSequence,
//GO(cmsReadRawTag,
//GO(cmsReadTag,
//GO(_cmsReadTypeBase,
//GO(_cmsReadUInt16Array,
//GO(_cmsReadUInt16Number,
//GO(_cmsReadUInt32Number,
//GO(_cmsReadUInt64Number,
//GO(_cmsReadUInt8Number,
//GO(_cmsReadXYZNumber,
//GO(_cmsRealloc,
//GO(_cmsReasonableGridpointsByColorspace,
//GO(_cmsRegisterFormattersPlugin,
//GO(_cmsRegisterInterpPlugin,
//GO(_cmsRegisterMemHandlerPlugin,
//GO(_cmsRegisterMultiProcessElementPlugin,
//GO(_cmsRegisterMutexPlugin,
//GO(_cmsRegisterOptimizationPlugin,
//GO(_cmsRegisterParametricCurvesPlugin,
//GO(_cmsRegisterRenderingIntentPlugin,
//GO(_cmsRegisterTagPlugin,
//GO(_cmsRegisterTagTypePlugin,
//GO(_cmsRegisterTransformPlugin,
//GO(cmsReverseToneCurve,
//GO(cmsReverseToneCurveEx,
//GO(cmsSaveProfileToFile,
//GO(cmsSaveProfileToIOhandler,
//GO(cmsSaveProfileToMem,
//GO(cmsSaveProfileToStream,
//GO(_cmsSearchTag,
//GO(cmsSetAdaptationState,
//GO(cmsSetAdaptationStateTHR,
//GO(cmsSetAlarmCodes,
//GO(cmsSetAlarmCodesTHR,
//GO(cmsSetColorSpace,
//GO(cmsSetDeviceClass,
//GO(cmsSetEncodedICCversion,
//GO(cmsSetHeaderAttributes,
//GO(cmsSetHeaderFlags,
//GO(cmsSetHeaderManufacturer,
//GO(cmsSetHeaderModel,
//GO(cmsSetHeaderProfileID,
//GO(cmsSetHeaderRenderingIntent,
//GO(_cmsSetInterpolationRoutine,
GOM(cmsSetLogErrorHandler, vFEp)
//GO(cmsSetLogErrorHandlerTHR,
//GO(cmsSetPCS,
//GO(cmsSetProfileVersion,
//GO(_cmsSetTransformUserData,
//GO(cmsSignalError,
//GO(cmsSliceSpace16,
//GO(cmsSliceSpaceFloat,
//GO(cmsSmoothToneCurve,
//GO(cmsStageAllocCLut16bit,
//GO(cmsStageAllocCLut16bitGranular,
//GO(cmsStageAllocCLutFloat,
//GO(cmsStageAllocCLutFloatGranular,
//GO(cmsStageAllocIdentity,
//GO(_cmsStageAllocIdentityCLut,
//GO(_cmsStageAllocIdentityCurves,
//GO(_cmsStageAllocLab2XYZ,
//GO(_cmsStageAllocLabPrelin,
//GO(_cmsStageAllocLabV2ToV4,
//GO(_cmsStageAllocLabV2ToV4curves,
//GO(_cmsStageAllocLabV4ToV2,
//GO(cmsStageAllocMatrix,
//GO(_cmsStageAllocNamedColor,
//GO(_cmsStageAllocPlaceholder,
//GO(cmsStageAllocToneCurves,
//GO(_cmsStageAllocXYZ2Lab,
//GO(_cmsStageClipNegatives,
//GO(cmsStageData,
//GO(cmsStageDup,
//GO(cmsStageFree,
//GO(_cmsStageGetPtrToCurveSet,
//GO(cmsStageInputChannels,
//GO(cmsStageNext,
//GO(_cmsStageNormalizeFromLabFloat,
//GO(_cmsStageNormalizeFromXyzFloat,
//GO(_cmsStageNormalizeToLabFloat,
//GO(_cmsStageNormalizeToXyzFloat,
//GO(cmsStageOutputChannels,
//GO(cmsStageSampleCLut16bit,
//GO(cmsStageSampleCLutFloat,
//GO(cmsStageType,
//GO(cmsstrcasecmp,
//GO(_cmsSubAlloc,
//GO(_cmsSubAllocDestroy,
//GO(_cmsSubAllocDup,
GO(cmsTagLinkedTo, iFpi)
//DATAB(_cmsTagPluginChunk,
//GO(_cmsTagSignature2String,
//DATAB(_cmsTagTypePluginChunk,
//GO(cmsTempFromWhitePoint,
//GO(cmsTransform2DeviceLink,
//DATAB(_cmsTransformPluginChunk,
//GO(_cmsUnlockMutex,
//GO(cmsUnregisterPlugins,
//GO(cmsUnregisterPluginsTHR,
//GO(_cmsVEC3cross,
//GO(_cmsVEC3distance,
//GO(_cmsVEC3dot,
//GO(_cmsVEC3init,
//GO(_cmsVEC3length,
//GO(_cmsVEC3minus,
//GO(cmsWhitePointFromTemp,
//GO(_cmsWrite15Fixed16Number,
//GO(_cmsWriteAlignment,
//GO(_cmsWriteFloat32Number,
//GO(_cmsWriteHeader,
//GO(_cmsWriteProfileSequence,
//GO(cmsWriteRawTag,
//GO(cmsWriteTag,
//GO(_cmsWriteTypeBase,
//GO(_cmsWriteUInt16Array,
//GO(_cmsWriteUInt16Number,
//GO(_cmsWriteUInt32Number,
//GO(_cmsWriteUInt64Number,
//GO(_cmsWriteUInt8Number,
//GO(_cmsWriteXYZNumber,
//GO(cmsxyY2XYZ,
//GO(cmsXYZ2Lab,
//GO(cmsXYZ2xyY,
//GO(cmsXYZEncoded2Float,
//DATA(_edata,
//DATAB(_end,
//DATAB(__end__,
//GO(_fini,
//GO(from16toDBL,
//GO(from16toFLT,
//GO(_init,
+101
View File
@@ -0,0 +1,101 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <dlfcn.h>
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
#include "x86emu.h"
#include "emu/x86emu_private.h"
#include "box86context.h"
#include "librarian.h"
#include "callback.h"
const char* ldaprName = "libldap_r-2.4.so.2";
#define LIBNAME ldapr
static library_t *my_lib = NULL;
typedef int (*iFpppppupp_t) (void*, void*, void*, void* , void*, unsigned, void*, void*);
#define SUPER() \
GO(ldap_sasl_interactive_bind_s, iFpppppupp_t) \
typedef struct ldapr_my_s {
// functions
#define GO(A, B) B A;
SUPER()
#undef GO
} ldapr_my_t;
void* getLdaprMy(library_t* lib)
{
ldapr_my_t* my = (ldapr_my_t*)calloc(1, sizeof(ldapr_my_t));
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
SUPER()
#undef GO
return my;
}
#undef SUPER
void freeLdaprMy(void* lib)
{
//ldapr_my_t *my = (ldapr_my_t *)lib;
}
#define SUPER() \
GO(0) \
GO(1) \
GO(2) \
GO(3) \
GO(4)
// LDAP_SASL_INTERACT_PROC ...
#define GO(A) \
static uintptr_t my_LDAP_SASL_INTERACT_PROC_fct_##A = 0; \
static int my_LDAP_SASL_INTERACT_PROC_##A(void* a, unsigned b, void* c, void* d) \
{ \
return RunFunction(my_context, my_LDAP_SASL_INTERACT_PROC_fct_##A, 4, a, b, c, d); \
}
SUPER()
#undef GO
static void* find_LDAP_SASL_INTERACT_PROC_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_LDAP_SASL_INTERACT_PROC_fct_##A == (uintptr_t)fct) return my_LDAP_SASL_INTERACT_PROC_##A;
SUPER()
#undef GO
#define GO(A) if(my_LDAP_SASL_INTERACT_PROC_fct_##A == 0) {my_LDAP_SASL_INTERACT_PROC_fct_##A = (uintptr_t)fct; return my_LDAP_SASL_INTERACT_PROC_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libldap_r LDAP_SASL_INTERACT_PROC callback\n");
return NULL;
}
#undef SUPER
EXPORT int my_ldap_sasl_interactive_bind_s(x86emu_t* emu, void* ld, void* dn, void* mechs, void* sctrls, void* cctrls, unsigned flags, void* f, void* defaults)
{
ldapr_my_t* my = (ldapr_my_t*)my_lib->priv.w.p2;
return my->ldap_sasl_interactive_bind_s(ld, dn, mechs, sctrls, cctrls, flags, find_LDAP_SASL_INTERACT_PROC_Fct(f), defaults);
}
#define CUSTOM_INIT \
lib->priv.w.p2 = getLdaprMy(lib); \
lib->priv.w.needed = 1; \
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
lib->priv.w.neededlibs[0] = strdup("liblber-2.4.so.2"); \
my_lib = lib;
#define CUSTOM_FINI \
freeLdaprMy(lib->priv.w.p2); \
free(lib->priv.w.p2); \
my_lib = NULL;
#include "wrappedlib_init.h"
+510
View File
@@ -0,0 +1,510 @@
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
#error Meh....
#endif
GO(ldap_abandon, iFpi)
GO(ldap_abandon_ext, iFpipp)
//GO(ldap_add,
GO(ldap_add_ext, iFpppppp)
GO(ldap_add_ext_s, iFppppp)
//GO(ldap_add_result_entry,
//GO(ldap_add_s,
//GO(ldap_alloc_ber_with_options,
//GO(ldap_append_referral,
//GO(ldap_attributetype2bv,
//GO(ldap_attributetype2name,
//GO(ldap_attributetype2str,
//GO(ldap_attributetype_free,
GO(ldap_bind, iFpppi)
GO(ldap_bind_s, iFpppi)
//GO(ldap_build_add_req,
//GO(ldap_build_bind_req,
//GO(ldap_build_compare_req,
//GO(ldap_build_delete_req,
//GO(ldap_build_extended_req,
//GO(ldap_build_moddn_req,
//GO(ldap_build_modify_req,
//GO(ldap_build_search_req,
//GO(ldap_bv2dn,
//GO(ldap_bv2dn_x,
//GO(ldap_bv2escaped_filter_value,
//GO(ldap_bv2escaped_filter_value_len,
//GO(ldap_bv2escaped_filter_value_x,
//GO(ldap_bv2rdn,
//GO(ldap_bv2rdn_x,
//GO(ldap_cancel,
//GO(ldap_cancel_s,
//GO(ldap_charray2str,
//GO(ldap_charray_add,
//GO(ldap_charray_dup,
//GO(ldap_charray_free,
//GO(ldap_charray_inlist,
//GO(ldap_charray_merge,
//GO(ldap_chase_referrals,
//GO(ldap_chase_v3referrals,
//GO(ldap_clear_select_write,
//GO(ldap_compare,
GO(ldap_compare_ext, iFppppppp)
GO(ldap_compare_ext_s, iFpppppp)
//GO(ldap_compare_s,
//GO(ldap_connect_to_host,
//GO(ldap_connect_to_path,
//GO(ldap_contentrule2bv,
//GO(ldap_contentrule2name,
//GO(ldap_contentrule2str,
//GO(ldap_contentrule_free,
GO(ldap_control_create, iFpipip)
GO(ldap_control_dup, pFp)
GO(ldap_control_find, pFppp)
GO(ldap_control_free, vFp)
GO(ldap_controls_dup, pFp)
GO(ldap_controls_free, vFp)
GO(ldap_count_entries, iFpp)
//GO(ldap_count_messages,
GO(ldap_count_references, iFpp)
GO(ldap_count_values, iFp)
GO(ldap_count_values_len, iFp)
//GO(ldap_create,
//GO(ldap_create_assertion_control,
//GO(ldap_create_assertion_control_value,
//GO(ldap_create_control,
//GO(ldap_create_deref_control,
//GO(ldap_create_deref_control_value,
//GO(ldap_create_page_control,
//GO(ldap_create_page_control_value,
//GO(ldap_create_passwordpolicy_control,
//GO(ldap_create_session_tracking_control,
//GO(ldap_create_session_tracking_value,
GO(ldap_create_sort_control, iFppip)
//GO(ldap_create_sort_control_value,
//GO(ldap_create_sort_keylist,
GO(ldap_create_vlv_control, iFppp)
//GO(ldap_create_vlv_control_value,
GO(ldap_dcedn2dn, pFp)
GO(ldap_delete, iFpp)
GO(ldap_delete_ext, iFppppp)
GO(ldap_delete_ext_s, iFpppp)
//GO(ldap_delete_result_entry,
GO(ldap_delete_s, iFpp)
//GO(ldap_derefresponse_free,
//GO(ldap_destroy,
GO(ldap_dn2ad_canonical, pFp)
//GO(ldap_dn2bv,
//GO(ldap_dn2bv_x,
GO(ldap_dn2dcedn, pFp)
//GO(ldap_dn2domain,
GO(ldap_dn2str, iFppu)
GO(ldap_dn2ufn, pFp)
//GO(ldap_dnfree,
//GO(ldap_dnfree_x,
//GO(ldap_dn_normalize,
//GO(ldap_domain2dn,
//GO(ldap_domain2hostlist,
//GO(ldap_dump_connection,
//GO(ldap_dump_requests_and_responses,
//GO(ldap_dup,
//GO(ldap_err2string,
GO(ldap_explode_dn, pFpi)
GO(ldap_explode_rdn, pFpi)
GO(ldap_extended_operation, iFpppppp)
GO(ldap_extended_operation_s, iFppppppp)
//GO(ldap_find_control,
//GO(ldap_find_request_by_msgid,
GO(ldap_first_attribute, pFppp)
GO(ldap_first_entry, pFpp)
//GO(ldap_first_message,
GO(ldap_first_reference, pFpp)
//GO(ldap_free_connection,
//GO(ldap_free_request,
//GO(ldap_free_select_info,
//GO(ldap_free_sort_keylist,
//GO(ldap_free_urldesc,
//GO(ldap_free_urllist,
//GO(ldap_get_attribute_ber,
GO(ldap_get_dn, pFpp)
//GO(ldap_get_dn_ber,
//GO(ldap_get_entry_controls,
//GO(ldap_get_message_ber,
GO(ldap_get_option, iFpip)
GO(ldap_get_values, pFppp)
GO(ldap_get_values_len, pFppp)
//GO(ldap_gssapi_bind,
//GO(ldap_gssapi_bind_s,
//GO(ldap_host_connected_to,
GO(ldap_init, pFpi)
GO(ldap_init_fd, iFuipp)
GO(ldap_initialize, iFpp)
GO(ldap_install_tls, iFp)
//GO(ldap_int_bisect_delete,
//GO(ldap_int_bisect_find,
//GO(ldap_int_bisect_insert,
//GO(ldap_int_check_async_open,
//GO(ldap_int_client_controls,
//GO(ldap_int_connect_cbs,
//GO(ldap_int_error_init,
//GO(ldap_int_flush_request,
//DATA(ldap_int_global_options,
//DATAB(ldap_int_gmtime_mutex,
//DATAB(ldap_int_hostname,
//DATAB(ldap_int_hostname_mutex,
//DATAB(ldap_int_inet4or6,
//GO(ldap_int_initialize,
//GO(ldap_int_initialize_global_options,
//GO(ldap_int_msgtype2str,
//GO(ldap_int_open_connection,
//GO(ldap_int_parse_numericoid,
//GO(ldap_int_parse_ruleid,
//GO(ldap_int_poll,
//GO(ldap_int_put_controls,
//DATAB(ldap_int_resolv_mutex,
//GO(ldap_int_sasl_bind,
//GO(ldap_int_sasl_close,
//GO(ldap_int_sasl_config,
//GO(ldap_int_sasl_external,
//GO(ldap_int_sasl_get_option,
//GO(ldap_int_sasl_init,
//GO(ldap_int_sasl_open,
//GO(ldap_int_sasl_set_option,
//GO(ldap_int_select,
//GO(ldap_int_thread_destroy,
//GO(ldap_int_thread_initialize,
//GO(ldap_int_thread_pool_shutdown,
//GO(ldap_int_thread_pool_startup,
//GO(ldap_int_timeval_dup,
//GO(ldap_int_tls_config,
//GO(ldap_int_tls_destroy,
//DATA(ldap_int_tls_impl,
//GO(ldap_int_tls_start,
//GO(ldap_int_utils_init,
//GO(ldap_is_ldapi_url,
//GO(ldap_is_ldaps_url,
//GO(ldap_is_ldap_url,
//GO(ldap_is_read_ready,
//GO(ldap_is_write_ready,
//GO(ldap_ld_free,
//GO(ldap_log_printf,
//GO(ldap_mark_select_clear,
//GO(ldap_mark_select_read,
//GO(ldap_mark_select_write,
//GO(ldap_matchingrule2bv,
//GO(ldap_matchingrule2name,
//GO(ldap_matchingrule2str,
//GO(ldap_matchingrule_free,
//GO(ldap_matchingruleuse2bv,
//GO(ldap_matchingruleuse2name,
//GO(ldap_matchingruleuse2str,
//GO(ldap_matchingruleuse_free,
GO(ldap_memalloc, pFL)
GO(ldap_memcalloc, pFLL)
GO(ldap_memfree, vFp)
GO(ldap_memrealloc, pFpL)
GO(ldap_memvfree, vFp)
//GO(ldap_modify,
GO(ldap_modify_ext, iFpppppp)
GO(ldap_modify_ext_s, iFppppp)
//GO(ldap_modify_s,
//GO(ldap_modrdn,
//GO(ldap_modrdn2,
//GO(ldap_modrdn2_s,
//GO(ldap_modrdn_s,
GO(ldap_mods_free, vFpp)
//GO(ldap_msgdelete,
GO(ldap_msgfree, iFp)
GO(ldap_msgid, iFp)
GO(ldap_msgtype, iFp)
//GO(ldap_nameform2bv,
//GO(ldap_nameform2name,
//GO(ldap_nameform2str,
//GO(ldap_nameform_free,
//GO(ldap_new_connection,
//GO(ldap_new_select_info,
GO(ldap_next_attribute, pFppp)
GO(ldap_next_entry, pFpp)
//GO(ldap_next_message,
GO(ldap_next_reference, pFpp)
//GO(ldap_ntlm_bind,
//GO(ldap_objectclass2bv,
//GO(ldap_objectclass2name,
//GO(ldap_objectclass2str,
//GO(ldap_objectclass_free,
GO(ldap_open, pFpi)
//GO(ldap_open_defconn,
//GO(ldap_open_internal_connection,
//GO(ldap_parse_deref_control,
//GO(ldap_parse_derefresponse_control,
GO(ldap_parse_extended_result, iFppppi)
//GO(ldap_parse_intermediate,
//GO(ldap_parse_ntlm_bind_result,
//GO(ldap_parse_page_control,
//GO(ldap_parse_pageresponse_control,
//GO(ldap_parse_passwd,
//GO(ldap_parse_passwordpolicy_control,
GO(ldap_parse_reference, iFppppi)
//GO(ldap_parse_refresh,
GO(ldap_parse_result, iFpppppppi)
GO(ldap_parse_sasl_bind_result, iFpppi)
//GO(ldap_parse_session_tracking_control,
GO(ldap_parse_sortresponse_control, iFpppp)
GO(ldap_parse_vlvresponse_control, iFpppppp)
//GO(ldap_parse_whoami,
//GO(ldap_passwd,
//GO(ldap_passwd_s,
//GO(ldap_passwordpolicy_err2txt,
//GO(ldap_perror,
//GO(ldap_put_vrFilter,
//GO(ldap_pvt_bv2scope,
//GO(ldap_pvt_csnstr,
//GO(ldap_pvt_ctime,
//GO(ldap_pvt_discard,
//GO(ldap_pvt_filter_value_unescape,
//GO(ldap_pvt_find_wildcard,
//GO(ldap_pvt_get_controls,
//GO(ldap_pvt_get_fqdn,
//GO(ldap_pvt_get_hname,
//GO(ldap_pvt_gethostbyaddr_a,
//GO(ldap_pvt_gethostbyname_a,
//GO(ldap_pvt_gettime,
//GO(ldap_pvt_hex_unescape,
//GO(ldap_pvt_put_control,
//GO(ldap_pvt_put_filter,
//GO(ldap_pvt_runqueue_find,
//GO(ldap_pvt_runqueue_insert,
//GO(ldap_pvt_runqueue_isrunning,
//GO(ldap_pvt_runqueue_next_sched,
//GO(ldap_pvt_runqueue_persistent_backload,
//GO(ldap_pvt_runqueue_remove,
//GO(ldap_pvt_runqueue_resched,
//GO(ldap_pvt_runqueue_runtask,
//GO(ldap_pvt_runqueue_stoptask,
//GO(ldap_pvt_sasl_generic_install,
//GO(ldap_pvt_sasl_generic_remove,
//GO(ldap_pvt_sasl_getmechs,
//GO(ldap_pvt_sasl_install,
//GO(ldap_pvt_sasl_mutex_dispose,
//GO(ldap_pvt_sasl_mutex_lock,
//GO(ldap_pvt_sasl_mutex_new,
//GO(ldap_pvt_sasl_mutex_unlock,
//GO(ldap_pvt_sasl_remove,
//GO(ldap_pvt_sasl_secprops,
//GO(ldap_pvt_sasl_secprops_unparse,
//GO(ldap_pvt_scope2bv,
//GO(ldap_pvt_scope2str,
//GO(ldap_pvt_search,
//GO(ldap_pvt_search_s,
//DATA(ldap_pvt_sockbuf_io_sasl_generic,
//GO(ldap_pvt_str2lower,
//GO(ldap_pvt_str2lowerbv,
//GO(ldap_pvt_str2scope,
//GO(ldap_pvt_str2upper,
//GO(ldap_pvt_str2upperbv,
//GO(ldap_pvt_strtok,
//GO(ldap_pvt_thread_cond_broadcast,
//GO(ldap_pvt_thread_cond_destroy,
//GO(ldap_pvt_thread_cond_init,
//GO(ldap_pvt_thread_cond_signal,
//GO(ldap_pvt_thread_cond_wait,
//GO(ldap_pvt_thread_create,
//GO(ldap_pvt_thread_destroy,
//GO(ldap_pvt_thread_exit,
//GO(ldap_pvt_thread_get_concurrency,
//GO(ldap_pvt_thread_initialize,
//GO(ldap_pvt_thread_join,
//GO(ldap_pvt_thread_key_create,
//GO(ldap_pvt_thread_key_destroy,
//GO(ldap_pvt_thread_key_getdata,
//GO(ldap_pvt_thread_key_setdata,
//GO(ldap_pvt_thread_kill,
//GO(ldap_pvt_thread_mutex_destroy,
//GO(ldap_pvt_thread_mutex_init,
//GO(ldap_pvt_thread_mutex_lock,
//GO(ldap_pvt_thread_mutex_trylock,
//GO(ldap_pvt_thread_mutex_unlock,
//GO(ldap_pvt_thread_pool_backload,
//GO(ldap_pvt_thread_pool_context,
//GO(ldap_pvt_thread_pool_context_reset,
//GO(ldap_pvt_thread_pool_destroy,
//GO(ldap_pvt_thread_pool_getkey,
//GO(ldap_pvt_thread_pool_idle,
//GO(ldap_pvt_thread_pool_init,
//GO(ldap_pvt_thread_pool_maxthreads,
//GO(ldap_pvt_thread_pool_pause,
//GO(ldap_pvt_thread_pool_pausecheck,
//GO(ldap_pvt_thread_pool_pausing,
//GO(ldap_pvt_thread_pool_purgekey,
//GO(ldap_pvt_thread_pool_query,
//GO(ldap_pvt_thread_pool_resume,
//GO(ldap_pvt_thread_pool_retract,
//GO(ldap_pvt_thread_pool_setkey,
//GO(ldap_pvt_thread_pool_submit,
//GO(ldap_pvt_thread_pool_tid,
//GO(ldap_pvt_thread_pool_unidle,
//GO(ldap_pvt_thread_rdwr_destroy,
//GO(ldap_pvt_thread_rdwr_init,
//GO(ldap_pvt_thread_rdwr_rlock,
//GO(ldap_pvt_thread_rdwr_rtrylock,
//GO(ldap_pvt_thread_rdwr_runlock,
//GO(ldap_pvt_thread_rdwr_wlock,
//GO(ldap_pvt_thread_rdwr_wtrylock,
//GO(ldap_pvt_thread_rdwr_wunlock,
//GO(ldap_pvt_thread_rmutex_destroy,
//GO(ldap_pvt_thread_rmutex_init,
//GO(ldap_pvt_thread_rmutex_lock,
//GO(ldap_pvt_thread_rmutex_trylock,
//GO(ldap_pvt_thread_rmutex_unlock,
//GO(ldap_pvt_thread_self,
//GO(ldap_pvt_thread_set_concurrency,
//GO(ldap_pvt_thread_sleep,
//GO(ldap_pvt_thread_yield,
//GO(ldap_pvt_tls_accept,
//GO(ldap_pvt_tls_check_hostname,
//GO(ldap_pvt_tls_ctx_free,
//GO(ldap_pvt_tls_destroy,
//GO(ldap_pvt_tls_get_my_dn,
//GO(ldap_pvt_tls_get_option,
//GO(ldap_pvt_tls_get_peer_dn,
//GO(ldap_pvt_tls_get_strength,
//GO(ldap_pvt_tls_init,
//GO(ldap_pvt_tls_init_def_ctx,
//GO(ldap_pvt_tls_inplace,
//GO(ldap_pvt_tls_sb_ctx,
//GO(ldap_pvt_tls_set_option,
//GO(ldap_pvt_url_scheme2proto,
//GO(ldap_pvt_url_scheme2tls,
//GO(ldap_pvt_url_scheme_port,
//GO(ldap_rdn2bv,
//GO(ldap_rdn2bv_x,
//GO(ldap_rdn2str,
//GO(ldap_rdnfree,
//GO(ldap_rdnfree_x,
//GO(ldap_refresh,
//GO(ldap_refresh_s,
GO(ldap_rename, iFppppippp)
//GO(ldap_rename2,
//GO(ldap_rename2_s,
GO(ldap_rename_s, iFppppipp)
GO(ldap_result, iFppipp)
//GO(ldap_result2error,
//GO(ldap_return_request,
GO(ldap_sasl_bind, iFppppppp)
GO(ldap_sasl_bind_s, iFppppppp)
//GO(ldap_sasl_interactive_bind,
GOM(ldap_sasl_interactive_bind_s, iFEpppppupp)
//GO(ldap_scherr2str,
//GO(ldap_search,
GO(ldap_search_ext, iFppippipppip)
GO(ldap_search_ext_s, iFppippipppip)
//GO(ldap_search_s,
//GO(ldap_search_st,
//GO(ldap_send_initial_request,
//GO(ldap_send_server_request,
//GO(ldap_send_unbind,
//GO(ldap_set_ber_options,
//GO(ldap_set_nextref_proc,
GO(ldap_set_option, iFpip)
//GOM(ldap_set_rebind_proc, iFEpBp)
//GO(ldap_set_urllist_proc,
GO(ldap_simple_bind, iFppp)
GO(ldap_simple_bind_s, iFppp)
//GO(ldap_sort_entries,
//GO(ldap_sort_strcasecmp,
//GO(ldap_sort_values,
GO(ldap_start_tls, iFp)
GO(ldap_start_tls_s, iFppp)
//GO(ldap_str2attributetype,
//GO(ldap_str2charray,
//GO(ldap_str2contentrule,
GO(ldap_str2dn, iFppu)
//GO(ldap_str2matchingrule,
//GO(ldap_str2matchingruleuse,
//GO(ldap_str2nameform,
//GO(ldap_str2objectclass,
//GO(ldap_str2rdn,
//GO(ldap_str2structurerule,
//GO(ldap_str2syntax,
GO(ldap_strdup, pFp)
//GO(ldap_structurerule2bv,
//GO(ldap_structurerule2name,
//GO(ldap_structurerule2str,
//GO(ldap_structurerule_free,
//GO(ldap_sync_destroy,
//GO(ldap_sync_init,
//GO(ldap_sync_initialize,
//GO(ldap_sync_init_refresh_and_persist,
//GO(ldap_sync_init_refresh_only,
//GO(ldap_sync_poll,
//GO(ldap_syntax2bv,
//GO(ldap_syntax2name,
//GO(ldap_syntax2str,
//GO(ldap_syntax_free,
GO(ldap_tls_inplace, iFp)
//GO(ldap_turn,
//GO(ldap_turn_s,
//GO(ldap_ucs_to_utf8s,
GO(ldap_unbind, iFp)
GO(ldap_unbind_ext, iFppp)
GO(ldap_unbind_ext_s, iFppp)
GO(ldap_unbind_s, iFp)
//GO(ldap_url_desc2str,
//GO(ldap_url_dup,
//GO(ldap_url_duplist,
//GO(ldap_url_list2hosts,
//GO(ldap_url_list2urls,
//GO(ldap_url_parse,
//GO(ldap_url_parse_ext,
//GO(ldap_url_parsehosts,
//GO(ldap_url_parselist,
//GO(ldap_url_parselist_ext,
//GO(ldap_utf8_bytes,
//GO(ldap_utf8_charlen,
//GO(ldap_utf8_charlen2,
//GO(ldap_utf8_chars,
//GO(ldap_utf8_copy,
//GO(ldap_utf8_isalnum,
//GO(ldap_utf8_isalpha,
//GO(ldap_utf8_isascii,
//GO(ldap_utf8_isdigit,
//GO(ldap_utf8_islower,
//GO(ldap_utf8_isspace,
//GO(ldap_utf8_isupper,
//GO(ldap_utf8_isxdigit,
//GO(ldap_utf8_next,
//GO(ldap_utf8_offset,
//GO(ldap_utf8_prev,
//GO(ldap_utf8_strchr,
//GO(ldap_utf8_strcspn,
//GO(ldap_utf8_strpbrk,
//GO(ldap_utf8_strspn,
//GO(ldap_utf8_strtok,
//GO(ldap_value_dup,
GO(ldap_value_free, vFp)
GO(ldap_value_free_len, vFp)
//GO(ldap_whoami,
//GO(ldap_whoami_s,
//GO(ldap_X509dn2bv,
//GO(ldap_x_mbs_to_utf8s,
//GO(ldap_x_mb_to_utf8,
//GO(ldap_x_ucs4_to_utf8,
//GO(ldap_x_utf8s_to_mbs,
//GO(ldap_x_utf8s_to_wcs,
//GO(ldap_x_utf8_to_mb,
//GO(ldap_x_utf8_to_ucs4,
//GO(ldap_x_utf8_to_wc,
//GO(ldap_x_wcs_to_utf8s,
//GO(ldap_x_wc_to_utf8,
//GO(ldif_close,
//GO(ldif_countlines,
//DATAB(ldif_debug,
//GO(ldif_fetch_url,
//GO(ldif_getline,
//GO(ldif_is_not_printable,
//GO(ldif_must_b64_encode_register,
//GO(ldif_must_b64_encode_release,
//GO(ldif_open,
//GO(ldif_open_url,
//GO(ldif_parse_line,
//GO(ldif_parse_line2,
//GO(ldif_put,
//GO(ldif_put_wrap,
//GO(ldif_read_record,
//GO(ldif_sput,
//GO(ldif_sput_wrap,
+2 -2
View File
@@ -208,7 +208,7 @@ int FUNC(_get)(library_t* lib, const char* name, uintptr_t *offs, uint32_t *sz)
#endif
}
//POST
if(!addr)
if(!addr && !size)
return 0;
*offs = addr;
*sz = size;
@@ -231,7 +231,7 @@ int FUNC(_getnoweak)(library_t* lib, const char* name, uintptr_t *offs, uint32_t
#endif
}
//POST
if(!addr)
if(!addr && !size)
return 0;
*offs = addr;
*sz = size;
+1 -1
View File
@@ -52,7 +52,7 @@ void* getAsoundMy(library_t* lib)
SUPER()
#undef GO
// setup custom error handler
my_snd_lib_error = AddCheckBridge(my_context->system, vFpipipV, default_error_handler, 0);
my_snd_lib_error = AddCheckBridge(my_context->system, my_context, vFpipipV, default_error_handler, 0);
//all done
return my;
}
+143 -70
View File
@@ -70,6 +70,10 @@
#ifndef __NR_recvmmsg
#define __NR_recvmmsg (__NR_SYSCALL_BASE+365)
#endif
#elif defined(__arm__)
#ifndef __NR_accept4
#define __NR_accept4 (__NR_SYSCALL_BASE+366)
#endif
#endif
// need to undef all read / read64 stuffs!
@@ -172,12 +176,6 @@ void freeLIBCMy(void* lib)
// empty for now
}
void libc1ArgCallback(void *userdata)
{
x86emu_t *emu = (x86emu_t*) userdata;
RunCallback(emu);
}
// utility functions
#define SUPER() \
GO(0) \
@@ -1172,23 +1170,28 @@ EXPORT int my_statfs64(const char* path, void* buf)
}
typedef struct compare_r_s {
x86emu_t* emu;
uintptr_t f;
void* data;
int r;
} compare_r_t;
static int my_compare_r_cb(void* a, void* b, x86emu_t* emu)
static int my_compare_r_cb(void* a, void* b, compare_r_t* arg)
{
SetCallbackArgs(emu, 2, a, b);
return (int)RunCallback(emu);
return (int)RunFunctionWithEmu(arg->emu, 0, arg->f, 2+arg->r, a, b, arg->data);
}
EXPORT void my_qsort(x86emu_t* emu, void* base, size_t nmemb, size_t size, void* fnc)
{
x86emu_t *emucb = AddSharedCallback(emu, (uintptr_t)fnc, 2, NULL, NULL, NULL, NULL);
qsort_r(base, nmemb, size, (__compar_d_fn_t)my_compare_r_cb, emucb);
FreeCallback(emucb);
compare_r_t args;
args.emu = emu; args.f = (uintptr_t)fnc; args.r = 0; args.data = NULL;
qsort_r(base, nmemb, size, (__compar_d_fn_t)my_compare_r_cb, &args);
}
EXPORT void my_qsort_r(x86emu_t* emu, void* base, size_t nmemb, size_t size, void* fnc, void* arg)
EXPORT void my_qsort_r(x86emu_t* emu, void* base, size_t nmemb, size_t size, void* fnc, void* data)
{
x86emu_t *emucb = AddSharedCallback(emu, (uintptr_t)fnc, 3, NULL, NULL, arg, NULL);
qsort_r(base, nmemb, size, (__compar_d_fn_t)my_compare_r_cb, emucb);
FreeCallback(emucb);
compare_r_t args;
args.emu = emu; args.f = (uintptr_t)fnc; args.r = 1; args.data = data;
qsort_r(base, nmemb, size, (__compar_d_fn_t)my_compare_r_cb, &args);
}
EXPORT void* my_bsearch(x86emu_t* emu, void* key, void* base, size_t nmemb, size_t size, void* fnc)
@@ -1493,6 +1496,14 @@ EXPORT int32_t my_open(x86emu_t* emu, void* pathname, int32_t flags, uint32_t mo
}
EXPORT int32_t my___open(x86emu_t* emu, void* pathname, int32_t flags, uint32_t mode) __attribute__((alias("my_open")));
#ifdef DYNAREC
static int hasDBFromAddress(uintptr_t addr)
{
int idx = (addr>>DYNAMAP_SHIFT);
return my_context->dynmap[idx]?1:0;
}
#endif
EXPORT int32_t my_read(int fd, void* buf, uint32_t count)
{
int ret = read(fd, buf, count);
@@ -1500,7 +1511,7 @@ EXPORT int32_t my_read(int fd, void* buf, uint32_t count)
if(ret!=count && ret>0) {
// continue reading...
void* p = buf+ret;
if(getDBFromAddress((uintptr_t)p)) {
if(hasDBFromAddress((uintptr_t)p)) {
// allow writing the whole block (this happens with HalfLife, libMiles load code directly from .mix and other file like that)
unprotectDB((uintptr_t)p, count-ret);
int l;
@@ -2207,10 +2218,19 @@ EXPORT void* my_mmap(x86emu_t* emu, void *addr, unsigned long length, int prot,
if(box86_log<LOG_DEBUG) {dynarec_log(LOG_DEBUG, "%p\n", ret);}
#ifdef DYNAREC
if(box86_dynarec && ret!=(void*)-1) {
if(prot& PROT_EXEC)
addDBFromAddressRange((uintptr_t)ret, length, 1);
else
cleanDBFromAddressRange((uintptr_t)ret, length, 0);
if(flags&0x100000 && addr!=ret)
{
// program used MAP_FIXED_NOREPLACE but the host linux didn't support it
// and responded with a different address, so ignore it
} else {
if(prot& PROT_EXEC)
addDBFromAddressRange(my_context, (uintptr_t)ret, length, ((flags&MAP_ANONYMOUS) && !box86_dynarec_safemmap)?1:0);
else
cleanDBFromAddressRange(my_context, (uintptr_t)ret, length, 0);
}
} else if(box86_dynarec && ret==(void*)-1 && !((flags&MAP_ANONYMOUS) && !box86_dynarec_safemmap) && addr) {
// hack, the programs wanted to map a file, but system didn't want. Still, mark the memory as ok with linker
addDBFromAddressRange(my_context, (uintptr_t)addr, length, 0);
}
#endif
return ret;
@@ -2223,10 +2243,19 @@ EXPORT void* my_mmap64(x86emu_t* emu, void *addr, unsigned long length, int prot
if(box86_log<LOG_DEBUG) {dynarec_log(LOG_DEBUG, "%p\n", ret);}
#ifdef DYNAREC
if(box86_dynarec && ret!=(void*)-1) {
if(prot& PROT_EXEC)
addDBFromAddressRange((uintptr_t)ret, length, 1);
else
cleanDBFromAddressRange((uintptr_t)ret, length, 0);
if(flags&0x100000 && addr!=ret)
{
// program used MAP_FIXED_NOREPLACE but the host linux didn't support it
// and responded with a different address, so ignore it
} else {
if(prot& PROT_EXEC)
addDBFromAddressRange(my_context, (uintptr_t)ret, length, ((flags&MAP_ANONYMOUS) && !box86_dynarec_safemmap)?1:0);
else
cleanDBFromAddressRange(my_context, (uintptr_t)ret, length, 0);
}
} else if(box86_dynarec && ret==(void*)-1 && !((flags&MAP_ANONYMOUS) && !box86_dynarec_safemmap) && addr) {
// hack, the programs wanted to map a file, but system didn't want. Still, mark the memory as ok with linker
addDBFromAddressRange(my_context, (uintptr_t)addr, length, 0);
}
#endif
return ret;
@@ -2237,7 +2266,7 @@ EXPORT int my_munmap(x86emu_t* emu, void* addr, unsigned long length)
dynarec_log(LOG_DEBUG, "munmap(%p, %lu)\n", addr, length);
#ifdef DYNAREC
if(box86_dynarec)
cleanDBFromAddressRange((uintptr_t)addr, length, 1);
cleanDBFromAddressRange(my_context, (uintptr_t)addr, length, 1);
#endif
return munmap(addr, length);
}
@@ -2249,64 +2278,52 @@ EXPORT int my_mprotect(x86emu_t* emu, void *addr, unsigned long len, int prot)
#ifdef DYNAREC
if(box86_dynarec) {
if(prot& PROT_EXEC)
addDBFromAddressRange((uintptr_t)addr, len, 1);
addDBFromAddressRange(my_context, (uintptr_t)addr, len, 1);
else
cleanDBFromAddressRange((uintptr_t)addr, len, 0);
cleanDBFromAddressRange(my_context, (uintptr_t)addr, len, 0);
}
#endif
return ret;
}
static ssize_t my_cookie_read(void *cookie, char *buf, size_t size)
{
x86emu_t *emu = (x86emu_t*)cookie;
SetCallbackAddress(emu, (uintptr_t)GetCallbackArg(emu, 6));
SetCallbackArg(emu, 1, buf);
SetCallbackArg(emu, 2, (void*)size);
SetCallbackNArg(emu, 3);
return RunCallback(emu);
}
static ssize_t my_cookie_write(void *cookie, const char *buf, size_t size)
{
x86emu_t *emu = (x86emu_t*)cookie;
SetCallbackAddress(emu, (uintptr_t)GetCallbackArg(emu, 7));
SetCallbackArg(emu, 1, (void*)buf);
SetCallbackArg(emu, 2, (void*)size);
SetCallbackNArg(emu, 3);
return RunCallback(emu);
}
static int my_cookie_seek(void *cookie, off64_t *offset, int whence)
{
x86emu_t *emu = (x86emu_t*)cookie;
SetCallbackAddress(emu, (uintptr_t)GetCallbackArg(emu, 8));
SetCallbackArg(emu, 1, offset);
SetCallbackArg(emu, 2, (void*)whence);
SetCallbackNArg(emu, 3);
return RunCallback(emu);
typedef struct my_cookie_s {
uintptr_t r, w, s, c;
void* cookie;
} my_cookie_t;
}
static int my_cookie_close(void *cookie)
static ssize_t my_cookie_read(void *p, char *buf, size_t size)
{
x86emu_t *emu = (x86emu_t*)cookie;
void* cl = (void*)GetCallbackArg(emu, 9);
my_cookie_t* cookie = (my_cookie_t*)p;
return (ssize_t)RunFunction(my_context, cookie->r, 3, cookie->cookie, buf, size);
}
static ssize_t my_cookie_write(void *p, const char *buf, size_t size)
{
my_cookie_t* cookie = (my_cookie_t*)p;
return (ssize_t)RunFunction(my_context, cookie->w, 3, cookie->cookie, buf, size);
}
static int my_cookie_seek(void *p, off64_t *offset, int whence)
{
my_cookie_t* cookie = (my_cookie_t*)p;
return RunFunction(my_context, cookie->s, 3, cookie->cookie, offset, whence);
}
static int my_cookie_close(void *p)
{
my_cookie_t* cookie = (my_cookie_t*)p;
int ret = 0;
if(cl) {
SetCallbackAddress(emu, (uintptr_t)cl);
SetCallbackNArg(emu, 1);
ret = (int)RunCallback(emu);
}
// free anyway, even if ret is not null?
FreeCallback(emu);
if(cookie->c)
ret = RunFunction(my_context, cookie->c, 1, cookie->cookie);
free(cookie);
return ret;
}
EXPORT void* my_fopencookie(x86emu_t* emu, void* cookie, void* mode, void* read, void* write, void* seek, void* close)
{
cookie_io_functions_t io_funcs = {read?my_cookie_read:NULL, write?my_cookie_write:NULL, seek?my_cookie_seek:NULL, my_cookie_close};
x86emu_t *cb = AddCallback(emu, 0, 3, cookie, NULL, NULL, NULL);
SetCallbackArg(emu, 6, read);
SetCallbackArg(emu, 7, write);
SetCallbackArg(emu, 8, seek);
SetCallbackArg(emu, 9, close);
my_cookie_t *cb = (my_cookie_t*)calloc(1, sizeof(my_cookie_t));
cb->r = (uintptr_t)read;
cb->w = (uintptr_t)write;
cb->s = (uintptr_t)seek;
cb->c = (uintptr_t)close;
cb->cookie = cookie;
return fopencookie(cb, mode, io_funcs);
}
@@ -2380,6 +2397,57 @@ EXPORT void* my_malloc(unsigned long size)
}
#endif
#ifdef PANDORA
#define RENAME_NOREPLACE (1 << 0)
#define RENAME_EXCHANGE (1 << 1)
#define RENAME_WHITEOUT (1 << 2)
EXPORT int my_renameat2(int olddirfd, void* oldpath, int newdirfd, void* newpath, uint32_t flags)
{
// simulate that function, but
if(flags&RENAME_NOREPLACE) {
if(FileExist(newpath, -1)) {
errno = EEXIST;
return -1;
}
flags &= ~RENAME_NOREPLACE;
}
if(!flags) return renameat(olddirfd, oldpath, newdirfd, newpath);
if(flags&RENAME_WHITEOUT) {
errno = EINVAL;
return -1; // not handling that
}
if((flags&RENAME_EXCHANGE) && (olddirfd==-1) && (newdirfd==-1)) {
// cannot do atomically...
char* tmp = (char*)malloc(strlen(oldpath)+10); // create a temp intermediary
tmp = strcat(oldpath, ".tmp");
int ret = renameat(-1, oldpath, -1, tmp);
if(ret==-1) return -1;
ret = renameat(-1, newpath, -1, oldpath);
if(ret==-1) return -1;
ret = renameat(-1, tmp, -1, newpath);
free(tmp);
return ret;
}
return -1; // unknown flags
}
#endif
#ifndef __NR_memfd_create
#define MFD_CLOEXEC 0x0001U
#define MFD_ALLOW_SEALING 0x0002U
EXPORT int my_memfd_create(x86emu_t* emu, void* name, uint32_t flags)
{
// try to simulate that function
uint32_t fl = O_RDWR | O_CREAT;
if(flags&MFD_CLOEXEC)
fl |= O_CLOEXEC;
int tmp = shm_open(name, fl, S_IRWXU);
if(tmp<0) return -1;
shm_unlink(name); // remove the shm file, but it will still exist because it's currently in use
return tmp;
}
#endif
#ifndef GRND_RANDOM
#define GRND_RANDOM 0x0002
#endif
@@ -2418,6 +2486,11 @@ EXPORT char* my___progname_full = NULL;
EXPORT char* my_program_invocation_name = NULL;
EXPORT char* my_program_invocation_short_name = NULL;
#define PRE_INIT\
if(box86_tcmalloc_minimal) \
lib->priv.w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \
else
#define CUSTOM_INIT \
box86->libclib = lib; \
my_lib = lib; \
+6 -2
View File
@@ -1061,7 +1061,7 @@ DATAV(__malloc_initialize_hook, 4)
// malloc_set_state // Weak
// malloc_stats // Weak
GOW(malloc_trim, iFu)
GOW(malloc_usable_size, uFp)
GOW(malloc_usable_size, LFp)
GOW(mallopt, iFii) // Weak
// mallwatch // type B
GO(mblen, iFpu)
@@ -1129,7 +1129,7 @@ GOW(mount, iFpppup)
GOM(mprotect, iFEpLi)
// mrand48
// mrand48_r
GOW(mremap, pFpuuip) // 5th hidden paramerer "void* new_addr" if flags is MREMAP_FIXED
GOW(mremap, pFpuuip) // 5th hidden paramerer "void* new_addr" if flags is MREMAP_FIXED // does this need some GOM for protection handling?
GO(msgctl, iFiip)
GOW(msgget, iFpi)
GOW(msgrcv, lFipLli)
@@ -1383,7 +1383,11 @@ GO(removexattr, iFpp)
// remque
GO(rename, iFpp)
GO(renameat, iFipip)
#ifdef PANDORA
GOM(renameat2, iFipipu)
#else
GO(renameat2, iFipipu)
#endif
// _res // type B
GOW(re_search, iFppiiip)
GOW(re_search_2, iFppipiiipi)
Loaded 100 of 157 files, more files were not shown because too many files have changed in this diff. Show more