Results 1 to 6 of 6

Thread: win32 c processor only needed

  1. #1
    ::[ Reverse Engineer ]:: OHPen's Avatar
    Join Date
    Nov 2002
    Location
    .text
    Posts
    399
    Blog Entries
    5

    win32 c processor only needed

    Hi all,

    actually I'm working on a project where i have to process a non c file with with a typical standard c preprocessor in order to rename some strings, etc.
    the file i have to process is a java source file.

    i just want to merge "#define"-declarations with the java source file and afterwards the preprocessor should do the replace work for me and produce a new java source file with renamed methods, fields, etc.

    i know that i could use cpp with the according switch but i would prefare a standalone console tool, to simplify the process.

    any ideas what i could use on a standard win32 system ?

    thx in advance,

    OHPen
    - Reverse Enginnering can be everything, but sometimes it's more than nothing. Really rare moments but then they appear to last ages... -

  2. #2
    If I'm understanding you right you need to tokenize and extract from a source file. Sounds like you want a lexer like Flex? You'll have to do some coding but if you already know how to use a lexer it'll be much faster.

    http://flex.sourceforge.net/
    Still here...

  3. #3
    ::[ Reverse Engineer ]:: OHPen's Avatar
    Join Date
    Nov 2002
    Location
    .text
    Posts
    399
    Blog Entries
    5
    @silver: thx for your reply. it would be no problem to write my own tokenizer and so it would also be no problem to use an tokenizer or as you said a lexer.
    But this is far to much for the simple problem i have to solve.

    A "#define"-Mechanism would do it fast enough for me. I will use this solution because it produces the smallest amount of work for me. its more a search'n'replace problem than a tokenizing problem.

    you surely agree that a preprocessor is pretty good adequat for this job.

    the problem is now only to find a small c preprocess which is able to handle file up to 8000 lines of code. nothing more.

    i hope someone know such a preprocessor, would be really great.
    if not so then i will use the preprocess from gnu, which is not so good (cpp).

    cu

    OHPen
    - Reverse Enginnering can be everything, but sometimes it's more than nothing. Really rare moments but then they appear to last ages... -

  4. #4
    King of Redonda
    Join Date
    Jul 2006
    Posts
    109
    Blog Entries
    4
    sed?
    http://gnuwin32.sourceforge.net/packages/sed.htm
    <[TN]FBMachine> i got kicked out of barnes and noble once for moving all the bibles into the fiction section

  5. #5
    python might be a good candidate too...

  6. #6
    ::[ Reverse Engineer ]:: OHPen's Avatar
    Join Date
    Nov 2002
    Location
    .text
    Posts
    399
    Blog Entries
    5
    Thanks for all replies

    But as i said before i really want to use an c-preprocessor. it's not only because i want, i also because i would have to make changes to our build system when i would use new software. and if there would be a c-preprocessor we probably already have it intregrated somewhere

    Anyway, i decided to use cpp now:

    By using this command line parameters i achieve what it want:

    cpp -E test.java -o test2.java -P

    It wasn't obvious that it is so simple. So this solution will do it for me,

    thanks,

    OHPen
    - Reverse Enginnering can be everything, but sometimes it's more than nothing. Really rare moments but then they appear to last ages... -

Similar Threads

  1. disasseble for arm-processor...
    By SpeKKeL in forum The Newbie Forum
    Replies: 10
    Last Post: March 24th, 2005, 15:41
  2. Reduce processor power?
    By xoder in forum Off Topic
    Replies: 4
    Last Post: February 8th, 2004, 17:05
  3. SoftICE 'bprw' vs. Athlon processor (lockup)???
    By Clandestiny in forum Tools of Our Trade (TOT) Messageboard
    Replies: 5
    Last Post: January 22nd, 2003, 17:11
  4. IDA new processor module
    By Rainor in forum Advanced Reversing and Programming
    Replies: 4
    Last Post: April 2nd, 2002, 20:55
  5. IDA Pro 4.17 and Windows CE apps (for MIPS processor)
    By novichok in forum Tools of Our Trade (TOT) Messageboard
    Replies: 7
    Last Post: March 17th, 2002, 14:11

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
  •