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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
mov ebx, dword [esp + 0x78]
mov esi, dword [esp + 0x70]
mov edi, dword [esp + 0x74]
call fcn.0045ad10
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__get_osfhandle]
cmp eax, 0xffffffff
mov dword [esp + 0x30], eax
je 0x476a9e
cmp ebx, 2
jle 0x476790
mov edx, dword [esp + 0x7c]
test edx, edx
je 0x4767f0
lea eax, [esi + 8]
mov edx, dword [esp + 0x7c]
mov dword [edi + 4], esi
mov dword [edi + 8], 0xe
mov dword [edi + 0x10], eax
mov ecx, dword [esi + 0xc]
lea eax, [edi + 0x10]
test edx, edx
mov dword [edi + 0x14], ecx
mov dword [ecx], eax
mov dword [esi + 0xc], eax
mov eax, dword [esp + 0x30]
mov dword [edi + 0x30], 0
mov dword [edi + 0x40], 0
mov dword [edi + 0x88], 0
mov dword [edi + 0x48], 0xe
mov dword [edi + 0x64], 0
mov dword [edi + 0x80], 0
mov dword [edi + 0x84], 0xffffffff
mov dword [edi + 0x44], edi
mov dword [edi + 0x8c], 0
mov dword [edi + 0x90], eax
mov dword [edi + 0x18], ebx
mov dword [edi + 0x3c], 0
mov dword [edi + 0x2c], 0x1220
jne 0x476952
xor eax, eax
mov dword [edi + 0x2c], 0x11220
mov dword [edi + 0x94], 0
mov word [edi + 0x98], ax
mov byte [edi + 0x9a], 0
xor eax, eax
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
lea ecx, [esp + 0x30]
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0xffffffff
mov ebx, 0xffffffff
mov dword [esp + 0xc], ecx
mov dword [esp + 4], eax
mov dword [esp], 0xffffffff
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
sub esp, 0x1c
test eax, eax
jne 0x4766c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], eax
call fcn.0045b940
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x30]
lea ebp, [esp + 0x3a]
mov dword [esp + 4], ebp
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
sub esp, 8
test eax, eax
je 0x4767d9
mov dword [esp], 0x6ab660
call fcn.00472cd0
cmp dword [0x63a044], 1
je 0x476a30
mov eax, dword [0x6ab658]
test eax, eax
jne 0x47693a
movzx eax, word [esp + 0x42]
test ax, ax
je 0x4769d0
mov edx, eax
mov ecx, eax
mov word [0x63a04a], ax
and edx, 4
and ecx, 2
mov byte [0x63a048], 0
mov word [esp + 0x2e], dx
mov edx, eax
mov byte [0x6ab65f], 0
and edx, 1
mov byte [0x6ab65e], 0
mov byte [0x6ab65d], 0
mov word [esp + 0x2c], dx
mov edx, eax
mov byte [0x6ab65c], 0
and edx, 0x40
mov word [esp + 0x2a], dx
mov edx, eax
and edx, 0x20
mov word [esp + 0x28], dx
mov edx, eax
and edx, 0x10
mov word [esp + 0x26], dx
mov edx, eax
and edx, 8
mov word [esp + 0x20], dx
mov edx, eax
and ax, 0x4000
and dx, 0x80
cmp word [esp + 0x2e], 0
jne 0x476a22
test cx, cx
je 0x4768cd
or byte [0x63a048], 2
cmp word [esp + 0x2c], 0
je 0x4768dc
or byte [0x63a048], 4
cmp word [esp + 0x2a], 0
je 0x4768eb
mov byte [0x6ab65f], 1
cmp word [esp + 0x28], 0
je 0x4768fa
or byte [0x6ab65f], 2
cmp word [esp + 0x26], 0
je 0x476909
or byte [0x6ab65f], 4
cmp word [esp + 0x20], 0
je 0x476918
mov byte [0x6ab65e], 1
test dx, dx
je 0x476924
mov byte [0x6ab65d], 1
test ax, ax
je 0x476930
mov byte [0x6ab65c], 1
mov dword [0x6ab658], 1
mov eax, ebp
call fcn.00473fd0
mov dword [esp], 0x6ab660
call fcn.00472c90
jmp 0x4766d3
mov dword [edi + 0x2c], 0x1009220
mov dword [edi + 0x94], 0
xor eax, eax
mov dword [edi + 0x98], 0
mov dword [edi + 0x9c], 0
mov dword [edi + 0xa0], 0
mov dword [edi + 0xac], 0
mov dword [edi + 0xb0], 0
mov dword [edi + 0xb4], 0
mov dword [edi + 0xb8], 0
mov dword [edi + 0xbc], 0
mov dword [edi + 0xc0], 0
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, 7
xor edx, edx
mov byte [0x6ab65f], 0
mov word [0x63a04a], cx
xor ecx, ecx
mov word [esp + 0x2a], dx
mov word [esp + 0x28], cx
xor edx, edx
xor ecx, ecx
mov word [esp + 0x20], dx
mov word [esp + 0x26], cx
xor edx, edx
mov byte [0x6ab65e], 0
mov byte [0x6ab65d], 0
mov ecx, 2
mov byte [0x6ab65c], 0
mov word [esp + 0x2c], 1
mov byte [0x63a048], 1
jmp 0x4768c1
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0x34]
mov dword [esp + 0x34], 0
mov dword [esp + 4], eax
mov dword [esp], ecx
mov dword [esp + 0x20], ecx
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
sub esp, 8
test eax, eax
mov ecx, dword [esp + 0x20]
jne 0x476a70
mov dword [0x63a044], 2
jmp 0x476825
mov eax, dword [esp + 0x34]
mov dword [esp], ecx
or eax, 4
mov dword [esp + 0x34], eax
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
sub esp, 8
test eax, eax
je 0x476a5c
mov dword [0x63a044], 0
jmp 0x476825
mov eax, 0xfffff00d
jmp 0x476782