Parse simple Input file and generate output file

  • Tình trạng Đã Đóng
  • Ngân sách $30 - $250 USD
  • Tổng Lượt Chào Giá 25

Mô Tả Dự Án

Hello,

I need a simple command line application (in C/C++ with Visual Studio) that accepts

one input file and generate one output (parsed) file. The command line arguments are:

ParseTests [url removed, login to view] [url removed, login to view] test_name bits

"test_name" is just a simple string (word)

"bits" can be the string "32" or the string "64"

This is an example test input file:

*************************************

Test Number: 0

-------------------

04240000h push eax

04240001h mov eax, DEAD14C6h

04240006h add cx, word ptr [eax]

04240009h pop eax

0424000ah jnp 04240012h

04240010h shl cl, cl

04240012h jmp 04240018h

04240013h mov eax, DEAD052Ah

04240018h and word ptr [eax], 38B8h

Test Number: 1

-------------------

04240000h push edx

04240001h ja 04240024h

0424001ch pop ebx

0424001dh jnl 0424002Bh

04240023h push esi

04240024h jbe 04240029h

04240029h mov dword ptr [esi], edx

0424002bh pop esi

*************************************

The output file is generated as following:

1) Replace all "DEAD" strings with "0DEAD"

2) Replace all " ptr [" with " ["

3) This is the one a bit more complex:

All jump instructions (JMP, JNZ, JZ, JA, JAE, JBE, JB, JG, JGE, JL, JLE, JNO,

JNP, JNS, JO, JP, JS) contains an address next to it.

That address should be converted as "labelX" (X is an incremental counter)

In the left column, you can see an hexadecimal address. That hexadecimal address

is removed, but the ones that are referenced by "jumps" are converted at the

corresponding label. Please, look at the output file for better understanding

This is the output file for the above example (notice that some "headers" are

generated). Notice that "32" (in the BITS section) is taken from the command line

argument "bits". Suppose that we passed as "test_name" command line argument the

string "test_random"

*************************************

[test_random_1]

{

BITS

{

32

}

EXECUTE

{

push eax

mov eax, 0DEAD14C6h

add cx, word [eax]

pop eax

jnp label1

shl cl, cl

label1: jmp label2

mov eax, 0DEAD052Ah

label2: and word [eax], 38B8h

}

}

[test_random_2]

{

BITS

{

32

}

EXECUTE

{

push edx

ja label1

pop ebx

jnl label2

push esi

label1: jbe label3

label3: mov dword [esi], edx

label2: pop esi

}

}

*************************************

Attached you have a longer input file sample so you can test better.

Nhận báo giá miễn phí cho dự án tương tự
Đã trao cho:
Các kỹ năng yêu cầu

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Thuê những Freelancer đã đặt giá trong dự án này

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online