Function at 0x501010
Capabilities:
Validate payment card number using luhn algorithm
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58c6b6
mov eax, dword fs:[0]
push eax
sub esp, 0x44c
mov eax, dword [0x5f8310]
xor eax, ebp
mov dword [ebp - 0x204], eax
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x430], ecx
mov byte [ebp - 0x410], 0x1b
mov byte [ebp - 0x40f], 0x30
mov byte [ebp - 0x40e], 0
mov byte [ebp - 0x368], 0xd
mov byte [ebp - 0x367], 0xa
mov byte [ebp - 0x366], 0
lea ecx, [ebp - 0x2bc]
call sub.mfc90.dll_Ordinal_580
mov dword [ebp - 4], 0
push 0x78
push 0
lea eax, [ebp - 0x8c]
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
push 0x5b3ac5
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_310]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_316]
mov byte [ebp - 4], 2
mov dword [ebp - 0x1fc], 2
mov dword [ebp - 0x1f8], 2
mov dword [ebp - 0x1f4], 0xc
mov dword [ebp - 0x1f0], 2
mov dword [ebp - 0x1ec], 6
mov dword [ebp - 0x1e8], 0x44
mov dword [ebp - 0x1e4], 3
mov dword [ebp - 0x1e0], 2
mov dword [ebp - 0x1dc], 0xc
mov dword [ebp - 0x1d8], 3
mov dword [ebp - 0x1d4], 4
mov dword [ebp - 0x1d0], 0x28
mov dword [ebp - 0x1cc], 3
mov dword [ebp - 0x1c8], 7
mov dword [ebp - 0x1c4], 0x4e
mov dword [ebp - 0x1c0], 4
mov dword [ebp - 0x1bc], 2
mov dword [ebp - 0x1b8], 0xc
mov dword [ebp - 0x1b4], 4
mov dword [ebp - 0x1b0], 5
mov dword [ebp - 0x1ac], 0x32
mov dword [ebp - 0x1a8], 5
mov dword [ebp - 0x1a4], 5
mov dword [ebp - 0x1a0], 0x32
mov dword [ebp - 0x19c], 5
mov dword [ebp - 0x198], 7
mov dword [ebp - 0x194], 0x4e
mov dword [ebp - 0x190], 6
mov dword [ebp - 0x18c], 1
mov dword [ebp - 0x188], 2
mov dword [ebp - 0x184], 6
mov dword [ebp - 0x180], 5
mov dword [ebp - 0x17c], 0x32
mov dword [ebp - 0x178], 6
mov dword [ebp - 0x174], 7
mov dword [ebp - 0x170], 0x4e
mov dword [ebp - 0x16c], 7
mov dword [ebp - 0x168], 5
mov dword [ebp - 0x164], 0x32
mov dword [ebp - 0x160], 7
mov dword [ebp - 0x15c], 7
mov dword [ebp - 0x158], 0x4e
mov dword [ebp - 0x154], 8
mov dword [ebp - 0x150], 5
mov dword [ebp - 0x14c], 0x32
mov dword [ebp - 0x148], 8
mov dword [ebp - 0x144], 7
mov dword [ebp - 0x140], 0x4e
mov dword [ebp - 0x13c], 9
mov dword [ebp - 0x138], 7
mov dword [ebp - 0x134], 0x4e
mov dword [ebp - 0x130], 0xa
mov dword [ebp - 0x12c], 1
mov dword [ebp - 0x128], 2
mov dword [ebp - 0x124], 0xa
mov dword [ebp - 0x120], 7
mov dword [ebp - 0x11c], 0x4e
mov dword [ebp - 0x118], 0xc
mov dword [ebp - 0x114], 1
mov dword [ebp - 0x110], 2
mov dword [ebp - 0x10c], 0xc
mov dword [ebp - 0x108], 3
mov dword [ebp - 0x104], 0x28
mov dword [ebp - 0x100], 0xc
mov dword [ebp - 0xfc], 5
mov dword [ebp - 0xf8], 0x32
mov dword [ebp - 0xf4], 0xc
mov dword [ebp - 0xf0], 6
mov dword [ebp - 0xec], 0x44
mov dword [ebp - 0xe8], 0xc
mov dword [ebp - 0xe4], 7
mov dword [ebp - 0xe0], 0x4e
mov dword [ebp - 0xdc], 0x10
mov dword [ebp - 0xd8], 6
mov dword [ebp - 0xd4], 0x44
mov dword [ebp - 0xd0], 0x10
mov dword [ebp - 0xcc], 7
mov dword [ebp - 0xc8], 0x4e
mov dword [ebp - 0xc4], 0x11
mov dword [ebp - 0xc0], 2
mov dword [ebp - 0xbc], 0xc
mov dword [ebp - 0xb8], 0x11
mov dword [ebp - 0xb4], 6
mov dword [ebp - 0xb0], 0x44
mov dword [ebp - 0xac], 0x12
mov dword [ebp - 0xa8], 2
mov dword [ebp - 0xa4], 0xc
mov dword [ebp - 0xa0], 0x12
mov dword [ebp - 0x9c], 6
mov dword [ebp - 0x98], 0x44
push 0x5b4718
push str.c:printm.txt
call dword [sym.imp.MSVCR90.dll_fopen]
add esp, 8
mov dword [ebp - 0x200], eax
cmp dword [ebp - 0x200], 0
jne 0x5014a4
push 0
push 0
push str.open_printm_error
call sub.mfc90.dll_Ordinal_1183
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2bc]
call sub.mfc90.dll_Ordinal_781
jmp 0x501d65
push 0x5b4740
mov ecx, 0x5f8888
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call dword [sym.imp.MSVCR90.dll_fopen]
add esp, 8
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x50150c
push 0
push 0
push str.open_output__error
call sub.mfc90.dll_Ordinal_1183
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2bc]
call sub.mfc90.dll_Ordinal_781
jmp 0x501d65
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x2a4], 0
lea ecx, [ebp - 0x404]
push ecx
mov edx, dword [ebp - 0x200]
push edx
mov ecx, dword [ebp - 0x430]
call fcn.00501d90
push 0x96
push 0
lea eax, [ebp - 0x404]
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
mov ecx, dword [ebp - 0x200]
push ecx
call dword [sym.imp.MSVCR90.dll_feof]
add esp, 4
test eax, eax
jne 0x50157b
lea edx, [ebp - 0x404]
push edx
mov eax, dword [ebp - 0x200]
push eax
mov ecx, dword [ebp - 0x430]
call fcn.00501d90
jmp 0x5015b2
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2bc]
call sub.mfc90.dll_Ordinal_781
jmp 0x501d65
mov ecx, dword [ebp - 0x10]
push ecx
push 1
lea edx, [ebp - 0x404]
push edx
call sub.MSVCR90.dll_strlen
add esp, 4
sub eax, 1
push eax
lea eax, [ebp - 0x403]
push eax
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
mov ecx, dword [ebp - 0x200]
push ecx
call dword [sym.imp.MSVCR90.dll_feof]
add esp, 4
test eax, eax
jne 0x501c9b
push 0x96
push 0
lea edx, [ebp - 0x404]
push edx
call sub.MSVCR90.dll_memset
add esp, 0xc
lea eax, [ebp - 0x404]
push eax
mov ecx, dword [ebp - 0x200]
push ecx
mov ecx, dword [ebp - 0x430]
call fcn.00501d90
mov dword [ebp - 0x2a0], 0
jmp 0x50163d
mov edx, dword [ebp - 0x2a0]
add edx, 1
mov dword [ebp - 0x2a0], edx
lea ecx, [ebp - 0x2bc]
call fcn.00403350
cmp dword [ebp - 0x2a0], eax
jge 0x501798
mov eax, dword [ebp - 0x2a0]
push eax
lea ecx, [ebp - 0x2bc]
call fcn.00415440
push eax
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_817]
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_3178]
test eax, eax
jle 0x501793
mov ecx, dword [ebp - 0x2a0]
mov edx, dword [ebp + ecx*4 - 0x8c]
movsx eax, byte [ebp + edx - 0x403]
cmp eax, 0x20
jne 0x50177c
mov ecx, dword [ebp - 0x2a0]
mov edx, dword [ebp + ecx*4 - 0x8c]
push edx
lea eax, [ebp - 0x403]
push eax
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call fcn.004b95a0
add esp, 0xc
mov dword [ebp - 0x358], eax
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_3178]
cmp eax, dword [ebp - 0x358]
jle 0x501763
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_3178]
sub eax, dword [ebp - 0x358]
push eax
lea ecx, [ebp - 0x41c]
push ecx
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_5997]
mov dword [ebp - 0x434], eax
mov edx, dword [ebp - 0x434]
mov dword [ebp - 0x438], edx
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x438]
push eax
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_817]
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x41c]
call dword [sym.imp.mfc90.dll_Ordinal_601]
lea ecx, [ebp - 0x2a8]
push ecx
mov edx, dword [ebp - 0x2a0]
push edx
lea ecx, [ebp - 0x2bc]
call fcn.004154b0
jmp 0x50177a
push 0x5b3ac6
mov eax, dword [ebp - 0x2a0]
push eax
lea ecx, [ebp - 0x2bc]
call fcn.00415470
jmp 0x501793
push 0x5b3ac7
mov ecx, dword [ebp - 0x2a0]
push ecx
lea ecx, [ebp - 0x2bc]
call fcn.00415470
jmp 0x50162e
movsx ecx, byte [ebp - 0x404]
sub ecx, 0x30
mov edx, dword [ebp - 0x14]
imul edx, edx, 0xc
mov eax, dword [ebp + edx - 0x1fc]
cdq
mov esi, 0xa
idiv esi
cmp ecx, edx
jne 0x501c40
cmp dword [ebp - 0x14], 0x1e
jge 0x501c40
mov eax, dword [ebp - 0x14]
imul eax, eax, 0xc
mov ecx, dword [ebp + eax - 0x1fc]
mov dword [ebp - 0x90], ecx
cmp dword [ebp - 0x90], 0xc
jne 0x501a07
push 0x96
push 0
lea edx, [ebp - 0x354]
push edx
call sub.MSVCR90.dll_memset
add esp, 0xc
push 0x96
push 0
lea eax, [ebp - 0x29c]
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
lea ecx, [ebp - 0x29c]
push ecx
mov edx, dword [ebp - 0x200]
push edx
mov ecx, dword [ebp - 0x430]
call fcn.00501d90
lea eax, [ebp - 0x404]
push eax
lea ecx, [ebp - 0x354]
push ecx
call fcn.00429550
add esp, 8
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x414], edx
mov dword [ebp - 0x418], 0xc
jmp 0x501868
mov eax, dword [ebp - 0x418]
add eax, 1
mov dword [ebp - 0x418], eax
mov ecx, dword [ebp - 0x430]
mov edx, dword [ebp - 0x418]
cmp edx, dword [ecx + 0xdc70]
jge 0x5019f9
mov eax, dword [ebp - 0x14]
imul eax, eax, 0xc
mov ecx, dword [ebp + eax - 0x1fc]
mov dword [ebp - 0x90], ecx
mov edx, dword [ebp - 0x14]
imul edx, edx, 0xc
mov eax, dword [ebp - 0x90]
cmp eax, dword [ebp + edx - 0x1fc]
jne 0x50194a
mov ecx, dword [ebp - 0x14]
imul ecx, ecx, 0xc
mov edx, dword [ebp + ecx - 0x1f4]
push edx
lea eax, [ebp - 0x403]
push eax
mov ecx, dword [ebp - 0x14]
imul ecx, ecx, 0xc
mov edx, dword [ebp + ecx - 0x1f8]
push edx
mov eax, dword [ebp - 0x418]
push eax
lea ecx, [ebp - 0x420]
push ecx
mov ecx, dword [ebp - 0x430]
add ecx, 0x108
call fcn.0049c660
mov dword [ebp - 0x43c], eax
mov edx, dword [ebp - 0x43c]
mov dword [ebp - 0x440], edx
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x440]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call fcn.004b95a0
add esp, 0xc
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x420]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov eax, dword [ebp - 0x14]
imul eax, eax, 0xc
mov ecx, dword [ebp + eax - 0x1fc]
mov dword [ebp - 0x90], ecx
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
jmp 0x501893
mov eax, dword [ebp - 0x10]
push eax
push 2
push 1
lea ecx, [ebp - 0x410]
push ecx
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
mov edx, dword [ebp - 0x10]
push edx
push 1
lea eax, [ebp - 0x404]
push eax
call sub.MSVCR90.dll_strlen
add esp, 4
sub eax, 1
push eax
lea ecx, [ebp - 0x403]
push ecx
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
mov edx, dword [ebp - 0x10]
push edx
push 2
push 1
lea eax, [ebp - 0x410]
push eax
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
mov ecx, dword [ebp - 0x10]
push ecx
push 1
lea edx, [ebp - 0x29c]
push edx
call sub.MSVCR90.dll_strlen
add esp, 4
sub eax, 1
push eax
lea eax, [ebp - 0x29b]
push eax
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x2a4], ecx
mov edx, dword [ebp - 0x414]
mov dword [ebp - 0x14], edx
lea eax, [ebp - 0x354]
push eax
lea ecx, [ebp - 0x404]
push ecx
call fcn.00429550
add esp, 8
jmp 0x501859
mov edx, dword [ebp - 0x2a4]
mov dword [ebp - 0x14], edx
jmp 0x501c40
mov eax, dword [ebp - 0x14]
imul eax, eax, 0xc
mov ecx, dword [ebp - 0x90]
cmp ecx, dword [ebp + eax - 0x1fc]
jne 0x501c40
cmp dword [ebp - 0x90], 0x10
jl 0x501ac6
mov edx, dword [ebp - 0x14]
imul edx, edx, 0xc
mov eax, dword [ebp + edx - 0x1f4]
push eax
lea ecx, [ebp - 0x403]
push ecx
mov edx, dword [ebp - 0x14]
imul edx, edx, 0xc
mov eax, dword [ebp + edx - 0x1f8]
push eax
mov ecx, dword [ebp - 0x14]
imul ecx, ecx, 0xc
mov edx, dword [ebp - 0x430]
mov eax, dword [edx + 0xdc70]
mov ecx, dword [ebp + ecx - 0x1fc]
lea edx, [eax + ecx - 0x10]
push edx
lea eax, [ebp - 0x424]
push eax
mov ecx, dword [ebp - 0x430]
add ecx, 0x108
call fcn.0049c660
mov dword [ebp - 0x444], eax
mov ecx, dword [ebp - 0x444]
mov dword [ebp - 0x448], ecx
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x448]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call fcn.004b95a0
add esp, 0xc
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x424]
call dword [sym.imp.mfc90.dll_Ordinal_601]
jmp 0x501c1f
mov edx, dword [ebp - 0x14]
imul edx, edx, 0xc
mov eax, dword [ebp + edx - 0x1f8]
push eax
mov ecx, dword [ebp - 0x14]
imul ecx, ecx, 0xc
mov edx, dword [ebp + ecx - 0x1fc]
push edx
lea eax, [ebp - 0x428]
push eax
mov ecx, dword [ebp - 0x430]
add ecx, 0x108
call fcn.0049c660
mov dword [ebp - 0x44c], eax
mov ecx, dword [ebp - 0x44c]
mov dword [ebp - 0x450], ecx
mov byte [ebp - 4], 6
mov edx, dword [ebp - 0x450]
push edx
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_817]
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x428]
call dword [sym.imp.mfc90.dll_Ordinal_601]
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_3178]
test eax, eax
jle 0x501c1f
mov eax, dword [ebp - 0x14]
imul eax, eax, 0xc
mov ecx, dword [ebp + eax - 0x1f4]
push ecx
lea edx, [ebp - 0x403]
push edx
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call fcn.004b95a0
add esp, 0xc
mov dword [ebp - 0x358], eax
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_3178]
cmp eax, dword [ebp - 0x358]
jle 0x501c1f
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_3178]
sub eax, dword [ebp - 0x358]
push eax
lea eax, [ebp - 0x42c]
push eax
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_5997]
mov dword [ebp - 0x454], eax
mov ecx, dword [ebp - 0x454]
mov dword [ebp - 0x458], ecx
mov byte [ebp - 4], 7
mov edx, dword [ebp - 0x458]
push edx
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_817]
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x42c]
call dword [sym.imp.mfc90.dll_Ordinal_601]
lea eax, [ebp - 0x2a8]
push eax
lea ecx, [ebp - 0x2bc]
call fcn.004154f0
mov esi, dword [ebp - 0x14]
imul esi, esi, 0xc
lea ecx, [ebp - 0x2bc]
call fcn.00403350
mov ecx, dword [ebp + esi - 0x1f4]
mov dword [ebp + eax*4 - 0x90], ecx
mov edx, dword [ebp - 0x14]
imul edx, edx, 0xc
mov eax, dword [ebp + edx - 0x1fc]
mov dword [ebp - 0x90], eax
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
jmp 0x501a07
cmp dword [ebp - 0x2a4], 0
jne 0x501c8c
mov edx, dword [ebp - 0x10]
push edx
push 2
push 1
lea eax, [ebp - 0x410]
push eax
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
mov ecx, dword [ebp - 0x10]
push ecx
push 1
lea edx, [ebp - 0x404]
push edx
call sub.MSVCR90.dll_strlen
add esp, 4
sub eax, 1
push eax
lea eax, [ebp - 0x403]
push eax
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
jmp 0x501c96
mov dword [ebp - 0x2a4], 0
jmp 0x5015db
mov ecx, dword [ebp - 0x430]
cmp dword [ecx + 0xdc70], 0x10
jl 0x501cc9
mov edx, dword [ebp - 0x430]
mov eax, dword [edx + 0xdc70]
lea ecx, [eax + eax - 0x1e]
mov edx, 6
sub edx, ecx
mov dword [ebp - 0x90], edx
jmp 0x501cd3
mov dword [ebp - 0x90], 6
mov dword [ebp - 0x2a4], 0
jmp 0x501cee
mov eax, dword [ebp - 0x2a4]
add eax, 1
mov dword [ebp - 0x2a4], eax
mov ecx, dword [ebp - 0x2a4]
cmp ecx, dword [ebp - 0x90]
jge 0x501d16
mov edx, dword [ebp - 0x10]
push edx
push 2
push 1
lea eax, [ebp - 0x368]
push eax
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
jmp 0x501cdf
mov ecx, dword [ebp - 0x200]
push ecx
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x35c]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x2a8]
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2bc]
call sub.mfc90.dll_Ordinal_781
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
mov ecx, dword [ebp - 0x204]
xor ecx, ebp
call fcn.005795a6
mov esp, ebp
pop ebp
ret