Function at 0x458020
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x70]
mov eax, dword [esp + 0x64]
mov esi, dword [ecx]
mov ebx, dword [edx]
cmp eax, 3
je 0x458100
cmp eax, 4
je 0x458070
cmp eax, 1
je 0x458170
cmp eax, 5
je 0x4581f0
xor edi, edi
cmp eax, 2
je 0x458220
add esp, 0x4c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
xor edi, edi
test ebx, ebx
je 0x4580e6
mov ebp, dword [esp + 0x6c]
lea edi, [esp + 0x3c]
jmp 0x45808e
mov eax, dword [esp + 0x3c]
add ebp, eax
sub ebx, eax
je 0x458210
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [esp + 4], ebp
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
test eax, eax
jne 0x458080
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], eax
mov esi, eax
call sub.libgpg_error_0.dll_gpg_err_code_from_errno
mov dword [esp + 8], esi
movzx edi, ax
mov eax, dword [esp + 0x60]
mov dword [esp], str._s:_write_error:_ec_d_n
add eax, 0x14
mov dword [esp + 4], eax
call fcn.0044dbb0
mov ebx, ebp
sub ebx, dword [esp + 0x6c]
mov eax, dword [esp + 0x70]
mov dword [eax], ebx
add esp, 0x4c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
test ebx, ebx
je 0x458191
mov eax, dword [esp + 0x60]
mov edi, dword [eax + 0xc]
test edi, edi
jne 0x458330
lea eax, [esp + 0x3c]
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x6c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
mov esi, eax
test eax, eax
je 0x4581b2
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x45815d
mov edx, dword [esp + 0x60]
mov edi, 0xffffffff
mov dword [edx + 0xc], 1
mov ecx, dword [esp + 0x70]
mov dword [ecx], eax
add esp, 0x4c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ecx + 0xc], 0
xor edi, edi
mov dword [ecx + 4], 0
mov eax, edi
mov dword [ecx + 8], 0
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], 0x1c6
mov dword [esp + 4], str._home_wk_b_gnupg_2.2_dist_PLAY_release_gnupg_w32_2.2.19_common_iobuf.c
mov dword [esp], str.size
call fcn.00474e00
jmp 0x458108
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
xor eax, eax
cmp ebp, 0x6d
je 0x45815d
mov dword [esp], ebp
call sub.libgpg_error_0.dll_gpg_err_code_from_errno
mov dword [esp + 8], ebp
movzx edi, ax
mov eax, dword [esp + 0x60]
mov dword [esp], str._s:_read_error:_ec_d_n
add eax, 0x14
mov dword [esp + 4], eax
call fcn.0044dbb0
mov eax, esi
jmp 0x45815d
mov eax, dword [esp + 0x6c]
mov dword [esp + 8], ebx
xor edi, edi
mov dword [esp + 4], str.file_filter_fd_
mov dword [esp], eax
call fcn.00446ac0
jmp 0x458062
xor edi, edi
jmp 0x4580e0
mov dword [esp], 0xfffffff6
mov ebx, dword [sym.imp.KERNEL32.dll_GetStdHandle]
call ebx
sub esp, 4
cmp eax, esi
je 0x458314
mov dword [esp], 0xfffffff5
call ebx
sub esp, 4
cmp eax, esi
je 0x458314
mov edi, dword [0x491510]
test edi, edi
jne 0x458344
mov eax, dword [esp + 0x60]
mov ebx, dword [eax + 4]
test ebx, ebx
jne 0x458314
mov ecx, dword [eax + 8]
test ecx, ecx
jne 0x4583b2
lea ebp, [eax + 0x14]
test esi, esi
je 0x458435
mov eax, dword [esp + 0x60]
movzx eax, byte [eax + 0x14]
mov byte [esp + 0x2f], al
test al, al
je 0x4583d2
mov edi, dword [0x490db0]
test edi, edi
jne 0x4582ae
jmp 0x458364
mov edi, dword [edi]
test edi, edi
je 0x458364
cmp dword [edi + 4], 0xffffffff
jne 0x4582a4
movzx eax, byte [edi + 8]
lea ebx, [edi + 8]
mov ecx, ebp
test al, al
je 0x4582fe
movzx edx, byte [esp + 0x2f]
jmp 0x4582d7
movzx edx, byte [ecx]
test dl, dl
je 0x458300
cmp dl, al
je 0x4582f1
cmp al, 0x2f
jne 0x4582e4
cmp dl, 0x5c
je 0x4582f1
cmp al, 0x5c
jne 0x458300
cmp dl, 0x2f
jne 0x458401
add ebx, 1
movzx eax, byte [ebx]
add ecx, 1
test al, al
jne 0x4582d0
xor eax, eax
cmp al, byte [ecx]
jne 0x4582a4
cmp dword [0x491510], 0
mov dword [edi + 4], esi
jne 0x458420
mov eax, dword [esp + 0x60]
xor edi, edi
mov dword [esp], eax
call sub.libgcrypt_20.dll_gcry_free
jmp 0x458062
mov eax, dword [esp + 0x70]
mov edi, 0xffffffff
mov dword [eax], 0
jmp 0x458062
mov eax, dword [esp + 0x60]
mov dword [esp + 8], esi
mov dword [esp], str._s:_close_fd_handle__d_n
add eax, 0x14
mov dword [esp + 4], eax
call fcn.0044ddd0
jmp 0x45825c
mov eax, dword [0x491510]
test eax, eax
jne 0x45840b
mov dword [esp], ebp
call sub.msvcrt.dll_strlen
mov dword [esp], 1
add eax, 0xc
mov dword [esp + 4], eax
call sub.libgcrypt_20.dll_gcry_xcalloc
mov dword [esp + 4], ebp
mov ebx, eax
lea eax, [eax + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov eax, dword [0x490db0]
mov dword [ebx + 4], esi
mov dword [0x490db0], ebx
mov dword [ebx], eax
jmp 0x458314
test esi, esi
jne 0x4583d2
mov dword [esp + 8], 0x16f
mov dword [esp + 4], str._home_wk_b_gnupg_2.2_dist_PLAY_release_gnupg_w32_2.2.19_common_iobuf.c
mov dword [esp], 0x488923
call fcn.00474e00
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x491510]
sub esp, 4
test edx, edx
je 0x458314
mov dword [esp + 4], esi
mov dword [esp], str.fd_cache_close___d__real_n
call fcn.0044ddd0
jmp 0x458314
mov eax, 0x5c
jmp 0x458300
mov dword [esp + 4], ebp
mov dword [esp], str.fd_cache_close___s__new_slot_created_n
call fcn.0044ddd0
jmp 0x458371
mov dword [esp + 4], ebp
mov dword [esp], str.fd_cache_close___s__used_existing_slot_n
call fcn.0044ddd0
jmp 0x458314
mov dword [esp + 8], 0x16f
mov dword [esp + 4], str._home_wk_b_gnupg_2.2_dist_PLAY_release_gnupg_w32_2.2.19_common_iobuf.c
mov dword [esp], 0x488923
call fcn.00474e00
jmp 0x458281