Function at 0x4b0820
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x170
mov eax, dword [0xa0b130]
xor eax, esp
mov dword [esp + 0x16c], eax
cmp byte [esp + 0x17c], 0
push ebx
mov ebx, dword [esp + 0x188]
push esi
push edi
mov edi, dword [esp + 0x18c]
jne 0x4b089d
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea eax, [esp + 0xc]
push 2
push 1
push 0
push eax
call esi
push eax
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__get_osfhandle]
add esp, 4
push eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
mov ecx, dword [esp + 0xc]
or edx, 0xffffffff
test eax, eax
cmove ecx, edx
mov eax, ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x16c]
xor ecx, esp
call fcn.004087b5
add esp, 0x170
ret
mov ecx, dword [esp + 0x184]
mov edx, 0xf
mov dword [esp + 0x24], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], edx
test ecx, ecx
jne 0x4b08e6
mov ax, word [0x927c80]
mov word [esp + 0x24], ax
mov al, byte [0x927c82]
mov dword [esp + 0x34], 3
mov byte [esp + 0x26], al
mov byte [esp + 0x27], cl
jmp 0x4b0967
mov eax, dword [esp + 0x180]
mov dword [esp + 0x3c], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], edx
test eax, eax
je 0x4b094d
push ecx
push eax
lea ecx, [esp + 0x44]
call fcn.00408698
mov edx, dword [esp + 0x38]
cmp edx, 0x10
jb 0x4b0946
mov ecx, dword [esp + 0x24]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4b093c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4b0aa4
push edx
push ecx
call fcn.004036ca
add esp, 8
mov ecx, dword [esp + 0x184]
movups xmm0, xmmword [esp + 0x3c]
movups xmmword [esp + 0x24], xmm0
movq xmm0, qword [esp + 0x4c]
movq qword [esp + 0x34], xmm0
mov edx, dword [esp + 0x38]
mov dword [esp + 0x10], 0xc
lea eax, [esp + 0x78]
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 1
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0x80
test ecx, ecx
jne 0x4b0aaa
lea eax, [esp + 0x6c]
push eax
sub esp, 8
lea eax, [esp + 0x30]
mov ecx, esp
cmp edx, 0x10
cmovae eax, dword [esp + 0x30]
mov dword [ecx], eax
mov eax, dword [esp + 0x40]
mov dword [ecx + 4], eax
lea eax, [esp + 0x28]
push eax
call fcn.00412350
add esp, 0x10
cmp dword [eax], 0
jne 0x4b0ade
push 0
mov eax, edi
mov ecx, 0x40000000
neg eax
push 0x80
sbb eax, eax
add eax, 3
test edi, edi
push eax
lea eax, [esp + 0x1c]
push eax
push 1
mov eax, SysReAllocString
cmovne eax, ecx
push eax
push dword [esp + 0x84]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [esp + 0xc], esi
cmp esi, 0xffffffff
jne 0x4b0a66
mov ecx, str.output
test edi, edi
mov eax, str.input
cmove eax, ecx
push eax
push str.:_Cant_open_file_for
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x60]
push eax
call fcn.00403fd5
add esp, 0xc
push eax
lea eax, [esp + 0x44]
push eax
call fcn.0041576c
push eax
push ebx
call fcn.004152bc
add esp, 0x14
lea ecx, [esp + 0x3c]
call fcn.0040aeed
lea ecx, [esp + 0x54]
call fcn.0040aeed
mov esi, dword [esp + 0xc]
mov eax, dword [esp + 0x6c]
lea ecx, [esp + 0x78]
cmp eax, ecx
je 0x4b0a7c
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov edx, dword [esp + 0x38]
cmp edx, 0x10
jb 0x4b0aed
mov ecx, dword [esp + 0x24]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4b0ae3
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4b0ae3
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
lea eax, [esp + 0x24]
mov word [esp + 0x44], 0x104
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x6c]
push 0x104
push eax
lea eax, [esp + 0x44]
push eax
lea eax, [esp + 0x28]
push eax
call fcn.004095cf
add esp, 0x10
cmp dword [eax], 0
je 0x4b09d4
or esi, 0xffffffff
jmp 0x4b0a66
push edx
push ecx
call fcn.004036ca
add esp, 8
mov ecx, dword [esp + 0x178]
mov eax, esi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004087b5
add esp, 0x170
ret