Function at 0x1004834
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor ebx, ebx
cmp edi, ebx
mov dword [ebp - 4], ebx
je 0x1004a63
mov esi, dword [ebp + 0xc]
cmp esi, ebx
je 0x1004a63
push edi
call fcn.01002e9c
cmp eax, 1
jne 0x1004947
mov eax, dword [sym.imp.msvcrt.dll__iob]
lea ecx, [eax + 0x20]
cmp edi, ecx
jne 0x1004877
push 0xfffffffffffffff5
jmp 0x1004884
add eax, 0x40
cmp edi, eax
jne 0x100492f
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push ebx
push esi
mov dword [ebp + 8], eax
mov dword [ebp - 4], ebx
call fcn.01002fa4
mov edi, dword [sym.imp.KERNEL32.dll_WriteConsoleW]
push ebx
lea ecx, [ebp - 4]
push ecx
push eax
push esi
push dword [ebp + 8]
mov dword [ebp - 0xc], eax
call edi
test eax, eax
je 0x10048b8
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 4]
je 0x100491a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 8
jne 0x1004922
push ebx
push esi
call fcn.01002fa4
cmp eax, ebx
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], ebx
jbe 0x100491a
mov dword [ebp - 0x10], esi
mov esi, 0x400
mov eax, dword [ebp - 0xc]
sub eax, dword [ebp - 8]
mov dword [ebp + 0xc], esi
cmp eax, esi
ja 0x10048ec
mov dword [ebp + 0xc], eax
push ebx
lea eax, [ebp - 4]
push eax
push dword [ebp + 0xc]
push dword [ebp - 0x10]
push dword [ebp + 8]
call edi
test eax, eax
je 0x1004922
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 4]
jne 0x1004922
add dword [ebp - 8], esi
mov eax, dword [ebp - 8]
add dword [ebp - 0x10], 0x800
cmp eax, dword [ebp - 0xc]
jb 0x10048dc
xor eax, eax
inc eax
jmp 0x1004a77
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
jmp 0x10049f1
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1004a75
push 0x42b
jmp 0x1004a6f
push 1
push esi
call fcn.010046de
push ebx
push eax
mov dword [ebp - 0x14], eax
call fcn.01002fa4
mov dword [ebp - 0xc], eax
push 0x40
mov esi, 0x1008038
xor eax, eax
cmp dword [ebp - 0xc], ebx
pop ecx
mov edi, esi
rep stosd dword es:[edi], eax
mov dword [ebp - 8], ebx
jbe 0x100491a
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
mov edi, 0xff
sub eax, ecx
cmp eax, edi
mov dword [ebp - 4], ebx
mov dword [ebp + 0xc], edi
ja 0x100498c
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 0x14]
lea eax, [eax + ecx*2]
mov dword [ebp - 0x10], eax
push ebx
push ebx
push ebx
push ebx
push dword [ebp + 0xc]
push dword [ebp - 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x10049e9
cmp eax, edi
jbe 0x1004a04
add eax, 0xffffff01
cmp eax, 3
jbe 0x10049c9
shr eax, 1
sub dword [ebp + 0xc], eax
jmp 0x10049cc
dec dword [ebp + 0xc]
cmp dword [ebp + 0xc], ebx
mov dword [ebp - 4], ebx
jne 0x1004995
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x10049e9
push 0x42b
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call fcn.01002dee
call fcn.01003902
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
cmp eax, dword [ebp + 0xc]
jae 0x1004a0c
mov dword [ebp + 0xc], eax
push 0x40
pop ecx
push ebx
push ebx
push 0xff
xor eax, eax
mov edi, esi
push esi
rep stosd dword es:[edi], eax
mov edi, dword [ebp + 0xc]
push edi
push dword [ebp - 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x10049e9
add dword [ebp - 8], edi
push esi
push dword [ebp + 8]
call dword [sym.imp.msvcrt.dll_fprintf]
push dword [ebp + 8]
call dword [sym.imp.msvcrt.dll_fflush]
mov eax, dword [ebp - 0xc]
add esp, 0xc
cmp eax, dword [ebp - 8]
ja 0x1004972
jmp 0x100491a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1004a75
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 8