| View previous topic :: View next topic |
| Author |
Message |
reverser69 Expert Cheater
Reputation: 0
Joined: 03 Sep 2014 Posts: 112
|
Posted: Mon Mar 09, 2020 8:20 am Post subject: writing a memory address's value to file |
|
|
theres a loop
x= 0
Y = read fileA.exe+X
encrypt Y and write it to [XXXXX]
now i want to inline the writing code so that i write those encrypted bytes to a file. i.e. write [XXXXX]'s values to file every time it is caculated
|
|
| Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Mon Mar 09, 2020 9:32 am Post subject: |
|
|
| Code: | function writeFile(filePath,data)
if (type(data)=='string') then
local file = assert(io.open(filePath,'a'),'io.open failed!'); -- create files if does not exists and appends to it;
file:write(data);
file:close();
return true
end
return false
end
function logXXXX()
local log_file_path = 'C:\\Path\\To\\File.log';
local value = readInteger('address_XXXX');
local fmt = ('%s -\t\tvalue - %d',tostring(os.date(),value))
return writeFile(log_file_path,fmt)
end
function recalculate()
-- your calculation code...
logXXXX();
-- contiune and such
end |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
| Back to top |
|
 |
reverser69 Expert Cheater
Reputation: 0
Joined: 03 Sep 2014 Posts: 112
|
Posted: Mon Mar 09, 2020 3:35 pm Post subject: |
|
|
hi & thx for reply
this is my code:
| Code: | [ENABLE]
{$lua}
function writeFile(filePath,data)
if (type(data)=='string') then
local file = assert(io.open(filePath,'a'),'io.open failed!');
file:write(data);
file:close();
return true
end
return false
end
function logXXXX()
local log_file_path = 'C:\\Users\\shetal\\Desktop\\1.txt';
local value = readInteger(ecx+0x3c);
local fmt = ('%s -\t\tvalue - %d',tostring(os.date(),value))
return writeFile(log_file_path,fmt)
end
{$asm}
"Operators.exe"+4C0D:
mov [ecx+3C],al
mov [ebp-04],00000009
luacall(logXXXX())
[DISABLE]
dealloc(newmem)
"Operators.exe"+4C0D:
mov [ecx+3C],al
mov [ebp-04],00000009
//Alt: db 88 41 3C C7 45 FC 09 00 00 00 |
but i receive error :
lua error in line 3 : string "local syntaxcheck...... ')' expected near ','
whats wrong?
|
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Mon Mar 09, 2020 10:47 pm Post subject: |
|
|
Look at your code, line 3, there is something typo there. At least you need to post your complete code before asking something you don't know.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
| Back to top |
|
 |
reverser69 Expert Cheater
Reputation: 0
Joined: 03 Sep 2014 Posts: 112
|
Posted: Tue Mar 10, 2020 6:42 am Post subject: |
|
|
| i don't know Lua so i cant recognize that typo. why don't you point it out?!
|
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Tue Mar 10, 2020 9:10 am Post subject: |
|
|
| reverser69 wrote: | | i don't know Lua so i cant recognize that typo. why don't you point it out?! |
Because you are not posting your Lua script at least lines 1 to 10 or more.
The error you got shown that error on line 3 in your Lua script. So, what is the code written on line 3 ?.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
| Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Wed Mar 11, 2020 8:51 am Post subject: |
|
|
Yes sorry, had a typo
| Code: | [ENABLE]
{$lua}
function writeFile(filePath,data)
if (type(data)=='string') then
local file = assert(io.open(filePath,'a'),'io.open failed!');
file:write(data);
file:close();
return true
end
return false
end
function logXXXX()
local log_file_path = 'C:\\Users\\shetal\\Desktop\\1.txt';
local value = readInteger(ecx+0x3c);
local fmt = ('%s -\t\tvalue - %d'):format(os.date(),tostring(value))
return writeFile(log_file_path,fmt)
end
{$asm}
"Operators.exe"+4C0D:
mov [ecx+3C],al
mov [ebp-04],00000009
luacall(logXXXX())
[DISABLE]
dealloc(newmem)
"Operators.exe"+4C0D:
mov [ecx+3C],al
mov [ebp-04],00000009
//Alt: db 88 41 3C C7 45 FC 09 00 00 00 |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
| Back to top |
|
 |
|