Skip to content

Commit 9a50a10

Browse files
authored
Merge pull request #2 from wizardy0ga/crt-independant-printing
- Removed CRT dependency (print) from dbg macro in hashycalls source code. Hashycalls can now be debugged within implants that don't use the CRT. - Condensed script & template versions to single version matching the modules version. - Fixed various items in the winapi.json dataset.
2 parents c1be517 + d50d236 commit 9a50a10

File tree

5 files changed

+120
-8
lines changed

5 files changed

+120
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build-backend = "hatchling.build"
1010
[project]
1111
name = "hashycalls"
1212
readme = "Readme.md"
13-
version = "2.1.0"
13+
version = "2.1.1"
1414
description = "An Import Address Table obfuscation utility for C/C++ based windows implants"
1515
authors = [
1616
{name="wizardy0ga"}

src/hashycalls/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def print_banner( key_width: int, val_width: int ) -> int:
2222
print( f"║{' '.center( key_width + val_width + 4, ' ' ) }{ RED }║")
2323
print( f"║{ RED }{ description.center( val_width + key_width + 4, ' ' ) }{ RED }║")
2424
print( f"║{ 'Coded By: Wizardy0ga'.center( val_width + key_width + 4 ) }║")
25-
print( f"║{ f'Script Version: { SCRIPT_VERSION } | Template Version: { TEMPLATE_VERSION }'.center( key_width + val_width + 4 ) }║")
25+
print( f"║{ f'Version: { VERSION }'.center( key_width + val_width + 4 ) }║")
2626
print( f"║{' '.center( key_width + val_width + 4, ' ' ) }{ RED }║")
2727

2828
return ret

src/hashycalls/core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
from hashycalls.colors import *
66

77
# -------------------------- Constants --------------------------
8-
SCRIPT_VERSION = "2.1.0"
9-
TEMPLATE_VERSION = "2.0.0"
8+
VERSION = "2.1.1"
109

1110
NAME_LOOKUP = os.path.join( os.path.dirname( os.path.abspath( __file__ ) ), 'rsrc', 'data', 'name-conversion.json' )
1211
TYPE_LOOKUP = os.path.join( os.path.dirname( os.path.abspath( __file__ ) ), 'rsrc', 'data', 'type-conversion.json' )
@@ -178,7 +177,7 @@ def __init__ ( self, source_file: str, filename: str ):
178177
self.comment_regex = []
179178
self.source_file = source_file
180179
self.header_content = \
181-
f"Generated with hashycalls v-{ SCRIPT_VERSION }\nTemplate version: { TEMPLATE_VERSION }\nCommandline: { ' '.join( sys.argv ) }"
180+
f"Generated with hashycalls v-{ VERSION }\nCommandline: { ' '.join( sys.argv ) }"
182181

183182
with open( self.source_file, 'r' ) as file:
184183
self.content = file.read()

src/hashycalls/rsrc/code/solution file/src/hashycalls.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@
3535

3636
// --- Functions
3737
# ifdef DEBUG
38-
# include <stdio.h>
39-
# define dbg(msg, ...) printf("[DEBUG]::Hashycalls.%s.L%d -> " msg "\n", __func__, __LINE__, ##__VA_ARGS__)
38+
# define dbg(msg, ...) \
39+
if (1) { \
40+
LPSTR Buf = (LPSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1024); \
41+
if (Buf) { \
42+
int len = wsprintfA(Buf, "[DEBUG]::Hashycalls.%s.L%d -> " msg "\n", __func__, __LINE__, ##__VA_ARGS__); \
43+
WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), Buf, len, 0, 0); \
44+
HeapFree(GetProcessHeap(), 0x00, Buf); \
45+
} \
46+
}
4047
# endif
4148
# ifndef DEBUG
4249
# define dbg(msg, ...) do {} while (0)

0 commit comments

Comments
 (0)