Function at 0x518900
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x3c94
call fcn.0050a820
mov eax, dword [0x583f80]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x3c6c], 0
mov dword [ebp - 0x3c70], 0
mov dword [ebp - 0x3c1c], 0
mov eax, dword [ebp - 0x3c1c]
mov dword [ebp - 0x3c30], eax
cmp dword [ebp + 0x10], 0
jne 0x51894e
xor eax, eax
jmp 0x51967d
cmp dword [ebp + 0xc], 0
je 0x518960
mov dword [ebp - 0x3c84], 1
jmp 0x51896a
mov dword [ebp - 0x3c84], 0
mov ecx, dword [ebp - 0x3c84]
mov dword [ebp - 0x3c78], ecx
cmp dword [ebp - 0x3c78], 0
jne 0x5189a2
push str._buf___NULL_
push 0x567220
push 0
push 0x6c
push str.f:dd_vctoolscrt_bld_self_x86crt_srcwrite.c
push 2
call fcn.005022e0
add esp, 0x18
cmp eax, 1
jne 0x5189a2
int3
cmp dword [ebp - 0x3c78], 0
jne 0x5189e4
call fcn.00502d30
mov dword [eax], 0
call fcn.00502d90
mov dword [eax], 0x16
push 0
push 0x6c
push str.f:dd_vctoolscrt_bld_self_x86crt_srcwrite.c
push str._write_nolock
push str._buf___NULL_
call fcn.004ff160
add esp, 0x14
or eax, 0xffffffff
jmp 0x51967d
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
mov al, byte [edx + ecx + 0x24]
shl al, 1
sar al, 1
mov byte [ebp - 0x3c11], al
movsx ecx, byte [ebp - 0x3c11]
cmp ecx, 2
je 0x518a24
movsx edx, byte [ebp - 0x3c11]
cmp edx, 1
jne 0x518abc
mov eax, dword [ebp + 0x10]
and eax, 1
jne 0x518a38
mov dword [ebp - 0x3c80], 1
jmp 0x518a42
mov dword [ebp - 0x3c80], 0
mov ecx, dword [ebp - 0x3c80]
mov dword [ebp - 0x3c88], ecx
cmp dword [ebp - 0x3c88], 0
jne 0x518a7a
push str.__cnt__1___0_
push 0x567220
push 0
push 0x74
push str.f:dd_vctoolscrt_bld_self_x86crt_srcwrite.c
push 2
call fcn.005022e0
add esp, 0x18
cmp eax, 1
jne 0x518a7a
int3
cmp dword [ebp - 0x3c88], 0
jne 0x518abc
call fcn.00502d30
mov dword [eax], 0
call fcn.00502d90
mov dword [eax], 0x16
push 0
push 0x74
push str.f:dd_vctoolscrt_bld_self_x86crt_srcwrite.c
push str._write_nolock
push str.__cnt__1___0_
call fcn.004ff160
add esp, 0x14
or eax, 0xffffffff
jmp 0x51967d
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
movsx eax, byte [edx + ecx + 4]
and eax, 0x20
je 0x518aee
push 2
push 0
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.00509d70
add esp, 0x10
mov edx, dword [ebp + 8]
push edx
call fcn.00528fc0
add esp, 4
test eax, eax
je 0x518b98
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
movsx eax, byte [edx + ecx + 4]
and eax, 0x80
je 0x518b98
call fcn.005163c0
mov dword [ebp - 0x3c90], eax
mov ecx, dword [ebp - 0x3c90]
mov edx, dword [ecx + 0x6c]
mov eax, 4
shl eax, 1
cmp dword [edx + eax + 0xa0], 0
jne 0x518b55
mov dword [ebp - 0x3c7c], 1
jmp 0x518b5f
mov dword [ebp - 0x3c7c], 0
mov ecx, dword [ebp - 0x3c7c]
mov dword [ebp - 0x3c70], ecx
lea edx, [ebp - 0x3c94]
push edx
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
mov eax, dword [edx + ecx]
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov dword [ebp - 0x3c6c], eax
cmp dword [ebp - 0x3c6c], 0
je 0x51909d
cmp dword [ebp - 0x3c70], 0
je 0x518bbd
movsx ecx, byte [ebp - 0x3c11]
test ecx, ecx
je 0x51909d
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
mov dword [ebp - 0x3c8c], eax
mov dword [ebp - 0x3c40], 0
mov dword [ebp - 0x3c60], 0
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x3c20], edx
mov eax, dword [ebp - 0x3c20]
sub eax, dword [ebp + 0xc]
cmp eax, dword [ebp + 0x10]
jae 0x519098
movsx ecx, byte [ebp - 0x3c11]
test ecx, ecx
jne 0x518e0b
mov edx, dword [ebp - 0x3c20]
movsx eax, byte [edx]
cmp eax, 0xa
jne 0x518c21
mov dword [ebp - 0x3c74], 1
jmp 0x518c2b
mov dword [ebp - 0x3c74], 0
mov ecx, dword [ebp - 0x3c74]
mov dword [ebp - 0x3c64], ecx
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
shl eax, 6
mov ecx, dword [edx*4 + 0x587790]
cmp dword [ecx + eax + 0x38], 0
je 0x518d22
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
shl eax, 6
mov ecx, dword [edx*4 + 0x587790]
movsx edx, byte [ecx + eax + 0x34]
push edx
call fcn.00516860
add esp, 4
test eax, eax
jne 0x518ca6
push str.isleadbyte__dbcsBuffer_fh__
push 0x567220
push 0
push 0xae
push str.f:dd_vctoolscrt_bld_self_x86crt_srcwrite.c
push 2
call fcn.005022e0
add esp, 0x18
cmp eax, 1
jne 0x518ca6
int3
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
shl edx, 6
mov eax, dword [ecx*4 + 0x587790]
mov ecx, 1
imul ecx, ecx, 0
mov dl, byte [eax + edx + 0x34]
mov byte [ebp + ecx - 0xc], dl
mov eax, 1
shl eax, 0
mov ecx, dword [ebp - 0x3c20]
mov dl, byte [ecx]
mov byte [ebp + eax - 0xc], dl
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
mov dword [edx + ecx + 0x38], 0
push 2
lea eax, [ebp - 0xc]
push eax
lea ecx, [ebp - 0x3c18]
push ecx
call fcn.005328a0
add esp, 0xc
cmp eax, 0xffffffff
jne 0x518d1d
jmp 0x519098
jmp 0x518dfa
mov edx, dword [ebp - 0x3c20]
movsx eax, byte [edx]
push eax
call fcn.00516860
add esp, 4
test eax, eax
je 0x518dd8
mov ecx, dword [ebp - 0x3c20]
sub ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub edx, ecx
cmp edx, 1
jbe 0x518d82
push 2
mov eax, dword [ebp - 0x3c20]
push eax
lea ecx, [ebp - 0x3c18]
push ecx
call fcn.005328a0
add esp, 0xc
cmp eax, 0xffffffff
jne 0x518d71
jmp 0x519098
mov edx, dword [ebp - 0x3c20]
add edx, 1
mov dword [ebp - 0x3c20], edx
jmp 0x518dd6
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
mov eax, dword [ebp - 0x3c20]
mov al, byte [eax]
mov byte [edx + ecx + 0x34], al
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
shl edx, 6
mov eax, dword [ecx*4 + 0x587790]
mov dword [eax + edx + 0x38], 1
mov ecx, dword [ebp - 0x3c1c]
add ecx, 1
mov dword [ebp - 0x3c1c], ecx
jmp 0x519098
jmp 0x518dfa
push 1
mov edx, dword [ebp - 0x3c20]
push edx
lea eax, [ebp - 0x3c18]
push eax
call fcn.005328a0
add esp, 0xc
cmp eax, 0xffffffff
jne 0x518dfa
jmp 0x519098
mov ecx, dword [ebp - 0x3c20]
add ecx, 1
mov dword [ebp - 0x3c20], ecx
jmp 0x518e70
movsx edx, byte [ebp - 0x3c11]
cmp edx, 1
je 0x518e23
movsx eax, byte [ebp - 0x3c11]
cmp eax, 2
jne 0x518e70
mov ecx, dword [ebp - 0x3c20]
mov dx, word [ecx]
mov word [ebp - 0x3c18], dx
movzx eax, word [ebp - 0x3c18]
cmp eax, 0xa
jne 0x518e4b
mov dword [ebp - 0x3c68], 1
jmp 0x518e55
mov dword [ebp - 0x3c68], 0
mov ecx, dword [ebp - 0x3c68]
mov dword [ebp - 0x3c64], ecx
mov edx, dword [ebp - 0x3c20]
add edx, 2
mov dword [ebp - 0x3c20], edx
movsx eax, byte [ebp - 0x3c11]
test eax, eax
jne 0x518fcf
push 0
push 0
push 5
lea ecx, [ebp - 0xc]
push ecx
push 1
lea edx, [ebp - 0x3c18]
push edx
push 0
mov eax, dword [ebp - 0x3c8c]
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x3c40], eax
cmp dword [ebp - 0x3c40], 0
jne 0x518eb7
jmp 0x519098
push 0
lea ecx, [ebp - 0x3c60]
push ecx
mov edx, dword [ebp - 0x3c40]
push edx
lea eax, [ebp - 0xc]
push eax
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
shl edx, 6
mov eax, dword [ecx*4 + 0x587790]
mov ecx, dword [eax + edx]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x518f19
mov edx, dword [ebp - 0x3c20]
sub edx, dword [ebp + 0xc]
add edx, dword [ebp - 0x3c30]
mov dword [ebp - 0x3c1c], edx
mov eax, dword [ebp - 0x3c60]
cmp eax, dword [ebp - 0x3c40]
jge 0x518f17
jmp 0x519098
jmp 0x518f2a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
jmp 0x519098
cmp dword [ebp - 0x3c64], 0
je 0x518fca
mov dword [ebp - 0x3c40], 1
mov ecx, 1
imul ecx, ecx, 0
mov byte [ebp + ecx - 0xc], 0xd
push 0
lea edx, [ebp - 0x3c60]
push edx
mov eax, dword [ebp - 0x3c40]
push eax
lea ecx, [ebp - 0xc]
push ecx
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
shl eax, 6
mov ecx, dword [edx*4 + 0x587790]
mov edx, dword [ecx + eax]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x518fb9
mov eax, dword [ebp - 0x3c60]
cmp eax, dword [ebp - 0x3c40]
jge 0x518f99
jmp 0x519098
mov ecx, dword [ebp - 0x3c30]
add ecx, 1
mov dword [ebp - 0x3c30], ecx
mov edx, dword [ebp - 0x3c1c]
add edx, 1
mov dword [ebp - 0x3c1c], edx
jmp 0x518fca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
jmp 0x519098
jmp 0x519093
movsx eax, byte [ebp - 0x3c11]
cmp eax, 1
je 0x518feb
movsx ecx, byte [ebp - 0x3c11]
cmp ecx, 2
jne 0x519093
movzx edx, word [ebp - 0x3c18]
push edx
call fcn.005328c0
add esp, 4
movzx eax, ax
movzx ecx, word [ebp - 0x3c18]
cmp eax, ecx
jne 0x51901a
mov edx, dword [ebp - 0x3c1c]
add edx, 2
mov dword [ebp - 0x3c1c], edx
jmp 0x519028
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
jmp 0x519098
cmp dword [ebp - 0x3c64], 0
je 0x519093
mov dword [ebp - 0x3c40], 1
mov eax, 0xd
mov word [ebp - 0x3c18], ax
movzx ecx, word [ebp - 0x3c18]
push ecx
call fcn.005328c0
add esp, 4
movzx edx, ax
movzx eax, word [ebp - 0x3c18]
cmp edx, eax
jne 0x519085
mov ecx, dword [ebp - 0x3c1c]
add ecx, 1
mov dword [ebp - 0x3c1c], ecx
mov edx, dword [ebp - 0x3c30]
add edx, 1
mov dword [ebp - 0x3c30], edx
jmp 0x519093
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
jmp 0x519098
jmp 0x518be6
jmp 0x5195d4
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
movsx eax, byte [edx + ecx + 4]
and eax, 0x80
je 0x51957b
mov dword [ebp - 0x3c24], 0
movsx ecx, byte [ebp - 0x3c11]
test ecx, ecx
jne 0x519238
mov dword [ebp - 0x3c48], 0
mov dword [ebp - 0x3c2c], 0
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x3c48], edx
mov eax, dword [ebp - 0x3c48]
sub eax, dword [ebp + 0xc]
cmp eax, dword [ebp + 0x10]
jae 0x519233
lea ecx, [ebp - 0x2810]
mov dword [ebp - 0x3c2c], ecx
mov edx, dword [ebp - 0x3c2c]
lea eax, [ebp - 0x2810]
sub edx, eax
cmp edx, 0x13ff
jae 0x5191b1
mov ecx, dword [ebp - 0x3c48]
sub ecx, dword [ebp + 0xc]
cmp ecx, dword [ebp + 0x10]
jae 0x5191b1
mov edx, dword [ebp - 0x3c48]
mov al, byte [edx]
mov byte [ebp - 0x3c25], al
mov ecx, dword [ebp - 0x3c48]
add ecx, 1
mov dword [ebp - 0x3c48], ecx
movsx edx, byte [ebp - 0x3c25]
cmp edx, 0xa
jne 0x51918f
mov eax, dword [ebp - 0x3c30]
add eax, 1
mov dword [ebp - 0x3c30], eax
mov ecx, dword [ebp - 0x3c2c]
mov byte [ecx], 0xd
mov edx, dword [ebp - 0x3c2c]
add edx, 1
mov dword [ebp - 0x3c2c], edx
mov eax, dword [ebp - 0x3c2c]
mov cl, byte [ebp - 0x3c25]
mov byte [eax], cl
mov edx, dword [ebp - 0x3c2c]
add edx, 1
mov dword [ebp - 0x3c2c], edx
jmp 0x519117
push 0
lea eax, [ebp - 0x3c3c]
push eax
mov ecx, dword [ebp - 0x3c2c]
lea edx, [ebp - 0x2810]
sub ecx, edx
push ecx
lea eax, [ebp - 0x2810]
push eax
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
shl edx, 6
mov eax, dword [ecx*4 + 0x587790]
mov ecx, dword [eax + edx]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x519220
mov edx, dword [ebp - 0x3c1c]
add edx, dword [ebp - 0x3c3c]
mov dword [ebp - 0x3c1c], edx
mov eax, dword [ebp - 0x3c2c]
lea ecx, [ebp - 0x2810]
sub eax, ecx
cmp dword [ebp - 0x3c3c], eax
jge 0x51921e
jmp 0x519233
jmp 0x51922e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
jmp 0x519233
jmp 0x5190f9
jmp 0x519579
movsx edx, byte [ebp - 0x3c11]
cmp edx, 2
jne 0x5193a2
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x3c54], eax
mov dword [ebp - 0x3c34], 0
mov ecx, dword [ebp - 0x3c54]
sub ecx, dword [ebp + 0xc]
cmp ecx, dword [ebp + 0x10]
jae 0x51939d
lea edx, [ebp - 0x3c10]
mov dword [ebp - 0x3c34], edx
mov eax, dword [ebp - 0x3c34]
lea ecx, [ebp - 0x3c10]
sub eax, ecx
cmp eax, 0x13fe
jae 0x51931b
mov edx, dword [ebp - 0x3c54]
sub edx, dword [ebp + 0xc]
cmp edx, dword [ebp + 0x10]
jae 0x51931b
mov eax, dword [ebp - 0x3c54]
mov cx, word [eax]
mov word [ebp - 0x3c5c], cx
mov edx, dword [ebp - 0x3c54]
add edx, 2
mov dword [ebp - 0x3c54], edx
movzx eax, word [ebp - 0x3c5c]
cmp eax, 0xa
jne 0x5192f7
mov ecx, dword [ebp - 0x3c30]
add ecx, 2
mov dword [ebp - 0x3c30], ecx
mov edx, 0xd
mov eax, dword [ebp - 0x3c34]
mov word [eax], dx
mov ecx, dword [ebp - 0x3c34]
add ecx, 2
mov dword [ebp - 0x3c34], ecx
mov edx, dword [ebp - 0x3c34]
mov ax, word [ebp - 0x3c5c]
mov word [edx], ax
mov ecx, dword [ebp - 0x3c34]
add ecx, 2
mov dword [ebp - 0x3c34], ecx
jmp 0x519279
push 0
lea edx, [ebp - 0x3c3c]
push edx
mov eax, dword [ebp - 0x3c34]
lea ecx, [ebp - 0x3c10]
sub eax, ecx
push eax
lea edx, [ebp - 0x3c10]
push edx
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
mov eax, dword [edx + ecx]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x51938a
mov ecx, dword [ebp - 0x3c1c]
add ecx, dword [ebp - 0x3c3c]
mov dword [ebp - 0x3c1c], ecx
mov edx, dword [ebp - 0x3c34]
lea eax, [ebp - 0x3c10]
sub edx, eax
cmp dword [ebp - 0x3c3c], edx
jge 0x519388
jmp 0x51939d
jmp 0x519398
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
jmp 0x51939d
jmp 0x51925b
jmp 0x519579
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x3c44], ecx
mov dword [ebp - 0x3c38], 0
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x3c44], edx
mov eax, dword [ebp - 0x3c44]
sub eax, dword [ebp + 0xc]
cmp eax, dword [ebp + 0x10]
jae 0x519579
mov dword [ebp - 0x3c50], 0
lea ecx, [ebp - 0x6b8]
mov dword [ebp - 0x3c38], ecx
mov edx, dword [ebp - 0x3c38]
lea eax, [ebp - 0x6b8]
sub edx, eax
cmp edx, 0x6a8
jae 0x519476
mov ecx, dword [ebp - 0x3c44]
sub ecx, dword [ebp + 0xc]
cmp ecx, dword [ebp + 0x10]
jae 0x519476
mov edx, dword [ebp - 0x3c44]
mov ax, word [edx]
mov word [ebp - 0x3c58], ax
mov ecx, dword [ebp - 0x3c44]
add ecx, 2
mov dword [ebp - 0x3c44], ecx
movzx edx, word [ebp - 0x3c58]
cmp edx, 0xa
jne 0x519452
mov eax, 0xd
mov ecx, dword [ebp - 0x3c38]
mov word [ecx], ax
mov edx, dword [ebp - 0x3c38]
add edx, 2
mov dword [ebp - 0x3c38], edx
mov eax, dword [ebp - 0x3c38]
mov cx, word [ebp - 0x3c58]
mov word [eax], cx
mov edx, dword [ebp - 0x3c38]
add edx, 2
mov dword [ebp - 0x3c38], edx
jmp 0x5193e6
push 0
push 0
push 0xd55
lea eax, [ebp - 0x1410]
push eax
mov eax, dword [ebp - 0x3c38]
lea ecx, [ebp - 0x6b8]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
push eax
lea edx, [ebp - 0x6b8]
push edx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x3c50], eax
cmp dword [ebp - 0x3c50], 0
jne 0x5194d3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
jmp 0x519579
mov dword [ebp - 0x3c4c], 0
push 0
lea eax, [ebp - 0x3c3c]
push eax
mov ecx, dword [ebp - 0x3c50]
sub ecx, dword [ebp - 0x3c4c]
push ecx
mov edx, dword [ebp - 0x3c4c]
lea eax, [ebp + edx - 0x1410]
push eax
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
shl edx, 6
mov eax, dword [ecx*4 + 0x587790]
mov ecx, dword [eax + edx]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x519539
mov edx, dword [ebp - 0x3c4c]
add edx, dword [ebp - 0x3c3c]
mov dword [ebp - 0x3c4c], edx
jmp 0x519547
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
jmp 0x519555
mov eax, dword [ebp - 0x3c50]
cmp eax, dword [ebp - 0x3c4c]
jg 0x5194dd
mov ecx, dword [ebp - 0x3c50]
cmp ecx, dword [ebp - 0x3c4c]
jle 0x519565
jmp 0x519579
mov edx, dword [ebp - 0x3c44]
sub edx, dword [ebp + 0xc]
mov dword [ebp - 0x3c1c], edx
jmp 0x5193be
jmp 0x5195d4
push 0
lea eax, [ebp - 0x3c3c]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
shl ecx, 6
mov edx, dword [eax*4 + 0x587790]
mov eax, dword [edx + ecx]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5195c8
mov dword [ebp - 0x3c24], 0
mov ecx, dword [ebp - 0x3c3c]
mov dword [ebp - 0x3c1c], ecx
jmp 0x5195d4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c24], eax
cmp dword [ebp - 0x3c1c], 0
jne 0x519671
cmp dword [ebp - 0x3c24], 0
je 0x519623
cmp dword [ebp - 0x3c24], 5
jne 0x51960d
call fcn.00502d90
mov dword [eax], 9
call fcn.00502d30
mov edx, dword [ebp - 0x3c24]
mov dword [eax], edx
jmp 0x51961c
mov eax, dword [ebp - 0x3c24]
push eax
call fcn.00502d60
add esp, 4
or eax, 0xffffffff
jmp 0x51967d
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
shl edx, 6
mov eax, dword [ecx*4 + 0x587790]
movsx ecx, byte [eax + edx + 4]
and ecx, 0x40
je 0x519654
mov edx, dword [ebp + 0xc]
movsx eax, byte [edx]
cmp eax, 0x1a
jne 0x519654
xor eax, eax
jmp 0x51967d
call fcn.00502d90
mov dword [eax], 0x1c
call fcn.00502d30
mov dword [eax], 0
or eax, 0xffffffff
jmp 0x51967d
mov eax, dword [ebp - 0x3c1c]
sub eax, dword [ebp - 0x3c30]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004fcf30
mov esp, ebp
pop ebp
ret