Results 1 to 6 of 6

Thread: Writing an OpCode Generator

  1. #1
    foxthree
    Guest

    Writing an OpCode Generator

    Hi:

    I was just wondering about OpCodes and stuff and I thought it would be a cool idea to write an OpCode generator for Intel Pentiums. Not that there aren't tools out there already but I downloaded a couple of them and they didn't look that impressive to me (bad UI and bad bad bugs :-<)

    So what would it take to write a OpCode Generator? Any good pointers to information is gratefully accepted. (if the site has source code even better ;-))

    Thanks,

    --Signed
    FoxThree
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    Red wine, not vodka! ZaiRoN's Avatar
    Join Date
    Oct 2001
    Location
    Italy
    Posts
    922
    Blog Entries
    17
    hi foxthree,
    if i remember well there's an opcode generator written by Neural Noise with the source code. you could try it...

    bye
    ZaiRoN

  3. #3
    DakienDX
    Guest
    Hello foxthree !

    What do you exactly mean by a OpCode Generator?

    A program which generates opcodes from text? (Why not try TASM/MASM?)

    A program which checks if given binary data is valid code?

    A program which creates code to make debugging harder?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  4. #4
    foxthree
    Guest

    Hi DakienDX

    Hi DakienDX:

    I was more referring to the one like Zairon... you input some assembly instructions and it generats OPcodes for that. However, the problem with some of the Opcode generators are that they're buggy and generate wrong opcodes at times.

    Yes, I came to know that it would something similar to writing an assembler. I wouldn't want to write a full-fledged assembler... not yet ;-). Just one that generates OpCodes.

    It was just for my learning...

    Signed,
    -- FoxThree
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  5. #5
    Teach, Not Flame Kayaker's Avatar
    Join Date
    Oct 2000
    Posts
    4,127
    Blog Entries
    5
    Hi foxthree

    You could take a look at LDE32 (Length Disassembly Engine) by Z0mbie. It's an ASM module you can incorporate into your code. Would require a loader for the target file, then you give it an address to partially disassemble and it returns the proper opcodes from the sequence of bytes starting at that address.

    To actually get the disassembled text you'd need to pass the opcodes to a disassembler. I found LDE32 lacked support for some recent P6 opcodes, but it's fine for the basics.

    But if you're going for the full disassembler route, it'd be best to look into something like the NASM source or Borg or some other sourced disassembler.

    Just out of curiousity, what other Opcode generators have you found other than Neurals OpGen? I can't think of any others per se.

    Actually, I just noticed Z0mbie has a couple of updates and there's 2 interesting opcode programs (using his LDE32) used here:

    http://z0mbie.host.sk/opcodes.html

    Kayaker

  6. #6
    foxthree
    Guest

    Arrow OpCoder (protools.cjb.net)

    Hi Kayaker:

    I found this too at protools.cjb.net. However link is broken and a Google search revealed nothing :-<


    oPcodeR by Cool McCool. 16.IV.2001.
    oPcodeR 1.1 (297K).

    News:
    - added support for ADC, ADD, ARPL, BSWAP, IDIV, LDS, LES, LFS, LGS, LSL, LSS, SBB, SFENCE, SUB

    oPcodeR is another opcode generator. But it doesn't simply generate opcodes from values given in comboboxes. It occupies some sort of built-in parser, which generates byte series from typed instructions.

    Signed,
    -- FoxThree
    I promise that I have read the FAQ and tried to use the Search to answer my question.

Similar Threads

  1. Patch Generator
    By peterg70 in forum Tools of Our Trade (TOT) Messageboard
    Replies: 4
    Last Post: February 17th, 2013, 16:38
  2. Need Dictionary Generator
    By Aimless in forum Off Topic
    Replies: 2
    Last Post: April 1st, 2009, 12:55
  3. Writing an EXE packer ?
    By squidge in forum Malware Analysis and Unpacking Forum
    Replies: 5
    Last Post: December 4th, 2002, 15:25
  4. C Source Code Generator
    By silent in forum Tools of Our Trade (TOT) Messageboard
    Replies: 5
    Last Post: July 5th, 2002, 15:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •