flat assembler
Message board for the users of flat assembler.
Index
> Main > bootstraping fasmg, x64dbg, to reproduce PE P016 |
Author |
|
beowulf34 19 Oct 2022, 03:03
@bitRAKE
Moving our conversation here. I am trying to reproduce your PE P016 assembly solution: Code: POWER EQU 1000 _DATA SEGMENT Number DWORD (POWER+31)/32 DUP (0) _DATA ENDS ; set up number in binary lea ebp, [Number] mov eax, POWER bts [ebp], eax ; convert to decimal to sum digits mov edi, LENGTHOF Number - 1 mov ecx, 10 xor ebx, ebx ; sum _0: mov esi, edi ; dwords to convert xor edx, edx @@: mov eax, [ebp][esi*4] div ecx mov [ebp][esi*4], eax dec esi jns @B add ebx, edx cmp DWORD PTR [ebp][edi*4], 0 jne _0 dec edi jns _0 Full source is here: https://github.com/bitRAKE/fasmg_playground/blob/master/math/Project%20Euler/P016.asm You recommended fasm assembler with the x64dbg/radare2 debugger. I have tried the fasmg and fasm windows releases, without success to compile the P016.asm. I have successfully executed fasmg on macos to run the P016.g script. It cannot create an output file. Likewise, fasmg.exe via wine also runs the P016.g script and cannot create an output file. Trying to compile the .asm file results in: Error: source file 'win64a.inc' not found. None of the releases appear to contain this file. As far as I can tell it is some sort of legacy fasm windows support include dependency. The fasm windows release gets a little further: Code: wine /Users/jhg/Work/euler/fasm_win/FASM.EXE P016.asm flat assembler version 1.73.300024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION (655359 kilobytes memory) P016.asm [3]: POWER = 1000 error: unexpected characters. I do not have /r/n line endings, which git can sometimes change to /n for unix (I am macos native). I see you have a .gitattributes which disables this translation, so it's not that. Thoughts? Cheers, Joe |
|||
19 Oct 2022, 03:03 |
|
bitRAKE 19 Oct 2022, 03:51
The following steps produce no error:
Code: git clone https://github.com/bitRAKE/fasmg_playground.git cd "fasmg_playground\math\Project Euler" fasmg P016.g fasmg P016.asm P016.exe This does require having your environment configured correctly. Which means fasmg on the PATH and INCLUDE defined such that it points to "\fasmg\packages\x86\include". Whatever problem you are having is most likely due to insufficient environment configuration. This newer repo is even a simpler process: Code: git clone --recursive https://github.com/bitRAKE/fasmg-umbrella cd fasmg-umbrella environment.cmd 'win64a.inc' is indeed part of fasmg - you may find it at: \fasmg\packages\x86\include\win64a.inc Good luck. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
19 Oct 2022, 03:51 |
|
bitRAKE 20 Oct 2022, 03:47
A typical debug session would be, load the EXE, F9 - execute until entry breakpoint, and then use a combination of F2/F7/F8/F9 to navigate execution. You'll probably want to examine machine state, memory, etc. Might seem over-whelming at first, but becomes second nature. Don't worry about making a mistake - the EXE can always be reloaded, and try again. Change things, break stuff, etc.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
20 Oct 2022, 03:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.