Skip to content

Commit c2486ab

Browse files
committed
Release 1.1.4.9 for Linux(x64) and Windows(x64)
1 parent 14cf50c commit c2486ab

File tree

8 files changed

+175
-19
lines changed

8 files changed

+175
-19
lines changed

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
# Volcano
2-
A GUI for Krakatau assembler / disassembler built with Electron and CodeMirror.
2+
Current release: 1.1.4.9 for Linux(x64) and Windows(x64)
33

4-
Download from https://github.com/redking00/Volcano/releases
4+
A GUI for [Krakatau](https://github.com/Storyyeller/Krakatau) assembler / disassembler built with [Electron](https://github.com/electron/electron) and [CodeMirror](https://github.com/codemirror/CodeMirror).
5+
6+
Download it from [Releases](https://github.com/redking00/Volcano/releases) page.
7+
8+
Krakatau is included as a pyInstaller executable.
9+
Read [how to build kasm executable](https://github.com/redking00/Volcano/blob/master/src/krakatau/HOWTOBUILD.TXT/) if you need / want to build yourself.
510

6-
Krakatau (https://github.com/Storyyeller/Krakatau) is included as a pyInstaller executable. Only win32-x64 support for now.
711

8-
You can edit and assemble *.j source files and disassemble class or jar files.
12+
With Volcano you can edit and assemble *.j source files and disassemble class or jar files.
913

10-
The syntax highlighting is 95% completed. There is work to do yet.
11-
1214
Let me know if you find any errors, have a comment or found it useful. ;)
1315

1416

17+
Screenshots
18+
19+
![volcano screenshot_01](https://github.com/redking00/Volcano/raw/master/screenshot_01.jpg "Screenshot showing assembler error")
20+
21+
1522
**TODO
1623

17-
- 100% Syntax support.
18-
- Verification of numerical literals.
24+
- Windows-x86, Linux-x86 and Mac support.
25+
- 100% Krakatau syntax support.
26+
- Verification of numeric literals.
1927
- Code snipets templates.
2028
- ...
2129

22-
**Screenshots
23-
24-
![volcano screenshot_01](https://github.com/redking00/Volcano/raw/master/screenshot_01.jpg "Screenshot showing assembler error")
2530

src/krakatau/HOWTOBUILD.TXT

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
How to build kasm executable
2+
3+
- Install Python, pyInstaller and all its requirements for your platform.
4+
- Download Krakatau commit 86dfd43d148f65226ae4c020aff7421637e3756d from https://github.com/Storyyeller/Krakatau
5+
- Copy kasm.py to the same folder that contains assemble.py and disassemble.py scripts.
6+
- Run "pyinstaller -F kasm.py".
7+
- If there is no error, your exec must be in the recently created folder "dist"
8+
9+
10+

src/krakatau/kasm.py

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#!/usr/bin/env python2
2+
3+
# ---------------------------------------------------------------
4+
# Assembler / Disassembler in one script.
5+
# For Krakatau commit 86dfd43d148f65226ae4c020aff7421637e3756d
6+
# ---------------------------------------------------------------
7+
8+
from __future__ import print_function
9+
10+
import functools
11+
import os.path
12+
import time, zipfile, sys
13+
import os.path, time
14+
import Krakatau
15+
from Krakatau import script_util
16+
from Krakatau.classfileformat.reader import Reader
17+
from Krakatau.classfileformat.classdata import ClassData
18+
from Krakatau.assembler.disassembly import Disassembler
19+
from Krakatau.assembler import parse
20+
21+
try:
22+
from StringIO import StringIO
23+
except ImportError:
24+
from io import StringIO
25+
26+
27+
def readArchive(archive, name):
28+
with archive.open(name.decode('utf8')) as f:
29+
return f.read()
30+
31+
32+
def readFile(filename):
33+
with open(filename, 'rb') as f:
34+
return f.read()
35+
36+
37+
def disassembleSub(readTarget, out, targets, roundtrip=False, outputClassName=True):
38+
start_time = time.time()
39+
with out:
40+
for i, target in enumerate(targets):
41+
print('processing target {}, {}/{} remaining'.format(target, len(targets)-i, len(targets)))
42+
43+
data = readTarget(target)
44+
clsdata = ClassData(Reader(data))
45+
46+
if outputClassName:
47+
name = clsdata.pool.getclsutf(clsdata.this)
48+
else:
49+
name = target.rpartition('.')[0] or target
50+
51+
output = StringIO()
52+
# output = sys.stdout
53+
Disassembler(clsdata, output.write, roundtrip=roundtrip).disassemble()
54+
55+
filename = out.write(name, output.getvalue())
56+
if filename is not None:
57+
print('Class written to', filename)
58+
print(time.time() - start_time, ' seconds elapsed')
59+
60+
61+
def assembleSource(source, basename, fatal=False):
62+
source = source.replace('\t', ' ') + '\n'
63+
return list(parse.assemble(source, basename, fatal=fatal))
64+
65+
66+
def assembleClass(filename):
67+
basename = os.path.basename(filename)
68+
with open(filename, 'rU') as f:
69+
source = f.read()
70+
return assembleSource(source, basename)
71+
72+
73+
def assemble(args):
74+
log = script_util.Logger('warning' if args.q else 'info')
75+
log.info(script_util.copyright)
76+
77+
out = script_util.makeWriter(args.out, '.class')
78+
targets = script_util.findFiles(args.target, args.r, '.j')
79+
80+
start_time = time.time()
81+
with out:
82+
for i, target in enumerate(targets):
83+
log.info('Processing file {}, {}/{} remaining'.format(target, len(targets)-i, len(targets)))
84+
85+
pairs = assembleClass(target)
86+
for name, data in pairs:
87+
filename = out.write(name, data)
88+
log.info('Class written to', filename)
89+
print('Total time', time.time() - start_time)
90+
91+
92+
def disassemble(args):
93+
print(script_util.copyright)
94+
95+
targets = script_util.findFiles(args.target, args.r, '.class')
96+
97+
jar = args.path
98+
if jar is None and args.target.endswith('.jar'):
99+
jar = args.target
100+
101+
out = script_util.makeWriter(args.out, '.j')
102+
if jar is not None:
103+
with zipfile.ZipFile(jar, 'r') as archive:
104+
readFunc = functools.partial(readArchive, archive)
105+
disassembleSub(readFunc, out, targets, roundtrip=args.roundtrip)
106+
else:
107+
disassembleSub(readFile, out, targets, roundtrip=args.roundtrip)
108+
109+
110+
if __name__ == "__main__":
111+
import argparse
112+
parser = argparse.ArgumentParser(description='Krakatau bytecode assembler/disassembler')
113+
parser.add_argument('-d', action='store_true', help='Disassemble mode')
114+
parser.add_argument('-out', help='Path to generate files in')
115+
parser.add_argument('-r', action='store_true', help="Process all files in the directory target and subdirectories")
116+
parser.add_argument('-q', action='store_true', help="Only display warnings and errors (asm mode only)")
117+
parser.add_argument('-path', help='Jar to look for class in (disasm mode only)')
118+
parser.add_argument('-roundtrip', action='store_true', help='Create assembly file that can roundtrip to original binary (disasm mode only).')
119+
parser.add_argument('target', help='Name of file to assemble or name of class or jar file to decompile')
120+
args = parser.parse_args()
121+
122+
if args.d:
123+
disassemble(args)
124+
else:
125+
assemble(args)

src/krakatau/linux-x64/kasm

4.09 MB
Binary file not shown.

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "volcano",
3-
"version": "1.1.4.8",
3+
"version": "1.1.4.9",
44
"description": "A GUI for Krakatau assembler/disassembler",
55
"main": "main.js",
66
"author": "Diego Vigorra",

src/ui/index.html

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</body>
3232

3333
<script>
34-
let rolling = 1148;
34+
let rolling = 1149;
3535
let debug = false;
3636
let currentFilePath;
3737
let currentOutputPath;
@@ -168,7 +168,11 @@
168168
},
169169
{
170170
label:'View', submenu:[
171-
{ label: 'Full Screen mode', accelerator:'F11', role:'togglefullscreen' }
171+
{ label: 'Full Screen mode', accelerator:'F11', click(){
172+
remote.getCurrentWindow().setFullScreen(!remote.getCurrentWindow().isFullScreen());
173+
remote.getCurrentWindow().setMenuBarVisibility(true);
174+
}
175+
}
172176
]
173177
},
174178
{
@@ -656,12 +660,19 @@
656660
'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + asmlines[1].replace(/ /g,'&nbsp;') +
657661
'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + asmlines[2].replace(/ /g,'&nbsp;');
658662
showAlert('Assembler error (line ' + line + ', col ' + col + '):<br>' + htmlmsg);
663+
setStatusBarMessage('Build failed.');
659664
if (debug) console.log(match);
660665
}
661-
else showAlert('Assembler error: ' + stderror);
666+
else {
667+
showAlert('Assembler error: ' + stderror);
668+
setStatusBarMessage('Build failed.');
669+
}
662670
}
663671
}
664-
else showAlert('Assembler error stdout:['+stdoutput+'] stderr:['+stderror+']');
672+
else {
673+
showAlert('Assembler error stdout:['+stdoutput+'] stderr:['+stderror+']');
674+
setStatusBarMessage('Build failed.');
675+
}
665676

666677
if (debug) console.log(`child process exited with code ${code}`);
667678
});
@@ -813,7 +824,10 @@
813824
}
814825
else showAlert(patchFile);
815826
}
816-
else if (!quiet) showAlert('Volcano is up to date!');
827+
else if (!quiet) {
828+
showAlert('Volcano is up to date!');
829+
setStatusBarMessage('Volcano is up to date!');
830+
}
817831
}
818832
else if (!quiet) printGenericError();
819833
}

updates/linux-x64/latest

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1149
2+
There is a new version available!. Download it from<br><span style="text-decoration: underline;cursor:pointer;" onclick="let {shell} = require('electron');shell.openExternal('https://github.com/redking00/Volcano/releases')">https://github.com/redking00/Volcano/releases</span>

updates/win32-x64/latest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1148
2-
Latest Version
1+
1149
2+
There is a new version available!. Download it from<br><span style="text-decoration: underline;cursor:pointer;" onclick="let {shell} = require('electron');shell.openExternal('https://github.com/redking00/Volcano/releases')">https://github.com/redking00/Volcano/releases</span>

0 commit comments

Comments
 (0)