| Ferrous Moon http://www.ferrousmoon.com:80/forums/ |
|
| OnlinkLogNuker http://www.ferrousmoon.com:80/forums/viewtopic.php?f=52&t=2003 |
Page 2 of 2 |
| Author: | bioshacker001 [Mon May 24, 2010 12:13 pm ] |
| Post subject: | Re: OnlinkLogNuker |
It was explained to me by someone i no longer trust that you can only paste it into msword. i used to find the clipboard folder and then cut it from there, but... i couldnt on xp. |
|
| Author: | hans henrik [Sun Nov 14, 2010 12:13 am ] |
| Post subject: | Re: OnlinkLogNuker |
![]() i guess this reply comes too late but, bioshacker001 its obvious you are new to cpp. (no flaming intended what i meant was Code: #include <cstdio>
#include <cstdlib>
#include <string.h>
#define BUFFER_SIZE 4096
char buffer[BUFFER_SIZE];
char token[BUFFER_SIZE + 1];
int lookAhead;
int bufferPos;
int bufferLen;
int nextChar(FILE *file){
if (bufferPos == bufferLen){
bufferLen = fread(buffer, 1, BUFFER_SIZE, file);
if (bufferLen <= 0)
return -1;
bufferPos = 0;
}
return buffer[bufferPos++];
}
void readUntil(FILE *file, char *buf, int &nowAt, char targetCh){
bool inStr = false;
lookAhead = nextChar(file);
while ((lookAhead != targetCh) || inStr){
buf[nowAt++] = lookAhead;
if (lookAhead == '"') inStr = !inStr;
lookAhead = nextChar(file);
if (lookAhead < 0) return;
}
}
void nextToken(FILE *file){
int nowAt = 0;
token[nowAt++] = lookAhead;
if (lookAhead == '<'){
readUntil(file, token, nowAt, '>');
token[nowAt++] = lookAhead;
lookAhead = nextChar(file);
} else
readUntil(file, token, nowAt, '<');
token[nowAt] = '\0';
}
bool beginWith(char *str, char *head){
int len = strlen(head);
if (strlen(str) < len) return false;
for (int i = 0; i < len; i++)
if (str[i] != head[i])
return false;
return true;
}
bool endWith(char *str, char *tail){
int len = strlen(tail);
int slen = strlen(str);
if (slen < len) return false;
for (int i = 0; i < len; i++)
if (str[slen - i - 1] != tail[len - i - 1])
return false;
return true;
}
void printLogbankHead(char *head, FILE *file){
int i = 0;
while (head[i] != ' '){
fprintf(file, "%c", head[i]);
i++;
}
fprintf(file, " count=\"0\" ");
do{
i++;
} while (head[i] != ' ');
i++;
while ((head[i] != '/') && (head[i] != '>')){
fprintf(file, "%c", head[i]);
i++;
}
fprintf(file, "/>");
}
int main(int argc, char* argv[]){
if (argc != 3)
{
printf("\nusage:\n");printf(argv[0]);printf("\"input file\" \"output file\"");
return 1;
}
FILE *xmlFile = fopen(argv[1], "r");
FILE *outputFile = fopen(argv[2], "w");
bufferPos = 0;
bufferLen = 0;
lookAhead = nextChar(xmlFile);
while (lookAhead >= 0){
nextToken(xmlFile);
if (beginWith(token, "<logbank ")){
printLogbankHead(token, outputFile);
if (!endWith(token, "/>"))
do{
nextToken(xmlFile);
}while(strcmp(token, "</logbank>"));
} else
fprintf(outputFile, "%s", token);
}
fclose(xmlFile);
fclose(outputFile);
}
now you can call the exe from cmd, and the files can be anywhere you wantexample: OnlinkLogNuker.exe "C:\Users\Hans Henrik\Desktop\Hacked.xml" "C:\Users\Hans Henrik\Desktop\Hacked.LogsNuked.xml" |
|
| Author: | qsdoosix [Sun Feb 13, 2011 11:13 pm ] |
| Post subject: | Re: OnlinkLogNuker |
But.... where could i find my save file? |
|
| Author: | afxi [Tue Feb 22, 2011 1:42 pm ] |
| Post subject: | Re: OnlinkLogNuker |
Quote: But....
If you use Windows Vista/7: \Users\[Username]\AppData\Roaming\Onlink\userswhere could i find my save file? on XP it should be something like \Documents and Settings\AppData\Onlink\users or \Documents and Settings\Local Settings\AppData\Onlink\users. I have the following problem: The log nuker creates a save file wich lets onlink always crash, when I try to load it. (I tried 0.2.0-a8-23-g0c617cf x68 and x86-64) I used the code by hans henrik. (no compilation errors) |
|
| Author: | Coder [Thu May 19, 2011 6:26 am ] |
| Post subject: | Re: OnlinkLogNuker |
Quote: Quote: But....
If you use Windows Vista/7: \Users\[Username]\AppData\Roaming\Onlink\userswhere could i find my save file? on XP it should be something like \Documents and Settings\AppData\Onlink\users or \Documents and Settings\Local Settings\AppData\Onlink\users. I have the following problem: The log nuker creates a save file wich lets onlink always crash, when I try to load it. (I tried 0.2.0-a8-23-g0c617cf x68 and x86-64) I used the code by hans henrik. (no compilation errors) |
|
| Page 2 of 2 | All times are UTC-05:00 |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|