Function at 0x413eb0
Capabilities:
Query environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x1b58
call fcn.00492bb0
sub esp, eax
mov eax, dword [esp + eax]
mov dword [esp + 0xc], edx
mov dword [esp + 8], str._s.pub
mov dword [esp + 4], 0x104
mov dword [ebp - 0x1b48], eax
lea eax, [ebp - 0x1b28]
mov dword [esp], eax
call fcn.0049fc60
cmp eax, 0x103
jle 0x413fb0
test byte [0x4f3061], 4
jne 0x413f10
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov esi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str.write_public_keyfile
mov dword [esp + 4], 0x4b6c8c
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call ebx
mov dword [eax], esi
mov dword [esp + 4], str.Path_too_long_while_writing_public_key_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call ebx
mov dword [eax], esi
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.00423d40
mov edi, eax
call fcn.004240f0
mov dword [ebp - 0x1b3c], eax
call fcn.004240f0
mov dword [ebp - 0x1b44], eax
call fcn.004240f0
mov dword [ebp - 0x1b4c], eax
call fcn.004240f0
mov ebx, eax
call fcn.004240f0
mov dword [ebp - 0x1b40], eax
call fcn.004240f0
mov dword [ebp - 0x1b50], eax
mov eax, dword [ebp - 0x1b48]
mov dword [esp], eax
call fcn.00421bf0
cmp eax, 0x100
je 0x4140d1
mov eax, dword [ebp - 0x1b50]
mov dword [esp], eax
call fcn.00424190
mov eax, dword [ebp - 0x1b40]
mov dword [esp], eax
call fcn.00424190
mov dword [esp], ebx
call fcn.00424190
mov eax, dword [ebp - 0x1b4c]
mov dword [esp], eax
call fcn.00424190
mov eax, dword [ebp - 0x1b44]
mov dword [esp], eax
call fcn.00424190
mov eax, dword [ebp - 0x1b3c]
mov dword [esp], eax
call fcn.00424190
mov dword [esp], edi
call fcn.00423de0
test byte [0x4f3061], 4
je 0x413f02
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov esi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str.write_public_keyfile
mov dword [esp + 4], 0x4b6c8c
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call ebx
mov dword [eax], esi
mov dword [esp + 4], str.Failed_to_convert_to_publickey_n
jmp 0x413f6b
mov esi, dword [ebp - 0x1b3c]
mov dword [esp + 4], 0x20
mov dword [esp], esi
call fcn.00424b00
mov eax, dword [ebp - 0x1b48]
mov eax, dword [eax + 8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1b40]
mov dword [esp], eax
call fcn.004244f0
mov edx, dword [ebp - 0x1b4c]
mov dword [esp + 4], 0x800
mov dword [esp], edx
call fcn.00424b00
mov edx, dword [ebp - 0x1b4c]
mov eax, dword [ebp - 0x1b40]
mov dword [esp + 0xc], edi
mov dword [esp + 4], edx
mov edx, dword [ebp - 0x1b44]
mov dword [esp + 8], eax
mov dword [esp], edx
call fcn.00425660
mov eax, dword [ebp - 0x1b40]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], edi
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov dword [esp], 0
call fcn.00424c70
mov dword [esp + 8], esi
mov esi, dword [ebp - 0x1b50]
mov dword [esp + 0xc], edi
mov dword [esp + 4], ebx
mov dword [esp], esi
call fcn.00425bf0
mov dword [esp], esi
lea esi, [ebp - 0x191c]
mov dword [ebp - 0x1a24], 0x40
call fcn.00426fe0
neg eax
mov dword [ebp - 0x1a20], eax
lea esi, [esi]
mov ecx, dword [ebp - 0x1b44]
add esi, 4
mov eax, dword [ebp - 0x1b3c]
mov dword [esp + 0x10], edi
mov dword [esp + 4], ebx
mov dword [esp + 8], ecx
mov dword [esp], ecx
mov dword [esp + 0xc], eax
call fcn.00424c70
mov dword [esp], ebx
call fcn.00426fe0
mov dword [esi - 4], eax
mov eax, dword [ebp - 0x1b3c]
mov dword [esp + 0x10], edi
mov dword [esp + 4], ebx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1b40]
mov dword [esp + 8], eax
mov dword [esp], eax
call fcn.00424c70
mov dword [esp], ebx
call fcn.00426fe0
mov dword [esi - 0x104], eax
lea eax, [ebp - 0x181c]
cmp esi, eax
jne 0x4141a0
mov eax, dword [ebp - 0x1b48]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call fcn.00426fe0
mov dword [ebp - 0x181c], eax
mov eax, dword [ebp - 0x1b50]
mov dword [esp], eax
call fcn.00424190
mov eax, dword [ebp - 0x1b40]
mov dword [esp], eax
call fcn.00424190
mov dword [esp], ebx
call fcn.00424190
mov eax, dword [ebp - 0x1b4c]
mov dword [esp], eax
call fcn.00424190
mov eax, dword [ebp - 0x1b44]
mov dword [esp], eax
call fcn.00424190
mov eax, dword [ebp - 0x1b3c]
mov dword [esp], eax
call fcn.00424190
mov dword [esp], edi
call fcn.00423de0
lea eax, [ebp - 0x1b28]
mov dword [esp + 4], 0x4b6d50
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
mov ebx, eax
je 0x41437a
test byte [0x4f3061], 4
jne 0x414545
lea eax, [ebp - 0x1b2c]
mov dword [esp + 4], 0x20c
mov dword [esp], eax
call fcn.00427a00
test eax, eax
jne 0x414401
test byte [0x4f3061], 4
jne 0x4142dc
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
jmp 0x413f02
mov esi, dword [sym.imp.msvcrt.dll__errno]
call esi
mov edi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x1b3c], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x1b3c]
mov dword [esp + 8], str.write_public_keyfile
mov dword [esp + 4], 0x4b6c8c
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call esi
mov dword [eax], edi
mov dword [esp + 4], str.Public_key_too_large_to_base64_encode
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov dword [eax], edi
jmp 0x4142cf
test byte [0x4f3061], 4
je 0x413f02
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov esi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str.write_public_keyfile
mov dword [esp + 4], 0x4b6c8c
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call ebx
mov dword [eax], esi
lea eax, [ebp - 0x1b28]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str.Failed_to_open__s_n
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
jmp 0x413f7b
mov eax, dword [ebp - 0x1b2c]
mov dword [esp], eax
call fcn.004a9640
test eax, eax
mov esi, eax
je 0x4145ed
lea eax, [ebp - 0x1a24]
mov dword [esp + 8], 0x20c
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.00427020
mov dword [esp], str.HOSTNAME
mov dword [ebp - 0x1b2c], eax
call sub.msvcrt.dll_getenv
test eax, eax
je 0x414683
mov dword [esp], str.HOSTNAME
lea edi, [ebp - 0x1818]
call sub.msvcrt.dll_getenv
mov dword [esp + 8], 0x400
mov dword [esp], edi
mov dword [esp + 4], eax
call sub.msvcrt.dll_strncpy
mov byte [ebp - 0x1419], 0
mov dword [esp], str.LOGNAME
call sub.msvcrt.dll_getenv
test eax, eax
je 0x414664
mov dword [esp], str.LOGNAME
call sub.msvcrt.dll_getenv
lea edx, [ebp - 0x1418]
mov dword [esp], edx
mov dword [esp + 8], 0x400
mov dword [ebp - 0x1b3c], edx
mov dword [esp + 4], eax
call sub.msvcrt.dll_strncpy
mov edx, dword [ebp - 0x1b3c]
mov byte [ebp - 0x1019], 0
mov dword [esp + 0x10], edi
lea edi, [ebp - 0x1018]
mov dword [esp + 0xc], edx
mov dword [esp + 8], str.__s__s
mov dword [esp + 4], 0x1000
mov dword [esp], edi
call fcn.0049fc60
cmp eax, 0xfff
jle 0x4144f8
mov byte [ebp - 0x19], 0
mov eax, dword [ebp - 0x1b2c]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp], esi
mov dword [esp + 4], eax
call sub.msvcrt.dll_fwrite
cmp eax, 1
je 0x414757
test byte [0x4f3061], 4
jne 0x4146a2
xor edi, edi
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov dword [esp], esi
call fcn.004a9610
mov eax, edi
jmp 0x413f04
mov edi, dword [sym.imp.msvcrt.dll__errno]
call edi
mov esi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x1b3c], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x1b3c]
mov dword [esp + 8], str.write_public_keyfile
mov dword [esp + 4], 0x4b6c8c
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call edi
mov dword [eax], esi
lea eax, [ebp - 0x1b28]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str.Writing_public_key_to__s_n
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call edi
mov dword [eax], esi
jmp 0x4142a8
test byte [0x4f3061], 4
je 0x4142cf
mov esi, dword [sym.imp.msvcrt.dll__errno]
call esi
mov edi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x1b3c], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x1b3c]
mov dword [esp + 8], str.write_public_keyfile
mov dword [esp + 4], 0x4b6c8c
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call esi
mov dword [eax], edi
mov dword [esp + 4], str.Allocation_failure
jmp 0x414341
mov dword [ebp - 0x1418], 0x6e6b6e75
lea edx, [ebp - 0x1418]
mov dword [ebp - 0x1414], 0x6e776f
jmp 0x4144c7
mov dword [ebp - 0x1818], 0x6e6b6e75
lea edi, [ebp - 0x1818]
mov dword [ebp - 0x1814], 0x6e776f
jmp 0x41447a
mov edi, dword [sym.imp.msvcrt.dll__errno]
call edi
mov eax, dword [eax]
mov dword [esp], 0x4f3068
mov dword [ebp - 0x1b3c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x1b40], eax
call sub.msvcrt.dll__getpid
mov ecx, dword [ebp - 0x1b40]
mov dword [esp + 8], str.write_public_keyfile
mov dword [esp + 4], 0x4b6c8c
mov dword [esp + 0x10], ecx
mov ecx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], eax
lea eax, [ecx + 0x40]
mov dword [esp], eax
call fcn.0049fc30
call edi
mov edx, dword [ebp - 0x1b3c]
mov dword [eax], edx
mov ecx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str.Write_error_while_writing_public_key
lea eax, [ecx + 0x40]
mov dword [esp], eax
call fcn.0049fc30
mov ecx, dword [sym.imp.msvcrt.dll__iob]
lea eax, [ecx + 0x40]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call edi
mov edx, dword [ebp - 0x1b3c]
xor edi, edi
mov dword [eax], edx
jmp 0x41452e
mov edx, edi
mov ecx, dword [edx]
add edx, 4
lea eax, [ecx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x414759
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea ecx, [edx + 2]
cmove edx, ecx
add al, al
sbb edx, 3
sub edx, edi
mov dword [esp], edi
mov edi, 1
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], edx
call sub.msvcrt.dll_fwrite
cmp eax, 1
jne 0x41451f
jmp 0x41452e