Function at 0x412c00
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.00491410
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.0049e4c0
cmp eax, 0x103
jle 0x412d00
test byte [0x4ee061], 4
jne 0x412c60
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], 0x4ee068
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], 0x4b1b4c
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049e490
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.0049e490
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ee068
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.00422490
mov edi, eax
call fcn.00422840
mov dword [ebp - 0x1b3c], eax
call fcn.00422840
mov dword [ebp - 0x1b44], eax
call fcn.00422840
mov dword [ebp - 0x1b4c], eax
call fcn.00422840
mov ebx, eax
call fcn.00422840
mov dword [ebp - 0x1b40], eax
call fcn.00422840
mov dword [ebp - 0x1b50], eax
mov eax, dword [ebp - 0x1b48]
mov dword [esp], eax
call fcn.00420340
cmp eax, 0x100
je 0x412e21
mov eax, dword [ebp - 0x1b50]
mov dword [esp], eax
call fcn.004228e0
mov eax, dword [ebp - 0x1b40]
mov dword [esp], eax
call fcn.004228e0
mov dword [esp], ebx
call fcn.004228e0
mov eax, dword [ebp - 0x1b4c]
mov dword [esp], eax
call fcn.004228e0
mov eax, dword [ebp - 0x1b44]
mov dword [esp], eax
call fcn.004228e0
mov eax, dword [ebp - 0x1b3c]
mov dword [esp], eax
call fcn.004228e0
mov dword [esp], edi
call fcn.00422530
test byte [0x4ee061], 4
je 0x412c52
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov esi, dword [eax]
mov dword [esp], 0x4ee068
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], 0x4b1b4c
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049e490
call ebx
mov dword [eax], esi
mov dword [esp + 4], str.Failed_to_convert_to_publickey_n
jmp 0x412cbb
mov esi, dword [ebp - 0x1b3c]
mov dword [esp + 4], 0x20
mov dword [esp], esi
call fcn.00423250
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.00422c40
mov edx, dword [ebp - 0x1b4c]
mov dword [esp + 4], 0x800
mov dword [esp], edx
call fcn.00423250
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.00423db0
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.004233c0
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.00424340
mov dword [esp], esi
lea esi, [ebp - 0x191c]
mov dword [ebp - 0x1a24], 0x40
call fcn.00425730
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.004233c0
mov dword [esp], ebx
call fcn.00425730
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.004233c0
mov dword [esp], ebx
call fcn.00425730
mov dword [esi - 0x104], eax
lea eax, [ebp - 0x181c]
cmp esi, eax
jne 0x412ef0
mov eax, dword [ebp - 0x1b48]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call fcn.00425730
mov dword [ebp - 0x181c], eax
mov eax, dword [ebp - 0x1b50]
mov dword [esp], eax
call fcn.004228e0
mov eax, dword [ebp - 0x1b40]
mov dword [esp], eax
call fcn.004228e0
mov dword [esp], ebx
call fcn.004228e0
mov eax, dword [ebp - 0x1b4c]
mov dword [esp], eax
call fcn.004228e0
mov eax, dword [ebp - 0x1b44]
mov dword [esp], eax
call fcn.004228e0
mov eax, dword [ebp - 0x1b3c]
mov dword [esp], eax
call fcn.004228e0
mov dword [esp], edi
call fcn.00422530
lea eax, [ebp - 0x1b28]
mov dword [esp + 4], 0x4b1c10
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
mov ebx, eax
je 0x4130ca
test byte [0x4ee061], 4
jne 0x413295
lea eax, [ebp - 0x1b2c]
mov dword [esp + 4], 0x20c
mov dword [esp], eax
call fcn.00426150
test eax, eax
jne 0x413151
test byte [0x4ee061], 4
jne 0x41302c
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
jmp 0x412c52
mov esi, dword [sym.imp.msvcrt.dll__errno]
call esi
mov edi, dword [eax]
mov dword [esp], 0x4ee068
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], 0x4b1b4c
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.0049e490
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.0049e490
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ee068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov dword [eax], edi
jmp 0x41301f
test byte [0x4ee061], 4
je 0x412c52
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov esi, dword [eax]
mov dword [esp], 0x4ee068
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], 0x4b1b4c
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049e490
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.0049e490
jmp 0x412ccb
mov eax, dword [ebp - 0x1b2c]
mov dword [esp], eax
call fcn.004a4690
test eax, eax
mov esi, eax
je 0x41333d
lea eax, [ebp - 0x1a24]
mov dword [esp + 8], 0x20c
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.00425770
mov dword [esp], str.HOSTNAME
mov dword [ebp - 0x1b2c], eax
call sub.msvcrt.dll_getenv
test eax, eax
je 0x4133d3
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 0x4133b4
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.0049e4c0
cmp eax, 0xfff
jle 0x413248
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 0x4134a7
test byte [0x4ee061], 4
jne 0x4133f2
xor edi, edi
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov dword [esp], esi
call fcn.004a4660
mov eax, edi
jmp 0x412c54
mov edi, dword [sym.imp.msvcrt.dll__errno]
call edi
mov esi, dword [eax]
mov dword [esp], 0x4ee068
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], 0x4b1b4c
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.0049e490
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.0049e490
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ee068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call edi
mov dword [eax], esi
jmp 0x412ff8
test byte [0x4ee061], 4
je 0x41301f
mov esi, dword [sym.imp.msvcrt.dll__errno]
call esi
mov edi, dword [eax]
mov dword [esp], 0x4ee068
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], 0x4b1b4c
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.0049e490
call esi
mov dword [eax], edi
mov dword [esp + 4], str.Allocation_failure
jmp 0x413091
mov dword [ebp - 0x1418], 0x6e6b6e75
lea edx, [ebp - 0x1418]
mov dword [ebp - 0x1414], 0x6e776f
jmp 0x413217
mov dword [ebp - 0x1818], 0x6e6b6e75
lea edi, [ebp - 0x1818]
mov dword [ebp - 0x1814], 0x6e776f
jmp 0x4131ca
mov edi, dword [sym.imp.msvcrt.dll__errno]
call edi
mov eax, dword [eax]
mov dword [esp], 0x4ee068
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], 0x4b1b4c
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.0049e490
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.0049e490
mov ecx, dword [sym.imp.msvcrt.dll__iob]
lea eax, [ecx + 0x40]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ee068
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 0x41327e
mov edx, edi
mov ecx, dword [edx]
add edx, 4
lea eax, [ecx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x4134a9
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 0x41326f
jmp 0x41327e