C :: Decrypting / Extracting Custom File Formats
Sep 25, 2014
So this may be against the rules, not sure, grey area probably? However I just bought the PC game Oil Rush, and was having a look at how the assets are packed. As with most games the textures, scripts, sounds and audio are all free to access.
However the game data such as maps, models and other, are packed into UNG files, i.e a custom encrypted file format, which probably is also compressed. So I googled for an unpacker/extracter and found one which also comes with the C source. You can download here. [URL] ....
So I am trying to figure out how these authors work out this file format, from the source we have,
Code:
static const u8 unigine_mask[] = "xffx7fx3fx1fx0fx07x03x01";
u32 unigine_key = 0xa13cdbde;
Looks like a password of sorts. You then have to work out the complete understanding of the file formats, headers, blocks etc.. How is this done...
View 4 Replies
ADVERTISEMENT
Apr 24, 2015
I'm very new to c and c++ and am currently working on a Caesar cipher that grabs encrypted text from a txt file and decrypts it onto a new txt file. My code builds fine in CodeBlocks and when I run it, there is a new txt file created but it stays blank.
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <cstdlib>
using namespace std ;
int main(int argc, char *argv[]){
[Code] ....
View 7 Replies
View Related
Jun 4, 2013
I have written a C++ program I have multiple of CSV file used as input, which I open one at a time and close it after extracting data to a output file which is the only file.
I run getline(inFile,line);
outFile << line << endl;
I run this code, and only part of it is goes to the output file I got, also have spacing randomly to specific file and inconsistent
But when I slower the code, like system("Pause") in the loop, I can get extract what I want perfectly....
Is my program running to fast, why getline would be skipping part of what things I want?
View 11 Replies
View Related
May 17, 2013
I have a string like this
const char *filename = "C:/Qt/progetti/worlds/fasr.world";
then I have a string like this
char *pathdir = "C:/Qt/progetti/worlds";
I would get this string: "worlds/fasr.world" how should I do ?
View 6 Replies
View Related
Jun 5, 2014
I have a program here that writes employee information into a text file called employee.txt. I don't have a problem writing into the text file.
I'm supposed to enter the employees ID and search for it. Then pull up all they're info.
This is what I have.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
ifstream inFile;
ofstream outFile;
[Code] ....
This is the text file
Viktor,Luc,552,123 Home,5000
Joe,Luc,553,123 House,7000
View 7 Replies
View Related
Apr 20, 2015
Create a simple data file like the example shown below containing the 4 dates below plus 10 or more additional dates. The file should include 1 date per line and each date should have the form MonthNumber-DayOfTheMonth-Last2DigitsOfTheYear with no extra spaces. All dates should be in this century. No error checking for invalid dates is necessary.
My Output displays like
February -19,1991
How do I get my program to ignore the dash between the dates?
#include <fstream>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(){
const int M = 13;
[code]....
View 1 Replies
View Related
Mar 26, 2014
I have a certain method of encrypting text. You get the first character of the word. For example in the word "hacker", you get 'h', and then you get the last character 'r'. The encrypted word until now is "hr". Then we get the same word with the 'h' and 'r' removed, now it's "acke". I do the same thing and get the first character 'a' and the last one 'e' and them to the encrypted word: it is now "hrae".
The left letters of the word are "ck", again we do the same thing and take the first character 'c' and the last character 'k' and and add them to the new encrypted word so it is "hraeck". The above word has an even number of characters and at the end had 2 characters left 'c' and 'k',first and last, in some cases of words with an odd number of characters, only one character is left! I'm completely lost on how to encrypt and decrypt this.
View 4 Replies
View Related
Jul 16, 2013
I have a simple decryption program but I cant get it to encrypt/decrypt text read from the keyboard using getline (), did i declare wrong?
#include <iostream>
#include <string>
using namespace std;
char text[ ]
(here I have my void decrypt/encrypt functions)
int main () {
cout <<''Enter text to encrypt''<<endl;
getline(cin,text);
View 3 Replies
View Related
Mar 29, 2015
I have managed to print out the encrypted text from the console, however it doesnt decrypt correctly and isn't returning the correct key. I can't seem to find the error that is causing the decrypted text from printing correctly. When I try to decrypt the text it changes it completely as well.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "rotUtils.h"
bool solved( char decodearr[], char dictarr[][30], int size1, int size2){
char* compared;
bool result = false;
for(int j = 0; j < size2; j++){
[code]....
View 3 Replies
View Related
Jun 18, 2013
I'm having a bit issue with ispunct in my function. The user can input a phone number in any of the formats below:
4147778888
(414)7778888
(414)777-8888
The program will only print out:
41447778888
What I am trying to do is accept any integer and parentheses. If the user inputs anything else, the program will display an error message. Right now, parentheses displays an error which is obvious but I'm wondering if there is a way I can allow a parentheses to be entered but not any other symbol. ex: . , : ; " '
Code:
void getPhoneNum(){
// Local Declarations
char string[14];
char* tokPtr;
[Code] ....
View 6 Replies
View Related
Mar 17, 2014
I am creating a logging namespace for a game that I am creating. The logging includes a file, and it would contain the following methods:
OUT::log(?)
OUT::warn(?)
OUT::critical(?)
OUT::debug(?)
I will want to call things like
OUT::log("Something happened");
and
OUT::log("Code process " + int proc + " occurred.");
But this might have to be changed to something like
OUT::log("Code process ", int proc, " occurred.");
What would I put in place of "?" to accomplish this?
I don't want to create 30 different methods for this, ie, not
OUT::log(string, int, string);
OUT::log(string, long, string);
OUT::log(string, double, string);
OUT::log(string, int);
OUT::log(string, int, string, int, string);
...I do NOT want to do this...too much chaos. I understand in C++11, I could do something with int like to_string, and that would make the "string" + int + "string" to work.
View 7 Replies
View Related
Feb 3, 2015
know of a handy function (or library) for converting between different text formats? I've heard of a library called iconv but I've no familiarity with it. However, it looks promising (from what little I can find out about it...)
Specifically, the text %20 is often used in hypertext to indicate a space character - so the string "Hello There" would get changed into "Hello%20There". How can I easily change between one and the other?
Obviously I could use string replacement functions but that'd need me to anticipate every potential hypertext code sequence.
View 5 Replies
View Related
Aug 2, 2014
I have a text file called (Test.txt) with the following text:
This is line one
This is line two
This is line three
How do I go about writing a program that will print a line of text (e.g. "This in line two" on the console screen?
All I can seem to do is display the entire text file.
View 6 Replies
View Related
Jul 9, 2014
Development of a custom binary file type? So far all I know is the just the basic structures of the binary file type, I know that structures are involved but the implementation part I have run into walls.
View 1 Replies
View Related
May 4, 2012
I am trying to make a custom hotkey on my program via a ini file.
Code:
TCHAR KeyValue[32];
GetPrivateProfileString(("test"), ("test"), ("") ,KeyValue, 32, ("C: est.ini"));
if(GetAsyncKeyState (KeyValue)) // Hotkeys 0x60 VK_NUMPAD0 //Problem here
{
}
Code:
test.ini :
[test]
test=0x60
Error:
invalid conversion from `CHAR*' to `int'
initializing argument 1 of `SHORT GetAsyncKeyState(int)'
View 5 Replies
View Related
Dec 12, 2013
Here your supposed to create a program that takes in information and formats it into three columns.
I can't seem to use the float variable unitprice with decimal places here for, if I try to use %.1f and type in an input, the program seems to skip over the second scanf function, not allowing me to put input into the third scanf function as the program runs before I can.
I can use %f on its own and it works but this creates too many zeroes(and you're supposed to set the currency limit to $99999.99).
Code:
#include <stdio.h>
int main(void) {
int itemno, month, year, day;
float unitprice;
[Code]....
So the output should look like three columns. It's just the float that is the issue here....
View 5 Replies
View Related
Jul 13, 2014
I'm using Visual Studio Express 2013 to create a Windows program that will upgrade my micro-controller firmware. I have a .exe program to upgrade it. What I normally do is I drag and drop a .txt file on the .exe program and it will be done. I want to write a program that will do the exact same thing. Where when I click on a button, it will run the .exe program with the .txt file.
What I got so far is just run the .exe program when i press the button. I do not know how to write a code to let the .exe start with the .txt file. Here's what I got so far.
Process.Start(@"C:UsersJayDocumentsVisual Studio 2013ProjectsWindowsFormsApplication1BSL_FilesBSL ScripterBSL_Scripter.exe");
That line only manage to open up my .exe file. How do I make it run with the .txt at this location?
C:UsersJayDesktopBSL_FilesBSLSCRIPT.txt
View 2 Replies
View Related
Jun 12, 2013
I’m developing an application where I have some defines, like:
#define PatientName “(0x0010, 0x0010)”
#define PatientId “(0x0010, 0x0020)”
#define Modality “(0x0010, 0x0030)”
And a few more (up to 3000). These defines are used to read certain fields from a DICOM image, that give information about that image (Patient Name, etc…). However I don’t wish to read all these fields. Instead I’m trying to load an .ini configuration which will configure which fields to read. For example:
[PROPERTIES]
# Fields to read
fields=PatienId,Modality
This would only retrieve the Patient Name and a Modality.
The problem is, the values I retrieve from the .ini file (reading and parsing the file with std::fstream) come as a string. How could I retrieve, for example, the defined value from PatientId, i.e. “(0x0010, 0x0020)”? Something like std::cout << # << "PatientId"; won't work.
View 3 Replies
View Related
Sep 9, 2014
I am trying to automatically(periodically) print screen a custom area of the screen, save it as an image file (the image will have the same format always), and then use OCR to get the text in the image as usable string variables. Is this doable? I was looking into tesseract OCR but I find it a bit unclear.
View 10 Replies
View Related
Mar 1, 2015
I'm having trouble trying to extra the second row from the array:
Code: double data[10][10] = {{0,5,10,15,20,25,30,35,40,45},{0,13,22,37,54,62,64,100,112,126}};
When I do this, it posts the entire array:
Code: int x,y;
for(x=0;x<2;x++)
{
for(y=0;y<10;y++)
{
printf("%.0lf ",data[1][y]);
}
}
View 5 Replies
View Related
Dec 5, 2014
So, I have a string and I need to extract numbers from it. I've tried different things but they are not working. So, Here is what I have:
int main() {
string myString;
char *strPtr;
cout << "Enter a string to evaluate: " << endl;
getline(cin, myString);
[Code] ....
View 10 Replies
View Related
Feb 15, 2013
We have an assignment to produce code to gather a string of input from the user in which they are entering a date. We then have to extract parts of that string to make substrings, and display different formats for the date(I will add my code in here so you can see what I have done). It took me a long while plucking away at this to understand this part. You will see that at the end of my code I have opened a file months.txt. We were provided with a file which states months corresponding to dates. I.e. 01January 02February 03March 04April, and so on until December. Exactly how I have typed it is how it is in the file.
I understand how to open and extract what is in the file as a string. I have extracted this as a string called myMonth (as you can see in the code as well) NOW,
I am supposed to have the program search for the month in the file, matching that to the month the user has input earlier, and then use the number infront of that month. I understand the basics of using find(), and making substrings. But how on earth do you get the computer to correlate what the user has input for a month, to finding that in the file, and then using the correct number.
Here is the code I have done so far:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
string myDate; // Date input from user;
string myMonth; // Input from months.txt
[Code] ....
View 1 Replies
View Related
May 16, 2014
Extracting integers from a string is trivial, but I am unable to find a function or code that will extract decimal numbers from a string.
I have a string that looks something like this:
" Asdf 1 1.3825 4.0000 12.0000 1.9133 0.1853 0.9000 1.1359 4.0000 "
Any tips on extracting the numbers (in decimal form) and storing them in a vector?
View 5 Replies
View Related
Nov 30, 2013
I want to extract polynomial coefficient out of a string recieved by input, for example if i enter 4x^3+2x^4+3 , the resulting out put be : 2 , 4 , 0 , 0 , 3
View 10 Replies
View Related
Feb 20, 2013
I got as far as getting a web page into an IHTMLDocument2 but I don't know what to do from there, all the examples I found are C# or .NET or something else I don't understand.
Any simple example in C++ of getting all the links from an IHTMLDocument2 ?
I was able to do this:
Code:
IHTMLElementCollection* collection;
hResult=document->get_links(&collection);
long nLinks;
collection->get_length(&nLinks); // returns correct number
collection->Release();
How do I loop through the collection and extract the actual links ? Also, if they come out as BSTR do I simple treat them as WCHAR* ? If I can do that I can figure out the rest myself.
View 2 Replies
View Related
Apr 26, 2013
I am trying to automatically extract all time stamps in a pdf file. These are typically in a line like:
when="2010-07-30T15:20:30+04:00"
For this I was thinking of using CStdioFile and the ReadString function. Somehow this doesn't work. My example code is below. Is this because pdf is not a true text file, because strings read can be longer than some max,...? Any quick way of reading the file and extracting the desired text between the brackets?
Code:
CStdioFile InputFile;
if (InputFile.Open(FileName,CFile::modeRead)) {
[Code]....
View 14 Replies
View Related