Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint __thiscall CFile::DecryptFile(CFile *this,int buffer,undefined4 length)
- {
- uint data;
- uint character;
- int x;
- int y;
- CheckFileHeader((cFile *)this);
- data = Read((CFile *)this,buffer,length);
- if ((this[0x20] != (CFile)0x0) && (character = 0, data != 0)) {
- do {
- y = *(int *)(this + 0x1c);
- x = *(int *)(this + 0x18);
- *(byte *)(character + buffer) =
- *(byte *)(character + buffer) ^ "theocracy sux"[x] ^ "mutant technology"[y];
- *(uint *)(this + 0x18) = (x + 1U) % 0xd;
- character = character + 1;
- *(uint *)(this + 0x1c) = (y + 1U) % 0x11;
- } while (character < data);
- }
- Close(this);
- return data;
- }
- undefined4 __fastcall CFile::CheckFileHeader(cFile *path)
- {
- undefined4 file;
- uint index;
- int address;
- char file_header [8];
- char error_message [1024];
- file = OpenR(path);
- if ((char)file == '\0') {
- return file;
- }
- Read((CFile *)path,file_header,7);
- index = 0;
- do {
- if (file_header[index] != "RSA4096"[index]) {
- path[0x20] = (cFile)0x0;
- sprintf(error_message,s_Unknown_textfile_format!_%s_005e01d0,*(undefined4 *)(path + 0x14));
- die(error_message);
- file = SeekB((CFile *)path,0);
- return CONCAT31((int3)((uint)file >> 8),1);
- }
- index = index + 1;
- } while (index < 7);
- path[0x20] = (cFile)0x1;
- address = SeekIgnoreHeader((CFile *)path,0); //Always uses 0 for "index"
- return CONCAT31((int3)((uint)address >> 8),1);
- }
- int __thiscall CFile::SeekIgnoreHeader(CFile *this,uint start)
- {
- int index;
- if (this[0x20] != (CFile)0x0) {
- index = SeekB((CFile *)this,start + 7);
- *(uint *)(this + 0x18) = start % 0xd;
- *(uint *)(this + 0x1c) = start % 0x11;
- return index + -7;
- }
- index = SeekB((CFile *)this,start);
- return index;
- }
- void __thiscall CFile::SeekB(CFile *this,undefined4 param_1)
- {
- bool bVar1;
- bVar1 = isOpen(this);
- if (!bVar1) {
- die(s_cFile::SeekB_file_is_not_open_005e0130);
- }
- (**(code **)(**(int **)(this + 0xc) + 0x10))(param_1,0);
- return;
- }
- void __thiscall CFile::Read(CFile *this,undefined4 buffer,undefined4 length)
- {
- int iVar1;
- bool isOpen;
- undefined4 uStack_10;
- isOpen = CFile::isOpen(this);
- if (!isOpen) {
- uStack_10 = 0x54a567;
- die(s_cFile::Read_file_is_not_open_005e0190);
- }
- iVar1 = **(int **)(this + 0xc);
- uStack_10 = length;
- FUN_005674e0(&uStack_10,buffer);
- (**(code **)(iVar1 + 0x14))();
- return;
- }
- void __thiscall FUN_005674e0(void *this,undefined4 param_1)
- {
- *(undefined4 *)this = param_1;
- return;
- }
Advertisement