44

Me:
*decompiles swf*
*thinks: "what is this shit?"*
*scrolls down*
*finds variable named "randomShit"*

Comments
  • 2
    You cant get good variable names if youre decompiling an exe
  • 1
    @linuxer4fun I know. Is it because of the compiler?
  • 2
    @calmyourtities the compiler does embed the variable names into nhe assembler file it generates... However, in assembler, "variables" are only a placeholder for a number, which represents the position relative to the beginning of the assembler file...

    0. File begins
    1. Section .data
    2. Myvar: db "hi"
    Blablabla
    10. Mov Myvar, eax

    This gets changed by the assembler to

    0. File begins
    1. Section .data
    2.db "HI" ;notice how the line number represents bytes in assembler
    5.blablabla ; it is required to skip these lines, else the linker wil allocate blablabla to the variable
    10. Mov file_begins+2,eax ; in the beginning of the execution every programm gets assigned a number where its execution starts in the ram... It is stored in a special regiser; if you wanna go in for a segfault, you can wove something into it

    So you see. Assembler just stores the values of the variables and the byte block number... Actually, a byte block number is 8 bytes wide... no space for typingg left
  • 2
    @linuxer4fun

    The assembler also does much more than shown above...

    Anyway. The .o file doesnt even contain infos about how long the variables are, or if there are even variables. It doesnt even care about nomes, as it knows the byte bloks they start in...

    You could do

    Mov var, dword[var2]

    Altough var2 is only a word long... It would just add the bytes of the next variable. It only sigsevs, when you try to access a pointer outside of the programm. This is caused by the operating system.

    Ok... Wrote everythitg pfuuhhhh
Add Comment