Function at 0x403c80
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x54
mov ebp, dword [esp + 0x6c]
mov esi, ecx
test ebp, ebp
je 0x403cab
push edx
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
test eax, eax
je 0x403cb7
mov edi, eax
cmp eax, 0xffffffff
jne 0x403cd4
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x403cbc
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x403ccc
mov eax, 6
mov byte [esi], 0
mov byte [esi + 3], 0
mov word [esi + 1], 0
mov dword [esi + 4], eax
add esp, 0x54
pop esi
pop edi
pop ebx
pop ebp
ret
mov ebx, dword [esp + 0x68]
lea eax, [esp + 0x24]
mov dword [esp + 0x24], 0
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x403da0
mov eax, dword [esp + 0x70]
movzx eax, byte [eax + 4]
test eax, eax
je 0x403dfa
cmp al, 4
jae 0x403ee4
movzx ecx, byte [ebx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x403e4f
mov ebx, dword [esp + 0x70]
mov byte [ebx + eax], cl
movzx eax, byte [ebx + 4]
inc al
mov byte [ebx + 4], al
movzx ecx, byte [ebx]
movzx ecx, byte [ecx + 0x6d8a5c]
cmp al, cl
jb 0x403eb6
cmp al, 5
jae 0x403ee4
mov ebp, ecx
movzx eax, al
lea ecx, [esp + 0x24]
mov edx, ebx
push eax
call fcn.00402030
add esp, 4
cmp dword [esp + 0x24], 0
mov byte [ebx + 4], 0
jne 0x403e57
cmp dword [esp + 0x2c], ebp
jne 0x403ee4
mov ecx, esp
mov edx, edi
push ebp
push dword [esp + 0x2c]
call fcn.00404020
add esp, 8
movzx eax, byte [esp]
cmp al, 4
jne 0x403ec5
cmp dword [esp + 4], ebp
je 0x403eb6
jmp 0x403ee4
lea eax, [esp + 0x3c]
mov dword [esp + 0x3c], 0x103
mov dword [esp + 0x40], 0
push 0
push 0
push ebp
push ebx
push eax
push 0
push 0
push 0
push edi
call dword [sym.imp.ntdll.dll_NtWriteFile]
cmp eax, 0x103
jne 0x403de7
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [esp + 0x3c]
cmp eax, 0x103
je 0x403ee8
test eax, eax
js 0x403e69
mov eax, dword [esp + 0x40]
mov dword [esi + 4], eax
mov byte [esi], 4
jmp 0x403ccc
cmp ebp, 0x1000
mov eax, 0x1000
mov ecx, esp
mov edx, ebx
cmovb eax, ebp
push eax
call fcn.00402030
add esp, 4
cmp dword [esp], 0
je 0x403e7e
mov eax, dword [esp + 4]
test eax, eax
je 0x403e99
cmp eax, ebp
ja 0x403ee4
lea ecx, [esp + 0x24]
mov edx, ebx
push eax
call fcn.00402030
add esp, 4
cmp dword [esp + 0x24], 0
jne 0x403ee4
mov eax, dword [esp + 0x28]
mov ebx, dword [esp + 0x2c]
jmp 0x403e86
mov eax, dword [esp + 0x70]
mov byte [eax + 4], 0
mov dword [esi], 2
mov dword [esi + 4], 0x6d8a50
jmp 0x403ccc
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov dword [esi + 4], eax
mov dword [esi], 0
jmp 0x403ccc
mov eax, dword [esp + 4]
mov ebx, dword [esp + 8]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.00404020
add esp, 8
jmp 0x403ccc
movzx eax, byte [ebx]
movzx ecx, byte [eax + 0x6d8a5c]
cmp ecx, 2
jb 0x403e57
cmp ecx, ebp
jbe 0x403e57
mov ecx, dword [esp + 0x70]
mov byte [ecx], al
mov byte [ecx + 4], 1
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x403ccc
movzx ecx, byte [esp + 3]
movzx edi, word [esp + 1]
mov edx, dword [esp + 4]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x403ccc
ud2
mov eax, esp
mov dword [esp + 0x24], 0
mov dword [esp + 0x2c], 0x6d8b74
mov dword [esp + 0x30], 2
lea ecx, [esp + 0x18]
mov dword [esp + 0x44], 0
mov dword [esp + 8], 0x6d89b0
mov dword [esp + 0xc], 1
mov dword [esp], 0
mov dword [esp + 0x10], str.NtCreateKeyedEvent
mov byte [esp + 0x48], 0
mov dword [esp + 0x14], 0
mov edx, 0x6d89e8
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x44]
mov dword [esp + 0x50], 0x4026e0
mov dword [esp + 0x20], eax
lea eax, [esp + 0x4c]
mov byte [esp + 0x18], 4
mov dword [esp + 0x34], eax
lea eax, [esp + 0x24]
mov dword [esp + 0x38], 1
push eax
call fcn.004024f0
add esp, 4
movzx ecx, byte [esp + 0x18]
test al, al
je 0x403fc2
cmp cl, 4
je 0x40400a
cmp byte [esp + 0x18], 3
jne 0x40400a
mov esi, dword [esp + 0x1c]
mov eax, dword [esi + 4]
push dword [esi]
call dword [eax]
add esp, 4
mov ecx, dword [esi + 4]
cmp dword [ecx + 4], 0
je 0x403fbf
mov eax, dword [esi]
cmp dword [ecx + 8], 9
jb 0x403fb0
mov eax, dword [eax - 4]
push eax
push 0
push dword [0x6da108]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push esi
jmp 0x403ffc
cmp cl, 3
jne 0x40400a
mov esi, dword [esp + 0x1c]
mov eax, dword [esi + 4]
push dword [esi]
call dword [eax]
add esp, 4
mov ecx, dword [esi + 4]
cmp dword [ecx + 4], 0
je 0x403ff8
mov eax, dword [esi]
cmp dword [ecx + 8], 9
jb 0x403fe9
mov eax, dword [eax - 4]
push eax
push 0
push dword [0x6da108]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [esp + 0x1c]
push 0
push dword [0x6da108]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, 7
int 0x29
ud2