Function at 0x403790
Capabilities:
Extract resource via kernel32 functions
Read file on windows

Disassembly:
push ebp
mov ecx, 0xc
mov ebp, esp
push edi
mov edx, 0xa
push esi
push ebx
sub esp, 0x13c
mov ebx, 0x400
mov dword [esp + 0xc], ebx
mov eax, dword [0x412880]
mov esi, dword [ebp + 0xc]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_FindResourceExA
sub esp, 0x10
test eax, eax
je 0x4039b4
mov dword [esp + 4], eax
mov edi, dword [0x412880]
mov dword [esp], edi
call sub.KERNEL32.dll_LoadResource
sub esp, 8
test eax, eax
je 0x40383a
mov dword [esp], eax
call sub.KERNEL32.dll_LockResource
sub esp, 4
test eax, eax
mov ecx, eax
je 0x40383a
xor edx, edx
mov esi, esi
movzx eax, byte [edx + ecx]
mov ebx, dword [ebp + 8]
mov byte [edx + ebx], al
inc edx
test al, al
jne 0x403800
mov edx, dword [0x40a028]
test edx, edx
je 0x403826
mov eax, dword [0x40a090]
test eax, eax
jne 0x4039ce
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edx, dword [ebp + 8]
mov word [eax + edx], 0x20
lea ebx, [ebp - 0x128]
mov edx, 0x104
xor edi, edi
mov dword [esp + 8], edx
mov dword [esp + 4], edi
mov dword [esp], ebx
call sub.msvcrt.dll_memset
mov dword [esp], esi
call sub.msvcrt.dll_strlen
mov dword [esp + 4], esi
sub eax, 3
xor esi, esi
mov dword [esp + 8], eax
mov dword [esp], ebx
call sub.msvcrt.dll_strncpy
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
mov dword [eax + ebx], 0x2e6a346c
mov ecx, 0x696e69
mov dword [eax + ebx + 4], ecx
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.msvcrt.dll__open
mov dword [ebp - 0x12c], eax
inc eax
je 0x403976
mov eax, dword [0x40a090]
test eax, eax
jne 0x40399a
mov esi, dword [ebp + 8]
mov dword [esp], esi
call sub.msvcrt.dll_strlen
mov esi, dword [ebp + 8]
mov edx, 0x7c00
sub edx, eax
mov dword [esp + 8], edx
add esi, eax
mov eax, dword [ebp - 0x12c]
mov dword [esp + 4], esi
mov edi, esi
mov dword [esp], eax
call sub.msvcrt.dll__read
mov dword [ebp - 0x130], eax
mov ecx, 1
test eax, eax
mov dword [ebp - 0x134], ecx
jle 0x403944
mov ebx, eax
nop
lea esi, [esi]
movzx ecx, byte [esi]
cmp cl, 0x23
je 0x403990
cmp cl, 0xd
sete al
cmp cl, 0xa
sete dl
or eax, edx
test al, 1
je 0x403980
cmp edi, dword [ebp + 8]
mov ecx, 1
mov dword [ebp - 0x134], ecx
jbe 0x403940
cmp byte [edi - 1], 0x20
je 0x403940
mov byte [edi], 0x20
inc edi
nop
lea esi, [esi]
inc esi
dec ebx
jne 0x403900
mov byte [edi], 0
mov ebx, dword [ebp - 0x130]
test ebx, ebx
jle 0x403968
cmp byte [edi - 1], 0x20
je 0x403968
mov edi, dword [ebp + 8]
mov dword [esp], edi
call sub.msvcrt.dll_strlen
mov word [eax + edi], 0x20
mov esi, dword [ebp - 0x12c]
mov dword [esp], esi
call sub.msvcrt.dll__close
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x134]
test eax, eax
je 0x403940
mov byte [edi], cl
jmp 0x403937
xor ecx, ecx
mov dword [ebp - 0x134], ecx
jmp 0x403940
mov dword [esp + 8], ebx
mov ebx, str.Loading:_t_s_n
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x4038b2
mov dword [esp], 0
call sub.KERNEL32.dll_SetLastError
mov edi, dword [ebp + 8]
sub esp, 4
mov byte [edi], 0
jmp 0x40383a
mov dword [esp + 0xc], ebx
mov ecx, str.Resource__d:_t_s_n
mov ebx, 0xc
mov dword [esp + 8], ebx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x403826