| 3795 | } |
| 3796 | |
| 3797 | static int internal_getMemRanges(lua_State *L) |
| 3798 | { |
| 3799 | vector<DFHack::t_memrange> ranges; |
| 3800 | Core::getInstance().p->getMemRanges(ranges); |
| 3801 | |
| 3802 | lua_newtable(L); |
| 3803 | |
| 3804 | for(size_t i = 0; i < ranges.size(); i++) |
| 3805 | { |
| 3806 | lua_newtable(L); |
| 3807 | if (ranges[i].base) { |
| 3808 | lua_pushinteger(L, (uintptr_t)ranges[i].base); |
| 3809 | lua_setfield(L, -2, "base_addr"); |
| 3810 | } |
| 3811 | lua_pushinteger(L, (uintptr_t)ranges[i].start); |
| 3812 | lua_setfield(L, -2, "start_addr"); |
| 3813 | lua_pushinteger(L, (uintptr_t)ranges[i].end); |
| 3814 | lua_setfield(L, -2, "end_addr"); |
| 3815 | lua_pushstring(L, ranges[i].name); |
| 3816 | lua_setfield(L, -2, "name"); |
| 3817 | lua_pushboolean(L, ranges[i].read); |
| 3818 | lua_setfield(L, -2, "read"); |
| 3819 | lua_pushboolean(L, ranges[i].write); |
| 3820 | lua_setfield(L, -2, "write"); |
| 3821 | lua_pushboolean(L, ranges[i].execute); |
| 3822 | lua_setfield(L, -2, "execute"); |
| 3823 | lua_pushboolean(L, ranges[i].shared); |
| 3824 | lua_setfield(L, -2, "shared"); |
| 3825 | lua_pushboolean(L, ranges[i].valid); |
| 3826 | lua_setfield(L, -2, "valid"); |
| 3827 | lua_rawseti(L, -2, i+1); |
| 3828 | } |
| 3829 | |
| 3830 | return 1; |
| 3831 | } |
| 3832 | |
| 3833 | static int internal_patchMemory(lua_State *L) |
| 3834 | { |
nothing calls this directly
no test coverage detected