text
stringlengths
0
2.35k
[2006.60 --> 2008.30] or do a calculation return
[2008.30 --> 2009.26] and then on top of that,
[2009.58 --> 2010.86] that all makes sense.
[2011.40 --> 2013.54] Do commands just pop up randomly
[2013.54 --> 2015.32] in what's happening now
[2015.32 --> 2017.60] and you kind of try to paint that
[2017.60 --> 2018.74] in the relevant context
[2018.74 --> 2020.18] once you're reverse engineering
[2020.18 --> 2022.20] something with multi-threads?
[2022.20 --> 2023.78] Actually, I think the best way
[2023.78 --> 2024.62] to visualize it
[2024.62 --> 2026.42] is not to try to think about the program
[2026.42 --> 2027.14] as it is running,
[2027.26 --> 2030.50] but imagine that instead of reading assembly code,
[2030.58 --> 2032.06] you are reading the source code
[2032.06 --> 2032.96] of a Go program.
[2033.42 --> 2036.10] I think you are not going to dispute the fact
[2036.10 --> 2038.90] that if you receive some Go project
[2038.90 --> 2040.58] from a friend or a coworker
[2040.58 --> 2042.30] and you know nothing about this project
[2042.30 --> 2044.26] and you have to read this source code,
[2044.68 --> 2045.86] then this source code is going to be
[2045.86 --> 2047.12] much easier to understand
[2047.12 --> 2050.46] if the program is just a single thread
[2050.46 --> 2052.02] that is doing a single thing, right?
[2052.16 --> 2053.58] If you receive this program
[2053.58 --> 2055.10] that as soon as it begins,
[2055.16 --> 2056.66] it launches three different threads
[2056.66 --> 2058.50] that are supposed to do different things
[2058.50 --> 2059.32] at the same time
[2059.32 --> 2061.34] and figuring out exactly
[2061.34 --> 2063.60] what the program is going to be doing
[2063.60 --> 2064.76] is going to be, I think,
[2064.80 --> 2065.60] much more difficult.
[2066.48 --> 2068.20] Now, imagine the same thing,
[2068.32 --> 2070.96] but instead of receiving proper Go code,
[2071.36 --> 2073.02] then you would receive Go code
[2073.02 --> 2075.12] where all the variable names have been wiped
[2075.12 --> 2076.30] and all the variables are named
[2076.30 --> 2077.56] A, B and C, et cetera.
[2077.66 --> 2079.60] So you cannot even use the function names
[2079.60 --> 2081.16] or you cannot even use the variable names
[2081.16 --> 2082.98] to try to understand
[2082.98 --> 2084.44] what the program is supposed to do.
[2084.66 --> 2086.18] Imagine that you have no comments
[2086.18 --> 2087.24] inside the code as well.
[2087.68 --> 2089.68] This is basically what reverse engineers have.
[2089.68 --> 2091.18] You don't always have to imagine that.
[2091.46 --> 2092.14] Yeah, of course.
[2092.98 --> 2094.90] Yeah, this might be real life
[2094.90 --> 2096.44] for a lot of people out there.
[2097.00 --> 2097.96] Shout out to them, I guess.
[2098.26 --> 2101.48] But this is exactly what reverse engineering is.
[2101.66 --> 2102.86] Like you receive some source code,
[2103.04 --> 2104.78] whether it is assembly or high-level.
[2105.26 --> 2106.20] A high-level code is,
[2106.60 --> 2107.52] that does a bit of difference
[2107.52 --> 2109.00] because assembly is hard to read.
[2109.06 --> 2109.56] But basically,
[2110.28 --> 2111.38] it's going to be the same thing
[2111.38 --> 2112.40] that you have to go through, right?
[2112.44 --> 2113.30] You receive some code,
[2113.52 --> 2114.88] you have to understand what it does.
[2115.34 --> 2117.66] And the more complex this code is,
[2117.80 --> 2120.00] the more sophisticated its operations are,
[2120.08 --> 2121.72] then the harder time you're going to have
[2121.72 --> 2123.96] to understand exactly what is going on in there.
[2124.48 --> 2126.26] To this, it brings me to the next question
[2126.26 --> 2129.96] that generally Go best practice, let's say,
[2130.16 --> 2132.66] or like the right way to do Go
[2132.66 --> 2135.08] is to write simple, readable code
[2135.08 --> 2136.82] rather than sophisticated
[2136.82 --> 2139.00] and like trinary operations and whatnot
[2139.00 --> 2141.38] and complicated things.
[2141.64 --> 2144.86] Does this in any way help or not?
[2145.22 --> 2146.14] I wish,
[2146.30 --> 2148.98] but it turns out that for the compiler,
[2149.30 --> 2151.30] whether you write the simple way
[2151.30 --> 2152.68] or the trinary operation,
[2152.90 --> 2154.20] if the compiler is smart enough,
[2154.26 --> 2155.06] then at the end of the day,
[2155.06 --> 2155.98] it's going to generate
[2155.98 --> 2157.88] the very same assembly construct.
[2157.88 --> 2160.30] Hopefully, the compiler,
[2160.56 --> 2162.84] if you do this, if, then, else,
[2163.32 --> 2165.30] or if you use the trinary operator,
[2165.98 --> 2167.18] it's going to be able to recognize
[2167.18 --> 2168.06] that it's the same thing
[2168.06 --> 2168.52] and in the end,
[2168.58 --> 2169.66] it's going to generate assembly
[2169.66 --> 2170.94] that does exactly the same.
[2171.08 --> 2172.56] So it's a good thing
[2172.56 --> 2175.18] as far as development practices are concerned.
[2175.58 --> 2178.06] But when you reach the assembly level,
[2178.26 --> 2180.52] then all those helpful things
[2180.52 --> 2181.44] and all those precautions
[2181.44 --> 2182.36] that you have taken
[2182.36 --> 2184.02] to make sure that other people
[2184.02 --> 2185.98] will be able to understand
[2185.98 --> 2186.60] what you are doing,