disassembly

Can I combine all the sections “Objdump -S -d elf-file” generate into a re-assemble capable file?

[亡魂溺海] 提交于 2019-12-04 15:32:33
THe elf file is static linked and currently the objdump's output is something like: Disassembly of section: .init: xxxxxx Disassembly of section: .plt: xxxxxx Disassembly of section: .text: xxxxxx basically what I want to achieve is "elf-file -(disassemble by objdump)-> assemble file --(re-compile)--> same functionality " I don't need the re-compiled binary has the binary content same as the original one, only same functionality is enough. After a quick search, basically the answer is no , and they argued that disassemble file lost some stuff like symbolic information or others, but I think by

Understanding disassembly of Dalvik code?

百般思念 提交于 2019-12-04 12:31:43
问题 I am playing around with smali and baksmali on a small Hello World Android application I have written. My source code is: package com.hello; import android.app.Activity; import android.os.Bundle; public class Main extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } which was then disassembled to: .class public Lcom/hello/Main; .super Landroid/app

Confused by TBB in a section of ARM disassembly

旧时模样 提交于 2019-12-04 09:43:47
As an intro to learning Arm assembly, I'm trying to recreate disassembled functions in a higher level language. However I'm confused by the following bit of assembly: 0000315e 2101 movs r1, #1 00003160 e8dff000 tbb [pc, r0] 00003164 030e lsls r6, r1, #12 00003166 0907 lsrs r7, r0, #4 00003168 050b lsls r3, r1, #20 0000316a 2106 movs r1, #6 0000316c e008 b.n 0x3180 0000316e 2102 movs r1, #2 00003170 e006 b.n 0x3180 00003172 2103 movs r1, #3 00003174 e004 b.n 0x3180 00003176 2104 movs r1, #4 00003178 e002 b.n 0x3180 0000317a 2105 movs r1, #5 0000317c e000 b.n 0x3180 0000317e 2100 movs r1, #0

How to intercept a call to a nonvirtual method from/to thirdy-party libraries in .Net?

百般思念 提交于 2019-12-04 09:39:19
I think what I need is something the .net folks call "transparent dynamic proxy", but all the implementations I've seen this far (Castle DynamicProxy, Spring.NET AOP, etc) require me to do at least one of these: Declare intercepted method as virtual Wrap class and create instances of the wrapper instead of wrapped class Change inheritance or implement interfaces Obviously, if both caller and callee are nonvirtual and from thirdy-party closed source libraries, which is the case, there is nothing I can do. If C# were a dynamic language like Python I would do something like this: foo =

What is your favorite disassembler tool in Mac OS X? [closed]

牧云@^-^@ 提交于 2019-12-04 07:23:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am using the otool , nm and Fraise text editor to disassemble the Mach-o binaries. My workflow at this point is pretty straightforward: 1. List the existed symbols. nm -g 2. Get the disasm code. otool -vt 3. Copy and paste this output to a text file. 4. Read and comment the codes in the text editor :) I am

No .BSS in PE file

纵然是瞬间 提交于 2019-12-04 05:21:54
问题 Here is short console application example static char buffer[4096]; int main() { for(int i=0;i<4096;i++) { buffer[i] = 1234; } return 0; } As I understand, 'exe' file produced by the compiler should contain .bss section to store 'buffer' variable. I'm using Tiny C Compiler and resulting file does not contain any reference to .bss. DOS Header Magic number: 0x5a4d (MZ) Bytes in last page: 144 Pages in file: 3 Relocations: 0 Size of header in paragraphs: 4 Minimum extra paragraphs: 0 Maximum

x86 instruction encoding how to choose opcode

孤人 提交于 2019-12-04 03:30:15
问题 When encode instruction cmpw %ax -5 for x86-64, from Intel-instruction-set-reference-manual, I have two opcodes to choose: 3D iw CMP AX, imm16 I Valid Valid Compare imm16 with AX. 83 /7 ib CMP r/m16, imm8 MI Valid Valid Compare imm8 with r/m16. So there will be two encoding results: 66 3d fb ff ; this for opcode 3d 66 83 f8 fb ; this for opcode 83 Then which one is better? I tried some online-disassembler below https://defuse.ca/online-x86-assembler.htm#disassembly2 https://onlinedisassembler

Smashing the stack example3.c confusion

混江龙づ霸主 提交于 2019-12-04 03:08:51
Article can be found here . I'm reading up on smashing the stack and have found myself to be getting stuck on example3.c. 0x80004a3 <main+19>: call 0x8000470 <function> 0x80004a8 <main+24>: addl $0xc,%esp 0x80004ab <main+27>: movl $0x1,0xfffffffc(%ebp) 0x80004b2 <main+34>: movl 0xfffffffc(%ebp),%eax The author indicates that we want to skip from 0x80004a8 to 0x80004b2 and that this jump is 8 bytes; how has the author determined this is 8 bytes? I have recreated the code and sent it through objdump and found that it's not 8 bytes (I am on a 64 bit machine but I've made sure to compile using 32

Keep getting e8 00 00 00 00 as the machine code to call a function in assembly

穿精又带淫゛_ 提交于 2019-12-04 02:27:26
问题 I know when using objdump -dr in my file call shows up in machine code as e8 00 00 00 00 because it has not yet been linked. But I need to find out what the 00 00 00 00 will turn into after the linker has done it's job. I know it should calculate the offset, but I'm a little confused about that. As an example with the code below, after the linker part is done, how should the e8 00 00 00 00 be? And how do I get to that answer? I'm testing out with this sample code: (I'm trying to call moo)

What is a good android disassember that can produce infomative results [closed]

六眼飞鱼酱① 提交于 2019-12-03 21:30:56
as titled, like function calls, application behavior when running You have a few options. "dexdump" is included with the SDK and is present on the device. With the "-d" option it produces a no-frills disassembly of the methods. The output format is intended to mimic the "--dump-to" output format of dx. "smali/baksmali" is an assembler/disassembler for Dalvik bytecode. It's open source , and is probably the most complete solution. "dedexer" is a disassembler that produces Jasmin-like output. It's also open source . As far as I know, nobody has written a program that attempts to convert Dalvik