Skip to content

Commit c151eae

Browse files
committed
update: source cleaning
- clean the source code - add nasm.exe - the assembler, and upx.exe - the packer as shared tools
1 parent e536bf1 commit c151eae

File tree

7 files changed

+39
-80
lines changed

7 files changed

+39
-80
lines changed

src/_internal/shared/bin/nasm.exe

329 KB
Binary file not shown.

src/_internal/shared/bin/upx.exe

553 KB
Binary file not shown.

src/_internal/shared/data.inc

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +0,0 @@
1-
fmtHello: WSTR "abde fg", 13, 10, 0
2-
fmtHello_length equ ($-fmtHello)-1
3-
written: dd 0
4-
5-
align 4
6-
last_error: dd 0
7-
8-
; Puffer für CONSOLE_SCREEN_BUFFER_INFO (>= 22 Bytes; wir nehmen 32 zur Sicherheit)
9-
csbi: times 32 db 0
10-
orig_attr: dw 0
11-
12-
fmtW: WSTR "Win32-Fehler: 0x%08X (%u)", 0 ; Format-String (UTF-16)
13-
wbuf: times 256 dw 0 ; Ausgabepuffer (128 WCHAR)
14-
ErrTitleW: WSTR "Fehler", 0
15-
16-
pMsg: dq 0 ; LPWSTR, wird von FormatMessageW allokiert
17-
errmsgW: WSTR 'RegisterClassExW failed'
18-
titleW: WSTR 'NASM PE64 GUI without Linker'
19-
winclassW: WSTR 'NasmWndClass'
20-
21-
; SMALL_RECT {Left,Top,Right,Bottom} = {0,0,79,24}
22-
Rect80x25: dw 0, 0, 79, 24
23-
24-
hWndCon: dq 0
25-
hMenu: dq 0
26-
27-
caption: db "Eingabe",0
28-
src times 256 db 0
29-
dst times 512 db 0
30-
bytesRead: dq 0 ; DWORD64 für Anzahl gelesener Zeichen
31-
32-
charswritten: dd 0 ; LPDWORD für WriteConsoleA (Anzahl Zeichen)
33-
MessageErrorTextW: WSTR "message error text"
34-
35-
fmt: db "%6d", 0 ; Limitiert die Eingabe für %s auf 63 Zeichen
36-
outfmt: db "Eingabe: %s", 13,10, 0
37-
num: dd 0
38-
39-
msg_down db "KEYDOWN: VK=%04X CH='%c'", 13,10, 0
40-
msg_up db "KEYUP : VK=%04X CH='%c'", 13,10, 0
41-
42-
hIn: dq 0
43-
hOut: dq 0
44-
prompt: db "Eingabe: ",0
45-
read: dd 0
46-
47-
; Wir lesen ein Array von 32 INPUT_RECORDs (je 20 Bytes → 640 Bytes)
48-
; Layout (x64, gepackt wie WinAPI, jeweils 2-Byte-aligned):
49-
; INPUT_RECORD {
50-
; WORD EventType; ; +0
51-
; WORD Padding; ; +2 (Ausgleich)
52-
; union {
53-
; KEY_EVENT_RECORD { ; +4
54-
; BOOL bKeyDown; ; +4 (4)
55-
; WORD wRepeatCount; ; +8 (2)
56-
; WORD wVirtualKeyCode; ; +10 (2)
57-
; WORD wVirtualScanCode; ; +12 (2)
58-
; WCHAR UnicodeChar; ; +14 (2) (wir nutzen W-Variante)
59-
; DWORD dwControlKeyState; ; +16 (4)
60-
; } ; Größe 20 Bytes insgesamt
61-
; }
62-
; }
63-
; == Gesamtgröße INPUT_RECORD: 20 Bytes
64-
records: times 32*20 db 0
65-
readCount: dd 1
66-
tmpConsoleMode: dd 0

src/_internal/shared/data64.asm

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
1-
1+
; -----------------------------------------------------------------------------
2+
; \file data64.asm
3+
; \note (c) 2025 by Jens Kallup - paule32
4+
; all rights reserved.
5+
;
6+
; \desc Create a dBASE MS-Windows 11 64-bit Pro EXE.
7+
; -----------------------------------------------------------------------------
28
times (DATA_RAW_PTR-($-$$)) db 0
39
data_start:
10+
411
%include 'data.inc'
5-
errA: db 'MessageBoxW failed',0
6-
capA: db 'User32',0
7-
msgW: WSTR 'Hello World'
12+
813
cap2A: db "ein Text",13,10,0
914
cap2A_length equ ($ - cap2A)
10-
capW: WSTR 'Pure NASM PE-64', 0
11-
capW_length: dd 5 ; equ ($-capW)
15+
16+
fmtW: WSTR "Win32-Fehler: 0x%08X (%u)", 0 ; Format-String (UTF-16)
17+
ErrTitleW: WSTR "Fehler", 0
18+
19+
errmsgW: WSTR 'RegisterClassExW failed'
20+
titleW: WSTR 'NASM PE64 GUI without Linker'
21+
winclassW: WSTR 'NasmWndClass'
22+
prompt: db "Eingabe: ",0
23+
24+
; SMALL_RECT {Left,Top,Right,Bottom} = {0,0,79,24}
25+
Rect80x25: dw 0, 0, 79, 24
26+
pMsg: dq 0 ; LPWSTR, wird von FormatMessageW allokiert
27+
28+
wbuf: times 256 dw 0 ; Ausgabepuffer (128 WCHAR)
29+
src: times 256 db 0
30+
dst: times 512 db 0
31+
32+
hIn: dq 0
33+
hOut: dq 0
34+
read: dd 0
35+
tmpConsoleMode: dd 0
36+
last_error: dd 0
37+
1238
data_end:
1339
times (ALIGN_UP($-$$,FILEALIGN)-($-$$)) db 0

src/_internal/shared/start.exe

-4.5 KB
Binary file not shown.

src/_internal/shared/stdlib.inc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ utf8_to_cp1252_char:
196196
push rbx
197197

198198
mov bl, [rcx]
199-
ShowMessageW titleW,capW
200199
test bl, bl
201200
jz .nul ; Stringende
202201

@@ -338,9 +337,9 @@ utf8_to_cp1252:
338337
inc rax ; count++
339338
jmp .next
340339
.done:
341-
push rcx
342-
ShowMessageW titleW,capW
343-
pop rcx
340+
;push rcx
341+
;ShowMessageW titleW,capW
342+
;pop rcx
344343
mov byte [rdi], 0
345344
pop rdi
346345
pop rsi

src/_internal/shared/text64.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ PASCALMAIN:
3232

3333
; ReadConsoleA(hIn, inbuf, maxChars, &read, NULL)
3434
mov rcx, r13
35-
mov rdx, IMAGE_BASE
36-
add rdx, RVA_DATA(src)
35+
GETDATA rdx, src
36+
;mov rdx, IMAGE_BASE
37+
;add rdx, RVA_DATA(src)
3738
mov r8d, 127 ; maxChars (Reserviere 1 Byte für NUL)
3839
mov r9, IMAGE_BASE
3940
add r9, RVA_DATA(read)
@@ -45,10 +46,9 @@ PASCALMAIN:
4546
4647
GETDATA rcx, src
4748
GETDATA rdx, dst
48-
4949
call utf8_to_cp1252
5050

51-
ShowMessageW dst,src
51+
ShowMessageW src,dst
5252
; --- Exit ---
5353
.exit:
5454
xor ecx, ecx

0 commit comments

Comments
 (0)