Function at 0x436630
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 0x436710
cmp eax, 4
je 0x436680
cmp eax, 1
je 0x436780
cmp eax, 5
je 0x436800
xor edi, edi
cmp eax, 2
je 0x436830
add esp, 0x4c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
xor edi, edi
test ebx, ebx
je 0x4366f6
mov ebp, dword [esp + 0x6c]
lea edi, [esp + 0x3c]
jmp 0x43669e
mov eax, dword [esp + 0x3c]
add ebp, eax
sub ebx, eax
je 0x436820
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 0x436690
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.0042d9c0
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 0x4367a1
mov eax, dword [esp + 0x60]
mov edi, dword [eax + 0xc]
test edi, edi
jne 0x436940
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 0x4367c2
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x43676d
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.004474c0
jmp 0x436718
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
xor eax, eax
cmp ebp, 0x6d
je 0x43676d
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.0042d9c0
mov eax, esi
jmp 0x43676d
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.004268d0
jmp 0x436672
xor edi, edi
jmp 0x4366f0
mov dword [esp], 0xfffffff6
mov ebx, dword [sym.imp.KERNEL32.dll_GetStdHandle]
call ebx
sub esp, 4
cmp eax, esi
je 0x436924
mov dword [esp], 0xfffffff5
call ebx
sub esp, 4
cmp eax, esi
je 0x436924
mov edi, dword [0x45aa54]
test edi, edi
jne 0x436954
mov eax, dword [esp + 0x60]
mov ebx, dword [eax + 4]
test ebx, ebx
jne 0x436924
mov ecx, dword [eax + 8]
test ecx, ecx
jne 0x4369c2
lea ebp, [eax + 0x14]
test esi, esi
je 0x436a45
mov eax, dword [esp + 0x60]
movzx eax, byte [eax + 0x14]
mov byte [esp + 0x2f], al
test al, al
je 0x4369e2
mov edi, dword [0x45a5d0]
test edi, edi
jne 0x4368be
jmp 0x436974
mov edi, dword [edi]
test edi, edi
je 0x436974
cmp dword [edi + 4], 0xffffffff
jne 0x4368b4
movzx eax, byte [edi + 8]
lea ebx, [edi + 8]
mov ecx, ebp
test al, al
je 0x43690e
movzx edx, byte [esp + 0x2f]
jmp 0x4368e7
movzx edx, byte [ecx]
test dl, dl
je 0x436910
cmp dl, al
je 0x436901
cmp al, 0x2f
jne 0x4368f4
cmp dl, 0x5c
je 0x436901
cmp al, 0x5c
jne 0x436910
cmp dl, 0x2f
jne 0x436a11
add ebx, 1
movzx eax, byte [ebx]
add ecx, 1
test al, al
jne 0x4368e0
xor eax, eax
cmp al, byte [ecx]
jne 0x4368b4
cmp dword [0x45aa54], 0
mov dword [edi + 4], esi
jne 0x436a30
mov eax, dword [esp + 0x60]
xor edi, edi
mov dword [esp], eax
call sub.libgcrypt_20.dll_gcry_free
jmp 0x436672
mov eax, dword [esp + 0x70]
mov edi, 0xffffffff
mov dword [eax], 0
jmp 0x436672
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.0042dbe0
jmp 0x43686c
mov eax, dword [0x45aa54]
test eax, eax
jne 0x436a1b
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 [0x45a5d0]
mov dword [ebx + 4], esi
mov dword [0x45a5d0], ebx
mov dword [ebx], eax
jmp 0x436924
test esi, esi
jne 0x4369e2
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], 0x456a63
call fcn.004474c0
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x45aa54]
sub esp, 4
test edx, edx
je 0x436924
mov dword [esp + 4], esi
mov dword [esp], str.fd_cache_close___d__real_n
call fcn.0042dbe0
jmp 0x436924
mov eax, 0x5c
jmp 0x436910
mov dword [esp + 4], ebp
mov dword [esp], str.fd_cache_close___s__new_slot_created_n
call fcn.0042dbe0
jmp 0x436981
mov dword [esp + 4], ebp
mov dword [esp], str.fd_cache_close___s__used_existing_slot_n
call fcn.0042dbe0
jmp 0x436924
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], 0x456a63
call fcn.004474c0
jmp 0x436891