I have the below code which is extracted by using stings command.
I need to edit the code and compile. But I do not have any idea how to proceed.
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
%s/CMSlog_%02d%02d.log
%.20s %7d %02d:%02d:%02d
%.2000s
%s/CMSrecvlog_%02d%02d.log
%.20s %7d %02d:%02d:%02d
%.2000s
%0*lu
%c%c%.6s%.8s
%s/MacEB13%.4s
EB13 path =[%s]
Mac EB13 ERR [%s] open error
%s/EB13%.4s
stderr [%s] open error
%s/MacEB11%.4s
stderr [%s] open error
%s/EB11%.4s
stderr [%s] open error
mac path = [%s]
%s/MacEB21%.4s
stderr [%s] open error
%s/EB21%.4s
stderr [%s] open error
MacCalculate
%s/MacEB13%.4s
%s/MacEB21%.4s
%s/MacEB11%.4s
MacCalculate Error idx[%d]
Mac open stderr [%s] open error
%2d%2d
%2d%2d%2d
%4d%2d%2d
%02d%02d%02d
%04d%02d%02d
%2d%2d
%02d%02d
%02d
%04d
yymmdd
%02d%02d%02d
mmddyy
%02d%02d%02d
ddmmyy
%02d%02d%02d
yyyymmdd
%04d%02d%02d
mmddyyyy
%02d%02d%04d
ddmmyyyy
%02d%02d%04d
hhmmss
%02d:%02d:%02d
%s database open error !
%s file open error !
%s table open error !
Parameter input error !
Can't execute %s !
Can't describe %s !
Can't declare %s !
Can't prepare %s !
%s data error !
%s error !
%.2d
p_get_etra_date dchg = %d error
19%.6s
20%.6s
19%.4s
20%.4s
%02d%02d%02d
Usage [%s] kind sendfile cfgfile
/data/applications/PgiWebApp/files/current/send/kftc/log
/data/applications/PgiWebApp/files/current/send/kftc/log
make directory error!!!
log directory is not exist!!
make new directory!!
get_config_file error[%.20s]
SENDER_NAME[%s]
PASS_WD[%s]
MAC1[%s]
MAC2[%s]
IP = [%s]
PORT = [%d]
KFTC
RKFTC
BKFTC
LKFTC
DKFTC
PKFTC
kind type error!!! [%s]
GiganCode [%s]
path [%.200s] NOT EXISTS !!
job_dir = [%s]
00%.4s
mac_day = [%s]
db_filename = [%s]
EB13
EB21
EB11
Mac job_kind error =[%d]
job_kind [%d]
22SENDER_NAME[%s]
PASS_WD[%s]
MAC1[%s]
MAC2[%s]
MAC LASTTotalSum = [%.10s]
600-001 respcode error %.3s
FAIL 600-001 respcode error!! check log file.
write_data=[%s]
new_protocol continue.. [%d]
600-003 respcode error %.3s
FAIL 600-003 respcode error!! see log file.
transfer complete
600-004 respcode error %.3s
FAIL 600-004 respcode error!! see log file.
mv %s/%s %s/%s
SUCCESS[%s]
command[%s]
SUCCESS
All success
write buf= [%.*s] len [%d]
write error [%.150s] ret %d sock %d err %d
socket write error!!
read error len %d
socket read error!! check log file!!
CDATA=[%.4s]
11READ ERROR.. len %d
socket read error!! check log file!!
data = [%.*s] r_length=[%d]
msgtype = [%.4s]
%s/%.8s
fopen error [%s]
File open error!! check [%s] file!!
630 respcode error %.3s
630 respcode error!! check log file.
ex_size[%.12s] rec640[%.12s]
fu_size is [%d]
%04ld
%04ld
%04ld
tran_byte = [%.4s]
gubun_code = [%.3s]
gigan_code = [%.8s]
%04d
tran_code = [%.4s]
%.8s
%.8s
%.8s
respcode = [%.3s]
%04d
%04d
%03d
%03ld
%04d
%03d
%04d
%04d
record_num =[%d], idx=[%d], sum_total=[%d]
signal [%d] encountered !!!!
pp value is [%d] in fseek
FLOW ret =[%d] blok_sz =[%d] block_no =[%d] teq_no =[%d]
file_pointer =[%d]
read error len %d
socket read error!!
temp=[%.4s]
r_length = [%ld]
READ ERROR.. len %d
socket read error!!
0300
Unknown Msgtype [%.4s] So I am Dead...
unknown msgtype!! check log file.
%02d%02d%02d
%02d%02d%02d
%.8s
%.8s
%.8s
%.12ld
%.4ld
error on open socket
oops: --> socket error
600-004 respcode error %.3s
600-004 respcode error!! check log file.
Check config file
File=[%s],
no search env file
no search env file
no search env file =
GIGWAN_CODE%d
no search env file
SEND_PATH%d
no search env file
SEND_ERR_PATH%d
no search env file
HISTORY_SEND_PATH%d
no search env file
MAC_SEND_PATH%d
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
no search env file
%.9s_SENDER_NAME_LEN
no search env file
%.9s_SENDER_NAME
no search env file
%.9s_PASS_WD
no search env file
%.9s_MAC_KEY1
no search env file
%.9s_MAC_KEY2
no search env file
no search env file
%04d%02d%02d%02d%02d%02d
/usr/sbin/sendmail -t
fopen err
from: %s
to : %s
subject: [DATA] [%s] [%s] [%.6s] [%.6s]
[%s] [%s] [%.6s] [%.6s]
/data/applications/PgiWebApp/files/current/send/kftc/log
/data/applications/PgiWebApp/files/current/recv/kftc/log
START!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
config file
yymmdd
TARGET_IP_ADDR
TARGET_PORT
GIGWAN_COUNT
SENDER_ID
RECEIVE_ID
BLOCK_SIZE
DATA_LENGTH1
DATA_LENGTH2
KFTC_TEMP_PATH
RKFTC_TEMP_PATH
BKFTC_TEMP_PATH
LKFTC_TEMP_PATH
DKFTC_TEMP_PATH
PKFTC_TEMP_PATH
KFTC_PATH
RKFTC_PATH
BKFTC_PATH
LKFTC_PATH
DKFTC_PATH
PKFTC_PATH
SCRIPT_PATH
Also I do not have any idea what the above code is trying to do.
It would be really helpful if anyone can:
Explain the code.
How to decompile
how to compile after the changes.
Thanks,
Anish
I have the below code which is extracted by using stings command.
I need to edit the code and compile.
Your first step should be: find someone who has a clue. It is unlikely that you'll achieve whatever you are trying to do on your own.
That said, strings does not extract code, it only extracts printable strings from the code. Therefore there is no code to explain. (You should also read man strings if you are to understand anything.)
Assuming you still have the original binary, and not just the strings output, you can disassemble that binary using objdump -d (do read man objdump as well). That output, if it is small enough, you can hope someone would be able to understand and explain to you (you could also try to understand it yourself, armed with SPARC assembly manual, such as this one).
Once you understand what the program does, you could write an equivalent program in C, and finally modify it to do whatever you want. But it may be simpler to write such a program from scratch, rather than going through decompile / modify route.
Related
I'm trying to automate a test where I need to upload a file, but I keep getting that the file can't be found.
I found in Selenium page that, for other languages, we have to use a Local File Detector so that the file that's in my computer are sent to the remote server.
The Local File Detector allows the transfer of files from the client machine to the remote server.
But I can't find any function related to that in Go.
I've tried the SendKeys function:
element, err := crediya.el.FindElement(selenium.ByID, "file")
if err != nil {
return fmt.Errorf(errors.Selenium.ElementNotFound+"\n%w", err)
}
if err = element.SendKeys(path); err != nil {
return fmt.Errorf(errors.Selenium.SendKeysFailure+"\n%w", err)
}
but I keep getting:
"unknown error - 61: invalid argument: File not found : "
Note: the element is an input of file type.
Thank you, in advance, for any help provided.
Can someone, please, help me?
Can someone please help me in uploading file in Podio? I am new in Podio library so I am trying but getting lots of errors.
Warning: realpath() expects parameter 1 to be a valid path, resource given in /home/gphxyz/public_html/decode/podio-php/models/PodioFile.php on line 54
Warning: filesize() expects parameter 1 to be a valid path, resource given in /home/gphxyz/public_html/decode/podio-php/models/PodioFile.php on line 54
Fatal error: Uncaught PodioBadRequestError: "'source' parameter must given as multipart/form-data with type 'file'"
Request URL: http://api.podio.com/file/v2/
Stack Trace: #0 /home/gphxyz/public_html/decode/podio-php/lib/Podio.php(352): Podio::request('POST', '/file/v2/', Array, Array)
#1 /home/gphxyz/public_html/decode/podio-php/models/PodioFile.php(54): Podio::post('/file/v2/', Array, Array)
#2 /home/gphxyz/public_html/decode/podio-php/index.php(22): PodioFile::upload(Resource id #72, 'http://geeksper...')
#3 {main} thrown in /home/gphxyz/public_html/decode/podio-php/lib/Podio.php on line 289
My code is below:
<?php
require_once 'PodioAPI.php';
//Initalize Podio connection
$client_id = '';
$client_secret = "";
Podio::setup($client_id, $client_secret);
//App ID's
$opname_app_id = '21209880';
$opname_app_token = "";
Podio::authenticate_with_app($opname_app_id, $opname_app_token);
$opname_auth = Podio::$oauth;
$filepath = 'http://geeksperhour.xyz/decode/podio-php/credit.jpg';
$filename = 'credit.jpg';
$goFile = PodioFile::upload($filepath, $filename);
$fileID = $goFile->file_id;
print_r($fileID);
You might find that lib/podio.php for file uploads is deprecated since a while.
See the open Ticket on Github: The usage of the #filename API for file uploading is deprecated - File upload #74
Changing the API in line 189 will allow you to follow the documentation again.
from
if (!empty($options['upload'])) {
curl_setopt(self::$ch, CURLOPT_POST, TRUE);
curl_setopt(self::$ch, CURLOPT_SAFE_UPLOAD, FALSE);
curl_setopt(self::$ch, CURLOPT_POSTFIELDS, $attributes);
self::$headers['Content-type'] = 'multipart/form-data';
}
to
if (!empty($options['upload'])) {
$cfile = curl_file_create(substr($attributes[ "source" ], 1));
// Assign POST data
$attributes[ "source" ] = $cfile;
curl_setopt(self::$ch, CURLOPT_POST, TRUE);
curl_setopt(self::$ch, CURLOPT_POSTFIELDS, $attributes);
self::$headers['Content-type'] = 'multipart/form-data';
}
Worked for me in a PHP 7.2 Ubuntu 16.04 environment.
Also make sure the path to your file is pointing to local a path of your server.
Additional if you use composer you might find it useful to point to the master rather than the latest release:
composer require podio/podio-php:dev-master
As error message says: expects parameter 1 to be a valid path, resource given in /home/gphxyz/public_html/decode/podio-php/models/PodioFile.php on line 54
So, please provide valid local file path instead of $filepath = 'http://geeksperhour.xyz/decode/podio-php/credit.jpg';
I have a simple table:
db.define_table('myfiles',
Field('title','string'),
Field('myfile','upload))
Then i run my app from shell:
python web2py.py -S myapp -M
Choose my file_path:
file_path = os.path.join(request.folder,'upload',db.myfiles[1].myfile)
but then i try to read my uploaded file, i get "File not open for reading"
with open(file_path, 'wb') as f: data = f.readlines()
I even tried the same process with copy-paste my file to private folder but still get the same error.
First, the default folder for uploaded files is "uploads", not "upload":
file_path = os.path.join(request.folder, 'uploads', db.myfiles[1].myfile)
Second, you should open the file for reading rather than writing:
with open(file_path, 'rb') as f:
data = f.readlines()
UPDATE: I am now running this command:
scrapyd-deploy <project_name>
And getting this error:
504 Connect to localhost:8123 failed: General SOCKS server failure
I am trying to deploy my scrapy spider through scrapyd-deploy, the following is the command I use:
scrapyd-deploy -L <project_name>
I get the following error message:
Traceback (most recent call last):
File "/usr/local/bin/scrapyd-deploy", line 269, in <module>
main()
File "/usr/local/bin/scrapyd-deploy", line 74, in main
f = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not found
The following is my scrapy.cfg file:
[settings]
default = <project_name>.settings
[deploy:<project_name>]
url = http://localhost:8123
project = <project_name>
eggs_dir = eggs
logs_dir = logs
items_dir = items
jobs_to_keep = 5
dbs_dir = dbs
max_proc = 0
max_proc_per_cpu = 4
finished_to_keep = 100
poll_interval = 5
http_port = 8123
debug = on
runner = scrapyd.runner
application = scrapyd.app.application
launcher = scrapyd.launcher.Launcher
[services]
schedule.json = scrapyd.webservice.Schedule
cancel.json = scrapyd.webservice.Cancel
addversion.json = scrapyd.webservice.AddVersion
listprojects.json = scrapyd.webservice.ListProjects
listversions.json = scrapyd.webservice.ListVersions
listspiders.json = scrapyd.webservice.ListSpiders
delproject.json = scrapyd.webservice.DeleteProject
delversion.json = scrapyd.webservice.DeleteVersion
listjobs.json = scrapyd.webservice.ListJobs
I am running tor and polipo, with the polipo proxy on port 'http://localhost:8123'. I can perform a wget and download that page without any problems. The proxy is correctly working, I can connect to the internet and so on. Please ask if you need more clarification.
Thanks!
urllib2.HTTPError: HTTP Error 404: Not found
The url is not reached.
Anything interesting in /var/log/polipo/polipo.log? What comes from tail -100 /var/log/polipo/polipo.log?
Apparently this is because I forgot to run the main command. It is easy to miss because it is mentioned in the Overview page of the documentation, and not the Deployment page. The following is the command:
scrapyd
504 Connect to localhost:8123 failed: General SOCKS server failure
You're asking Polipo to connect to localhost:8123; Polipo passes the request to tor, which returns a failure result which is dutifully returned by Polipo ("General SOCKS server failure").
url = http://localhost:8123
This is certainly not what you meant.
http_port = 8123
I'm also pretty sure you didn't want to run scrapyd on the same port as Polipo.
I'm trying to create a valid file URL which points to a file which I know exists.
NSURL* fileURL = [NSURL fileURLWithPath:[#"~/Users/zak/global.scss"
stringByExpandingTildeInPath] isDirectory:NO];
NSLog(#"Looks like you want me to open a %# file!", fileURL.pathExtension);
NSError *err;
if (![fileURL checkResourceIsReachableAndReturnError:&err]) {
NSLog(#"%#", err);
}
else {
NSLog(#"success!!!");
};
which always causes the compiler to keep telling me
Error Domain=NSCocoaErrorDomain Code=260 "The file “global.scss” couldn’t be
opened because there is no such file." UserInfo=0x1021937a0 {NSURL=file://
localhost/~/Users/zak/global.scss,
NSFilePath=/~/Users/zak/global.scss,
NSUnderlyingError=0x10212f4b0 "The operation couldn’t be completed.
No such file or directory"}
Why doesn't this work? Do I need to use some sort of constant as the base URL?
~/Users/zak/globals.scss almost certainly does not exist. That ~ is in a pretty weird looking place. You might try ~zak/global.scss or /Users/zak/globals.scss. To check the path, just do ls PATHTOTEST in a terminal window - it will tell you if it's there or not (and show you the expansion of the path if it failed).