Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


doubleToByteTable format help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
hemersonkla1
Cheater
Reputation: 0

Joined: 24 Jun 2015
Posts: 34

PostPosted: Sun Sep 17, 2017 1:18 pm    Post subject: doubleToByteTable format help Reply with quote

Code:
 local bt = doubleToByteTable(36)
 for i, v in ipairs(bt) do
   print(i - 1, string.format('%02X', v))
 end


out
0 00
1 00
2 00
3 00
4 00
5 00
6 42
7 40

Hello friends. I need your help again. I want to convert doubleToByteTable so that for example the number 36 is in that format
40 42 in hex it will originally convert 42 40 and with these line breaks I need it to stay like this = 40 42 forming an aob. Can you help me? Thank you.



Capturar.PNG
 Description:
 Filesize:  11.22 KB
 Viewed:  2383 Time(s)

Capturar.PNG


Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Sep 17, 2017 1:54 pm    Post subject: Reply with quote

Code:
local bt = doubleToByteTable(36)
local str = string.format("(%02X %02X %02X %02X %02X %02X %02X %02X)",unpack(bt))
print(str)

Code:
local bt = doubleToByteTable(36)
local str = "("
for i, v in ipairs(bt) do
  if i > 1 then
    str = str .. " "
  end
  str = str .. string.format("%02X", v)
end
str = str .. ")"
print(str)
Back to top
View user's profile Send private message
hemersonkla1
Cheater
Reputation: 0

Joined: 24 Jun 2015
Posts: 34

PostPosted: Sun Sep 17, 2017 2:03 pm    Post subject: Reply with quote

Zanzer wrote:
Code:
local bt = doubleToByteTable(36)
local str = string.format("(%02X %02X %02X %02X %02X %02X %02X %02X)",unpack(bt))
print(str)

Code:
local bt = doubleToByteTable(36)
local str = "("
for i, v in ipairs(bt) do
  if i > 1 then
    str = str .. " "
  end
  str = str .. string.format("%02X", v)
end
str = str .. ")"
print(str)

Again. Thank you very much. That's what I wanted. Thanks for the help. =)

ps = as () was just to highlight. I will not use them =)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites