I have ext2 formatted file system Images. I like to read in terminal all the file system structures data in Linux specifically Ubuntu.Is there a tool> - linux

So I have file system ext2 formatted image files. I like to view Inode, super block, filenames, etc. in the images for formatted file systsem . I like to know is there any tool for this. I need to view these structures like inode, superblock, file, related info like names of files, deleted inodes etc. In terminal, posssible some tool with available code in Linux. So can be editted the tool. Would be best if tool is coded in just C languange. Can anyone please do tell me this, Thanks again. Just opensource tool

I'm not certain I understood your question, but I think you probably just want to "loopback mount" your filesystem in a file. See here.
Failing that, I think you can use e2tools to access the contents. See here.

Related

How can I open a .cat file?

I'm looking for a way to open a .cat file. I have not a single clue about how to do it (I've tried with the notepad and sublime text, without results), the only thing I know is that it's not corrupted (it's read by another program, but I need to see it with my eyes to understand the structure of the content and create a similar one for my purposes).
Every hint is well accepted.
If you can't make sense of it in a standard text editor, it's probably a binary format.
If so, you need to get yourself a program capable of doing hex dumps (such as od) and prepare for some detailed analysis.
A good start would be trying to find information about Advanced Disk Catalog somewhere on the web, assuming that's what it is.

Linux/Python3 Look for a specific USB Flash Drive

I need a way to determine if a specific USB thumb drive has been inserted. For instance:
if "flash drive named "Records" is present":
copy data to drive
else:
"do something else"
I have all the copytree functions working just fine, I just need a way to check for the specific drive before the operation.
Thank you in advance!
By name, assuming you are looking for label, you could have a few ways. You could call blkid to get the labels of the system. But the tool itself might be limited to superusers. The target users might need to run your script as a superuser.
Other alternative I found with a little Google search is to use DBUS in Python. You might want to look up https://askubuntu.com/questions/437031/finding-volume-label-of-a-usb-mass-storage-device-using-python page.
In short, install python-dbus package and just a few lines of Python code could list you the drive labels.
How about the usbid package? It has the ability to find USB device IDs, so might be just what you need.
NB: I haven't used this myself; I just found this with a quick Google search and thought it might help solve your problem!
Your distro probably has the lsusb util installed. If so, you can have a look at this answer that demonstrated how to read and parse the output of lsusb from a python script.

How to handle images in j2me like .dat format

I am developing a game in j2me. How to handle images in .dat format.
I downloaded some games and extracted jar , found some dat format images and not able to open that images and images size also very less.. what tools I need to use?
Ref link
enter link description here
Not able to find solution?
A dat file could be anything. Depends what the developer felt like doing.
Some developers chose to strip PNG files of their header, and added the header back in the code. This was partly done in order to save a few bytes (because they mattered back then), and partly because of the challenge in doing it like that, and partly because it ensured all images used the exact same palette.
So that's one possibility, but it really could be anything.
As stated by mr_lou, there really isn't anything special about a .dat extension.
The steps to re-compile a file usually start with opening the file up in a hex editor and then looking at the first bits of information in the file. You then basically work from there to re-compile the data necessary for a 'normal' program to interpret the file. In particular, the first 8-16 bytes are often very helpful for determining what type of file it is "supposed" to be.
If you are looking at a png file (that's what I usually prefer to use for art assets) then you can reference http://en.wikipedia.org/wiki/Portable_Network_Graphics to see how a 'normal' png might look. When you're tweaking to save bytes you often strip unnecessary fields from png headers (things like the ancillary chunks) and using a common palette.
However, remember that it's not necessarily image data. It could be things like level data, sound, default stats or any particular amount of stuff.

Accessing raw file permissions(Linux)

As far as I am aware(correct me if I'm wrong), Linux is storing the information about each file's owner and permissions in a couple of bytes at the beginning of the file.
I know that there are plenty of ways to get that information about a file(both using shell commands and the GUI), but what I'm really wondering is if there is a way to access(view) those permissions in their raw form.
Maybe a more correct way to ask this question is whether there is a way to view the complete file contents(I've seen the binary output of a file using hexdump -C test.txt, but it still doesn't contain those) including the owner/permissions data.
I guess that this information is only accessed in it's raw form in deep-core code, but I'm really curious if it's possible to access it in a different way.
>>As far as I am aware(correct me if I'm wrong), Linux is storing the information about each file's owner and permissions in a couple of bytes at the beginning of the file.
NO!
This information is NOT stored in the file. It is a part of the filesystem's storage. Different file systems will store the binary data in different places. Some file systems will store in the information in the directory file. You should read more about filesystem permissions here, on Wikipedia
If you want to read permissions, since they are usually accessed from directory listings, look into the ls command.
If you really want to look at the "binary" data in it's "raw" form, look into opening and reading directory files in a programming language like C.

Forbid decompressing for UPX Win32/PE compressed files

Actually dont want people to decompress my Win32/PE executables.
I found a solution from one russian guy. His tool is named "UPX shell" and was at http://bash.x2i.net/, but website is down for now(it is not the same as upxshell.sourceforge.net)
His tool has option "Protect file from decompression" and it works just great(even with latest UPX)!
upx shell from russian guy doesn't have command line interface at all, which is needed for automatically compressing files with Visual Studio Post-Build.
Okay, it is not really cool for me, and I want to know how it works to write own command line solution, and is there any modern solutions for protecting .exe files from decompressing?
Depends a lot on your goals. Why don't you want people decompressing your PE?
If you are looking to stop people from "cracking" your software then even the "Russian guy"'s UPX Shell won't help. Code will get decompressed in memory when the EXE is running, so someone could simply read that memory.
My guess is UPX Shell just wraps the UPX compressed PE in another layer. Like making an executable zip file of an EXE. If this is the case just use another PE compressor on top of UPX, like PECOmpact http://pecompact.com/pecompact.php
Protection schemes are not unbreakable, on the contrary, a good amount of them are easely breakeable. There's a ton of tutorials for breaking a bunch of protetion schemes. So, I really don't recommend relying on this kind of protection.

Resources