Re: [Lazarus] trying to read an EXE

2021-09-05 Thread duilio foschi via lazarus
a new world to discover. Thanks a lot Peppe On Sun, Sep 5, 2021 at 4:30 PM Christo Crause wrote: > > On Sun, Sep 5, 2021 at 12:50 PM duilio foschi via lazarus < > lazarus@lists.lazarus-ide.org> wrote: > >> > An alternative is to use a tool such as objdump or dumpbin to >> disassemble the

Re: [Lazarus] trying to read an EXE

2021-09-05 Thread Christo Crause via lazarus
On Sun, Sep 5, 2021 at 12:50 PM duilio foschi via lazarus < lazarus@lists.lazarus-ide.org> wrote: > > An alternative is to use a tool such as objdump or dumpbin to > disassemble the executable file. > > objdump seems to be a unix tool. AFAIK dumpbin will only work from Visual > Studio. > You can

Re: [Lazarus] trying to read an EXE

2021-09-05 Thread duilio foschi via lazarus
x Christo ; for the problem in question, I was running short of time, so I went back to the source, fixed the line and recompiled. However this question picked my curiosity and I'd like to know more >The easiest way to see both the machine code, the disassembled code and the Pascal code from

Re: [Lazarus] trying to read an EXE

2021-09-04 Thread Christo Crause via lazarus
On Sat, Sep 4, 2021 at 11:53 AM duilio foschi via lazarus < lazarus@lists.lazarus-ide.org> wrote: > I followed Bart's suggestion and added the -al switch to the fpc.cfg file. > > This was probably the right move, as - after a new compile - I could see > the wanted .s file beside the regular EXE.

Re: [Lazarus] trying to read an EXE

2021-09-04 Thread duilio foschi via lazarus
I followed Bart's suggestion and added the -al switch to the fpc.cfg file. This was probably the right move, as - after a new compile - I could see the wanted .s file beside the regular EXE. I uploaded the .s file here: https://mega.nz/file/rlpyHa7b#fx0LYTjapmUdFRkzVGCCzFFogqYuEu7UvYQ5HtilLks I

Re: [Lazarus] trying to read an EXE

2021-09-04 Thread Christo Crause via lazarus
On Fri, Sep 3, 2021 at 11:08 PM duilio foschi via lazarus < lazarus@lists.lazarus-ide.org> wrote: > I thought it would be easy to use an hex editor like PSPad hex, find the > number > 2005 as 07D5 then fix it (maybe after the right guess in case of multiple > hits). > As a test I compiled a

Re: [Lazarus] trying to read an EXE

2021-09-03 Thread Sven Barth via lazarus
duilio foschi via lazarus schrieb am Fr., 3. Sep. 2021, 23:08: > > Looking for string 'peppe', I can easily spot the part that contains > the code of interest. > In addition to what Bart wrote: the string will be located in a different section (usually .rdata) than where it will be used (in

Re: [Lazarus] trying to read an EXE

2021-09-03 Thread Bart via lazarus
On Fri, Sep 3, 2021 at 11:08 PM duilio foschi via lazarus wrote: > In which form gets this instruction compiled? >i:=cmbYear.ItemIndex+2005; Compile wit -al and then open the resulting .s file in a texteditor. You'll see the assembler that the compiler generates for that line: It will be

[Lazarus] trying to read an EXE

2021-09-03 Thread duilio foschi via lazarus
today I did an experiment that gave me surprising results (due to my ignorance, of course). I have an application written in Lazarus and I need to do one fix only. This line result:=EncodeDate( cmbYear.ItemIndex+2005, cmbMonth.ItemIndex+1, 1); needs to be changed into