Function at 0x5062c0
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53a460
mov eax, dword fs:[0]
push eax
sub esp, 0x9c
mov eax, dword [0x577400]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x57ac30]
mov ecx, dword [eax + edx + 0x18]
mov dword [ebp - 0x88], ecx
mov edx, dword [ebp + 0x10]
add edx, dword [ebp + 0x14]
mov dword [ebp - 0x58], edx
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
mov dword [ebp - 0x94], eax
mov ecx, dword [ebp + 0x18]
call fcn.00405fb0
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x78]
mov ecx, dword [eax]
cmp dword [ecx + 8], 0xfde9
jne 0x506341
mov byte [ebp - 0x3d], 1
jmp 0x506345
mov byte [ebp - 0x3d], 0
mov dl, byte [ebp - 0x3d]
mov byte [ebp - 0x3e], dl
xor eax, eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x38], ecx
mov edx, dword [ebp - 0x38]
cmp edx, dword [ebp - 0x58]
jae 0x506b6e
mov eax, dword [ebp - 0x38]
mov cl, byte [eax]
mov byte [ebp - 0x3f], cl
xor edx, edx
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x5c], 1
movzx eax, byte [ebp - 0x3e]
test eax, eax
je 0x5067bb
mov ecx, dword [ebp + 0xc]
sar ecx, 6
mov edx, dword [ebp + 0xc]
and edx, 0x3f
imul eax, edx, 0x38
mov ecx, dword [ecx*4 + 0x57ac30]
mov dl, byte [ecx + eax + 0x2d]
shr dl, 2
and dl, 1
movzx eax, dl
test eax, eax
je 0x5063d5
push str.__dbcsBufferUsed_fh_
push 0x5426ac
push 0
push 0x94
push str.minkernelcrtsucrt_src_appcrtlowiowrite.cpp
push 2
call fcn.004022d4
add esp, 0x18
cmp eax, 1
jne 0x5063d5
int3
mov dword [ebp - 0xa8], 5
mov dword [ebp - 0x3c], 0
jmp 0x5063f1
mov edx, dword [ebp - 0x3c]
add edx, 1
mov dword [ebp - 0x3c], edx
cmp dword [ebp - 0x3c], 5
jge 0x50641d
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x57ac30]
add eax, edx
mov ecx, dword [ebp - 0x3c]
movsx edx, byte [eax + ecx + 0x2e]
test edx, edx
je 0x50641d
jmp 0x5063e8
cmp dword [ebp - 0x3c], 0
jle 0x50667f
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x57ac30]
add eax, edx
mov ecx, 1
imul edx, ecx, 0
movzx eax, byte [eax + edx + 0x2e]
push eax
call fcn.00403f80
add esp, 4
movsx ecx, al
add ecx, 1
mov dword [ebp - 0x64], ecx
cmp dword [ebp - 0x64], 1
jle 0x50646c
mov edx, dword [ebp - 0x3c]
cmp edx, dword [ebp - 0x64]
jl 0x506492
push str.1___mb_len__mb_buf_used___mb_len
push 0x5426ac
push 0
push 0x9d
push str.minkernelcrtsucrt_src_appcrtlowiowrite.cpp
push 2
call fcn.004022d4
add esp, 0x18
cmp eax, 1
jne 0x506492
int3
mov ecx, dword [ebp - 0x64]
sub ecx, dword [ebp - 0x3c]
mov dword [ebp - 0x84], ecx
mov edx, dword [ebp - 0x58]
sub edx, dword [ebp - 0x38]
cmp dword [ebp - 0x84], edx
jg 0x5065d7
mov dword [ebp - 0x48], 0
jmp 0x5064c2
mov eax, dword [ebp - 0x48]
add eax, 1
mov dword [ebp - 0x48], eax
mov ecx, dword [ebp - 0x48]
cmp ecx, dword [ebp - 0x3c]
jge 0x5064f0
mov edx, dword [ebp + 0xc]
sar edx, 6
mov eax, dword [ebp + 0xc]
and eax, 0x3f
imul ecx, eax, 0x38
add ecx, dword [edx*4 + 0x57ac30]
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x48]
mov cl, byte [ecx + eax + 0x2e]
mov byte [ebp + edx - 0x18], cl
jmp 0x5064b9
mov dword [ebp - 0x4c], 0
jmp 0x506502
mov edx, dword [ebp - 0x4c]
add edx, 1
mov dword [ebp - 0x4c], edx
mov eax, dword [ebp - 0x4c]
cmp eax, dword [ebp - 0x84]
jge 0x506521
mov ecx, dword [ebp - 0x4c]
add ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x38]
add edx, dword [ebp - 0x4c]
mov al, byte [edx]
mov byte [ebp + ecx - 0x18], al
jmp 0x5064f9
mov dword [ebp - 0x68], 0
jmp 0x506533
mov ecx, dword [ebp - 0x68]
add ecx, 1
mov dword [ebp - 0x68], ecx
mov edx, dword [ebp - 0x68]
cmp edx, dword [ebp - 0x3c]
jge 0x50655b
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul edx, ecx, 0x38
add edx, dword [eax*4 + 0x57ac30]
mov eax, dword [ebp - 0x68]
mov byte [edx + eax + 0x2e], 0
jmp 0x50652a
xor ecx, ecx
mov dword [ebp - 0x9c], ecx
mov dword [ebp - 0x98], ecx
lea edx, [ebp - 0x18]
mov dword [ebp - 0x8c], edx
cmp dword [ebp - 0x64], 4
jne 0x50657f
mov dword [ebp - 0x5c], 2
mov eax, dword [ebp + 0x18]
push eax
lea ecx, [ebp - 0x9c]
push ecx
mov edx, dword [ebp - 0x5c]
push edx
lea eax, [ebp - 0x8c]
push eax
lea ecx, [ebp - 0x44]
push ecx
call fcn.004041ec
add esp, 0x14
cmp eax, 0xffffffff
jne 0x5065c2
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x34]
mov dword [edx], eax
mov ecx, dword [ebp - 0x30]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 0x2c]
mov dword [edx + 8], eax
mov eax, dword [ebp + 8]
jmp 0x506b85
mov ecx, dword [ebp - 0x84]
mov edx, dword [ebp - 0x38]
lea eax, [edx + ecx - 1]
mov dword [ebp - 0x38], eax
jmp 0x50667a
mov ecx, dword [ebp - 0x58]
sub ecx, dword [ebp - 0x38]
mov dword [ebp - 0x70], ecx
mov edx, dword [ebp - 0x3c]
add edx, dword [ebp - 0x70]
cmp edx, 5
jl 0x506611
push str.mb_buf_used__bytes_to_add___mb_buf_size
push 0x5426ac
push 0
push 0xc3
push str.minkernelcrtsucrt_src_appcrtlowiowrite.cpp
push 2
call fcn.004022d4
add esp, 0x18
cmp eax, 1
jne 0x506611
int3
mov dword [ebp - 0x50], 0
jmp 0x506623
mov ecx, dword [ebp - 0x50]
add ecx, 1
mov dword [ebp - 0x50], ecx
mov edx, dword [ebp - 0x50]
cmp edx, dword [ebp - 0x70]
jge 0x506655
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul edx, ecx, 0x38
add edx, dword [eax*4 + 0x57ac30]
mov eax, dword [ebp - 0x50]
add eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp - 0x50]
mov cl, byte [ecx]
mov byte [edx + eax + 0x2e], cl
jmp 0x50661a
mov edx, dword [ebp - 0x30]
add edx, dword [ebp - 0x70]
mov dword [ebp - 0x30], edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x34]
mov dword [eax], ecx
mov edx, dword [ebp - 0x30]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 8], ecx
mov eax, dword [ebp + 8]
jmp 0x506b85
jmp 0x5067b6
lfence
mov edx, dword [ebp - 0x38]
movzx eax, byte [edx]
push eax
call fcn.00403f80
add esp, 4
movsx ecx, al
add ecx, 1
mov dword [ebp - 0x74], ecx
mov edx, dword [ebp - 0x58]
sub edx, dword [ebp - 0x38]
mov dword [ebp - 0x60], edx
mov eax, dword [ebp - 0x74]
cmp eax, dword [ebp - 0x60]
jg 0x506724
xor ecx, ecx
mov dword [ebp - 0xa4], ecx
mov dword [ebp - 0xa0], ecx
mov edx, dword [ebp - 0x38]
mov dword [ebp - 0x90], edx
cmp dword [ebp - 0x74], 4
jne 0x5066cf
mov dword [ebp - 0x5c], 2
mov eax, dword [ebp + 0x18]
push eax
lea ecx, [ebp - 0xa4]
push ecx
mov edx, dword [ebp - 0x5c]
push edx
lea eax, [ebp - 0x90]
push eax
lea ecx, [ebp - 0x44]
push ecx
call fcn.004041ec
add esp, 0x14
cmp eax, 0xffffffff
jne 0x506712
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x34]
mov dword [edx], eax
mov ecx, dword [ebp - 0x30]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 0x2c]
mov dword [edx + 8], eax
mov eax, dword [ebp + 8]
jmp 0x506b85
mov ecx, dword [ebp - 0x74]
mov edx, dword [ebp - 0x38]
lea eax, [edx + ecx - 1]
mov dword [ebp - 0x38], eax
jmp 0x5067b6
cmp dword [ebp - 0x60], 5
jbe 0x506750
push str.available_bytes___sizeof__mbBuffer_fh__
push 0x5426ac
push 0
push 0xe3
push str.minkernelcrtsucrt_src_appcrtlowiowrite.cpp
push 2
call fcn.004022d4
add esp, 0x18
cmp eax, 1
jne 0x506750
int3
mov dword [ebp - 0x54], 0
jmp 0x506762
mov edx, dword [ebp - 0x54]
add edx, 1
mov dword [ebp - 0x54], edx
mov eax, dword [ebp - 0x54]
cmp eax, dword [ebp - 0x60]
jge 0x506791
mov ecx, dword [ebp + 0xc]
sar ecx, 6
mov edx, dword [ebp + 0xc]
and edx, 0x3f
imul eax, edx, 0x38
add eax, dword [ecx*4 + 0x57ac30]
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp - 0x54]
mov edx, dword [ebp - 0x54]
mov cl, byte [ecx]
mov byte [eax + edx + 0x2e], cl
jmp 0x506759
mov edx, dword [ebp - 0x30]
add edx, dword [ebp - 0x60]
mov dword [ebp - 0x30], edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x34]
mov dword [eax], ecx
mov edx, dword [ebp - 0x30]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 8], ecx
mov eax, dword [ebp + 8]
jmp 0x506b85
jmp 0x506a22
mov edx, dword [ebp + 0xc]
sar edx, 6
mov eax, dword [ebp + 0xc]
and eax, 0x3f
imul ecx, eax, 0x38
mov edx, dword [edx*4 + 0x57ac30]
mov al, byte [edx + ecx + 0x2d]
shr al, 2
and al, 1
movzx ecx, al
test ecx, ecx
je 0x5068f5
mov edx, dword [ebp - 0x78]
push edx
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x57ac30]
add eax, edx
mov ecx, 1
imul edx, ecx, 0
movzx eax, byte [eax + edx + 0x2e]
push eax
call fcn.004022b1
add esp, 8
movzx ecx, ax
test ecx, ecx
jne 0x506844
push str._isleadbyte_fast_internal__dbcsBuffer_fh___locale_
push 0x5426ac
push 0
push 0xf2
push str.minkernelcrtsucrt_src_appcrtlowiowrite.cpp
push 2
call fcn.004022d4
add esp, 0x18
cmp eax, 1
jne 0x506844
int3
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul edx, ecx, 0x38
add edx, dword [eax*4 + 0x57ac30]
mov eax, 1
imul ecx, eax, 0
mov eax, 1
imul eax, eax, 0
mov cl, byte [edx + ecx + 0x2e]
mov byte [ebp + eax - 0x20], cl
mov edx, 1
shl edx, 0
mov eax, dword [ebp - 0x38]
mov cl, byte [eax]
mov byte [ebp + edx - 0x20], cl
mov edx, dword [ebp + 0xc]
sar edx, 6
mov eax, dword [ebp + 0xc]
and eax, 0x3f
imul ecx, eax, 0x38
mov edx, dword [edx*4 + 0x57ac30]
mov al, byte [edx + ecx + 0x2d]
and al, 0xfb
mov ecx, dword [ebp + 0xc]
sar ecx, 6
mov edx, dword [ebp + 0xc]
and edx, 0x3f
imul edx, edx, 0x38
mov ecx, dword [ecx*4 + 0x57ac30]
mov byte [ecx + edx + 0x2d], al
mov edx, dword [ebp + 0x18]
push edx
push 2
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x44]
push ecx
call fcn.00401384
add esp, 0x10
cmp eax, 0xffffffff
jne 0x5068f0
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x34]
mov dword [edx], eax
mov ecx, dword [ebp - 0x30]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 0x2c]
mov dword [edx + 8], eax
mov eax, dword [ebp + 8]
jmp 0x506b85
jmp 0x506a22
lfence
mov ecx, dword [ebp - 0x78]
push ecx
mov edx, dword [ebp - 0x38]
movzx eax, byte [edx]
push eax
call fcn.004022b1
add esp, 8
movzx ecx, ax
test ecx, ecx
je 0x5069eb
mov edx, dword [ebp - 0x38]
add edx, 1
cmp edx, dword [ebp - 0x58]
jae 0x506966
mov eax, dword [ebp + 0x18]
push eax
push 2
mov ecx, dword [ebp - 0x38]
push ecx
lea edx, [ebp - 0x44]
push edx
call fcn.00401384
add esp, 0x10
cmp eax, 0xffffffff
jne 0x506958
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x34]
mov dword [eax], ecx
mov edx, dword [ebp - 0x30]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 8], ecx
mov eax, dword [ebp + 8]
jmp 0x506b85
mov edx, dword [ebp - 0x38]
add edx, 1
mov dword [ebp - 0x38], edx
jmp 0x5069e9
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul edx, ecx, 0x38
add edx, dword [eax*4 + 0x57ac30]
mov eax, 1
imul ecx, eax, 0
mov eax, dword [ebp - 0x38]
mov al, byte [eax]
mov byte [edx + ecx + 0x2e], al
mov ecx, dword [ebp + 0xc]
sar ecx, 6
mov edx, dword [ebp + 0xc]
and edx, 0x3f
imul eax, edx, 0x38
mov ecx, dword [ecx*4 + 0x57ac30]
mov dl, byte [ecx + eax + 0x2d]
or dl, 4
mov eax, dword [ebp + 0xc]
sar eax, 6
mov ecx, dword [ebp + 0xc]
and ecx, 0x3f
imul ecx, ecx, 0x38
mov eax, dword [eax*4 + 0x57ac30]
mov byte [eax + ecx + 0x2d], dl
mov ecx, dword [ebp - 0x30]
add ecx, 1
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x34]
mov dword [edx], eax
mov ecx, dword [ebp - 0x30]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 0x2c]
mov dword [edx + 8], eax
mov eax, dword [ebp + 8]
jmp 0x506b85
jmp 0x506a22
mov ecx, dword [ebp + 0x18]
push ecx
push 1
mov edx, dword [ebp - 0x38]
push edx
lea eax, [ebp - 0x44]
push eax
call fcn.00401384
add esp, 0x10
cmp eax, 0xffffffff
jne 0x506a22
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x34]
mov dword [ecx], edx
mov eax, dword [ebp - 0x30]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x2c]
mov dword [ecx + 8], edx
mov eax, dword [ebp + 8]
jmp 0x506b85
mov eax, dword [ebp - 0x38]
add eax, 1
mov dword [ebp - 0x38], eax
push 0
push 0
push 5
lea ecx, [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x5c]
push edx
lea eax, [ebp - 0x44]
push eax
push 0
mov ecx, dword [ebp - 0x94]
push ecx
call fcn.004066f9
add esp, 0x20
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0
jne 0x506a73
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x34]
mov dword [edx], eax
mov ecx, dword [ebp - 0x30]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 0x2c]
mov dword [edx + 8], eax
mov eax, dword [ebp + 8]
jmp 0x506b85
push 0
lea ecx, [ebp - 0x80]
push ecx
mov edx, dword [ebp - 0x7c]
push edx
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x88]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x506ab7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x34], eax
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x34]
mov dword [edx], eax
mov ecx, dword [ebp - 0x30]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 0x2c]
mov dword [edx + 8], eax
mov eax, dword [ebp + 8]
jmp 0x506b85
mov ecx, dword [ebp - 0x38]
sub ecx, dword [ebp + 0x10]
add ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x80]
cmp edx, dword [ebp - 0x7c]
jae 0x506ae7
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x34]
mov dword [eax], ecx
mov edx, dword [ebp - 0x30]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 8], ecx
mov eax, dword [ebp + 8]
jmp 0x506b85
movsx edx, byte [ebp - 0x3f]
cmp edx, 0xa
jne 0x506b69
mov eax, 0xd
mov word [ebp - 0x6c], ax
push 0
lea ecx, [ebp - 0x80]
push ecx
push 1
lea edx, [ebp - 0x6c]
push edx
mov eax, dword [ebp - 0x88]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x506b38
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x34]
mov dword [ecx], edx
mov eax, dword [ebp - 0x30]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x2c]
mov dword [ecx + 8], edx
mov eax, dword [ebp + 8]
jmp 0x506b85
cmp dword [ebp - 0x80], 1
jae 0x506b57
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x34]
mov dword [eax], ecx
mov edx, dword [ebp - 0x30]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 8], ecx
mov eax, dword [ebp + 8]
jmp 0x506b85
mov edx, dword [ebp - 0x2c]
add edx, 1
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x30]
add eax, 1
mov dword [ebp - 0x30], eax
jmp 0x50635c
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x34]
mov dword [ecx], edx
mov eax, dword [ebp - 0x30]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x2c]
mov dword [ecx + 8], edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004030b7
mov esp, ebp
pop ebp
ret