Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

? Start a program like it was started by windows?

Hi!

I need to load a program, as it was loaded by windows.
EXACTLY
So the program could not determine, it was started by clickin on its icon, or loaded by my app...

THX,
Edocecrous


Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : Hi!
    :
    : I need to load a program, as it was loaded by windows.
    : EXACTLY
    : So the program could not determine, it was started by clickin on its icon, or loaded by my app...
    :
    : THX,
    : Edocecrous
    :
    :
    :
    [blue]I do not think the program can determine how it was started... just use [b]CreateProcess()[/b].[/blue]
  • edocecrousedocecrous Member Posts: 49
    Thanks!
    I'll try that...

    By the way, since your ID is AsmGuru, You might be the person to ask:
    Is there a preferred sequence, how should I look for opcodes, or it doesn't matter?

    I'm writing a disassembler, and my idea was to load 15 bytes,
    and go through them:
    First checking for prefixes,
    Than checking the high bits for op-code,
    When found, determine the S and W bits and set the operand parity/length,
    Check for MOD/OP/RM bits, and set the operand modifiers
    Load the data bytes,
    Determine the instruction length, and remove the instruction,
    Mov the bytes to the startingpoint of the 15byte, load the missing bytes

    And start over on the next instruction...

    Or it's simpler or faster to use lookup tables?

    Edocecrous

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : Thanks!
    : I'll try that...
    :
    : By the way, since your ID is AsmGuru, You might be the person to ask:
    : Is there a preferred sequence, how should I look for opcodes, or it doesn't matter?
    :
    : I'm writing a disassembler, and my idea was to load 15 bytes,
    : and go through them:
    : First checking for prefixes,
    : Than checking the high bits for op-code,
    : When found, determine the S and W bits and set the operand parity/length,
    : Check for MOD/OP/RM bits, and set the operand modifiers
    : Load the data bytes,
    : Determine the instruction length, and remove the instruction,
    : Mov the bytes to the startingpoint of the 15byte, load the missing bytes
    :
    : And start over on the next instruction...
    :
    : Or it's simpler or faster to use lookup tables?
    :
    : Edocecrous
    :
    :
    [blue]Your logic sounds good. Of course, lookup will be faster. You read a byte and then you have a table with 256 slots - every slot contains a label address where to jump, so you just go:

    1. Load byte
    2. Jump to address at TABLE[byte value]

    Build your table by the manual of the processor you trying to disassemble.[/blue]
  • edocecrousedocecrous Member Posts: 49
    : [blue]Your logic sounds good. Of course, lookup will be faster. You read a byte and then you have a table with 256 slots - every slot contains a label address where to jump, so you just go:
    :
    : 1. Load byte
    : 2. Jump to address at TABLE[byte value]
    :
    : Build your table by the manual of the processor you trying to disassemble.[/blue]

    Thanx,
    I did used table(s), and working well. I was writing a disassembler for the x86, up to pentium codes,+FP,+MMX fixed 32bit interpretation. /I use it under Win32.../

    Edocecrous
  • Justin BibJustin Bib USAMember Posts: 0

    ___ \ http://forcoder.org \ free ebooks and video tutorials about { C++, Visual Basic, Scratch, PHP, Java, JavaScript, R, Objective-C, C, Assembly, Ruby, Go, Delphi, Python, Visual Basic .NET, MATLAB, PL/SQL, C#, Swift, Perl Bash, Awk, Scala, Transact-SQL, Prolog, COBOL, Fortran, LabVIEW, VBScript, Julia, Hack, Ada, Clojure, Rust, SAS, Logo, D, Alice, Lua, FoxPro, ML, Lisp, ABAP, Erlang, F#, Scheme, Dart, Crystal, Kotlin, Apex } ________

Sign In or Register to comment.