Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write data to EXE file
#8
To change an EXE file one have to decompile it or use a disassembler. There are free (for-free) programs for this like: Cutter(OS) or IDA 82. These also allows programs to be debugged.

The following program below in IDA:

Code: (Select All)
Option _Explicit

Declare Function ggt(zahl1, zahl2 as Long) as Long
Declare Function kgV(zahl1, zahl2, ggtErgebnis as Long) as Long

Dim zahl1, zahl2 As Long
Dim d1, d2 As Long

Print
Print "Berechnet den GGT und das kgV nach Euklid"
Print
Input "Geben Sie die erste Zahl ein : ", zahl1
Input "Geben Sie die zweite Zahl ein: ", zahl2

'd1/2 = dummy - Zuweisung als Wert (Value)
'Sonst wird per Referenz auf zahl1/2 zugegriffen,
'und natuerlich ihr veraenderter Wert uebergeben
d1 = (zahl1)
d2 = (zahl2)

Print: Print
Print Using "Der gemeinsame Teiler von ##### und ##### ist: ####"; zahl1, zahl2, ggt(zahl1, zahl2)

Print: Print
'Nur mit den dummies funktioniert es
Print Using "Das kleinste gemeinsame Vielfache von ##### und ##### ist: ###,#####"; d1, d2, kgV(d1, d2, ggt(zahl1, zahl2))

End 'Hauptprogramm

Function ggt (zahl1, zahl2 As Long)

  Dim temp As Long

  While (zahl1 > 0)
    If (zahl1 < zahl2) Then
      temp = zahl1: zahl1 = zahl2: zahl2 = temp
    End If
    zahl1 = zahl1 - zahl2
  Wend
  ggt = zahl2

End Function

Function kgV (zahl1, zahl2, ggtErgebnis As Long)

  Dim ergebnis As Long

  ergebnis = ((zahl1 * zahl2) / ggtErgebnis)
  kgV = ergebnis

End Function

First a warning:
[Image: Warnung2023-05-15-182348.jpg]

Debugging in IDA:
[Image: Debugging-2023-05-15.jpg]
Reply


Messages In This Thread
Write data to EXE file - by Steffan-68 - 05-14-2023, 05:18 PM
RE: Write data to EXE file - by SMcNeill - 05-14-2023, 05:41 PM
RE: Write data to EXE file - by Steffan-68 - 05-14-2023, 08:37 PM
RE: Write data to EXE file - by mnrvovrfc - 05-14-2023, 10:31 PM
RE: Write data to EXE file - by Steffan-68 - 05-15-2023, 09:58 AM
RE: Write data to EXE file - by euklides - 05-15-2023, 03:00 PM
RE: Write data to EXE file - by Steffan-68 - 05-15-2023, 04:23 PM
RE: Write data to EXE file - by Kernelpanic - 05-15-2023, 05:21 PM
RE: Write data to EXE file - by Steffan-68 - 05-15-2023, 06:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Must an extra value be provided on DATA statement? dakra137 11 1,046 09-30-2025, 05:38 PM
Last Post: ahenry3068
  BINARY FILE write pmackay 6 700 09-29-2025, 01:06 PM
Last Post: dakra137
  keyword to get the EXE name and the EXE path instead of parsing Command$(0) ? madscijr 8 1,133 07-22-2025, 08:35 PM
Last Post: hsiangch_ong
  Seeking Matches in a Data Base Dimster 10 1,039 07-13-2025, 12:26 AM
Last Post: Dimster
  Change file data krovit 5 1,198 07-11-2024, 07:45 AM
Last Post: krovit

Forum Jump:


Users browsing this thread: 1 Guest(s)