 |
Coders' city Nasza pasja to programowanie!
|
| Zobacz poprzedni temat :: Zobacz następny temat |
| Autor |
Wiadomość |
janek6
Dołączył: 30 Mar 2010 Posty: 38
|
Wysłany: Pon Gru 20, 2010 5:56 pm Temat postu: [MASM] CreateFile: niezdefiniowane symbole |
|
|
Witam. Przepisuje kod z FASM na MASM. Napotkałem na problem z funkcją CreateFile.
| Kod: |   .686
  .model flat, C
  
  extrn _ExitProcess@4 : near
  include \masm32\include\kernel32.inc
  include \masm32\include\user32.inc
  
  includelib \masm32\lib\kernel32.lib
  includelib \masm32\lib\user32.lib
  
  MZ_MAGIC equ 0x5a4d
  PE_MAGIC equ 0x00004550
  
  .data
  
  .code
  _main:
  
  code_start:
  
  file_to_open equ 'test.exe'
  ok_text equ 'bla'
  idata_end equ 0xFF
  code_end equ 0xFF
  
  start:
  push 0 ;TemplateFile = NULL
  push FILE_ATTRIBUTE_NORMAL ;"Create normal file.
  push OPEN_EXISTING ;Open existing only
  push 0 ;No security options
  push 0 ;Allow to share for reading
  push GENERIC_RW ;open for reading
  push file_to_open ;filename
  
  call [CreateFile]
  
  cmp eax, INVALID_HANDLE_VALUE ;succeed to open?
  je code_end ;if so, proceed
  push dword PTR 0
  call _ExitProcess@4
  
  END
|
Błędy które dostaje wyglądają mi na nieporwane załadownie bibliotek kernel32.lib.
| Cytat: | .\kod.asm(36) : error A2006:undefined symbol : FILE_ATTRIBUTE_NORMAL .\kod.asm(37) : error A2006:undefined symbol : OPEN_EXISTING .\kod.asm(40) : error A2006:undefined symbol : GENERIC_RW .\kod.asm(41) : error A2084:constant value too large .\kod.asm(45) : error A2006:undefined symbol : INVALID_HANDLE_VALUE |
Czy mam racje ? Jak sprawdzić poprawność załadowanie tej biblioteki.
Tytuł wątku zmieniony przez moderatora. Pisz sensowne tematy! marcin_an Od moderatora: czy komunikaty błędów są kodem źródłowym? Nie, więc po co je jako takie oznaczasz!? marcin_an |
|
| Powrót do góry |
|
 |
|
|
|
|
Możesz pisać nowe tematy Możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Możesz dodawać załączniki na tym forum Możesz pobierać pliki z tego forum
|
 Debug: strone wygenerowano w 0.07368 sekund, zapytan = 7
|