Not sure about that. SHA-256 uses modular arithmetic which is not reversible.
Modulo is reversible, if you have enough context. For example:
a=badc0ded
b=c0deba5e
c=a+b=(badc0ded+c0deba5e)=7bbac84b
c=7bbac84b
b=c0deba5e
a=c-b=(7bbac84b-c0deba5e)=badc0ded
a=badc0ded
See? Addition modulo 2^32 is perfectly reversible. It is like a clock, you can use modulo 60 to represent the current second. You can add seconds, you will get them modulo 60. But you can also subtract them, then you will get it backwards. So, addition modulo 2^32 can be reversed by using subtraction modulo 2^32, it's that simple. The same with many other bijective operations: if you have xor, you can xor it again by the same value. If you have rotation, you can rotate it back. And if you can compute Addition, Rotation and Xor backwards, then you can implement the whole ARX model backwards.
it also use some compound operations involving "xor" and "and". those are not reversible either most likely
When it comes to "and", it is irreversible, but only partially (if you have "true" as your result, you know that all values were also "true"). Because it is used only internally, and is not a main operation to combine things, it can be reversed. Hash functions like SHA-1 and SHA-256 use Addition, Rotation, Xor, as their main core, functions like "and" or "or" are used only internally. Also, even if you think that "xor" alone is irreversible, then you are wrong, because having all 16 w-values is enough to xor and rotate them in any needed way, to recover all other w-values forward and backward.
it would have to store alot of information. think a computer. with memory
I don't think hash functions need more memory than a few kilobytes at most. The bare minimum for SHA-256 is eight 32-bit values for IV, eight 32-bit values for Exit Hash, and 16 32-bit values for the message. Then, maybe a few more 32-bit values will be needed to make it convenient, so the total memory cost could be, I don't know, 256 bytes? Maybe 512 bytes? Hash functions are not that complex to require a lot of memory, I think it is possible to do below 1 kB.
i honestly didn't understand any of that. but sha-256 is a pretty complex thing
Why do you think that SHA-256 is much more complex than SHA-1 in my examples? It has different k-values, and some different internal functions here and there, but the core of the whole hashing is pretty much identical. Also, when it comes to preimage attacks, it is also pretty much the same way of doing things, only some functions has to be changed here and there.
i don't think a mechanical device could reverse it in any meaningful way
Why not? Do you think that having a mechanical device that will perform 32-bit modulo addition is also impossible? Why? It is less complex than you think, you can write some simple code in any language, or even in some mathematical tool to see, that implementing hash functions is quite easy, much easier than implementing for example ECDSA. And then, if you have some hash function, executing all of my described attacks is pretty much straightforward, you just take one formula and transform it, for example:
w[i]=rol(w[i-16]^w[i-14]^w[i-8]^w[i-3]) //rotate both sides by 31 bits
rol31(w[i])=w[i-16]^w[i-14]^w[i-8]^w[i-3] //xor both sides by w[i-14]^w[i-8]^w[i-3]
rol31(w[i])^w[i-14]^w[i-8]^w[i-3]=w[i-16] //swap sides
w[i-16]=rol31(w[i])^w[i-14]^w[i-8]^w[i-3] //here we go, now we know, how to reverse w-values
but it's not really reversing it mathematically it's just spitting out stored data in a certain order
It actually is "reversing": if you have "a xor b = c", then you can mechanically xor "a" and "b", get your result in "c", and later use "c xor b = a" to restore "a". The same with addition modulo 2^32 that can be reversed by using subtraction modulo 2^32, and the same with rotations, that could be reversed by rotating it further: if you have rol5, you can reverse it by doing rol27, because 5+27=32, and rol32 means nothing will be changed.