orpheu_memory.inc
Original include source with line numbers.
| 1 | |
| 2 | #if defined _orpheu_memory_included |
| 3 | #endinput |
| 4 | #endif |
| 5 | #define _orpheu_memory_included |
| 6 | |
| 7 | #include <orpheu_const> |
| 8 | |
| 9 | /* |
| 10 | * To use this functionality you must build files that identify memory locations |
| 11 | * This files go on the folder "configs/orpheu/memory" |
| 12 | * More instructions on Orpheu thread |
| 13 | */ |
| 14 | |
| 15 | /** |
| 16 | * Replaces data in memory in the full extent of a library |
| 17 | * |
| 18 | * @param memoryDataName The name of the block that qualifies memory as defined in a file at "configs/orpheu/memory" |
| 19 | * @param count The number of occurences to replace. 0 = infinite |
| 20 | * @param any A pair "to be replaced" - "replacement". Pair members must be of the same type |
| 21 | * |
| 22 | * @return The number of replacements made |
| 23 | * |
| 24 | * Example: |
| 25 | * |
| 26 | * Replacing the value 16000 by 100000 in a library |
| 27 | * |
| 28 | * OrpheuMemoryReplace("name",0,16000,100000) (where name should be related to a block of data that qualifies the memory as holding a long value) |
| 29 | * |
| 30 | * Replacing the string "weapon_smokegrenade","weapon_flashbang" |
| 31 | * |
| 32 | * OrpheuMemoryReplace("name",0,"weapon_smokegrenade","weapon_flashbang") (where name should be related to a block of data that qualifies the memory as holding a string) |
| 33 | */ |
| 34 | native OrpheuMemoryReplace(const memoryDataName[],count,any:...) |
| 35 | |
| 36 | /** |
| 37 | * Replaces data in memory.It works like OrpheuMemoryReplace but starts at a given address |
| 38 | * |
| 39 | * @param address The address to start at |
| 40 | * @param memoryDataName The name of the block that qualifies memory as defined in a file at "configs/orpheu/memory" |
| 41 | * @param count The number of occurence. 0 = infinite |
| 42 | * @param any A pair "to be replaced" - "replacement". Pair members must be of the same type |
| 43 | * |
| 44 | * @return The number of replacements made |
| 45 | */ |
| 46 | native OrpheuMemoryReplaceAtAddress(address,const memoryDataNameName[],count,any:...) |
| 47 | |
| 48 | |
| 49 | /** |
| 50 | * Retrieves data in memory. The block of data that qualifies memory must also identify it by having identifier blocks, |
| 51 | * Memory can be located given an offset or a signature |
| 52 | * |
| 53 | * @param memoryDataName The name of the block that qualifies memory as defined in a file at "configs/orpheu/memory" |
| 54 | * @param any If the type of the memory location is passed by ref, the variables needed to get the value |
| 55 | * You can give an extra argument to retrieve the address where the data retrieved lies |
| 56 | * |
| 57 | * @return If the type of the memory location is not passed by ref, its value |
| 58 | */ |
| 59 | native OrpheuMemoryGet(const memoryDataName[],any:...) |
| 60 | |
| 61 | /** |
| 62 | * Retrieves data in memory. It works like OrpheuMemoryGet but starts at a given address |
| 63 | * |
| 64 | * @param address The address to start at |
| 65 | * @param memoryDataName The name of the block that qualifies memory as defined in a file at "configs/orpheu/memory" |
| 66 | * @param any If the type of the memory location is passed by ref, the variables needed to get the value |
| 67 | * You can give an extra argument to retrieve the address where the data retrieved lies |
| 68 | * |
| 69 | * @return If the type of the memory location is not passed by ref, its value |
| 70 | */ |
| 71 | native OrpheuMemoryGetAtAddress(address,const memoryDataName[],any:...) |
| 72 | |
| 73 | /** |
| 74 | * Alters data in memory. The block of data that qualifies memory must also identify it by having identifier blocks. |
| 75 | * Memory can be located given an offset or a signature |
| 76 | * |
| 77 | * @param memoryDataName The name of the block that qualifies memory as defined in a file at "configs/orpheu/memory" |
| 78 | * @param count The number of occurences to alter. 0 = infinite |
| 79 | * @param any The value to use as replacement |
| 80 | * You can give an extra argument to retrieve the address where the data retrieved lies |
| 81 | * |
| 82 | * @return Number of occurences replaced |
| 83 | */ |
| 84 | native OrpheuMemorySet(const memoryDataName[],count,any:...) |
| 85 | |
| 86 | /** |
| 87 | * Alters data in memory. It works like OrpheuMemorySet but starts at a given address |
| 88 | * |
| 89 | * @param address The address to start at |
| 90 | * @param memoryDataName The name of the block that qualifies memory as defined in a file at "configs/orpheu/memory" |
| 91 | * @param count The number of occurences to alter. 0 = infinite |
| 92 | * @param any The value to use as replacement |
| 93 | * You can give an extra argument to retrieve the address where the data retrieved lies |
| 94 | * |
| 95 | * @return Number of occurences replaced |
| 96 | */ |
| 97 | native OrpheuMemorySetAtAddress(address,const memoryDataName[],count,any:...) |
| 98 | |
| 99 | |