Posted by marginal on
2021-09-14
Estimated Reading Time 2 Minutes
Words 496 In Total
Viewed Times
这是一道pascal逆向+pwn
搜索字符串得到FPC 3.2.2 [2021/05/31] for x86_64 - Linux
FPC是pascal的编译器,
下好编译器, 编译器几份文件去bindiff.
重点是要编译一下system()这个函数.
网上抄的:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
program Greetings; const message = ' Welcome to the world of Pascal '; type name = string; var firstname, surname: name; begin writeln('Please enter your first name: '); readln(firstname); writeln('Please enter your surname: '); readln(surname); writeln; writeln(message, ' ', firstname, ' ', surname); end.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
program exRecursion; var num, f: integer; functionfact(x: integer): integer; (* calculates factorial of x - x! *) begin if x=0then fact := 1 else fact := x * fact(x-1); (* recursive call *) end; { end of function fact} begin writeln(' Enter a number: '); readln(num); f := fact(num); writeln(' Factorial ', num, ' is: ' , f); end.
1 2 3 4 5 6 7 8 9 10 11 12 13
rogram example56;
uses Unix;
{ Program to demonstrate the Shell function}
Var S : Longint;
begin Writeln ('Output of ls -l *.pp'); S:=fpSystem('ls -l *.pp'); Writeln ('Command exited with status : ',S); end.