Jump to content

UnKn0wnBooof

Active Members
  • Posts

    146
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by UnKn0wnBooof

  1. Ah, my oroginal code was meant to be doing what the second piece of code does - send a file to the 3DS. The code I posted wasn't meant to be recieving anything. Since I had copied the first bunch of code from stackexchange, I had thought that it would be doing what the second piece of code does. Both pieces of code are meant to be sending a file, yes :) . Like I said - new to C, I pretty much know nothing. I'm definitely gonna note down your responses though, as they may come in handy when I try to learn more about it. The second piece of code I posted, was made by the developer of FBI. FBI (3DS Homebrew) receives the file while the code I posted was designed to send it. Really appreciate your response :D Do you do console hacking by any chance? You seem quite knowledgeable about this stuff! Why not make a homebrew? With your skills, you'd be an awesome addition to the GBATemp community!
  2. Wow! Thanks for the tips! As I said - most (if not all) of the code I provided was copied 'n pasted from stackexchange. I made minor modifications. I was pretty much guessing stuff . I really appreciate the help! I contacted the dev of FBI and he also provided some code and we spent about half an hour fixing stuff so it would compile under Linux. Here is the new code: #include <errno.h> #include <string.h> #ifdef __WIN32__ #include <winsock2.h> char* sockGetErrorString() { char *s = NULL; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD) WSAGetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR) &s, 0, NULL); return s; } #else #include <arpa/inet.h> char* sockGetErrorString() { return strerror(errno); } #endif #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <string> #include <stdlib.h> int main(int argc, const char* argv[]) { if(argc != 3) { printf("Usage: %s ip file\n", argv[0]); return -1; } #ifdef __WIN32__ WORD versionWanted = MAKEWORD(1, 1); WSADATA wsaData; WSAStartup(versionWanted, &wsaData); #endif FILE* fd = fopen(argv[2], "r"); if(!fd) { printf("Failed to open file: %s\n", sockGetErrorString()); #ifdef __WIN32__ WSACleanup(); #endif return -1; } fseek(fd, 0, SEEK_END); uint64_t size = (uint64_t) ftell(fd); fseek(fd, 0, SEEK_SET); int sock = socket(AF_INET, SOCK_STREAM, 0); if(sock < 0) { printf("Failed to open socket: %s\n", sockGetErrorString()); #ifdef __WIN32__ WSACleanup(); #endif return -1; } struct sockaddr_in address; memset(&address, 0, sizeof(address)); address.sin_family = AF_INET; address.sin_port = htons(5000); address.sin_addr.s_addr = inet_addr(argv[1]); if(connect(sock, (struct sockaddr *) &address, sizeof(address)) < 0) { printf("Failed to connect: %s\n", sockGetErrorString()); #ifdef __WIN32__ WSACleanup(); #endif return -1; } printf("Sending info...\n"); fflush(stdout); uint64_t fileSize = size; static const int num = 42; if(*((char*) &num) == num) { fileSize = (((uint64_t) htonl((uint32_t) fileSize)) << 32) + htonl((uint32_t) (fileSize >> 32)); } if(send(sock, (char*) &fileSize, sizeof(fileSize), 0) < 0) { printf("Failed to send info: %s\n", sockGetErrorString()); #ifdef __WIN32__ WSACleanup(); #endif return -1; } printf("Sending file...\n"); fflush(stdout); uint64_t bufSize = 1024 * 16; // 16KB void* buf = malloc(bufSize); for(uint64_t pos = 0; pos < size; pos += bufSize) { size_t read = fread(buf, 1, bufSize, fd); if(send(sock, (char*) buf, read, 0) < 0) { printf("Failed to send file (pos %d): %s\n", pos, sockGetErrorString()); #ifdef __WIN32__ WSACleanup(); #endif return -1; } } printf("Waiting for server to finish receiving...\n"); char temp; while(recv(sock, &temp, sizeof(temp), 0) != 0) { sleep(1); } printf("Closing...\n"); close(sock); fclose(fd); printf("File successfully sent.\n"); #ifdef __WIN32__ WSACleanup(); #endif return 0; } You think any improvements could be made to this?
  3. On the 3DS screen, (in FBI) - it freezes on this: Do you think it would be possible to show a piece of example code? I'm new to C so... Edit: Also, I got "my" code from an example on stack exchange. I have no idea what some of the functions in my script even do. It could be completely wrong for all I know
  4. So, I've been using a program called "FBI" for a while, which lets a user install .CIA files on to the 3DS. There's an option within the application which enables you to recieve a .CIA through WiFi via a sock connection. The dev of the homebrew is using a Java program to send the files. I want a C version so I can port it easily to other devices. I mainly want it so I can run it on Android (compile C as Linux binary, place it in /system/xbin). I looked at some code on other websites but non of which seems to work. Here is the code I'm currently working on: // For both #include <sys/socket.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <unistd.h> #include <netinet/in.h> #include <arpa/inet.h> #define PORT 5000 #define BUF_SIZE 16384 int main(int argc, char** argv) { if (argc == 3) { const char* filename = argv[1]; const char* consoleip = argv[2]; FILE *fp = fopen(filename, "ab"); if(NULL == fp) { printf("Error opening file"); return 1; } /* Create a socket first */ int sockfd = 0; if((sockfd = socket(AF_INET, SOCK_STREAM, 0))< 0) { printf("\n Error : Could not create socket \n"); return 1; } /* Initialize sockaddr_in data structure */ struct sockaddr_in serv_addr; serv_addr.sin_family = AF_INET; serv_addr.sin_port = htons(PORT); // port serv_addr.sin_addr.s_addr = inet_addr(consoleip); /* Attempt a connection */ if(connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr))<0) { printf("\nError : Connect Failed\n"); return 1; } /* Receive data in chunks of BUF_SIZE bytes */ int bytesReceived = 0; char buff[BUF_SIZE]; memset(buff, '0', sizeof(buff)); while((bytesReceived = read(sockfd, buff, BUF_SIZE)) > 0) { printf("Bytes received %d\n",bytesReceived); fwrite(buff, 1,bytesReceived,fp); } if(bytesReceived < 0) { printf("\nRead Error\n"); } return 0; } else { printf("Usage:\n\n%s [FILENAME] [3DS IP]\n",argv[0]); } return 1; // Something went wrong } I'm new to C so I have no idea what to do. FBI freezes on "Reading info". This is the homebrew: http://gbatemp.net/threads/release-fbi-open-source-cia-installer.386433/ Any help is deeply appreciated. Thanks!
  5. Wanna Pledge? So, how should I start this? Well... Some time last year, I took the time to modify parts of the MK5's web UI (here) but I wasn't able to fully test or modify it due to the lack of owning a physical unit - I had hosted it on a Raspberry Pi so most of the features were broken . As such, I couldn't really do much with it... Had if I owned a unit, I would've kept developing on it and provided all the code via GitHub so users could freely install it at will. Due to me being a rather low-class citizen with very little money, I am unable to purchase a WiFi Pineapple so my work could start off again, neither am I able to raise the funds myself as my current income pretty much goes towards essentials - leaving me with pretty much no money I can "play with". Anyway, I haven't started a pledge campaign yet because it would be pointless if no one wanted to help me out with it, so instead I'd rather ask you guys about it first - give me your opinion on the subject, would you be willing to help, if not - why? What can I offer in return? Well, I'll just put it in bullets for you - saves us all some time, don't you think? Provide a custom UI More customization over more elements (i.e. Change background, font styles/colors etc) Fun! Something a bit more "up-to-date" looking. I'll add feature requests as soon as I can - making your Pineapple even more awesome! Anything else? Why trust me? Well, I've contributed to this forum on various occasions. I took the time to have a bit of fun with the MK5 firmware and share it with you guys. Contributed to the USB Rubber Ducky community (such as here, here and here) I'm generally quick at replying to messages and requests I can be really dedicated I love web design! It's amazing how cross-platform HTML is and that it can run on so many devices! I've worked with people on other projects, such as Pi-RC with Brandon Skari (here) I've written in HTML (duur), Javascript (duurr), CSS (duur), Python, PHP (of course), Batch, Bash, Visual Basic and a tiny bit of C (really tiny). I studied Networking Principals and Maintenance at college, too! I've even made my own robot before (not bragging or anything xD). This is my recent work for my Raspberry Pi project: Of course, I'm just asking for your opinions first - I would be utterly thankful if you decide to help me out here! I really want to develop for this awesome "toy" and contribute to you guys! Thank you for your time and patience, I appreciate every second spent.
  6. Hi! As the title says, would it be possible for someone to make an emulated Wi-Fi Pineapple web UI and upload it to a web server? The reason why I ask is because I still do not own a MKV (hoping to get one soon, heck - I've tried my luck with Hak5's Trivia questions, hoping that I could win a WiFi Pineapple, though I doubt that'll happen) and I think it would be awesome to see how the new UI performs. Personally, I would like to try the Pineapples' UI on my Nintendo 3DS (hacking from a 3DS - CUMON! THAT'LL BE AWESOME!), to see if it would work. Thanks! Hope I get a reply soon!
  7. DFU-PROGRAMMER for Windows! So, I've recently purchased a new laptop with is a 64 bit system, unlike my old 32 bit netbook which sadly died (it was a great netbook!). Anyway, that doesn't matter - what matters is that batchisp.exe always gave me errors (and I DID read the instructions and install all appropriate programs) such as: Could not find AtJniIsp.dll The program can't start because MSVCR71.dll is missing I finally gave up on Atmel's software and replaced it with DFU Programmer - which is far more reliable and easier to setup. I've modified the program.bat script to work with dfu-programmer, the results are fantastic. How to setup: Setting up is a breeze, just follow these steps: Download the package, which contains the needed files and drivers from here Extract the archive (I use 7-zip). Drag a .hex file over the program_dfu.bat program to flash the ducky while in DFU mode.​​ Alternatively, run this command from cmd: Easy as 123! So, what do you think? Do you prefer to use Atmel's, time consuming, setup frustrating method or just use a simple, standalone program? Note: If you don't have the drivers installed for the ducky, refer to the official documentation - it's easy to install though!
  8. I've been reading up on rooting the Google Chromecast and it turns out I need a teensy, but is it possible for the duck to do the same job? XDA Post/Info: http://forum.xda-developers.com/hardware-hacking/chromecast/root-hubcap-chromecast-root-release-t2855893 Program SRC: https://github.com/axoltl/HubCap Thanks.
  9. That sucks. Would be better if a new Duck was released, honestly Oil, it would be amazing if you worked in conjunction with Hak5 to make this new Duck a reality. You obviously know what your talking about.
  10. Actually, think about it a little more deeply. Yes - Android is mostly Java, but don't forget that it's also Linux. If your device is rooted, you can place a binary in /system/xbin then just chmod it. This will allow you to run it from the Terminal Emulator. Look at Busybox for Android, I highly doupt it's written in Java. I think that to compile a binary for Android, you will need the NDK (or was it the ADK?) since it provides the ability to compile binaries for a device.On the other hand, as long as a compiler knows what architecture to compile for (such as Arm 7 Neon, for example), it should work. I don't want a program written in Java. If a duck encoder was written as a Java app for Android, you'd have a activity, a GUI etc. A CLI is most preferred. The dsploit team have managed to get the metasploit framework (msf) running on Android, which is mostly written in Ruby. I agree with you about the "Java vs C", Java's speed is noticeable in some cases, such as the fact that Java isn't quick enough to relay high volume's of traffic so it tends to drop packets. If you haven't checked out dsploits github repository, I highly recommend that you do. The issue in the repository named "Dsploit Core?" goes into detail about this stuff. Back on topic however, still would be great if someone ports the encoder to C. I think Androids fastboot utility is written in C and someone on xda developer's managed to compile it for Android so we were able to use fastboot in conjunction with USB OTG to flash other devices through the terminal emulator program. I do think it is possible to compile C as a binary for Android. Thank you for the response :)
  11. Indeed, I agree. On the bright side, at least this "simple ducky script" lets us craft payload's easily and quickly within minutes (or perhaps even seconds). It would be great if the ducky script gave more flexibility however. So, does U3 still work or has Microsoft disabled autorun on these U3 interfaces?
  12. Another question! I pretty much hate the idea of using Java to use the encoder, sure it's multi platform but it doesn't support many platforms. I think it would be better if the encoder was written in C so that it can be compiled for pretty much any OS and architecture. I want to be able to compile it to run on android via the Terminal Emulator application. The only way to accomplish this (at least in my opinion) is to have the encoder as a single standalone binary that doesn't need 3rd party requirements. So, is this possible? Does anyone have the knowledge to pull this off? Or does anyone have any better ideas to make this dream become a reality? Thanks.
  13. I think it would be better if I did some more research into the SoC (Atmel chip) before I think about poking the duck with wires and solder. I'd rather not kill it, at least not yet anyway. D)
  14. Here is the link to the picture's, they're stored on my Dropbox account. Let me know if you need anymore. Link: https://www.dropbox.com/sh/pjxt0vv8cdzfm68/AAAm8qP01oxv8xST0TXSqDe_a?dl=0
  15. So, again with me and questions. I've been reading this topic http://neuromorphs.net/nm/wiki/2010/usb10/AtmelAVR32 and it provides some example firmware, sooo - is it possile to use pins at the bottom of the duck to add a led or anything like that to?
  16. I can provide pictures, but not at the moment. I don't have my Ducky with me. I'll try and provide you pictures within 24 hours however (if no one else has provided you them).
  17. Doesn't U3 still work though? If it does, it would save us from opening cmd and manually entering commands. How much do you think you've spent on making this "Ducky 2.0"? Do you plan on making it open-source?Would be great if I could make my own Ducky-like hardware. As for the ducky script, yes - I agree. I think ducky script would be better if it was written something like this: if ( Key.Pressed[CAPS_LOCK] == true ) { Key.Pressed[CAPS_LOCK] == false // Disable caps lock. String.Write(Hello, this is a string!) Key.Press[GUI + R] sleep 2 String.Write(cmd.exe) Key.Press[ENTER] Key.Hold[CTRL+ALT+C] // Can't remember what key combo stopped UAC from appearing. }
  18. Ok! I've been looking at this post: https://forums.hak5.org/index.php?/topic/2361-usb-switchblade-development/ and I'm wondering if there is going to be another version of the ducky with a U3 partition/launchpad. This would make the ducky even more powerful than what it already is. Is there any thoughts about a new version of the Rubber Ducky?
  19. Ok, when the duck is in it's case, you can't see the LED - meh. Anyway - does anyone know how to add another one? Is it possible to attach one to the connections at the bottom of the duck? Thanks.
  20. Now that is what I was looking for. Thanks Darren! Most appreciated. That's one question off my mind.
  21. Was hoping for a simple explanation for how the WiFi Pineapple is made, but never mind. All I wanted to know is if Hak5 are simply getting a much of people to make these or if its a "one man show" sort of thing; or even mass produced by machines - didn't need anything technical. Oh well - curiosity doesn't always get you an answer I guess.
  22. I'm a curious person and so I am now wondering, how is the Pineapple made? Are they assembled by machines, a bunch of people, just one dude, what? How long does it take to manufacture one unit? Would be great if there was a "insides video" of the manufacturing process. Anyone got a answer? Thanks.
  23. Do you think Seb can "steal" some parts from my work and merge them with the update? I think he will mostly find the "statusbar_handler" to be useful as it contains the script that creates the CPU % usage output as well as the tidy Logged On Users output.
×
×
  • Create New...