I'm trying to get the current time for a game and print that to the games chat window. I'm already injected into the process do I don't think I need ReadProcessMemory.
The value i'm trying to read is the game hours 1-12.
//doesn't work
byte time_hour_get ( void )
{
return *( byte *)0x00B70153; //the address to the memory containing the
}
addMessageToChatWindow((char*)time_hour_get); -> when I call this function it looks like s , . I want it to return the integer value like cheat engine. I used byte when scanning for this address
In the code below. I believe I am returning the memory location of the value I am looking for. How can get the value?
main.cpp
int choice = 0; PlayerMenu *newPM = new PlayerMenu; File *file = new File; // Menu for loading, creating or exiting the game choice = newPM->menuChoices();
PlayerMenu.cpp
[Code] ....
I am not sure how to deference the value so I can get at the value instead of the memory location.
The results of my code is supposed to be very simple: return the 2 integers and then their sum. However, it's doing returning the first value, then an address in memory(rather than the 2nd value), and then the 2nd value(rather than the sum). Here is the code:
Right now im creating a program that use xbox inputs and then send out keyboard functions using sendInput();
It works fine, but now im creating a system wich lets the user of the program change the settings in a textfile. Wich will then change what the controllers bindings are.
example, if settings.txt says: Y=button(0xIE)
i want the program to know that when xbox button Y is pressed, execute a sendInput function to the Key: A (0xIE).
The problem is that the virtual keycode (0xIE) i take from the settings.txt is stored as a string (lets say it is stored in string Y_event)and input.ki.wScan has to be of type BYTE. i made a function wich changes string into int. (because input.ki.wScan seems to be fine getting a int?)
int stringToInt(string insert) { char back[20]; for(unsigned int e=0;e < insert.length();e++) { back[e]=insert[e]; } return atoi(back); }
but when i run the code nothing happend...
In the code i have a function wich executes the keypress: void pressbutton(int key, int time)
when i send in the converted string it doesn't work but when i send in: (0xIE) it works.
pressButton(stringToInt(Y_Event),50) // doesn't work pressButton(0xIE,50) // works
Basically it has to do with the byte ordering in a binary buffer vs the typing of a variable used to hold it.
To give you an example, if I have a buffer (say of indefinite length), and a ptr "ptr" pointing to a byte in the buffer (say, C0), such that if I open the buffer in a binary viewer it reads like this: Code: C0 DD FE 1F Such that this is true:
Code: /*ptr is uint8_t*/ *ptr == 0xC0
Then I do this:
Code: uint16_t var; var = *(ptr+1);
I would expect the result to be:
Code: DD FE /*56830*/
Though if I print that out with:
Code: printf("%u ", var);
It'll print:
Code: 65245 /*(FE DD)*/
Now obviously it's byte swapped, but what is causing that? I'm assuming if I just stream that out to a file byte by byte it'll be fine, so it's something with the 16 bit data type (also have seen this issue with a 32 bit data type, where all 4 are in reverse order). Is there any way to 'fix' it except bit shifts & masks?
I basically want to create a save editor application that will enable people to alter various values in the save by clicking on releveant buttons and then also for the editor to auto update the checksum when changes are done.
The save file is in hex so from what I can gather I would need to create a button to open the file using 'open file dialogue' and then read the file into a byte array so that the values can be called at any time when a particular butto is pressed and the application will then seek to the point in the file to make the required changes.
I have an application that has its own embedded web server. I am trying to add jQuery/Ajax file upload capabilities to the application however, I am running into issues getting the posted file. The jQuery/Ajax portion is similar to this method here. Due to the way the webserver was written (its in a dll and I do not have access to the source), the posted file comes in as a byte[]. If I try to save the byte array directly to file using:
File.WriteAllBytes("path", ByteArray)
I end up with a corrupt file that I cannot open. I believe this is because the byte array also contains the posted file header info (Content-Disposition, name, filename, etc.). If I view the contents of the byte array using:
System.Text.Encoding.Default.GetString(ByteArray) the header info can be viewed as: ------WebKitFormBoundaryQfPjgEVpjoWgA5JL Content-Disposition: form-data; name="0"; filename="someimage.png" Content-Type: image/png ‰PNG
Based on the selected file size and the size of the byte array, the entire file is in the byte array. How can I go about extracting and saving the posted file from the byte array?
to read byte from the serial port.This function is part of the DLL that came with the chip(FT2232D) I am using on my board.I want to use the function to read a byte from the serial port and then send the value to the Graphic user interface.Unfortunately I was unable to get the expected value on my GUI.If I send for instance 40,what I get on the GUI are letters instead of the number 40 or at times the GUI will not even respond.Below are my lines of code I used to read the byte from the serial port:
The following instructions are executed whenever the CHECKBOX is checked
Trying to write very simple code to read a 4 byte int from a file.
code:
int tester; FILE *fp; fp=fopen("/home/bdluser/skeleton.blx","rb"); fread(&tester,sizeof(int),1,fp); printf("tested 1 byte read should be 1: %i",tester);
I have tried editing the binary file....it outputs similar large numbers