Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SetMemory(int Address, unsigned char* Input)
- {
- int i = 0;
- while(true)
- {
- if (*(unsigned char*)(Input + i) == 0x00)
- break;
- *(int*)(Address + i) = *(unsigned char*)Input;
- }
- }
- void WriteString(int Address, const char* Input)
- {
- int i = 0;
- while(true)
- {
- if(*(char*)(Input+i) == 0x00)
- {break;}
- *(int*)(Address + i) = *(char*)(Input + i);
- i++;
- }
- }
- char* ReadString(int Address)
- {
- return (char*)Address;
- }
- void WriteInt32(int Address, int Input)
- {
- *(int*)Address = Input;
- }
- int ReadInt32(int Address)
- {
- return *(int*)Address;
- }
- void WriteFloat(int Address, float Input)
- {
- *(float*)Address = Input;
- }
- void WriteSingle(int Address, float Input, int Length)
- {
- for (int i = 0; i < Length; i++)
- WriteFloat(Address + (i * 4), Input);
- }
- float ReadFloat(int Address)
- {
- return *(float*)Address;
- }
- float* ReadSingle(int Address, int Length)
- {
- float* Value;
- for (int i = 0; i < Length; i ++)
- Value[i] = ReadFloat(Address + (i * 4));
- return Value;
- }
- void WriteByte(int Address, unsigned char Input)
- {
- *(unsigned char*)Address = Input;
- }
- unsigned char ReadByte(int Address)
- {
- return *(unsigned char*)Address;
- }
- unsigned char* ReadBytes(int Address, int Length)
- {
- unsigned char* Value;
- for (int i = 0; i < Length; i ++)
- Value[i] = ReadByte(Address + Length;
- }
- void WriteBytes(int Address, unsigned char Input, int Length)
- {
- for (int i = 0; i < Length; i ++)
- WriteByte(Address + i, Input);
- }
- void WriteBool(int Address, bool Input)
- {
- WriteByte(Address, (int)Input);
- }
- bool ReadBool(int Address)
- {
- return ReadByte(Address) != 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement