Homebrew Homebrew Development

Verequies

New Member
Newbie
Joined
Oct 14, 2014
Messages
4
Trophies
0
Age
27
XP
126
Country
Hey Guys,

Having a bit of trouble here. I'm trying to modify FBI to add a few functions, however on compilation I get the following error:
Code:
source/ui/section/update.c:16:32: fatal error: builtin_rootca_der.h: No such file or directory
I understand why that error is coming up, however I'm not sure how to add the build options to FBI's Makefile so that it automatically builds and includes the 'builtin_rootca_der.h' & 'builtin_rootca.der.o' for 'data/builtin_rootca.der'.
 
Last edited by Verequies,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,032
Country
United States
Hey Guys,

Having a bit of trouble here. I'm trying to modify FBI to add a few functions, however on compilation I get the following error:
Code:
source/ui/section/update.c:16:32: fatal error: builtin_rootca_der.h: No such file or directory
I understand why that error is coming up, however I'm not sure how to add the build options to FBI's Makefile so that it automatically builds and includes the 'builtin_rootca_der.h' & 'builtin_rootca.der.o' for 'data/builtin_rootca.der'.
You need to add a bin2o rule in the makefile to convert files in the data directory. Or you could just add the file to the romfs directory and read it from there instead.
 
D

Deleted User

Guest
Lately, I've been trying to use ctrulib's wrappers for the ssl:c service. I tried writing a program that would send and HTTPS request to a certain website, in order to learn how the service works. The code is below:

Code:
Handle sslcHandle;

        char *endpoint = "https://www.somewebsite.com";
        char *message  = "GET https://www.somewebsite.com/api HTTP/1.0\r\n\r\nAuthorization: auth";
       
        sslcContext ctx;
        Result res;
        int sockfd;
       
        int retval;
        u32 out;
       
        char *response;
       
        printf("Getting ssl:c handle...\n");
       
        sslcInit(sslcHandle);
       
        printf("Handle obtained.\n");
       
        sockfd = socket(AF_INET, SOCK_STREAM, 0);
       
        printf("Socket created.\n");
       
        res = sslcCreateContext(&ctx, &sockfd, 0, endpoint);
        printf("SSL Context created.\n");
       
        res = sslcStartConnection(&ctx, retval, out);
        printf("Connection started.\n");
       
        printf(out);
       
        res = sslcWrite(&ctx, message, sizeof(message));
        printf("Writing...\n");
       
        res = sslcRead(&ctx, out, 1024, false);
        printf("Reading...\n");
       
        printf("Output: ");
        printf(out);
        printf("\n");
       
        res = sslcDestroyContext(&ctx);
        printf("Context destroyed.\n");
       
        close(sockfd);
        printf("Socket closed.\n");

This code runs without crashing the 3DS, but it returns no output. I assume that the problem lies in how I read/write data to/from the server, though I could be missing something else. Keep in mind, I'm fairly new to socketing, so I'm still pretty new to the protocol. Am I using the service correctly? Is there anything I'm doing incorrectly/missing?
 

Verequies

New Member
Newbie
Joined
Oct 14, 2014
Messages
4
Trophies
0
Age
27
XP
126
Country
You need to add a bin2o rule in the makefile to convert files in the data directory. Or you could just add the file to the romfs directory and read it from there instead.

Could you give an example of how I would add this to the 'buildtools/make_base'? I tried this from the examples:
Code:
%.der.o:%.der
    @echo $(notdir $<)
    @$(bin2o)
However the compiler just ignored it.
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,032
Country
United States
Could you give an example of how I would add this to the 'buildtools/make_base'? I tried this from the examples:
Code:
%.der.o:%.der
    @echo $(notdir $<)
    @$(bin2o)
However the compiler just ignored it.
You need to add the data directory. I think you might be able to add it to SOURCE_DIRS
 

Verequies

New Member
Newbie
Joined
Oct 14, 2014
Messages
4
Trophies
0
Age
27
XP
126
Country
You need to add the data directory. I think you might be able to add it to SOURCE_DIRS

Okay so I've moved the data folder to 'source/data' and modified BUILD_FILTER & OBJECT_FILES like so:
Code:
# TARGET SETUP #

    BUILT_FILTER := $(patsubst %.v.pica,$(BUILD_DIR)/%.shbin.o,$(BUILD_FILTER)) \
        $(patsubst %.shlist,$(BUILD_DIR)/%.shbin.o,$(BUILD_FILTER)) \
        $(patsubst %.der,$(BUILD_DIR)/%.der.o,$(BUILD_FILTER)) \

    OBJECT_FILES := $(foreach dir,$(SOURCE_DIRS), \
            $(patsubst %.v.pica,$(BUILD_DIR)/%.shbin.o,$(call rwildcard,$(dir),*.v.pica)) \
            $(patsubst %.shlist,$(BUILD_DIR)/%.shbin.o,$(call rwildcard,$(dir),*.shlist)) \
            $(patsubst %.der,$(BUILD_DIR)/%.der.o,$(call rwildcard,$(dir),*.der)) \
        ) $(OBJECT_FILES)

Also moved the %.der build options to:
Code:
# TARGET RULES #

$(BUILD_DIR)/%.der.o: %.der
    @echo $@
    @$(bin2o)

When compiling it shows that it is building it 'build/source/data/builtin_rootca.der.o' however nothing is actually built.
 
Last edited by Verequies,

LinkKenedy

Well-Known Member
Newcomer
Joined
Feb 14, 2015
Messages
67
Trophies
0
XP
517
Country
France
Help, i follow all instructions for setup my enviorement on a OSx and when write make in a terminal, this returns that -->

Makefile:6: *** "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM". Stop.
 

MasterFeizz

Well-Known Member
Member
Joined
Oct 15, 2015
Messages
1,098
Trophies
1
Age
29
XP
3,710
Country
United States
Help, i follow all instructions for setup my enviorement on a OSx and when write make in a terminal, this returns that -->

Makefile:6: *** "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM". Stop.
The makefile is giving you the error and telling you the solution.
 

LinkKenedy

Well-Known Member
Newcomer
Joined
Feb 14, 2015
Messages
67
Trophies
0
XP
517
Country
France
But i have all exports in ./bashcr! What i am doing wrong!? :S

IMG!
Pic.png
 
Last edited by LinkKenedy,

Hayleia

Well-Known Member
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
But i have all exports in ./bashcr! What i am doing wrong!? :S

IMG!
Pic.png
I'm so dirty I add the exports at the beginning of my Makefile :P
That's the wrong way to fix this problem but I'm too lazy to fix dev environment problems when I can fix code problems instead.
 

phoen1x74

Active Member
Newcomer
Joined
Aug 1, 2016
Messages
37
Trophies
0
Age
25
XP
97
Country
United States
Has anyone here successfully compiled ninjhax2.x? Modifiyng it for personal purposes and need help compiling it. I'm running python2 scripts/buildAll.py from the root of the directory, but have trouble. Using the latest superto branch from the github.
 

duffmmann

Well-Known Member
Member
Joined
Mar 11, 2009
Messages
3,966
Trophies
2
XP
2,305
Country
United States
I have no idea how feasible something like this could be. But, is there any way that a homebrew application could be made that when you boot it, you can select any NES VC title you've installed, but in a way where these VC titles do not appear on your main 3DS screen? Essentially this would be a program that kinda seems like an emulator, but in reality all it is is a shell that loads VC titles of one specific system. So there could be NES one, a SNES one, or a GB/C one. I'm guessing that because of the different way GBA VC titles are loaded, that such a thing might not be possible for those VC titles.

The reason for something like this would be all the better emulation of official VC titles, with the ability to store more than 300 titles of any system. If there were 300+ NES games I could have them all as VC titles, without taking up any space on the actual main screen and allowing for other titles to populate the 3DS main screen.

I hope that all makes sense, and I wouldn't be surprised if its not possible.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Hey, how can I trigger this screen whenever the app gets shut down?

You can do it only with a homebrew in CIA format.

use this code:

Code:
static bool task_quit;
static Handle task_pause_event;
static Handle task_suspend_event;
static aptHookCookie cookie;

static void task_apt_hook(APT_HookType hook, void* param) {
  switch(hook) {
  case APTHOOK_ONSUSPEND:
  svcClearEvent(task_suspend_event);
//       Mix_PauseMusic();  // NOP90 code: used to pause CSND music output when jumping in Home menu
//       muspaused=1; // NOP90 code: internal flag with music state to resume music returning to the program from Home menu
  break;
//  case APTHOOK_ONSLEEP:
//  svcClearEvent(task_pause_event);
//  break;
  default:
  break;
  }
}

void task_init() {
  task_quit = false;

  svcCreateEvent(&task_pause_event, RESET_STICKY);

  svcCreateEvent(&task_suspend_event, RESET_STICKY);

  svcSignalEvent(task_pause_event);
  svcSignalEvent(task_suspend_event);

  aptHook(&cookie, task_apt_hook, NULL);
}

void task_exit() {
  task_quit = true;

  aptUnhook(&cookie);

  if(task_pause_event != 0) {
  svcCloseHandle(task_pause_event);
  task_pause_event = 0;
  }

  if(task_suspend_event != 0) {
  svcCloseHandle(task_suspend_event);
  task_suspend_event = 0;
  }
}

I took it from a ctrulib example, but can't remember which one.

In your main() function call task_init() , than as usual make run your program in this loop:

Code:
cfguInit();
task_init();
while (aptMainLoop())
    {
        your code here...
       svcSleepThread(10000000); // pause the thread a little bit to make run the event handler thread
    }
task_exit(); // closing...
cfguExit();

PS: In the first block of code I commented out two lines to pause CSND music: you don't need it if you don't use CSND. If you do, well you have to figure out yourself how to stop music when you pause your program :)
 
Last edited by nop90,
  • Like
Reactions: KiiWii

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Cool. I got Prime